aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1251_main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-01-26 08:19:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-26 11:53:21 -0500
commit56007a028c51cbf800a6c969d6f6431d23443b99 (patch)
tree8bc0280467824ed3b5f95810444b1f8e1ebc2750 /drivers/net/wireless/wl12xx/wl1251_main.c
parentc21dbf9214bce129f92e1af05552553ff0e318ed (diff)
mac80211: wait for beacon before enabling powersave
Because DTIM information is required for powersave but is only conveyed in beacons, wait for a beacon before enabling powersave, and change the way the information is conveyed to the driver accordingly. mwl8k doesn't currently seem to implement PS but requires the DTIM period in a different way; after talking to Lennert we agreed to just have mwl8k do the parsing itself in the finalize_join work. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 595f0f94d16e..a717dde4822e 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -617,10 +617,13 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
617 617
618 wl->psm_requested = true; 618 wl->psm_requested = true;
619 619
620 wl->dtim_period = conf->ps_dtim_period;
621
622 ret = wl1251_acx_wr_tbtt_and_dtim(wl, wl->beacon_int,
623 wl->dtim_period);
624
620 /* 625 /*
621 * We enter PSM only if we're already associated. 626 * mac80211 enables PSM only if we're already associated.
622 * If we're not, we'll enter it when joining an SSID,
623 * through the bss_info_changed() hook.
624 */ 627 */
625 ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE); 628 ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
626 if (ret < 0) 629 if (ret < 0)
@@ -943,7 +946,6 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
943 struct ieee80211_bss_conf *bss_conf, 946 struct ieee80211_bss_conf *bss_conf,
944 u32 changed) 947 u32 changed)
945{ 948{
946 enum wl1251_cmd_ps_mode mode;
947 struct wl1251 *wl = hw->priv; 949 struct wl1251 *wl = hw->priv;
948 struct sk_buff *beacon, *skb; 950 struct sk_buff *beacon, *skb;
949 int ret; 951 int ret;
@@ -984,11 +986,6 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
984 if (changed & BSS_CHANGED_ASSOC) { 986 if (changed & BSS_CHANGED_ASSOC) {
985 if (bss_conf->assoc) { 987 if (bss_conf->assoc) {
986 wl->beacon_int = bss_conf->beacon_int; 988 wl->beacon_int = bss_conf->beacon_int;
987 wl->dtim_period = bss_conf->dtim_period;
988
989 ret = wl1251_acx_wr_tbtt_and_dtim(wl, wl->beacon_int,
990 wl->dtim_period);
991 wl->aid = bss_conf->aid;
992 989
993 skb = ieee80211_pspoll_get(wl->hw, wl->vif); 990 skb = ieee80211_pspoll_get(wl->hw, wl->vif);
994 if (!skb) 991 if (!skb)
@@ -1001,17 +998,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
1001 if (ret < 0) 998 if (ret < 0)
1002 goto out_sleep; 999 goto out_sleep;
1003 1000
1004 ret = wl1251_acx_aid(wl, wl->aid); 1001 ret = wl1251_acx_aid(wl, bss_conf->aid);
1005 if (ret < 0) 1002 if (ret < 0)
1006 goto out_sleep; 1003 goto out_sleep;
1007
1008 /* If we want to go in PSM but we're not there yet */
1009 if (wl->psm_requested && !wl->psm) {
1010 mode = STATION_POWER_SAVE_MODE;
1011 ret = wl1251_ps_set_mode(wl, mode);
1012 if (ret < 0)
1013 goto out_sleep;
1014 }
1015 } else { 1004 } else {
1016 /* use defaults when not associated */ 1005 /* use defaults when not associated */
1017 wl->beacon_int = WL1251_DEFAULT_BEACON_INT; 1006 wl->beacon_int = WL1251_DEFAULT_BEACON_INT;