aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/sme.c64
1 files changed, 38 insertions, 26 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index f272ebf9430..d4e0b4065cb 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -287,6 +287,44 @@ static void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
287 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION)) 287 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
288 return; 288 return;
289 289
290 if (wdev->sme_state == CFG80211_SME_CONNECTED)
291 nl80211_send_roamed(wiphy_to_dev(wdev->wiphy), dev,
292 bssid, req_ie, req_ie_len,
293 resp_ie, resp_ie_len, gfp);
294 else
295 nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev,
296 bssid, req_ie, req_ie_len,
297 resp_ie, resp_ie_len,
298 status, gfp);
299
300#ifdef CONFIG_WIRELESS_EXT
301 if (wextev) {
302 if (req_ie && status == WLAN_STATUS_SUCCESS) {
303 memset(&wrqu, 0, sizeof(wrqu));
304 wrqu.data.length = req_ie_len;
305 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, req_ie);
306 }
307
308 if (resp_ie && status == WLAN_STATUS_SUCCESS) {
309 memset(&wrqu, 0, sizeof(wrqu));
310 wrqu.data.length = resp_ie_len;
311 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, resp_ie);
312 }
313
314 memset(&wrqu, 0, sizeof(wrqu));
315 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
316 if (bssid && status == WLAN_STATUS_SUCCESS)
317 memcpy(wrqu.ap_addr.sa_data, bssid, ETH_ALEN);
318 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
319 }
320#endif
321
322 if (status == WLAN_STATUS_SUCCESS &&
323 wdev->sme_state == CFG80211_SME_IDLE) {
324 wdev->sme_state = CFG80211_SME_CONNECTED;
325 return;
326 }
327
290 if (wdev->sme_state != CFG80211_SME_CONNECTING) 328 if (wdev->sme_state != CFG80211_SME_CONNECTING)
291 return; 329 return;
292 330
@@ -315,32 +353,6 @@ static void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
315 353
316 if (wdev->conn) 354 if (wdev->conn)
317 wdev->conn->state = CFG80211_CONN_IDLE; 355 wdev->conn->state = CFG80211_CONN_IDLE;
318
319 nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev, bssid,
320 req_ie, req_ie_len, resp_ie, resp_ie_len,
321 status, gfp);
322
323#ifdef CONFIG_WIRELESS_EXT
324 if (wextev) {
325 if (req_ie && status == WLAN_STATUS_SUCCESS) {
326 memset(&wrqu, 0, sizeof(wrqu));
327 wrqu.data.length = req_ie_len;
328 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, req_ie);
329 }
330
331 if (resp_ie && status == WLAN_STATUS_SUCCESS) {
332 memset(&wrqu, 0, sizeof(wrqu));
333 wrqu.data.length = resp_ie_len;
334 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, resp_ie);
335 }
336
337 memset(&wrqu, 0, sizeof(wrqu));
338 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
339 if (bssid && status == WLAN_STATUS_SUCCESS)
340 memcpy(wrqu.ap_addr.sa_data, bssid, ETH_ALEN);
341 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
342 }
343#endif
344} 356}
345 357
346void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, 358void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,