diff options
author | Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> | 2011-08-10 19:15:13 +0200 |
---|---|---|
committer | Mathieu J. Poirier <mathieu.poirier@linaro.org> | 2011-11-10 11:04:38 -0700 |
commit | 2ca2cef4747a8674d292f2b1fb2d777ec854817c (patch) | |
tree | a9cea3c936e8826a2d340a7c6d1a5ca4cbbfbe55 /net | |
parent | da29b0e045b507c96d7e79f4406dc24966dfc7a0 (diff) |
cw1200: Purge cfg80211 beacon cache before authentication.
cw1200 device requires SSID to be available at AUTH stage.
cfg80211 beacon cache is designed to handle multi-SSID BSSes, so
bss struct returned by cfg80211_get_bss() has random SSID if BSS
just changed SSID before authentication (typical for p2p).
This is a firmware design fault, however as a workaround cfg80211
beacon cache is purged to make sure target BSS is searchable
in rb-tree at the AUTH stage.
Likely will not be accepted by community.
Change-Id: I38d071e0d32bf414906170a19134718b0e834cce
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/28558
Tested-by: Dmitry TARNYAGIN <dmitry.tarnyagin@stericsson.com>
Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/28696
Tested-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33504
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 1 | ||||
-rw-r--r-- | net/mac80211/work.c | 24 |
3 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 400c09bea63..e34b986b472 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -324,6 +324,7 @@ struct ieee80211_work { u8 key_len, key_idx; bool privacy; bool synced; + struct cfg80211_bss *bss; } probe_auth; struct { struct cfg80211_bss *bss; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index d6470c7fd6c..19fecc95391 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2414,6 +2414,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, wk->probe_auth.algorithm = auth_alg; wk->probe_auth.privacy = req->bss->capability & WLAN_CAPABILITY_PRIVACY; + wk->probe_auth.bss = req->bss; /* if we already have a probe, don't probe again */ if (req->bss->proberesp_ies) diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 380b9a7462b..c0c97317591 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c @@ -475,6 +475,30 @@ ieee80211_authenticate(struct ieee80211_work *wk) struct ieee80211_sub_if_data *sdata = wk->sdata; struct ieee80211_local *local = sdata->local; + /* HACK!!! cw1200 device requires SSID to be available at AUTH stage. + * cfg80211 beacon cache is designed to handle multi-SSID BSSes, so + * bss struct returned by cfg80211_get_bss() has random SSID if BSS + * just changed SSID before authentication (typical for p2p). + * This is a firmware design fault, however as a workaround cfg80211 + * beacon cache is purged to make sure target BSS is searchable + * in rb-tree at the AUTH stage. + */ + struct cfg80211_bss *bss; + while (true) { + bss = cfg80211_get_bss(local->hw.wiphy, + wk->probe_auth.bss->channel, + wk->probe_auth.bss->bssid, + NULL, 0, 0, 0); + if (WARN_ON(!bss)) + break; + if (bss == wk->probe_auth.bss) { + cfg80211_put_bss(bss); + break; + } + cfg80211_unlink_bss(local->hw.wiphy, bss); + } + /* End of the hack */ + if (!wk->probe_auth.synced) { int ret = drv_tx_sync(local, sdata, wk->filter_ta, IEEE80211_TX_SYNC_AUTH); |