aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/wmi.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2013-12-13 04:44:43 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2013-12-16 08:16:22 -0500
commit453cdb61c015f80e492dda217110353cd09eef18 (patch)
treee0ad70a18e5f0be9b2007e542eb1e4147ac6d315 /drivers/net/wireless/ath/ath10k/wmi.c
parent2256940010aab059dc238ab81b7b562b17942ec8 (diff)
ath10k: fix band reporting for mgmt CCK frames on 5GHz
Although CCK modulation isn't expected for 11a if it happened it made ath10k report wrong band (2GHz) for a mgmt frame that were actually received on 5Ghz band. Frequency would also decoded incorrectly too. In case of 5GHz-only devices this triggered mac80211 WARN_ON because there was no according sband pointer to be found. The patch should fix delivery of such frames by using different means to acquire band parameter. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 9ea333a7789c..3ec6c9a84e84 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -875,6 +875,7 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
875 struct wmi_mgmt_rx_event_v2 *ev_v2; 875 struct wmi_mgmt_rx_event_v2 *ev_v2;
876 struct wmi_mgmt_rx_hdr_v1 *ev_hdr; 876 struct wmi_mgmt_rx_hdr_v1 *ev_hdr;
877 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 877 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
878 struct ieee80211_channel *ch;
878 struct ieee80211_hdr *hdr; 879 struct ieee80211_hdr *hdr;
879 u32 rx_status; 880 u32 rx_status;
880 u32 channel; 881 u32 channel;
@@ -927,7 +928,25 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
927 if (rx_status & WMI_RX_STATUS_ERR_MIC) 928 if (rx_status & WMI_RX_STATUS_ERR_MIC)
928 status->flag |= RX_FLAG_MMIC_ERROR; 929 status->flag |= RX_FLAG_MMIC_ERROR;
929 930
930 status->band = phy_mode_to_band(phy_mode); 931 /* HW can Rx CCK rates on 5GHz. In that case phy_mode is set to
932 * MODE_11B. This means phy_mode is not a reliable source for the band
933 * of mgmt rx. */
934
935 ch = ar->scan_channel;
936 if (!ch)
937 ch = ar->rx_channel;
938
939 if (ch) {
940 status->band = ch->band;
941
942 if (phy_mode == MODE_11B &&
943 status->band == IEEE80211_BAND_5GHZ)
944 ath10k_dbg(ATH10K_DBG_MGMT, "wmi mgmt rx 11b (CCK) on 5GHz\n");
945 } else {
946 ath10k_warn("using (unreliable) phy_mode to extract band for mgmt rx\n");
947 status->band = phy_mode_to_band(phy_mode);
948 }
949
931 status->freq = ieee80211_channel_to_frequency(channel, status->band); 950 status->freq = ieee80211_channel_to_frequency(channel, status->band);
932 status->signal = snr + ATH10K_DEFAULT_NOISE_FLOOR; 951 status->signal = snr + ATH10K_DEFAULT_NOISE_FLOOR;
933 status->rate_idx = get_rate_idx(rate, status->band); 952 status->rate_idx = get_rate_idx(rate, status->band);