aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authornohee ko <noheek@broadcom.com>2010-10-06 14:07:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-07 13:09:09 -0400
commitb3164c71e27e58ef1c0b679e816d643cc1a1553e (patch)
treeea72e067f577704e94b3052fefe3cd933bbd1cf0 /drivers
parent194c60720dd96039ba46743743c4d8bc52d56364 (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.c44
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,
142static int32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev, 142static 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);
144static int32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, 144static 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);
146static int32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev, 147static 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);
148static int32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev, 149static 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*/
252static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e); 253static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e);
253static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e); 254static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e);
255static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e);
254static void wl_link_up(struct wl_priv *wl); 256static void wl_link_up(struct wl_priv *wl);
255static void wl_link_down(struct wl_priv *wl); 257static void wl_link_down(struct wl_priv *wl);
256static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype); 258static 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
2327static 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
2323static int32 2340static int32
2324wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, 2341wl_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
2523static int32 2542static int32
2524wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, 2543wl_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
2660static int32 wl_init_priv_mem(struct wl_priv *wl) 2682static 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
3791void wl_cfg80211_dbg_level(uint32 level) 3813void 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
3796static bool wl_is_ibssmode(struct wl_priv *wl) 3824static bool wl_is_ibssmode(struct wl_priv *wl)