aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h349
1 files changed, 125 insertions, 224 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 68b953f2bdc..214e4658c49 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved. 3 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -26,7 +26,6 @@
26/* 26/*
27 * Please use this file (iwl-dev.h) for driver implementation definitions. 27 * Please use this file (iwl-dev.h) for driver implementation definitions.
28 * Please use iwl-commands.h for uCode API definitions. 28 * Please use iwl-commands.h for uCode API definitions.
29 * Please use iwl-4965-hw.h for hardware-related definitions.
30 */ 29 */
31 30
32#ifndef __iwl_dev_h__ 31#ifndef __iwl_dev_h__
@@ -179,53 +178,12 @@ struct iwl_tx_queue {
179 178
180#define IWL_NUM_SCAN_RATES (2) 179#define IWL_NUM_SCAN_RATES (2)
181 180
182struct iwl4965_channel_tgd_info {
183 u8 type;
184 s8 max_power;
185};
186
187struct iwl4965_channel_tgh_info {
188 s64 last_radar_time;
189};
190
191#define IWL4965_MAX_RATE (33)
192
193struct iwl3945_clip_group {
194 /* maximum power level to prevent clipping for each rate, derived by
195 * us from this band's saturation power in EEPROM */
196 const s8 clip_powers[IWL_MAX_RATES];
197};
198
199/* current Tx power values to use, one for each rate for each channel.
200 * requested power is limited by:
201 * -- regulatory EEPROM limits for this channel
202 * -- hardware capabilities (clip-powers)
203 * -- spectrum management
204 * -- user preference (e.g. iwconfig)
205 * when requested power is set, base power index must also be set. */
206struct iwl3945_channel_power_info {
207 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
208 s8 power_table_index; /* actual (compenst'd) index into gain table */
209 s8 base_power_index; /* gain index for power at factory temp. */
210 s8 requested_power; /* power (dBm) requested for this chnl/rate */
211};
212
213/* current scan Tx power values to use, one for each scan rate for each
214 * channel. */
215struct iwl3945_scan_power_info {
216 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
217 s8 power_table_index; /* actual (compenst'd) index into gain table */
218 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
219};
220
221/* 181/*
222 * One for each channel, holds all channel setup data 182 * One for each channel, holds all channel setup data
223 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant 183 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
224 * with one another! 184 * with one another!
225 */ 185 */
226struct iwl_channel_info { 186struct iwl_channel_info {
227 struct iwl4965_channel_tgd_info tgd;
228 struct iwl4965_channel_tgh_info tgh;
229 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ 187 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */
230 struct iwl_eeprom_channel ht40_eeprom; /* EEPROM regulatory limit for 188 struct iwl_eeprom_channel ht40_eeprom; /* EEPROM regulatory limit for
231 * HT40 channel */ 189 * HT40 channel */
@@ -245,14 +203,6 @@ struct iwl_channel_info {
245 s8 ht40_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ 203 s8 ht40_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
246 u8 ht40_flags; /* flags copied from EEPROM */ 204 u8 ht40_flags; /* flags copied from EEPROM */
247 u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */ 205 u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */
248
249 /* Radio/DSP gain settings for each "normal" data Tx rate.
250 * These include, in addition to RF and DSP gain, a few fields for
251 * remembering/modifying gain settings (indexes). */
252 struct iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];
253
254 /* Radio/DSP gain settings for each scan rate, for directed scans. */
255 struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
256}; 206};
257 207
258#define IWL_TX_FIFO_BK 0 /* shared */ 208#define IWL_TX_FIFO_BK 0 /* shared */
@@ -288,15 +238,6 @@ struct iwl_channel_info {
288#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) 238#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
289#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 239#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
290 240
291struct iwl_frame {
292 union {
293 struct ieee80211_hdr frame;
294 struct iwl_tx_beacon_cmd beacon;
295 u8 raw[IEEE80211_FRAME_LEN];
296 u8 cmd[360];
297 } u;
298 struct list_head list;
299};
300 241
301#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) 242#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
302#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) 243#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
@@ -309,6 +250,7 @@ enum {
309 CMD_SIZE_HUGE = (1 << 0), 250 CMD_SIZE_HUGE = (1 << 0),
310 CMD_ASYNC = (1 << 1), 251 CMD_ASYNC = (1 << 1),
311 CMD_WANT_SKB = (1 << 2), 252 CMD_WANT_SKB = (1 << 2),
253 CMD_MAPPED = (1 << 3),
312}; 254};
313 255
314#define DEF_CMD_PAYLOAD_SIZE 320 256#define DEF_CMD_PAYLOAD_SIZE 320
@@ -416,6 +358,7 @@ struct iwl_ht_agg {
416#define IWL_EMPTYING_HW_QUEUE_ADDBA 2 358#define IWL_EMPTYING_HW_QUEUE_ADDBA 2
417#define IWL_EMPTYING_HW_QUEUE_DELBA 3 359#define IWL_EMPTYING_HW_QUEUE_DELBA 3
418 u8 state; 360 u8 state;
361 u8 tx_fifo;
419}; 362};
420 363
421 364
@@ -499,9 +442,6 @@ struct iwl_station_priv_common {
499 * When mac80211 creates a station it reserves some space (hw->sta_data_size) 442 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
500 * in the structure for use by driver. This structure is places in that 443 * in the structure for use by driver. This structure is places in that
501 * space. 444 * space.
502 *
503 * The common struct MUST be first because it is shared between
504 * 3945 and agn!
505 */ 445 */
506struct iwl_station_priv { 446struct iwl_station_priv {
507 struct iwl_station_priv_common common; 447 struct iwl_station_priv_common common;
@@ -530,6 +470,10 @@ struct fw_desc {
530 u32 len; /* bytes */ 470 u32 len; /* bytes */
531}; 471};
532 472
473struct fw_img {
474 struct fw_desc code, data;
475};
476
533/* v1/v2 uCode file layout */ 477/* v1/v2 uCode file layout */
534struct iwl_ucode_header { 478struct iwl_ucode_header {
535 __le32 ver; /* major/minor/API/serial */ 479 __le32 ver; /* major/minor/API/serial */
@@ -586,6 +530,22 @@ enum iwl_ucode_tlv_type {
586 IWL_UCODE_TLV_INIT_ERRLOG_PTR = 13, 530 IWL_UCODE_TLV_INIT_ERRLOG_PTR = 13,
587 IWL_UCODE_TLV_ENHANCE_SENS_TBL = 14, 531 IWL_UCODE_TLV_ENHANCE_SENS_TBL = 14,
588 IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15, 532 IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15,
533 /* 16 and 17 reserved for future use */
534 IWL_UCODE_TLV_FLAGS = 18,
535};
536
537/**
538 * enum iwl_ucode_tlv_flag - ucode API flags
539 * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
540 * was a separate TLV but moved here to save space.
541 * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID,
542 * treats good CRC threshold as a boolean
543 * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
544 */
545enum iwl_ucode_tlv_flag {
546 IWL_UCODE_TLV_FLAGS_PAN = BIT(0),
547 IWL_UCODE_TLV_FLAGS_NEWSCAN = BIT(1),
548 IWL_UCODE_TLV_FLAGS_MFP = BIT(2),
589}; 549};
590 550
591struct iwl_ucode_tlv { 551struct iwl_ucode_tlv {
@@ -619,14 +579,6 @@ struct iwl_tlv_ucode_header {
619 u8 data[0]; 579 u8 data[0];
620}; 580};
621 581
622struct iwl4965_ibss_seq {
623 u8 mac[ETH_ALEN];
624 u16 seq_num;
625 u16 frag_num;
626 unsigned long packet_time;
627 struct list_head list;
628};
629
630struct iwl_sensitivity_ranges { 582struct iwl_sensitivity_ranges {
631 u16 min_nrg_cck; 583 u16 min_nrg_cck;
632 u16 max_nrg_cck; 584 u16 max_nrg_cck;
@@ -700,7 +652,6 @@ struct iwl_hw_params {
700 u8 max_beacon_itrvl; /* in 1024 ms */ 652 u8 max_beacon_itrvl; /* in 1024 ms */
701 u32 max_inst_size; 653 u32 max_inst_size;
702 u32 max_data_size; 654 u32 max_data_size;
703 u32 max_bsm_size;
704 u32 ct_kill_threshold; /* value in hw-dependent units */ 655 u32 ct_kill_threshold; /* value in hw-dependent units */
705 u32 ct_kill_exit_threshold; /* value in hw-dependent units */ 656 u32 ct_kill_exit_threshold; /* value in hw-dependent units */
706 /* for 1000, 6000 series and up */ 657 /* for 1000, 6000 series and up */
@@ -722,8 +673,6 @@ struct iwl_hw_params {
722 * Naming convention -- 673 * Naming convention --
723 * iwl_ <-- Is part of iwlwifi 674 * iwl_ <-- Is part of iwlwifi
724 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) 675 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
725 * iwl4965_bg_ <-- Called from work queue context
726 * iwl4965_mac_ <-- mac80211 callback
727 * 676 *
728 ****************************************************************************/ 677 ****************************************************************************/
729extern void iwl_update_chain_flags(struct iwl_priv *priv); 678extern void iwl_update_chain_flags(struct iwl_priv *priv);
@@ -772,7 +721,6 @@ struct iwl_dma_ptr {
772 721
773/* Sensitivity and chain noise calibration */ 722/* Sensitivity and chain noise calibration */
774#define INITIALIZATION_VALUE 0xFFFF 723#define INITIALIZATION_VALUE 0xFFFF
775#define IWL4965_CAL_NUM_BEACONS 20
776#define IWL_CAL_NUM_BEACONS 16 724#define IWL_CAL_NUM_BEACONS 16
777#define MAXIMUM_ALLOWED_PATHLOSS 15 725#define MAXIMUM_ALLOWED_PATHLOSS 15
778 726
@@ -806,24 +754,19 @@ struct iwl_dma_ptr {
806#define NRG_NUM_PREV_STAT_L 20 754#define NRG_NUM_PREV_STAT_L 20
807#define NUM_RX_CHAINS 3 755#define NUM_RX_CHAINS 3
808 756
809enum iwl4965_false_alarm_state { 757enum iwlagn_false_alarm_state {
810 IWL_FA_TOO_MANY = 0, 758 IWL_FA_TOO_MANY = 0,
811 IWL_FA_TOO_FEW = 1, 759 IWL_FA_TOO_FEW = 1,
812 IWL_FA_GOOD_RANGE = 2, 760 IWL_FA_GOOD_RANGE = 2,
813}; 761};
814 762
815enum iwl4965_chain_noise_state { 763enum iwlagn_chain_noise_state {
816 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ 764 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */
817 IWL_CHAIN_NOISE_ACCUMULATE, 765 IWL_CHAIN_NOISE_ACCUMULATE,
818 IWL_CHAIN_NOISE_CALIBRATED, 766 IWL_CHAIN_NOISE_CALIBRATED,
819 IWL_CHAIN_NOISE_DONE, 767 IWL_CHAIN_NOISE_DONE,
820}; 768};
821 769
822enum iwl4965_calib_enabled_state {
823 IWL_CALIB_DISABLED = 0, /* must be 0 */
824 IWL_CALIB_ENABLED = 1,
825};
826
827 770
828/* 771/*
829 * enum iwl_calib 772 * enum iwl_calib
@@ -847,12 +790,6 @@ struct iwl_calib_result {
847 size_t buf_len; 790 size_t buf_len;
848}; 791};
849 792
850enum ucode_type {
851 UCODE_NONE = 0,
852 UCODE_INIT,
853 UCODE_RT
854};
855
856/* Sensitivity calib data */ 793/* Sensitivity calib data */
857struct iwl_sensitivity_data { 794struct iwl_sensitivity_data {
858 u32 auto_corr_ofdm; 795 u32 auto_corr_ofdm;
@@ -1131,12 +1068,6 @@ struct iwl_force_reset {
1131 1068
1132/* extend beacon time format bit shifting */ 1069/* extend beacon time format bit shifting */
1133/* 1070/*
1134 * for _3945 devices
1135 * bits 31:24 - extended
1136 * bits 23:0 - interval
1137 */
1138#define IWL3945_EXT_BEACON_TIME_POS 24
1139/*
1140 * for _agn devices 1071 * for _agn devices
1141 * bits 31:22 - extended 1072 * bits 31:22 - extended
1142 * bits 21:0 - interval 1073 * bits 21:0 - interval
@@ -1164,10 +1095,12 @@ struct iwl_force_reset {
1164struct iwl_notification_wait { 1095struct iwl_notification_wait {
1165 struct list_head list; 1096 struct list_head list;
1166 1097
1167 void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt); 1098 void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt,
1099 void *data);
1100 void *fn_data;
1168 1101
1169 u8 cmd; 1102 u8 cmd;
1170 bool triggered; 1103 bool triggered, aborted;
1171}; 1104};
1172 1105
1173enum iwl_rxon_context_id { 1106enum iwl_rxon_context_id {
@@ -1228,6 +1161,8 @@ struct iwl_rxon_context {
1228 bool enabled, is_40mhz; 1161 bool enabled, is_40mhz;
1229 u8 extension_chan_offset; 1162 u8 extension_chan_offset;
1230 } ht; 1163 } ht;
1164
1165 bool last_tx_rejected;
1231}; 1166};
1232 1167
1233enum iwl_scan_type { 1168enum iwl_scan_type {
@@ -1244,13 +1179,10 @@ struct iwl_priv {
1244 struct ieee80211_rate *ieee_rates; 1179 struct ieee80211_rate *ieee_rates;
1245 struct iwl_cfg *cfg; 1180 struct iwl_cfg *cfg;
1246 1181
1247 /* temporary frame storage list */
1248 struct list_head free_frames;
1249 int frames_count;
1250
1251 enum ieee80211_band band; 1182 enum ieee80211_band band;
1252 int alloc_rxb_page;
1253 1183
1184 void (*pre_rx_handler)(struct iwl_priv *priv,
1185 struct iwl_rx_mem_buffer *rxb);
1254 void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, 1186 void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv,
1255 struct iwl_rx_mem_buffer *rxb); 1187 struct iwl_rx_mem_buffer *rxb);
1256 1188
@@ -1305,16 +1237,12 @@ struct iwl_priv {
1305 spinlock_t hcmd_lock; /* protect hcmd */ 1237 spinlock_t hcmd_lock; /* protect hcmd */
1306 spinlock_t reg_lock; /* protect hw register access */ 1238 spinlock_t reg_lock; /* protect hw register access */
1307 struct mutex mutex; 1239 struct mutex mutex;
1308 struct mutex sync_cmd_mutex; /* enable serialization of sync commands */
1309 1240
1310 /* basic pci-network driver stuff */ 1241 /* basic pci-network driver stuff */
1311 struct pci_dev *pci_dev; 1242 struct pci_dev *pci_dev;
1312 1243
1313 /* pci hardware address support */ 1244 /* pci hardware address support */
1314 void __iomem *hw_base; 1245 void __iomem *hw_base;
1315 u32 hw_rev;
1316 u32 hw_wa_rev;
1317 u8 rev_id;
1318 1246
1319 /* microcode/device supports multiple contexts */ 1247 /* microcode/device supports multiple contexts */
1320 u8 valid_contexts; 1248 u8 valid_contexts;
@@ -1325,6 +1253,8 @@ struct iwl_priv {
1325 /* max number of station keys */ 1253 /* max number of station keys */
1326 u8 sta_key_max_num; 1254 u8 sta_key_max_num;
1327 1255
1256 bool new_scan_threshold_behaviour;
1257
1328 /* EEPROM MAC addresses */ 1258 /* EEPROM MAC addresses */
1329 struct mac_address addresses[2]; 1259 struct mac_address addresses[2];
1330 1260
@@ -1332,13 +1262,10 @@ struct iwl_priv {
1332 int fw_index; /* firmware we're trying to load */ 1262 int fw_index; /* firmware we're trying to load */
1333 u32 ucode_ver; /* version of ucode, copy of 1263 u32 ucode_ver; /* version of ucode, copy of
1334 iwl_ucode.ver */ 1264 iwl_ucode.ver */
1335 struct fw_desc ucode_code; /* runtime inst */ 1265 struct fw_img ucode_rt;
1336 struct fw_desc ucode_data; /* runtime data original */ 1266 struct fw_img ucode_init;
1337 struct fw_desc ucode_data_backup; /* runtime data save/restore */ 1267
1338 struct fw_desc ucode_init; /* initialization inst */ 1268 enum iwlagn_ucode_subtype ucode_type;
1339 struct fw_desc ucode_init_data; /* initialization data */
1340 struct fw_desc ucode_boot; /* bootstrap inst */
1341 enum ucode_type ucode_type;
1342 u8 ucode_write_complete; /* the image write is complete */ 1269 u8 ucode_write_complete; /* the image write is complete */
1343 char firmware_name[25]; 1270 char firmware_name[25];
1344 1271
@@ -1346,10 +1273,10 @@ struct iwl_priv {
1346 1273
1347 struct iwl_switch_rxon switch_rxon; 1274 struct iwl_switch_rxon switch_rxon;
1348 1275
1349 /* 1st responses from initialize and runtime uCode images. 1276 struct {
1350 * _agn's initialize alive response contains some calibration data. */ 1277 u32 error_event_table;
1351 struct iwl_init_alive_resp card_alive_init; 1278 u32 log_event_table;
1352 struct iwl_alive_resp card_alive; 1279 } device_pointers;
1353 1280
1354 u16 active_rate; 1281 u16 active_rate;
1355 1282
@@ -1390,15 +1317,12 @@ struct iwl_priv {
1390 struct iwl_power_mgr power_data; 1317 struct iwl_power_mgr power_data;
1391 struct iwl_tt_mgmt thermal_throttle; 1318 struct iwl_tt_mgmt thermal_throttle;
1392 1319
1393 /* context information */
1394 u8 bssid[ETH_ALEN]; /* used only on 3945 but filled by core */
1395
1396 /* station table variables */ 1320 /* station table variables */
1397 1321
1398 /* Note: if lock and sta_lock are needed, lock must be acquired first */ 1322 /* Note: if lock and sta_lock are needed, lock must be acquired first */
1399 spinlock_t sta_lock; 1323 spinlock_t sta_lock;
1400 int num_stations; 1324 int num_stations;
1401 struct iwl_station_entry stations[IWL_STATION_COUNT]; 1325 struct iwl_station_entry stations[IWLAGN_STATION_COUNT];
1402 unsigned long ucode_key_table; 1326 unsigned long ucode_key_table;
1403 1327
1404 /* queue refcounts */ 1328 /* queue refcounts */
@@ -1422,101 +1346,81 @@ struct iwl_priv {
1422 /* Last Rx'd beacon timestamp */ 1346 /* Last Rx'd beacon timestamp */
1423 u64 timestamp; 1347 u64 timestamp;
1424 1348
1425 union { 1349 struct {
1426#if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE) 1350 __le32 flag;
1427 struct { 1351 struct statistics_general_common common;
1428 void *shared_virt; 1352 struct statistics_rx_non_phy rx_non_phy;
1429 dma_addr_t shared_phys; 1353 struct statistics_rx_phy rx_ofdm;
1430 1354 struct statistics_rx_ht_phy rx_ofdm_ht;
1431 struct delayed_work thermal_periodic; 1355 struct statistics_rx_phy rx_cck;
1432 struct delayed_work rfkill_poll; 1356 struct statistics_tx tx;
1433
1434 struct iwl3945_notif_statistics statistics;
1435#ifdef CONFIG_IWLWIFI_DEBUGFS 1357#ifdef CONFIG_IWLWIFI_DEBUGFS
1436 struct iwl3945_notif_statistics accum_statistics; 1358 struct statistics_bt_activity bt_activity;
1437 struct iwl3945_notif_statistics delta_statistics; 1359 __le32 num_bt_kills, accum_num_bt_kills;
1438 struct iwl3945_notif_statistics max_delta;
1439#endif
1440
1441 u32 sta_supp_rates;
1442 int last_rx_rssi; /* From Rx packet statistics */
1443
1444 /* Rx'd packet timing information */
1445 u32 last_beacon_time;
1446 u64 last_tsf;
1447
1448 /*
1449 * each calibration channel group in the
1450 * EEPROM has a derived clip setting for
1451 * each rate.
1452 */
1453 const struct iwl3945_clip_group clip_groups[5];
1454
1455 } _3945;
1456#endif 1360#endif
1457#if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE) 1361 } statistics;
1458 struct {
1459 /* INT ICT Table */
1460 __le32 *ict_tbl;
1461 void *ict_tbl_vir;
1462 dma_addr_t ict_tbl_dma;
1463 dma_addr_t aligned_ict_tbl_dma;
1464 int ict_index;
1465 u32 inta;
1466 bool use_ict;
1467 /*
1468 * reporting the number of tids has AGG on. 0 means
1469 * no AGGREGATION
1470 */
1471 u8 agg_tids_count;
1472
1473 struct iwl_rx_phy_res last_phy_res;
1474 bool last_phy_res_valid;
1475
1476 struct completion firmware_loading_complete;
1477
1478 u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
1479 u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
1480
1481 /*
1482 * chain noise reset and gain commands are the
1483 * two extra calibration commands follows the standard
1484 * phy calibration commands
1485 */
1486 u8 phy_calib_chain_noise_reset_cmd;
1487 u8 phy_calib_chain_noise_gain_cmd;
1488
1489 struct iwl_notif_statistics statistics;
1490 struct iwl_bt_notif_statistics statistics_bt;
1491 /* counts reply_tx error */
1492 struct reply_tx_error_statistics reply_tx_stats;
1493 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
1494#ifdef CONFIG_IWLWIFI_DEBUGFS 1362#ifdef CONFIG_IWLWIFI_DEBUGFS
1495 struct iwl_notif_statistics accum_statistics; 1363 struct {
1496 struct iwl_notif_statistics delta_statistics; 1364 struct statistics_general_common common;
1497 struct iwl_notif_statistics max_delta; 1365 struct statistics_rx_non_phy rx_non_phy;
1498 struct iwl_bt_notif_statistics accum_statistics_bt; 1366 struct statistics_rx_phy rx_ofdm;
1499 struct iwl_bt_notif_statistics delta_statistics_bt; 1367 struct statistics_rx_ht_phy rx_ofdm_ht;
1500 struct iwl_bt_notif_statistics max_delta_bt; 1368 struct statistics_rx_phy rx_cck;
1369 struct statistics_tx tx;
1370 struct statistics_bt_activity bt_activity;
1371 } accum_stats, delta_stats, max_delta_stats;
1501#endif 1372#endif
1502 1373
1503 /* notification wait support */ 1374 struct {
1504 struct list_head notif_waits; 1375 /* INT ICT Table */
1505 spinlock_t notif_wait_lock; 1376 __le32 *ict_tbl;
1506 wait_queue_head_t notif_waitq; 1377 void *ict_tbl_vir;
1507 1378 dma_addr_t ict_tbl_dma;
1508 /* remain-on-channel offload support */ 1379 dma_addr_t aligned_ict_tbl_dma;
1509 struct ieee80211_channel *hw_roc_channel; 1380 int ict_index;
1510 struct delayed_work hw_roc_work; 1381 u32 inta;
1511 enum nl80211_channel_type hw_roc_chantype; 1382 bool use_ict;
1512 int hw_roc_duration; 1383 /*
1513 1384 * reporting the number of tids has AGG on. 0 means
1514 struct sk_buff *offchan_tx_skb; 1385 * no AGGREGATION
1515 int offchan_tx_timeout; 1386 */
1516 struct ieee80211_channel *offchan_tx_chan; 1387 u8 agg_tids_count;
1517 } _agn; 1388
1518#endif 1389 struct iwl_rx_phy_res last_phy_res;
1519 }; 1390 bool last_phy_res_valid;
1391
1392 struct completion firmware_loading_complete;
1393
1394 u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
1395 u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
1396
1397 /*
1398 * chain noise reset and gain commands are the
1399 * two extra calibration commands follows the standard
1400 * phy calibration commands
1401 */
1402 u8 phy_calib_chain_noise_reset_cmd;
1403 u8 phy_calib_chain_noise_gain_cmd;
1404
1405 /* counts reply_tx error */
1406 struct reply_tx_error_statistics reply_tx_stats;
1407 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
1408 /* notification wait support */
1409 struct list_head notif_waits;
1410 spinlock_t notif_wait_lock;
1411 wait_queue_head_t notif_waitq;
1412
1413 /* remain-on-channel offload support */
1414 struct ieee80211_channel *hw_roc_channel;
1415 struct delayed_work hw_roc_work;
1416 enum nl80211_channel_type hw_roc_chantype;
1417 int hw_roc_duration;
1418 bool hw_roc_setup;
1419
1420 struct sk_buff *offchan_tx_skb;
1421 int offchan_tx_timeout;
1422 struct ieee80211_channel *offchan_tx_chan;
1423 } _agn;
1520 1424
1521 /* bt coex */ 1425 /* bt coex */
1522 u8 bt_enable_flag; 1426 u8 bt_enable_flag;
@@ -1559,8 +1463,6 @@ struct iwl_priv {
1559 1463
1560 struct tasklet_struct irq_tasklet; 1464 struct tasklet_struct irq_tasklet;
1561 1465
1562 struct delayed_work init_alive_start;
1563 struct delayed_work alive_start;
1564 struct delayed_work scan_check; 1466 struct delayed_work scan_check;
1565 1467
1566 /* TX Power */ 1468 /* TX Power */
@@ -1589,12 +1491,10 @@ struct iwl_priv {
1589 struct work_struct txpower_work; 1491 struct work_struct txpower_work;
1590 u32 disable_sens_cal; 1492 u32 disable_sens_cal;
1591 u32 disable_chain_noise_cal; 1493 u32 disable_chain_noise_cal;
1592 u32 disable_tx_power_cal;
1593 struct work_struct run_time_calib_work; 1494 struct work_struct run_time_calib_work;
1594 struct timer_list statistics_periodic; 1495 struct timer_list statistics_periodic;
1595 struct timer_list ucode_trace; 1496 struct timer_list ucode_trace;
1596 struct timer_list watchdog; 1497 struct timer_list watchdog;
1597 bool hw_ready;
1598 1498
1599 struct iwl_event_log event_log; 1499 struct iwl_event_log event_log;
1600 1500
@@ -1658,21 +1558,24 @@ iwl_rxon_ctx_from_vif(struct ieee80211_vif *vif)
1658 ctx < &priv->contexts[NUM_IWL_RXON_CTX]; ctx++) \ 1558 ctx < &priv->contexts[NUM_IWL_RXON_CTX]; ctx++) \
1659 if (priv->valid_contexts & BIT(ctx->ctxid)) 1559 if (priv->valid_contexts & BIT(ctx->ctxid))
1660 1560
1661static inline int iwl_is_associated(struct iwl_priv *priv, 1561static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx)
1662 enum iwl_rxon_context_id ctxid)
1663{ 1562{
1664 return (priv->contexts[ctxid].active.filter_flags & 1563 return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1665 RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1666} 1564}
1667 1565
1668static inline int iwl_is_any_associated(struct iwl_priv *priv) 1566static inline int iwl_is_associated(struct iwl_priv *priv,
1567 enum iwl_rxon_context_id ctxid)
1669{ 1568{
1670 return iwl_is_associated(priv, IWL_RXON_CTX_BSS); 1569 return iwl_is_associated_ctx(&priv->contexts[ctxid]);
1671} 1570}
1672 1571
1673static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx) 1572static inline int iwl_is_any_associated(struct iwl_priv *priv)
1674{ 1573{
1675 return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; 1574 struct iwl_rxon_context *ctx;
1575 for_each_context(priv, ctx)
1576 if (iwl_is_associated_ctx(ctx))
1577 return true;
1578 return false;
1676} 1579}
1677 1580
1678static inline int is_channel_valid(const struct iwl_channel_info *ch_info) 1581static inline int is_channel_valid(const struct iwl_channel_info *ch_info)
@@ -1710,12 +1613,10 @@ static inline int is_channel_ibss(const struct iwl_channel_info *ch)
1710static inline void __iwl_free_pages(struct iwl_priv *priv, struct page *page) 1613static inline void __iwl_free_pages(struct iwl_priv *priv, struct page *page)
1711{ 1614{
1712 __free_pages(page, priv->hw_params.rx_page_order); 1615 __free_pages(page, priv->hw_params.rx_page_order);
1713 priv->alloc_rxb_page--;
1714} 1616}
1715 1617
1716static inline void iwl_free_pages(struct iwl_priv *priv, unsigned long page) 1618static inline void iwl_free_pages(struct iwl_priv *priv, unsigned long page)
1717{ 1619{
1718 free_pages(page, priv->hw_params.rx_page_order); 1620 free_pages(page, priv->hw_params.rx_page_order);
1719 priv->alloc_rxb_page--;
1720} 1621}
1721#endif /* __iwl_dev_h__ */ 1622#endif /* __iwl_dev_h__ */