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.h165
1 files changed, 133 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 1ad330342ffc..4dd38b7b8b74 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -144,6 +144,7 @@ struct iwl_queue {
144/* One for each TFD */ 144/* One for each TFD */
145struct iwl_tx_info { 145struct iwl_tx_info {
146 struct sk_buff *skb; 146 struct sk_buff *skb;
147 struct iwl_rxon_context *ctx;
147}; 148};
148 149
149/** 150/**
@@ -253,10 +254,14 @@ struct iwl_channel_info {
253 struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; 254 struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
254}; 255};
255 256
256#define IWL_TX_FIFO_BK 0 257#define IWL_TX_FIFO_BK 0 /* shared */
257#define IWL_TX_FIFO_BE 1 258#define IWL_TX_FIFO_BE 1
258#define IWL_TX_FIFO_VI 2 259#define IWL_TX_FIFO_VI 2 /* shared */
259#define IWL_TX_FIFO_VO 3 260#define IWL_TX_FIFO_VO 3
261#define IWL_TX_FIFO_BK_IPAN IWL_TX_FIFO_BK
262#define IWL_TX_FIFO_BE_IPAN 4
263#define IWL_TX_FIFO_VI_IPAN IWL_TX_FIFO_VI
264#define IWL_TX_FIFO_VO_IPAN 5
260#define IWL_TX_FIFO_UNUSED -1 265#define IWL_TX_FIFO_UNUSED -1
261 266
262/* Minimum number of queues. MAX_NUM is defined in hw specific files. 267/* Minimum number of queues. MAX_NUM is defined in hw specific files.
@@ -265,11 +270,17 @@ struct iwl_channel_info {
265#define IWL_MIN_NUM_QUEUES 10 270#define IWL_MIN_NUM_QUEUES 10
266 271
267/* 272/*
268 * Queue #4 is the command queue for 3945/4965/5x00/1000/6x00, 273 * Command queue depends on iPAN support.
269 * the driver maps it into the appropriate device FIFO for the
270 * uCode.
271 */ 274 */
272#define IWL_CMD_QUEUE_NUM 4 275#define IWL_DEFAULT_CMD_QUEUE_NUM 4
276#define IWL_IPAN_CMD_QUEUE_NUM 9
277
278/*
279 * This queue number is required for proper operation
280 * because the ucode will stop/start the scheduler as
281 * required.
282 */
283#define IWL_IPAN_MCAST_QUEUE 8
273 284
274/* Power management (not Tx power) structures */ 285/* Power management (not Tx power) structures */
275 286
@@ -459,15 +470,8 @@ union iwl_ht_rate_supp {
459#define CFG_HT_MPDU_DENSITY_MIN (0x1) 470#define CFG_HT_MPDU_DENSITY_MIN (0x1)
460 471
461struct iwl_ht_config { 472struct iwl_ht_config {
462 /* self configuration data */
463 bool is_ht;
464 bool is_40mhz;
465 bool single_chain_sufficient; 473 bool single_chain_sufficient;
466 enum ieee80211_smps_mode smps; /* current smps mode */ 474 enum ieee80211_smps_mode smps; /* current smps mode */
467 /* BSS related data */
468 u8 extension_chan_offset;
469 u8 ht_protection;
470 u8 non_GF_STA_present;
471}; 475};
472 476
473/* QoS structures */ 477/* QoS structures */
@@ -485,12 +489,13 @@ struct iwl_qos_info {
485struct iwl_station_entry { 489struct iwl_station_entry {
486 struct iwl_addsta_cmd sta; 490 struct iwl_addsta_cmd sta;
487 struct iwl_tid_data tid[MAX_TID_COUNT]; 491 struct iwl_tid_data tid[MAX_TID_COUNT];
488 u8 used; 492 u8 used, ctxid;
489 struct iwl_hw_key keyinfo; 493 struct iwl_hw_key keyinfo;
490 struct iwl_link_quality_cmd *lq; 494 struct iwl_link_quality_cmd *lq;
491}; 495};
492 496
493struct iwl_station_priv_common { 497struct iwl_station_priv_common {
498 struct iwl_rxon_context *ctx;
494 u8 sta_id; 499 u8 sta_id;
495}; 500};
496 501
@@ -519,6 +524,7 @@ struct iwl_station_priv {
519 * space for us to put data into. 524 * space for us to put data into.
520 */ 525 */
521struct iwl_vif_priv { 526struct iwl_vif_priv {
527 struct iwl_rxon_context *ctx;
522 u8 ibss_bssid_sta_id; 528 u8 ibss_bssid_sta_id;
523}; 529};
524 530
@@ -576,6 +582,7 @@ enum iwl_ucode_tlv_type {
576 IWL_UCODE_TLV_INIT_DATA = 4, 582 IWL_UCODE_TLV_INIT_DATA = 4,
577 IWL_UCODE_TLV_BOOT = 5, 583 IWL_UCODE_TLV_BOOT = 5,
578 IWL_UCODE_TLV_PROBE_MAX_LEN = 6, /* a u32 value */ 584 IWL_UCODE_TLV_PROBE_MAX_LEN = 6, /* a u32 value */
585 IWL_UCODE_TLV_PAN = 7,
579 IWL_UCODE_TLV_RUNT_EVTLOG_PTR = 8, 586 IWL_UCODE_TLV_RUNT_EVTLOG_PTR = 8,
580 IWL_UCODE_TLV_RUNT_EVTLOG_SIZE = 9, 587 IWL_UCODE_TLV_RUNT_EVTLOG_SIZE = 9,
581 IWL_UCODE_TLV_RUNT_ERRLOG_PTR = 10, 588 IWL_UCODE_TLV_RUNT_ERRLOG_PTR = 10,
@@ -670,7 +677,6 @@ struct iwl_sensitivity_ranges {
670 * @rx_page_order: Rx buffer page order 677 * @rx_page_order: Rx buffer page order
671 * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR 678 * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
672 * @max_stations: 679 * @max_stations:
673 * @bcast_sta_id:
674 * @ht40_channel: is 40MHz width possible in band 2.4 680 * @ht40_channel: is 40MHz width possible in band 2.4
675 * BIT(IEEE80211_BAND_5GHZ) BIT(IEEE80211_BAND_5GHZ) 681 * BIT(IEEE80211_BAND_5GHZ) BIT(IEEE80211_BAND_5GHZ)
676 * @sw_crypto: 0 for hw, 1 for sw 682 * @sw_crypto: 0 for hw, 1 for sw
@@ -694,7 +700,6 @@ struct iwl_hw_params {
694 u32 rx_page_order; 700 u32 rx_page_order;
695 u32 rx_wrt_ptr_reg; 701 u32 rx_wrt_ptr_reg;
696 u8 max_stations; 702 u8 max_stations;
697 u8 bcast_sta_id;
698 u8 ht40_channel; 703 u8 ht40_channel;
699 u8 max_beacon_itrvl; /* in 1024 ms */ 704 u8 max_beacon_itrvl; /* in 1024 ms */
700 u32 max_inst_size; 705 u32 max_inst_size;
@@ -1064,6 +1069,10 @@ struct iwl_event_log {
1064#define IWL_DEF_MONITORING_PERIOD (1000) 1069#define IWL_DEF_MONITORING_PERIOD (1000)
1065#define IWL_LONG_MONITORING_PERIOD (5000) 1070#define IWL_LONG_MONITORING_PERIOD (5000)
1066#define IWL_ONE_HUNDRED_MSECS (100) 1071#define IWL_ONE_HUNDRED_MSECS (100)
1072#define IWL_MAX_MONITORING_PERIOD (60000)
1073
1074/* BT Antenna Coupling Threshold (dB) */
1075#define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35)
1067 1076
1068enum iwl_reset { 1077enum iwl_reset {
1069 IWL_RF_RESET = 0, 1078 IWL_RF_RESET = 0,
@@ -1093,6 +1102,57 @@ struct iwl_force_reset {
1093 */ 1102 */
1094#define IWLAGN_EXT_BEACON_TIME_POS 22 1103#define IWLAGN_EXT_BEACON_TIME_POS 22
1095 1104
1105enum iwl_rxon_context_id {
1106 IWL_RXON_CTX_BSS,
1107 IWL_RXON_CTX_PAN,
1108
1109 NUM_IWL_RXON_CTX
1110};
1111
1112struct iwl_rxon_context {
1113 struct ieee80211_vif *vif;
1114
1115 const u8 *ac_to_fifo;
1116 const u8 *ac_to_queue;
1117 u8 mcast_queue;
1118
1119 enum iwl_rxon_context_id ctxid;
1120
1121 u32 interface_modes, exclusive_interface_modes;
1122 u8 unused_devtype, ap_devtype, ibss_devtype, station_devtype;
1123
1124 /*
1125 * We declare this const so it can only be
1126 * changed via explicit cast within the
1127 * routines that actually update the physical
1128 * hardware.
1129 */
1130 const struct iwl_rxon_cmd active;
1131 struct iwl_rxon_cmd staging;
1132
1133 struct iwl_rxon_time_cmd timing;
1134
1135 struct iwl_qos_info qos_data;
1136
1137 u8 bcast_sta_id, ap_sta_id;
1138
1139 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
1140 u8 qos_cmd;
1141 u8 wep_key_cmd;
1142
1143 struct iwl_wep_key wep_keys[WEP_KEYS_MAX];
1144 u8 key_mapping_keys;
1145
1146 __le32 station_flags;
1147
1148 struct {
1149 bool non_gf_sta_present;
1150 u8 protection;
1151 bool enabled, is_40mhz;
1152 u8 extension_chan_offset;
1153 } ht;
1154};
1155
1096struct iwl_priv { 1156struct iwl_priv {
1097 1157
1098 /* ieee device used by generic ieee processing code */ 1158 /* ieee device used by generic ieee processing code */
@@ -1169,6 +1229,15 @@ struct iwl_priv {
1169 u32 hw_wa_rev; 1229 u32 hw_wa_rev;
1170 u8 rev_id; 1230 u8 rev_id;
1171 1231
1232 /* microcode/device supports multiple contexts */
1233 u8 valid_contexts;
1234
1235 /* command queue number */
1236 u8 cmd_queue;
1237
1238 /* max number of station keys */
1239 u8 sta_key_max_num;
1240
1172 /* EEPROM MAC addresses */ 1241 /* EEPROM MAC addresses */
1173 struct mac_address addresses[2]; 1242 struct mac_address addresses[2];
1174 1243
@@ -1186,15 +1255,7 @@ struct iwl_priv {
1186 u8 ucode_write_complete; /* the image write is complete */ 1255 u8 ucode_write_complete; /* the image write is complete */
1187 char firmware_name[25]; 1256 char firmware_name[25];
1188 1257
1189 1258 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
1190 struct iwl_rxon_time_cmd rxon_timing;
1191
1192 /* We declare this const so it can only be
1193 * changed via explicit cast within the
1194 * routines that actually update the physical
1195 * hardware */
1196 const struct iwl_rxon_cmd active_rxon;
1197 struct iwl_rxon_cmd staging_rxon;
1198 1259
1199 struct iwl_switch_rxon switch_rxon; 1260 struct iwl_switch_rxon switch_rxon;
1200 1261
@@ -1256,8 +1317,6 @@ struct iwl_priv {
1256 spinlock_t sta_lock; 1317 spinlock_t sta_lock;
1257 int num_stations; 1318 int num_stations;
1258 struct iwl_station_entry stations[IWL_STATION_COUNT]; 1319 struct iwl_station_entry stations[IWL_STATION_COUNT];
1259 struct iwl_wep_key wep_keys[WEP_KEYS_MAX]; /* protected by mutex */
1260 u8 key_mapping_key;
1261 unsigned long ucode_key_table; 1320 unsigned long ucode_key_table;
1262 1321
1263 /* queue refcounts */ 1322 /* queue refcounts */
@@ -1282,7 +1341,6 @@ struct iwl_priv {
1282 1341
1283 /* Last Rx'd beacon timestamp */ 1342 /* Last Rx'd beacon timestamp */
1284 u64 timestamp; 1343 u64 timestamp;
1285 struct ieee80211_vif *vif;
1286 1344
1287 union { 1345 union {
1288#if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE) 1346#if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE)
@@ -1362,12 +1420,27 @@ struct iwl_priv {
1362#endif 1420#endif
1363 }; 1421 };
1364 1422
1423 /* bt coex */
1424 u8 bt_status;
1425 u8 bt_traffic_load, notif_bt_traffic_load;
1426 bool bt_ch_announce;
1427 bool bt_sco_active;
1428 bool bt_full_concurrent;
1429 bool bt_ant_couple_ok;
1430 __le32 kill_ack_mask;
1431 __le32 kill_cts_mask;
1432 __le16 bt_valid;
1433 u16 bt_on_thresh;
1434 u16 bt_duration;
1435 u16 dynamic_frag_thresh;
1436 u16 dynamic_agg_thresh;
1437 u8 bt_ci_compliance;
1438 struct work_struct bt_traffic_change_work;
1439
1365 struct iwl_hw_params hw_params; 1440 struct iwl_hw_params hw_params;
1366 1441
1367 u32 inta_mask; 1442 u32 inta_mask;
1368 1443
1369 struct iwl_qos_info qos_data;
1370
1371 struct workqueue_struct *workqueue; 1444 struct workqueue_struct *workqueue;
1372 1445
1373 struct work_struct restart; 1446 struct work_struct restart;
@@ -1375,11 +1448,15 @@ struct iwl_priv {
1375 struct work_struct rx_replenish; 1448 struct work_struct rx_replenish;
1376 struct work_struct abort_scan; 1449 struct work_struct abort_scan;
1377 struct work_struct beacon_update; 1450 struct work_struct beacon_update;
1451 struct iwl_rxon_context *beacon_ctx;
1452
1378 struct work_struct tt_work; 1453 struct work_struct tt_work;
1379 struct work_struct ct_enter; 1454 struct work_struct ct_enter;
1380 struct work_struct ct_exit; 1455 struct work_struct ct_exit;
1381 struct work_struct start_internal_scan; 1456 struct work_struct start_internal_scan;
1382 struct work_struct tx_flush; 1457 struct work_struct tx_flush;
1458 struct work_struct bt_full_concurrency;
1459 struct work_struct bt_runtime_config;
1383 1460
1384 struct tasklet_struct irq_tasklet; 1461 struct tasklet_struct irq_tasklet;
1385 1462
@@ -1467,10 +1544,34 @@ static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
1467 return NULL; 1544 return NULL;
1468} 1545}
1469 1546
1547static inline struct iwl_rxon_context *
1548iwl_rxon_ctx_from_vif(struct ieee80211_vif *vif)
1549{
1550 struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
1551
1552 return vif_priv->ctx;
1553}
1554
1555#define for_each_context(priv, ctx) \
1556 for (ctx = &priv->contexts[IWL_RXON_CTX_BSS]; \
1557 ctx < &priv->contexts[NUM_IWL_RXON_CTX]; ctx++) \
1558 if (priv->valid_contexts & BIT(ctx->ctxid))
1559
1560static inline int iwl_is_associated(struct iwl_priv *priv,
1561 enum iwl_rxon_context_id ctxid)
1562{
1563 return (priv->contexts[ctxid].active.filter_flags &
1564 RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1565}
1566
1567static inline int iwl_is_any_associated(struct iwl_priv *priv)
1568{
1569 return iwl_is_associated(priv, IWL_RXON_CTX_BSS);
1570}
1470 1571
1471static inline int iwl_is_associated(struct iwl_priv *priv) 1572static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx)
1472{ 1573{
1473 return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; 1574 return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1474} 1575}
1475 1576
1476static inline int is_channel_valid(const struct iwl_channel_info *ch_info) 1577static inline int is_channel_valid(const struct iwl_channel_info *ch_info)