diff options
-rw-r--r-- | drivers/staging/cw1200/ap.c | 15 | ||||
-rw-r--r-- | drivers/staging/cw1200/pm.c | 4 | ||||
-rw-r--r-- | drivers/staging/cw1200/sta.c | 5 | ||||
-rw-r--r-- | drivers/staging/cw1200/wsm.h | 2 |
4 files changed, 17 insertions, 9 deletions
diff --git a/drivers/staging/cw1200/ap.c b/drivers/staging/cw1200/ap.c index 1211e127c52..c104b39d8f8 100644 --- a/drivers/staging/cw1200/ap.c +++ b/drivers/staging/cw1200/ap.c @@ -389,8 +389,9 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev, BSS_CHANGED_ERP_SLOT)) { ap_printk(KERN_DEBUG "BSS_CHANGED_ASSOC.\n"); if (info->assoc) { /* TODO: ibss_joined */ - int dtim_interval = info->dtim_period; struct ieee80211_sta *sta = NULL; + priv->join_dtim_period = info->dtim_period; + priv->beacon_int = info->beacon_int; /* Associated: kill join timeout */ cancel_delayed_work_sync(&priv->join_timeout); @@ -465,11 +466,11 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev, priv->bss_params.aid = info->aid; - if (dtim_interval < 1) - dtim_interval = 1; + if (priv->join_dtim_period < 1) + priv->join_dtim_period = 1; - ap_printk(KERN_DEBUG "[STA] DTIM %d\n", - dtim_interval); + ap_printk(KERN_DEBUG "[STA] DTIM %d, interval: %d\n", + priv->join_dtim_period, priv->beacon_int); ap_printk(KERN_DEBUG "[STA] Preamble: %d, " \ "Greenfield: %d, Aid: %d, " \ "Rates: 0x%.8X, Basic: 0x%.8X\n", @@ -484,7 +485,9 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev, WARN_ON(wsm_set_bss_params(priv, &priv->bss_params)); priv->setbssparams_done = true; WARN_ON(wsm_set_beacon_wakeup_period(priv, - dtim_interval, 0)); + priv->beacon_int * priv->join_dtim_period > + MAX_BEACON_SKIP_TIME_MS ? 1 : + priv->join_dtim_period, 0)); if (sta && cw1200_is_ht(&priv->ht_info)) { ap_printk(KERN_DEBUG "[STA] Enabling Block ACK\n"); diff --git a/drivers/staging/cw1200/pm.c b/drivers/staging/cw1200/pm.c index 9eece65a709..550ee1482b1 100644 --- a/drivers/staging/cw1200/pm.c +++ b/drivers/staging/cw1200/pm.c @@ -333,7 +333,9 @@ int cw1200_wow_resume(struct ieee80211_hw *hw) WARN_ON(cw1200_bh_resume(priv)); if (state->beacon_skipping) { - wsm_set_beacon_wakeup_period(priv, + wsm_set_beacon_wakeup_period(priv, priv->beacon_int * + priv->join_dtim_period > + MAX_BEACON_SKIP_TIME_MS ? 1 : priv->join_dtim_period, 0); state->beacon_skipping = false; } diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c index 3d82550231a..6c5ff577e32 100644 --- a/drivers/staging/cw1200/sta.c +++ b/drivers/staging/cw1200/sta.c @@ -1288,9 +1288,10 @@ void cw1200_join_work(struct work_struct *work) if (tim && tim->dtim_period > 1) { join.dtimPeriod = tim->dtim_period; priv->join_dtim_period = tim->dtim_period; - sta_printk(KERN_DEBUG "[STA] Join DTIM: %d\n", - join.dtimPeriod); } + priv->beacon_int = bss->beacon_interval; + sta_printk(KERN_DEBUG "[STA] Join DTIM: %d, interval: %d\n", + join.dtimPeriod, priv->beacon_int); join.channelNumber = priv->channel->hw_value; join.band = (priv->channel->band == IEEE80211_BAND_5GHZ) ? diff --git a/drivers/staging/cw1200/wsm.h b/drivers/staging/cw1200/wsm.h index 0915b32bf96..61b2bd0c06b 100644 --- a/drivers/staging/cw1200/wsm.h +++ b/drivers/staging/cw1200/wsm.h @@ -585,6 +585,8 @@ struct wsm_hdr { #define WSM_TX_LINK_ID(link_id) \ ((link_id & WSM_TX_LINK_ID_MAX) << 6) +#define MAX_BEACON_SKIP_TIME_MS 1000 + /* ******************************************************************** */ /* WSM capcbility */ |