Commit d18da7fc authored by Eyal Shapira's avatar Eyal Shapira Committed by Luciano Coelho

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: default avatarEyal Shapira <eyal@wizery.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent ed471d34
...@@ -358,7 +358,7 @@ static ssize_t dynamic_ps_timeout_write(struct file *file, ...@@ -358,7 +358,7 @@ static ssize_t dynamic_ps_timeout_write(struct file *file,
*/ */
wl12xx_for_each_wlvif_sta(wl, wlvif) { wl12xx_for_each_wlvif_sta(wl, wlvif) {
if (test_bit(WLVIF_FLAG_PSM, &wlvif->flags)) if (test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags))
wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE); wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE);
} }
......
...@@ -1715,9 +1715,7 @@ static int wl1271_op_start(struct ieee80211_hw *hw) ...@@ -1715,9 +1715,7 @@ static int wl1271_op_start(struct ieee80211_hw *hw)
* is added. That is where we will initialize the hardware. * is added. That is where we will initialize the hardware.
*/ */
wl1271_error("wl12xx is in an ustable state (fw api update is " return 0;
"taking place). skip this commit when bisecting");
return -EBUSY;
} }
static void wl1271_op_stop(struct ieee80211_hw *hw) 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,29 +2458,29 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
} }
} }
if (conf->flags & IEEE80211_CONF_PS && if ((changed & IEEE80211_CONF_CHANGE_PS) && !is_ap) {
!test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags)) {
set_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags); if ((conf->flags & IEEE80211_CONF_PS) &&
test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) &&
!test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags)) {
wl1271_debug(DEBUG_PSM, "auto ps enabled");
/*
* We enter PSM only if we're already associated.
* If we're not, we'll enter it when joining an SSID,
* through the bss_info_changed() hook.
*/
if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {
wl1271_debug(DEBUG_PSM, "psm enabled");
ret = wl1271_ps_set_mode(wl, wlvif, ret = wl1271_ps_set_mode(wl, wlvif,
STATION_AUTO_PS_MODE); STATION_AUTO_PS_MODE);
} if (ret < 0)
} else if (!(conf->flags & IEEE80211_CONF_PS) && wl1271_warning("enter auto ps failed %d", ret);
test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags)) {
wl1271_debug(DEBUG_PSM, "psm disabled");
clear_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags); } else if (!(conf->flags & IEEE80211_CONF_PS) &&
test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags)) {
wl1271_debug(DEBUG_PSM, "auto ps disabled");
if (test_bit(WLVIF_FLAG_PSM, &wlvif->flags))
ret = wl1271_ps_set_mode(wl, wlvif, ret = wl1271_ps_set_mode(wl, wlvif,
STATION_ACTIVE_MODE); STATION_ACTIVE_MODE);
if (ret < 0)
wl1271_warning("exit auto ps failed %d", ret);
}
} }
if (conf->power_level != wlvif->power_level) { if (conf->power_level != wlvif->power_level) {
...@@ -3816,16 +3814,6 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3816,16 +3814,6 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
/* If we want to go in PSM but we're not there yet */
if (test_bit(WLVIF_FLAG_PSM_REQUESTED, &wlvif->flags) &&
!test_bit(WLVIF_FLAG_PSM, &wlvif->flags)) {
ret = wl1271_ps_set_mode(wl, wlvif,
STATION_AUTO_PS_MODE);
if (ret < 0)
goto out;
}
} }
/* Handle new association with HT. Do this after join. */ /* Handle new association with HT. Do this after join. */
......
...@@ -56,7 +56,7 @@ void wl1271_elp_work(struct work_struct *work) ...@@ -56,7 +56,7 @@ void wl1271_elp_work(struct work_struct *work)
if (wlvif->bss_type == BSS_TYPE_AP_BSS) if (wlvif->bss_type == BSS_TYPE_AP_BSS)
goto out; goto out;
if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && if (!test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags) &&
test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
goto out; goto out;
} }
...@@ -84,7 +84,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl) ...@@ -84,7 +84,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
if (wlvif->bss_type == BSS_TYPE_AP_BSS) if (wlvif->bss_type == BSS_TYPE_AP_BSS)
return; return;
if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && if (!test_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags) &&
test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
return; return;
} }
...@@ -180,7 +180,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -180,7 +180,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
if (ret < 0) if (ret < 0)
return ret; return ret;
set_bit(WLVIF_FLAG_PSM, &wlvif->flags); set_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags);
/* enable beacon early termination. Not relevant for 5GHz */ /* enable beacon early termination. Not relevant for 5GHz */
if (wlvif->band == IEEE80211_BAND_2GHZ) { if (wlvif->band == IEEE80211_BAND_2GHZ) {
...@@ -203,7 +203,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -203,7 +203,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
if (ret < 0) if (ret < 0)
return ret; return ret;
clear_bit(WLVIF_FLAG_PSM, &wlvif->flags); clear_bit(WLVIF_FLAG_IN_AUTO_PS, &wlvif->flags);
break; break;
case STATION_POWER_SAVE_MODE: case STATION_POWER_SAVE_MODE:
default: default:
......
...@@ -254,8 +254,7 @@ enum wl12xx_vif_flags { ...@@ -254,8 +254,7 @@ enum wl12xx_vif_flags {
WLVIF_FLAG_STA_ASSOCIATED, WLVIF_FLAG_STA_ASSOCIATED,
WLVIF_FLAG_IBSS_JOINED, WLVIF_FLAG_IBSS_JOINED,
WLVIF_FLAG_AP_STARTED, WLVIF_FLAG_AP_STARTED,
WLVIF_FLAG_PSM, WLVIF_FLAG_IN_AUTO_PS,
WLVIF_FLAG_PSM_REQUESTED,
WLVIF_FLAG_STA_STATE_SENT, WLVIF_FLAG_STA_STATE_SENT,
WLVIF_FLAG_RX_STREAMING_STARTED, WLVIF_FLAG_RX_STREAMING_STARTED,
WLVIF_FLAG_PSPOLL_FAILURE, WLVIF_FLAG_PSPOLL_FAILURE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment