Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202784
b: refs/heads/master
c: 0d58cbf
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Jun 2, 2010
1 parent 975409c commit 0cdd020
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 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: db81956cc4a6780e9aeb1e85993096e67dcb0cd3
refs/heads/master: 0d58cbff2495fda8b2389719d30da694d3077a87
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ struct wl1271 {
#define WL1271_FLAG_IRQ_PENDING (9)
#define WL1271_FLAG_IRQ_RUNNING (10)
#define WL1271_FLAG_IDLE (11)
#define WL1271_FLAG_IDLE_REQUESTED (12)
unsigned long flags;

struct wl1271_partition_set part;
Expand Down
60 changes: 39 additions & 21 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,11 +1135,6 @@ static int wl1271_dummy_join(struct wl1271 *wl)

memcpy(wl->bssid, dummy_bssid, ETH_ALEN);

/* increment the session counter */
wl->session_counter++;
if (wl->session_counter >= SESSION_COUNTER_MAX)
wl->session_counter = 0;

/* pass through frames from all BSS */
wl1271_configure_filters(wl, FIF_OTHER_BSS);

Expand Down Expand Up @@ -1253,6 +1248,42 @@ static u32 wl1271_min_rate_get(struct wl1271 *wl)
return rate;
}

static int wl1271_handle_idle(struct wl1271 *wl, bool idle)
{
int ret;

if (idle) {
if (test_bit(WL1271_FLAG_JOINED, &wl->flags)) {
ret = wl1271_unjoin(wl);
if (ret < 0)
goto out;
}
wl->rate_set = wl1271_min_rate_get(wl);
wl->sta_rate_set = 0;
ret = wl1271_acx_rate_policies(wl);
if (ret < 0)
goto out;
ret = wl1271_acx_keep_alive_config(
wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
ACX_KEEP_ALIVE_TPL_INVALID);
if (ret < 0)
goto out;
set_bit(WL1271_FLAG_IDLE, &wl->flags);
} else {
/* increment the session counter */
wl->session_counter++;
if (wl->session_counter >= SESSION_COUNTER_MAX)
wl->session_counter = 0;
ret = wl1271_dummy_join(wl);
if (ret < 0)
goto out;
clear_bit(WL1271_FLAG_IDLE, &wl->flags);
}

out:
return ret;
}

static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
{
struct wl1271 *wl = hw->priv;
Expand Down Expand Up @@ -1307,22 +1338,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
}

if (changed & IEEE80211_CONF_CHANGE_IDLE) {
if (conf->flags & IEEE80211_CONF_IDLE &&
test_bit(WL1271_FLAG_JOINED, &wl->flags))
wl1271_unjoin(wl);
else if (!(conf->flags & IEEE80211_CONF_IDLE))
wl1271_dummy_join(wl);

if (conf->flags & IEEE80211_CONF_IDLE) {
wl->rate_set = wl1271_min_rate_get(wl);
wl->sta_rate_set = 0;
wl1271_acx_rate_policies(wl);
wl1271_acx_keep_alive_config(
wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
ACX_KEEP_ALIVE_TPL_INVALID);
set_bit(WL1271_FLAG_IDLE, &wl->flags);
} else
clear_bit(WL1271_FLAG_IDLE, &wl->flags);
ret = wl1271_handle_idle(wl, conf->flags & IEEE80211_CONF_IDLE);
if (ret < 0)
wl1271_warning("idle mode change failed %d", ret);
}

if (conf->flags & IEEE80211_CONF_PS &&
Expand Down

0 comments on commit 0cdd020

Please sign in to comment.