summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/init.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-11 11:49:15 +0200
committerLuciano Coelho <coelho@ti.com>2011-10-11 15:04:23 +0300
commita4e4130dcea01f3e0dfcbfeaf0d815b971e6e515 (patch)
treebfc84bbad4246630300677ef4b8a9a1098b3a7a7 /drivers/net/wireless/wl12xx/init.c
parenta32d0cdfcb7e5d41f210e13cbc78dc86a5a85a08 (diff)
wl12xx: configure sleep_policy according to active roles
If there is an active AP role, stay always on. Otherwise, allow chip to enter elp. (Note that this is a global configuration, so if the device is already configured according to our policy, we don't have to configure it again) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/init.c')
-rw-r--r--drivers/net/wireless/wl12xx/init.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 80e89e319879..4af7e2fb52fd 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -343,11 +343,6 @@ static int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
if (ret < 0)
return ret;
- /* Configure for ELP power saving */
- ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
- if (ret < 0)
- return ret;
-
ret = wl1271_acx_sta_rate_policies(wl, wlvif);
if (ret < 0)
return ret;
@@ -382,11 +377,6 @@ static int wl1271_ap_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{
int ret;
- /* Configure for power always on */
- ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
- if (ret < 0)
- return ret;
-
ret = wl1271_init_ap_rates(wl, wlvif);
if (ret < 0)
return ret;
@@ -577,9 +567,26 @@ int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
struct conf_tx_ac_category *conf_ac;
struct conf_tx_tid *conf_tid;
bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
-
int ret, i;
+ /*
+ * consider all existing roles before configuring psm.
+ * TODO: reconfigure on interface removal.
+ */
+ if (!wl->ap_count) {
+ if (is_ap) {
+ /* Configure for power always on */
+ ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
+ if (ret < 0)
+ return ret;
+ } else if (!wl->sta_count) {
+ /* Configure for ELP power saving */
+ ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
/* Mode specific init */
if (is_ap) {
ret = wl1271_ap_hw_init(wl, wlvif);