diff options
author | nohee ko <noheek@broadcom.com> | 2010-10-06 14:07:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 13:09:09 -0400 |
commit | b3164c71e27e58ef1c0b679e816d643cc1a1553e (patch) | |
tree | ea72e067f577704e94b3052fefe3cd933bbd1cf0 /drivers | |
parent | 194c60720dd96039ba46743743c4d8bc52d56364 (diff) |
staging: brcm80211: bug fix - connection status report
Added connection status report for the case connection fails.
Originally this logic was missing.
Signed-off-by: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index 0c5d5cf29fc..896a6fd08e0 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -142,7 +142,8 @@ static int32 wl_notify_roaming_status(struct wl_priv *wl, | |||
142 | static int32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev, | 142 | static int32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev, |
143 | const wl_event_msg_t *e, void *data); | 143 | const wl_event_msg_t *e, void *data); |
144 | static int32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, | 144 | static int32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, |
145 | const wl_event_msg_t *e, void *data); | 145 | const wl_event_msg_t *e, void *data, |
146 | bool completed); | ||
146 | static int32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev, | 147 | static int32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev, |
147 | const wl_event_msg_t *e, void *data); | 148 | const wl_event_msg_t *e, void *data); |
148 | static int32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev, | 149 | static int32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev, |
@@ -251,6 +252,7 @@ static bool wl_is_ibssstarter(struct wl_priv *wl); | |||
251 | */ | 252 | */ |
252 | static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e); | 253 | static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e); |
253 | static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e); | 254 | static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e); |
255 | static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e); | ||
254 | static void wl_link_up(struct wl_priv *wl); | 256 | static void wl_link_up(struct wl_priv *wl); |
255 | static void wl_link_down(struct wl_priv *wl); | 257 | static void wl_link_down(struct wl_priv *wl); |
256 | static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype); | 258 | static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype); |
@@ -2266,8 +2268,10 @@ static int32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi) | |||
2266 | freq = ieee80211_channel_to_frequency(notif_bss_info->channel); | 2268 | freq = ieee80211_channel_to_frequency(notif_bss_info->channel); |
2267 | channel = ieee80211_get_channel(wiphy, freq); | 2269 | channel = ieee80211_get_channel(wiphy, freq); |
2268 | 2270 | ||
2269 | WL_DBG(("SSID : \"%s\", rssi (%d), capability : 0x04%x\n", bi->SSID, | 2271 | WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x\n", |
2270 | notif_bss_info->rssi, mgmt->u.probe_resp.capab_info)); | 2272 | bi->SSID, |
2273 | notif_bss_info->rssi, notif_bss_info->channel, | ||
2274 | mgmt->u.probe_resp.capab_info)); | ||
2271 | 2275 | ||
2272 | signal = notif_bss_info->rssi * 100; | 2276 | signal = notif_bss_info->rssi * 100; |
2273 | if (unlikely(!cfg80211_inform_bss_frame(wiphy, channel, mgmt, | 2277 | if (unlikely(!cfg80211_inform_bss_frame(wiphy, channel, mgmt, |
@@ -2320,6 +2324,19 @@ static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e) | |||
2320 | return FALSE; | 2324 | return FALSE; |
2321 | } | 2325 | } |
2322 | 2326 | ||
2327 | static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e) | ||
2328 | { | ||
2329 | uint32 event = ntoh32(e->event_type); | ||
2330 | uint32 status = ntoh32(e->status); | ||
2331 | |||
2332 | if (event == WLC_E_SET_SSID || event == WLC_E_LINK) { | ||
2333 | if (status == WLC_E_STATUS_NO_NETWORKS) | ||
2334 | return TRUE; | ||
2335 | } | ||
2336 | |||
2337 | return FALSE; | ||
2338 | } | ||
2339 | |||
2323 | static int32 | 2340 | static int32 |
2324 | wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, | 2341 | wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, |
2325 | const wl_event_msg_t *e, void *data) | 2342 | const wl_event_msg_t *e, void *data) |
@@ -2334,7 +2351,7 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, | |||
2334 | GFP_KERNEL); | 2351 | GFP_KERNEL); |
2335 | WL_DBG(("joined in IBSS network\n")); | 2352 | WL_DBG(("joined in IBSS network\n")); |
2336 | } else { | 2353 | } else { |
2337 | wl_bss_connect_done(wl, ndev, e, data); | 2354 | wl_bss_connect_done(wl, ndev, e, data, TRUE); |
2338 | WL_DBG(("joined in BSS network \"%s\"\n", | 2355 | WL_DBG(("joined in BSS network \"%s\"\n", |
2339 | ((struct wlc_ssid *) | 2356 | ((struct wlc_ssid *) |
2340 | wl_read_prof(wl, WL_PROF_SSID))->SSID)); | 2357 | wl_read_prof(wl, WL_PROF_SSID))->SSID)); |
@@ -2346,6 +2363,8 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, | |||
2346 | clear_bit(WL_STATUS_CONNECTED, &wl->status); | 2363 | clear_bit(WL_STATUS_CONNECTED, &wl->status); |
2347 | wl_link_down(wl); | 2364 | wl_link_down(wl); |
2348 | wl_init_prof(wl->profile); | 2365 | wl_init_prof(wl->profile); |
2366 | } else if (wl_is_nonetwork(wl, e)) { | ||
2367 | wl_bss_connect_done(wl, ndev, e, data, FALSE); | ||
2349 | } | 2368 | } |
2350 | 2369 | ||
2351 | return err; | 2370 | return err; |
@@ -2522,7 +2541,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev, | |||
2522 | 2541 | ||
2523 | static int32 | 2542 | static int32 |
2524 | wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, | 2543 | wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, |
2525 | const wl_event_msg_t *e, void *data) | 2544 | const wl_event_msg_t *e, void *data, bool completed) |
2526 | { | 2545 | { |
2527 | struct wl_connect_info *conn_info = wl_to_conn(wl); | 2546 | struct wl_connect_info *conn_info = wl_to_conn(wl); |
2528 | int32 err = 0; | 2547 | int32 err = 0; |
@@ -2537,8 +2556,10 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, | |||
2537 | conn_info->req_ie_len, | 2556 | conn_info->req_ie_len, |
2538 | conn_info->resp_ie, | 2557 | conn_info->resp_ie, |
2539 | conn_info->resp_ie_len, | 2558 | conn_info->resp_ie_len, |
2540 | WLAN_STATUS_SUCCESS, GFP_KERNEL); | 2559 | completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT, |
2541 | WL_DBG(("Report connect result\n")); | 2560 | GFP_KERNEL); |
2561 | WL_DBG(("Report connect result - connection %s\n", | ||
2562 | completed ? "succeeded" : "failed")); | ||
2542 | } else { | 2563 | } else { |
2543 | cfg80211_roamed(ndev, | 2564 | cfg80211_roamed(ndev, |
2544 | (u8 *)&wl->bssid, | 2565 | (u8 *)&wl->bssid, |
@@ -2655,6 +2676,7 @@ static void wl_init_eloop_handler(struct wl_event_loop *el) | |||
2655 | el->handler[WLC_E_REASSOC_IND] = wl_notify_connect_status; | 2676 | el->handler[WLC_E_REASSOC_IND] = wl_notify_connect_status; |
2656 | el->handler[WLC_E_ROAM] = wl_notify_roaming_status; | 2677 | el->handler[WLC_E_ROAM] = wl_notify_roaming_status; |
2657 | el->handler[WLC_E_MIC_ERROR] = wl_notify_mic_status; | 2678 | el->handler[WLC_E_MIC_ERROR] = wl_notify_mic_status; |
2679 | el->handler[WLC_E_SET_SSID] = wl_notify_connect_status; | ||
2658 | } | 2680 | } |
2659 | 2681 | ||
2660 | static int32 wl_init_priv_mem(struct wl_priv *wl) | 2682 | static int32 wl_init_priv_mem(struct wl_priv *wl) |
@@ -3790,7 +3812,13 @@ wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data, | |||
3790 | 3812 | ||
3791 | void wl_cfg80211_dbg_level(uint32 level) | 3813 | void wl_cfg80211_dbg_level(uint32 level) |
3792 | { | 3814 | { |
3793 | wl_dbg_level = level; | 3815 | /* |
3816 | * prohibit to change debug level | ||
3817 | * by insmod parameter. | ||
3818 | * eventually debug level will be configured | ||
3819 | * in compile time by using CONFIG_XXX | ||
3820 | */ | ||
3821 | /* wl_dbg_level = level; */ | ||
3794 | } | 3822 | } |
3795 | 3823 | ||
3796 | static bool wl_is_ibssmode(struct wl_priv *wl) | 3824 | static bool wl_is_ibssmode(struct wl_priv *wl) |