📄 ah.h
字号:
* * NB: These values are intentionally assigned for * direct use when setting up h/w descriptors. */typedef enum { HAL_PKT_TYPE_NORMAL = 0, HAL_PKT_TYPE_ATIM = 1, HAL_PKT_TYPE_PSPOLL = 2, HAL_PKT_TYPE_BEACON = 3, HAL_PKT_TYPE_PROBE_RESP = 4, HAL_PKT_TYPE_CHIRP = 5, HAL_PKT_TYPE_GRP_POLL = 6,} HAL_PKT_TYPE;/* Rx Filter Frame Types */typedef enum { HAL_RX_FILTER_UCAST = 0x00000001, /* Allow unicast frames */ HAL_RX_FILTER_MCAST = 0x00000002, /* Allow multicast frames */ HAL_RX_FILTER_BCAST = 0x00000004, /* Allow broadcast frames */ HAL_RX_FILTER_CONTROL = 0x00000008, /* Allow control frames */ HAL_RX_FILTER_BEACON = 0x00000010, /* Allow beacon frames */ HAL_RX_FILTER_PROM = 0x00000020, /* Promiscuous mode */ HAL_RX_FILTER_XRPOLL = 0x00000040, /* Allow XR poll frmae */ HAL_RX_FILTER_PROBEREQ = 0x00000080, /* Allow probe request frames */ HAL_RX_FILTER_PHYERR = 0x00000100, /* Allow phy errors */ HAL_RX_FILTER_PHYRADAR = 0x00000200, /* Allow phy radar errors*/} HAL_RX_FILTER;typedef enum { HAL_PM_AWAKE = 0, HAL_PM_FULL_SLEEP = 1, HAL_PM_NETWORK_SLEEP = 2, HAL_PM_UNDEFINED = 3} HAL_POWER_MODE;/* * NOTE WELL: * These are mapped to take advantage of the common locations for many of * the bits on all of the currently supported MAC chips. This is to make * the ISR as efficient as possible, while still abstracting HW differences. * When new hardware breaks this commonality this enumerated type, as well * as the HAL functions using it, must be modified. All values are directly * mapped unless commented otherwise. */typedef enum { HAL_INT_RX = 0x00000001, /* Non-common mapping */ HAL_INT_RXDESC = 0x00000002, HAL_INT_RXNOFRM = 0x00000008, HAL_INT_RXEOL = 0x00000010, HAL_INT_RXORN = 0x00000020, HAL_INT_TX = 0x00000040, /* Non-common mapping */ HAL_INT_TXDESC = 0x00000080, HAL_INT_TXURN = 0x00000800, HAL_INT_MIB = 0x00001000, HAL_INT_RXPHY = 0x00004000, HAL_INT_RXKCM = 0x00008000, HAL_INT_SWBA = 0x00010000, HAL_INT_BMISS = 0x00040000, HAL_INT_BNR = 0x00100000, /* Non-common mapping */ HAL_INT_TIM = 0x00200000, /* Non-common mapping */ HAL_INT_DTIM = 0x00400000, /* Non-common mapping */ HAL_INT_DTIMSYNC= 0x00800000, /* Non-common mapping */ HAL_INT_GPIO = 0x01000000, HAL_INT_CABEND = 0x02000000, /* Non-common mapping */ HAL_INT_FATAL = 0x40000000, /* Non-common mapping */#define HAL_INT_GLOBAL 0x80000000 /* Set/clear IER */ HAL_INT_BMISC = HAL_INT_TIM | HAL_INT_DTIM | HAL_INT_DTIMSYNC | HAL_INT_CABEND, /* Interrupt bits that map directly to ISR/IMR bits */ HAL_INT_COMMON = HAL_INT_RXNOFRM | HAL_INT_RXDESC | HAL_INT_RXEOL | HAL_INT_RXORN | HAL_INT_TXURN | HAL_INT_TXDESC | HAL_INT_MIB | HAL_INT_RXPHY | HAL_INT_RXKCM | HAL_INT_SWBA | HAL_INT_BMISS | HAL_INT_GPIO,} HAL_INT;typedef enum { HAL_RFGAIN_INACTIVE = 0, HAL_RFGAIN_READ_REQUESTED = 1, HAL_RFGAIN_NEED_CHANGE = 2} HAL_RFGAIN;/* * Channels are specified by frequency. */typedef struct { u_int16_t channel; /* setting in Mhz */ u_int16_t channelFlags; /* see below */ u_int8_t privFlags; int8_t maxRegTxPower; /* max regulatory tx power in dBm */ int8_t maxTxPower; /* max true tx power in 0.5 dBm */ int8_t minTxPower; /* min true tx power in 0.5 dBm */} HAL_CHANNEL;/* channelFlags */#define CHANNEL_CW_INT 0x0002 /* CW interference detected on channel */#define CHANNEL_TURBO 0x0010 /* Turbo Channel */#define CHANNEL_CCK 0x0020 /* CCK channel */#define CHANNEL_OFDM 0x0040 /* OFDM channel */#define CHANNEL_2GHZ 0x0080 /* 2 GHz spectrum channel. */#define CHANNEL_5GHZ 0x0100 /* 5 GHz spectrum channel */#define CHANNEL_PASSIVE 0x0200 /* Only passive scan allowed in the channel */#define CHANNEL_DYN 0x0400 /* dynamic CCK-OFDM channel */#define CHANNEL_XR 0x0800 /* XR channel */#define CHANNEL_STURBO 0x2000 /* Static turbo, no 11a-only usage */#define CHANNEL_HALF 0x4000 /* Half rate channel */#define CHANNEL_QUARTER 0x8000 /* Quarter rate channel *//* privFlags */#define CHANNEL_INTERFERENCE 0x01 /* Software use: channel interference used for as AR as well as RADAR interference detection */#define CHANNEL_DFS 0x02 /* DFS required on channel */#define CHANNEL_4MS_LIMIT 0x04 /* 4msec packet limit on this channel */#define CHANNEL_DFS_CLEAR 0x08 /* if channel has been checked for DFS */#define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM)#define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK)#define CHANNEL_PUREG (CHANNEL_2GHZ|CHANNEL_OFDM)#ifdef notdef#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_DYN)#else#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM)#endif#define CHANNEL_T (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO)#define CHANNEL_ST (CHANNEL_T|CHANNEL_STURBO)#define CHANNEL_108G (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)#define CHANNEL_108A CHANNEL_T#define CHANNEL_X (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR)#define CHANNEL_ALL \ (CHANNEL_OFDM|CHANNEL_CCK| CHANNEL_2GHZ | CHANNEL_5GHZ | CHANNEL_TURBO)#define CHANNEL_ALL_NOTURBO (CHANNEL_ALL &~ CHANNEL_TURBO)#define HAL_ANTENNA_MIN_MODE 0#define HAL_ANTENNA_FIXED_A 1#define HAL_ANTENNA_FIXED_B 2#define HAL_ANTENNA_MAX_MODE 3typedef struct { u_int32_t ackrcv_bad; u_int32_t rts_bad; u_int32_t rts_good; u_int32_t fcs_bad; u_int32_t beacons;} HAL_MIB_STATS;typedef u_int16_t HAL_CTRY_CODE; /* country code */typedef u_int16_t HAL_REG_DOMAIN; /* regulatory domain code */enum { CTRY_DEBUG = 0x1ff, /* debug country code */ CTRY_DEFAULT = 0 /* default country code */};enum { HAL_MODE_11A = 0x001, /* 11a channels */ HAL_MODE_TURBO = 0x002, /* 11a turbo-only channels */ HAL_MODE_11B = 0x004, /* 11b channels */ HAL_MODE_PUREG = 0x008, /* 11g channels (OFDM only) */#ifdef notdef HAL_MODE_11G = 0x010, /* 11g channels (OFDM/CCK) */#else HAL_MODE_11G = 0x008, /* XXX historical */#endif HAL_MODE_108G = 0x020, /* 11a+Turbo channels */ HAL_MODE_108A = 0x040, /* 11g+Turbo channels */ HAL_MODE_XR = 0x100, /* XR channels */ HAL_MODE_11A_HALF_RATE = 0x200, /* 11A half rate channels */ HAL_MODE_11A_QUARTER_RATE = 0x400, /* 11A quarter rate channels */ HAL_MODE_ALL = 0xfff};typedef struct { int rateCount; /* NB: for proper padding */ u_int8_t rateCodeToIndex[32]; /* back mapping */ struct { u_int8_t valid; /* valid for rate control use */ u_int8_t phy; /* CCK/OFDM/XR */ u_int16_t rateKbps; /* transfer rate in kbs */ u_int8_t rateCode; /* rate for h/w descriptors */ u_int8_t shortPreamble; /* mask for enabling short * preamble in CCK rate code */ u_int8_t dot11Rate; /* value for supported rates * info element of MLME */ u_int8_t controlRate; /* index of next lower basic * rate; used for dur. calcs */ u_int16_t lpAckDuration; /* long preamble ACK duration */ u_int16_t spAckDuration; /* short preamble ACK duration*/ } info[32];} HAL_RATE_TABLE;typedef struct { u_int rs_count; /* number of valid entries */ u_int8_t rs_rates[32]; /* rates */} HAL_RATE_SET;/* * Antenna switch control. By default antenna selection * enables multiple (2) antenna use. To force use of the * A or B antenna only specify a fixed setting. Fixing * the antenna will also disable any diversity support. */typedef enum { HAL_ANT_VARIABLE = 0, /* variable by programming */ HAL_ANT_FIXED_A = 1, /* fixed antenna A */ HAL_ANT_FIXED_B = 2, /* fixed antenna B */} HAL_ANT_SETTING;typedef enum { HAL_M_STA = 1, /* infrastructure station */ HAL_M_IBSS = 0, /* IBSS (adhoc) station */ HAL_M_HOSTAP = 6, /* Software Access Point */ HAL_M_MONITOR = 8 /* Monitor mode */} HAL_OPMODE;typedef struct { u_int8_t kv_type; /* one of HAL_CIPHER */ u_int8_t kv_pad; u_int16_t kv_len; /* length in bits */ u_int8_t kv_val[16]; /* enough for 128-bit keys */ u_int8_t kv_mic[8]; /* TKIP MIC key */ u_int8_t kv_txmic[8]; /* TKIP TX MIC key (optional) */} HAL_KEYVAL;typedef enum { HAL_CIPHER_WEP = 0, HAL_CIPHER_AES_OCB = 1, HAL_CIPHER_AES_CCM = 2, HAL_CIPHER_CKIP = 3, HAL_CIPHER_TKIP = 4, HAL_CIPHER_CLR = 5, /* no encryption */ HAL_CIPHER_MIC = 127 /* TKIP-MIC, not a cipher */} HAL_CIPHER;enum { HAL_SLOT_TIME_6 = 6, /* NB: for turbo mode */ HAL_SLOT_TIME_9 = 9, HAL_SLOT_TIME_20 = 20,};/* * Per-station beacon timer state. Note that the specified * beacon interval (given in TU's) can also include flags * to force a TSF reset and to enable the beacon xmit logic. * If bs_cfpmaxduration is non-zero the hardware is setup to * coexist with a PCF-capable AP. */typedef struct { u_int32_t bs_nexttbtt; /* next beacon in TU */ u_int32_t bs_nextdtim; /* next DTIM in TU */ u_int32_t bs_intval; /* beacon interval+flags */#define HAL_BEACON_PERIOD 0x0000ffff /* beacon interval period */#define HAL_BEACON_ENA 0x00800000 /* beacon xmit enable */#define HAL_BEACON_RESET_TSF 0x01000000 /* clear TSF */ u_int32_t bs_dtimperiod; u_int16_t bs_cfpperiod; /* CFP period in TU */ u_int16_t bs_cfpmaxduration; /* max CFP duration in TU */ u_int32_t bs_cfpnext; /* next CFP in TU */ u_int16_t bs_timoffset; /* byte offset to TIM bitmap */ u_int16_t bs_bmissthreshold; /* beacon miss threshold */ u_int32_t bs_sleepduration; /* max sleep duration */} HAL_BEACON_STATE;/* * Like HAL_BEACON_STATE but for non-station mode setup. * NB: see above flag definitions */typedef struct { u_int32_t bt_intval; /* beacon interval+flags */ u_int32_t bt_nexttbtt; /* next beacon in TU */ u_int32_t bt_nextatim; /* next ATIM in TU */ u_int32_t bt_nextdba; /* next DBA in 1/8th TU */ u_int32_t bt_nextswba; /* next SWBA in 1/8th TU */} HAL_BEACON_TIMERS;/* * Per-node statistics maintained by the driver for use in * optimizing signal quality and other operational aspects. */typedef struct { u_int32_t ns_avgbrssi; /* average beacon rssi */ u_int32_t ns_avgrssi; /* average data rssi */ u_int32_t ns_avgtxrssi; /* average tx rssi */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -