diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-01-31 04:57:25 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-02-15 01:38:32 -0500 |
commit | d18da7fcca449f09c91a209b4f5006959c5a7656 (patch) | |
tree | ecc93d55861ee77e3ae6c196014ba281aa07d4bf /drivers/net/wireless | |
parent | ed471d3402b0fa77e52007c6f8d79b16c4194000 (diff) |
wl12xx: change WLVIF_FLAG_PSM name and remove WLVIF_FLAG_PSM_REQUESTED
WLVIF_FLAG_PSM turned to WLVIF_FLAG_IN_AUTO_PS which
marks that this vif is in AUTO PS.
WLVIF_FLAG_PSM_REQUESTED is not required as mac80211
calls op_config with CONF_PS after association.
wl12xx_config_vif() handling of CONF_PS was simplified
and cleaned up.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 46 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/ps.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 3 |
4 files changed, 23 insertions, 36 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index 4436851a4fa7..4dcb3f758fe2 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -358,7 +358,7 @@ static ssize_t dynamic_ps_timeout_write(struct file *file, | |||
358 | */ | 358 | */ |
359 | 359 | ||
360 | wl12xx_for_each_wlvif_sta(wl, wlvif) { | 360 | wl12xx_for_each_wlvif_sta(wl, wlvif) { |
361 | if (test_bit(WLVIF_FLAG_PSM, &wlvif->flags)) | 361 | if (test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags)) |
362 | wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE); | 362 | wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE); |
363 | } | 363 | } |
364 | 364 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 97f7591c3b39..4ca7278201ec 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1715,9 +1715,7 @@ static int wl1271_op_start(struct ieee80211_hw *hw) | |||
1715 | * is added. That is where we will initialize the hardware. | 1715 | * is added. That is where we will initialize the hardware. |
1716 | */ | 1716 | */ |
1717 | 1717 | ||
1718 | wl1271_error("wl12xx is in an ustable state (fw api update is " | 1718 | return 0; |
1719 | "taking place). skip this commit when bisecting"); | ||
1720 | return -EBUSY; | ||
1721 | } | 1719 | } |
1722 | 1720 | ||
1723 | static void wl1271_op_stop(struct ieee80211_hw *hw) | 1721 | static void wl1271_op_stop(struct ieee80211_hw *hw) |
@@ -2460,29 +2458,29 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
2460 | } | 2458 | } |
2461 | } | 2459 | } |
2462 | 2460 | ||
2463 | if (conf->flags & IEEE80211_CONF_PS && | 2461 | if ((changed & IEEE80211_CONF_CHANGE_PS) && !is_ap) { |
2464 | !test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags)) { | 2462 | |
2465 | set_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags); | 2463 | if ((conf->flags & IEEE80211_CONF_PS) && |
2464 | test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) && | ||
2465 | !test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags)) { | ||
2466 | |||
2467 | wl1271_debug(DEBUG_PSM, "auto ps enabled"); | ||
2466 | 2468 | ||
2467 | /* | ||
2468 | * We enter PSM only if we're already associated. | ||
2469 | * If we're not, we'll enter it when joining an SSID, | ||
2470 | * through the bss_info_changed() hook. | ||
2471 | */ | ||
2472 | if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) { | ||
2473 | wl1271_debug(DEBUG_PSM, "psm enabled"); | ||
2474 | ret = wl1271_ps_set_mode(wl, wlvif, | 2469 | ret = wl1271_ps_set_mode(wl, wlvif, |
2475 | STATION_AUTO_PS_MODE); | 2470 | STATION_AUTO_PS_MODE); |
2476 | } | 2471 | if (ret < 0) |
2477 | } else if (!(conf->flags & IEEE80211_CONF_PS) && | 2472 | wl1271_warning("enter auto ps failed %d", ret); |
2478 | test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags)) { | ||
2479 | wl1271_debug(DEBUG_PSM, "psm disabled"); | ||
2480 | 2473 | ||
2481 | clear_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags); | 2474 | } else if (!(conf->flags & IEEE80211_CONF_PS) && |
2475 | test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags)) { | ||
2476 | |||
2477 | wl1271_debug(DEBUG_PSM, "auto ps disabled"); | ||
2482 | 2478 | ||
2483 | if (test_bit(WLVIF_FLAG_PSM, &wlvif->flags)) | ||
2484 | ret = wl1271_ps_set_mode(wl, wlvif, | 2479 | ret = wl1271_ps_set_mode(wl, wlvif, |
2485 | STATION_ACTIVE_MODE); | 2480 | STATION_ACTIVE_MODE); |
2481 | if (ret < 0) | ||
2482 | wl1271_warning("exit auto ps failed %d", ret); | ||
2483 | } | ||
2486 | } | 2484 | } |
2487 | 2485 | ||
2488 | if (conf->power_level != wlvif->power_level) { | 2486 | if (conf->power_level != wlvif->power_level) { |
@@ -3816,16 +3814,6 @@ sta_not_found: | |||
3816 | if (ret < 0) | 3814 | if (ret < 0) |
3817 | goto out; | 3815 | goto out; |
3818 | } | 3816 | } |
3819 | |||
3820 | /* If we want to go in PSM but we're not there yet */ | ||
3821 | if (test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags) && | ||
3822 | !test_bit(WLVIF_FLAG_PSM, &wlvif->flags)) { | ||
3823 | |||
3824 | ret = wl1271_ps_set_mode(wl, wlvif, | ||
3825 | STATION_AUTO_PS_MODE); | ||
3826 | if (ret < 0) | ||
3827 | goto out; | ||
3828 | } | ||
3829 | } | 3817 | } |
3830 | 3818 | ||
3831 | /* Handle new association with HT. Do this after join. */ | 3819 | /* Handle new association with HT. Do this after join. */ |
diff --git a/drivers/net/wireless/wl12xx/ps.c b/drivers/net/wireless/wl12xx/ps.c index d7a91d3c398d..e209e29ffb45 100644 --- a/drivers/net/wireless/wl12xx/ps.c +++ b/drivers/net/wireless/wl12xx/ps.c | |||
@@ -56,7 +56,7 @@ void wl1271_elp_work(struct work_struct *work) | |||
56 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) | 56 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) |
57 | goto out; | 57 | goto out; |
58 | 58 | ||
59 | if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && | 59 | if (!test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags) && |
60 | test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) | 60 | test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) |
61 | goto out; | 61 | goto out; |
62 | } | 62 | } |
@@ -84,7 +84,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl) | |||
84 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) | 84 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) |
85 | return; | 85 | return; |
86 | 86 | ||
87 | if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && | 87 | if (!test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags) && |
88 | test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) | 88 | test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) |
89 | return; | 89 | return; |
90 | } | 90 | } |
@@ -180,7 +180,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
180 | if (ret < 0) | 180 | if (ret < 0) |
181 | return ret; | 181 | return ret; |
182 | 182 | ||
183 | set_bit(WLVIF_FLAG_PSM, &wlvif->flags); | 183 | set_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags); |
184 | 184 | ||
185 | /* enable beacon early termination. Not relevant for 5GHz */ | 185 | /* enable beacon early termination. Not relevant for 5GHz */ |
186 | if (wlvif->band == IEEE80211_BAND_2GHZ) { | 186 | if (wlvif->band == IEEE80211_BAND_2GHZ) { |
@@ -203,7 +203,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
203 | if (ret < 0) | 203 | if (ret < 0) |
204 | return ret; | 204 | return ret; |
205 | 205 | ||
206 | clear_bit(WLVIF_FLAG_PSM, &wlvif->flags); | 206 | clear_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags); |
207 | break; | 207 | break; |
208 | case STATION_POWER_SAVE_MODE: | 208 | case STATION_POWER_SAVE_MODE: |
209 | default: | 209 | default: |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index e18e6160fdab..9baed6be6a31 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -254,8 +254,7 @@ enum wl12xx_vif_flags { | |||
254 | WLVIF_FLAG_STA_ASSOCIATED, | 254 | WLVIF_FLAG_STA_ASSOCIATED, |
255 | WLVIF_FLAG_IBSS_JOINED, | 255 | WLVIF_FLAG_IBSS_JOINED, |
256 | WLVIF_FLAG_AP_STARTED, | 256 | WLVIF_FLAG_AP_STARTED, |
257 | WLVIF_FLAG_PSM, | 257 | WLVIF_FLAG_IN_AUTO_PS, |
258 | WLVIF_FLAG_PSM_REQUESTED, | ||
259 | WLVIF_FLAG_STA_STATE_SENT, | 258 | WLVIF_FLAG_STA_STATE_SENT, |
260 | WLVIF_FLAG_RX_STREAMING_STARTED, | 259 | WLVIF_FLAG_RX_STREAMING_STARTED, |
261 | WLVIF_FLAG_PSPOLL_FAILURE, | 260 | WLVIF_FLAG_PSPOLL_FAILURE, |