Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352181
b: refs/heads/master
c: 518b680
h: refs/heads/master
i:
  352179: 62ea3ba
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Dec 4, 2012
1 parent c65ebc4 commit 72f8005
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 873d2a403462b3b495603c0a9a39bd857575aa82
refs/heads/master: 518b680a8eb3ef953c80c9ef1bd6502e107b36fb
70 changes: 32 additions & 38 deletions trunk/drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2781,46 +2781,8 @@ static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif)
static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
struct ieee80211_conf *conf, u32 changed)
{
bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
int ret;

if ((changed & IEEE80211_CONF_CHANGE_PS) && !is_ap) {

if ((conf->flags & IEEE80211_CONF_PS) &&
test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) &&
!test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags)) {

int ps_mode;
char *ps_mode_str;

if (wl->conf.conn.forced_ps) {
ps_mode = STATION_POWER_SAVE_MODE;
ps_mode_str = "forced";
} else {
ps_mode = STATION_AUTO_PS_MODE;
ps_mode_str = "auto";
}

wl1271_debug(DEBUG_PSM, "%s ps enabled", ps_mode_str);

ret = wl1271_ps_set_mode(wl, wlvif, ps_mode);

if (ret < 0)
wl1271_warning("enter %s ps failed %d",
ps_mode_str, ret);

} else if (!(conf->flags & IEEE80211_CONF_PS) &&
test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags)) {

wl1271_debug(DEBUG_PSM, "auto ps disabled");

ret = wl1271_ps_set_mode(wl, wlvif,
STATION_ACTIVE_MODE);
if (ret < 0)
wl1271_warning("exit auto ps failed %d", ret);
}
}

if (conf->power_level != wlvif->power_level) {
ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level);
if (ret < 0)
Expand Down Expand Up @@ -4115,6 +4077,38 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
}
}

if (changed & BSS_CHANGED_PS) {
if ((bss_conf->ps) &&
test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) &&
!test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags)) {
int ps_mode;
char *ps_mode_str;

if (wl->conf.conn.forced_ps) {
ps_mode = STATION_POWER_SAVE_MODE;
ps_mode_str = "forced";
} else {
ps_mode = STATION_AUTO_PS_MODE;
ps_mode_str = "auto";
}

wl1271_debug(DEBUG_PSM, "%s ps enabled", ps_mode_str);

ret = wl1271_ps_set_mode(wl, wlvif, ps_mode);
if (ret < 0)
wl1271_warning("enter %s ps failed %d",
ps_mode_str, ret);
} else if (!bss_conf->ps &&
test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags)) {
wl1271_debug(DEBUG_PSM, "auto ps disabled");

ret = wl1271_ps_set_mode(wl, wlvif,
STATION_ACTIVE_MODE);
if (ret < 0)
wl1271_warning("exit auto ps failed %d", ret);
}
}

/* Handle new association with HT. Do this after join. */
if (sta_exists &&
(changed & BSS_CHANGED_HT)) {
Expand Down

0 comments on commit 72f8005

Please sign in to comment.