⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ixethdb_p.h

📁 有关ARM开发板上的IXP400网络驱动程序的源码以。
💻 H
📖 第 1 页 / 共 3 页
字号:
 */typedef struct{    HashNode *hashBuckets[NUM_BUCKETS];    UINT32 numBuckets;    __lock__ IxOsalFastMutex bucketLocks[NUM_BUCKETS];    HashFunction entryHashFunction;    MatchFunction *matchFunctions;    FreeFunction freeFunction;} HashTable;typedef enum{    IX_ETH_DB_MAC_KEY           = 1,    IX_ETH_DB_MAC_PORT_KEY      = 2,    IX_ETH_DB_MAC_VLAN_KEY      = 3,    IX_ETH_DB_MAC_MASK_PORT_KEY = 4,    IX_ETH_DB_MAX_KEY_INDEX     = 4} IxEthDBSearchKeyType;typedef struct MacTreeNode_t{    __smartpointer__  MacDescriptor *descriptor;    struct MacTreeNode_t *left, *right;    __mempool__ struct MacTreeNode_t *nextFree;} MacTreeNode;typedef IxEthDBStatus (*IxEthDBPortUpdateHandler)(IxEthDBPortId portID, IxEthDBRecordType type);typedef UINT32 (*IxEthDBNoteWriteFn)(MacTreeNode *, void *, UINT32, UINT32);typedef struct {    BOOL updateEnabled;                         /**< TRUE if updates are enabled for port */    BOOL userControlled;                        /**< TRUE if the user has manually used ixEthDBPortUpdateEnableSet */    BOOL treeInitialized;                       /**< TRUE if the NPE has received an initial tree */    IxEthDBPortUpdateHandler updateHandler;     /**< port update handler routine */    void *npeUpdateZone;                        /**< port update memory zone */    void *npeGwUpdateZone;                      /**< port update memory zone for gateways */    void *npeBssidUpdateZone;                   /**< port update memory zone for bssids */    void *vlanUpdateZone;                       /**< port update memory zone for VLAN tables */    MacTreeNode *searchTree;                    /**< internal search tree, in MacTreeNode representation */    BOOL searchTreePendingWrite;                /**< TRUE if searchTree holds a tree pending write to the port */} PortUpdateMethod;typedef struct{    IxEthDBPortId portID;                   /**< port ID */    BOOL enabled;                           /**< TRUE if the port is enabled */    BOOL agingEnabled;                      /**< TRUE if aging on this port is enabled */    BOOL initialized;    IxEthDBPortMap dependencyPortMap;       /**< dependency port map for this port */    PortUpdateMethod updateMethod;          /**< update method structure */    BOOL macAddressUploaded;                /**< TRUE if the MAC address was uploaded into the port */    UINT32 maxRxFrameSize;                  /**< maximum Rx frame size for this port */    UINT32 maxTxFrameSize;                  /**< maximum Rx frame size for this port */        UINT8 bssid[IX_IEEE803_MAC_ADDRESS_SIZE];    __alignment__ UINT8 reserved[2];    UINT32 frameControlDurationID;          /**< Frame Control - Duration/ID WiFi control */        IxEthDBVlanTag vlanTag;                 /**< default VLAN tag for port */    IxEthDBPriorityTable priorityTable;     /**< QoS <=> internal priority mapping */    IxEthDBVlanSet vlanMembership;    IxEthDBVlanSet transmitTaggingInfo;    IxEthDBFrameFilter frameFilter;    IxEthDBTaggingAction taggingAction;        UINT32 npeFrameFilter;    UINT32 npeTaggingAction;        IxEthDBFirewallMode firewallMode;    BOOL srcAddressFilterEnabled;        BOOL stpBlocked;        IxEthDBFeature featureCapability;    IxEthDBFeature featureStatus;        UINT32 ixEthDBTrafficClassAQMAssignments[IX_IEEE802_1Q_QOS_PRIORITY_COUNT];    UINT32 ixEthDBTrafficClassCount;    UINT32 ixEthDBTrafficClassAvailable;    UINT16 fwRecordsCount;    UINT16 wifiRecordsCount;    __lock__ IxOsalMutex npeAckLock;} PortInfo;/* list of port information structures indexed on port Ids */extern IX_ETH_DB_PUBLIC PortInfo ixEthDBPortInfo[IX_ETH_DB_NUMBER_OF_PORTS];typedef enum{    IX_ETH_DB_ADD_FILTERING_RECORD    = 0xFF0001,    IX_ETH_DB_REMOVE_FILTERING_RECORD = 0xFF0002} PortEventType;typedef struct{    UINT32 eventType;    IxEthDBPortId portID;    IxEthDBMacAddr macAddr;    BOOL staticEntry;} PortEvent;typedef struct{    PortEvent queue[EVENT_QUEUE_SIZE];    UINT32 base;    UINT32 length;} PortEventQueue;typedef struct{    IxEthDBPortId portID; /**< originating port */    MacDescriptor *macDescriptors[MAX_ELT_SIZE]; /**< addresses to be synced into db */    UINT32 addressCount; /**< number of addresses */} TreeSyncInfo;typedef struct{    MacTreeNode *nodes[MAX_ELT_SIZE];    UINT32 offsets[MAX_ELT_SIZE];    UINT32 nodeCount;} MacTreeNodeStack;/* Prototypes *//* ----------- Memory management -------------- */IX_ETH_DB_PUBLIC void ixEthDBInitMemoryPools(void);IX_ETH_DB_PUBLIC HashNode* ixEthDBAllocHashNode(void);IX_ETH_DB_PUBLIC void ixEthDBFreeHashNode(HashNode *);IX_ETH_DB_PUBLIC __smartpointer__ MacDescriptor* ixEthDBAllocMacDescriptor(void);IX_ETH_DB_PUBLIC __smartpointer__ MacDescriptor* ixEthDBCloneMacDescriptor(MacDescriptor *macDescriptor);IX_ETH_DB_PUBLIC __smartpointer__ void ixEthDBFreeMacDescriptor(MacDescriptor *);IX_ETH_DB_PUBLIC __smartpointer__ MacTreeNode* ixEthDBAllocMacTreeNode(void);IX_ETH_DB_PUBLIC __smartpointer__ MacTreeNode* ixEthDBCloneMacTreeNode(MacTreeNode *);IX_ETH_DB_PUBLIC __smartpointer__ void ixEthDBFreeMacTreeNode(MacTreeNode *);IX_ETH_DB_PUBLIC void ixEthDBPoolFreeMacTreeNode(MacTreeNode *);IX_ETH_DB_PUBLIC UINT32 ixEthDBSearchTreeUsageGet(MacTreeNode *tree);IX_ETH_DB_PUBLIC int ixEthDBShowMemoryStatus(void);/* Hash Table */IX_ETH_DB_PUBLIC void ixEthDBInitHash(HashTable *hashTable, UINT32 numBuckets, HashFunction entryHashFunction, MatchFunction *matchFunctions, FreeFunction freeFunction);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBAddHashEntry(HashTable *hashTable, void *entry);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBRemoveHashEntry(HashTable *hashTable, int keyType, void *reference);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBSearchHashEntry(HashTable *hashTable, int keyType, void *reference, HashNode **searchResult);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPeekHashEntry(HashTable *hashTable, int keyType, void *reference);IX_ETH_DB_PUBLIC void ixEthDBReleaseHashNode(HashNode *node);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBInitHashIterator(HashTable *hashTable, HashIterator *iterator);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBIncrementHashIterator(HashTable *hashTable, HashIterator *iterator);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBRemoveEntryAtHashIterator(HashTable *hashTable, HashIterator *iterator);IX_ETH_DB_PUBLIC void ixEthDBReleaseHashIterator(HashIterator *iterator);/* API Support */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);IX_ETH_DB_PUBLIC void ixEthDBMaximumFrameSizeAckCallback(IxNpeMhNpeId npeID, IxNpeMhMessage msg);/* DB Core functions */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBInit(void);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBAdd(MacDescriptor *newRecordTemplate, IxEthDBPortMap updateTrigger);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBRemove(MacDescriptor *templateRecord, IxEthDBPortMap updateTrigger);IX_ETH_DB_PUBLIC HashNode* ixEthDBSearch(IxEthDBMacAddr *macAddress, IxEthDBRecordType typeFilter);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPeek(IxEthDBMacAddr *macAddress, IxEthDBRecordType typeFilter);/* Learning support */IX_ETH_DB_PUBLIC UINT32 ixEthDBAddressCompare(UINT8 *mac1, UINT8 *mac2);IX_ETH_DB_PUBLIC BOOL ixEthDBAddressMatch(void *reference, void *entry);IX_ETH_DB_PUBLIC UINT32 ixEthDBEntryXORHash(void *macDescriptor);IX_ETH_DB_PUBLIC UINT32 ixEthDBKeyXORHash(void *macAddress);/* Port updates */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBNPEUpdateHandler(IxEthDBPortId portID, IxEthDBFeature type);IX_ETH_DB_PUBLIC void ixEthDBUpdatePortLearningTrees(IxEthDBPortMap triggerPorts);IX_ETH_DB_PUBLIC void ixEthDBNPEAccessRequest(IxEthDBPortId portID);IX_ETH_DB_PUBLIC void ixEthDBUpdateLock(void);IX_ETH_DB_PUBLIC void ixEthDBUpdateUnlock(void);IX_ETH_DB_PUBLIC MacTreeNode* ixEthDBQuery(MacTreeNode *searchTree, IxEthDBPortMap query, IxEthDBRecordType recordFilter, UINT32 maximumEntries);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFirewallUpdate(IxEthDBPortId portID, void *address, UINT32 epDelta);/* Init/unload */IX_ETH_DB_PUBLIC void ixEthDBPortSetAckCallback(IxNpeMhNpeId npeID, IxNpeMhMessage msg);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBEventProcessorInit(void);IX_ETH_DB_PUBLIC void ixEthDBPortInit(IxEthDBPortId portID);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID);IX_ETH_DB_PUBLIC void ixEthDBNPEUpdateAreasInit(void);IX_ETH_DB_PUBLIC UINT32 ixEthDBMatchMethodsRegister(MatchFunction *matchFunctions);IX_ETH_DB_PUBLIC UINT32 ixEthDBRecordSerializeMethodsRegister(void);IX_ETH_DB_PUBLIC UINT32 ixEthDBUpdateTypeRegister(BOOL *typeArray);IX_ETH_DB_PUBLIC void ixEthDBNPEUpdateAreasUnload(void);IX_ETH_DB_PUBLIC void ixEthDBFeatureCapabilityScan(void);IX_ETH_DB_PUBLIC UINT32 ixEthDBKeyTypeRegister(UINT32 *keyType);/* Event processing */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBDefaultEventCallbackEnable(IxEthDBPortId portID, BOOL enable);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBTriggerAddPortUpdate(IxEthDBMacAddr *macAddr, IxEthDBPortId portID, BOOL staticEntry);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBTriggerRemovePortUpdate(IxEthDBMacAddr *macAddr, IxEthDBPortId portID);IX_ETH_DB_PUBLIC void ixEthDBNPEEventCallback(IxNpeMhNpeId npeID, IxNpeMhMessage msg);/* NPE adaptor */IX_ETH_DB_PUBLIC void ixEthDBGetMacDatabaseCbk(IxNpeMhNpeId npeID, IxNpeMhMessage msg);IX_ETH_DB_PUBLIC void ixEthDBNpeMsgAck(IxNpeMhNpeId npeID, IxNpeMhMessage msg);IX_ETH_DB_PUBLIC void ixEthDBNPESyncScan(IxEthDBPortId portID, void *eltBaseAddress, UINT32 eltSize);IX_ETH_DB_PUBLIC void ixEthDBNPETreeWrite(IxEthDBRecordType type, UINT32 totalSize, void *baseAddress, MacTreeNode *tree, UINT32 *blocks, UINT32 *startIndex);IX_ETH_DB_PUBLIC UINT32 ixEthDBNPEGatewayNodeWrite(MacTreeNode*, void*, UINT32, UINT32);IX_ETH_DB_PUBLIC UINT32 ixEthDBNPEBssidNodeWrite(MacTreeNode*, void*, UINT32, UINT32);/* Other public API functions */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBStartLearningFunction(void);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBStopLearningFunction(void);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortUpdateEnableSet(IxEthDBPortId portID, BOOL enableUpdate);/* Maximum Tx/Rx public functions */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortMaximumRxFrameSizeSet(IxEthDBPortId portID, UINT32 maximumRxFrameSize);IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortMaximumTxFrameSizeSet(IxEthDBPortId portID, UINT32 maximumTxFrameSize);/* VLAN-related */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortVlanTableSet(IxEthDBPortId portID, IxEthDBVlanSet portVlanTable, IxEthDBVlanSet vlanSet);/* Record search */IX_ETH_DB_PUBLIC BOOL ixEthDBAddressRecordMatch(void *untypedReference, void *untypedEntry);IX_ETH_DB_PUBLIC BOOL ixEthDBVlanRecordMatch(void *untypedReference, void *untypedEntry);IX_ETH_DB_PUBLIC BOOL ixEthDBPortRecordMatch(void *untypedReference, void *untypedEntry);IX_ETH_DB_PUBLIC BOOL ixEthDBFirewallMaskedRecordMatch(void *untypedReference, void *untypedEntry);IX_ETH_DB_PUBLIC BOOL ixEthDBNullMatch(void *reference, void *entry);IX_ETH_DB_PUBLIC HashNode* ixEthDBPortSearch(IxEthDBMacAddr *macAddress, IxEthDBPortId portID, IxEthDBRecordType typeFilter);IX_ETH_DB_PUBLIC HashNode* ixEthDBVlanSearch(IxEthDBMacAddr *macAddress, IxEthDBVlanId vlanID, IxEthDBRecordType typeFilter);/* Utilities */IX_ETH_DB_PUBLIC const char* mac2string(const unsigned char *mac);IX_ETH_DB_PUBLIC void showHashInfo(void);IX_ETH_DB_PUBLIC int ixEthDBAnalyzeHash(void);IX_ETH_DB_PUBLIC const char* errorString(IxEthDBStatus error);IX_ETH_DB_PUBLIC int numHashElements(void);IX_ETH_DB_PUBLIC void zapHashtable(void);IX_ETH_DB_PUBLIC BOOL ixEthDBCheckSingleBitValue(UINT32 value);/* Single Eth NPE Check */IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBSingleEthNpeCheck(IxEthDBPortId portId);#endif /* IxEthDB_p_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -