aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-08-19 12:48:41 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-10-01 06:17:45 -0400
commit55fff50113daa178010a38e0dc27172f06d17b8e (patch)
tree575f7f639ec6746c442a7fd5568df346ebf8ac52 /net/mac80211/ibss.c
parent5eb7906b47dcd906b3ffd811e689e0de4a6b1b6a (diff)
mac80211: add explicit IBSS driver operations
This can be useful for drivers if they have any failure cases when joining an IBSS. Also move setting the queue parameters to before this new call, in case the new driver op needs them already. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5ea9b3ae303e..21a0b8835cb3 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -229,6 +229,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
229 struct beacon_data *presp; 229 struct beacon_data *presp;
230 enum nl80211_bss_scan_width scan_width; 230 enum nl80211_bss_scan_width scan_width;
231 bool have_higher_than_11mbit; 231 bool have_higher_than_11mbit;
232 int err;
232 233
233 sdata_assert_lock(sdata); 234 sdata_assert_lock(sdata);
234 235
@@ -247,6 +248,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
247 ieee80211_bss_info_change_notify(sdata, 248 ieee80211_bss_info_change_notify(sdata,
248 BSS_CHANGED_IBSS | 249 BSS_CHANGED_IBSS |
249 BSS_CHANGED_BEACON_ENABLED); 250 BSS_CHANGED_BEACON_ENABLED);
251 drv_leave_ibss(local, sdata);
250 } 252 }
251 253
252 presp = rcu_dereference_protected(ifibss->presp, 254 presp = rcu_dereference_protected(ifibss->presp,
@@ -329,11 +331,26 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
329 else 331 else
330 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; 332 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
331 333
334 ieee80211_set_wmm_default(sdata, true);
335
332 sdata->vif.bss_conf.ibss_joined = true; 336 sdata->vif.bss_conf.ibss_joined = true;
333 sdata->vif.bss_conf.ibss_creator = creator; 337 sdata->vif.bss_conf.ibss_creator = creator;
334 ieee80211_bss_info_change_notify(sdata, bss_change);
335 338
336 ieee80211_set_wmm_default(sdata, true); 339 err = drv_join_ibss(local, sdata);
340 if (err) {
341 sdata->vif.bss_conf.ibss_joined = false;
342 sdata->vif.bss_conf.ibss_creator = false;
343 sdata->vif.bss_conf.enable_beacon = false;
344 sdata->vif.bss_conf.ssid_len = 0;
345 RCU_INIT_POINTER(ifibss->presp, NULL);
346 kfree_rcu(presp, rcu_head);
347 ieee80211_vif_release_channel(sdata);
348 sdata_info(sdata, "Failed to join IBSS, driver failure: %d\n",
349 err);
350 return;
351 }
352
353 ieee80211_bss_info_change_notify(sdata, bss_change);
337 354
338 ifibss->state = IEEE80211_IBSS_MLME_JOINED; 355 ifibss->state = IEEE80211_IBSS_MLME_JOINED;
339 mod_timer(&ifibss->timer, 356 mod_timer(&ifibss->timer,
@@ -761,6 +778,7 @@ static void ieee80211_ibss_disconnect(struct ieee80211_sub_if_data *sdata)
761 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); 778 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
762 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | 779 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
763 BSS_CHANGED_IBSS); 780 BSS_CHANGED_IBSS);
781 drv_leave_ibss(local, sdata);
764 ieee80211_vif_release_channel(sdata); 782 ieee80211_vif_release_channel(sdata);
765} 783}
766 784