aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-06-06 06:03:12 -0400
committerLuciano Coelho <coelho@ti.com>2011-06-27 06:56:14 -0400
commitef4b29e976f9e0a622dfd2722b443bb65686f47c (patch)
tree7978aecc11cd1057bb7a3e55c8538624454cc1d4 /drivers
parent6bb043321569ac356c790a8d3bd759742e1f9352 (diff)
wl12xx: check the vif's operstate after join
When resuming while connected (without wowlan), the interface is already IF_OPER_UP, so we won't get the notifier callback, and hence never complete the association (from wl12xx perspective) This situation, among other potential problems, prevents the station from entering psm. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-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: