aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-10-29 03:30:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-30 16:50:39 -0400
commiteddcbb94f75c3e8944503e9f13c1d29acd0d7052 (patch)
treeb5e4786dbafccea91d7ec42cb9e84af655414aca /net
parent750266646befe42ee8a3a9f9b6f692174635c5b8 (diff)
mac80211: introduce ieee80211_beacon_get_tim()
Compared to ieee80211_beacon_get(), the new function ieee80211_beacon_get_tim() returns information on the location and length of the TIM IE, which some drivers need in order to generate the TIM on the device. The old function, ieee80211_beacon_get(), becomes a small static inline wrapper around the new one to not break all drivers. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index cb06d8e56496..8595d14c774c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2012,8 +2012,9 @@ static void ieee80211_beacon_add_tim(struct ieee80211_if_ap *bss,
2012 } 2012 }
2013} 2013}
2014 2014
2015struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 2015struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
2016 struct ieee80211_vif *vif) 2016 struct ieee80211_vif *vif,
2017 u16 *tim_offset, u16 *tim_length)
2017{ 2018{
2018 struct ieee80211_local *local = hw_to_local(hw); 2019 struct ieee80211_local *local = hw_to_local(hw);
2019 struct sk_buff *skb = NULL; 2020 struct sk_buff *skb = NULL;
@@ -2030,6 +2031,11 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
2030 2031
2031 sdata = vif_to_sdata(vif); 2032 sdata = vif_to_sdata(vif);
2032 2033
2034 if (tim_offset)
2035 *tim_offset = 0;
2036 if (tim_length)
2037 *tim_length = 0;
2038
2033 if (sdata->vif.type == NL80211_IFTYPE_AP) { 2039 if (sdata->vif.type == NL80211_IFTYPE_AP) {
2034 ap = &sdata->u.ap; 2040 ap = &sdata->u.ap;
2035 beacon = rcu_dereference(ap->beacon); 2041 beacon = rcu_dereference(ap->beacon);
@@ -2065,6 +2071,11 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
2065 spin_unlock_irqrestore(&local->sta_lock, flags); 2071 spin_unlock_irqrestore(&local->sta_lock, flags);
2066 } 2072 }
2067 2073
2074 if (tim_offset)
2075 *tim_offset = beacon->head_len;
2076 if (tim_length)
2077 *tim_length = skb->len - beacon->head_len;
2078
2068 if (beacon->tail) 2079 if (beacon->tail)
2069 memcpy(skb_put(skb, beacon->tail_len), 2080 memcpy(skb_put(skb, beacon->tail_len),
2070 beacon->tail, beacon->tail_len); 2081 beacon->tail, beacon->tail_len);
@@ -2141,7 +2152,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
2141 rcu_read_unlock(); 2152 rcu_read_unlock();
2142 return skb; 2153 return skb;
2143} 2154}
2144EXPORT_SYMBOL(ieee80211_beacon_get); 2155EXPORT_SYMBOL(ieee80211_beacon_get_tim);
2145 2156
2146void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2157void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2147 const void *frame, size_t frame_len, 2158 const void *frame, size_t frame_len,