diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-12-11 08:41:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:31:34 -0500 |
commit | af5e084b3200ab6e3033068a34fe16fd139be17b (patch) | |
tree | 8ccb0cb06f65cced58c852cb1cd23807e3d503fa /drivers/net/wireless | |
parent | 13f2dc52c69bcca074cd12d4806953b2af45c386 (diff) |
wl1271: prevent power save entry while not associated
The mac80211 sometimes requests power save entry while not associated - this
will cause problems, so prevent it if not associated. Go to powersave once
association is complete.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index 4b5ddba96f0b..81e1c9531a3a 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
@@ -416,6 +416,7 @@ struct wl1271 { | |||
416 | 416 | ||
417 | /* PSM mode requested */ | 417 | /* PSM mode requested */ |
418 | bool psm_requested; | 418 | bool psm_requested; |
419 | bool associated; | ||
419 | 420 | ||
420 | /* retry counter for PSM entries */ | 421 | /* retry counter for PSM entries */ |
421 | u8 psm_entry_retry; | 422 | u8 psm_entry_retry; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index d507dae19e17..d07f03565196 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -978,6 +978,7 @@ static void wl1271_op_stop(struct ieee80211_hw *hw) | |||
978 | wl->elp = false; | 978 | wl->elp = false; |
979 | wl->psm = 0; | 979 | wl->psm = 0; |
980 | wl->psm_entry_retry = 0; | 980 | wl->psm_entry_retry = 0; |
981 | wl->associated = false; | ||
981 | wl->tx_queue_stopped = false; | 982 | wl->tx_queue_stopped = false; |
982 | wl->power_level = WL1271_DEFAULT_POWER_LEVEL; | 983 | wl->power_level = WL1271_DEFAULT_POWER_LEVEL; |
983 | wl->tx_blocks_available = 0; | 984 | wl->tx_blocks_available = 0; |
@@ -1191,8 +1192,6 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) | |||
1191 | wl1271_join_channel(wl, channel); | 1192 | wl1271_join_channel(wl, channel); |
1192 | 1193 | ||
1193 | if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { | 1194 | if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { |
1194 | wl1271_info("psm enabled"); | ||
1195 | |||
1196 | wl->psm_requested = true; | 1195 | wl->psm_requested = true; |
1197 | 1196 | ||
1198 | /* | 1197 | /* |
@@ -1200,7 +1199,10 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) | |||
1200 | * If we're not, we'll enter it when joining an SSID, | 1199 | * If we're not, we'll enter it when joining an SSID, |
1201 | * through the bss_info_changed() hook. | 1200 | * through the bss_info_changed() hook. |
1202 | */ | 1201 | */ |
1203 | ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE); | 1202 | if (wl->associated) { |
1203 | wl1271_info("psm enabled"); | ||
1204 | ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE); | ||
1205 | } | ||
1204 | } else if (!(conf->flags & IEEE80211_CONF_PS) && | 1206 | } else if (!(conf->flags & IEEE80211_CONF_PS) && |
1205 | wl->psm_requested) { | 1207 | wl->psm_requested) { |
1206 | wl1271_info("psm disabled"); | 1208 | wl1271_info("psm disabled"); |
@@ -1548,6 +1550,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1548 | if (changed & BSS_CHANGED_ASSOC) { | 1550 | if (changed & BSS_CHANGED_ASSOC) { |
1549 | if (bss_conf->assoc) { | 1551 | if (bss_conf->assoc) { |
1550 | wl->aid = bss_conf->aid; | 1552 | wl->aid = bss_conf->aid; |
1553 | wl->associated = true; | ||
1551 | 1554 | ||
1552 | /* | 1555 | /* |
1553 | * with wl1271, we don't need to update the | 1556 | * with wl1271, we don't need to update the |
@@ -1572,6 +1575,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1572 | } | 1575 | } |
1573 | } else { | 1576 | } else { |
1574 | /* use defaults when not associated */ | 1577 | /* use defaults when not associated */ |
1578 | wl->associated = false; | ||
1575 | wl->aid = 0; | 1579 | wl->aid = 0; |
1576 | } | 1580 | } |
1577 | 1581 | ||
@@ -1898,6 +1902,7 @@ static int __devinit wl1271_probe(struct spi_device *spi) | |||
1898 | wl->psm = 0; | 1902 | wl->psm = 0; |
1899 | wl->psm_requested = false; | 1903 | wl->psm_requested = false; |
1900 | wl->psm_entry_retry = 0; | 1904 | wl->psm_entry_retry = 0; |
1905 | wl->associated = false; | ||
1901 | wl->tx_queue_stopped = false; | 1906 | wl->tx_queue_stopped = false; |
1902 | wl->power_level = WL1271_DEFAULT_POWER_LEVEL; | 1907 | wl->power_level = WL1271_DEFAULT_POWER_LEVEL; |
1903 | wl->basic_rate_set = CONF_TX_RATE_MASK_BASIC; | 1908 | wl->basic_rate_set = CONF_TX_RATE_MASK_BASIC; |