📄 ipw2100.h
字号:
#define IPW_BD_QUEUE_W_R_MIN_SPARE 2#define IPW_CACHE_LINE_LENGTH_DEFAULT 0x80#define IPW_CARD_DISABLE_PHY_OFF_COMPLETE_WAIT 100 // 100 milli#define IPW_PREPARE_POWER_DOWN_COMPLETE_WAIT 100 // 100 milli#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr)#define IPW_MAX_80211_PAYLOAD_SIZE 2304U#define IPW_MAX_802_11_PAYLOAD_LENGTH 2312#define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536#define IPW_MIN_ACCEPTABLE_RX_FRAME_LENGTH 60#define IPW_MAX_ACCEPTABLE_RX_FRAME_LENGTH \ (IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH + IPW_HEADER_802_11_SIZE - \ sizeof(struct ethhdr))#define IPW_802_11_FCS_LENGTH 4#define IPW_RX_NIC_BUFFER_LENGTH \ (IPW_MAX_802_11_PAYLOAD_LENGTH + IPW_HEADER_802_11_SIZE + \ IPW_802_11_FCS_LENGTH)#define IPW_802_11_PAYLOAD_OFFSET \ (sizeof(struct ieee80211_hdr_3addr) + \ sizeof(struct ieee80211_snap_hdr))struct ipw2100_rx { union { unsigned char payload[IPW_RX_NIC_BUFFER_LENGTH]; struct ieee80211_hdr_4addr header; u32 status; struct ipw2100_notification notification; struct ipw2100_cmd_header command; } rx_data;} __attribute__ ((packed));/* Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved */#define TX_RATE_1_MBIT 0x0001#define TX_RATE_2_MBIT 0x0002#define TX_RATE_5_5_MBIT 0x0004#define TX_RATE_11_MBIT 0x0008#define TX_RATE_MASK 0x000F#define DEFAULT_TX_RATES 0x000F#define IPW_POWER_MODE_CAM 0x00 //(always on)#define IPW_POWER_INDEX_1 0x01#define IPW_POWER_INDEX_2 0x02#define IPW_POWER_INDEX_3 0x03#define IPW_POWER_INDEX_4 0x04#define IPW_POWER_INDEX_5 0x05#define IPW_POWER_AUTO 0x06#define IPW_POWER_MASK 0x0F#define IPW_POWER_ENABLED 0x10#define IPW_POWER_LEVEL(x) ((x) & IPW_POWER_MASK)#define IPW_TX_POWER_AUTO 0#define IPW_TX_POWER_ENHANCED 1#define IPW_TX_POWER_DEFAULT 32#define IPW_TX_POWER_MIN 0#define IPW_TX_POWER_MAX 16#define IPW_TX_POWER_MIN_DBM (-12)#define IPW_TX_POWER_MAX_DBM 16#define FW_SCAN_DONOT_ASSOCIATE 0x0001 // Dont Attempt to Associate after Scan#define FW_SCAN_PASSIVE 0x0008 // Force PASSSIVE Scan#define REG_MIN_CHANNEL 0#define REG_MAX_CHANNEL 14#define REG_CHANNEL_MASK 0x00003FFF#define IPW_IBSS_11B_DEFAULT_MASK 0x87ff#define DIVERSITY_EITHER 0 // Use both antennas#define DIVERSITY_ANTENNA_A 1 // Use antenna A#define DIVERSITY_ANTENNA_B 2 // Use antenna B#define HOST_COMMAND_WAIT 0#define HOST_COMMAND_NO_WAIT 1#define LOCK_NONE 0#define LOCK_DRIVER 1#define LOCK_FW 2#define TYPE_SWEEP_ORD 0x000D#define TYPE_IBSS_STTN_ORD 0x000E#define TYPE_BSS_AP_ORD 0x000F#define TYPE_RAW_BEACON_ENTRY 0x0010#define TYPE_CALIBRATION_DATA 0x0011#define TYPE_ROGUE_AP_DATA 0x0012#define TYPE_ASSOCIATION_REQUEST 0x0013#define TYPE_REASSOCIATION_REQUEST 0x0014#define HW_FEATURE_RFKILL 0x0001#define RF_KILLSWITCH_OFF 1#define RF_KILLSWITCH_ON 0#define IPW_COMMAND_POOL_SIZE 40#define IPW_START_ORD_TAB_1 1#define IPW_START_ORD_TAB_2 1000#define IPW_ORD_TAB_1_ENTRY_SIZE sizeof(u32)#define IS_ORDINAL_TABLE_ONE(mgr,id) \ ((id >= IPW_START_ORD_TAB_1) && (id < mgr->table1_size))#define IS_ORDINAL_TABLE_TWO(mgr,id) \ ((id >= IPW_START_ORD_TAB_2) && (id < (mgr->table2_size + IPW_START_ORD_TAB_2)))#define BSS_ID_LENGTH 6// Fixed size data: Ordinal Table 1typedef enum _ORDINAL_TABLE_1 { // NS - means Not Supported by FW// Transmit statistics IPW_ORD_STAT_TX_HOST_REQUESTS = 1, // # of requested Host Tx's (MSDU) IPW_ORD_STAT_TX_HOST_COMPLETE, // # of successful Host Tx's (MSDU) IPW_ORD_STAT_TX_DIR_DATA, // # of successful Directed Tx's (MSDU) IPW_ORD_STAT_TX_DIR_DATA1 = 4, // # of successful Directed Tx's (MSDU) @ 1MB IPW_ORD_STAT_TX_DIR_DATA2, // # of successful Directed Tx's (MSDU) @ 2MB IPW_ORD_STAT_TX_DIR_DATA5_5, // # of successful Directed Tx's (MSDU) @ 5_5MB IPW_ORD_STAT_TX_DIR_DATA11, // # of successful Directed Tx's (MSDU) @ 11MB IPW_ORD_STAT_TX_DIR_DATA22, // # of successful Directed Tx's (MSDU) @ 22MB IPW_ORD_STAT_TX_NODIR_DATA1 = 13, // # of successful Non_Directed Tx's (MSDU) @ 1MB IPW_ORD_STAT_TX_NODIR_DATA2, // # of successful Non_Directed Tx's (MSDU) @ 2MB IPW_ORD_STAT_TX_NODIR_DATA5_5, // # of successful Non_Directed Tx's (MSDU) @ 5.5MB IPW_ORD_STAT_TX_NODIR_DATA11, // # of successful Non_Directed Tx's (MSDU) @ 11MB IPW_ORD_STAT_NULL_DATA = 21, // # of successful NULL data Tx's IPW_ORD_STAT_TX_RTS, // # of successful Tx RTS IPW_ORD_STAT_TX_CTS, // # of successful Tx CTS IPW_ORD_STAT_TX_ACK, // # of successful Tx ACK IPW_ORD_STAT_TX_ASSN, // # of successful Association Tx's IPW_ORD_STAT_TX_ASSN_RESP, // # of successful Association response Tx's IPW_ORD_STAT_TX_REASSN, // # of successful Reassociation Tx's IPW_ORD_STAT_TX_REASSN_RESP, // # of successful Reassociation response Tx's IPW_ORD_STAT_TX_PROBE, // # of probes successfully transmitted IPW_ORD_STAT_TX_PROBE_RESP, // # of probe responses successfully transmitted IPW_ORD_STAT_TX_BEACON, // # of tx beacon IPW_ORD_STAT_TX_ATIM, // # of Tx ATIM IPW_ORD_STAT_TX_DISASSN, // # of successful Disassociation TX IPW_ORD_STAT_TX_AUTH, // # of successful Authentication Tx IPW_ORD_STAT_TX_DEAUTH, // # of successful Deauthentication TX IPW_ORD_STAT_TX_TOTAL_BYTES = 41, // Total successful Tx data bytes IPW_ORD_STAT_TX_RETRIES, // # of Tx retries IPW_ORD_STAT_TX_RETRY1, // # of Tx retries at 1MBPS IPW_ORD_STAT_TX_RETRY2, // # of Tx retries at 2MBPS IPW_ORD_STAT_TX_RETRY5_5, // # of Tx retries at 5.5MBPS IPW_ORD_STAT_TX_RETRY11, // # of Tx retries at 11MBPS IPW_ORD_STAT_TX_FAILURES = 51, // # of Tx Failures IPW_ORD_STAT_TX_ABORT_AT_HOP, //NS // # of Tx's aborted at hop time IPW_ORD_STAT_TX_MAX_TRIES_IN_HOP, // # of times max tries in a hop failed IPW_ORD_STAT_TX_ABORT_LATE_DMA, //NS // # of times tx aborted due to late dma setup IPW_ORD_STAT_TX_ABORT_STX, //NS // # of times backoff aborted IPW_ORD_STAT_TX_DISASSN_FAIL, // # of times disassociation failed IPW_ORD_STAT_TX_ERR_CTS, // # of missed/bad CTS frames IPW_ORD_STAT_TX_BPDU, //NS // # of spanning tree BPDUs sent IPW_ORD_STAT_TX_ERR_ACK, // # of tx err due to acks // Receive statistics IPW_ORD_STAT_RX_HOST = 61, // # of packets passed to host IPW_ORD_STAT_RX_DIR_DATA, // # of directed packets IPW_ORD_STAT_RX_DIR_DATA1, // # of directed packets at 1MB IPW_ORD_STAT_RX_DIR_DATA2, // # of directed packets at 2MB IPW_ORD_STAT_RX_DIR_DATA5_5, // # of directed packets at 5.5MB IPW_ORD_STAT_RX_DIR_DATA11, // # of directed packets at 11MB IPW_ORD_STAT_RX_DIR_DATA22, // # of directed packets at 22MB IPW_ORD_STAT_RX_NODIR_DATA = 71, // # of nondirected packets IPW_ORD_STAT_RX_NODIR_DATA1, // # of nondirected packets at 1MB IPW_ORD_STAT_RX_NODIR_DATA2, // # of nondirected packets at 2MB IPW_ORD_STAT_RX_NODIR_DATA5_5, // # of nondirected packets at 5.5MB IPW_ORD_STAT_RX_NODIR_DATA11, // # of nondirected packets at 11MB IPW_ORD_STAT_RX_NULL_DATA = 80, // # of null data rx's IPW_ORD_STAT_RX_POLL, //NS // # of poll rx IPW_ORD_STAT_RX_RTS, // # of Rx RTS IPW_ORD_STAT_RX_CTS, // # of Rx CTS IPW_ORD_STAT_RX_ACK, // # of Rx ACK IPW_ORD_STAT_RX_CFEND, // # of Rx CF End IPW_ORD_STAT_RX_CFEND_ACK, // # of Rx CF End + CF Ack IPW_ORD_STAT_RX_ASSN, // # of Association Rx's IPW_ORD_STAT_RX_ASSN_RESP, // # of Association response Rx's IPW_ORD_STAT_RX_REASSN, // # of Reassociation Rx's IPW_ORD_STAT_RX_REASSN_RESP, // # of Reassociation response Rx's IPW_ORD_STAT_RX_PROBE, // # of probe Rx's IPW_ORD_STAT_RX_PROBE_RESP, // # of probe response Rx's IPW_ORD_STAT_RX_BEACON, // # of Rx beacon IPW_ORD_STAT_RX_ATIM, // # of Rx ATIM IPW_ORD_STAT_RX_DISASSN, // # of disassociation Rx IPW_ORD_STAT_RX_AUTH, // # of authentication Rx IPW_ORD_STAT_RX_DEAUTH, // # of deauthentication Rx IPW_ORD_STAT_RX_TOTAL_BYTES = 101, // Total rx data bytes received IPW_ORD_STAT_RX_ERR_CRC, // # of packets with Rx CRC error IPW_ORD_STAT_RX_ERR_CRC1, // # of Rx CRC errors at 1MB IPW_ORD_STAT_RX_ERR_CRC2, // # of Rx CRC errors at 2MB IPW_ORD_STAT_RX_ERR_CRC5_5, // # of Rx CRC errors at 5.5MB IPW_ORD_STAT_RX_ERR_CRC11, // # of Rx CRC errors at 11MB IPW_ORD_STAT_RX_DUPLICATE1 = 112, // # of duplicate rx packets at 1MB IPW_ORD_STAT_RX_DUPLICATE2, // # of duplicate rx packets at 2MB IPW_ORD_STAT_RX_DUPLICATE5_5, // # of duplicate rx packets at 5.5MB IPW_ORD_STAT_RX_DUPLICATE11, // # of duplicate rx packets at 11MB IPW_ORD_STAT_RX_DUPLICATE = 119, // # of duplicate rx packets IPW_ORD_PERS_DB_LOCK = 120, // # locking fw permanent db IPW_ORD_PERS_DB_SIZE, // # size of fw permanent db IPW_ORD_PERS_DB_ADDR, // # address of fw permanent db IPW_ORD_STAT_RX_INVALID_PROTOCOL, // # of rx frames with invalid protocol IPW_ORD_SYS_BOOT_TIME, // # Boot time IPW_ORD_STAT_RX_NO_BUFFER, // # of rx frames rejected due to no buffer IPW_ORD_STAT_RX_ABORT_LATE_DMA, //NS // # of rx frames rejected due to dma setup too late IPW_ORD_STAT_RX_ABORT_AT_HOP, //NS // # of rx frames aborted due to hop IPW_ORD_STAT_RX_MISSING_FRAG, // # of rx frames dropped due to missing fragment IPW_ORD_STAT_RX_ORPHAN_FRAG, // # of rx frames dropped due to non-sequential fragment IPW_ORD_STAT_RX_ORPHAN_FRAME, // # of rx frames dropped due to unmatched 1st frame IPW_ORD_STAT_RX_FRAG_AGEOUT, // # of rx frames dropped due to uncompleted frame IPW_ORD_STAT_RX_BAD_SSID, //NS // Bad SSID (unused) IPW_ORD_STAT_RX_ICV_ERRORS, // # of ICV errors during decryption// PSP Statistics IPW_ORD_STAT_PSP_SUSPENSION = 137, // # of times adapter suspended IPW_ORD_STAT_PSP_BCN_TIMEOUT, // # of beacon timeout IPW_ORD_STAT_PSP_POLL_TIMEOUT, // # of poll response timeouts IPW_ORD_STAT_PSP_NONDIR_TIMEOUT, // # of timeouts waiting for last broadcast/muticast pkt IPW_ORD_STAT_PSP_RX_DTIMS, // # of PSP DTIMs received IPW_ORD_STAT_PSP_RX_TIMS, // # of PSP TIMs received IPW_ORD_STAT_PSP_STATION_ID, // PSP Station ID// Association and roaming IPW_ORD_LAST_ASSN_TIME = 147, // RTC time of last association IPW_ORD_STAT_PERCENT_MISSED_BCNS, // current calculation of % missed beacons IPW_ORD_STAT_PERCENT_RETRIES, // current calculation of % missed tx retries IPW_ORD_ASSOCIATED_AP_PTR, // If associated, this is ptr to the associated // AP table entry. set to 0 if not associated IPW_ORD_AVAILABLE_AP_CNT, // # of AP's decsribed in the AP table IPW_ORD_AP_LIST_PTR, // Ptr to list of available APs IPW_ORD_STAT_AP_ASSNS, // # of associations IPW_ORD_STAT_ASSN_FAIL, // # of association failures IPW_ORD_STAT_ASSN_RESP_FAIL, // # of failuresdue to response fail IPW_ORD_STAT_FULL_SCANS, // # of full scans IPW_ORD_CARD_DISABLED, // # Card Disabled IPW_ORD_STAT_ROAM_INHIBIT, // # of times roaming was inhibited due to ongoing activity IPW_FILLER_40, IPW_ORD_RSSI_AT_ASSN = 160, // RSSI of associated AP at time of association IPW_ORD_STAT_ASSN_CAUSE1, // # of reassociations due to no tx from AP in last N // hops or no prob_ responses in last 3 minutes IPW_ORD_STAT_ASSN_CAUSE2, // # of reassociations due to poor tx/rx quality IPW_ORD_STAT_ASSN_CAUSE3, // # of reassociations due to tx/rx quality with excessive // load at the AP IPW_ORD_STAT_ASSN_CAUSE4, // # of reassociations due to AP RSSI level fell below // eligible group IPW_ORD_STAT_ASSN_CAUSE5, // # of reassociations due to load leveling IPW_ORD_STAT_ASSN_CAUSE6, //NS // # of reassociations due to dropped by Ap IPW_FILLER_41, IPW_FILLER_42, IPW_FILLER_43, IPW_ORD_STAT_AUTH_FAIL, // # of times authentication failed IPW_ORD_STAT_AUTH_RESP_FAIL, // # of times authentication response failed IPW_ORD_STATION_TABLE_CNT, // # of entries in association table// Other statistics IPW_ORD_RSSI_AVG_CURR = 173, // Current avg RSSI IPW_ORD_STEST_RESULTS_CURR, //NS // Current self test results word IPW_ORD_STEST_RESULTS_CUM, //NS // Cummulative self test results word IPW_ORD_SELF_TEST_STATUS, //NS // IPW_ORD_POWER_MGMT_MODE, // Power mode - 0=CAM, 1=PSP IPW_ORD_POWER_MGMT_INDEX, //NS // IPW_ORD_COUNTRY_CODE, // IEEE country code as recv'd from beacon IPW_ORD_COUNTRY_CHANNELS, // channels suported by country// IPW_ORD_COUNTRY_CHANNELS:// For 11b the lower 2-byte are used for channels from 1-14// and the higher 2-byte are not used. IPW_ORD_RESET_CNT, // # of adapter resets (warm) IPW_ORD_BEACON_INTERVAL, // Beacon interval IPW_ORD_PRINCETON_VERSION = 184, //NS // Princeton Version IPW_ORD_ANTENNA_DIVERSITY, // TRUE if antenna diversity is disabled IPW_ORD_CCA_RSSI, //NS // CCA RSSI value (factory programmed) IPW_ORD_STAT_EEPROM_UPDATE, //NS // # of times config EEPROM updated IPW_ORD_DTIM_PERIOD, // # of beacon intervals between DTIMs IPW_ORD_OUR_FREQ, // current radio freq lower digits - channel ID IPW_ORD_RTC_TIME = 190, // current RTC time IPW_ORD_PORT_TYPE, // operating mode IPW_ORD_CURRENT_TX_RATE, // current tx rate IPW_ORD_SUPPORTED_RATES, // Bitmap of supported tx rates IPW_ORD_ATIM_WINDOW, // current ATIM Window IPW_ORD_BASIC_RATES, // bitmap of basic tx rates IPW_ORD_NIC_HIGHEST_RATE, // bitmap of basic tx rates IPW_ORD_AP_HIGHEST_RATE, // bitmap of basic tx rates IPW_ORD_CAPABILITIES, // Management frame capability field IPW_ORD_AUTH_TYPE, // Type of authentication IPW_ORD_RADIO_TYPE, // Adapter card platform type IPW_ORD_RTS_THRESHOLD = 201, // Min length of packet after which RTS handshaking is used IPW_ORD_INT_MODE, // International mode IPW_ORD_FRAGMENTATION_THRESHOLD, // protocol frag threshold IPW_ORD_EEPROM_SRAM_DB_BLOCK_START_ADDRESS, // EEPROM offset in SRAM IPW_ORD_EEPROM_SRAM_DB_BLOCK_SIZE, // EEPROM size in SRAM IPW_ORD_EEPROM_SKU_CAPABILITY, // EEPROM SKU Capability 206 = IPW_ORD_EEPROM_IBSS_11B_CHANNELS, // EEPROM IBSS 11b channel set IPW_ORD_MAC_VERSION = 209, // MAC Version IPW_ORD_MAC_REVISION, // MAC Revision IPW_ORD_RADIO_VERSION, // Radio Version IPW_ORD_NIC_MANF_DATE_TIME, // MANF Date/Time STAMP IPW_ORD_UCODE_VERSION, // Ucode Version IPW_ORD_HW_RF_SWITCH_STATE = 214, // HW RF Kill Switch State} ORDINALTABLE1;// ordinal table 2// Variable length data:#define IPW_FIRST_VARIABLE_LENGTH_ORDINAL 1001typedef enum _ORDINAL_TABLE_2 { // NS - means Not Supported by FW IPW_ORD_STAT_BASE = 1000, // contains number of variable ORDs IPW_ORD_STAT_ADAPTER_MAC = 1001, // 6 bytes: our adapter MAC address IPW_ORD_STAT_PREFERRED_BSSID = 1002, // 6 bytes: BSSID of the preferred AP IPW_ORD_STAT_MANDATORY_BSSID = 1003, // 6 bytes: BSSID of the mandatory AP IPW_FILL_1, //NS // IPW_ORD_STAT_COUNTRY_TEXT = 1005, // 36 bytes: Country name text, First two bytes are Country code IPW_ORD_STAT_ASSN_SSID = 1006, // 32 bytes: ESSID String IPW_ORD_STATION_TABLE = 1007, // ? bytes: Station/AP table (via Direct SSID Scans) IPW_ORD_STAT_SWEEP_TABLE = 1008, // ? bytes: Sweep/Host Table table (via Broadcast Scans) IPW_ORD_STAT_ROAM_LOG = 1009, // ? bytes: Roaming log IPW_ORD_STAT_RATE_LOG = 1010, //NS // 0 bytes: Rate log IPW_ORD_STAT_FIFO = 1011, //NS // 0 bytes: Fifo buffer data structures IPW_ORD_STAT_FW_VER_NUM = 1012, // 14 bytes: fw version ID string as in (a.bb.ccc; "0.08.011") IPW_ORD_STAT_FW_DATE = 1013, // 14 bytes: fw date string (mmm dd yyyy; "Mar 13 2002") IPW_ORD_STAT_ASSN_AP_BSSID = 1014, // 6 bytes: MAC address of associated AP IPW_ORD_STAT_DEBUG = 1015, //NS // ? bytes: IPW_ORD_STAT_NIC_BPA_NUM = 1016, // 11 bytes: NIC BPA number in ASCII IPW_ORD_STAT_UCODE_DATE = 1017, // 5 bytes: uCode date IPW_ORD_SECURITY_NGOTIATION_RESULT = 1018,} ORDINALTABLE2; // NS - means Not Supported by FW#define IPW_LAST_VARIABLE_LENGTH_ORDINAL 1018#ifndef WIRELESS_SPY#define WIRELESS_SPY // enable iwspy support#endif#define IPW_HOST_FW_SHARED_AREA0 0x0002f200#define IPW_HOST_FW_SHARED_AREA0_END 0x0002f510 // 0x310 bytes#define IPW_HOST_FW_SHARED_AREA1 0x0002f610#define IPW_HOST_FW_SHARED_AREA1_END 0x0002f630 // 0x20 bytes#define IPW_HOST_FW_SHARED_AREA2 0x0002fa00#define IPW_HOST_FW_SHARED_AREA2_END 0x0002fa20 // 0x20 bytes#define IPW_HOST_FW_SHARED_AREA3 0x0002fc00#define IPW_HOST_FW_SHARED_AREA3_END 0x0002fc10 // 0x10 bytes#define IPW_HOST_FW_INTERRUPT_AREA 0x0002ff80#define IPW_HOST_FW_INTERRUPT_AREA_END 0x00030000 // 0x80 bytesstruct ipw2100_fw_chunk { unsigned char *buf; long len; long pos; struct list_head list;};struct ipw2100_fw_chunk_set { const void *data; unsigned long size;};struct ipw2100_fw { int version; struct ipw2100_fw_chunk_set fw; struct ipw2100_fw_chunk_set uc; const struct firmware *fw_entry;};#define MAX_FW_VERSION_LEN 14#endif /* _IPW2100_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -