MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
NETC driver

Overview

The MCUXpresso SDK provides a driver for the NETC module. The NETC driver is designed in 2 layers:

Modules

 API layer
 
 Abbreviation in NETC driver
 
 Hardware layer
 

Data Structures

struct  netc_vlan_t
 VLAN tag struct. More...
 
struct  netc_buffer_struct_t
 Buffer structure. More...
 
struct  netc_frame_struct_t
 Frame structure for single Tx/Rx frame. More...
 
struct  netc_frame_attr_t
 Frame attribute struct. More...
 
struct  netc_tx_frame_info_t
 Frame attribute structure. More...
 
struct  netc_msix_entry_t
 NETC MSIX entry structure. More...
 

Macros

#define FSL_NETC_DRIVER_VERSION   (MAKE_VERSION(2, 7, 0))
 Driver Version.
 
#define NETC_ADDR_LOW_32BIT(x)   ((uint32_t)(x)&0xFFFFFFFFU)
 Macro to divides an address into a low 32 bits and a possible high 32 bits.
 

Enumerations

enum  {
  kStatus_NETC_RxFrameEmpty = MAKE_STATUS(kStatusGroup_NETC, 0),
  kStatus_NETC_RxTsrResp = MAKE_STATUS(kStatusGroup_NETC, 1),
  kStatus_NETC_RxFrameError = MAKE_STATUS(kStatusGroup_NETC, 2),
  kStatus_NETC_TxFrameOverLen = MAKE_STATUS(kStatusGroup_NETC, 3),
  kStatus_NETC_LackOfResource,
  kStatus_NETC_Unsupported = MAKE_STATUS(kStatusGroup_NETC, 5),
  kStatus_NETC_RxHRZeroFrame = MAKE_STATUS(kStatusGroup_NETC, 6),
  kStatus_NETC_RxHRNotZeroFrame = MAKE_STATUS(kStatusGroup_NETC, 7),
  kStatus_NETC_NotFound = MAKE_STATUS(kStatusGroup_NETC, 8),
  kStatus_NETC_EntryExists = MAKE_STATUS(kStatusGroup_NETC, 9)
}
 Status code for the NETC module. More...
 
enum  netc_ep_event_t {
  kNETC_EPRxEvent,
  kNETC_EPTxEvent
}
 Defines the common interrupt event for callback use. More...
 
enum  netc_ep_tx_status_t {
  kNETC_EPTxSuccess = 0x0,
  kNETC_EPTxProgramErr = 0x1,
  kNETC_EPTxTsdDrop = 0x2,
  kNETC_EPTxFrameSizeErr = 0x8,
  kNETC_EPTxNullAddr = 0x9,
  kNETC_EPTxInvalidLength = 0xA,
  kNETC_EPTxSrcMacSpoofingDetect = 0x10,
  kNETC_EPTxPortRestDrop = 0x20,
  kNETC_EPTxPortDisableDrop = 0x21,
  kNETC_EPTxVlanTpidDrop = 0x40,
  kNETC_EPTxSmsoParamErr = 0x60,
  kNETC_EPTxFrameGateErr = 0x80,
  kNETC_EPTxAxiReadErr = 0x90,
  kNETC_EPTxAxiWriteErr = 0x91,
  kNETC_EPTxMultiBitECCErr = 0xA0,
  kNETC_EPTxParityErr = 0xF0,
  kNETC_EPTxSwCongestion = 0x100
}
 Status for the transmit buffer descriptor. More...
 
enum  netc_vlan_tpid_select_t {
  kNETC_StanCvlan = 0x0U,
  kNETC_StanSvlan,
  kNETC_CustomVlan1,
  kNETC_CustomVlan2
}
 Ethernet VLAN Tag protocol identifier. More...
 
enum  netc_packet_type_t
 Ethernet packet type enumerator.
 
enum  netc_host_reason_t
 Host reason.
 
enum  netc_msix_vector_ctrl_t { kNETC_MsixIntrMaskBit = 1U }
 MSIX vector control field. More...
 
enum  netc_tx_ext_flags_t {
  kNETC_TxExtVlanInsert = 0x1,
  kNETC_TxExtTwoStepTs = 0x1 << 2U
}
 METC Extension Transmit Buffer Descriptor Extension flags field. More...
 

Data Structure Documentation

struct netc_vlan_t

Data Fields

uint32_t vid: 12
 Vlan Identifier. More...
 
uint32_t dei: 1
 Drop Eligible indicator. More...
 
uint32_t pcp: 3
 Priority. More...
 
uint32_t tpid: 16
 Tag protocol identifier. More...
 

Field Documentation

uint32_t netc_vlan_t::vid
uint32_t netc_vlan_t::dei
uint32_t netc_vlan_t::pcp
uint32_t netc_vlan_t::tpid
struct netc_buffer_struct_t

Driver can send/receive one frame spread across multiple buffers

Data Fields

void * buffer
 Buffer address. More...
 
uint16_t length
 Buffer data length. More...
 

Field Documentation

void* netc_buffer_struct_t::buffer
uint16_t netc_buffer_struct_t::length
struct netc_frame_struct_t

Data Fields

