aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 00ee01e7d4a4..8e2f560812d4 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -394,6 +394,22 @@ static struct platform_device wl1271_device = {
394static DEFINE_MUTEX(wl_list_mutex); 394static DEFINE_MUTEX(wl_list_mutex);
395static LIST_HEAD(wl_list); 395static LIST_HEAD(wl_list);
396 396
397static int wl1271_check_operstate(struct wl1271 *wl, unsigned char operstate)
398{
399 int ret;
400 if (operstate != IF_OPER_UP)
401 return 0;
402
403 if (test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags))
404 return 0;
405
406 ret = wl1271_cmd_set_sta_state(wl);
407 if (ret < 0)
408 return ret;
409
410 wl1271_info("Association completed.");
411 return 0;
412}
397static int wl1271_dev_notify(struct notifier_block *me, unsigned long what, 413static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
398 void *arg) 414 void *arg)
399{ 415{
@@ -443,11 +459,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
443 if (ret < 0) 459 if (ret < 0)
444 goto out; 460 goto out;
445 461
446 if ((dev->operstate == IF_OPER_UP) && 462 wl1271_check_operstate(wl, dev->operstate);
447 !test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags)) {
448 wl1271_cmd_set_sta_state(wl);
449 wl1271_info("Association completed.");
450 }
451 463
452 wl1271_ps_elp_sleep(wl); 464 wl1271_ps_elp_sleep(wl);
453 465
@@ -3217,6 +3229,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
3217 wl1271_warning("cmd join failed %d", ret); 3229 wl1271_warning("cmd join failed %d", ret);
3218 goto out; 3230 goto out;
3219 } 3231 }
3232 wl1271_check_operstate(wl, ieee80211_get_operstate(vif));
3220 } 3233 }
3221 3234
3222out: 3235out: