diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-01-26 08:19:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-26 11:53:21 -0500 |
commit | 56007a028c51cbf800a6c969d6f6431d23443b99 (patch) | |
tree | 8bc0280467824ed3b5f95810444b1f8e1ebc2750 /drivers/net/wireless/mwl8k.c | |
parent | c21dbf9214bce129f92e1af05552553ff0e318ed (diff) |
mac80211: wait for beacon before enabling powersave
Because DTIM information is required for powersave
but is only conveyed in beacons, wait for a beacon
before enabling powersave, and change the way the
information is conveyed to the driver accordingly.
mwl8k doesn't currently seem to implement PS but
requires the DTIM period in a different way; after
talking to Lennert we agreed to just have mwl8k do
the parsing itself in the finalize_join work.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 68546ca0ba37..f0f08f3919cc 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3881,12 +3881,16 @@ static void mwl8k_finalize_join_worker(struct work_struct *work) | |||
3881 | struct mwl8k_priv *priv = | 3881 | struct mwl8k_priv *priv = |
3882 | container_of(work, struct mwl8k_priv, finalize_join_worker); | 3882 | container_of(work, struct mwl8k_priv, finalize_join_worker); |
3883 | struct sk_buff *skb = priv->beacon_skb; | 3883 | struct sk_buff *skb = priv->beacon_skb; |
3884 | struct mwl8k_vif *mwl8k_vif; | 3884 | struct ieee80211_mgmt *mgmt = (void *)skb->data; |
3885 | int len = skb->len - offsetof(struct ieee80211_mgmt, u.beacon.variable); | ||
3886 | const u8 *tim = cfg80211_find_ie(WLAN_EID_TIM, | ||
3887 | mgmt->u.beacon.variable, len); | ||
3888 | int dtim_period = 1; | ||
3889 | |||
3890 | if (tim && tim[1] >= 2) | ||
3891 | dtim_period = tim[3]; | ||
3885 | 3892 | ||
3886 | mwl8k_vif = mwl8k_first_vif(priv); | 3893 | mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, dtim_period); |
3887 | if (mwl8k_vif != NULL) | ||
3888 | mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, | ||
3889 | mwl8k_vif->vif->bss_conf.dtim_period); | ||
3890 | 3894 | ||
3891 | dev_kfree_skb(skb); | 3895 | dev_kfree_skb(skb); |
3892 | priv->beacon_skb = NULL; | 3896 | priv->beacon_skb = NULL; |