aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-dev.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-08 11:14:56 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-08 11:19:00 -0400
commit0da0e5bf1522d75d446f5124e17016628d0a149e (patch)
tree86d9c4986be873fb834b54a4d9075330743c0f03 /drivers/net/wireless/iwlwifi/iwl-dev.h
parent703bc583cb98a24eeedd297ee59dfa12852897d1 (diff)
iwlagn: clean up & autodetect statistics
There's no need to keep both normal and BT statistics versions around all the time in memory when we only use a subset of both. So keep only the subsets that we need in memory, depending on the debug config). Also, in doing so, we can remove all the calls to iwl_bt_statistics() in the driver as we'll just access the copied statistics now. Finally, also remove this call from the one place where it might still be needed and automatically detect what kind of statistics the device is sending based on their size. This way, we don't need to keep track of which devices do what any more, which is good since this is subject to change based on the ucode version (as some ucode even for non-BT devices will in fact use BT statistics). Warn upon encountering a statistics command from the ucode that isn't known, so we will find such issues earlier in the future. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h41
1 files changed, 27 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 7fe68f8dd210..e84534c4d956 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -543,13 +543,12 @@ enum iwl_ucode_tlv_type {
543 * enum iwl_ucode_tlv_flag - ucode API flags 543 * enum iwl_ucode_tlv_flag - ucode API flags
544 * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously 544 * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
545 * was a separate TLV but moved here to save space. 545 * was a separate TLV but moved here to save space.
546 * @IWL_UCODE_TLV_FLAGS_BTSTATS: This uCode image uses BT statistics, which 546 * @IWL_UCODE_TLV_FLAGS_RESERVED_1: reserved
547 * may be true even if the device doesn't have BT.
548 * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). 547 * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
549 */ 548 */
550enum iwl_ucode_tlv_flag { 549enum iwl_ucode_tlv_flag {
551 IWL_UCODE_TLV_FLAGS_PAN = BIT(0), 550 IWL_UCODE_TLV_FLAGS_PAN = BIT(0),
552 IWL_UCODE_TLV_FLAGS_BTSTATS = BIT(1), 551 IWL_UCODE_TLV_FLAGS_RESERVED_1 = BIT(1),
553 IWL_UCODE_TLV_FLAGS_MFP = BIT(2), 552 IWL_UCODE_TLV_FLAGS_MFP = BIT(2),
554}; 553};
555 554
@@ -1357,6 +1356,31 @@ struct iwl_priv {
1357 u64 timestamp; 1356 u64 timestamp;
1358 1357
1359 struct { 1358 struct {
1359 __le32 flag;
1360 struct statistics_general_common common;
1361 struct statistics_rx_non_phy rx_non_phy;
1362 struct statistics_rx_phy rx_ofdm;
1363 struct statistics_rx_ht_phy rx_ofdm_ht;
1364 struct statistics_rx_phy rx_cck;
1365 struct statistics_tx tx;
1366#ifdef CONFIG_IWLWIFI_DEBUGFS
1367 struct statistics_bt_activity bt_activity;
1368 __le32 num_bt_kills, accum_num_bt_kills;
1369#endif
1370 } statistics;
1371#ifdef CONFIG_IWLWIFI_DEBUGFS
1372 struct {
1373 struct statistics_general_common common;
1374 struct statistics_rx_non_phy rx_non_phy;
1375 struct statistics_rx_phy rx_ofdm;
1376 struct statistics_rx_ht_phy rx_ofdm_ht;
1377 struct statistics_rx_phy rx_cck;
1378 struct statistics_tx tx;
1379 struct statistics_bt_activity bt_activity;
1380 } accum_stats, delta_stats, max_delta_stats;
1381#endif
1382
1383 struct {
1360 /* INT ICT Table */ 1384 /* INT ICT Table */
1361 __le32 *ict_tbl; 1385 __le32 *ict_tbl;
1362 void *ict_tbl_vir; 1386 void *ict_tbl_vir;
@@ -1387,19 +1411,9 @@ struct iwl_priv {
1387 u8 phy_calib_chain_noise_reset_cmd; 1411 u8 phy_calib_chain_noise_reset_cmd;
1388 u8 phy_calib_chain_noise_gain_cmd; 1412 u8 phy_calib_chain_noise_gain_cmd;
1389 1413
1390 struct iwl_notif_statistics statistics;
1391 struct iwl_bt_notif_statistics statistics_bt;
1392 /* counts reply_tx error */ 1414 /* counts reply_tx error */
1393 struct reply_tx_error_statistics reply_tx_stats; 1415 struct reply_tx_error_statistics reply_tx_stats;
1394 struct reply_agg_tx_error_statistics reply_agg_tx_stats; 1416 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
1395#ifdef CONFIG_IWLWIFI_DEBUGFS
1396 struct iwl_notif_statistics accum_statistics;
1397 struct iwl_notif_statistics delta_statistics;
1398 struct iwl_notif_statistics max_delta;
1399 struct iwl_bt_notif_statistics accum_statistics_bt;
1400 struct iwl_bt_notif_statistics delta_statistics_bt;
1401 struct iwl_bt_notif_statistics max_delta_bt;
1402#endif
1403 /* notification wait support */ 1417 /* notification wait support */
1404 struct list_head notif_waits; 1418 struct list_head notif_waits;
1405 spinlock_t notif_wait_lock; 1419 spinlock_t notif_wait_lock;
@@ -1424,7 +1438,6 @@ struct iwl_priv {
1424 bool bt_ch_announce; 1438 bool bt_ch_announce;
1425 bool bt_full_concurrent; 1439 bool bt_full_concurrent;
1426 bool bt_ant_couple_ok; 1440 bool bt_ant_couple_ok;
1427 bool bt_statistics;
1428 __le32 kill_ack_mask; 1441 __le32 kill_ack_mask;
1429 __le32 kill_cts_mask; 1442 __le32 kill_cts_mask;
1430 __le16 bt_valid; 1443 __le16 bt_valid;