162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/****************************************************************************** 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci Contact Information: 862306a36Sopenharmony_ci Intel Linux Wireless <ilw@linux.intel.com> 962306a36Sopenharmony_ci Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci******************************************************************************/ 1262306a36Sopenharmony_ci#ifndef _IPW2100_H 1362306a36Sopenharmony_ci#define _IPW2100_H 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#include <linux/sched.h> 1662306a36Sopenharmony_ci#include <linux/interrupt.h> 1762306a36Sopenharmony_ci#include <linux/netdevice.h> 1862306a36Sopenharmony_ci#include <linux/etherdevice.h> 1962306a36Sopenharmony_ci#include <linux/list.h> 2062306a36Sopenharmony_ci#include <linux/delay.h> 2162306a36Sopenharmony_ci#include <linux/skbuff.h> 2262306a36Sopenharmony_ci#include <asm/io.h> 2362306a36Sopenharmony_ci#include <linux/socket.h> 2462306a36Sopenharmony_ci#include <linux/if_arp.h> 2562306a36Sopenharmony_ci#include <linux/wireless.h> 2662306a36Sopenharmony_ci#include <net/iw_handler.h> // new driver API 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci#ifdef CONFIG_IPW2100_MONITOR 2962306a36Sopenharmony_ci#include <net/ieee80211_radiotap.h> 3062306a36Sopenharmony_ci#endif 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#include <linux/workqueue.h> 3362306a36Sopenharmony_ci#include <linux/mutex.h> 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#include "libipw.h" 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_cistruct ipw2100_priv; 3862306a36Sopenharmony_cistruct ipw2100_tx_packet; 3962306a36Sopenharmony_cistruct ipw2100_rx_packet; 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#define IPW_DL_UNINIT 0x80000000 4262306a36Sopenharmony_ci#define IPW_DL_NONE 0x00000000 4362306a36Sopenharmony_ci#define IPW_DL_ALL 0x7FFFFFFF 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci/* 4662306a36Sopenharmony_ci * To use the debug system; 4762306a36Sopenharmony_ci * 4862306a36Sopenharmony_ci * If you are defining a new debug classification, simply add it to the #define 4962306a36Sopenharmony_ci * list here in the form of: 5062306a36Sopenharmony_ci * 5162306a36Sopenharmony_ci * #define IPW_DL_xxxx VALUE 5262306a36Sopenharmony_ci * 5362306a36Sopenharmony_ci * shifting value to the left one bit from the previous entry. xxxx should be 5462306a36Sopenharmony_ci * the name of the classification (for example, WEP) 5562306a36Sopenharmony_ci * 5662306a36Sopenharmony_ci * You then need to either add a IPW2100_xxxx_DEBUG() macro definition for your 5762306a36Sopenharmony_ci * classification, or use IPW_DEBUG(IPW_DL_xxxx, ...) whenever you want 5862306a36Sopenharmony_ci * to send output to that classification. 5962306a36Sopenharmony_ci * 6062306a36Sopenharmony_ci * To add your debug level to the list of levels seen when you perform 6162306a36Sopenharmony_ci * 6262306a36Sopenharmony_ci * % cat /proc/net/ipw2100/debug_level 6362306a36Sopenharmony_ci * 6462306a36Sopenharmony_ci * you simply need to add your entry to the ipw2100_debug_levels array. 6562306a36Sopenharmony_ci * 6662306a36Sopenharmony_ci * If you do not see debug_level in /proc/net/ipw2100 then you do not have 6762306a36Sopenharmony_ci * CONFIG_IPW2100_DEBUG defined in your kernel configuration 6862306a36Sopenharmony_ci * 6962306a36Sopenharmony_ci */ 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci#define IPW_DL_ERROR (1<<0) 7262306a36Sopenharmony_ci#define IPW_DL_WARNING (1<<1) 7362306a36Sopenharmony_ci#define IPW_DL_INFO (1<<2) 7462306a36Sopenharmony_ci#define IPW_DL_WX (1<<3) 7562306a36Sopenharmony_ci#define IPW_DL_HC (1<<5) 7662306a36Sopenharmony_ci#define IPW_DL_STATE (1<<6) 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#define IPW_DL_NOTIF (1<<10) 7962306a36Sopenharmony_ci#define IPW_DL_SCAN (1<<11) 8062306a36Sopenharmony_ci#define IPW_DL_ASSOC (1<<12) 8162306a36Sopenharmony_ci#define IPW_DL_DROP (1<<13) 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define IPW_DL_IOCTL (1<<14) 8462306a36Sopenharmony_ci#define IPW_DL_RF_KILL (1<<17) 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci#define IPW_DL_MANAGE (1<<15) 8762306a36Sopenharmony_ci#define IPW_DL_FW (1<<16) 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci#define IPW_DL_FRAG (1<<21) 9062306a36Sopenharmony_ci#define IPW_DL_WEP (1<<22) 9162306a36Sopenharmony_ci#define IPW_DL_TX (1<<23) 9262306a36Sopenharmony_ci#define IPW_DL_RX (1<<24) 9362306a36Sopenharmony_ci#define IPW_DL_ISR (1<<25) 9462306a36Sopenharmony_ci#define IPW_DL_IO (1<<26) 9562306a36Sopenharmony_ci#define IPW_DL_TRACE (1<<28) 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci#define IPW_DEBUG_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a) 9862306a36Sopenharmony_ci#define IPW_DEBUG_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a) 9962306a36Sopenharmony_ci#define IPW_DEBUG_INFO(f...) IPW_DEBUG(IPW_DL_INFO, ## f) 10062306a36Sopenharmony_ci#define IPW_DEBUG_WX(f...) IPW_DEBUG(IPW_DL_WX, ## f) 10162306a36Sopenharmony_ci#define IPW_DEBUG_SCAN(f...) IPW_DEBUG(IPW_DL_SCAN, ## f) 10262306a36Sopenharmony_ci#define IPW_DEBUG_NOTIF(f...) IPW_DEBUG(IPW_DL_NOTIF, ## f) 10362306a36Sopenharmony_ci#define IPW_DEBUG_TRACE(f...) IPW_DEBUG(IPW_DL_TRACE, ## f) 10462306a36Sopenharmony_ci#define IPW_DEBUG_RX(f...) IPW_DEBUG(IPW_DL_RX, ## f) 10562306a36Sopenharmony_ci#define IPW_DEBUG_TX(f...) IPW_DEBUG(IPW_DL_TX, ## f) 10662306a36Sopenharmony_ci#define IPW_DEBUG_ISR(f...) IPW_DEBUG(IPW_DL_ISR, ## f) 10762306a36Sopenharmony_ci#define IPW_DEBUG_MANAGEMENT(f...) IPW_DEBUG(IPW_DL_MANAGE, ## f) 10862306a36Sopenharmony_ci#define IPW_DEBUG_WEP(f...) IPW_DEBUG(IPW_DL_WEP, ## f) 10962306a36Sopenharmony_ci#define IPW_DEBUG_HC(f...) IPW_DEBUG(IPW_DL_HC, ## f) 11062306a36Sopenharmony_ci#define IPW_DEBUG_FRAG(f...) IPW_DEBUG(IPW_DL_FRAG, ## f) 11162306a36Sopenharmony_ci#define IPW_DEBUG_FW(f...) IPW_DEBUG(IPW_DL_FW, ## f) 11262306a36Sopenharmony_ci#define IPW_DEBUG_RF_KILL(f...) IPW_DEBUG(IPW_DL_RF_KILL, ## f) 11362306a36Sopenharmony_ci#define IPW_DEBUG_DROP(f...) IPW_DEBUG(IPW_DL_DROP, ## f) 11462306a36Sopenharmony_ci#define IPW_DEBUG_IO(f...) IPW_DEBUG(IPW_DL_IO, ## f) 11562306a36Sopenharmony_ci#define IPW_DEBUG_IOCTL(f...) IPW_DEBUG(IPW_DL_IOCTL, ## f) 11662306a36Sopenharmony_ci#define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) 11762306a36Sopenharmony_ci#define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_cienum { 12062306a36Sopenharmony_ci IPW_HW_STATE_DISABLED = 1, 12162306a36Sopenharmony_ci IPW_HW_STATE_ENABLED = 0 12262306a36Sopenharmony_ci}; 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ciextern const char *port_type_str[]; 12562306a36Sopenharmony_ciextern const char *band_str[]; 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci#define NUMBER_OF_BD_PER_COMMAND_PACKET 1 12862306a36Sopenharmony_ci#define NUMBER_OF_BD_PER_DATA_PACKET 2 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci#define IPW_MAX_BDS 6 13162306a36Sopenharmony_ci#define NUMBER_OF_OVERHEAD_BDS_PER_PACKETR 2 13262306a36Sopenharmony_ci#define NUMBER_OF_BDS_TO_LEAVE_FOR_COMMANDS 1 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci#define REQUIRED_SPACE_IN_RING_FOR_COMMAND_PACKET \ 13562306a36Sopenharmony_ci (IPW_BD_QUEUE_W_R_MIN_SPARE + NUMBER_OF_BD_PER_COMMAND_PACKET) 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_cistruct bd_status { 13862306a36Sopenharmony_ci union { 13962306a36Sopenharmony_ci struct { 14062306a36Sopenharmony_ci u8 nlf:1, txType:2, intEnabled:1, reserved:4; 14162306a36Sopenharmony_ci } fields; 14262306a36Sopenharmony_ci u8 field; 14362306a36Sopenharmony_ci } info; 14462306a36Sopenharmony_ci} __packed; 14562306a36Sopenharmony_ci 14662306a36Sopenharmony_cistruct ipw2100_bd { 14762306a36Sopenharmony_ci u32 host_addr; 14862306a36Sopenharmony_ci u32 buf_length; 14962306a36Sopenharmony_ci struct bd_status status; 15062306a36Sopenharmony_ci /* number of fragments for frame (should be set only for 15162306a36Sopenharmony_ci * 1st TBD) */ 15262306a36Sopenharmony_ci u8 num_fragments; 15362306a36Sopenharmony_ci u8 reserved[6]; 15462306a36Sopenharmony_ci} __packed; 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define IPW_BD_QUEUE_LENGTH(n) (1<<n) 15762306a36Sopenharmony_ci#define IPW_BD_ALIGNMENT(L) (L*sizeof(struct ipw2100_bd)) 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci#define IPW_BD_STATUS_TX_FRAME_802_3 0x00 16062306a36Sopenharmony_ci#define IPW_BD_STATUS_TX_FRAME_NOT_LAST_FRAGMENT 0x01 16162306a36Sopenharmony_ci#define IPW_BD_STATUS_TX_FRAME_COMMAND 0x02 16262306a36Sopenharmony_ci#define IPW_BD_STATUS_TX_FRAME_802_11 0x04 16362306a36Sopenharmony_ci#define IPW_BD_STATUS_TX_INTERRUPT_ENABLE 0x08 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_cistruct ipw2100_bd_queue { 16662306a36Sopenharmony_ci /* driver (virtual) pointer to queue */ 16762306a36Sopenharmony_ci struct ipw2100_bd *drv; 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci /* firmware (physical) pointer to queue */ 17062306a36Sopenharmony_ci dma_addr_t nic; 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci /* Length of phy memory allocated for BDs */ 17362306a36Sopenharmony_ci u32 size; 17462306a36Sopenharmony_ci 17562306a36Sopenharmony_ci /* Number of BDs in queue (and in array) */ 17662306a36Sopenharmony_ci u32 entries; 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci /* Number of available BDs (invalid for NIC BDs) */ 17962306a36Sopenharmony_ci u32 available; 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci /* Offset of oldest used BD in array (next one to 18262306a36Sopenharmony_ci * check for completion) */ 18362306a36Sopenharmony_ci u32 oldest; 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci /* Offset of next available (unused) BD */ 18662306a36Sopenharmony_ci u32 next; 18762306a36Sopenharmony_ci}; 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci#define RX_QUEUE_LENGTH 256 19062306a36Sopenharmony_ci#define TX_QUEUE_LENGTH 256 19162306a36Sopenharmony_ci#define HW_QUEUE_LENGTH 256 19262306a36Sopenharmony_ci 19362306a36Sopenharmony_ci#define TX_PENDED_QUEUE_LENGTH (TX_QUEUE_LENGTH / NUMBER_OF_BD_PER_DATA_PACKET) 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci#define STATUS_TYPE_MASK 0x0000000f 19662306a36Sopenharmony_ci#define COMMAND_STATUS_VAL 0 19762306a36Sopenharmony_ci#define STATUS_CHANGE_VAL 1 19862306a36Sopenharmony_ci#define P80211_DATA_VAL 2 19962306a36Sopenharmony_ci#define P8023_DATA_VAL 3 20062306a36Sopenharmony_ci#define HOST_NOTIFICATION_VAL 4 20162306a36Sopenharmony_ci 20262306a36Sopenharmony_ci#define IPW2100_RSSI_TO_DBM (-98) 20362306a36Sopenharmony_ci 20462306a36Sopenharmony_cistruct ipw2100_status { 20562306a36Sopenharmony_ci u32 frame_size; 20662306a36Sopenharmony_ci u16 status_fields; 20762306a36Sopenharmony_ci u8 flags; 20862306a36Sopenharmony_ci#define IPW_STATUS_FLAG_DECRYPTED (1<<0) 20962306a36Sopenharmony_ci#define IPW_STATUS_FLAG_WEP_ENCRYPTED (1<<1) 21062306a36Sopenharmony_ci#define IPW_STATUS_FLAG_CRC_ERROR (1<<2) 21162306a36Sopenharmony_ci u8 rssi; 21262306a36Sopenharmony_ci} __packed; 21362306a36Sopenharmony_ci 21462306a36Sopenharmony_cistruct ipw2100_status_queue { 21562306a36Sopenharmony_ci /* driver (virtual) pointer to queue */ 21662306a36Sopenharmony_ci struct ipw2100_status *drv; 21762306a36Sopenharmony_ci 21862306a36Sopenharmony_ci /* firmware (physical) pointer to queue */ 21962306a36Sopenharmony_ci dma_addr_t nic; 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ci /* Length of phy memory allocated for BDs */ 22262306a36Sopenharmony_ci u32 size; 22362306a36Sopenharmony_ci}; 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci#define HOST_COMMAND_PARAMS_REG_LEN 100 22662306a36Sopenharmony_ci#define CMD_STATUS_PARAMS_REG_LEN 3 22762306a36Sopenharmony_ci 22862306a36Sopenharmony_ci#define IPW_WPA_CAPABILITIES 0x1 22962306a36Sopenharmony_ci#define IPW_WPA_LISTENINTERVAL 0x2 23062306a36Sopenharmony_ci#define IPW_WPA_AP_ADDRESS 0x4 23162306a36Sopenharmony_ci 23262306a36Sopenharmony_ci#define IPW_MAX_VAR_IE_LEN ((HOST_COMMAND_PARAMS_REG_LEN - 4) * sizeof(u32)) 23362306a36Sopenharmony_ci 23462306a36Sopenharmony_cistruct ipw2100_wpa_assoc_frame { 23562306a36Sopenharmony_ci u16 fixed_ie_mask; 23662306a36Sopenharmony_ci struct { 23762306a36Sopenharmony_ci u16 capab_info; 23862306a36Sopenharmony_ci u16 listen_interval; 23962306a36Sopenharmony_ci u8 current_ap[ETH_ALEN]; 24062306a36Sopenharmony_ci } fixed_ies; 24162306a36Sopenharmony_ci u32 var_ie_len; 24262306a36Sopenharmony_ci u8 var_ie[IPW_MAX_VAR_IE_LEN]; 24362306a36Sopenharmony_ci}; 24462306a36Sopenharmony_ci 24562306a36Sopenharmony_ci#define IPW_BSS 1 24662306a36Sopenharmony_ci#define IPW_MONITOR 2 24762306a36Sopenharmony_ci#define IPW_IBSS 3 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_ci/** 25062306a36Sopenharmony_ci * @struct _tx_cmd - HWCommand 25162306a36Sopenharmony_ci * @brief H/W command structure. 25262306a36Sopenharmony_ci */ 25362306a36Sopenharmony_cistruct ipw2100_cmd_header { 25462306a36Sopenharmony_ci u32 host_command_reg; 25562306a36Sopenharmony_ci u32 host_command_reg1; 25662306a36Sopenharmony_ci u32 sequence; 25762306a36Sopenharmony_ci u32 host_command_len_reg; 25862306a36Sopenharmony_ci u32 host_command_params_reg[HOST_COMMAND_PARAMS_REG_LEN]; 25962306a36Sopenharmony_ci u32 cmd_status_reg; 26062306a36Sopenharmony_ci u32 cmd_status_params_reg[CMD_STATUS_PARAMS_REG_LEN]; 26162306a36Sopenharmony_ci u32 rxq_base_ptr; 26262306a36Sopenharmony_ci u32 rxq_next_ptr; 26362306a36Sopenharmony_ci u32 rxq_host_ptr; 26462306a36Sopenharmony_ci u32 txq_base_ptr; 26562306a36Sopenharmony_ci u32 txq_next_ptr; 26662306a36Sopenharmony_ci u32 txq_host_ptr; 26762306a36Sopenharmony_ci u32 tx_status_reg; 26862306a36Sopenharmony_ci u32 reserved; 26962306a36Sopenharmony_ci u32 status_change_reg; 27062306a36Sopenharmony_ci u32 reserved1[3]; 27162306a36Sopenharmony_ci u32 *ordinal1_ptr; 27262306a36Sopenharmony_ci u32 *ordinal2_ptr; 27362306a36Sopenharmony_ci} __packed; 27462306a36Sopenharmony_ci 27562306a36Sopenharmony_cistruct ipw2100_data_header { 27662306a36Sopenharmony_ci u32 host_command_reg; 27762306a36Sopenharmony_ci u32 host_command_reg1; 27862306a36Sopenharmony_ci u8 encrypted; // BOOLEAN in win! TRUE if frame is enc by driver 27962306a36Sopenharmony_ci u8 needs_encryption; // BOOLEAN in win! TRUE if frma need to be enc in NIC 28062306a36Sopenharmony_ci u8 wep_index; // 0 no key, 1-4 key index, 0xff immediate key 28162306a36Sopenharmony_ci u8 key_size; // 0 no imm key, 0x5 64bit encr, 0xd 128bit encr, 0x10 128bit encr and 128bit IV 28262306a36Sopenharmony_ci u8 key[16]; 28362306a36Sopenharmony_ci u8 reserved[10]; // f/w reserved 28462306a36Sopenharmony_ci u8 src_addr[ETH_ALEN]; 28562306a36Sopenharmony_ci u8 dst_addr[ETH_ALEN]; 28662306a36Sopenharmony_ci u16 fragment_size; 28762306a36Sopenharmony_ci} __packed; 28862306a36Sopenharmony_ci 28962306a36Sopenharmony_ci/* Host command data structure */ 29062306a36Sopenharmony_cistruct host_command { 29162306a36Sopenharmony_ci u32 host_command; // COMMAND ID 29262306a36Sopenharmony_ci u32 host_command1; // COMMAND ID 29362306a36Sopenharmony_ci u32 host_command_sequence; // UNIQUE COMMAND NUMBER (ID) 29462306a36Sopenharmony_ci u32 host_command_length; // LENGTH 29562306a36Sopenharmony_ci u32 host_command_parameters[HOST_COMMAND_PARAMS_REG_LEN]; // COMMAND PARAMETERS 29662306a36Sopenharmony_ci} __packed; 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_citypedef enum { 29962306a36Sopenharmony_ci POWER_ON_RESET, 30062306a36Sopenharmony_ci EXIT_POWER_DOWN_RESET, 30162306a36Sopenharmony_ci SW_RESET, 30262306a36Sopenharmony_ci EEPROM_RW, 30362306a36Sopenharmony_ci SW_RE_INIT 30462306a36Sopenharmony_ci} ipw2100_reset_event; 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_cienum { 30762306a36Sopenharmony_ci COMMAND = 0xCAFE, 30862306a36Sopenharmony_ci DATA, 30962306a36Sopenharmony_ci RX 31062306a36Sopenharmony_ci}; 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_cistruct ipw2100_tx_packet { 31362306a36Sopenharmony_ci int type; 31462306a36Sopenharmony_ci int index; 31562306a36Sopenharmony_ci union { 31662306a36Sopenharmony_ci struct { /* COMMAND */ 31762306a36Sopenharmony_ci struct ipw2100_cmd_header *cmd; 31862306a36Sopenharmony_ci dma_addr_t cmd_phys; 31962306a36Sopenharmony_ci } c_struct; 32062306a36Sopenharmony_ci struct { /* DATA */ 32162306a36Sopenharmony_ci struct ipw2100_data_header *data; 32262306a36Sopenharmony_ci dma_addr_t data_phys; 32362306a36Sopenharmony_ci struct libipw_txb *txb; 32462306a36Sopenharmony_ci } d_struct; 32562306a36Sopenharmony_ci } info; 32662306a36Sopenharmony_ci int jiffy_start; 32762306a36Sopenharmony_ci 32862306a36Sopenharmony_ci struct list_head list; 32962306a36Sopenharmony_ci}; 33062306a36Sopenharmony_ci 33162306a36Sopenharmony_cistruct ipw2100_rx_packet { 33262306a36Sopenharmony_ci struct ipw2100_rx *rxp; 33362306a36Sopenharmony_ci dma_addr_t dma_addr; 33462306a36Sopenharmony_ci int jiffy_start; 33562306a36Sopenharmony_ci struct sk_buff *skb; 33662306a36Sopenharmony_ci struct list_head list; 33762306a36Sopenharmony_ci}; 33862306a36Sopenharmony_ci 33962306a36Sopenharmony_ci#define FRAG_DISABLED (1<<31) 34062306a36Sopenharmony_ci#define RTS_DISABLED (1<<31) 34162306a36Sopenharmony_ci#define MAX_RTS_THRESHOLD 2304U 34262306a36Sopenharmony_ci#define MIN_RTS_THRESHOLD 1U 34362306a36Sopenharmony_ci#define DEFAULT_RTS_THRESHOLD 1000U 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_ci#define DEFAULT_BEACON_INTERVAL 100U 34662306a36Sopenharmony_ci#define DEFAULT_SHORT_RETRY_LIMIT 7U 34762306a36Sopenharmony_ci#define DEFAULT_LONG_RETRY_LIMIT 4U 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_cistruct ipw2100_ordinals { 35062306a36Sopenharmony_ci u32 table1_addr; 35162306a36Sopenharmony_ci u32 table2_addr; 35262306a36Sopenharmony_ci u32 table1_size; 35362306a36Sopenharmony_ci u32 table2_size; 35462306a36Sopenharmony_ci}; 35562306a36Sopenharmony_ci 35662306a36Sopenharmony_ci/* Host Notification header */ 35762306a36Sopenharmony_cistruct ipw2100_notification { 35862306a36Sopenharmony_ci u32 hnhdr_subtype; /* type of host notification */ 35962306a36Sopenharmony_ci u32 hnhdr_size; /* size in bytes of data 36062306a36Sopenharmony_ci or number of entries, if table. 36162306a36Sopenharmony_ci Does NOT include header */ 36262306a36Sopenharmony_ci} __packed; 36362306a36Sopenharmony_ci 36462306a36Sopenharmony_ci#define MAX_KEY_SIZE 16 36562306a36Sopenharmony_ci#define MAX_KEYS 8 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci#define IPW2100_WEP_ENABLE (1<<1) 36862306a36Sopenharmony_ci#define IPW2100_WEP_DROP_CLEAR (1<<2) 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ci#define IPW_NONE_CIPHER (1<<0) 37162306a36Sopenharmony_ci#define IPW_WEP40_CIPHER (1<<1) 37262306a36Sopenharmony_ci#define IPW_TKIP_CIPHER (1<<2) 37362306a36Sopenharmony_ci#define IPW_CCMP_CIPHER (1<<4) 37462306a36Sopenharmony_ci#define IPW_WEP104_CIPHER (1<<5) 37562306a36Sopenharmony_ci#define IPW_CKIP_CIPHER (1<<6) 37662306a36Sopenharmony_ci 37762306a36Sopenharmony_ci#define IPW_AUTH_OPEN 0 37862306a36Sopenharmony_ci#define IPW_AUTH_SHARED 1 37962306a36Sopenharmony_ci#define IPW_AUTH_LEAP 2 38062306a36Sopenharmony_ci#define IPW_AUTH_LEAP_CISCO_ID 0x80 38162306a36Sopenharmony_ci 38262306a36Sopenharmony_cistruct statistic { 38362306a36Sopenharmony_ci int value; 38462306a36Sopenharmony_ci int hi; 38562306a36Sopenharmony_ci int lo; 38662306a36Sopenharmony_ci}; 38762306a36Sopenharmony_ci 38862306a36Sopenharmony_ci#define INIT_STAT(x) do { \ 38962306a36Sopenharmony_ci (x)->value = (x)->hi = 0; \ 39062306a36Sopenharmony_ci (x)->lo = 0x7fffffff; \ 39162306a36Sopenharmony_ci} while (0) 39262306a36Sopenharmony_ci#define SET_STAT(x,y) do { \ 39362306a36Sopenharmony_ci (x)->value = y; \ 39462306a36Sopenharmony_ci if ((x)->value > (x)->hi) (x)->hi = (x)->value; \ 39562306a36Sopenharmony_ci if ((x)->value < (x)->lo) (x)->lo = (x)->value; \ 39662306a36Sopenharmony_ci} while (0) 39762306a36Sopenharmony_ci#define INC_STAT(x) do { if (++(x)->value > (x)->hi) (x)->hi = (x)->value; } \ 39862306a36Sopenharmony_ciwhile (0) 39962306a36Sopenharmony_ci#define DEC_STAT(x) do { if (--(x)->value < (x)->lo) (x)->lo = (x)->value; } \ 40062306a36Sopenharmony_ciwhile (0) 40162306a36Sopenharmony_ci 40262306a36Sopenharmony_ci#define IPW2100_ERROR_QUEUE 5 40362306a36Sopenharmony_ci 40462306a36Sopenharmony_ci/* Power management code: enable or disable? */ 40562306a36Sopenharmony_cienum { 40662306a36Sopenharmony_ci#ifdef CONFIG_PM 40762306a36Sopenharmony_ci IPW2100_PM_DISABLED = 0, 40862306a36Sopenharmony_ci PM_STATE_SIZE = 16, 40962306a36Sopenharmony_ci#else 41062306a36Sopenharmony_ci IPW2100_PM_DISABLED = 1, 41162306a36Sopenharmony_ci PM_STATE_SIZE = 0, 41262306a36Sopenharmony_ci#endif 41362306a36Sopenharmony_ci}; 41462306a36Sopenharmony_ci 41562306a36Sopenharmony_ci#define STATUS_POWERED (1<<0) 41662306a36Sopenharmony_ci#define STATUS_CMD_ACTIVE (1<<1) /**< host command in progress */ 41762306a36Sopenharmony_ci#define STATUS_RUNNING (1<<2) /* Card initialized, but not enabled */ 41862306a36Sopenharmony_ci#define STATUS_ENABLED (1<<3) /* Card enabled -- can scan,Tx,Rx */ 41962306a36Sopenharmony_ci#define STATUS_STOPPING (1<<4) /* Card is in shutdown phase */ 42062306a36Sopenharmony_ci#define STATUS_INITIALIZED (1<<5) /* Card is ready for external calls */ 42162306a36Sopenharmony_ci#define STATUS_ASSOCIATING (1<<9) /* Associated, but no BSSID yet */ 42262306a36Sopenharmony_ci#define STATUS_ASSOCIATED (1<<10) /* Associated and BSSID valid */ 42362306a36Sopenharmony_ci#define STATUS_INT_ENABLED (1<<11) 42462306a36Sopenharmony_ci#define STATUS_RF_KILL_HW (1<<12) 42562306a36Sopenharmony_ci#define STATUS_RF_KILL_SW (1<<13) 42662306a36Sopenharmony_ci#define STATUS_RF_KILL_MASK (STATUS_RF_KILL_HW | STATUS_RF_KILL_SW) 42762306a36Sopenharmony_ci#define STATUS_EXIT_PENDING (1<<14) 42862306a36Sopenharmony_ci 42962306a36Sopenharmony_ci#define STATUS_SCAN_PENDING (1<<23) 43062306a36Sopenharmony_ci#define STATUS_SCANNING (1<<24) 43162306a36Sopenharmony_ci#define STATUS_SCAN_ABORTING (1<<25) 43262306a36Sopenharmony_ci#define STATUS_SCAN_COMPLETE (1<<26) 43362306a36Sopenharmony_ci#define STATUS_WX_EVENT_PENDING (1<<27) 43462306a36Sopenharmony_ci#define STATUS_RESET_PENDING (1<<29) 43562306a36Sopenharmony_ci#define STATUS_SECURITY_UPDATED (1<<30) /* Security sync needed */ 43662306a36Sopenharmony_ci 43762306a36Sopenharmony_ci/* Internal NIC states */ 43862306a36Sopenharmony_ci#define IPW_STATE_INITIALIZED (1<<0) 43962306a36Sopenharmony_ci#define IPW_STATE_COUNTRY_FOUND (1<<1) 44062306a36Sopenharmony_ci#define IPW_STATE_ASSOCIATED (1<<2) 44162306a36Sopenharmony_ci#define IPW_STATE_ASSN_LOST (1<<3) 44262306a36Sopenharmony_ci#define IPW_STATE_ASSN_CHANGED (1<<4) 44362306a36Sopenharmony_ci#define IPW_STATE_SCAN_COMPLETE (1<<5) 44462306a36Sopenharmony_ci#define IPW_STATE_ENTERED_PSP (1<<6) 44562306a36Sopenharmony_ci#define IPW_STATE_LEFT_PSP (1<<7) 44662306a36Sopenharmony_ci#define IPW_STATE_RF_KILL (1<<8) 44762306a36Sopenharmony_ci#define IPW_STATE_DISABLED (1<<9) 44862306a36Sopenharmony_ci#define IPW_STATE_POWER_DOWN (1<<10) 44962306a36Sopenharmony_ci#define IPW_STATE_SCANNING (1<<11) 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci#define CFG_STATIC_CHANNEL (1<<0) /* Restrict assoc. to single channel */ 45262306a36Sopenharmony_ci#define CFG_STATIC_ESSID (1<<1) /* Restrict assoc. to single SSID */ 45362306a36Sopenharmony_ci#define CFG_STATIC_BSSID (1<<2) /* Restrict assoc. to single BSSID */ 45462306a36Sopenharmony_ci#define CFG_CUSTOM_MAC (1<<3) 45562306a36Sopenharmony_ci#define CFG_LONG_PREAMBLE (1<<4) 45662306a36Sopenharmony_ci#define CFG_ASSOCIATE (1<<6) 45762306a36Sopenharmony_ci#define CFG_FIXED_RATE (1<<7) 45862306a36Sopenharmony_ci#define CFG_ADHOC_CREATE (1<<8) 45962306a36Sopenharmony_ci#define CFG_PASSIVE_SCAN (1<<10) 46062306a36Sopenharmony_ci#ifdef CONFIG_IPW2100_MONITOR 46162306a36Sopenharmony_ci#define CFG_CRC_CHECK (1<<11) 46262306a36Sopenharmony_ci#endif 46362306a36Sopenharmony_ci 46462306a36Sopenharmony_ci#define CAP_SHARED_KEY (1<<0) /* Off = OPEN */ 46562306a36Sopenharmony_ci#define CAP_PRIVACY_ON (1<<1) /* Off = No privacy */ 46662306a36Sopenharmony_ci 46762306a36Sopenharmony_cistruct ipw2100_priv { 46862306a36Sopenharmony_ci void __iomem *ioaddr; 46962306a36Sopenharmony_ci 47062306a36Sopenharmony_ci int stop_hang_check; /* Set 1 when shutting down to kill hang_check */ 47162306a36Sopenharmony_ci int stop_rf_kill; /* Set 1 when shutting down to kill rf_kill */ 47262306a36Sopenharmony_ci 47362306a36Sopenharmony_ci struct libipw_device *ieee; 47462306a36Sopenharmony_ci unsigned long status; 47562306a36Sopenharmony_ci unsigned long config; 47662306a36Sopenharmony_ci unsigned long capability; 47762306a36Sopenharmony_ci 47862306a36Sopenharmony_ci /* Statistics */ 47962306a36Sopenharmony_ci int resets; 48062306a36Sopenharmony_ci time64_t reset_backoff; 48162306a36Sopenharmony_ci 48262306a36Sopenharmony_ci /* Context */ 48362306a36Sopenharmony_ci u8 essid[IW_ESSID_MAX_SIZE]; 48462306a36Sopenharmony_ci u8 essid_len; 48562306a36Sopenharmony_ci u8 bssid[ETH_ALEN]; 48662306a36Sopenharmony_ci u8 channel; 48762306a36Sopenharmony_ci int last_mode; 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci time64_t connect_start; 49062306a36Sopenharmony_ci time64_t last_reset; 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci u32 channel_mask; 49362306a36Sopenharmony_ci u32 fatal_error; 49462306a36Sopenharmony_ci u32 fatal_errors[IPW2100_ERROR_QUEUE]; 49562306a36Sopenharmony_ci u32 fatal_index; 49662306a36Sopenharmony_ci int eeprom_version; 49762306a36Sopenharmony_ci int firmware_version; 49862306a36Sopenharmony_ci unsigned long hw_features; 49962306a36Sopenharmony_ci int hangs; 50062306a36Sopenharmony_ci u32 last_rtc; 50162306a36Sopenharmony_ci int dump_raw; /* 1 to dump raw bytes in /sys/.../memory */ 50262306a36Sopenharmony_ci u8 *snapshot[0x30]; 50362306a36Sopenharmony_ci 50462306a36Sopenharmony_ci u8 mandatory_bssid_mac[ETH_ALEN]; 50562306a36Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 50662306a36Sopenharmony_ci 50762306a36Sopenharmony_ci int power_mode; 50862306a36Sopenharmony_ci 50962306a36Sopenharmony_ci int messages_sent; 51062306a36Sopenharmony_ci 51162306a36Sopenharmony_ci int short_retry_limit; 51262306a36Sopenharmony_ci int long_retry_limit; 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci u32 rts_threshold; 51562306a36Sopenharmony_ci u32 frag_threshold; 51662306a36Sopenharmony_ci 51762306a36Sopenharmony_ci int in_isr; 51862306a36Sopenharmony_ci 51962306a36Sopenharmony_ci u32 tx_rates; 52062306a36Sopenharmony_ci int tx_power; 52162306a36Sopenharmony_ci u32 beacon_interval; 52262306a36Sopenharmony_ci 52362306a36Sopenharmony_ci char nick[IW_ESSID_MAX_SIZE + 1]; 52462306a36Sopenharmony_ci 52562306a36Sopenharmony_ci struct ipw2100_status_queue status_queue; 52662306a36Sopenharmony_ci 52762306a36Sopenharmony_ci struct statistic txq_stat; 52862306a36Sopenharmony_ci struct statistic rxq_stat; 52962306a36Sopenharmony_ci struct ipw2100_bd_queue rx_queue; 53062306a36Sopenharmony_ci struct ipw2100_bd_queue tx_queue; 53162306a36Sopenharmony_ci struct ipw2100_rx_packet *rx_buffers; 53262306a36Sopenharmony_ci 53362306a36Sopenharmony_ci struct statistic fw_pend_stat; 53462306a36Sopenharmony_ci struct list_head fw_pend_list; 53562306a36Sopenharmony_ci 53662306a36Sopenharmony_ci struct statistic msg_free_stat; 53762306a36Sopenharmony_ci struct statistic msg_pend_stat; 53862306a36Sopenharmony_ci struct list_head msg_free_list; 53962306a36Sopenharmony_ci struct list_head msg_pend_list; 54062306a36Sopenharmony_ci struct ipw2100_tx_packet *msg_buffers; 54162306a36Sopenharmony_ci 54262306a36Sopenharmony_ci struct statistic tx_free_stat; 54362306a36Sopenharmony_ci struct statistic tx_pend_stat; 54462306a36Sopenharmony_ci struct list_head tx_free_list; 54562306a36Sopenharmony_ci struct list_head tx_pend_list; 54662306a36Sopenharmony_ci struct ipw2100_tx_packet *tx_buffers; 54762306a36Sopenharmony_ci 54862306a36Sopenharmony_ci struct ipw2100_ordinals ordinals; 54962306a36Sopenharmony_ci 55062306a36Sopenharmony_ci struct pci_dev *pci_dev; 55162306a36Sopenharmony_ci 55262306a36Sopenharmony_ci struct proc_dir_entry *dir_dev; 55362306a36Sopenharmony_ci 55462306a36Sopenharmony_ci struct net_device *net_dev; 55562306a36Sopenharmony_ci struct iw_statistics wstats; 55662306a36Sopenharmony_ci 55762306a36Sopenharmony_ci struct iw_public_data wireless_data; 55862306a36Sopenharmony_ci 55962306a36Sopenharmony_ci struct tasklet_struct irq_tasklet; 56062306a36Sopenharmony_ci 56162306a36Sopenharmony_ci struct delayed_work reset_work; 56262306a36Sopenharmony_ci struct delayed_work security_work; 56362306a36Sopenharmony_ci struct delayed_work wx_event_work; 56462306a36Sopenharmony_ci struct delayed_work hang_check; 56562306a36Sopenharmony_ci struct delayed_work rf_kill; 56662306a36Sopenharmony_ci struct delayed_work scan_event; 56762306a36Sopenharmony_ci 56862306a36Sopenharmony_ci int user_requested_scan; 56962306a36Sopenharmony_ci 57062306a36Sopenharmony_ci /* Track time in suspend, using CLOCK_BOOTTIME */ 57162306a36Sopenharmony_ci time64_t suspend_at; 57262306a36Sopenharmony_ci time64_t suspend_time; 57362306a36Sopenharmony_ci 57462306a36Sopenharmony_ci u32 interrupts; 57562306a36Sopenharmony_ci int tx_interrupts; 57662306a36Sopenharmony_ci int rx_interrupts; 57762306a36Sopenharmony_ci int inta_other; 57862306a36Sopenharmony_ci 57962306a36Sopenharmony_ci spinlock_t low_lock; 58062306a36Sopenharmony_ci struct mutex action_mutex; 58162306a36Sopenharmony_ci struct mutex adapter_mutex; 58262306a36Sopenharmony_ci 58362306a36Sopenharmony_ci wait_queue_head_t wait_command_queue; 58462306a36Sopenharmony_ci}; 58562306a36Sopenharmony_ci 58662306a36Sopenharmony_ci/********************************************************* 58762306a36Sopenharmony_ci * Host Command -> From Driver to FW 58862306a36Sopenharmony_ci *********************************************************/ 58962306a36Sopenharmony_ci 59062306a36Sopenharmony_ci/** 59162306a36Sopenharmony_ci * Host command identifiers 59262306a36Sopenharmony_ci */ 59362306a36Sopenharmony_ci#define HOST_COMPLETE 2 59462306a36Sopenharmony_ci#define SYSTEM_CONFIG 6 59562306a36Sopenharmony_ci#define SSID 8 59662306a36Sopenharmony_ci#define MANDATORY_BSSID 9 59762306a36Sopenharmony_ci#define AUTHENTICATION_TYPE 10 59862306a36Sopenharmony_ci#define ADAPTER_ADDRESS 11 59962306a36Sopenharmony_ci#define PORT_TYPE 12 60062306a36Sopenharmony_ci#define INTERNATIONAL_MODE 13 60162306a36Sopenharmony_ci#define CHANNEL 14 60262306a36Sopenharmony_ci#define RTS_THRESHOLD 15 60362306a36Sopenharmony_ci#define FRAG_THRESHOLD 16 60462306a36Sopenharmony_ci#define POWER_MODE 17 60562306a36Sopenharmony_ci#define TX_RATES 18 60662306a36Sopenharmony_ci#define BASIC_TX_RATES 19 60762306a36Sopenharmony_ci#define WEP_KEY_INFO 20 60862306a36Sopenharmony_ci#define WEP_KEY_INDEX 25 60962306a36Sopenharmony_ci#define WEP_FLAGS 26 61062306a36Sopenharmony_ci#define ADD_MULTICAST 27 61162306a36Sopenharmony_ci#define CLEAR_ALL_MULTICAST 28 61262306a36Sopenharmony_ci#define BEACON_INTERVAL 29 61362306a36Sopenharmony_ci#define ATIM_WINDOW 30 61462306a36Sopenharmony_ci#define CLEAR_STATISTICS 31 61562306a36Sopenharmony_ci#define SEND 33 61662306a36Sopenharmony_ci#define TX_POWER_INDEX 36 61762306a36Sopenharmony_ci#define BROADCAST_SCAN 43 61862306a36Sopenharmony_ci#define CARD_DISABLE 44 61962306a36Sopenharmony_ci#define PREFERRED_BSSID 45 62062306a36Sopenharmony_ci#define SET_SCAN_OPTIONS 46 62162306a36Sopenharmony_ci#define SCAN_DWELL_TIME 47 62262306a36Sopenharmony_ci#define SWEEP_TABLE 48 62362306a36Sopenharmony_ci#define AP_OR_STATION_TABLE 49 62462306a36Sopenharmony_ci#define GROUP_ORDINALS 50 62562306a36Sopenharmony_ci#define SHORT_RETRY_LIMIT 51 62662306a36Sopenharmony_ci#define LONG_RETRY_LIMIT 52 62762306a36Sopenharmony_ci 62862306a36Sopenharmony_ci#define HOST_PRE_POWER_DOWN 58 62962306a36Sopenharmony_ci#define CARD_DISABLE_PHY_OFF 61 63062306a36Sopenharmony_ci#define MSDU_TX_RATES 62 63162306a36Sopenharmony_ci 63262306a36Sopenharmony_ci/* Rogue AP Detection */ 63362306a36Sopenharmony_ci#define SET_STATION_STAT_BITS 64 63462306a36Sopenharmony_ci#define CLEAR_STATIONS_STAT_BITS 65 63562306a36Sopenharmony_ci#define LEAP_ROGUE_MODE 66 //TODO tbw replaced by CFG_LEAP_ROGUE_AP 63662306a36Sopenharmony_ci#define SET_SECURITY_INFORMATION 67 63762306a36Sopenharmony_ci#define DISASSOCIATION_BSSID 68 63862306a36Sopenharmony_ci#define SET_WPA_IE 69 63962306a36Sopenharmony_ci 64062306a36Sopenharmony_ci/* system configuration bit mask: */ 64162306a36Sopenharmony_ci#define IPW_CFG_MONITOR 0x00004 64262306a36Sopenharmony_ci#define IPW_CFG_PREAMBLE_AUTO 0x00010 64362306a36Sopenharmony_ci#define IPW_CFG_IBSS_AUTO_START 0x00020 64462306a36Sopenharmony_ci#define IPW_CFG_LOOPBACK 0x00100 64562306a36Sopenharmony_ci#define IPW_CFG_ANSWER_BCSSID_PROBE 0x00800 64662306a36Sopenharmony_ci#define IPW_CFG_BT_SIDEBAND_SIGNAL 0x02000 64762306a36Sopenharmony_ci#define IPW_CFG_802_1x_ENABLE 0x04000 64862306a36Sopenharmony_ci#define IPW_CFG_BSS_MASK 0x08000 64962306a36Sopenharmony_ci#define IPW_CFG_IBSS_MASK 0x10000 65062306a36Sopenharmony_ci 65162306a36Sopenharmony_ci#define IPW_SCAN_NOASSOCIATE (1<<0) 65262306a36Sopenharmony_ci#define IPW_SCAN_MIXED_CELL (1<<1) 65362306a36Sopenharmony_ci/* RESERVED (1<<2) */ 65462306a36Sopenharmony_ci#define IPW_SCAN_PASSIVE (1<<3) 65562306a36Sopenharmony_ci 65662306a36Sopenharmony_ci#define IPW_NIC_FATAL_ERROR 0x2A7F0 65762306a36Sopenharmony_ci#define IPW_ERROR_ADDR(x) (x & 0x3FFFF) 65862306a36Sopenharmony_ci#define IPW_ERROR_CODE(x) ((x & 0xFF000000) >> 24) 65962306a36Sopenharmony_ci#define IPW2100_ERR_C3_CORRUPTION (0x10 << 24) 66062306a36Sopenharmony_ci#define IPW2100_ERR_MSG_TIMEOUT (0x11 << 24) 66162306a36Sopenharmony_ci#define IPW2100_ERR_FW_LOAD (0x12 << 24) 66262306a36Sopenharmony_ci 66362306a36Sopenharmony_ci#define IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND 0x200 66462306a36Sopenharmony_ci#define IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0D80 66562306a36Sopenharmony_ci 66662306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_RX_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x40) 66762306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_RX_STATUS_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x44) 66862306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_RX_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x48) 66962306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_RX_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0xa0) 67062306a36Sopenharmony_ci 67162306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x00) 67262306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x04) 67362306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x80) 67462306a36Sopenharmony_ci 67562306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_RX_WRITE_INDEX \ 67662306a36Sopenharmony_ci (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x20) 67762306a36Sopenharmony_ci 67862306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX \ 67962306a36Sopenharmony_ci (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND) 68062306a36Sopenharmony_ci 68162306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x180) 68262306a36Sopenharmony_ci#define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x184) 68362306a36Sopenharmony_ci 68462306a36Sopenharmony_ci#define IPW2100_INTA_TX_TRANSFER (0x00000001) // Bit 0 (LSB) 68562306a36Sopenharmony_ci#define IPW2100_INTA_RX_TRANSFER (0x00000002) // Bit 1 68662306a36Sopenharmony_ci#define IPW2100_INTA_TX_COMPLETE (0x00000004) // Bit 2 68762306a36Sopenharmony_ci#define IPW2100_INTA_EVENT_INTERRUPT (0x00000008) // Bit 3 68862306a36Sopenharmony_ci#define IPW2100_INTA_STATUS_CHANGE (0x00000010) // Bit 4 68962306a36Sopenharmony_ci#define IPW2100_INTA_BEACON_PERIOD_EXPIRED (0x00000020) // Bit 5 69062306a36Sopenharmony_ci#define IPW2100_INTA_SLAVE_MODE_HOST_COMMAND_DONE (0x00010000) // Bit 16 69162306a36Sopenharmony_ci#define IPW2100_INTA_FW_INIT_DONE (0x01000000) // Bit 24 69262306a36Sopenharmony_ci#define IPW2100_INTA_FW_CALIBRATION_CALC (0x02000000) // Bit 25 69362306a36Sopenharmony_ci#define IPW2100_INTA_FATAL_ERROR (0x40000000) // Bit 30 69462306a36Sopenharmony_ci#define IPW2100_INTA_PARITY_ERROR (0x80000000) // Bit 31 (MSB) 69562306a36Sopenharmony_ci 69662306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_PRINCETON_RESET (0x00000001) 69762306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_FORCE_NMI (0x00000002) 69862306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_PCI_HOST_CLUSTER_FATAL_NMI (0x00000004) 69962306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_CORE_FATAL_NMI (0x00000008) 70062306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_SW_RESET (0x00000080) 70162306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_MASTER_DISABLED (0x00000100) 70262306a36Sopenharmony_ci#define IPW_AUX_HOST_RESET_REG_STOP_MASTER (0x00000200) 70362306a36Sopenharmony_ci 70462306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_CLOCK_READY (0x00000001) // Bit 0 (LSB) 70562306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY (0x00000002) // Bit 1 70662306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_INIT_DONE (0x00000004) // Bit 2 70762306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BITS_SYS_CONFIG (0x000007c0) // Bits 6-10 70862306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_BUS_TYPE (0x00000200) // Bit 9 70962306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_BAR0_BLOCK_SIZE (0x00000400) // Bit 10 71062306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_USB_MODE (0x20000000) // Bit 29 71162306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_HOST_FORCES_SYS_CLK (0x40000000) // Bit 30 71262306a36Sopenharmony_ci#define IPW_AUX_HOST_GP_CNTRL_BIT_FW_FORCES_SYS_CLK (0x80000000) // Bit 31 (MSB) 71362306a36Sopenharmony_ci 71462306a36Sopenharmony_ci#define IPW_BIT_GPIO_GPIO1_MASK 0x0000000C 71562306a36Sopenharmony_ci#define IPW_BIT_GPIO_GPIO3_MASK 0x000000C0 71662306a36Sopenharmony_ci#define IPW_BIT_GPIO_GPIO1_ENABLE 0x00000008 71762306a36Sopenharmony_ci#define IPW_BIT_GPIO_RF_KILL 0x00010000 71862306a36Sopenharmony_ci 71962306a36Sopenharmony_ci#define IPW_BIT_GPIO_LED_OFF 0x00002000 // Bit 13 = 1 72062306a36Sopenharmony_ci 72162306a36Sopenharmony_ci#define IPW_REG_DOMAIN_0_OFFSET 0x0000 72262306a36Sopenharmony_ci#define IPW_REG_DOMAIN_1_OFFSET IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND 72362306a36Sopenharmony_ci 72462306a36Sopenharmony_ci#define IPW_REG_INTA IPW_REG_DOMAIN_0_OFFSET + 0x0008 72562306a36Sopenharmony_ci#define IPW_REG_INTA_MASK IPW_REG_DOMAIN_0_OFFSET + 0x000C 72662306a36Sopenharmony_ci#define IPW_REG_INDIRECT_ACCESS_ADDRESS IPW_REG_DOMAIN_0_OFFSET + 0x0010 72762306a36Sopenharmony_ci#define IPW_REG_INDIRECT_ACCESS_DATA IPW_REG_DOMAIN_0_OFFSET + 0x0014 72862306a36Sopenharmony_ci#define IPW_REG_AUTOINCREMENT_ADDRESS IPW_REG_DOMAIN_0_OFFSET + 0x0018 72962306a36Sopenharmony_ci#define IPW_REG_AUTOINCREMENT_DATA IPW_REG_DOMAIN_0_OFFSET + 0x001C 73062306a36Sopenharmony_ci#define IPW_REG_RESET_REG IPW_REG_DOMAIN_0_OFFSET + 0x0020 73162306a36Sopenharmony_ci#define IPW_REG_GP_CNTRL IPW_REG_DOMAIN_0_OFFSET + 0x0024 73262306a36Sopenharmony_ci#define IPW_REG_GPIO IPW_REG_DOMAIN_0_OFFSET + 0x0030 73362306a36Sopenharmony_ci#define IPW_REG_FW_TYPE IPW_REG_DOMAIN_1_OFFSET + 0x0188 73462306a36Sopenharmony_ci#define IPW_REG_FW_VERSION IPW_REG_DOMAIN_1_OFFSET + 0x018C 73562306a36Sopenharmony_ci#define IPW_REG_FW_COMPATIBILITY_VERSION IPW_REG_DOMAIN_1_OFFSET + 0x0190 73662306a36Sopenharmony_ci 73762306a36Sopenharmony_ci#define IPW_REG_INDIRECT_ADDR_MASK 0x00FFFFFC 73862306a36Sopenharmony_ci 73962306a36Sopenharmony_ci#define IPW_INTERRUPT_MASK 0xC1010013 74062306a36Sopenharmony_ci 74162306a36Sopenharmony_ci#define IPW2100_CONTROL_REG 0x220000 74262306a36Sopenharmony_ci#define IPW2100_CONTROL_PHY_OFF 0x8 74362306a36Sopenharmony_ci 74462306a36Sopenharmony_ci#define IPW2100_COMMAND 0x00300004 74562306a36Sopenharmony_ci#define IPW2100_COMMAND_PHY_ON 0x0 74662306a36Sopenharmony_ci#define IPW2100_COMMAND_PHY_OFF 0x1 74762306a36Sopenharmony_ci 74862306a36Sopenharmony_ci/* in DEBUG_AREA, values of memory always 0xd55555d5 */ 74962306a36Sopenharmony_ci#define IPW_REG_DOA_DEBUG_AREA_START IPW_REG_DOMAIN_0_OFFSET + 0x0090 75062306a36Sopenharmony_ci#define IPW_REG_DOA_DEBUG_AREA_END IPW_REG_DOMAIN_0_OFFSET + 0x00FF 75162306a36Sopenharmony_ci#define IPW_DATA_DOA_DEBUG_VALUE 0xd55555d5 75262306a36Sopenharmony_ci 75362306a36Sopenharmony_ci#define IPW_INTERNAL_REGISTER_HALT_AND_RESET 0x003000e0 75462306a36Sopenharmony_ci 75562306a36Sopenharmony_ci#define IPW_WAIT_CLOCK_STABILIZATION_DELAY 50 // micro seconds 75662306a36Sopenharmony_ci#define IPW_WAIT_RESET_ARC_COMPLETE_DELAY 10 // micro seconds 75762306a36Sopenharmony_ci#define IPW_WAIT_RESET_MASTER_ASSERT_COMPLETE_DELAY 10 // micro seconds 75862306a36Sopenharmony_ci 75962306a36Sopenharmony_ci// BD ring queue read/write difference 76062306a36Sopenharmony_ci#define IPW_BD_QUEUE_W_R_MIN_SPARE 2 76162306a36Sopenharmony_ci 76262306a36Sopenharmony_ci#define IPW_CACHE_LINE_LENGTH_DEFAULT 0x80 76362306a36Sopenharmony_ci 76462306a36Sopenharmony_ci#define IPW_CARD_DISABLE_PHY_OFF_COMPLETE_WAIT 100 // 100 milli 76562306a36Sopenharmony_ci#define IPW_PREPARE_POWER_DOWN_COMPLETE_WAIT 100 // 100 milli 76662306a36Sopenharmony_ci 76762306a36Sopenharmony_ci#define IPW_HEADER_802_11_SIZE sizeof(struct libipw_hdr_3addr) 76862306a36Sopenharmony_ci#define IPW_MAX_80211_PAYLOAD_SIZE 2304U 76962306a36Sopenharmony_ci#define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 77062306a36Sopenharmony_ci#define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 77162306a36Sopenharmony_ci#define IPW_MIN_ACCEPTABLE_RX_FRAME_LENGTH 60 77262306a36Sopenharmony_ci#define IPW_MAX_ACCEPTABLE_RX_FRAME_LENGTH \ 77362306a36Sopenharmony_ci (IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH + IPW_HEADER_802_11_SIZE - \ 77462306a36Sopenharmony_ci sizeof(struct ethhdr)) 77562306a36Sopenharmony_ci 77662306a36Sopenharmony_ci#define IPW_802_11_FCS_LENGTH 4 77762306a36Sopenharmony_ci#define IPW_RX_NIC_BUFFER_LENGTH \ 77862306a36Sopenharmony_ci (IPW_MAX_802_11_PAYLOAD_LENGTH + IPW_HEADER_802_11_SIZE + \ 77962306a36Sopenharmony_ci IPW_802_11_FCS_LENGTH) 78062306a36Sopenharmony_ci 78162306a36Sopenharmony_ci#define IPW_802_11_PAYLOAD_OFFSET \ 78262306a36Sopenharmony_ci (sizeof(struct libipw_hdr_3addr) + \ 78362306a36Sopenharmony_ci sizeof(struct libipw_snap_hdr)) 78462306a36Sopenharmony_ci 78562306a36Sopenharmony_cistruct ipw2100_rx { 78662306a36Sopenharmony_ci union { 78762306a36Sopenharmony_ci unsigned char payload[IPW_RX_NIC_BUFFER_LENGTH]; 78862306a36Sopenharmony_ci struct libipw_hdr_4addr header; 78962306a36Sopenharmony_ci u32 status; 79062306a36Sopenharmony_ci struct ipw2100_notification notification; 79162306a36Sopenharmony_ci struct ipw2100_cmd_header command; 79262306a36Sopenharmony_ci } rx_data; 79362306a36Sopenharmony_ci} __packed; 79462306a36Sopenharmony_ci 79562306a36Sopenharmony_ci/* Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved */ 79662306a36Sopenharmony_ci#define TX_RATE_1_MBIT 0x0001 79762306a36Sopenharmony_ci#define TX_RATE_2_MBIT 0x0002 79862306a36Sopenharmony_ci#define TX_RATE_5_5_MBIT 0x0004 79962306a36Sopenharmony_ci#define TX_RATE_11_MBIT 0x0008 80062306a36Sopenharmony_ci#define TX_RATE_MASK 0x000F 80162306a36Sopenharmony_ci#define DEFAULT_TX_RATES 0x000F 80262306a36Sopenharmony_ci 80362306a36Sopenharmony_ci#define IPW_POWER_MODE_CAM 0x00 //(always on) 80462306a36Sopenharmony_ci#define IPW_POWER_INDEX_1 0x01 80562306a36Sopenharmony_ci#define IPW_POWER_INDEX_2 0x02 80662306a36Sopenharmony_ci#define IPW_POWER_INDEX_3 0x03 80762306a36Sopenharmony_ci#define IPW_POWER_INDEX_4 0x04 80862306a36Sopenharmony_ci#define IPW_POWER_INDEX_5 0x05 80962306a36Sopenharmony_ci#define IPW_POWER_AUTO 0x06 81062306a36Sopenharmony_ci#define IPW_POWER_MASK 0x0F 81162306a36Sopenharmony_ci#define IPW_POWER_ENABLED 0x10 81262306a36Sopenharmony_ci#define IPW_POWER_LEVEL(x) ((x) & IPW_POWER_MASK) 81362306a36Sopenharmony_ci 81462306a36Sopenharmony_ci#define IPW_TX_POWER_AUTO 0 81562306a36Sopenharmony_ci#define IPW_TX_POWER_ENHANCED 1 81662306a36Sopenharmony_ci 81762306a36Sopenharmony_ci#define IPW_TX_POWER_DEFAULT 32 81862306a36Sopenharmony_ci#define IPW_TX_POWER_MIN 0 81962306a36Sopenharmony_ci#define IPW_TX_POWER_MAX 16 82062306a36Sopenharmony_ci#define IPW_TX_POWER_MIN_DBM (-12) 82162306a36Sopenharmony_ci#define IPW_TX_POWER_MAX_DBM 16 82262306a36Sopenharmony_ci 82362306a36Sopenharmony_ci#define FW_SCAN_DONOT_ASSOCIATE 0x0001 // Dont Attempt to Associate after Scan 82462306a36Sopenharmony_ci#define FW_SCAN_PASSIVE 0x0008 // Force PASSSIVE Scan 82562306a36Sopenharmony_ci 82662306a36Sopenharmony_ci#define REG_MIN_CHANNEL 0 82762306a36Sopenharmony_ci#define REG_MAX_CHANNEL 14 82862306a36Sopenharmony_ci 82962306a36Sopenharmony_ci#define REG_CHANNEL_MASK 0x00003FFF 83062306a36Sopenharmony_ci#define IPW_IBSS_11B_DEFAULT_MASK 0x87ff 83162306a36Sopenharmony_ci 83262306a36Sopenharmony_ci#define DIVERSITY_EITHER 0 // Use both antennas 83362306a36Sopenharmony_ci#define DIVERSITY_ANTENNA_A 1 // Use antenna A 83462306a36Sopenharmony_ci#define DIVERSITY_ANTENNA_B 2 // Use antenna B 83562306a36Sopenharmony_ci 83662306a36Sopenharmony_ci#define HOST_COMMAND_WAIT 0 83762306a36Sopenharmony_ci#define HOST_COMMAND_NO_WAIT 1 83862306a36Sopenharmony_ci 83962306a36Sopenharmony_ci#define LOCK_NONE 0 84062306a36Sopenharmony_ci#define LOCK_DRIVER 1 84162306a36Sopenharmony_ci#define LOCK_FW 2 84262306a36Sopenharmony_ci 84362306a36Sopenharmony_ci#define TYPE_SWEEP_ORD 0x000D 84462306a36Sopenharmony_ci#define TYPE_IBSS_STTN_ORD 0x000E 84562306a36Sopenharmony_ci#define TYPE_BSS_AP_ORD 0x000F 84662306a36Sopenharmony_ci#define TYPE_RAW_BEACON_ENTRY 0x0010 84762306a36Sopenharmony_ci#define TYPE_CALIBRATION_DATA 0x0011 84862306a36Sopenharmony_ci#define TYPE_ROGUE_AP_DATA 0x0012 84962306a36Sopenharmony_ci#define TYPE_ASSOCIATION_REQUEST 0x0013 85062306a36Sopenharmony_ci#define TYPE_REASSOCIATION_REQUEST 0x0014 85162306a36Sopenharmony_ci 85262306a36Sopenharmony_ci#define HW_FEATURE_RFKILL 0x0001 85362306a36Sopenharmony_ci#define RF_KILLSWITCH_OFF 1 85462306a36Sopenharmony_ci#define RF_KILLSWITCH_ON 0 85562306a36Sopenharmony_ci 85662306a36Sopenharmony_ci#define IPW_COMMAND_POOL_SIZE 40 85762306a36Sopenharmony_ci 85862306a36Sopenharmony_ci#define IPW_START_ORD_TAB_1 1 85962306a36Sopenharmony_ci#define IPW_START_ORD_TAB_2 1000 86062306a36Sopenharmony_ci 86162306a36Sopenharmony_ci#define IPW_ORD_TAB_1_ENTRY_SIZE sizeof(u32) 86262306a36Sopenharmony_ci 86362306a36Sopenharmony_ci#define IS_ORDINAL_TABLE_ONE(mgr,id) \ 86462306a36Sopenharmony_ci ((id >= IPW_START_ORD_TAB_1) && (id < mgr->table1_size)) 86562306a36Sopenharmony_ci#define IS_ORDINAL_TABLE_TWO(mgr,id) \ 86662306a36Sopenharmony_ci ((id >= IPW_START_ORD_TAB_2) && (id < (mgr->table2_size + IPW_START_ORD_TAB_2))) 86762306a36Sopenharmony_ci 86862306a36Sopenharmony_ci#define BSS_ID_LENGTH 6 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci// Fixed size data: Ordinal Table 1 87162306a36Sopenharmony_citypedef enum _ORDINAL_TABLE_1 { // NS - means Not Supported by FW 87262306a36Sopenharmony_ci// Transmit statistics 87362306a36Sopenharmony_ci IPW_ORD_STAT_TX_HOST_REQUESTS = 1, // # of requested Host Tx's (MSDU) 87462306a36Sopenharmony_ci IPW_ORD_STAT_TX_HOST_COMPLETE, // # of successful Host Tx's (MSDU) 87562306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA, // # of successful Directed Tx's (MSDU) 87662306a36Sopenharmony_ci 87762306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA1 = 4, // # of successful Directed Tx's (MSDU) @ 1MB 87862306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA2, // # of successful Directed Tx's (MSDU) @ 2MB 87962306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA5_5, // # of successful Directed Tx's (MSDU) @ 5_5MB 88062306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA11, // # of successful Directed Tx's (MSDU) @ 11MB 88162306a36Sopenharmony_ci IPW_ORD_STAT_TX_DIR_DATA22, // # of successful Directed Tx's (MSDU) @ 22MB 88262306a36Sopenharmony_ci 88362306a36Sopenharmony_ci IPW_ORD_STAT_TX_NODIR_DATA1 = 13, // # of successful Non_Directed Tx's (MSDU) @ 1MB 88462306a36Sopenharmony_ci IPW_ORD_STAT_TX_NODIR_DATA2, // # of successful Non_Directed Tx's (MSDU) @ 2MB 88562306a36Sopenharmony_ci IPW_ORD_STAT_TX_NODIR_DATA5_5, // # of successful Non_Directed Tx's (MSDU) @ 5.5MB 88662306a36Sopenharmony_ci IPW_ORD_STAT_TX_NODIR_DATA11, // # of successful Non_Directed Tx's (MSDU) @ 11MB 88762306a36Sopenharmony_ci 88862306a36Sopenharmony_ci IPW_ORD_STAT_NULL_DATA = 21, // # of successful NULL data Tx's 88962306a36Sopenharmony_ci IPW_ORD_STAT_TX_RTS, // # of successful Tx RTS 89062306a36Sopenharmony_ci IPW_ORD_STAT_TX_CTS, // # of successful Tx CTS 89162306a36Sopenharmony_ci IPW_ORD_STAT_TX_ACK, // # of successful Tx ACK 89262306a36Sopenharmony_ci IPW_ORD_STAT_TX_ASSN, // # of successful Association Tx's 89362306a36Sopenharmony_ci IPW_ORD_STAT_TX_ASSN_RESP, // # of successful Association response Tx's 89462306a36Sopenharmony_ci IPW_ORD_STAT_TX_REASSN, // # of successful Reassociation Tx's 89562306a36Sopenharmony_ci IPW_ORD_STAT_TX_REASSN_RESP, // # of successful Reassociation response Tx's 89662306a36Sopenharmony_ci IPW_ORD_STAT_TX_PROBE, // # of probes successfully transmitted 89762306a36Sopenharmony_ci IPW_ORD_STAT_TX_PROBE_RESP, // # of probe responses successfully transmitted 89862306a36Sopenharmony_ci IPW_ORD_STAT_TX_BEACON, // # of tx beacon 89962306a36Sopenharmony_ci IPW_ORD_STAT_TX_ATIM, // # of Tx ATIM 90062306a36Sopenharmony_ci IPW_ORD_STAT_TX_DISASSN, // # of successful Disassociation TX 90162306a36Sopenharmony_ci IPW_ORD_STAT_TX_AUTH, // # of successful Authentication Tx 90262306a36Sopenharmony_ci IPW_ORD_STAT_TX_DEAUTH, // # of successful Deauthentication TX 90362306a36Sopenharmony_ci 90462306a36Sopenharmony_ci IPW_ORD_STAT_TX_TOTAL_BYTES = 41, // Total successful Tx data bytes 90562306a36Sopenharmony_ci IPW_ORD_STAT_TX_RETRIES, // # of Tx retries 90662306a36Sopenharmony_ci IPW_ORD_STAT_TX_RETRY1, // # of Tx retries at 1MBPS 90762306a36Sopenharmony_ci IPW_ORD_STAT_TX_RETRY2, // # of Tx retries at 2MBPS 90862306a36Sopenharmony_ci IPW_ORD_STAT_TX_RETRY5_5, // # of Tx retries at 5.5MBPS 90962306a36Sopenharmony_ci IPW_ORD_STAT_TX_RETRY11, // # of Tx retries at 11MBPS 91062306a36Sopenharmony_ci 91162306a36Sopenharmony_ci IPW_ORD_STAT_TX_FAILURES = 51, // # of Tx Failures 91262306a36Sopenharmony_ci IPW_ORD_STAT_TX_ABORT_AT_HOP, //NS // # of Tx's aborted at hop time 91362306a36Sopenharmony_ci IPW_ORD_STAT_TX_MAX_TRIES_IN_HOP, // # of times max tries in a hop failed 91462306a36Sopenharmony_ci IPW_ORD_STAT_TX_ABORT_LATE_DMA, //NS // # of times tx aborted due to late dma setup 91562306a36Sopenharmony_ci IPW_ORD_STAT_TX_ABORT_STX, //NS // # of times backoff aborted 91662306a36Sopenharmony_ci IPW_ORD_STAT_TX_DISASSN_FAIL, // # of times disassociation failed 91762306a36Sopenharmony_ci IPW_ORD_STAT_TX_ERR_CTS, // # of missed/bad CTS frames 91862306a36Sopenharmony_ci IPW_ORD_STAT_TX_BPDU, //NS // # of spanning tree BPDUs sent 91962306a36Sopenharmony_ci IPW_ORD_STAT_TX_ERR_ACK, // # of tx err due to acks 92062306a36Sopenharmony_ci 92162306a36Sopenharmony_ci // Receive statistics 92262306a36Sopenharmony_ci IPW_ORD_STAT_RX_HOST = 61, // # of packets passed to host 92362306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA, // # of directed packets 92462306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA1, // # of directed packets at 1MB 92562306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA2, // # of directed packets at 2MB 92662306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA5_5, // # of directed packets at 5.5MB 92762306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA11, // # of directed packets at 11MB 92862306a36Sopenharmony_ci IPW_ORD_STAT_RX_DIR_DATA22, // # of directed packets at 22MB 92962306a36Sopenharmony_ci 93062306a36Sopenharmony_ci IPW_ORD_STAT_RX_NODIR_DATA = 71, // # of nondirected packets 93162306a36Sopenharmony_ci IPW_ORD_STAT_RX_NODIR_DATA1, // # of nondirected packets at 1MB 93262306a36Sopenharmony_ci IPW_ORD_STAT_RX_NODIR_DATA2, // # of nondirected packets at 2MB 93362306a36Sopenharmony_ci IPW_ORD_STAT_RX_NODIR_DATA5_5, // # of nondirected packets at 5.5MB 93462306a36Sopenharmony_ci IPW_ORD_STAT_RX_NODIR_DATA11, // # of nondirected packets at 11MB 93562306a36Sopenharmony_ci 93662306a36Sopenharmony_ci IPW_ORD_STAT_RX_NULL_DATA = 80, // # of null data rx's 93762306a36Sopenharmony_ci IPW_ORD_STAT_RX_POLL, //NS // # of poll rx 93862306a36Sopenharmony_ci IPW_ORD_STAT_RX_RTS, // # of Rx RTS 93962306a36Sopenharmony_ci IPW_ORD_STAT_RX_CTS, // # of Rx CTS 94062306a36Sopenharmony_ci IPW_ORD_STAT_RX_ACK, // # of Rx ACK 94162306a36Sopenharmony_ci IPW_ORD_STAT_RX_CFEND, // # of Rx CF End 94262306a36Sopenharmony_ci IPW_ORD_STAT_RX_CFEND_ACK, // # of Rx CF End + CF Ack 94362306a36Sopenharmony_ci IPW_ORD_STAT_RX_ASSN, // # of Association Rx's 94462306a36Sopenharmony_ci IPW_ORD_STAT_RX_ASSN_RESP, // # of Association response Rx's 94562306a36Sopenharmony_ci IPW_ORD_STAT_RX_REASSN, // # of Reassociation Rx's 94662306a36Sopenharmony_ci IPW_ORD_STAT_RX_REASSN_RESP, // # of Reassociation response Rx's 94762306a36Sopenharmony_ci IPW_ORD_STAT_RX_PROBE, // # of probe Rx's 94862306a36Sopenharmony_ci IPW_ORD_STAT_RX_PROBE_RESP, // # of probe response Rx's 94962306a36Sopenharmony_ci IPW_ORD_STAT_RX_BEACON, // # of Rx beacon 95062306a36Sopenharmony_ci IPW_ORD_STAT_RX_ATIM, // # of Rx ATIM 95162306a36Sopenharmony_ci IPW_ORD_STAT_RX_DISASSN, // # of disassociation Rx 95262306a36Sopenharmony_ci IPW_ORD_STAT_RX_AUTH, // # of authentication Rx 95362306a36Sopenharmony_ci IPW_ORD_STAT_RX_DEAUTH, // # of deauthentication Rx 95462306a36Sopenharmony_ci 95562306a36Sopenharmony_ci IPW_ORD_STAT_RX_TOTAL_BYTES = 101, // Total rx data bytes received 95662306a36Sopenharmony_ci IPW_ORD_STAT_RX_ERR_CRC, // # of packets with Rx CRC error 95762306a36Sopenharmony_ci IPW_ORD_STAT_RX_ERR_CRC1, // # of Rx CRC errors at 1MB 95862306a36Sopenharmony_ci IPW_ORD_STAT_RX_ERR_CRC2, // # of Rx CRC errors at 2MB 95962306a36Sopenharmony_ci IPW_ORD_STAT_RX_ERR_CRC5_5, // # of Rx CRC errors at 5.5MB 96062306a36Sopenharmony_ci IPW_ORD_STAT_RX_ERR_CRC11, // # of Rx CRC errors at 11MB 96162306a36Sopenharmony_ci 96262306a36Sopenharmony_ci IPW_ORD_STAT_RX_DUPLICATE1 = 112, // # of duplicate rx packets at 1MB 96362306a36Sopenharmony_ci IPW_ORD_STAT_RX_DUPLICATE2, // # of duplicate rx packets at 2MB 96462306a36Sopenharmony_ci IPW_ORD_STAT_RX_DUPLICATE5_5, // # of duplicate rx packets at 5.5MB 96562306a36Sopenharmony_ci IPW_ORD_STAT_RX_DUPLICATE11, // # of duplicate rx packets at 11MB 96662306a36Sopenharmony_ci IPW_ORD_STAT_RX_DUPLICATE = 119, // # of duplicate rx packets 96762306a36Sopenharmony_ci 96862306a36Sopenharmony_ci IPW_ORD_PERS_DB_LOCK = 120, // # locking fw permanent db 96962306a36Sopenharmony_ci IPW_ORD_PERS_DB_SIZE, // # size of fw permanent db 97062306a36Sopenharmony_ci IPW_ORD_PERS_DB_ADDR, // # address of fw permanent db 97162306a36Sopenharmony_ci IPW_ORD_STAT_RX_INVALID_PROTOCOL, // # of rx frames with invalid protocol 97262306a36Sopenharmony_ci IPW_ORD_SYS_BOOT_TIME, // # Boot time 97362306a36Sopenharmony_ci IPW_ORD_STAT_RX_NO_BUFFER, // # of rx frames rejected due to no buffer 97462306a36Sopenharmony_ci IPW_ORD_STAT_RX_ABORT_LATE_DMA, //NS // # of rx frames rejected due to dma setup too late 97562306a36Sopenharmony_ci IPW_ORD_STAT_RX_ABORT_AT_HOP, //NS // # of rx frames aborted due to hop 97662306a36Sopenharmony_ci IPW_ORD_STAT_RX_MISSING_FRAG, // # of rx frames dropped due to missing fragment 97762306a36Sopenharmony_ci IPW_ORD_STAT_RX_ORPHAN_FRAG, // # of rx frames dropped due to non-sequential fragment 97862306a36Sopenharmony_ci IPW_ORD_STAT_RX_ORPHAN_FRAME, // # of rx frames dropped due to unmatched 1st frame 97962306a36Sopenharmony_ci IPW_ORD_STAT_RX_FRAG_AGEOUT, // # of rx frames dropped due to uncompleted frame 98062306a36Sopenharmony_ci IPW_ORD_STAT_RX_BAD_SSID, //NS // Bad SSID (unused) 98162306a36Sopenharmony_ci IPW_ORD_STAT_RX_ICV_ERRORS, // # of ICV errors during decryption 98262306a36Sopenharmony_ci 98362306a36Sopenharmony_ci// PSP Statistics 98462306a36Sopenharmony_ci IPW_ORD_STAT_PSP_SUSPENSION = 137, // # of times adapter suspended 98562306a36Sopenharmony_ci IPW_ORD_STAT_PSP_BCN_TIMEOUT, // # of beacon timeout 98662306a36Sopenharmony_ci IPW_ORD_STAT_PSP_POLL_TIMEOUT, // # of poll response timeouts 98762306a36Sopenharmony_ci IPW_ORD_STAT_PSP_NONDIR_TIMEOUT, // # of timeouts waiting for last broadcast/muticast pkt 98862306a36Sopenharmony_ci IPW_ORD_STAT_PSP_RX_DTIMS, // # of PSP DTIMs received 98962306a36Sopenharmony_ci IPW_ORD_STAT_PSP_RX_TIMS, // # of PSP TIMs received 99062306a36Sopenharmony_ci IPW_ORD_STAT_PSP_STATION_ID, // PSP Station ID 99162306a36Sopenharmony_ci 99262306a36Sopenharmony_ci// Association and roaming 99362306a36Sopenharmony_ci IPW_ORD_LAST_ASSN_TIME = 147, // RTC time of last association 99462306a36Sopenharmony_ci IPW_ORD_STAT_PERCENT_MISSED_BCNS, // current calculation of % missed beacons 99562306a36Sopenharmony_ci IPW_ORD_STAT_PERCENT_RETRIES, // current calculation of % missed tx retries 99662306a36Sopenharmony_ci IPW_ORD_ASSOCIATED_AP_PTR, // If associated, this is ptr to the associated 99762306a36Sopenharmony_ci // AP table entry. set to 0 if not associated 99862306a36Sopenharmony_ci IPW_ORD_AVAILABLE_AP_CNT, // # of AP's described in the AP table 99962306a36Sopenharmony_ci IPW_ORD_AP_LIST_PTR, // Ptr to list of available APs 100062306a36Sopenharmony_ci IPW_ORD_STAT_AP_ASSNS, // # of associations 100162306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_FAIL, // # of association failures 100262306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_RESP_FAIL, // # of failuresdue to response fail 100362306a36Sopenharmony_ci IPW_ORD_STAT_FULL_SCANS, // # of full scans 100462306a36Sopenharmony_ci 100562306a36Sopenharmony_ci IPW_ORD_CARD_DISABLED, // # Card Disabled 100662306a36Sopenharmony_ci IPW_ORD_STAT_ROAM_INHIBIT, // # of times roaming was inhibited due to ongoing activity 100762306a36Sopenharmony_ci IPW_FILLER_40, 100862306a36Sopenharmony_ci IPW_ORD_RSSI_AT_ASSN = 160, // RSSI of associated AP at time of association 100962306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE1, // # of reassociations due to no tx from AP in last N 101062306a36Sopenharmony_ci // hops or no prob_ responses in last 3 minutes 101162306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE2, // # of reassociations due to poor tx/rx quality 101262306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE3, // # of reassociations due to tx/rx quality with excessive 101362306a36Sopenharmony_ci // load at the AP 101462306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE4, // # of reassociations due to AP RSSI level fell below 101562306a36Sopenharmony_ci // eligible group 101662306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE5, // # of reassociations due to load leveling 101762306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_CAUSE6, //NS // # of reassociations due to dropped by Ap 101862306a36Sopenharmony_ci IPW_FILLER_41, 101962306a36Sopenharmony_ci IPW_FILLER_42, 102062306a36Sopenharmony_ci IPW_FILLER_43, 102162306a36Sopenharmony_ci IPW_ORD_STAT_AUTH_FAIL, // # of times authentication failed 102262306a36Sopenharmony_ci IPW_ORD_STAT_AUTH_RESP_FAIL, // # of times authentication response failed 102362306a36Sopenharmony_ci IPW_ORD_STATION_TABLE_CNT, // # of entries in association table 102462306a36Sopenharmony_ci 102562306a36Sopenharmony_ci// Other statistics 102662306a36Sopenharmony_ci IPW_ORD_RSSI_AVG_CURR = 173, // Current avg RSSI 102762306a36Sopenharmony_ci IPW_ORD_STEST_RESULTS_CURR, //NS // Current self test results word 102862306a36Sopenharmony_ci IPW_ORD_STEST_RESULTS_CUM, //NS // Cummulative self test results word 102962306a36Sopenharmony_ci IPW_ORD_SELF_TEST_STATUS, //NS // 103062306a36Sopenharmony_ci IPW_ORD_POWER_MGMT_MODE, // Power mode - 0=CAM, 1=PSP 103162306a36Sopenharmony_ci IPW_ORD_POWER_MGMT_INDEX, //NS // 103262306a36Sopenharmony_ci IPW_ORD_COUNTRY_CODE, // IEEE country code as recv'd from beacon 103362306a36Sopenharmony_ci IPW_ORD_COUNTRY_CHANNELS, // channels supported by country 103462306a36Sopenharmony_ci// IPW_ORD_COUNTRY_CHANNELS: 103562306a36Sopenharmony_ci// For 11b the lower 2-byte are used for channels from 1-14 103662306a36Sopenharmony_ci// and the higher 2-byte are not used. 103762306a36Sopenharmony_ci IPW_ORD_RESET_CNT, // # of adapter resets (warm) 103862306a36Sopenharmony_ci IPW_ORD_BEACON_INTERVAL, // Beacon interval 103962306a36Sopenharmony_ci 104062306a36Sopenharmony_ci IPW_ORD_PRINCETON_VERSION = 184, //NS // Princeton Version 104162306a36Sopenharmony_ci IPW_ORD_ANTENNA_DIVERSITY, // TRUE if antenna diversity is disabled 104262306a36Sopenharmony_ci IPW_ORD_CCA_RSSI, //NS // CCA RSSI value (factory programmed) 104362306a36Sopenharmony_ci IPW_ORD_STAT_EEPROM_UPDATE, //NS // # of times config EEPROM updated 104462306a36Sopenharmony_ci IPW_ORD_DTIM_PERIOD, // # of beacon intervals between DTIMs 104562306a36Sopenharmony_ci IPW_ORD_OUR_FREQ, // current radio freq lower digits - channel ID 104662306a36Sopenharmony_ci 104762306a36Sopenharmony_ci IPW_ORD_RTC_TIME = 190, // current RTC time 104862306a36Sopenharmony_ci IPW_ORD_PORT_TYPE, // operating mode 104962306a36Sopenharmony_ci IPW_ORD_CURRENT_TX_RATE, // current tx rate 105062306a36Sopenharmony_ci IPW_ORD_SUPPORTED_RATES, // Bitmap of supported tx rates 105162306a36Sopenharmony_ci IPW_ORD_ATIM_WINDOW, // current ATIM Window 105262306a36Sopenharmony_ci IPW_ORD_BASIC_RATES, // bitmap of basic tx rates 105362306a36Sopenharmony_ci IPW_ORD_NIC_HIGHEST_RATE, // bitmap of basic tx rates 105462306a36Sopenharmony_ci IPW_ORD_AP_HIGHEST_RATE, // bitmap of basic tx rates 105562306a36Sopenharmony_ci IPW_ORD_CAPABILITIES, // Management frame capability field 105662306a36Sopenharmony_ci IPW_ORD_AUTH_TYPE, // Type of authentication 105762306a36Sopenharmony_ci IPW_ORD_RADIO_TYPE, // Adapter card platform type 105862306a36Sopenharmony_ci IPW_ORD_RTS_THRESHOLD = 201, // Min length of packet after which RTS handshaking is used 105962306a36Sopenharmony_ci IPW_ORD_INT_MODE, // International mode 106062306a36Sopenharmony_ci IPW_ORD_FRAGMENTATION_THRESHOLD, // protocol frag threshold 106162306a36Sopenharmony_ci IPW_ORD_EEPROM_SRAM_DB_BLOCK_START_ADDRESS, // EEPROM offset in SRAM 106262306a36Sopenharmony_ci IPW_ORD_EEPROM_SRAM_DB_BLOCK_SIZE, // EEPROM size in SRAM 106362306a36Sopenharmony_ci IPW_ORD_EEPROM_SKU_CAPABILITY, // EEPROM SKU Capability 206 = 106462306a36Sopenharmony_ci IPW_ORD_EEPROM_IBSS_11B_CHANNELS, // EEPROM IBSS 11b channel set 106562306a36Sopenharmony_ci 106662306a36Sopenharmony_ci IPW_ORD_MAC_VERSION = 209, // MAC Version 106762306a36Sopenharmony_ci IPW_ORD_MAC_REVISION, // MAC Revision 106862306a36Sopenharmony_ci IPW_ORD_RADIO_VERSION, // Radio Version 106962306a36Sopenharmony_ci IPW_ORD_NIC_MANF_DATE_TIME, // MANF Date/Time STAMP 107062306a36Sopenharmony_ci IPW_ORD_UCODE_VERSION, // Ucode Version 107162306a36Sopenharmony_ci IPW_ORD_HW_RF_SWITCH_STATE = 214, // HW RF Kill Switch State 107262306a36Sopenharmony_ci} ORDINALTABLE1; 107362306a36Sopenharmony_ci 107462306a36Sopenharmony_ci// ordinal table 2 107562306a36Sopenharmony_ci// Variable length data: 107662306a36Sopenharmony_ci#define IPW_FIRST_VARIABLE_LENGTH_ORDINAL 1001 107762306a36Sopenharmony_ci 107862306a36Sopenharmony_citypedef enum _ORDINAL_TABLE_2 { // NS - means Not Supported by FW 107962306a36Sopenharmony_ci IPW_ORD_STAT_BASE = 1000, // contains number of variable ORDs 108062306a36Sopenharmony_ci IPW_ORD_STAT_ADAPTER_MAC = 1001, // 6 bytes: our adapter MAC address 108162306a36Sopenharmony_ci IPW_ORD_STAT_PREFERRED_BSSID = 1002, // 6 bytes: BSSID of the preferred AP 108262306a36Sopenharmony_ci IPW_ORD_STAT_MANDATORY_BSSID = 1003, // 6 bytes: BSSID of the mandatory AP 108362306a36Sopenharmony_ci IPW_FILL_1, //NS // 108462306a36Sopenharmony_ci IPW_ORD_STAT_COUNTRY_TEXT = 1005, // 36 bytes: Country name text, First two bytes are Country code 108562306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_SSID = 1006, // 32 bytes: ESSID String 108662306a36Sopenharmony_ci IPW_ORD_STATION_TABLE = 1007, // ? bytes: Station/AP table (via Direct SSID Scans) 108762306a36Sopenharmony_ci IPW_ORD_STAT_SWEEP_TABLE = 1008, // ? bytes: Sweep/Host Table table (via Broadcast Scans) 108862306a36Sopenharmony_ci IPW_ORD_STAT_ROAM_LOG = 1009, // ? bytes: Roaming log 108962306a36Sopenharmony_ci IPW_ORD_STAT_RATE_LOG = 1010, //NS // 0 bytes: Rate log 109062306a36Sopenharmony_ci IPW_ORD_STAT_FIFO = 1011, //NS // 0 bytes: Fifo buffer data structures 109162306a36Sopenharmony_ci IPW_ORD_STAT_FW_VER_NUM = 1012, // 14 bytes: fw version ID string as in (a.bb.ccc; "0.08.011") 109262306a36Sopenharmony_ci IPW_ORD_STAT_FW_DATE = 1013, // 14 bytes: fw date string (mmm dd yyyy; "Mar 13 2002") 109362306a36Sopenharmony_ci IPW_ORD_STAT_ASSN_AP_BSSID = 1014, // 6 bytes: MAC address of associated AP 109462306a36Sopenharmony_ci IPW_ORD_STAT_DEBUG = 1015, //NS // ? bytes: 109562306a36Sopenharmony_ci IPW_ORD_STAT_NIC_BPA_NUM = 1016, // 11 bytes: NIC BPA number in ASCII 109662306a36Sopenharmony_ci IPW_ORD_STAT_UCODE_DATE = 1017, // 5 bytes: uCode date 109762306a36Sopenharmony_ci IPW_ORD_SECURITY_NGOTIATION_RESULT = 1018, 109862306a36Sopenharmony_ci} ORDINALTABLE2; // NS - means Not Supported by FW 109962306a36Sopenharmony_ci 110062306a36Sopenharmony_ci#define IPW_LAST_VARIABLE_LENGTH_ORDINAL 1018 110162306a36Sopenharmony_ci 110262306a36Sopenharmony_ci#ifndef WIRELESS_SPY 110362306a36Sopenharmony_ci#define WIRELESS_SPY // enable iwspy support 110462306a36Sopenharmony_ci#endif 110562306a36Sopenharmony_ci 110662306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA0 0x0002f200 110762306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA0_END 0x0002f510 // 0x310 bytes 110862306a36Sopenharmony_ci 110962306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA1 0x0002f610 111062306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA1_END 0x0002f630 // 0x20 bytes 111162306a36Sopenharmony_ci 111262306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA2 0x0002fa00 111362306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA2_END 0x0002fa20 // 0x20 bytes 111462306a36Sopenharmony_ci 111562306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA3 0x0002fc00 111662306a36Sopenharmony_ci#define IPW_HOST_FW_SHARED_AREA3_END 0x0002fc10 // 0x10 bytes 111762306a36Sopenharmony_ci 111862306a36Sopenharmony_ci#define IPW_HOST_FW_INTERRUPT_AREA 0x0002ff80 111962306a36Sopenharmony_ci#define IPW_HOST_FW_INTERRUPT_AREA_END 0x00030000 // 0x80 bytes 112062306a36Sopenharmony_ci 112162306a36Sopenharmony_cistruct ipw2100_fw_chunk { 112262306a36Sopenharmony_ci unsigned char *buf; 112362306a36Sopenharmony_ci long len; 112462306a36Sopenharmony_ci long pos; 112562306a36Sopenharmony_ci struct list_head list; 112662306a36Sopenharmony_ci}; 112762306a36Sopenharmony_ci 112862306a36Sopenharmony_cistruct ipw2100_fw_chunk_set { 112962306a36Sopenharmony_ci const void *data; 113062306a36Sopenharmony_ci unsigned long size; 113162306a36Sopenharmony_ci}; 113262306a36Sopenharmony_ci 113362306a36Sopenharmony_cistruct ipw2100_fw { 113462306a36Sopenharmony_ci int version; 113562306a36Sopenharmony_ci struct ipw2100_fw_chunk_set fw; 113662306a36Sopenharmony_ci struct ipw2100_fw_chunk_set uc; 113762306a36Sopenharmony_ci const struct firmware *fw_entry; 113862306a36Sopenharmony_ci}; 113962306a36Sopenharmony_ci 114062306a36Sopenharmony_ci#define MAX_FW_VERSION_LEN 14 114162306a36Sopenharmony_ci 114262306a36Sopenharmony_ci#endif /* _IPW2100_H */ 1143