[PATCH 2/2] mac80211: store the channel in wdev upon ibss_join

Antonio Quartulli
2013-10-14T23:25:23Z

From: Antonio Quartulli <antonio@open-mesh.com>

To allow cfg80211 to use the real channel to pick up the
proper (i)bss object, store the used channel in
wdev->channel during ibss_join

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/mac80211/ibss.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index a12afe7..2b5aa4b 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -331,6 +331,12 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
bss = cfg80211_inform_bss_width_frame(local->hw.wiphy, chan,
scan_width, mgmt,
presp->head_len, 0, GFP_KERNEL);
+
+ /* store the channel so that it can be used by cfg80211 to retrieve the
+ * correct bss object
+ */
+ sdata->wdev.channel = chan;
+
cfg80211_put_bss(local->hw.wiphy, bss);
netif_carrier_on(sdata->dev);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
--
1.8.3.2