summaryrefslogtreecommitdiff
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-20 11:21:35 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:26 -0500
commit004c872e78d433f84f0a5cd4db7a6c780c0946e1 (patch)
treebd9e7cd0b69e720738d49e170e4f4f64e9111e1a /net/mac80211/ieee80211_i.h
parent836341a70471ba77657b0b420dd7eea3c30a038b (diff)
mac80211: consolidate TIM handling code
This consolidates all TIM handling code to avoid re-introducing errors with the bitmap/set_tim order and to reduce code. While reading the code I noticed a possible problem so I also added a comment about that. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h36
1 files changed, 1 insertions, 35 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1b4a4497030d..b07b3cbfd039 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -207,7 +207,7 @@ struct ieee80211_if_ap {
/* yes, this looks ugly, but guarantees that we can later use
* bitmap_empty :)
- * NB: don't ever use set_bit, use bss_tim_set/bss_tim_clear! */
+ * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)];
atomic_t num_sta_ps; /* number of stations in PS mode */
struct sk_buff_head ps_bc_buf;
@@ -640,40 +640,6 @@ struct sta_attribute {
ssize_t (*store)(struct sta_info *, const char *buf, size_t count);
};
-static inline void __bss_tim_set(struct ieee80211_if_ap *bss, u16 aid)
-{
- /*
- * This format has been mandated by the IEEE specifications,
- * so this line may not be changed to use the __set_bit() format.
- */
- bss->tim[aid / 8] |= (1 << (aid % 8));
-}
-
-static inline void bss_tim_set(struct ieee80211_local *local,
- struct ieee80211_if_ap *bss, u16 aid)
-{
- read_lock_bh(&local->sta_lock);
- __bss_tim_set(bss, aid);
- read_unlock_bh(&local->sta_lock);
-}
-
-static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, u16 aid)
-{
- /*
- * This format has been mandated by the IEEE specifications,
- * so this line may not be changed to use the __clear_bit() format.
- */
- bss->tim[aid / 8] &= ~(1 << (aid % 8));
-}
-
-static inline void bss_tim_clear(struct ieee80211_local *local,
- struct ieee80211_if_ap *bss, u16 aid)
-{
- read_lock_bh(&local->sta_lock);
- __bss_tim_clear(bss, aid);
- read_unlock_bh(&local->sta_lock);
-}
-
static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
{
return compare_ether_addr(raddr, addr) == 0 ||