/* Copyright (C) 2006 Ikanos Communications * See IKANOS_PROP_LICENSE.txt for license information. */ #ifndef _APLIBDEFS_H_ #define _APLIBDEFS_H_ #include #include #include #include #include #ifdef AP_DENY #include #endif /* AP_DENY */ #include #include #ifdef VX185_BONDING #include typedef struct vlanLineDistList_s { struct list_head list; unsigned short vlanId; unsigned char lineNum; // either 1 or 2 } vlanLineDistList_t; typedef struct vlanlinemap_s { char *cmd; // command parameters unsigned short vlanid; //vlan id unsigned char linenum; //line number } vlanlinemap_t; #endif /* VX185_BONDING */ typedef struct ipcInfo_s { // start address of array of IPC queues read/write pointers (between AP and Host). // Number of pairs in this array would be same as number of queues for this AP. // This pointer would be initialized by using "mallocSlaveMem" function apQueueState_t *apIndexes; // Array of structures which are presenting pointer to IPC queue between AP and Host // and Max size of this queue apQueueSpec_t apRxq[MAX_NUMBER_IPC_QUEUES]; }ipcInfo_t; typedef struct classInfo_s { apEgressPort_t bridgeEgress; /* Unrecognized bridge packets */ //apEgressPort_t ttlZeroEgress; /* Dest for packets with TTL = zero */ //apEgressPort_t ipVerEgress; /* Dest for packets ver != IPv4 */ //apEgressPort_t ipCsumEgress; /* Dest for packets with IP csum err */ //apEgressPort_t ipFragEgress; /* Dest for packets that are frags */ #ifdef AP_DENY apEgressPort_t fwAttacksEgress;/* Dest for attack related packets */ #endif /* AP_DENY */ apEgressPort_t unknownEgress; /* Dest for packets that have no * flow table entry */ }classInfo_t; typedef struct trafficInfo_s { #if defined(PORT_MONITORING) && (PORT_MONITORING) unsigned char macAddr[AP_MAC_ADDR_LEN]; unsigned short control; unsigned char bridgeState; #endif /* The bridging table is specified by a base address for the bridging * table and a hash mask. Basically the 16bit hash is calculated and then * folded to be in the range of the mask. * * This allows tables with less than 64k entries to be used, saving a * considerable amount of memory. */ apBridgeEntry_t_chaligned *pBridgeTable; unsigned short bridgeMask; /* The flow table is specified as a base adress for the flow table and * a hash mask. The use of the mask is the same as that for the bridging * table mask. */ apFlowEntry_t_chaligned *pFlowTable; unsigned short flowMask; #if defined(AP2AP_PPPOERELAY_FASTPATH) && (AP2AP_PPPOERELAY_FASTPATH) /* * The pppoe relay flow table is specified as a base adress for the pppoe relayflow * table and a hash mask. The use of the mask is the same as that for the bridging * table mask. */ struct t_ap2ap_pppoerelay_session_aligned *pppoeRelayFlowTable; unsigned short pppoeRelayFlowmask; unsigned short numRelayTableUsers; #endif /* The IPV6 flow table is specified as a base adress for the IPV6 flow table and * a IPV6 hash mask. */ apIpv6FlowEntry_t_chaligned *pIpv6FlowTable; unsigned short flowIpv6Mask; } trafficInfo_t; #define AP_ETH_Q_TO_TX 8 #if defined(IS_VX185) && IS_VX185 /* Type of mapping macros */ #define IPQOS_TOS 0x1 #define IPQOS_DSCP 0x2 #define IPQOS_COS 0x4 #define IPQOS_RECV_COS 0x5 #endif //Store QOS queue Weights in bytes per usec calculated based link rate typedef struct qosInfo_s { //unsigned short qosWeights[AP_ETH_Q_TO_TX]; unsigned short minBytes[AP_ETH_Q_TO_TX]; unsigned short maxBytes[AP_ETH_Q_TO_TX]; int sharedBytes; }qosInfo_t; #if defined(IS_VX185) && IS_VX185 typedef struct { unsigned int uiWfqQuota[AP_ETH_Q_TO_TX]; unsigned int uiWfqMax[AP_ETH_Q_TO_TX]; unsigned int totalBW; /* Q Masking Flags */ unsigned char qShareBwMask; /* BW Sharing Mask */ unsigned char qActiveMask; /* Maximum Bandwidth Bit Mask */ unsigned char qBWContributeMask; /* Bandwidth Contribution */ unsigned char qTCPAckMask; /* TCP-ACK Priority Mask */ }apEthQosConfig_t; #if 1 //CACHE:: // Important for CACHE WRITE BACK MODE // Below definitions are created to have all entries on different cache lines // In this case a situation when Host and AP are updating elements of different structures // on the SAME cache line and Host is doing cache flush will be resolved properly // WITHOUT AP portion data loss. #ifdef AP_ASSEMBLER #define APETHQOSINFO_PADDING_TILL_CLINE (CACHE_LINE_SIZE - (sizeof typedef apEthQosConfig_t & (CACHE_LINE_SIZE - 1))) #else #define APETHQOSINFO_PADDING_TILL_CLINE (CACHE_LINE_SIZE - (sizeof(apEthQosConfig_t) & (CACHE_LINE_SIZE - 1))) #endif typedef struct { apEthQosConfig_t apEthQosConfigMain; unsigned char reserved[APETHQOSINFO_PADDING_TILL_CLINE]; }apEthQosConfig_t_chaligned __attribute__((aligned(CACHE_LINE_SIZE))); #ifdef AP_ASSEMBLER assert (sizeof typedef apEthQosConfig_t_chaligned & (CACHE_LINE_SIZE - 1)), 0 #else //assert (0 == (sizeof(apEthQosConfig_t_chaligned) & (CACHE_LINE_SIZE - 1))); #endif #endif //CACHE:: #endif //RVRV Next typedef describes common structure construction for all APs // The information included here presents SUPERSET of all possible // parameters for all APs in the System typedef struct apLibStruct_s { // Pointer to configuration structure. Each AP can have his own // construction of configuration information. void *pApConf; // Size of config structure UINT16 configSize; // Number of IPC queues UCHAR numIpcQueues; // Pointer to the area used to exchange AP information void *pExchangeArea; // Pointer to Configuartion function which would be provided to AP // library by specific drivers and would be called by Ap library before // loading AP. // Driver will copy all necessary information from substructures of // this structure into his own elements ( AP configuration structure, // Host owned structures ) UINT32 (*confFunc)( void *pUser, void *ptr2ApConf, void *pApLibStruct); // Identifier to be used when calling the config fn void *pUser; // The following information represents the configuration features // supported by the AP toolkit classInfo_t classInfo; ipcInfo_t ipcInfo; trafficInfo_t trafficInfo; qosInfo_t qosInfo; // This entry is to be filled in by the driver. It gives the "txFifo" // address for the device. Should be set to 0 if the device doesn't // support a tx function UINT32 *pTxFifo; // This entry is to be filled inside of User stack by calling libtoolkit APIs. UINT16 features_bits; //this counter is incremented whenever a single ap attaches multiple times with the same s //bridge table. UCHAR numOfApBridgeTblInst; #if (defined (IS_VX185) && IS_VX185) || (defined(IS_VX175) && IS_VX175) #if defined(POLICY_BASED_VLAN) && (POLICY_BASED_VLAN) UINT16 policy_features_bits; #endif #endif #if defined(PACKET_TAGGING) && (PACKET_TAGGING) //this element presents length of potential tag which can be appended by H/W // with the same bridge table. UCHAR packetPreambleTagLength; #endif } apLibStruct_t; #endif /* _APLIBDEFS_H_ */