?? am930hw.h
字號:
/* am930hw.c: Handles the AM79C930 specifics* --------------------------------------------------------------------** Linux WLAN ** The contents of this file are subject to the Mozilla Public* License Version 1.0 (the "License"); you may not use this file* except in compliance with the License. You may obtain a copy of* the License at http://www.mozilla.org/MPL/** Software distributed under the License is distributed on an "AS* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or* implied. See the License for the specific language governing* rights and limitations under the License.** The initial developer of the original code is Mark S. Mathews* <mark@absoval.com>. Portions created by Mark S. Mathews* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.** --------------------------------------------------------------------*/#ifndef _LINUX_AM930HW_H#define _LINUX_AM930HW_H/*===== Control/Status and Command block Related Constants =*//*--- Fixed memory offsets --------------------------*/#define SU_OFF_LAST_TXDESC 0x3ec#define SU_OFF_RSVD1 0x400#define SU_OFF_BANNER 0x480#define SU_OFF_CMD_BLK 0x4a0#define SU_OFF_CNTL_STATUS_BLK 0x4f0#define SU_OFF_VBM 0x500#define SU_OFF_BUFFER 0x600/*--- Global Sizes ----------------------------------*/#define SU_LEN_BANNER 32/*===== Descriptor Related Constants & Macros =========*//*--- next testing macro (applies to Rx and Tx) -------*/#define SUTXD_ISLAST(x) ((x) & BIT31)#define SURXD_ISLAST(x) ((x) & BIT31)/*=============================================================*//*------ Types and their related constants --------------------*//*=============================================================*//*--- Last Completed Tx Descriptor Block ---------------*/typedef struct am930txcmplt_blk{ volatile UINT32 last_bcast; volatile UINT32 last_mgmt; volatile UINT32 last_data; volatile UINT32 last_pspoll; volatile UINT32 last_cfpoll;} SU_PACK am930txcmplt_blk_t;#define TXCMPLT_OFF_BCAST 0#define TXCMPLT_OFF_MGMT 4#define TXCMPLT_OFF_DATA 8#define TXCMPLT_OFF_PSPOLL 12#define TXCMPLT_OFF_CFPOLL 16/*=============================================================*//*--- Command Block for sending commands to f/w ---------------*/typedef struct am930cmd_blk{ volatile UINT8 code; volatile UINT8 status; volatile UINT8 error_offset; volatile UINT8 reserved; volatile UINT8 cmd_parms[76];} SU_PACK am930cmd_blk_t;#define CMD_OFF_CODE 0#define CMD_OFF_STATUS 1#define CMD_OFF_ERR_OFF 2#define CMD_OFF_PARMS 4/*--- Command Block - Command values -----------------*/#define SUCMD_CMD_TEST_NOP 0x01#define SUCMD_CMD_SET_MIB_VAR 0x02#define SUCMD_CMD_INIT_TX 0x03#define SUCMD_CMD_FLUSH_TX 0x04#define SUCMD_CMD_EN_RCVR 0x05#define SUCMD_CMD_DIS_RCVR 0x06#define SUCMD_CMD_SLEEP 0x07#define SUCMD_CMD_WAKE 0x08#define SUCMD_CMD_GET_MIB_VAR 0x09#define SUCMD_CMD_SCAN 0x0a#define SUCMD_CMD_SYNC 0x0b#define SUCMD_CMD_RESUME 0x0c/*--- Command Block - Status values ------------------*/#define SUCMD_STAT_IDLE 0x00#define SUCMD_STAT_CMPLT 0x01#define SUCMD_STAT_REJECT_UNK 0x02#define SUCMD_STAT_REJECT_ARG 0x03#define SUCMD_STAT_REJECT_NOS 0x04#define SUCMD_STAT_REJECT_ARG2 0x05#define SUCMD_STAT_REJECT_MODE 0x06/* other error codes undocumented *//*=============================================================*//*--- Control/Status Block ------------------------------------*/typedef struct am930cs_blk{ volatile UINT8 self_test_status; volatile UINT8 sta_state; volatile UINT8 user_rtn; volatile UINT8 int_status; volatile UINT8 int_mask; volatile UINT8 lockout_fw; volatile UINT8 lockout_host; volatile UINT8 int_status2; volatile UINT32 rsvd; volatile UINT8 sw_dis_pwrdn; volatile UINT8 int_mask2; volatile UINT8 driver_state; volatile UINT8 rsvd2;} SU_PACK am930cs_blk_t;#define CS_OFF_SELF_TEST 0#define CS_OFF_STA_STATE 1#define CS_OFF_USER_RTN 2#define CS_OFF_INT_STATUS 3#define CS_OFF_INT_MASK 4#define CS_OFF_LOCKOUT_FW 5#define CS_OFF_LOCKOUT_HOST 6#define CS_OFF_INT_STATUS2 7#define CS_OFF_RSVD 8#define CS_OFF_DIS_PWR_DN 12#define CS_OFF_INT_MASK2 13#define CS_OFF_DRIVER_STATE 14#define CS_OFF_RSVD2 15/*--- Control/Status Block - self_test_status values -*/#define SUCS_POST_INIT 0x00#define SUCS_POST_FIRMWARE 0x01#define SUCS_POST_HW 0x02#define SUCS_POST_INIT_MIB 0x03#define SUCS_POST_MIB_CHKSUM_FAIL 0xfa#define SUCS_POST_RADIO_FAIL 0xfb#define SUCS_POST_SUTRO_FAIL 0xfc#define SUCS_POST_PROM_CKSUM_FAIL 0xfd#define SUCS_POST_RAM_FAIL 0xfe#define SUCS_POST_SUCCESS 0xff/*--- Control/Status Block - state testing macros ----*/#define SUCS_ST_IS_RSVD1(x) ((x) & BIT7)#define SUCS_ST_IS_RSVD2(x) ((x) & BIT6)#define SUCS_ST_IS_AP_ACTIVE(x) ((x) & BIT5)#define SUCS_ST_IS_PSP_DISABLED(x) ((x) & BIT4)#define SUCS_ST_IS_DOZE(x) ((x) & BIT3)#define SUCS_ST_IS_PSPMODE(x) ((x) & BIT2)#define SUCS_ST_IS_RX_ENABLED(x) ((x) & BIT1)#define SUCS_ST_IS_TX_ENABLED(x) ((x) & BIT0)/*--- Control/Status Block - int_status testing macros --*/#define SUCS_INT_IS_WAKEUP(x) ((x) & BIT7)#define SUCS_INT_IS_CFPEND(x) ((x) & BIT6)#define SUCS_INT_IS_DTIMTX(x) ((x) & BIT5)#define SUCS_INT_IS_CFPSTART(x) ((x) & BIT4)#define SUCS_INT_IS_SCANCMPLT(x) ((x) & BIT3)#define SUCS_INT_IS_TX(x) ((x) & BIT2)#define SUCS_INT_IS_RX(x) ((x) & BIT1)#define SUCS_INT_IS_CMD(x) ((x) & BIT0)/*--- Control/Status Block - int_mask (and status) values --*/#define SUCS_INT_WAKEUP (BIT7)#define SUCS_INT_CFPEND (BIT6)#define SUCS_INT_DTIMTX (BIT5)#define SUCS_INT_CFPSTART (BIT4)#define SUCS_INT_SCANCMPLT (BIT3)#define SUCS_INT_TX (BIT2)#define SUCS_INT_RX (BIT1)#define SUCS_INT_MASK_CMD (BIT0)/*--- Control/Status Block - int_status2 testing macros --*/#define SUCS_INT2_IS_RX_MGMT_PSPOLL(x) ((x) & (BIT7))#define SUCS_INT2_IS_RX_DATA(x) ((x) & (BIT6))#define SUCS_INT2_IS_RSVD(x) ((x) & (BIT5))#define SUCS_INT2_IS_TX_MGMT(x) ((x) & (BIT4))#define SUCS_INT2_IS_TX_CFPOLL(x) ((x) & (BIT3))#define SUCS_INT2_IS_TX_PSPOLL(x) ((x) & (BIT2))#define SUCS_INT2_IS_TX_BCAST(x) ((x) & (BIT1))#define SUCS_INT2_IS_TX_DATA(x) ((x) & (BIT0)/*--- Control/Status Block - int_mask2 (and status) values --*/#define SUCS_INT2_RX_MGMT_PSPOLL (BIT7)#define SUCS_INT2_RX_DATA (BIT6)#define SUCS_INT2_RSVD (BIT5)#define SUCS_INT2_TX_MGMT (BIT4)#define SUCS_INT2_TX_CFPOLL (BIT3)#define SUCS_INT2_TX_PSPOLL (BIT2)#define SUCS_INT2_TX_BCAST (BIT1)#define SUCS_INT2_TX_DATA (BIT0)/*--- Control/Status Block - driver state values --*//*-- bits 0-3 --------*/#define SUCS_DS_RESET (0x00)#define SUCS_DS_ESS_SYNC (0x01)#define SUCS_DS_IBSS_SCAN (0x02)#define SUCS_DS_IBSS_SYNC (0x03)#define SUCS_DS_ESS_SCAN (0x04)#define SUCS_DS_ESS_AUTH (0x05)#define SUCS_DS_ESS_ASSOC (0x06)#define SUCS_DS_ESS_HANDOFF (0x07)#define SUCS_DS_AP_NO_ASSOC (0x08)#define SUCS_DS_AP_ASSOC_NONE (0x0c)#define SUCS_DS_AP_ASSOC_LIGHT (0x0d)#define SUCS_DS_AP_ASSOC_MOD (0x0e)#define SUCS_DS_AP_ASSOC_HVY (0x0f)/*-- enable f/w control of the LEDS ---*/#define SUCS_DS_AUTO_RXLED_EN (BIT4)#define SUCS_DS_AUTO_TXLED_EN (BIT5)/*-- if f/w control of LEDs is off, then driver controls them with these bits*/#define SUCS_DS_RXLED_ON (BIT6)#define SUCS_DS_TXLED_ON (BIT7)/*=============================================================*//*--- Virtual Bitmap Block ------------------------------------*/typedef struct am930vbm_blk{ volatile UINT8 offset; volatile UINT8 length; volatile UINT8 bm[251];} SU_PACK am930vbm_blk_t;#define VBM_OFF_OFFSET 0#define VBM_OFF_LENGTH 1#define VBM_OFF_BM 2/*=============================================================*//*--- Rx Descriptor Block ------------------------------------*/typedef struct am930rx_desc{ volatile UINT32 rsvd1; volatile UINT32 next; volatile UINT8 rsvd2; volatile UINT8 state; volatile UINT8 rssi; volatile UINT8 index_or_ch; volatile UINT32 local_time; volatile UINT32 rx_start_frame; volatile UINT16 rx_len; volatile UINT8 rate; volatile UINT8 rsvd3;} SU_PACK am930rx_desc_t;#define RXD_OFF_RSVD1 0#define RXD_OFF_NEXT 4#define RXD_OFF_RSVD2 8#define RXD_OFF_STATE 9#define RXD_OFF_RSSI 10#define RXD_OFF_INDEX_OR_CH 11#define RXD_OFF_LOCAL_TIME 12#define RXD_OFF_START_FRAME 16#define RXD_OFF_LEN 20#define RXD_OFF_RATE 22#define RXD_OFF_RSVD3 23/*--- RX Descriptor - state values and testing macros -*/#define SURXD_ST_FWOWN (BIT7)#define SURXD_ST_CONSUMED (BIT6)#define SURXD_ST_LAST_FRAG (BIT5)#define SURXD_ST_RSVD1 (BIT4)#define SURXD_ST_CRCERR (BIT3)#define SURXD_ST_RSVD2 (BIT2)#define SURXD_ST_BUF_OFLOW (BIT1)#define SURXD_ST_RXERR (BIT0)#define SURXD_ST_IS_FWOWN(x) ((x) & SURXD_ST_FWOWN)#define SURXD_ST_IS_HOSTOWN(x) (~(x) & SURXD_ST_FWOWN)#define SURXD_ST_IS_CONSUMED(x) ((x) & SURXD_ST_CONSUMED)#define SURXD_ST_IS_LAST_FRAG(x) ((x) & SURXD_ST_LAST_FRAG)#define SURXD_ST_IS_CRC_ERR(x) ((x) & SURXD_ST_CRCERR)#define SURXD_ST_IS_BUF_OFLOW(x) ((x) & SURXD_ST_BUF_OFLOW)#define SURXD_ST_IS_RXERR(x) ((x) & SURXD_ST_RXERR)/*=============================================================*//*--- Tx Descriptor Block ------------------------------------*/typedef struct am930tx_desc{ volatile UINT32 tx_start_frame; volatile UINT32 next; volatile UINT16 tx_len; volatile UINT8 state; volatile UINT8 rate; volatile UINT8 difs_attempts; volatile UINT8 difs_failures; volatile UINT8 sifs_attempts; volatile UINT8 sifs_failures;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -