aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/ibss.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r--net/wireless/ibss.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index d80e47194d49..39bff7d36768 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -43,7 +43,6 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
43 cfg80211_hold_bss(bss_from_pub(bss)); 43 cfg80211_hold_bss(bss_from_pub(bss));
44 wdev->current_bss = bss_from_pub(bss); 44 wdev->current_bss = bss_from_pub(bss);
45 45
46 wdev->sme_state = CFG80211_SME_CONNECTED;
47 cfg80211_upload_connect_keys(wdev); 46 cfg80211_upload_connect_keys(wdev);
48 47
49 nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid, 48 nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid,
@@ -64,8 +63,6 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp)
64 63
65 trace_cfg80211_ibss_joined(dev, bssid); 64 trace_cfg80211_ibss_joined(dev, bssid);
66 65
67 CFG80211_DEV_WARN_ON(wdev->sme_state != CFG80211_SME_CONNECTING);
68
69 ev = kzalloc(sizeof(*ev), gfp); 66 ev = kzalloc(sizeof(*ev), gfp);
70 if (!ev) 67 if (!ev)
71 return; 68 return;
@@ -120,7 +117,6 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
120#ifdef CONFIG_CFG80211_WEXT 117#ifdef CONFIG_CFG80211_WEXT
121 wdev->wext.ibss.chandef = params->chandef; 118 wdev->wext.ibss.chandef = params->chandef;
122#endif 119#endif
123 wdev->sme_state = CFG80211_SME_CONNECTING;
124 120
125 err = cfg80211_can_use_chan(rdev, wdev, params->chandef.chan, 121 err = cfg80211_can_use_chan(rdev, wdev, params->chandef.chan,
126 params->channel_fixed 122 params->channel_fixed
@@ -134,7 +130,6 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
134 err = rdev_join_ibss(rdev, dev, params); 130 err = rdev_join_ibss(rdev, dev, params);
135 if (err) { 131 if (err) {
136 wdev->connect_keys = NULL; 132 wdev->connect_keys = NULL;
137 wdev->sme_state = CFG80211_SME_IDLE;
138 return err; 133 return err;
139 } 134 }
140 135
@@ -152,11 +147,11 @@ int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
152 struct wireless_dev *wdev = dev->ieee80211_ptr; 147 struct wireless_dev *wdev = dev->ieee80211_ptr;
153 int err; 148 int err;
154 149
155 mutex_lock(&rdev->devlist_mtx); 150 ASSERT_RTNL();
151
156 wdev_lock(wdev); 152 wdev_lock(wdev);
157 err = __cfg80211_join_ibss(rdev, dev, params, connkeys); 153 err = __cfg80211_join_ibss(rdev, dev, params, connkeys);
158 wdev_unlock(wdev); 154 wdev_unlock(wdev);
159 mutex_unlock(&rdev->devlist_mtx);
160 155
161 return err; 156 return err;
162} 157}
@@ -186,7 +181,6 @@ static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext)
186 } 181 }
187 182
188 wdev->current_bss = NULL; 183 wdev->current_bss = NULL;
189 wdev->sme_state = CFG80211_SME_IDLE;
190 wdev->ssid_len = 0; 184 wdev->ssid_len = 0;
191#ifdef CONFIG_CFG80211_WEXT 185#ifdef CONFIG_CFG80211_WEXT
192 if (!nowext) 186 if (!nowext)
@@ -359,11 +353,9 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
359 wdev->wext.ibss.channel_fixed = false; 353 wdev->wext.ibss.channel_fixed = false;
360 } 354 }
361 355
362 mutex_lock(&rdev->devlist_mtx);
363 wdev_lock(wdev); 356 wdev_lock(wdev);
364 err = cfg80211_ibss_wext_join(rdev, wdev); 357 err = cfg80211_ibss_wext_join(rdev, wdev);
365 wdev_unlock(wdev); 358 wdev_unlock(wdev);
366 mutex_unlock(&rdev->devlist_mtx);
367 359
368 return err; 360 return err;
369} 361}
@@ -429,11 +421,9 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev,
429 memcpy(wdev->wext.ibss.ssid, ssid, len); 421 memcpy(wdev->wext.ibss.ssid, ssid, len);
430 wdev->wext.ibss.ssid_len = len; 422 wdev->wext.ibss.ssid_len = len;
431 423
432 mutex_lock(&rdev->devlist_mtx);
433 wdev_lock(wdev); 424 wdev_lock(wdev);
434 err = cfg80211_ibss_wext_join(rdev, wdev); 425 err = cfg80211_ibss_wext_join(rdev, wdev);
435 wdev_unlock(wdev); 426 wdev_unlock(wdev);
436 mutex_unlock(&rdev->devlist_mtx);
437 427
438 return err; 428 return err;
439} 429}
@@ -512,11 +502,9 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev,
512 } else 502 } else
513 wdev->wext.ibss.bssid = NULL; 503 wdev->wext.ibss.bssid = NULL;
514 504
515 mutex_lock(&rdev->devlist_mtx);
516 wdev_lock(wdev); 505 wdev_lock(wdev);
517 err = cfg80211_ibss_wext_join(rdev, wdev); 506 err = cfg80211_ibss_wext_join(rdev, wdev);
518 wdev_unlock(wdev); 507 wdev_unlock(wdev);
519 mutex_unlock(&rdev->devlist_mtx);
520 508
521 return err; 509 return err;
522} 510}