summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-01-26 14:19:52 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-01-26 11:53:21 -0500
commit56007a028c51cbf800a6c969d6f6431d23443b99 (patch)
tree8bc0280467824ed3b5f95810444b1f8e1ebc2750 /drivers/net/wireless/mwl8k.c
parentc21dbf9214bce129f92e1af05552553ff0e318ed (diff)
downloadblackbird-op-linux-56007a028c51cbf800a6c969d6f6431d23443b99.tar.gz
blackbird-op-linux-56007a028c51cbf800a6c969d6f6431d23443b99.zip
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.c14
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)
struct mwl8k_priv *priv =
container_of(work, struct mwl8k_priv, finalize_join_worker);
struct sk_buff *skb = priv->beacon_skb;
- struct mwl8k_vif *mwl8k_vif;
+ struct ieee80211_mgmt *mgmt = (void *)skb->data;
+ int len = skb->len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
+ const u8 *tim = cfg80211_find_ie(WLAN_EID_TIM,
+ mgmt->u.beacon.variable, len);
+ int dtim_period = 1;
+
+ if (tim && tim[1] >= 2)
+ dtim_period = tim[3];
- mwl8k_vif = mwl8k_first_vif(priv);
- if (mwl8k_vif != NULL)
- mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len,
- mwl8k_vif->vif->bss_conf.dtim_period);
+ mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, dtim_period);
dev_kfree_skb(skb);
priv->beacon_skb = NULL;
OpenPOWER on IntegriCloud