/* Copyright (C) 2006 Ikanos Communications * See IKANOS_PROP_LICENSE.txt for license information. */ // =========================================================================== // // File name : apload.h // Description : Information for AP load from Host // =========================================================================== #ifndef _APLOAD_H_ #define _APLOAD_H_ #include typedef enum { SIM_OK = 0, // No error SIM_PMEM_ADDR, // Error accessing PMEM - address out of range SIM_DMEM_ADDR, // Error accessing DMEM - address out ot range SIM_DMEM_ALIGN, // Error accessing DMEM - address badly aligned SIM_IO_NOPORT, // Error accessing port - no handler registered SIM_IO_BADPORT, // Error registering port handler - port out or range SIM_DEC_BADINST, // Error decoding instruction - invalid instr SIM_STK_FULL, // Error pushing to stack - full SIM_STK_EMPTY, // Error popping from stack - empty SIM_AP_ID, // Error AP Identifier SIM_AP_EVENT_ERR, // AP didn't response to event from Host SIM_ALLOC_ERR, // Allocation of SDRAM memory block Failed SIM_SLAVEMEM_ALLOC_ERR, // Allocation of Slave memory block Failed SIM_RAMQ_WRONG_PARAMS, /* Wrong definition of ramQ parameters ( related to BM Only )*/ SIM_MAX_BM_CLUSTERS_TOO_SMALL, /* The distance between poolsize and max number of clusters under usage by BM is too small */ SIM_PARAM_INITIALIZED_ALREADY, // The parameter has been initialized already SIM_EGRESS_TYPE, // Wrong type of packets for egress port assignment SIM_QUEUE_NUM, // Number of IPC queue is out of possible range SIM_QUEUE_SIZE, // Size of IPC queue is out of possible range SIM_ALREADY_USED_QUEUE, // IPC queue was already initialized SIM_BAD_HASH_MASK, // value of defined hash mask isn't (2^2 - 1) SIM_WRONG_FUNCTION, // wrong defined function SIM_PARAM_NOT_INITIALIZED, // parameter wasn't initiliazed SIM_ALREADY_DISABLED_ENTRY, // entry is disabled already SIM_ENTRY_COLLISION, // entry is existing already SIM_ENTRY_DOESNT_EXIST, // The entry doesn't exist SIM_MATCHING_ENTRY, // The entry with same field values exists ALREADY SIM_WRONG_FEATURE, // The feature isn't inside of permit range SIM_MAC_LIST_FULL, /* Number of MAC addresses in list exceed max configured number */ SIM_MAC_LIST_EMPTY, // Attempt to remove MAC address from an empty list SIM_WRONG_MAC_ADDR, // Attempt to remove MAC address which doesn't exist SIM_PRELIMINARY_CALL, // Function is called before possible call time SIM_LATE_CALL, // Function is called after possible call time SIM_AP_SUSPENSION_ACTION, // Wrong action to suspend/resume AP SIM_PPPOE_MATCHING_ENTRY, /* TCP/UDP flow matches but PPPOE session ID doesn't match */ SIM_UNCOMPATIBLE_OPERATIONS_ERR, // If operations bits are not set correctly SIM_AP_INPUT_QUEUE_ALMOST_FULL, // Host dropped packet because of fulness of AP INPUT Queue SIM_WRONG_PARAMS_ERR, // If any of input parameters is wrong SIM_ETHERTYPE_LIST_FULL, // Ethertype table is FULL SIM_INCORRECT_MTU_SIZE, // MTU is less than minimum SIM_AHB_BADADDR = 0x1000, // Bad/unhandled AHB address SIM_AHB_ALIGN, // AHB address not aligned to word boundary SIM_AHB_ACTIVE, // AHB master is already making request SIM_AHB_UNDERRUN, // Underrun while writing AHB SIM_AHB_OVERRUN, // Overrun while reading AHB } simResult_t; #define _codeSectionLength(pref) pref ## _codeSectionLength #define _dataSectionLength(pref) pref ## _dataSectionLength #define _sDataSectionLength(pref) pref ## _sDataSectionLength #define _codeSection(pref) pref ## _codeSection #define _dataSection(pref) pref ## _dataSection #define _sDataSection(pref) pref ## _sDataSection #define _startData(pref) pref ## _startData #define _endData(pref) pref ## _endData #define _startSData(pref) pref ## _startSData #define _endSData(pref) pref ## _endSData #define _startBSS(pref) pref ## _startBSS #define _endBSS(pref) pref ## _endBSS #define _startSBSS(pref) pref ## _startSBSS #define _endSBSS(pref) pref ## _endSBSS #ifdef VX185_BONDING #define _signature(pref) pref ## _signature[] #endif /* VX185_BONDING */ // Code and data information from assembled program for AP #ifdef VX185_BONDING #define extern_declaration_ap_vars( ap_prefix ) \ extern unsigned long _codeSectionLength( ap_prefix );\ extern unsigned long _dataSectionLength( ap_prefix );\ extern unsigned long _sDataSectionLength( ap_prefix );\ extern unsigned char _codeSection( ap_prefix )[];\ extern unsigned char _dataSection( ap_prefix )[];\ extern unsigned char _sDataSection( ap_prefix )[];\ extern unsigned long _startData( ap_prefix );\ extern unsigned long _endData( ap_prefix );\ extern unsigned long _startSData( ap_prefix );\ extern unsigned long _endSData( ap_prefix );\ extern unsigned long _startBSS( ap_prefix );\ extern unsigned long _endBSS( ap_prefix );\ extern unsigned long _startSBSS( ap_prefix );\ extern unsigned long _endSBSS( ap_prefix ); \ extern unsigned char _signature( ap_prefix ); #else #define extern_declaration_ap_vars( ap_prefix ) \ extern unsigned long _codeSectionLength( ap_prefix );\ extern unsigned long _dataSectionLength( ap_prefix );\ extern unsigned long _sDataSectionLength( ap_prefix );\ extern unsigned char _codeSection( ap_prefix )[];\ extern unsigned char _dataSection( ap_prefix )[];\ extern unsigned char _sDataSection( ap_prefix )[];\ extern unsigned long _startData( ap_prefix );\ extern unsigned long _endData( ap_prefix );\ extern unsigned long _startSData( ap_prefix );\ extern unsigned long _endSData( ap_prefix );\ extern unsigned long _startBSS( ap_prefix );\ extern unsigned long _endBSS( ap_prefix );\ extern unsigned long _startSBSS( ap_prefix );\ extern unsigned long _endSBSS( ap_prefix ); #endif /* VX185_BONDING */ #define APUInit( apId, ap_prefix, pConfigStruct, configSize) loadAPCode( apId,\ _codeSectionLength(ap_prefix),\ _dataSectionLength(ap_prefix),\ _sDataSectionLength(ap_prefix),\ (unsigned long)_codeSection(ap_prefix),\ (unsigned long)_dataSection(ap_prefix),\ (unsigned long)_sDataSection(ap_prefix),\ _startData(ap_prefix),\ _endData(ap_prefix),\ _startSData(ap_prefix),\ _endSData(ap_prefix),\ _startBSS(ap_prefix),\ _endBSS(ap_prefix),\ _startSBSS(ap_prefix),\ _endSBSS(ap_prefix),\ pConfigStruct, configSize ); simResult_t loadAPCode( unsigned char apId, unsigned long codeSectionLength, unsigned long _dataSectionLength, unsigned long _sDataSectionLength, unsigned long codeSection, unsigned long _dataSection, unsigned long _sDataSection, unsigned long startData, unsigned long _endData, unsigned long startSData, unsigned long _endSData, unsigned long startBSS, unsigned long _endBSS, unsigned long startSBSS, unsigned long _endSBSS, void *pConfigStruct, int configSize ); simResult_t pmemLoad( unsigned long ulAPBaseAddr, unsigned char *pProgram, unsigned short length); simResult_t dmemLoadData( unsigned char *pData, unsigned long addr, unsigned short length ); simResult_t dmemZeroData(unsigned long addr, unsigned short length); simResult_t dmemStructExchange( unsigned char apId, void *pMemBlock,unsigned short eventType, unsigned short usTimeOut); unsigned long getAPBaseAddress(unsigned char apId); simResult_t hostIpcQueueConfig(unsigned char apId,unsigned char queueNum,unsigned short queueSize); void apProcessMulticastPkts( apPreHeader_t* pFrame); int apProcessMcastWlanPkts(apPreHeader_t* pFrame); apPreHeader_t *uart2Receive(void); simResult_t apResetStatistics( unsigned char apId ); #if defined(BM_SPECIAL_STATS) && (BM_SPECIAL_STATS) simResult_t apPPPoESessionIdConfig( unsigned char sessionIndex,unsigned short sessionId); #endif #endif /* _APLOAD_H_ */