diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 10:10:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:33 -0400 |
commit | 57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (patch) | |
tree | bcd24a127b4c79891f45799a20867f49c0f7f949 /net/mac80211/sta_info.c | |
parent | f3b85252f081581a8f257545ed748062dce7798b (diff) |
mac80211: clean up beacon interval settings
We currently have two beacon interval configuration knobs:
hw.conf.beacon_int and vif.bss_info.beacon_int. This is
rather confusing, even though the former is used when we
beacon ourselves and the latter when we are associated to
an AP.
This just deprecates the hw.conf.beacon_int setting in favour
of always using vif.bss_info.beacon_int. Since it touches all
the beaconing IBSS code anyway, we can also add support for
the cfg80211 IBSS beacon interval configuration easily.
NOTE: The hw.conf.beacon_int setting is retained for now due
to drivers still using it -- I couldn't untangle all
drivers, some are updated in this patch.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 654a8e963ccb..7116220d06be 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -543,9 +543,8 @@ void sta_info_unlink(struct sta_info **sta) | |||
543 | spin_unlock_irqrestore(&local->sta_lock, flags); | 543 | spin_unlock_irqrestore(&local->sta_lock, flags); |
544 | } | 544 | } |
545 | 545 | ||
546 | static inline int sta_info_buffer_expired(struct ieee80211_local *local, | 546 | static int sta_info_buffer_expired(struct sta_info *sta, |
547 | struct sta_info *sta, | 547 | struct sk_buff *skb) |
548 | struct sk_buff *skb) | ||
549 | { | 548 | { |
550 | struct ieee80211_tx_info *info; | 549 | struct ieee80211_tx_info *info; |
551 | int timeout; | 550 | int timeout; |
@@ -556,8 +555,9 @@ static inline int sta_info_buffer_expired(struct ieee80211_local *local, | |||
556 | info = IEEE80211_SKB_CB(skb); | 555 | info = IEEE80211_SKB_CB(skb); |
557 | 556 | ||
558 | /* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */ | 557 | /* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */ |
559 | timeout = (sta->listen_interval * local->hw.conf.beacon_int * 32 / | 558 | timeout = (sta->listen_interval * |
560 | 15625) * HZ; | 559 | sta->sdata->vif.bss_conf.beacon_int * |
560 | 32 / 15625) * HZ; | ||
561 | if (timeout < STA_TX_BUFFER_EXPIRE) | 561 | if (timeout < STA_TX_BUFFER_EXPIRE) |
562 | timeout = STA_TX_BUFFER_EXPIRE; | 562 | timeout = STA_TX_BUFFER_EXPIRE; |
563 | return time_after(jiffies, info->control.jiffies + timeout); | 563 | return time_after(jiffies, info->control.jiffies + timeout); |
@@ -577,7 +577,7 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
577 | for (;;) { | 577 | for (;;) { |
578 | spin_lock_irqsave(&sta->ps_tx_buf.lock, flags); | 578 | spin_lock_irqsave(&sta->ps_tx_buf.lock, flags); |
579 | skb = skb_peek(&sta->ps_tx_buf); | 579 | skb = skb_peek(&sta->ps_tx_buf); |
580 | if (sta_info_buffer_expired(local, sta, skb)) | 580 | if (sta_info_buffer_expired(sta, skb)) |
581 | skb = __skb_dequeue(&sta->ps_tx_buf); | 581 | skb = __skb_dequeue(&sta->ps_tx_buf); |
582 | else | 582 | else |
583 | skb = NULL; | 583 | skb = NULL; |