Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171347
b: refs/heads/master
c: eddcbb9
h: refs/heads/master
i:
  171345: e6e9cd4
  171343: d6f226b
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Oct 30, 2009
1 parent 1ef8ba2 commit 947d712
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 750266646befe42ee8a3a9f9b6f692174635c5b8
refs/heads/master: eddcbb94f75c3e8944503e9f13c1d29acd0d7052
42 changes: 34 additions & 8 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1743,19 +1743,45 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
struct sk_buff *skb);

/**
* ieee80211_beacon_get - beacon generation function
* ieee80211_beacon_get_tim - beacon generation function
* @hw: pointer obtained from ieee80211_alloc_hw().
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
* @tim_offset: pointer to variable that will receive the TIM IE offset.
* Set to 0 if invalid (in non-AP modes).
* @tim_length: pointer to variable that will receive the TIM IE length,
* (including the ID and length bytes!).
* Set to 0 if invalid (in non-AP modes).
*
* If the driver implements beaconing modes, it must use this function to
* obtain the beacon frame/template.
*
* If the beacon frames are generated by the host system (i.e., not in
* hardware/firmware), the low-level driver uses this function to receive
* the next beacon frame from the 802.11 code. The low-level is responsible
* for calling this function before beacon data is needed (e.g., based on
* hardware interrupt). Returned skb is used only once and low-level driver
* is responsible for freeing it.
* hardware/firmware), the driver uses this function to get each beacon
* frame from mac80211 -- it is responsible for calling this function
* before the beacon is needed (e.g. based on hardware interrupt).
*
* If the beacon frames are generated by the device, then the driver
* must use the returned beacon as the template and change the TIM IE
* according to the current DTIM parameters/TIM bitmap.
*
* The driver is responsible for freeing the returned skb.
*/
struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u16 *tim_offset, u16 *tim_length);

/**
* ieee80211_beacon_get - beacon generation function
* @hw: pointer obtained from ieee80211_alloc_hw().
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
*
* See ieee80211_beacon_get_tim().
*/
struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
return ieee80211_beacon_get_tim(hw, vif, NULL, NULL);
}

/**
* ieee80211_rts_get - RTS frame generation function
Expand Down
17 changes: 14 additions & 3 deletions trunk/net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2012,8 +2012,9 @@ static void ieee80211_beacon_add_tim(struct ieee80211_if_ap *bss,
}
}

struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u16 *tim_offset, u16 *tim_length)
{
struct ieee80211_local *local = hw_to_local(hw);
struct sk_buff *skb = NULL;
Expand All @@ -2030,6 +2031,11 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,

sdata = vif_to_sdata(vif);

if (tim_offset)
*tim_offset = 0;
if (tim_length)
*tim_length = 0;

if (sdata->vif.type == NL80211_IFTYPE_AP) {
ap = &sdata->u.ap;
beacon = rcu_dereference(ap->beacon);
Expand Down Expand Up @@ -2065,6 +2071,11 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
spin_unlock_irqrestore(&local->sta_lock, flags);
}

if (tim_offset)
*tim_offset = beacon->head_len;
if (tim_length)
*tim_length = skb->len - beacon->head_len;

if (beacon->tail)
memcpy(skb_put(skb, beacon->tail_len),
beacon->tail, beacon->tail_len);
Expand Down Expand Up @@ -2141,7 +2152,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
rcu_read_unlock();
return skb;
}
EXPORT_SYMBOL(ieee80211_beacon_get);
EXPORT_SYMBOL(ieee80211_beacon_get_tim);

void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
const void *frame, size_t frame_len,
Expand Down

0 comments on commit 947d712

Please sign in to comment.