netc_buffer_struct_tbuffArray
 Buffer array. More...
 
uint16_t length
 Buffer array length. More...
 

Field Documentation

netc_buffer_struct_t* netc_frame_struct_t::buffArray

Tx: [in]App sets, Rx: [in/out]App sets prepared array, driver sets back received buffers array.

uint16_t netc_frame_struct_t::length

Tx: [in]App sets, Rx: [in/out]App sets prepared array length, driver sets back received buffers array length.

struct netc_frame_attr_t

Data Fields

bool isTsAvail
 Rx frame timestamp is available or not. More...
 
bool isVlanExtracted
 Rx frame VLAN header is available or not. More...
 
uint32_t timestamp
 The timestamp of this Rx frame. More...
 

Field Documentation

bool netc_frame_attr_t::isTsAvail
bool netc_frame_attr_t::isVlanExtracted
uint32_t netc_frame_attr_t::timestamp
struct netc_tx_frame_info_t

Data Fields

bool isTsAvail
 Tx frame timestamp is available or not. More...
 
uint32_t timestamp
 The timestamp of this Tx frame, valid when isTsAvail is true. More...
 
bool isTxTsIdAvail
 Switch port Tx frame timestamp Identifier is available or not. More...
 
uint16_t txtsid
 The Transmit Timestamp Identifier, valid when isTsIdAvail is true, use for Switch management ENETC direct frame which has specified a timestamp request. More...
 
void * context
 Private context provided by the user. More...
 
netc_ep_tx_status_t status
 Transmit status. More...
 

Field Documentation

bool netc_tx_frame_info_t::isTsAvail
uint32_t netc_tx_frame_info_t::timestamp
bool netc_tx_frame_info_t::isTxTsIdAvail
uint16_t netc_tx_frame_info_t::txtsid
void* netc_tx_frame_info_t::context
netc_ep_tx_status_t netc_tx_frame_info_t::status
struct netc_msix_entry_t

Data Fields

uint64_t msgAddr
 Message address. More...
 
uint32_t msgData
 Message data. More...
 
uint32_t control
 Vector control, netc_msix_vector_ctrl_t. More...
 

Field Documentation

uint64_t netc_msix_entry_t::msgAddr
uint32_t netc_msix_entry_t::msgData
uint32_t netc_msix_entry_t::control

Enumeration Type Documentation

anonymous enum
Enumerator
kStatus_NETC_RxFrameEmpty 

Rx BD ring empty.

kStatus_NETC_RxTsrResp 

Rx timestamp reference response.

kStatus_NETC_RxFrameError 

Rx frame error.

kStatus_NETC_TxFrameOverLen 

Tx frame over length.

kStatus_NETC_LackOfResource 

Lack of resources to configure certain features.

kStatus_NETC_Unsupported 

Unsupported operation/feature.

kStatus_NETC_RxHRZeroFrame 

Rx frame host reason is zero.

kStatus_NETC_RxHRNotZeroFrame 

Rx frame host reason is not zero.

kStatus_NETC_NotFound 

No entry found in hardware tables.

kStatus_NETC_EntryExists 

An entry already exists in hardware tables.

Enumerator
kNETC_EPRxEvent 

EP Rx interrupt event.

kNETC_EPTxEvent 

EP Tx interrupt event.

Enumerator
kNETC_EPTxSuccess 

Success transmission.

kNETC_EPTxProgramErr 

Error exists in either the Tx BD, the Tx ring registers, or both.

kNETC_EPTxTsdDrop 

The time defined in TX_START expired before frame could be transmitted.

kNETC_EPTxFrameSizeErr 

Frame size error.

kNETC_EPTxNullAddr 

Null address.

kNETC_EPTxInvalidLength 

Invalid frame/buffer/chain length.

kNETC_EPTxSrcMacSpoofingDetect 

Source MAC address spoofing detected.

kNETC_EPTxPortRestDrop 

Frame dropped due to port reset.

kNETC_EPTxPortDisableDrop 

Frame dropped due to port disable.

kNETC_EPTxVlanTpidDrop 

VLAN TPID not allowed.

kNETC_EPTxSmsoParamErr 

Programming error in buffer descriptor used for direct switch enqueue.

kNETC_EPTxFrameGateErr 

Frame too large for time gating window.

kNETC_EPTxAxiReadErr 

AXI read error.

kNETC_EPTxAxiWriteErr 

AXI write error.

kNETC_EPTxMultiBitECCErr 

Frame not transmitted(dropped) due to a multi-bit ECC error detected.

kNETC_EPTxParityErr 

Parity error.

kNETC_EPTxSwCongestion 

Frame dropped due to switch congestion.

Enumerator
kNETC_StanCvlan 

0x8100.

kNETC_StanSvlan 

0x88A8.

kNETC_CustomVlan1 

CVLANR1[ETYPE].

kNETC_CustomVlan2 

CVLANR2[ETYPE].

Enumerator
kNETC_MsixIntrMaskBit 

MSIX vector control interrupt mask bit.

Enumerator
kNETC_TxExtVlanInsert 

Enable VLAN insert.

kNETC_TxExtTwoStepTs 

Enable two-step timestamp offload.