mac80211: split hardware scan by band
Johannes Berg
maintainerPATCH 1/1 mac80211: split hardware scan by band
There's currently a very odd bug in mac80211 -- a hardware scan that is done while the hardware is really operating on 2.4 GHz will include CCK rates in the probe request frame, even on 5 GHz (if the driver uses the mac80211 IEs). Vice versa, if the hardware is operating on 5 GHz the 2.4 GHz probe requests will not include CCK rates even though they should.
Fix this by splitting up cfg80211 scan requests by band -- recalculating the IEs every time -- and requesting only per-band scans from the driver.
Apparently this bug hasn't been a problem yet, but it is imaginable that some older access points get confused if confronted with such behaviour.
--- net/mac80211/ieee80211_i.h | 8 +-- net/mac80211/scan.c | 96 +++++++++++++++++++++++++++++++++------------ net/mac80211/util.c | 8 ++- 3 files changed, 80 insertions(+), 32 deletions(-)
net/mac80211/ieee80211_i.h +4 -4
@@ -667,10 +667,9 @@ struct ieee80211_local {unsigned long scanning;struct cfg80211_ssid scan_ssid;struct cfg80211_scan_request *int_scan_req; -struct cfg80211_scan_request *scan_req; +struct cfg80211_scan_request *scan_req, *hw_scan_req;struct ieee80211_channel *scan_channel; -const u8 *orig_ies; -int orig_ies_len; +enum ieee80211_band hw_scan_band;int scan_channel_idx;int scan_ies_len;
@@ -1050,7 +1049,8 @@ void ieee80211_send_auth(struct ieee8021 u8 *extra, size_t extra_len, const u8 *bssid, const u8 *key, u8 key_len, u8 key_idx);int ieee80211_build_preq_ies (struct ieee80211_local *local,u8 *buffer, -const u8 *ie,size_t ie_len); +const u8 *ie,size_t ie_len, +enum ieee80211_band band);void ieee80211_send_probe_req (struct ieee80211_sub_if_data *sdata,u8 *dst,const u8 *ssid,size_t ssid_len,const u8 *ie,size_t ie_len);
net/mac80211/scan.c +71 -25
146 lines not on this page · raw message
net/mac80211/util.c +5 -3
@@ -872,13 +872,14 @@ void ieee80211_send_auth(struct ieee8021 }int ieee80211_build_preq_ies (struct ieee80211_local *local,u8 *buffer, -const u8 *ie,size_t ie_len) +const u8 *ie,size_t ie_len, +enum ieee80211_band band) {struct ieee80211_supported_band *sband;u8 *pos, *supp_rates_len, *esupp_rates_len =NULL ;int i; - sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; + sband = local->hw.wiphy->bands[band]; pos = buffer;
@@ -966,7 +967,8 @@ void ieee80211_send_probe_req(struct ieememcpy (pos, ssid, ssid_len); pos += ssid_len; -skb_put (skb,ieee80211_build_preq_ies (local, pos, ie, ie_len)); +skb_put (skb,ieee80211_build_preq_ies (local, pos, ie, ie_len, + local->hw.conf.channel->band));ieee80211_tx_skb (sdata, skb,0 ); }
Johannes Berg
maintainerQuoted 3 lines · Johannes Berg
Fix this by splitting up cfg80211 scan requests by band -- recalculating the IEs every time -- and requesting only per-band scans from the driver.
Incidentally, this means that dual-band drivers now absolutely need to take a look at the scan channel list that is provided since if they ignore it they will end up doing two full scans instead of one. Since wl1271 is the only driver this affects right now, and its 5ghz support is disabled, this seems ok to me.
johannes
Quoted 11 lines · ext Johannes Berg
Quoted 3 lines · Johannes Berg
Fix this by splitting up cfg80211 scan requests by band -- recalculating the IEs every time -- and requesting only per-band scans from the driver.
Incidentally, this means that dual-band drivers now absolutely need to take a look at the scan channel list that is provided since if they ignore it they will end up doing two full scans instead of one. Since wl1271 is the only driver this affects right now, and its 5ghz support is disabled, this seems ok to me.
Sorry for the late response.
This is fine with me. We added one item to handle this on our 5GHz TODO list. We're unfortunately not working with 5GHz at the moment, but we'll hopefully do so in the near future (prioritization and stuff).
I said to you that I would add a FIXME in the code, but I think this is not really necessary, because 5GHz is not fully working anyway, there is definitely still some work to be done (and that's why it is disabled).
Signature · 2 lines
Cheers, Luca.