/* prepares EthDB for unloading 
Note that this function is fully documented in the main component header file, IxEthDB.h. */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBUnload(void)
/* prepares EthDB for unloading 
Note that this function is fully documented in the main component header file, IxEthDB.h. */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBUnload(void)
{
    IxEthDBPortId portIndex;
    if (!ethDBInitializationComplete)
    {
        return IX_ETH_DB_SUCCESS;
    }
    for (portIndex = 0 ; portIndex < IX_ETH_DB_NUMBER_OF_PORTS ; portIndex++)
    {
        if (ixEthDBPortInfo[portIndex].enabled)
        {
            return IX_ETH_DB_BUSY;
        }
    }
    for (portIndex = 0 ; portIndex < IX_ETH_DB_NUMBER_OF_PORTS ; portIndex++)
    {
        if (ixEthDBPortDefinitions[portIndex].type == IX_ETH_NPE)
        {
            ixOsalMutexDestroy(&ixEthDBPortInfo[portIndex].npeAckLock);
        }
        ixEthDBPortInfo[portIndex].initialized = FALSE;
    }
    ixEthDBStopLearningFunction();
    ixEthDBNPEUpdateAreasUnload();
    ethDBInitializationComplete = FALSE;
    return IX_ETH_DB_SUCCESS;
}