diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-02 03:58:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:53 -0400 |
commit | e45cd82ace91b71bc690ba78a0ebea17edfaabef (patch) | |
tree | 8a7e9d6aa13d1827c8d82568cf446aa0005440e6 /net/wireless | |
parent | ab1faead50d09165b58c2854997c7205ca9c0d22 (diff) |
cfg80211: send events for userspace SME
When the userspace SME is in control, we are currently not sending
events, but this means that any userspace applications using wext
or nl80211 to receive events will not know what's going on unless
they can also interpret the nl80211 assoc event. Since we have all
the required code, let the SME follow events from the userspace
SME, this even means that you will be refused to connect() while
the userspace SME is in control and connected.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/sme.c | 64 |
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 | ||
346 | void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | 358 | void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, |