📄 ixatmdaccctrl.h
字号:
* transmission will stop so this function must be call sufficently * frequently to ensure no disruption to the transmit operation. * * This function can be used from a timer context, or can be associated * with a TxDone level threshold event (see @a ixAtmdAccTxDoneDispatcherRegister() ), * or can be used inside an active polling mechanism under user control. * * For ease of use the signature of this function is compatible with the * TxDone threshold event callback prototype. * * This functions can be used inside an interrupt context. * * @sa ixAtmdAccTxDoneDispatcherRegister * @sa IxAtmdAccTxVcBufferReturnCallback * @sa ixAtmdAccTxDoneLevelQuery * * @param numberOfPdusToProcess unsigned int [in] - maxiumum number of pdus to remove * from the TX Done queue * @param *numberOfPdusProcessedPtr unsigned int [out] - number of pdus removed from * the TX Done queue. This parameter cannot be a null pointer. * * @return @li IX_SUCCESS the number of pdus as indicated in * numberOfPdusToProcess are removed from the TX Done hardware * and passed to the user through the Tx Done callback registered * during a call to @a ixAtmdAccTxVcConnect() * @return @li IX_FAIL invalid parameters or numberOfPdusProcessedPtr is * a null pointer or some unspecified internal error occured. * */PUBLIC IX_STATUSixAtmdAccTxDoneDispatch (unsigned int numberOfPdusToProcess, unsigned int *numberOfPdusProcessedPtr);/** * * @ingroup IxAtmdAccCtrlAPI * * @fn ixAtmdAccTxDoneLevelQuery (unsigned int *numberOfPdusPtr) * * @brief Query the current number of transmit pdus ready for * recycling. * * This function is used to get the number of transmitted pdus which * the hardware is ready to hand back to user. * * This function can be used from a timer context, or can be associated * with a threshold event, on can be used inside an active polling * mechanism * * @sa ixAtmdAccTxDoneDispatch * * @param *numberOfPdusPtr unsigned int [out] - Pointer to the number of pdus transmitted * at the time of this function call, and ready for recycling * This parameter cannot be a null pointer. * * @return @li IX_SUCCESS numberOfPdusPtr contains the number of pdus * ready for recycling at the time of this function call * * @return @li IX_FAIL wrong parameter (null pointer as parameter).or * unspecified rocessing error occurs..The value in numberOfPdusPtr * is unspecified. * */PUBLIC IX_STATUSixAtmdAccTxDoneLevelQuery (unsigned int *numberOfPdusPtr);/** * * @ingroup IxAtmdAccCtrlAPI * * @fn ixAtmdAccTxDoneQueueSizeQuery (unsigned int *numberOfPdusPtr) * * @brief Query the TxDone queue size. * * This function is used to get the number of pdus which * the hardware is able to store after transmission is complete * * The returned value can be used to set a threshold and enable * a callback to be notified when the number of pdus is going over * the threshold. * * @sa ixAtmdAccTxDoneDispatcherRegister * * @param *numberOfPdusPtr unsigned int [out] - Pointer to the number of pdus the system * is able to queue after transmission * * @return @li IX_SUCCESS numberOfPdusPtr contains the the number of * pdus the system is able to queue after transmission * @return @li IX_FAIL wrong parameter (null pointer as parameter).or * unspecified rocessing error occurs..The value in numberOfPdusPtr * is unspecified. * * @note - This function is reentrant, doesn't use system resources * and can be used from an interrupt context. */PUBLIC IX_STATUSixAtmdAccTxDoneQueueSizeQuery (unsigned int *numberOfPdusPtr);/** * * @ingroup IxAtmdAccCtrlAPI * * @fn ixAtmdAccTxDoneDispatcherRegister (unsigned int numberOfPdus, IxAtmdAccTxDoneDispatcher notificationCallback) * * @brief Configure the Tx Done stream threshold value and register a * callback to handle threshold notifications. * * This function sets the threshold level in term of number of pdus at * which the supplied notification function should be called. * * The higher the threshold value is, the less events will be necessary * to process transmitted buffers. * * Transmitted buffers recycling implementation is a sytem-wide mechanism * and needs to be set prior any traffic is started. If this threshold * mechanism is not used, the user is responsible for polling the * transmitted buffers thanks to @a ixAtmdAccTxDoneDispatch() and * @a ixAtmdAccTxDoneLevelQuery() functions. * * This function should be called during system initialisation outside * an interrupt context * * @sa ixAtmdAccTxDoneDispatcherRegister * @sa ixAtmdAccTxDoneDispatch * @sa ixAtmdAccTxDoneLevelQuery * * @param numberOfPdus unsigned int [in] - The number of TxDone pdus which triggers the * callback invocation This number has to be a power of 2, one of the * values 0,1,2,4,8,16,32 ... * The maximum value cannot be more than half of the txDone queue * size (which can be retrieved using @a ixAtmdAccTxDoneQueueSizeQuery()) * @param notificationCallback @ref IxAtmdAccTxDoneDispatcher [in] - The function to invoke. (This * parameter can be @a ixAtmdAccTxDoneDispatch()).This * parameter ust not be a null pointer. * * @return @li IX_SUCCESS Successful call to ixAtmdAccTxDoneDispatcherRegister * @return @li IX_FAIL error in the parameters: * * @note - The notificationCallback will be called exactly when the threshold level * will increase from (numberOfPdus) to (numberOfPdus+1) * * @note - If there is no Tx traffic, there is no guarantee that TxDone Pdus will * be released to the user (when txDone level is permanently under the threshold * level. One of the preffered way to return resources to the user is to use * a mix of txDone notifications, used together with a slow * rate timer and an exclusion mechanism protecting from re-entrancy * * @note - The TxDone threshold will only hand back buffers when the threshold level is * crossed. Setting this threshold to a great number reduce the interrupt rate * and the cpu load, but also increase the number of outstanding mbufs and has * a system wide impact when these mbufs are needed by other components. * */PUBLIC IX_STATUS ixAtmdAccTxDoneDispatcherRegister (unsigned int numberOfPdus, IxAtmdAccTxDoneDispatcher notificationCallback);/* ------------------------------------------------------ Part of the IxAtmdAcc interface related to Utopia config ------------------------------------------------------ *//** * * @ingroup IxAtmdAccCtrlAPI * * @defgroup IxAtmdAccUtopiaCtrlAPI IXP400 ATM Driver Access (IxAtmdAcc) Utopia Control API * * @brief The public API for the IXP400 Atm Driver Control component * * IxAtmdAcc is the low level interface by which AAL PDU get * transmitted to,and received from the Utopia bus * * This part is related to the UTOPIA configuration. * * @{ *//** * * @brief Utopia configuration * * This structure is used to set the Utopia parameters * @li contains the values of Utopia registers, to be set during initialisation * @li contains debug commands for NPE, to be used during development steps * * @note - the exact description of all parameters is done in the Utopia reference * documents. * */typedef struct{ /** * @ingroup IxAtmdAccUtopiaCtrlAPI * @struct UtTxConfig_ * @brief Utopia Tx Config Register */ struct UtTxConfig_ { unsigned int reserved_1:1; /**< [31] These bits are always 0.*/ unsigned int txInterface:1; /**< [30] Utopia Transmit Interface. The following encoding * is used to set the Utopia Transmit interface as ATM master * or PHY slave: * @li 1 - PHY * @li 0 - ATM */ unsigned int txMode:1; /**< [29] Utopia Transmit Mode. The following encoding is used * to set the Utopia Transmit mode to SPHY or MPHY: * @li 1 - SPHY * @li 0 - MPHY */ unsigned int txOctet:1; /**< [28] Utopia Transmit cell transfer protocol. Used to set * the Utopia cell transfer protocol to Octet-level handshaking. * Note this is only applicable in SPHY mode. * @li 1 - Octet-handshaking enabled * @li 0 - Cell-handshaking enabled */ unsigned int txParity:1; /**< [27] Utopia Transmit parity enabled when set. TxEvenParity * defines the parity format odd/even. * @li 1 - Enable Parity generation. * @li 0 - ut_op_prty held low. */ unsigned int txEvenParity:1; /**< [26] Utopia Transmit Parity Mode * @li 1 - Even Parity Generated. * @li 0 - Odd Parity Generated. */ unsigned int txHEC:1; /**< [25] Header Error Check Insertion Mode. Specifies if the transmit * cell header check byte is calculated and inserted when set. * @li 1 - Generate HEC. * @li 0 - Disable HEC generation. */ unsigned int txCOSET:1; /**< [24] If enabled the HEC is Exclusive-OR芿d with the value 0x55 before * being presented on the Utopia bus. * @li 1 - Enable HEC ExOR with value 0x55 * @li 0 - Use generated HEC value. */ unsigned int reserved_2:1; /**< [23] These bits are always 0 */ unsigned int txCellSize:7; /**< [22:16] Transmit expected cell size. Configures the cell size * for the transmit module: Values between 52-64 are valid. */ unsigned int reserved_3:3; /**< [15:13] These bits are always 0 */ unsigned int txAddrRange:5; /**< [12:8] When configured as an ATM master in MPHY mode this * register specifies the upper limit of the PHY polling logical * range. The number of active PHYs are TxAddrRange + 1. */ unsigned int reserved_4:3; /**< [7:5] These bits are always 0 */ unsigned int txPHYAddr:5; /**< [4:0] When configured as a slave in an MPHY system this register * specifies the physical address of the PHY. */ } utTxConfig; /**< Tx config Utopia register */ /** * @ingroup IxAtmdAccUtopiaCtrlAPI * @struct UtTxStatsConfig_ * @brief Utopia Tx stats Register */ struct UtTxStatsConfig_ { unsigned int vpi:12; /**< [31:20] ATM VPI [11:0] OR GFC [3:0] and VPI [7:0] @li Note: if VCStatsTxGFC is set to 0 the GFC field is ignored in test. */ unsigned int vci:16; /**< [19:4] ATM VCI [15:0] or PHY Address[4] */ unsigned int pti:3; /**< [3:1] ATM PTI [2:0] or PHY Address[3:1] @li Note: if VCStatsTxPTI is set to 0 the PTI field is ignored in test. @li Note: if VCStatsTxEnb is set to 0 only the transmit PHY port address as defined by this register is used for ATM statistics [4:0]. */ unsigned int clp:1; /**< [0] ATM CLP or PHY Address [0] @li Note: if VCStatsTxCLP is set to 0 the CLP field is ignored in test. @li Note: if VCStatsTxEnb is set to 0 only the transmit PHY port address as defined by this register is used for ATM statistics [4:0]. */ } utTxStatsConfig; /**< Tx stats config Utopia register */ /** * @ingroup IxAtmdAccUtopiaCtrlAPI * @struct UtTxDefineIdle_ * @brief Utopia Tx idle cells Register */ struct UtTxDefineIdle_ { unsigned int vpi:12; /**< [31:20] ATM VPI [11:0] OR GFC [3:0] and VPI [7:0] @li Note: if VCIdleTxGFC is set to 0 the GFC field is ignored in test. */ unsigned int vci:16; /**< [19:4] ATM VCI [15:0] */ unsigned int pti:3; /**< [3:1] ATM PTI PTI [2:0] @li Note: if VCIdleTxPTI is set to 0 the PTI field is ignored in test.*/ unsigned int clp:1; /**< [0] ATM CLP [0] @li Note: if VCIdleTxCLP is set to 0 the CLP field is ignored in test.*/ } utTxDefineIdle; /**< Tx idle cell config Utopia register */ /** * @ingroup IxAtmdAccUtopiaCtrlAPI * @struct UtTxEnableFields_ * @brief Utopia Tx ienable fields Register */ struct UtTxEnableFields_ { unsigned int defineTxIdleGFC:1; /**< [31] This register is used to include or exclude the GFC field of the ATM header when testing for Idle cells. @li 1 - GFC field is valid. @li 0 - GFC field ignored.*/ unsigned int defineTxIdlePTI:1; /**< [30] This register is used to include or exclude the PTI field of the ATM header when testing for Idle cells. @li 1 - PTI field is valid @li 0 - PTI field ignored.*/ unsigned int defineTxIdleCLP:1; /**< [29] This register is used to include or exclude the CLP field of the ATM header when testing for Idle cells. @li 1 - CLP field is valid. @li 0 - CLP field ignored. */ unsigned int phyStatsTxEnb:1; /**< [28] This register is used to enable or disable ATM statistics gathering based on the specified PHY address as defined in TxStatsConfig register. @li 1 - Enable statistics for specified transmit PHY address. @li 0 - Disable statistics for specified transmit PHY address. */ unsigned int vcStatsTxEnb:1; /**< [27] This register is used to change the ATM statistics-gathering mode from the specified logical PHY address to a specific VPI/VCI address. @li 1 - Enable statistics for specified VPI/VCI address. @li 0 - Disable statistics for specified VPI/VCI address */ unsigned int vcStatsTxGFC:1; /**< [26] This register is used to include or exclude the GFC field of the ATM header when ATM VPI/VCI statistics are enabled. GFC is only available at the UNI and uses the first 4-bits of the VPI field. @li 1 - GFC field is valid @li 0 - GFC field ignored.*/ unsigned int vcStatsTxPTI:1; /**< [25] This register is used to include or exclude the PTI field of the ATM header when ATM VPI/VCI statistics are enabled. @li 1 - PTI field is valid @li 0 - PTI field ignored.*/ unsigned int vcStatsTxCLP:1; /**< [24] This register is used to include or exclude the CLP field of the ATM header when ATM VPI/VCI statistics are enabled. @li 1 - CLP field is valid @li 0 - CLP field ignored. */ unsigned int reserved_1:3; /**< [23-21] These bits are always 0 */ unsigned int txPollStsInt:1; /**< [20] Enable the assertion of the ucp_tx_poll_sts condition where there is a change in polling status. @li 1 - ucp_tx_poll_sts asserted whenever there is a change in status @li 0 - ucp_tx_poll_sts asserted if ANY transmit PHY is available */ unsigned int txCellOvrInt:1; /**< [19] Enable TxCellCount overflow CBI Transmit Status condition assertion. @li 1 - If TxCellCountOvr is set assert the Transmit Status Condition. @li 0 - No CBI Transmit Status condition assertion */ unsigned int txIdleCellOvrInt:1; /**< [18] Enable TxIdleCellCount overflow Transmit Status Condition @li 1 - If TxIdleCellCountOvr is set assert the Transmit Status Condition @li 0 - No CBI Transmit Status condition assertion..*/ unsigned int enbIdleCellCnt:1; /**< [17] Enable Transmit Idle Cell Count. @li 1 - Enable count of Idle cells transmitted.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -