aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2200.h')
-rw-r--r--drivers/net/wireless/ipw2200.h457
1 files changed, 303 insertions, 154 deletions
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index 243b8ea14140..9dbd73a42094 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -161,6 +161,16 @@ enum connection_manager_assoc_states {
161 * TX Queue Flag Definitions 161 * TX Queue Flag Definitions
162 */ 162 */
163 163
164/* tx wep key definition */
165#define DCT_WEP_KEY_NOT_IMMIDIATE 0x00
166#define DCT_WEP_KEY_64Bit 0x40
167#define DCT_WEP_KEY_128Bit 0x80
168#define DCT_WEP_KEY_128bitIV 0xC0
169#define DCT_WEP_KEY_SIZE_MASK 0xC0
170
171#define DCT_WEP_KEY_INDEX_MASK 0x0F
172#define DCT_WEP_INDEX_USE_IMMEDIATE 0x20
173
164/* abort attempt if mgmt frame is rx'd */ 174/* abort attempt if mgmt frame is rx'd */
165#define DCT_FLAG_ABORT_MGMT 0x01 175#define DCT_FLAG_ABORT_MGMT 0x01
166 176
@@ -186,9 +196,23 @@ enum connection_manager_assoc_states {
186/* ACK rx is expected to follow */ 196/* ACK rx is expected to follow */
187#define DCT_FLAG_ACK_REQD 0x80 197#define DCT_FLAG_ACK_REQD 0x80
188 198
199/* TX flags extension */
189#define DCT_FLAG_EXT_MODE_CCK 0x01 200#define DCT_FLAG_EXT_MODE_CCK 0x01
190#define DCT_FLAG_EXT_MODE_OFDM 0x00 201#define DCT_FLAG_EXT_MODE_OFDM 0x00
191 202
203#define DCT_FLAG_EXT_SECURITY_WEP 0x00
204#define DCT_FLAG_EXT_SECURITY_NO DCT_FLAG_EXT_SECURITY_WEP
205#define DCT_FLAG_EXT_SECURITY_CKIP 0x04
206#define DCT_FLAG_EXT_SECURITY_CCM 0x08
207#define DCT_FLAG_EXT_SECURITY_TKIP 0x0C
208#define DCT_FLAG_EXT_SECURITY_MASK 0x0C
209
210#define DCT_FLAG_EXT_QOS_ENABLED 0x10
211
212#define DCT_FLAG_EXT_HC_NO_SIFS_PIFS 0x00
213#define DCT_FLAG_EXT_HC_SIFS 0x20
214#define DCT_FLAG_EXT_HC_PIFS 0x40
215
192#define TX_RX_TYPE_MASK 0xFF 216#define TX_RX_TYPE_MASK 0xFF
193#define TX_FRAME_TYPE 0x00 217#define TX_FRAME_TYPE 0x00
194#define TX_HOST_COMMAND_TYPE 0x01 218#define TX_HOST_COMMAND_TYPE 0x01
@@ -234,6 +258,117 @@ enum connection_manager_assoc_states {
234#define DCR_TYPE_SNIFFER 0x06 258#define DCR_TYPE_SNIFFER 0x06
235#define DCR_TYPE_MU_BSS DCR_TYPE_MU_ESS 259#define DCR_TYPE_MU_BSS DCR_TYPE_MU_ESS
236 260
261/* QoS definitions */
262
263#define CW_MIN_OFDM 15
264#define CW_MAX_OFDM 1023
265#define CW_MIN_CCK 31
266#define CW_MAX_CCK 1023
267
268#define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM
269#define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM
270#define QOS_TX2_CW_MIN_OFDM ( (CW_MIN_OFDM + 1) / 2 - 1 )
271#define QOS_TX3_CW_MIN_OFDM ( (CW_MIN_OFDM + 1) / 4 - 1 )
272
273#define QOS_TX0_CW_MIN_CCK CW_MIN_CCK
274#define QOS_TX1_CW_MIN_CCK CW_MIN_CCK
275#define QOS_TX2_CW_MIN_CCK ( (CW_MIN_CCK + 1) / 2 - 1 )
276#define QOS_TX3_CW_MIN_CCK ( (CW_MIN_CCK + 1) / 4 - 1 )
277
278#define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM
279#define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM
280#define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM
281#define QOS_TX3_CW_MAX_OFDM ( (CW_MIN_OFDM + 1) / 2 - 1 )
282
283#define QOS_TX0_CW_MAX_CCK CW_MAX_CCK
284#define QOS_TX1_CW_MAX_CCK CW_MAX_CCK
285#define QOS_TX2_CW_MAX_CCK CW_MIN_CCK
286#define QOS_TX3_CW_MAX_CCK ( (CW_MIN_CCK + 1) / 2 - 1 )
287
288#define QOS_TX0_AIFS (3 - QOS_AIFSN_MIN_VALUE)
289#define QOS_TX1_AIFS (7 - QOS_AIFSN_MIN_VALUE)
290#define QOS_TX2_AIFS (2 - QOS_AIFSN_MIN_VALUE)
291#define QOS_TX3_AIFS (2 - QOS_AIFSN_MIN_VALUE)
292
293#define QOS_TX0_ACM 0
294#define QOS_TX1_ACM 0
295#define QOS_TX2_ACM 0
296#define QOS_TX3_ACM 0
297
298#define QOS_TX0_TXOP_LIMIT_CCK 0
299#define QOS_TX1_TXOP_LIMIT_CCK 0
300#define QOS_TX2_TXOP_LIMIT_CCK 6016
301#define QOS_TX3_TXOP_LIMIT_CCK 3264
302
303#define QOS_TX0_TXOP_LIMIT_OFDM 0
304#define QOS_TX1_TXOP_LIMIT_OFDM 0
305#define QOS_TX2_TXOP_LIMIT_OFDM 3008
306#define QOS_TX3_TXOP_LIMIT_OFDM 1504
307
308#define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM
309#define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM
310#define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM
311#define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM
312
313#define DEF_TX0_CW_MIN_CCK CW_MIN_CCK
314#define DEF_TX1_CW_MIN_CCK CW_MIN_CCK
315#define DEF_TX2_CW_MIN_CCK CW_MIN_CCK
316#define DEF_TX3_CW_MIN_CCK CW_MIN_CCK
317
318#define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM
319#define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM
320#define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM
321#define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM
322
323#define DEF_TX0_CW_MAX_CCK CW_MAX_CCK
324#define DEF_TX1_CW_MAX_CCK CW_MAX_CCK
325#define DEF_TX2_CW_MAX_CCK CW_MAX_CCK
326#define DEF_TX3_CW_MAX_CCK CW_MAX_CCK
327
328#define DEF_TX0_AIFS 0
329#define DEF_TX1_AIFS 0
330#define DEF_TX2_AIFS 0
331#define DEF_TX3_AIFS 0
332
333#define DEF_TX0_ACM 0
334#define DEF_TX1_ACM 0
335#define DEF_TX2_ACM 0
336#define DEF_TX3_ACM 0
337
338#define DEF_TX0_TXOP_LIMIT_CCK 0
339#define DEF_TX1_TXOP_LIMIT_CCK 0
340#define DEF_TX2_TXOP_LIMIT_CCK 0
341#define DEF_TX3_TXOP_LIMIT_CCK 0
342
343#define DEF_TX0_TXOP_LIMIT_OFDM 0
344#define DEF_TX1_TXOP_LIMIT_OFDM 0
345#define DEF_TX2_TXOP_LIMIT_OFDM 0
346#define DEF_TX3_TXOP_LIMIT_OFDM 0
347
348#define QOS_QOS_SETS 3
349#define QOS_PARAM_SET_ACTIVE 0
350#define QOS_PARAM_SET_DEF_CCK 1
351#define QOS_PARAM_SET_DEF_OFDM 2
352
353#define CTRL_QOS_NO_ACK (0x0020)
354
355#define IPW_TX_QUEUE_1 1
356#define IPW_TX_QUEUE_2 2
357#define IPW_TX_QUEUE_3 3
358#define IPW_TX_QUEUE_4 4
359
360/* QoS sturctures */
361struct ipw_qos_info {
362 int qos_enable;
363 struct ieee80211_qos_parameters *def_qos_parm_OFDM;
364 struct ieee80211_qos_parameters *def_qos_parm_CCK;
365 u32 burst_duration_CCK;
366 u32 burst_duration_OFDM;
367 u16 qos_no_ack_mask;
368 int burst_enable;
369};
370
371/**************************************************************/
237/** 372/**
238 * Generic queue structure 373 * Generic queue structure
239 * 374 *
@@ -658,6 +793,19 @@ struct ipw_multicast_addr {
658 u8 mac4[6]; 793 u8 mac4[6];
659} __attribute__ ((packed)); 794} __attribute__ ((packed));
660 795
796#define DCW_WEP_KEY_INDEX_MASK 0x03 /* bits [0:1] */
797#define DCW_WEP_KEY_SEC_TYPE_MASK 0x30 /* bits [4:5] */
798
799#define DCW_WEP_KEY_SEC_TYPE_WEP 0x00
800#define DCW_WEP_KEY_SEC_TYPE_CCM 0x20
801#define DCW_WEP_KEY_SEC_TYPE_TKIP 0x30
802
803#define DCW_WEP_KEY_INVALID_SIZE 0x00 /* 0 = Invalid key */
804#define DCW_WEP_KEY64Bit_SIZE 0x05 /* 64-bit encryption */
805#define DCW_WEP_KEY128Bit_SIZE 0x0D /* 128-bit encryption */
806#define DCW_CCM_KEY128Bit_SIZE 0x10 /* 128-bit key */
807//#define DCW_WEP_KEY128BitIV_SIZE 0x10 /* 128-bit key and 128-bit IV */
808
661struct ipw_wep_key { 809struct ipw_wep_key {
662 u8 cmd_id; 810 u8 cmd_id;
663 u8 seq_num; 811 u8 seq_num;
@@ -819,14 +967,6 @@ struct ipw_tx_power {
819 struct ipw_channel_tx_power channels_tx_power[MAX_A_CHANNELS]; 967 struct ipw_channel_tx_power channels_tx_power[MAX_A_CHANNELS];
820} __attribute__ ((packed)); 968} __attribute__ ((packed));
821 969
822struct ipw_qos_parameters {
823 u16 cw_min[4];
824 u16 cw_max[4];
825 u8 aifs[4];
826 u8 flag[4];
827 u16 tx_op_limit[4];
828} __attribute__ ((packed));
829
830struct ipw_rsn_capabilities { 970struct ipw_rsn_capabilities {
831 u8 id; 971 u8 id;
832 u8 length; 972 u8 length;
@@ -910,6 +1050,8 @@ struct ipw_cmd {
910#define CFG_ADHOC_CREATE (1<<8) 1050#define CFG_ADHOC_CREATE (1<<8)
911#define CFG_NO_LED (1<<9) 1051#define CFG_NO_LED (1<<9)
912#define CFG_BACKGROUND_SCAN (1<<10) 1052#define CFG_BACKGROUND_SCAN (1<<10)
1053#define CFG_SPEED_SCAN (1<<11)
1054#define CFG_NET_STATS (1<<12)
913 1055
914#define CAP_SHARED_KEY (1<<0) /* Off = OPEN */ 1056#define CAP_SHARED_KEY (1<<0) /* Off = OPEN */
915#define CAP_PRIVACY_ON (1<<1) /* Off = No privacy */ 1057#define CAP_PRIVACY_ON (1<<1) /* Off = No privacy */
@@ -931,10 +1073,11 @@ struct average {
931 s32 sum; 1073 s32 sum;
932}; 1074};
933 1075
1076#define MAX_SPEED_SCAN 100
1077
934struct ipw_priv { 1078struct ipw_priv {
935 /* ieee device used by generic ieee processing code */ 1079 /* ieee device used by generic ieee processing code */
936 struct ieee80211_device *ieee; 1080 struct ieee80211_device *ieee;
937 struct ieee80211_security sec;
938 1081
939 spinlock_t lock; 1082 spinlock_t lock;
940 struct semaphore sem; 1083 struct semaphore sem;
@@ -1030,6 +1173,9 @@ struct ipw_priv {
1030 u32 tx_packets; 1173 u32 tx_packets;
1031 u32 quality; 1174 u32 quality;
1032 1175
1176 u8 speed_scan[MAX_SPEED_SCAN];
1177 u8 speed_scan_pos;
1178
1033 /* eeprom */ 1179 /* eeprom */
1034 u8 eeprom[0x100]; /* 256 bytes of eeprom */ 1180 u8 eeprom[0x100]; /* 256 bytes of eeprom */
1035 int eeprom_delay; 1181 int eeprom_delay;
@@ -1074,8 +1220,7 @@ struct ipw_priv {
1074#define IPW_2915ABG 2 1220#define IPW_2915ABG 2
1075 u8 adapter; 1221 u8 adapter;
1076 1222
1077#define IPW_DEFAULT_TX_POWER 0x14 1223 s8 tx_power;
1078 u8 tx_power;
1079 1224
1080#ifdef CONFIG_PM 1225#ifdef CONFIG_PM
1081 u32 pm_state[16]; 1226 u32 pm_state[16];
@@ -1086,6 +1231,11 @@ struct ipw_priv {
1086 /* Used to pass the current INTA value from ISR to Tasklet */ 1231 /* Used to pass the current INTA value from ISR to Tasklet */
1087 u32 isr_inta; 1232 u32 isr_inta;
1088 1233
1234 /* QoS */
1235 struct ipw_qos_info qos_data;
1236 struct work_struct qos_activate;
1237 /*********************************/
1238
1089 /* debugging info */ 1239 /* debugging info */
1090 u32 indirect_dword; 1240 u32 indirect_dword;
1091 u32 direct_dword; 1241 u32 direct_dword;
@@ -1162,6 +1312,7 @@ do { if (ipw_debug_level & (level)) \
1162 1312
1163#define IPW_DL_STATS (1<<29) 1313#define IPW_DL_STATS (1<<29)
1164#define IPW_DL_MERGE (1<<30) 1314#define IPW_DL_MERGE (1<<30)
1315#define IPW_DL_QOS (1<<31)
1165 1316
1166#define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a) 1317#define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
1167#define IPW_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a) 1318#define IPW_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
@@ -1190,6 +1341,7 @@ do { if (ipw_debug_level & (level)) \
1190#define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) 1341#define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a)
1191#define IPW_DEBUG_STATS(f, a...) IPW_DEBUG(IPW_DL_STATS, f, ## a) 1342#define IPW_DEBUG_STATS(f, a...) IPW_DEBUG(IPW_DL_STATS, f, ## a)
1192#define IPW_DEBUG_MERGE(f, a...) IPW_DEBUG(IPW_DL_MERGE, f, ## a) 1343#define IPW_DEBUG_MERGE(f, a...) IPW_DEBUG(IPW_DL_MERGE, f, ## a)
1344#define IPW_DEBUG_QOS(f, a...) IPW_DEBUG(IPW_DL_QOS, f, ## a)
1193 1345
1194#include <linux/ctype.h> 1346#include <linux/ctype.h>
1195 1347
@@ -1204,65 +1356,65 @@ do { if (ipw_debug_level & (level)) \
1204#define DINO_RXFIFO_DATA 0x01 1356#define DINO_RXFIFO_DATA 0x01
1205#define DINO_CONTROL_REG 0x00200000 1357#define DINO_CONTROL_REG 0x00200000
1206 1358
1207#define CX2_INTA_RW 0x00000008 1359#define IPW_INTA_RW 0x00000008
1208#define CX2_INTA_MASK_R 0x0000000C 1360#define IPW_INTA_MASK_R 0x0000000C
1209#define CX2_INDIRECT_ADDR 0x00000010 1361#define IPW_INDIRECT_ADDR 0x00000010
1210#define CX2_INDIRECT_DATA 0x00000014 1362#define IPW_INDIRECT_DATA 0x00000014
1211#define CX2_AUTOINC_ADDR 0x00000018 1363#define IPW_AUTOINC_ADDR 0x00000018
1212#define CX2_AUTOINC_DATA 0x0000001C 1364#define IPW_AUTOINC_DATA 0x0000001C
1213#define CX2_RESET_REG 0x00000020 1365#define IPW_RESET_REG 0x00000020
1214#define CX2_GP_CNTRL_RW 0x00000024 1366#define IPW_GP_CNTRL_RW 0x00000024
1215 1367
1216#define CX2_READ_INT_REGISTER 0xFF4 1368#define IPW_READ_INT_REGISTER 0xFF4
1217 1369
1218#define CX2_GP_CNTRL_BIT_INIT_DONE 0x00000004 1370#define IPW_GP_CNTRL_BIT_INIT_DONE 0x00000004
1219 1371
1220#define CX2_REGISTER_DOMAIN1_END 0x00001000 1372#define IPW_REGISTER_DOMAIN1_END 0x00001000
1221#define CX2_SRAM_READ_INT_REGISTER 0x00000ff4 1373#define IPW_SRAM_READ_INT_REGISTER 0x00000ff4
1222 1374
1223#define CX2_SHARED_LOWER_BOUND 0x00000200 1375#define IPW_SHARED_LOWER_BOUND 0x00000200
1224#define CX2_INTERRUPT_AREA_LOWER_BOUND 0x00000f80 1376#define IPW_INTERRUPT_AREA_LOWER_BOUND 0x00000f80
1225 1377
1226#define CX2_NIC_SRAM_LOWER_BOUND 0x00000000 1378#define IPW_NIC_SRAM_LOWER_BOUND 0x00000000
1227#define CX2_NIC_SRAM_UPPER_BOUND 0x00030000 1379#define IPW_NIC_SRAM_UPPER_BOUND 0x00030000
1228 1380
1229#define CX2_BIT_INT_HOST_SRAM_READ_INT_REGISTER (1 << 29) 1381#define IPW_BIT_INT_HOST_SRAM_READ_INT_REGISTER (1 << 29)
1230#define CX2_GP_CNTRL_BIT_CLOCK_READY 0x00000001 1382#define IPW_GP_CNTRL_BIT_CLOCK_READY 0x00000001
1231#define CX2_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY 0x00000002 1383#define IPW_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY 0x00000002
1232 1384
1233/* 1385/*
1234 * RESET Register Bit Indexes 1386 * RESET Register Bit Indexes
1235 */ 1387 */
1236#define CBD_RESET_REG_PRINCETON_RESET (1<<0) 1388#define CBD_RESET_REG_PRINCETON_RESET (1<<0)
1237#define CX2_START_STANDBY (1<<2) 1389#define IPW_START_STANDBY (1<<2)
1238#define CX2_ACTIVITY_LED (1<<4) 1390#define IPW_ACTIVITY_LED (1<<4)
1239#define CX2_ASSOCIATED_LED (1<<5) 1391#define IPW_ASSOCIATED_LED (1<<5)
1240#define CX2_OFDM_LED (1<<6) 1392#define IPW_OFDM_LED (1<<6)
1241#define CX2_RESET_REG_SW_RESET (1<<7) 1393#define IPW_RESET_REG_SW_RESET (1<<7)
1242#define CX2_RESET_REG_MASTER_DISABLED (1<<8) 1394#define IPW_RESET_REG_MASTER_DISABLED (1<<8)
1243#define CX2_RESET_REG_STOP_MASTER (1<<9) 1395#define IPW_RESET_REG_STOP_MASTER (1<<9)
1244#define CX2_GATE_ODMA (1<<25) 1396#define IPW_GATE_ODMA (1<<25)
1245#define CX2_GATE_IDMA (1<<26) 1397#define IPW_GATE_IDMA (1<<26)
1246#define CX2_ARC_KESHET_CONFIG (1<<27) 1398#define IPW_ARC_KESHET_CONFIG (1<<27)
1247#define CX2_GATE_ADMA (1<<29) 1399#define IPW_GATE_ADMA (1<<29)
1248 1400
1249#define CX2_CSR_CIS_UPPER_BOUND 0x00000200 1401#define IPW_CSR_CIS_UPPER_BOUND 0x00000200
1250#define CX2_DOMAIN_0_END 0x1000 1402#define IPW_DOMAIN_0_END 0x1000
1251#define CLX_MEM_BAR_SIZE 0x1000 1403#define CLX_MEM_BAR_SIZE 0x1000
1252 1404
1253#define CX2_BASEBAND_CONTROL_STATUS 0X00200000 1405#define IPW_BASEBAND_CONTROL_STATUS 0X00200000
1254#define CX2_BASEBAND_TX_FIFO_WRITE 0X00200004 1406#define IPW_BASEBAND_TX_FIFO_WRITE 0X00200004
1255#define CX2_BASEBAND_RX_FIFO_READ 0X00200004 1407#define IPW_BASEBAND_RX_FIFO_READ 0X00200004
1256#define CX2_BASEBAND_CONTROL_STORE 0X00200010 1408#define IPW_BASEBAND_CONTROL_STORE 0X00200010
1257 1409
1258#define CX2_INTERNAL_CMD_EVENT 0X00300004 1410#define IPW_INTERNAL_CMD_EVENT 0X00300004
1259#define CX2_BASEBAND_POWER_DOWN 0x00000001 1411#define IPW_BASEBAND_POWER_DOWN 0x00000001
1260 1412
1261#define CX2_MEM_HALT_AND_RESET 0x003000e0 1413#define IPW_MEM_HALT_AND_RESET 0x003000e0
1262 1414
1263/* defgroup bits_halt_reset MEM_HALT_AND_RESET register bits */ 1415/* defgroup bits_halt_reset MEM_HALT_AND_RESET register bits */
1264#define CX2_BIT_HALT_RESET_ON 0x80000000 1416#define IPW_BIT_HALT_RESET_ON 0x80000000
1265#define CX2_BIT_HALT_RESET_OFF 0x00000000 1417#define IPW_BIT_HALT_RESET_OFF 0x00000000
1266 1418
1267#define CB_LAST_VALID 0x20000000 1419#define CB_LAST_VALID 0x20000000
1268#define CB_INT_ENABLED 0x40000000 1420#define CB_INT_ENABLED 0x40000000
@@ -1281,63 +1433,63 @@ do { if (ipw_debug_level & (level)) \
1281#define DMA_CB_STOP_AND_ABORT 0x00000C00 1433#define DMA_CB_STOP_AND_ABORT 0x00000C00
1282#define DMA_CB_START 0x00000100 1434#define DMA_CB_START 0x00000100
1283 1435
1284#define CX2_SHARED_SRAM_SIZE 0x00030000 1436#define IPW_SHARED_SRAM_SIZE 0x00030000
1285#define CX2_SHARED_SRAM_DMA_CONTROL 0x00027000 1437#define IPW_SHARED_SRAM_DMA_CONTROL 0x00027000
1286#define CB_MAX_LENGTH 0x1FFF 1438#define CB_MAX_LENGTH 0x1FFF
1287 1439
1288#define CX2_HOST_EEPROM_DATA_SRAM_SIZE 0xA18 1440#define IPW_HOST_EEPROM_DATA_SRAM_SIZE 0xA18
1289#define CX2_EEPROM_IMAGE_SIZE 0x100 1441#define IPW_EEPROM_IMAGE_SIZE 0x100
1290 1442
1291/* DMA defs */ 1443/* DMA defs */
1292#define CX2_DMA_I_CURRENT_CB 0x003000D0 1444#define IPW_DMA_I_CURRENT_CB 0x003000D0
1293#define CX2_DMA_O_CURRENT_CB 0x003000D4 1445#define IPW_DMA_O_CURRENT_CB 0x003000D4
1294#define CX2_DMA_I_DMA_CONTROL 0x003000A4 1446#define IPW_DMA_I_DMA_CONTROL 0x003000A4
1295#define CX2_DMA_I_CB_BASE 0x003000A0 1447#define IPW_DMA_I_CB_BASE 0x003000A0
1296 1448
1297#define CX2_TX_CMD_QUEUE_BD_BASE 0x00000200 1449#define IPW_TX_CMD_QUEUE_BD_BASE 0x00000200
1298#define CX2_TX_CMD_QUEUE_BD_SIZE 0x00000204 1450#define IPW_TX_CMD_QUEUE_BD_SIZE 0x00000204
1299#define CX2_TX_QUEUE_0_BD_BASE 0x00000208 1451#define IPW_TX_QUEUE_0_BD_BASE 0x00000208
1300#define CX2_TX_QUEUE_0_BD_SIZE (0x0000020C) 1452#define IPW_TX_QUEUE_0_BD_SIZE (0x0000020C)
1301#define CX2_TX_QUEUE_1_BD_BASE 0x00000210 1453#define IPW_TX_QUEUE_1_BD_BASE 0x00000210
1302#define CX2_TX_QUEUE_1_BD_SIZE 0x00000214 1454#define IPW_TX_QUEUE_1_BD_SIZE 0x00000214
1303#define CX2_TX_QUEUE_2_BD_BASE 0x00000218 1455#define IPW_TX_QUEUE_2_BD_BASE 0x00000218
1304#define CX2_TX_QUEUE_2_BD_SIZE (0x0000021C) 1456#define IPW_TX_QUEUE_2_BD_SIZE (0x0000021C)
1305#define CX2_TX_QUEUE_3_BD_BASE 0x00000220 1457#define IPW_TX_QUEUE_3_BD_BASE 0x00000220
1306#define CX2_TX_QUEUE_3_BD_SIZE 0x00000224 1458#define IPW_TX_QUEUE_3_BD_SIZE 0x00000224
1307#define CX2_RX_BD_BASE 0x00000240 1459#define IPW_RX_BD_BASE 0x00000240
1308#define CX2_RX_BD_SIZE 0x00000244 1460#define IPW_RX_BD_SIZE 0x00000244
1309#define CX2_RFDS_TABLE_LOWER 0x00000500 1461#define IPW_RFDS_TABLE_LOWER 0x00000500
1310 1462
1311#define CX2_TX_CMD_QUEUE_READ_INDEX 0x00000280 1463#define IPW_TX_CMD_QUEUE_READ_INDEX 0x00000280
1312#define CX2_TX_QUEUE_0_READ_INDEX 0x00000284 1464#define IPW_TX_QUEUE_0_READ_INDEX 0x00000284
1313#define CX2_TX_QUEUE_1_READ_INDEX 0x00000288 1465#define IPW_TX_QUEUE_1_READ_INDEX 0x00000288
1314#define CX2_TX_QUEUE_2_READ_INDEX (0x0000028C) 1466#define IPW_TX_QUEUE_2_READ_INDEX (0x0000028C)
1315#define CX2_TX_QUEUE_3_READ_INDEX 0x00000290 1467#define IPW_TX_QUEUE_3_READ_INDEX 0x00000290
1316#define CX2_RX_READ_INDEX (0x000002A0) 1468#define IPW_RX_READ_INDEX (0x000002A0)
1317 1469
1318#define CX2_TX_CMD_QUEUE_WRITE_INDEX (0x00000F80) 1470#define IPW_TX_CMD_QUEUE_WRITE_INDEX (0x00000F80)
1319#define CX2_TX_QUEUE_0_WRITE_INDEX (0x00000F84) 1471#define IPW_TX_QUEUE_0_WRITE_INDEX (0x00000F84)
1320#define CX2_TX_QUEUE_1_WRITE_INDEX (0x00000F88) 1472#define IPW_TX_QUEUE_1_WRITE_INDEX (0x00000F88)
1321#define CX2_TX_QUEUE_2_WRITE_INDEX (0x00000F8C) 1473#define IPW_TX_QUEUE_2_WRITE_INDEX (0x00000F8C)
1322#define CX2_TX_QUEUE_3_WRITE_INDEX (0x00000F90) 1474#define IPW_TX_QUEUE_3_WRITE_INDEX (0x00000F90)
1323#define CX2_RX_WRITE_INDEX (0x00000FA0) 1475#define IPW_RX_WRITE_INDEX (0x00000FA0)
1324 1476
1325/* 1477/*
1326 * EEPROM Related Definitions 1478 * EEPROM Related Definitions
1327 */ 1479 */
1328 1480
1329#define IPW_EEPROM_DATA_SRAM_ADDRESS (CX2_SHARED_LOWER_BOUND + 0x814) 1481#define IPW_EEPROM_DATA_SRAM_ADDRESS (IPW_SHARED_LOWER_BOUND + 0x814)
1330#define IPW_EEPROM_DATA_SRAM_SIZE (CX2_SHARED_LOWER_BOUND + 0x818) 1482#define IPW_EEPROM_DATA_SRAM_SIZE (IPW_SHARED_LOWER_BOUND + 0x818)
1331#define IPW_EEPROM_LOAD_DISABLE (CX2_SHARED_LOWER_BOUND + 0x81C) 1483#define IPW_EEPROM_LOAD_DISABLE (IPW_SHARED_LOWER_BOUND + 0x81C)
1332#define IPW_EEPROM_DATA (CX2_SHARED_LOWER_BOUND + 0x820) 1484#define IPW_EEPROM_DATA (IPW_SHARED_LOWER_BOUND + 0x820)
1333#define IPW_EEPROM_UPPER_ADDRESS (CX2_SHARED_LOWER_BOUND + 0x9E0) 1485#define IPW_EEPROM_UPPER_ADDRESS (IPW_SHARED_LOWER_BOUND + 0x9E0)
1334 1486
1335#define IPW_STATION_TABLE_LOWER (CX2_SHARED_LOWER_BOUND + 0xA0C) 1487#define IPW_STATION_TABLE_LOWER (IPW_SHARED_LOWER_BOUND + 0xA0C)
1336#define IPW_STATION_TABLE_UPPER (CX2_SHARED_LOWER_BOUND + 0xB0C) 1488#define IPW_STATION_TABLE_UPPER (IPW_SHARED_LOWER_BOUND + 0xB0C)
1337#define IPW_REQUEST_ATIM (CX2_SHARED_LOWER_BOUND + 0xB0C) 1489#define IPW_REQUEST_ATIM (IPW_SHARED_LOWER_BOUND + 0xB0C)
1338#define IPW_ATIM_SENT (CX2_SHARED_LOWER_BOUND + 0xB10) 1490#define IPW_ATIM_SENT (IPW_SHARED_LOWER_BOUND + 0xB10)
1339#define IPW_WHO_IS_AWAKE (CX2_SHARED_LOWER_BOUND + 0xB14) 1491#define IPW_WHO_IS_AWAKE (IPW_SHARED_LOWER_BOUND + 0xB14)
1340#define IPW_DURING_ATIM_WINDOW (CX2_SHARED_LOWER_BOUND + 0xB18) 1492#define IPW_DURING_ATIM_WINDOW (IPW_SHARED_LOWER_BOUND + 0xB18)
1341 1493
1342#define MSB 1 1494#define MSB 1
1343#define LSB 0 1495#define LSB 0
@@ -1367,7 +1519,7 @@ do { if (ipw_debug_level & (level)) \
1367 1519
1368#define FW_MEM_REG_LOWER_BOUND 0x00300000 1520#define FW_MEM_REG_LOWER_BOUND 0x00300000
1369#define FW_MEM_REG_EEPROM_ACCESS (FW_MEM_REG_LOWER_BOUND + 0x40) 1521#define FW_MEM_REG_EEPROM_ACCESS (FW_MEM_REG_LOWER_BOUND + 0x40)
1370#define CX2_EVENT_REG (FW_MEM_REG_LOWER_BOUND + 0x04) 1522#define IPW_EVENT_REG (FW_MEM_REG_LOWER_BOUND + 0x04)
1371#define EEPROM_BIT_SK (1<<0) 1523#define EEPROM_BIT_SK (1<<0)
1372#define EEPROM_BIT_CS (1<<1) 1524#define EEPROM_BIT_CS (1<<1)
1373#define EEPROM_BIT_DI (1<<2) 1525#define EEPROM_BIT_DI (1<<2)
@@ -1376,50 +1528,47 @@ do { if (ipw_debug_level & (level)) \
1376#define EEPROM_CMD_READ 0x2 1528#define EEPROM_CMD_READ 0x2
1377 1529
1378/* Interrupts masks */ 1530/* Interrupts masks */
1379#define CX2_INTA_NONE 0x00000000 1531#define IPW_INTA_NONE 0x00000000
1380 1532
1381#define CX2_INTA_BIT_RX_TRANSFER 0x00000002 1533#define IPW_INTA_BIT_RX_TRANSFER 0x00000002
1382#define CX2_INTA_BIT_STATUS_CHANGE 0x00000010 1534#define IPW_INTA_BIT_STATUS_CHANGE 0x00000010
1383#define CX2_INTA_BIT_BEACON_PERIOD_EXPIRED 0x00000020 1535#define IPW_INTA_BIT_BEACON_PERIOD_EXPIRED 0x00000020
1384 1536
1385//Inta Bits for CF 1537//Inta Bits for CF
1386#define CX2_INTA_BIT_TX_CMD_QUEUE 0x00000800 1538#define IPW_INTA_BIT_TX_CMD_QUEUE 0x00000800
1387#define CX2_INTA_BIT_TX_QUEUE_1 0x00001000 1539#define IPW_INTA_BIT_TX_QUEUE_1 0x00001000
1388#define CX2_INTA_BIT_TX_QUEUE_2 0x00002000 1540#define IPW_INTA_BIT_TX_QUEUE_2 0x00002000
1389#define CX2_INTA_BIT_TX_QUEUE_3 0x00004000 1541#define IPW_INTA_BIT_TX_QUEUE_3 0x00004000
1390#define CX2_INTA_BIT_TX_QUEUE_4 0x00008000 1542#define IPW_INTA_BIT_TX_QUEUE_4 0x00008000
1391 1543
1392#define CX2_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE 0x00010000 1544#define IPW_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE 0x00010000
1393 1545
1394#define CX2_INTA_BIT_PREPARE_FOR_POWER_DOWN 0x00100000 1546#define IPW_INTA_BIT_PREPARE_FOR_POWER_DOWN 0x00100000
1395#define CX2_INTA_BIT_POWER_DOWN 0x00200000 1547#define IPW_INTA_BIT_POWER_DOWN 0x00200000
1396 1548
1397#define CX2_INTA_BIT_FW_INITIALIZATION_DONE 0x01000000 1549#define IPW_INTA_BIT_FW_INITIALIZATION_DONE 0x01000000
1398#define CX2_INTA_BIT_FW_CARD_DISABLE_PHY_OFF_DONE 0x02000000 1550#define IPW_INTA_BIT_FW_CARD_DISABLE_PHY_OFF_DONE 0x02000000
1399#define CX2_INTA_BIT_RF_KILL_DONE 0x04000000 1551#define IPW_INTA_BIT_RF_KILL_DONE 0x04000000
1400#define CX2_INTA_BIT_FATAL_ERROR 0x40000000 1552#define IPW_INTA_BIT_FATAL_ERROR 0x40000000
1401#define CX2_INTA_BIT_PARITY_ERROR 0x80000000 1553#define IPW_INTA_BIT_PARITY_ERROR 0x80000000
1402 1554
1403/* Interrupts enabled at init time. */ 1555/* Interrupts enabled at init time. */
1404#define CX2_INTA_MASK_ALL \ 1556#define IPW_INTA_MASK_ALL \
1405 (CX2_INTA_BIT_TX_QUEUE_1 | \ 1557 (IPW_INTA_BIT_TX_QUEUE_1 | \
1406 CX2_INTA_BIT_TX_QUEUE_2 | \ 1558 IPW_INTA_BIT_TX_QUEUE_2 | \
1407 CX2_INTA_BIT_TX_QUEUE_3 | \ 1559 IPW_INTA_BIT_TX_QUEUE_3 | \
1408 CX2_INTA_BIT_TX_QUEUE_4 | \ 1560 IPW_INTA_BIT_TX_QUEUE_4 | \
1409 CX2_INTA_BIT_TX_CMD_QUEUE | \ 1561 IPW_INTA_BIT_TX_CMD_QUEUE | \
1410 CX2_INTA_BIT_RX_TRANSFER | \ 1562 IPW_INTA_BIT_RX_TRANSFER | \
1411 CX2_INTA_BIT_FATAL_ERROR | \ 1563 IPW_INTA_BIT_FATAL_ERROR | \
1412 CX2_INTA_BIT_PARITY_ERROR | \ 1564 IPW_INTA_BIT_PARITY_ERROR | \
1413 CX2_INTA_BIT_STATUS_CHANGE | \ 1565 IPW_INTA_BIT_STATUS_CHANGE | \
1414 CX2_INTA_BIT_FW_INITIALIZATION_DONE | \ 1566 IPW_INTA_BIT_FW_INITIALIZATION_DONE | \
1415 CX2_INTA_BIT_BEACON_PERIOD_EXPIRED | \ 1567 IPW_INTA_BIT_BEACON_PERIOD_EXPIRED | \
1416 CX2_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE | \ 1568 IPW_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE | \
1417 CX2_INTA_BIT_PREPARE_FOR_POWER_DOWN | \ 1569 IPW_INTA_BIT_PREPARE_FOR_POWER_DOWN | \
1418 CX2_INTA_BIT_POWER_DOWN | \ 1570 IPW_INTA_BIT_POWER_DOWN | \
1419 CX2_INTA_BIT_RF_KILL_DONE ) 1571 IPW_INTA_BIT_RF_KILL_DONE )
1420
1421#define IPWSTATUS_ERROR_LOG (CX2_SHARED_LOWER_BOUND + 0x410)
1422#define IPW_EVENT_LOG (CX2_SHARED_LOWER_BOUND + 0x414)
1423 1572
1424/* FW event log definitions */ 1573/* FW event log definitions */
1425#define EVENT_ELEM_SIZE (3 * sizeof(u32)) 1574#define EVENT_ELEM_SIZE (3 * sizeof(u32))
@@ -1429,6 +1578,11 @@ do { if (ipw_debug_level & (level)) \
1429#define ERROR_ELEM_SIZE (7 * sizeof(u32)) 1578#define ERROR_ELEM_SIZE (7 * sizeof(u32))
1430#define ERROR_START_OFFSET (1 * sizeof(u32)) 1579#define ERROR_START_OFFSET (1 * sizeof(u32))
1431 1580
1581/* TX power level (dbm) */
1582#define IPW_TX_POWER_MIN -12
1583#define IPW_TX_POWER_MAX 20
1584#define IPW_TX_POWER_DEFAULT IPW_TX_POWER_MAX
1585
1432enum { 1586enum {
1433 IPW_FW_ERROR_OK = 0, 1587 IPW_FW_ERROR_OK = 0,
1434 IPW_FW_ERROR_FAIL, 1588 IPW_FW_ERROR_FAIL,
@@ -1441,8 +1595,8 @@ enum {
1441 IPW_FW_ERROR_ALLOC_FAIL, 1595 IPW_FW_ERROR_ALLOC_FAIL,
1442 IPW_FW_ERROR_DMA_UNDERRUN, 1596 IPW_FW_ERROR_DMA_UNDERRUN,
1443 IPW_FW_ERROR_DMA_STATUS, 1597 IPW_FW_ERROR_DMA_STATUS,
1444 IPW_FW_ERROR_DINOSTATUS_ERROR, 1598 IPW_FW_ERROR_DINO_ERROR,
1445 IPW_FW_ERROR_EEPROMSTATUS_ERROR, 1599 IPW_FW_ERROR_EEPROM_ERROR,
1446 IPW_FW_ERROR_SYSASSERT, 1600 IPW_FW_ERROR_SYSASSERT,
1447 IPW_FW_ERROR_FATAL_ERROR 1601 IPW_FW_ERROR_FATAL_ERROR
1448}; 1602};
@@ -1458,6 +1612,8 @@ enum {
1458#define HC_IBSS_RECONF 4 1612#define HC_IBSS_RECONF 4
1459#define HC_DISASSOC_QUIET 5 1613#define HC_DISASSOC_QUIET 5
1460 1614
1615#define HC_QOS_SUPPORT_ASSOC 0x01
1616
1461#define IPW_RATE_CAPABILITIES 1 1617#define IPW_RATE_CAPABILITIES 1
1462#define IPW_RATE_CONNECT 0 1618#define IPW_RATE_CONNECT 0
1463 1619
@@ -1628,18 +1784,20 @@ enum {
1628 IPW_ORD_TABLE_7_LAST 1784 IPW_ORD_TABLE_7_LAST
1629}; 1785};
1630 1786
1631#define IPW_ORDINALS_TABLE_LOWER (CX2_SHARED_LOWER_BOUND + 0x500) 1787#define IPWSTATUS_ERROR_LOG (IPW_SHARED_LOWER_BOUND + 0x410)
1632#define IPW_ORDINALS_TABLE_0 (CX2_SHARED_LOWER_BOUND + 0x180) 1788#define IPW_EVENT_LOG (IPW_SHARED_LOWER_BOUND + 0x414)
1633#define IPW_ORDINALS_TABLE_1 (CX2_SHARED_LOWER_BOUND + 0x184) 1789#define IPW_ORDINALS_TABLE_LOWER (IPW_SHARED_LOWER_BOUND + 0x500)
1634#define IPW_ORDINALS_TABLE_2 (CX2_SHARED_LOWER_BOUND + 0x188) 1790#define IPW_ORDINALS_TABLE_0 (IPW_SHARED_LOWER_BOUND + 0x180)
1635#define IPW_MEM_FIXED_OVERRIDE (CX2_SHARED_LOWER_BOUND + 0x41C) 1791#define IPW_ORDINALS_TABLE_1 (IPW_SHARED_LOWER_BOUND + 0x184)
1792#define IPW_ORDINALS_TABLE_2 (IPW_SHARED_LOWER_BOUND + 0x188)
1793#define IPW_MEM_FIXED_OVERRIDE (IPW_SHARED_LOWER_BOUND + 0x41C)
1636 1794
1637struct ipw_fixed_rate { 1795struct ipw_fixed_rate {
1638 u16 tx_rates; 1796 u16 tx_rates;
1639 u16 reserved; 1797 u16 reserved;
1640} __attribute__ ((packed)); 1798} __attribute__ ((packed));
1641 1799
1642#define CX2_INDIRECT_ADDR_MASK (~0x3ul) 1800#define IPW_INDIRECT_ADDR_MASK (~0x3ul)
1643 1801
1644struct host_cmd { 1802struct host_cmd {
1645 u8 cmd; 1803 u8 cmd;
@@ -1676,15 +1834,6 @@ struct host_cmd {
1676#define REG_CHANNEL_MASK 0x00003FFF 1834#define REG_CHANNEL_MASK 0x00003FFF
1677#define IPW_IBSS_11B_DEFAULT_MASK 0x87ff 1835#define IPW_IBSS_11B_DEFAULT_MASK 0x87ff
1678 1836
1679static const long ipw_frequencies[] = {
1680 2412, 2417, 2422, 2427,
1681 2432, 2437, 2442, 2447,
1682 2452, 2457, 2462, 2467,
1683 2472, 2484
1684};
1685
1686#define FREQ_COUNT ARRAY_SIZE(ipw_frequencies)
1687
1688#define IPW_MAX_CONFIG_RETRIES 10 1837#define IPW_MAX_CONFIG_RETRIES 10
1689 1838
1690static inline u32 frame_hdr_len(struct ieee80211_hdr_4addr *hdr) 1839static inline u32 frame_hdr_len(struct ieee80211_hdr_4addr *hdr)