aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2017-08-31 05:57:33 -0400
committerLuca Coelho <luciano.coelho@intel.com>2017-10-06 07:57:21 -0400
commitd7b9bb69c9b3accbd199b51b28d95d08f37049cd (patch)
tree9e815cc7e5cc27c370960b8ddaba2f5d98e5a127
parent72cbb73e8ad34b2d4409156546678763e91c71b6 (diff)
iwlwifi: mvm: remove support for Link Quality Measurements
This was never used by any product. Remove it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h67
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c76
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c10
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h12
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/ops.c2
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/utils.c71
6 files changed, 0 insertions, 238 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
index 39c89e85fd2f..ec42c84e5df2 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
@@ -68,78 +68,11 @@
68 */ 68 */
69enum iwl_mac_conf_subcmd_ids { 69enum iwl_mac_conf_subcmd_ids {
70 /** 70 /**
71 * @LINK_QUALITY_MEASUREMENT_CMD: &struct iwl_link_qual_msrmnt_cmd
72 */
73 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
74
75 /**
76 * @LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF:
77 * &struct iwl_link_qual_msrmnt_notif
78 */
79 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
80
81 /**
82 * @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif 71 * @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif
83 */ 72 */
84 CHANNEL_SWITCH_NOA_NOTIF = 0xFF, 73 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
85}; 74};
86 75
87#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
88
89enum iwl_lqm_cmd_operatrions {
90 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
91 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
92};
93
94enum iwl_lqm_status {
95 LQM_STATUS_SUCCESS = 0,
96 LQM_STATUS_TIMEOUT = 1,
97 LQM_STATUS_ABORT = 2,
98};
99
100/**
101 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
102 * @cmd_operation: command operation to be performed (start or stop)
103 * as defined above.
104 * @mac_id: MAC ID the measurement applies to.
105 * @measurement_time: time of the total measurement to be performed, in uSec.
106 * @timeout: maximum time allowed until a response is sent, in uSec.
107 */
108struct iwl_link_qual_msrmnt_cmd {
109 __le32 cmd_operation;
110 __le32 mac_id;
111 __le32 measurement_time;
112 __le32 timeout;
113} __packed /* LQM_CMD_API_S_VER_1 */;
114
115/**
116 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
117 *
118 * @frequent_stations_air_time: an array containing the total air time
119 * (in uSec) used by the most frequently transmitting stations.
120 * @number_of_stations: the number of uniqe stations included in the array
121 * (a number between 0 to 16)
122 * @total_air_time_other_stations: the total air time (uSec) used by all the
123 * stations which are not included in the above report.
124 * @time_in_measurement_window: the total time in uSec in which a measurement
125 * took place.
126 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
127 * measurement
128 * @mac_id: MAC ID the measurement applies to.
129 * @status: return status. may be one of the LQM_STATUS_* defined above.
130 * @reserved: reserved.
131 */
132struct iwl_link_qual_msrmnt_notif {
133 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
134 __le32 number_of_stations;
135 __le32 total_air_time_other_stations;
136 __le32 time_in_measurement_window;
137 __le32 tx_frame_dropped;
138 __le32 mac_id;
139 __le32 status;
140 u8 reserved[12];
141} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
142
143/** 76/**
144 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification 77 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
145 * 78 *
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
index 71a01df96f8b..4228fac77f41 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
@@ -1455,80 +1455,6 @@ static const char * const chanwidths[] = {
1455 [NL80211_CHAN_WIDTH_160] = "vht160", 1455 [NL80211_CHAN_WIDTH_160] = "vht160",
1456}; 1456};
1457 1457
1458static bool iwl_mvm_lqm_notif_wait(struct iwl_notif_wait_data *notif_wait,
1459 struct iwl_rx_packet *pkt, void *data)
1460{
1461 struct ieee80211_vif *vif = data;
1462 struct iwl_mvm *mvm =
1463 container_of(notif_wait, struct iwl_mvm, notif_wait);
1464 struct iwl_link_qual_msrmnt_notif *report = (void *)pkt->data;
1465 u32 num_of_stations = le32_to_cpu(report->number_of_stations);
1466 int i;
1467
1468 IWL_INFO(mvm, "LQM report:\n");
1469 IWL_INFO(mvm, "\tstatus: %d\n", report->status);
1470 IWL_INFO(mvm, "\tmacID: %d\n", le32_to_cpu(report->mac_id));
1471 IWL_INFO(mvm, "\ttx_frame_dropped: %d\n",
1472 le32_to_cpu(report->tx_frame_dropped));
1473 IWL_INFO(mvm, "\ttime_in_measurement_window: %d us\n",
1474 le32_to_cpu(report->time_in_measurement_window));
1475 IWL_INFO(mvm, "\ttotal_air_time_other_stations: %d\n",
1476 le32_to_cpu(report->total_air_time_other_stations));
1477 IWL_INFO(mvm, "\tchannel_freq: %d\n",
1478 vif->bss_conf.chandef.center_freq1);
1479 IWL_INFO(mvm, "\tchannel_width: %s\n",
1480 chanwidths[vif->bss_conf.chandef.width]);
1481 IWL_INFO(mvm, "\tnumber_of_stations: %d\n", num_of_stations);
1482 for (i = 0; i < num_of_stations; i++)
1483 IWL_INFO(mvm, "\t\tsta[%d]: %d\n", i,
1484 report->frequent_stations_air_time[i]);
1485
1486 return true;
1487}
1488
1489static ssize_t iwl_dbgfs_lqm_send_cmd_write(struct ieee80211_vif *vif,
1490 char *buf, size_t count,
1491 loff_t *ppos)
1492{
1493 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1494 struct iwl_mvm *mvm = mvmvif->mvm;
1495 struct iwl_notification_wait wait_lqm_notif;
1496 static u16 lqm_notif[] = {
1497 WIDE_ID(MAC_CONF_GROUP,
1498 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF)
1499 };
1500 int err;
1501 u32 duration;
1502 u32 timeout;
1503
1504 if (sscanf(buf, "%d,%d", &duration, &timeout) != 2)
1505 return -EINVAL;
1506
1507 iwl_init_notification_wait(&mvm->notif_wait, &wait_lqm_notif,
1508 lqm_notif, ARRAY_SIZE(lqm_notif),
1509 iwl_mvm_lqm_notif_wait, vif);
1510 mutex_lock(&mvm->mutex);
1511 err = iwl_mvm_send_lqm_cmd(vif, LQM_CMD_OPERATION_START_MEASUREMENT,
1512 duration, timeout);
1513 mutex_unlock(&mvm->mutex);
1514
1515 if (err) {
1516 IWL_ERR(mvm, "Failed to send lqm cmdf(err=%d)\n", err);
1517 iwl_remove_notification(&mvm->notif_wait, &wait_lqm_notif);
1518 return err;
1519 }
1520
1521 /* wait for 2 * timeout (safety guard) and convert to jiffies*/
1522 timeout = msecs_to_jiffies((timeout * 2) / 1000);
1523
1524 err = iwl_wait_notification(&mvm->notif_wait, &wait_lqm_notif,
1525 timeout);
1526 if (err)
1527 IWL_ERR(mvm, "Getting lqm notif timed out\n");
1528
1529 return count;
1530}
1531
1532#define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \ 1458#define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \
1533 _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) 1459 _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif)
1534#define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ 1460#define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \
@@ -1553,7 +1479,6 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_range_abort, 32);
1553MVM_DEBUGFS_READ_FILE_OPS(tof_range_response); 1479MVM_DEBUGFS_READ_FILE_OPS(tof_range_response);
1554MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_responder_params, 32); 1480MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_responder_params, 32);
1555MVM_DEBUGFS_READ_WRITE_FILE_OPS(quota_min, 32); 1481MVM_DEBUGFS_READ_WRITE_FILE_OPS(quota_min, 32);
1556MVM_DEBUGFS_WRITE_FILE_OPS(lqm_send_cmd, 64);
1557MVM_DEBUGFS_READ_FILE_OPS(os_device_timediff); 1482MVM_DEBUGFS_READ_FILE_OPS(os_device_timediff);
1558 1483
1559 1484
@@ -1594,7 +1519,6 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
1594 S_IRUSR | S_IWUSR); 1519 S_IRUSR | S_IWUSR);
1595 MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir, 1520 MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir,
1596 S_IRUSR | S_IWUSR); 1521 S_IRUSR | S_IWUSR);
1597 MVM_DEBUGFS_ADD_FILE_VIF(lqm_send_cmd, mvmvif->dbgfs_dir, S_IWUSR);
1598 MVM_DEBUGFS_ADD_FILE_VIF(os_device_timediff, 1522 MVM_DEBUGFS_ADD_FILE_VIF(os_device_timediff,
1599 mvmvif->dbgfs_dir, S_IRUSR); 1523 mvmvif->dbgfs_dir, S_IRUSR);
1600 1524
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 15f2d826bb4b..8b4584541272 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1878,11 +1878,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
1878 if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) 1878 if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc)
1879 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); 1879 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif);
1880 1880
1881 if (changes & BSS_CHANGED_ASSOC && !bss_conf->assoc &&
1882 mvmvif->lqm_active)
1883 iwl_mvm_send_lqm_cmd(vif, LQM_CMD_OPERATION_STOP_MEASUREMENT,
1884 0, 0);
1885
1886 /* 1881 /*
1887 * If we're not associated yet, take the (new) BSSID before associating 1882 * If we're not associated yet, take the (new) BSSID before associating
1888 * so the firmware knows. If we're already associated, then use the old 1883 * so the firmware knows. If we're already associated, then use the old
@@ -3879,11 +3874,6 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
3879 3874
3880 break; 3875 break;
3881 case NL80211_IFTYPE_STATION: 3876 case NL80211_IFTYPE_STATION:
3882 if (mvmvif->lqm_active)
3883 iwl_mvm_send_lqm_cmd(vif,
3884 LQM_CMD_OPERATION_STOP_MEASUREMENT,
3885 0, 0);
3886
3887 /* Schedule the time event to a bit before beacon 1, 3877 /* Schedule the time event to a bit before beacon 1,
3888 * to make sure we're in the new channel when the 3878 * to make sure we're in the new channel when the
3889 * GO/AP arrives. In case count <= 1 immediately schedule the 3879 * GO/AP arrives. In case count <= 1 immediately schedule the
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 48cb08eea700..ec2cf248990b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -436,12 +436,6 @@ struct iwl_mvm_vif {
436 436
437 /* TCP Checksum Offload */ 437 /* TCP Checksum Offload */
438 netdev_features_t features; 438 netdev_features_t features;
439
440 /*
441 * link quality measurement - used to check whether this interface
442 * is in the middle of a link quality measurement
443 */
444 bool lqm_active;
445}; 439};
446 440
447static inline struct iwl_mvm_vif * 441static inline struct iwl_mvm_vif *
@@ -1846,12 +1840,6 @@ unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
1846void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1840void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1847 const char *errmsg); 1841 const char *errmsg);
1848 1842
1849/* Link Quality Measurement */
1850int iwl_mvm_send_lqm_cmd(struct ieee80211_vif *vif,
1851 enum iwl_lqm_cmd_operatrions operation,
1852 u32 duration, u32 timeout);
1853bool iwl_mvm_lqm_active(struct iwl_mvm *mvm);
1854
1855int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b); 1843int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b);
1856int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm); 1844int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm);
1857 1845
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 231878969332..d855920f5456 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -423,8 +423,6 @@ static const struct iwl_hcmd_names iwl_mvm_system_names[] = {
423 * Access is done through binary search 423 * Access is done through binary search
424 */ 424 */
425static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = { 425static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = {
426 HCMD_NAME(LINK_QUALITY_MEASUREMENT_CMD),
427 HCMD_NAME(LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF),
428 HCMD_NAME(CHANNEL_SWITCH_NOA_NOTIF), 426 HCMD_NAME(CHANNEL_SWITCH_NOA_NOTIF),
429}; 427};
430 428
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 2ea74abad73d..328035640669 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -1389,74 +1389,3 @@ void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, u32 *gp2, u64 *boottime)
1389 iwl_mvm_power_update_device(mvm); 1389 iwl_mvm_power_update_device(mvm);
1390 } 1390 }
1391} 1391}
1392
1393int iwl_mvm_send_lqm_cmd(struct ieee80211_vif *vif,
1394 enum iwl_lqm_cmd_operatrions operation,
1395 u32 duration, u32 timeout)
1396{
1397 struct iwl_mvm_vif *mvm_vif = iwl_mvm_vif_from_mac80211(vif);
1398 struct iwl_link_qual_msrmnt_cmd cmd = {
1399 .cmd_operation = cpu_to_le32(operation),
1400 .mac_id = cpu_to_le32(mvm_vif->id),
1401 .measurement_time = cpu_to_le32(duration),
1402 .timeout = cpu_to_le32(timeout),
1403 };
1404 u32 cmdid =
1405 iwl_cmd_id(LINK_QUALITY_MEASUREMENT_CMD, MAC_CONF_GROUP, 0);
1406 int ret;
1407
1408 if (!fw_has_capa(&mvm_vif->mvm->fw->ucode_capa,
1409 IWL_UCODE_TLV_CAPA_LQM_SUPPORT))
1410 return -EOPNOTSUPP;
1411
1412 if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
1413 return -EINVAL;
1414
1415 switch (operation) {
1416 case LQM_CMD_OPERATION_START_MEASUREMENT:
1417 if (iwl_mvm_lqm_active(mvm_vif->mvm))
1418 return -EBUSY;
1419 if (!vif->bss_conf.assoc)
1420 return -EINVAL;
1421 mvm_vif->lqm_active = true;
1422 break;
1423 case LQM_CMD_OPERATION_STOP_MEASUREMENT:
1424 if (!iwl_mvm_lqm_active(mvm_vif->mvm))
1425 return -EINVAL;
1426 break;
1427 default:
1428 return -EINVAL;
1429 }
1430
1431 ret = iwl_mvm_send_cmd_pdu(mvm_vif->mvm, cmdid, 0, sizeof(cmd),
1432 &cmd);
1433
1434 /* command failed - roll back lqm_active state */
1435 if (ret) {
1436 mvm_vif->lqm_active =
1437 operation == LQM_CMD_OPERATION_STOP_MEASUREMENT;
1438 }
1439
1440 return ret;
1441}
1442
1443static void iwl_mvm_lqm_active_iterator(void *_data, u8 *mac,
1444 struct ieee80211_vif *vif)
1445{
1446 struct iwl_mvm_vif *mvm_vif = iwl_mvm_vif_from_mac80211(vif);
1447 bool *lqm_active = _data;
1448
1449 *lqm_active = *lqm_active || mvm_vif->lqm_active;
1450}
1451
1452bool iwl_mvm_lqm_active(struct iwl_mvm *mvm)
1453{
1454 bool ret = false;
1455
1456 lockdep_assert_held(&mvm->mutex);
1457 ieee80211_iterate_active_interfaces_atomic(
1458 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
1459 iwl_mvm_lqm_active_iterator, &ret);
1460
1461 return ret;
1462}