📄 ixethacc.h
字号:
* This mask applies to @a IX_ETHACC_NE_FLAGS and defines if a received * frame is a IPv6 frame. The IP flag is set on Rx direction, depending on * the frame contents. The flag is set when the length/type field of a * received frame is 0x86DD. * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_IPV6MASK (0x1 << 3)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_LINKMASK * * @brief This mask is the link layer protocol indicator * * This mask applies to @a IX_ETHACC_NE_FLAGS. * It reflects the state of a frame as it exits an NPE on the Rx path * or enters an NPE on the Tx path. Its values are as follows: * @li 0x00 - IEEE802.3 - 8802 (Rx) / IEEE802.3 - 8802 (Tx) * @li 0x01 - IEEE802.3 - Ethernet (Rx) / IEEE802.3 - Ethernet (Tx) * @li 0x02 - IEEE802.11 AP -> STA (Rx) / IEEE802.11 STA -> AP (Tx) * @li 0x03 - IEEE802.11 AP -> AP (Rx) / IEEE802.11 AP->AP (Tx) * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_LINKMASK (0x3 << 4)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_STMASK * * @brief This mask defines if a received frame is a Spanning Tree frame. * * This mask applies to @a IX_ETHACC_NE_FLAGS. * On rx direction, it defines if a received if frame is a Spanning Tree frame. * Setting this fkag on transmit direction overrides the port settings * regarding the VLAN options and * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_STMASK (0x1 << 6)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_FILTERMASK * * @brief This bit indicates whether a frame has been filtered by the Rx service. * * This mask applies to @a IX_ETHACC_NE_FLAGS. * Certain frames, which should normally be fully filtered by the NPE to due * the destination MAC address being on the same segment as the Rx port are * still forwarded to the XScale (although the payload is invalid) in order * to learn the MAC address of the transmitting station, if this is unknown. * Normally EthAcc will filter and recycle these framess internally and no * frames with the FILTER bit set will be received by the client. * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_FILTERMASK (0x1 << 7)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_PORTOVERMASK * * @brief This mask defines the rule to transmit a frame * * This mask defines the rule to transmit a frame. When set, a frame * is transmitted to the destination port as set by the macro * @a IX_ETHACC_NE_DESTPORTID. If not set, the destination port * is searched using the destination MAC address. * * @note This flag is meaningful only for multiport Network Engines. * * @sa IX_ETHACC_NE_FLAGS * @sa IX_ETHACC_NE_DESTPORTID * */#define IX_ETHACC_NE_PORTOVERMASK (0x1 << 8)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_TAGMODEMASK * * @brief This mask defines the tagging rules to apply to a transmit frame. * * This mask defines the tagging rules to apply to a transmit frame * regardless of the default setting for a port. When used together * with @a IX_ETHACC_NE_TAGOVERMASK and when set, the * frame will be tagged prior to transmission. When not set, * the frame will be untagged prior to transmission. This is accomplished * irrespective of the Egress tagging rules, constituting a per-frame override. * * @sa IX_ETHACC_NE_FLAGS * @sa IX_ETHACC_NE_TAGOVERMASK * */#define IX_ETHACC_NE_TAGMODEMASK (0x1 << 9)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_TAGOVERMASK * * @brief This mask defines the rule to transmit a frame * * This mask defines the rule to transmit a frame. When set, the * default transmit rules of a port are overriden. * When not set, the default rules as set by @ref IxEthDB should apply. * * @sa IX_ETHACC_NE_FLAGS * @sa IX_ETHACC_NE_TAGMODEMASK * */#define IX_ETHACC_NE_TAGOVERMASK (0x1 << 10)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_LOCALMACMASK * * @brief This mask defines the rule to receive a frame to local mac * * This mask defines the rule to receive a frame to local mac. When set, the * default receive rules of a port are overriden. * When not set, the default rules as set by @ref IxEthDB should apply. * * @sa IX_ETHACC_NE_FLAGS * @sa IX_ETHACC_NE_LOCALMACMASK * */#define IX_ETHACC_NE_LOCALMACMASK (0x1 << 11)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_VLANMASK * * @brief This mask defines if a received frame is VLAN tagged. * * This mask defines if a received frame is VLAN tagged. * When set, the Rx frame is VLAN-tagged and the tag value * is available thru @a IX_ETHACC_NE_VLANID. * Note that when sending frames which are already tagged * this flag should be set, to avoid inserting another VLAN tag. * * @sa IX_ETHACC_NE_FLAGS * @sa IX_ETHACC_NE_VLANID * */#define IX_ETHACC_NE_VLANMASK (0x1 << 13)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_VLANENABLEMASK * * @brief This mask defines if a frame is a VLAN frame or not * * When set, frames undergo normal VLAN processing on the Tx path * (membership filtering, tagging, tag removal etc). If this flag is * not set, the frame is considered to be a regular non-VLAN frame * and no VLAN processing will be performed. * * Note that VLAN-enabled NPE images will always set this flag in all * Rx frames, and images which are not VLAN enabled will clear this * flag for all received frames. * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_VLANENABLEMASK (0x1 << 14)/** * @ingroup IxEthAcc * * @def IX_ETHACC_NE_NEWSRCMASK * * @brief This mask defines if a received frame has been learned. * * This mask defines if the source MAC address of a frame is * already known. If the bit is set, the source MAC address was * unknown to the NPE at the time the frame was received. * * @sa IX_ETHACC_NE_FLAGS * */#define IX_ETHACC_NE_NEWSRCMASK (0x1 << 15)/** * @ingroup IxEthAcc * * @brief This defines the recommanded minimum size of MBUF's submitted * to the frame receive service. * */#define IX_ETHACC_RX_MBUF_MIN_SIZE (2048)/** * @ingroup IxEthAcc * * @brief This defines the highest MII address of any attached PHYs * * The maximum number for PHY address is 31, add on for range checking. * */#define IXP400_ETH_ACC_MII_MAX_ADDR (32)/** * @ingroup IxEthAcc * * @brief This defines the highest MII address of any attached PHYs * * The maximum number for PHY address is 31, add on for range checking. * This is maintained to provide backward compatibility. It will be * deprecated in future release. * */#define IXP425_ETH_ACC_MII_MAX_ADDR (IXP400_ETH_ACC_MII_MAX_ADDR)/** * @ingroup IxEthAcc * * @fn ixEthAccInit(void) * * @brief Initializes the Intel (R) IXP400 Software Ethernet Access Service. * * @li Reentrant - yes * @li ISR Callable - no * * This should be called once per module initialization. Secord call to this function yields SUCCESS. * @pre * The NPE must first be downloaded with the required microcode which supports all * required features. * * @return IxEthAccStatus * @li @a IX_ETH_ACC_SUCCESS : Init Done successfully or already initialized * @li @a IX_ETH_ACC_FAIL : Service has failed to initialize - EthDB, Dataplane, MII, MemInit, Mutex Init. * * <hr> */PUBLIC IxEthAccStatus ixEthAccInit(void);/** * @ingroup IxEthAcc * * @fn ixEthAccUninit(void) * * @brief Un-Initializes the Intel (R) IXP400 Software Ethernet Access Service. * * @li Reentrant - no * @li ISR Callable - no * * This should be called once per module Un-initialization. * * @return IxEthAccStatus * @li @a IX_ETH_ACC_SUCCESS * @li @a IX_ETH_ACC_FAIL : Service has failed to Un-initialize. * * <hr> */PUBLIC IxEthAccStatusixEthAccUninit (void);/** * @ingroup IxEthAcc * * @fn ixEthAccPortInit( IxEthAccPortId portId) * * @brief Initializes an NPE/Ethernet MAC Port. * * The NPE/Ethernet port initialisation includes the following steps * @li Initialize the NPE/Ethernet MAC hardware. * @li Verify NPE downloaded and operational. * @li The NPE shall be available for usage once this API returns. * @li Verify that the Ethernet port is present before initializing * * @li Reentrant - no * @li ISR Callable - no * * This should be called once per mac device. * The NPE/MAC shall be in disabled state after init. * * @pre * The component must be initialized via @a ixEthAccInit * The NPE must first be downloaded with the required microcode which supports all * required features. * * Dependant on Services: (Must be initialized before using this service may be initialized) * ixNPEmh - NPE Message handling service. * ixQmgr - Queue Manager component. * * @param portId @ref IxEthAccPortId [in] * * @return IxEthAccStatus * @li @a IX_ETH_ACC_SUCCESS: if the ethernet port is not present, a warning is issued. * @li @a IX_ETH_ACC_FAIL : The NPE processor has failed to initialize. * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid. * * <hr> */PUBLIC IxEthAccStatus ixEthAccPortInit(IxEthAccPortId portId);/************************************************************************* ##### ## ##### ## ##### ## ##### # # # # # # # # # # # # # # # # # # # # # # # # # # # # ###### # # ###### # ###### ##### ###### # # # # # # # # # # # # # # # # ##### # # # # # # # # # # #*************************************************************************//** * @ingroup IxEthAcc * * @fn ixEthAccPortTxFrameSubmit( IxEthAccPortId portId, IX_OSAL_MBUF *buffer, IxEthAccTxPriority priority) * * @brief This function shall be used to submit MBUFs buffers for transmission on a particular MAC device. * * When the frame is transmitted, the buffer shall be returned thru the * callback @a IxEthAccPortTxDoneCallback. * * In case of over-submitting, the order of the frames on the * network may be modified. * * Buffers shall be not queued for transmission if the port is disabled. * The port can be enabled using @a ixEthAccPortEnable * * * @li Reentrant - yes * @li ISR Callable - yes * * * @pre * @a ixEthAccPortTxDoneCallbackRegister must be called to register a function to allow this service to * return the buffer to the calling service. * * @note * If the buffer submit fails for any reason the user has retained ownership of the buffer. * * @param portId @ref IxEthAccPortId [in] - MAC port ID to transmit Ethernet frame on. * @param buffer @ref IX_OSAL_MBUF [in] - pointer to an MBUF formatted buffer. Chained buffers are supported for transmission. * Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is ignored. * @param priority @ref IxEthAccTxPriority [in] * * @return IxEthAccStatus * @li @a IX_ETH_ACC_SUCCESS * @li @a IX_ETH_ACC_FAIL : Failed to queue frame for transmission. * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid. * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized * * <hr> */PUBLIC IxEthAccStatus ixEthAccPortTxFrameSubmit( IxEthAccPortId portId, IX_OSAL_MBUF *buffer, IxEthAccTxPriority priority);/** * @ingroup IxEthAcc * * @brief Function prototype for Ethernet Tx Buffer Done callback. Registered * via @a ixEthAccTxBufferDoneCallbackRegister * * This function is called once the previously submitted buffer is no longer required by this service. * It may be returned upon successful transmission of the frame or during the shutdown of * the port prior to the transmission of a queued frame. * The calling of this registered function is not a guarantee of successful transmission of the buffer. * * * @li Reentrant - yes , The user provided function should be reentrant. * @li ISR Callable - yes , The user provided function must be callable from an ISR. * * * <b>Calling Context </b>: * @par * This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread. * The decision is system specific. * * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC * via @a ixEthAccPortTxDoneCallbackRegister. It allows the same callback to be used for multiple MACs. * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Tx mbuf descriptor. * * @return void
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -