summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2011-08-10 19:15:13 +0200
committerPhilippe LANGLAIS <philippe.langlais@stericsson.com>2011-10-13 10:00:42 +0200
commita110b4f06c29a3b5e70d74bcd0144000646bd061 (patch)
tree3242bcc06748c3a595b57e32e791b91443f19bb1
parent133ef23c9bf00208edea628acd81de82eb08af53 (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>
-rw-r--r--drivers/staging/cw1200/sta.c3
-rw-r--r--net/mac80211/ieee80211_i.h1
-rw-r--r--net/mac80211/mlme.c1
-rw-r--r--net/mac80211/work.c24
4 files changed, 28 insertions, 1 deletions
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index 17a4184a360..d6a25a27358 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -1027,7 +1027,8 @@ void cw1200_join_work(struct work_struct *work)
cancel_delayed_work_sync(&priv->join_timeout);
priv->join_pending_frame = NULL;
- bss = cfg80211_get_bss(priv->hw->wiphy, NULL, bssid, NULL, 0, 0, 0);
+ bss = cfg80211_get_bss(priv->hw->wiphy, priv->channel,
+ bssid, NULL, 0, 0, 0);
if (!bss) {
cw1200_queue_remove(&priv->tx_queue[queueId],
priv, __le32_to_cpu(wsm->packetID));
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4473e1c926d..625ee2cd8a4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -308,6 +308,7 @@ struct ieee80211_work {
u8 key[WLAN_KEY_LEN_WEP104];
u8 key_len, key_idx;
bool privacy;
+ struct cfg80211_bss *bss;
} probe_auth;
struct {
struct cfg80211_bss *bss;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d595265d6c2..96fda24bc8b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2342,6 +2342,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 d2e7f0e8667..59437667d75 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -465,6 +465,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 */
+
wk->probe_auth.tries++;
if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) {
printk(KERN_DEBUG "%s: authentication with %pM"