📄 xemacps_bd.h
字号:
* * @note * C-style signature: * u32 XEmacPs_BdIsRxWrap(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxWrap(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & \ XEMACPS_RXBUF_WRAP_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Sets this bit to mark the last descriptor in the transmit buffer * descriptor list. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * void XEmacPs_BdSetTxWrap(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdSetTxWrap(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_STAT_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) | \ XEMACPS_TXBUF_WRAP_MASK))/*****************************************************************************//** * Determine the wrap bit of the transmit BD which indicates end of the * BD list. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdGetTxWrap(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsTxWrap(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_TXBUF_WRAP_MASK) ? TRUE : FALSE)/*****************************************************************************//* * Must clear this bit to enable the MAC to write data to the receive * buffer. Hardware sets this bit once it has successfully written a frame to * memory. Once set, software has to clear the bit before the buffer can be * used again. This macro clear the new bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * void XEmacPs_BdClearRxNew(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdClearRxNew(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_ADDR_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & \ ~XEMACPS_RXBUF_NEW_MASK))/*****************************************************************************//** * Determine the new bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxNew(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxNew(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & \ XEMACPS_RXBUF_NEW_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Software sets this bit to disable the buffer to be read by the hardware. * Hardware sets this bit for the first buffer of a frame once it has been * successfully transmitted. This macro sets this bit of transmit BD to avoid * confusion. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * void XEmacPs_BdSetTxUsed(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdSetTxUsed(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_STAT_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) | \ XEMACPS_TXBUF_USED_MASK))/*****************************************************************************//** * Software clears this bit to enable the buffer to be read by the hardware. * Hardware sets this bit for the first buffer of a frame once it has been * successfully transmitted. This macro clears this bit of transmit BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * void XEmacPs_BdClearTxUsed(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdClearTxUsed(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_STAT_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ ~XEMACPS_TXBUF_USED_MASK))/*****************************************************************************//** * Determine the used bit of the transmit BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsTxUsed(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsTxUsed(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_TXBUF_USED_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if a frame fails to be transmitted due to too many retries. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsTxRetry(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsTxRetry(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_TXBUF_RETRY_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if a frame fails to be transmitted due to data can not be * feteched in time or buffers are exhausted. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsTxUrun(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsTxUrun(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_TXBUF_URUN_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if a frame fails to be transmitted due to buffer is exhausted * mid-frame. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsTxExh(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsTxExh(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_TXBUF_EXH_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Sets this bit, no CRC will be appended to the current frame. This control * bit must be set for the first buffer in a frame and will be ignored for * the subsequent buffers of a frame. * * @param BdPtr is the BD pointer to operate on * * @note * This bit must be clear when using the transmit checksum generation offload, * otherwise checksum generation and substitution will not occur. * * C-style signature: * u32 XEmacPs_BdSetTxNoCRC(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdSetTxNoCRC(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_STAT_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) | \ XEMACPS_TXBUF_NOCRC_MASK))/*****************************************************************************//** * Clear this bit, CRC will be appended to the current frame. This control * bit must be set for the first buffer in a frame and will be ignored for * the subsequent buffers of a frame. * * @param BdPtr is the BD pointer to operate on * * @note * This bit must be clear when using the transmit checksum generation offload, * otherwise checksum generation and substitution will not occur. * * C-style signature: * u32 XEmacPs_BdClearTxNoCRC(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdClearTxNoCRC(BdPtr) \ (XEmacPs_BdWrite((BdPtr), XEMACPS_BD_STAT_OFFSET, \ XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ ~XEMACPS_TXBUF_NOCRC_MASK))/*****************************************************************************//** * Determine the broadcast bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxBcast(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxBcast(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_BCAST_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine the multicast hash bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxMultiHash(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxMultiHash(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_MULTIHASH_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine the unicast hash bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxUniHash(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxUniHash(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_UNIHASH_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if the received frame is a VLAN Tagged frame. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxVlan(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxVlan(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_VLAN_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if the received frame has Type ID of 8100h and null VLAN * identifier(Priority tag). * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxPri(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxPri(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_PRI_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine if the received frame's Concatenation Format Indicator (CFI) of * the frames VLANTCI field was set. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdIsRxCFI(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxCFI(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_CFI_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine the End Of Frame (EOF) bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdGetRxEOF(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxEOF(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_EOF_MASK) ? TRUE : FALSE)/*****************************************************************************//** * Determine the Start Of Frame (SOF) bit of the receive BD. * * @param BdPtr is the BD pointer to operate on * * @note * C-style signature: * u32 XEmacPs_BdGetRxSOF(XEmacPs_Bd* BdPtr) * *****************************************************************************/#define XEmacPs_BdIsRxSOF(BdPtr) \ ((XEmacPs_BdRead((BdPtr), XEMACPS_BD_STAT_OFFSET) & \ XEMACPS_RXBUF_SOF_MASK) ? TRUE : FALSE)/************************** Function Prototypes ******************************/#ifdef __cplusplus}#endif#endif /* end of protection macro */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -