📄 am930hw.h
字号:
/*--- TX Descriptor - state values and testing macros -*/#define SUTXD_ST_FWOWN (BIT7)#define SUTXD_ST_DONE (BIT6)#define SUTXD_ST_REJECTED (BIT5)#define SUTXD_ST_MSDU_TMOUT (BIT4)#define SUTXD_ST_ABRT (BIT3)#define SUTXD_ST_ABRT_NOTX (BIT2)#define SUTXD_ST_MAX_RETRY (BIT1)#define SUTXD_ST_TXERR (BIT0)#define SUTXD_ST_IS_FWOWN(x) ((x) & SUTXD_ST_FWOWN)#define SUTXD_ST_IS_HOSTOWN(x) (~(x) & SUTXD_ST_FWOWN)#define SUTXD_ST_IS_DONE(x) ((x) & SUTXD_ST_DONE)#define SUTXD_ST_IS_REJECTED(x) ((x) & SUTXD_ST_REJECTED)#define SUTXD_ST_IS_MSDU_TMOUT(x) ((x) & SUTXD_ST_MSDU_TMOUT)#define SUTXD_ST_IS_ABRT(x) ((x) & SUTXD_ST_ABRT)#define SUTXD_ST_IS_ABRT_NOTX(x) ((x) & SUTXD_ST_ABRT_NOTX)#define SUTXD_ST_IS_MAX_RETRY(x) ((x) & SUTXD_ST_MAX_RETRY)#define SUTXD_ST_IS_TXERR(x) ((x) & SUTXD_ST_TXERR)/*--- TX Descriptor - tx_cntl values ----*/#define SUTXD_CTL_PRESERVE_SEQ (BIT7)#define SUTXD_CTL_RSVD1 (BIT6)#define SUTXD_CTL_RSVD2 (BIT5)#define SUTXD_CTL_RSVD3 (BIT4)#define SUTXD_CTL_RSVD4 (BIT3)#define SUTXD_CTL_RSVD5 (BIT2)#define SUTXD_CTL_BURST (BIT1)#define SUTXD_CTL_FRAGS (BIT0)/*===== Variables ==================================*/extern int am930_iodelay; /* udelay between i/o or mem reads *//*=============================================================*//*--- Command Argument Types ---------------------------------*//*=============================================================*//*--- Test Interface/NOP -SUCMD_TEST_NOP ----------------------*//*__WLAN_PRAGMA_PACK1__typedef struct sucmd_test_nop{} sucmd_test_nop_t;__WLAN_PRAGMA_PACKDFLT__*//*--- Set MIB Variables - SUCMD_SET_MIB_VAR -------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_set_mib_var{ UINT8 type __WLAN_ATTRIB_PACK__; UINT8 size __WLAN_ATTRIB_PACK__; UINT8 index __WLAN_ATTRIB_PACK__; UINT8 rsvd __WLAN_ATTRIB_PACK__; UINT8 data[72] __WLAN_ATTRIB_PACK__;} sucmd_set_mib_var_t;__WLAN_PRAGMA_PACKDFLT__/*--- Init Tx Routines --- SUCMD_INIT_TX ----------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_init_tx{ UINT32 data_desc __WLAN_ATTRIB_PACK__; UINT32 mgmt_desc __WLAN_ATTRIB_PACK__; UINT32 bcast_desc __WLAN_ATTRIB_PACK__; UINT32 pspoll_desc __WLAN_ATTRIB_PACK__; UINT32 cfpoll_desc __WLAN_ATTRIB_PACK__;} sucmd_init_tx_t;__WLAN_PRAGMA_PACKDFLT__/*--- Flush Tx ----------- SUCMD_FLUSH_TX ---------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_flush_tx{ UINT8 data __WLAN_ATTRIB_PACK__; UINT8 mgmt __WLAN_ATTRIB_PACK__; UINT8 bcast __WLAN_ATTRIB_PACK__; UINT8 pspoll __WLAN_ATTRIB_PACK__; UINT8 cfpoll __WLAN_ATTRIB_PACK__;} sucmd_flush_tx_t;__WLAN_PRAGMA_PACKDFLT__/*--- Enable Receiver ---- SUCMD_EN_RCVR ----------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_en_rcvr{ UINT32 data_desc __WLAN_ATTRIB_PACK__; UINT32 pspoll_desc __WLAN_ATTRIB_PACK__;} sucmd_en_rcvr_t;__WLAN_PRAGMA_PACKDFLT__/*--- Disable Receiver --- SUCMD_DIS_RCVR ---------------------*//*__WLAN_PRAGMA_PACK1__typedef struct sucmd_dis_rcvr{} sucmd_dis_rcvr_t;__WLAN_PRAGMA_PACKDFLT__*//*--- Sleep -------------- SUCMD_SLEEP ------------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_sleep{ UINT64 wake_up_time;} sucmd_sleep_t;__WLAN_PRAGMA_PACKDFLT__/*--- Wake --------------- SUCMD_WAKE -------------------------*//*__WLAN_PRAGMA_PACK1__typedef struct sucmd_wake{} sucmd_wake_t;__WLAN_PRAGMA_PACKDFLT__*//*--- Get MIB variables -- SUCMD_GET_MIB_VAR ------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_get_mib_var{ UINT8 type __WLAN_ATTRIB_PACK__; UINT8 size __WLAN_ATTRIB_PACK__; UINT8 index __WLAN_ATTRIB_PACK__; UINT8 rsvd __WLAN_ATTRIB_PACK__; UINT8 data[72] __WLAN_ATTRIB_PACK__;} sucmd_get_mib_var_t;__WLAN_PRAGMA_PACKDFLT__/*--- Scan --------------- SUCMD_SCAN -------------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_scan{ UINT16 duration __WLAN_ATTRIB_PACK__; UINT8 set_or_ch __WLAN_ATTRIB_PACK__; UINT8 pattern __WLAN_ATTRIB_PACK__; UINT8 index __WLAN_ATTRIB_PACK__; UINT8 suspend __WLAN_ATTRIB_PACK__;} sucmd_scan_t;__WLAN_PRAGMA_PACKDFLT__/*--- Sync --------------- SUCMD_SYNC -------------------------*/__WLAN_PRAGMA_PACK1__typedef struct sucmd_sync{ UINT8 set_or_ch __WLAN_ATTRIB_PACK__; UINT8 pattern __WLAN_ATTRIB_PACK__; UINT8 index __WLAN_ATTRIB_PACK__; UINT8 start_BSS __WLAN_ATTRIB_PACK__; UINT16 dwell_interval __WLAN_ATTRIB_PACK__; UINT16 rsvd __WLAN_ATTRIB_PACK__; UINT8 bss_timestamp[WLAN_BSS_TS_LEN] __WLAN_ATTRIB_PACK__; UINT32 ref_time __WLAN_ATTRIB_PACK__;} sucmd_sync_t;__WLAN_PRAGMA_PACKDFLT__/*--- Resume ------------- SUCMD_RESUME -----------------------*//*__WLAN_PRAGMA_PACK1__typedef struct sucmd_resume{} sucmd_resume_t;__WLAN_PRAGMA_PACKDFLT__*//*=============================================================*//*--- AM930 Hardware interface types -------------------*//*=============================================================*/typedef void (*am930hw_scan_callback_t)(void *);typedef struct am930mem /* used for tx buffer mem mgmt */{ UINT32 lock; UINT32 bits; UINT32 start; UINT32 len; UINT32 fragsize;} am930mem_t;typedef struct am930hw_stats{ UINT32 tx_tmout; UINT32 tx_fifo_uflow; UINT32 tx_retry; UINT32 tx_rejected; UINT32 rx_crcerr; UINT32 rx_buf_oflow;} am930hw_stats_t;typedef struct am930hw{ /* object status indicator */ volatile UINT32 state; /* driver support */ struct am930mac *mac; /* resource assignments */ UINT32 membase; UINT32 usemem; /* use mem mapped io?? */ UINT32 iobase; UINT32 irq; /* firmware revision */ UINT32 fw_major; UINT32 fw_minor; UINT32 fw_api; UINT32 fw_date; /* firmware interface, note: the addrs are in card space */ UINT32 banner; UINT32 cs; UINT32 cmd; UINT32 txcmplt; UINT32 vbm; /* tx queue location */ UINT32 tx_base; UINT32 tx_len; UINT ntxbuf; UINT used_txbuf; UINT32 mgmt_tx_base; /* rx queue location */ UINT32 rx_base; UINT32 rx_len; /* tx queue management */ am930mem_t *mem; UINT32 tx_tail; UINT32 mgmt_tx_tail; UINT8 *txfrbuf; /* rx queue current head ptr */ UINT32 rx_head; /* MAC address */ UINT8 addr[WLAN_ADDR_LEN]; /* F/W command support elements */ volatile UINT8 last_cmd; volatile UINT8 scan_ch; /* when scannning, this is the channel */ am930hw_stats_t stats; /* callback ptr(s) */ am930hw_scan_callback_t scan_callback; void *scan_callbackarg; void (*timerfunc)(struct am930hw *hw);} am930hw_t;/* bit flags for state information */#define AM930HW_CONFIG_PENDING (BIT0)#define AM930HW_CONFIG (BIT1)#define AM930HW_INTOCURRED (BIT2)#define AM930HW_SCANNING (BIT3)#define AM930HW_RXENABLED (BIT4)#define AM930HW_TXENABLED (BIT5)/* Method return codes */#define AM930HW_SUCCESS 0#define AM930HW_FAILURE 1#define AM930HW_NOTSUPPORTED 2/* Scan method bit flags */#define AM930HWSCAN_ACTIVE (BIT0)#define AM930HWSCAN_PASSIVE (BIT1)#define AM930HWSCAN_IBSS (BIT2)#define AM930HWSCAN_ESS (BIT3)/*=============================================================*//*--- Methods -------------------------------------------------*//*=============================================================*//* public: */am930hw_t* am930hw_construct(UINT32 irq, UINT32 iobase, UINT32 membase, am930mac_t *mac);void am930hw_destruct(am930hw_t *hw);int am930hw_init_rx_tx( am930hw_t *hw );void am930hw_ISR( am930hw_t *hw );UINT32 am930hw_joinbss( am930hw_t *hw, UINT32 ch, UINT32 newBSS, UINT8 *bssid, wlan_ie_ssid_t *ssid, UINT32 bcn_int, wlan_bss_ts_t ts, UINT32 sutro_ref_time );UINT32 am930hw_resumefromscan( am930hw_t *hw);UINT32 am930hw_scan( am930hw_t *hw, UINT32 cntl, UINT8 *bssid, UINT32 ch, UINT32 duration, wlan_ie_ssid_t *ssid, am930hw_scan_callback_t cb, void *callback_arg );UINT32 am930hw_reset( am930hw_t *hw );UINT8 am930hw_stateset( am930hw_t *hw, UINT8 state);UINT8 am930hw_stateget( am930hw_t *hw);UINT32 am930hw_txdata( am930hw_t* hw, wlan_pb_t *pb, UINT32 rate);UINT32 am930hw_txmgmt( am930hw_t* hw, UINT8 *buf, UINT32 len);void am930hw_txkick( am930hw_t* hw);UINT32 am930hw_mibget( am930hw_t *hw, UINT32 mibsec, UINT32 offset, UINT32 len, void *buf);UINT32 am930hw_mibgetitem( am930hw_t *hw, UINT32 itemid, void *buf, UINT32 len);UINT32 am930hw_mibset( am930hw_t *hw, UINT32 mibsec, UINT32 offset, UINT32 len, void *buf);UINT32 am930hw_mibsetitem( am930hw_t *hw, UINT32 itemid, void *buf, UINT32 len);/*=============================================================*//*--- AM79C930 byte order swapping macros ---------------------*//*=============================================================*/#if (WLAN_CPU_FAMILY == WLAN_Ix86) #define amd2host16(n) (n) #define amd2host32(n) (n) #define host2amd16(n) (n) #define host2amd32(n) (n)#elif (WLAN_CPU_FAMILY == WLAN_PPC ) #define amd2host16(n) (__swab16((n))) #define amd2host32(n) (__swab32((n))) #define host2amd16(n) (__swab16((n))) #define host2amd32(n) (__swab32((n)))#else #error "No WLAN_CPU_FAMILY match!"#endif/*=============================================================*//*--- Functions -----------------------------------------------*//*=============================================================*/#endif /* _LINUX_AM930HW_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -