summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2015-05-25 14:06:19 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2015-05-29 17:34:51 +0300
commit44b7d483b73df7fb35dc7b426fcb6f133b6273e4 (patch)
treeb585eb00200c8073cda915d9af620769e2537fc0 /drivers/net/wireless
parent587f7031f303bae561caecb0d5b23ba4d2585522 (diff)
downloadop-kernel-dev-44b7d483b73df7fb35dc7b426fcb6f133b6273e4.zip
op-kernel-dev-44b7d483b73df7fb35dc7b426fcb6f133b6273e4.tar.gz
ath10k: fix inconsistent survey reports
In some cases some channel survey data was reported incorrect. Channel info events were expected to come in pairs without and with COMPLETE flag set respectively for each channel visit during scan. The known deviation from this is rule for last scan chan info and first (next) scan chan info both have COMPLETE flag set. This was either programmed with the intent of providing BSS cycle count info or this is an artefact of firmware scan state machine. Either way this is useless due to short wraparound time, wraparound quirks and no overflow notification. Survey dumps now include only data gathered during scan channel visits that can be computed correctly. This should improve hostapd ACS a little bit. Reported-by: Srinivasa Duvvuri <sduvvuri@chromium.org> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.h8
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c30
2 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 5a648e9..87376b3 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -701,6 +701,14 @@ struct ath10k {
u32 survey_last_cycle_count;
struct survey_info survey[ATH10K_NUM_CHANS];
+ /* Channel info events are expected to come in pairs without and with
+ * COMPLETE flag set respectively for each channel visit during scan.
+ *
+ * However there are deviations from this rule. This flag is used to
+ * avoid reporting garbage data.
+ */
+ bool ch_info_can_report_survey;
+
struct dfs_pattern_detector *dfs_detector;
unsigned long tx_paused; /* see ATH10K_TX_PAUSE_ */
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 70e6efa..77220b0 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1637,20 +1637,22 @@ void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb)
}
if (cmd_flags & WMI_CHAN_INFO_FLAG_COMPLETE) {
- /* During scanning chan info is reported twice for each
- * visited channel. The reported cycle count is global
- * and per-channel cycle count must be calculated */
-
- survey = &ar->survey[idx];
- survey->noise = noise_floor;
- survey->filled = SURVEY_INFO_NOISE_DBM;
-
- ath10k_hw_fill_survey_time(ar,
- survey,
- cycle_count,
- rx_clear_count,
- ar->survey_last_cycle_count,
- ar->survey_last_rx_clear_count);
+ if (ar->ch_info_can_report_survey) {
+ survey = &ar->survey[idx];
+ survey->noise = noise_floor;
+ survey->filled = SURVEY_INFO_NOISE_DBM;
+
+ ath10k_hw_fill_survey_time(ar,
+ survey,
+ cycle_count,
+ rx_clear_count,
+ ar->survey_last_cycle_count,
+ ar->survey_last_rx_clear_count);
+ }
+
+ ar->ch_info_can_report_survey = false;
+ } else {
+ ar->ch_info_can_report_survey = true;
}
ar->survey_last_rx_clear_count = rx_clear_count;
OpenPOWER on IntegriCloud