?? ixethdb.h
字號:
* * @fn IxEthDBStatus ixEthDBUnload(void) * * @brief Stops and prepares the EthDB component for unloading. * * @retval IX_ETH_DB_SUCCESS de-initialization was successful * @retval IX_ETH_DB_BUSY de-initialization failed, ports must be disabled first * @retval IX_ETH_DB_FAIL de-initialization failed (OS error) */IX_ETH_DB_PUBLICIxEthDBStatus ixEthDBUnload(void);/** * @ingroup IxEthDB * * @fn void ixEthDBPortInit(IxEthDBPortId portID) * * @brief Initializes a port * * This function is called automatically by the Ethernet Access * ixEthAccPortInit() routine for Ethernet NPE ports and should be manually * called for any user-defined port (any port that is not one of * the two Ethernet NPEs). * * @param portID @ref IxEthDBPortId [in] - ID of the port to be initialized * * @see IxEthDBPortDefs.h for port definitions * * @note calling this function multiple times does not constitute an error; * redundant calls will be ignored */IX_ETH_DB_PUBLIC void ixEthDBPortInit(IxEthDBPortId portID);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID) * * @brief Enables a port * * This function is called automatically from the Ethernet Access component * ixEthAccPortEnable() routine for Ethernet NPE ports and should be manually * called for any user-defined port (any port that is not one of * the Ethernet NPEs). * * @param portID @ref IxEthDBPortId [in] - ID of the port to enable processing on * * @retval IX_ETH_DB_SUCCESS if enabling is successful * @retval IX_ETH_DB_FAIL if the enabling was not successful due to * a message handler error * @retval IX_ETH_DB_MAC_UNINITIALIZED the MAC address of this port was * not initialized (only for Ethernet NPEs) * @retval IX_ETH_DB_INVALID_PORT if portID is invalid * * @pre ixEthDBPortAddressSet needs to be called prior to enabling the port events * for Ethernet NPEs * * @see ixEthDBPortAddressSet * * @see IxEthDBPortDefs.h for port definitions * * @note calling this function multiple times does not constitute an error; * redundant calls will be ignored */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID) * * @brief Disables processing on a port * * This function is called automatically from the Ethernet Access component * ixEthAccPortDisable() routine for Ethernet NPE ports and should be manually * called for any user-defined port (any port that is not one of * the Ethernet NPEs). * * @note Calling ixEthAccPortDisable() will disable the respective Ethernet NPE. * After Ethernet NPEs are disabled they are stopped therefore * when re-enabled they need to be reset, downloaded with microcode and started. * For learning to restart working the user needs to call again * ixEthAccPortUnicastMacAddressSet or ixEthDBUnicastAddressSet * with the respective port MAC address. * Residual MAC addresses learnt before the port was disabled are deleted as soon * as the port is disabled. This only applies to dynamic (learnt) entries, static * entries do not dissapear when the port is disabled. * * @param portID @ref IxEthDBPortId [in] - ID of the port to disable processing on * * @retval IX_ETH_DB_SUCCESS if disabling is successful * @retval IX_ETH_DB_FAIL if the disabling was not successful due to * a message handler error * @retval IX_ETH_DB_INVALID_PORT if portID is invalid * * @note calling this function multiple times after the first time completed successfully * does not constitute an error; redundant calls will be ignored and return IX_ETH_DB_SUCCESS*/IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr) * * @brief Sets the port MAC address * * This function is to be called from the Ethernet Access component top-level * ixEthDBUnicastAddressSet(). Event processing cannot be enabled for a port * until its MAC address has been set. * * @param portID @ref IxEthDBPortId [in] - ID of the port whose MAC address is set * @param macAddr @ref IxEthDBMacAddr [in] - port MAC address * * @retval IX_ETH_DB_SUCCESS MAC address was set successfully * @retval IX_ETH_DB_FAIL MAC address was not set due to a message handler failure * @retval IX_ETH_DB_INVALID_PORT if the port is not an Ethernet NPE * * @see IxEthDBPortDefs.h for port definitions */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize) * * @brief Set the maximum frame size supported on the given port ID * * This functions set the maximum frame size supported on a specific port ID * * - Reentrant - yes * - ISR Callable - no * * @param portID @ref IxEthDBPortId [in] - port ID to configure * @param maximumFrameSize UINT32 [in] - maximum frame size to configure * * @retval IX_ETH_DB_SUCCESS the port is configured * @retval IX_ETH_DB_PORT_UNINITIALIZED the port has not been initialized * @retval IX_ETH_DB_INVALID_PORT portID is invalid * @retval IX_ETH_DB_INVALID_ARG size parameter is out of range * @retval IX_ETH_DB_NO_PERMISSION selected port is not an Ethernet NPE * @retval IX_FAIL unknown OS or NPE communication error * * @note * This maximum frame size is used to filter the frames based on their * destination addresses and the capabilities of the destination port. * The mximum value that can be set for a NPE port is 16320. * (IX_ETHNPE_ACC_FRAME_LENGTH_MAX) */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr) * * @brief Populate the Ethernet learning/filtering database with a static MAC address * * Populates the Ethernet learning/filtering database with a static MAC address. The entry will not be subject to aging. * If there is an entry (static or dynamic) with the corresponding MAC address on any port this entry will take precedence. * Any other entry with the same MAC address will be removed. * * - Reentrant - yes * - ISR Callable - yes * * @param portID @ref IxEthDBPortId [in] - port ID to add the static address to * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add * * @retval IX_ETH_DB_SUCCESS the add was successful * @retval IX_ETH_DB_FAIL failed to populate the database entry * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later * @retval IX_ETH_DB_INVALID_PORT portID is invalid * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr) * * @brief Populate the Ethernet learning/filtering database with a dynamic MAC address * * Populates the Ethernet learning/filtering database with a dynamic MAC address. This entry will be subject to normal * aging function, if aging is enabled on its port. * If there is an entry (static or dynamic) with the same MAC address on any port this entry will take precedence. * Any other entry with the same MAC address will be removed. * * - Reentrant - yes * - ISR Callable - yes * * @param portID @ref IxEthDBPortId [in] - port ID to add the dynamic address to * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add * * @retval IX_ETH_DB_SUCCESS the add was successful * @retval IX_ETH_DB_FAIL failed to populate the database entry * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later * @retval IX_ETH_DB_INVALID_PORT portID is invalid * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringEntryDelete(IxEthDBMacAddr *macAddr) * * @brief Removes a MAC address entry from the Ethernet learning/filtering database * * @param macAddr IxEthDBMacAddr [in] - MAC address to remove * * - Reentrant - yes * - ISR Callable - no * * @retval IX_ETH_DB_SUCCESS the removal was successful * @retval IX_ETH_DB_NO_SUCH_ADDR failed to remove the address (not in the database) * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringEntryDelete(IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringPortSearch(IxEthDBPortId portID, IxEthDBMacAddr *macAddr) * * @brief Search the Ethernet learning/filtering database for the given MAC address and port ID * * This functions searches the database for a specific port ID and MAC address. Both the port ID * and the MAC address have to match in order for the record to be reported as found. * * - Reentrant - yes * - ISR Callable - no * * @param portID @ref IxEthDBPortId [in] - port ID to search for * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for * * @retval IX_ETH_DB_SUCCESS the record exists in the database * @retval IX_ETH_DB_INVALID_ARG invalid macAddr pointer argument * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database * @retval IX_ETH_DB_INVALID_PORT portID is invalid * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortSearch(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringDatabaseSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr) * * @brief Search the Ethernet learning/filtering database for a MAC address and return the port ID * * Searches the database for a MAC address. The function returns the portID for the * MAC address record, if found. If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR. * The portID is only valid if the function finds a match. * * - Reentrant - yes * - ISR Callable - no * * @param portID @ref IxEthDBPortId [in] - port ID the address belongs to (populated only on a successful search) * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for * * @retval IX_ETH_DB_SUCCESS the record exists in the database * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database * @retval IX_ETH_DB_INVALID_ARG invalid macAddr or portID pointer argument(s) */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringDatabaseSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr);/** * @ingroup IxEthDB * * @fn IxEthDBStatus ixEthDBFilteringPortUpdatingSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr) * * @brief Search the filtering database for a MAC address, return the port ID and reset the record age * * Searches the database for a MAC address. The function returns the portID for the * MAC address record and resets the entry age to 0, if found.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -