summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2012-02-29 15:14:36 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:40 +0200
commit4c4e06be96fda139dad42b7b743091a58dda92f0 (patch)
tree4ddf07d2949810edbeb0e14b0934f8765df125f0
parent723143f7b0f360d0161120909a502790afa09b41 (diff)
cw1200: block consecutive calls to wsm_set_pm
Reported by Dheeshan SASI: One observation in OMAC logging is that there are repeated calls of set-PM-Mode-Req. This is incorrect, it is a call that should be made only once. After this, the FW manages power control. Each time the call is made the FW states have to be reset. Even on channel changes (as in code snippet below) FW will manage the power save states. Host MAC should not control this. Leave always in fast power save, the only practical reason to change this is for rogue/bad APs. Channel change will internally change the joined channel. If there appears to be a link to Power Save, then this set-PM-Mode-Req issue should be corrected. The call can be made once per association, after set-bss-params. This means all the information for power save is available (AID especially). Also after Reset if necessary for OMAC. Similarly operational mode also should only be called once. There is no need to keep calling this, however this has less impact and no large state machine is involved. ST-Ericsson ID: 355071 Change-Id: I740e9b21f5e1fdf0b696ddc709b26a640872922c Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37688 Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com> Tested-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
-rw-r--r--drivers/staging/cw1200/cw1200.h1
-rw-r--r--drivers/staging/cw1200/scan.c4
-rw-r--r--drivers/staging/cw1200/sta.c16
3 files changed, 12 insertions, 9 deletions
diff --git a/drivers/staging/cw1200/cw1200.h b/drivers/staging/cw1200/cw1200.h
index 0ab5d04a054..6dbc59eeab5 100644
--- a/drivers/staging/cw1200/cw1200.h
+++ b/drivers/staging/cw1200/cw1200.h
@@ -116,6 +116,7 @@ struct cw1200_common {
struct wsm_set_bss_params bss_params;
struct cw1200_ht_info ht_info;
struct wsm_set_pm powersave_mode;
+ struct wsm_set_pm firmware_ps_mode;
int cqm_rssi_thold;
unsigned cqm_rssi_hyst;
unsigned cqm_tx_failure_thold;
diff --git a/drivers/staging/cw1200/scan.c b/drivers/staging/cw1200/scan.c
index 0d3859fd011..0d6a1c2f5b7 100644
--- a/drivers/staging/cw1200/scan.c
+++ b/drivers/staging/cw1200/scan.c
@@ -152,7 +152,7 @@ void cw1200_scan_work(struct work_struct *work)
!(priv->powersave_mode.pmMode & WSM_PSM_PS)) {
struct wsm_set_pm pm = priv->powersave_mode;
pm.pmMode = WSM_PSM_PS;
- wsm_set_pm(priv, &pm);
+ cw1200_set_pm(priv, &pm);
} else if (priv->join_status == CW1200_JOIN_STATUS_MONITOR) {
/* FW bug: driver has to restart p2p-dev mode
* after scan */
@@ -166,7 +166,7 @@ void cw1200_scan_work(struct work_struct *work)
priv->output_power * 10));
if (priv->join_status == CW1200_JOIN_STATUS_STA &&
!(priv->powersave_mode.pmMode & WSM_PSM_PS))
- wsm_set_pm(priv, &priv->powersave_mode);
+ cw1200_set_pm(priv, &priv->powersave_mode);
if (priv->scan.req)
wiphy_dbg(priv->hw->wiphy,
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index cda81e4c4b1..6c79880900b 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -389,11 +389,6 @@ int cw1200_config(struct ieee80211_hw *dev, u32 changed)
}
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
- struct wsm_operational_mode mode = {
- .power_mode = wsm_power_mode_quiescent,
- .disableMoreFlagUsage = true,
- };
-
wsm_lock_tx(priv);
/* Disable p2p-dev mode forced by TX request */
if ((priv->join_status == CW1200_JOIN_STATUS_MONITOR) &&
@@ -402,7 +397,6 @@ int cw1200_config(struct ieee80211_hw *dev, u32 changed)
cw1200_disable_listening(priv);
priv->join_status = CW1200_JOIN_STATUS_PASSIVE;
}
- WARN_ON(wsm_set_operational_mode(priv, &mode));
wsm_unlock_tx(priv);
}
@@ -597,7 +591,13 @@ int cw1200_set_pm(struct cw1200_common *priv, const struct wsm_set_pm *arg)
if (priv->uapsd_info.uapsdFlags != 0)
pm.pmMode &= ~WSM_PSM_FAST_PS_FLAG;
- return wsm_set_pm(priv, &pm);
+ if (memcmp(&pm, &priv->firmware_ps_mode,
+ sizeof(struct wsm_set_pm))) {
+ priv->firmware_ps_mode = pm;
+ return wsm_set_pm(priv, &pm);
+ } else {
+ return 0;
+ }
}
int cw1200_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
@@ -1344,6 +1344,8 @@ void cw1200_unjoin_work(struct work_struct *work)
memset(&priv->association_mode, 0,
sizeof(priv->association_mode));
memset(&priv->bss_params, 0, sizeof(priv->bss_params));
+ memset(&priv->firmware_ps_mode, 0,
+ sizeof(priv->firmware_ps_mode));
sta_printk(KERN_DEBUG "[STA] Unjoin.\n");
}
mutex_unlock(&priv->conf_mutex);