Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 246949
b: refs/heads/master
c: dcf55fb
h: refs/heads/master
i:
  246947: a8620f4
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Apr 19, 2011
1 parent d533bee commit 35a8745
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 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: cea3235cf578b5e952f5a0cec9bc6c2e862eb697
refs/heads/master: dcf55fb5d43bd82e1e3bf94f065cfe8f75a4bc5a
12 changes: 12 additions & 0 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,18 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
*/
#define IEEE80211_TX_STATUS_HEADROOM 13

/**
* ieee80211_sta_set_tim - set the TIM bit for a sleeping station
*
* If a driver buffers frames for a powersave station instead of passing
* them back to mac80211 for retransmission, the station needs to be told
* to wake up using the TIM bitmap in the beacon.
*
* This function sets the station's TIM bit - it will be cleared when the
* station wakes up.
*/
void ieee80211_sta_set_tim(struct ieee80211_sta *sta);

/**
* ieee80211_tx_status - transmit status callback
*
Expand Down
13 changes: 12 additions & 1 deletion trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
#endif
dev_kfree_skb(skb);

if (skb_queue_empty(&sta->ps_tx_buf))
if (skb_queue_empty(&sta->ps_tx_buf) &&
!test_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF))
sta_info_clear_tim_bit(sta);
}

Expand Down Expand Up @@ -896,6 +897,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
struct ieee80211_local *local = sdata->local;
int sent, buffered;

clear_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF);
if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS))
drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta);

Expand Down Expand Up @@ -988,3 +990,12 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
ieee80211_queue_work(hw, &sta->drv_unblock_wk);
}
EXPORT_SYMBOL(ieee80211_sta_block_awake);

void ieee80211_sta_set_tim(struct ieee80211_sta *pubsta)
{
struct sta_info *sta = container_of(pubsta, struct sta_info, sta);

set_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF);
sta_info_set_tim_bit(sta);
}
EXPORT_SYMBOL(ieee80211_sta_set_tim);
3 changes: 3 additions & 0 deletions trunk/net/mac80211/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
* be in the queues
* @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping
* station in power-save mode, reply when the driver unblocks.
* @WLAN_STA_PS_DRIVER_BUF: Station has frames pending in driver internal
* buffers. Automatically cleared on station wake-up.
*/
enum ieee80211_sta_info_flags {
WLAN_STA_AUTH = 1<<0,
Expand All @@ -58,6 +60,7 @@ enum ieee80211_sta_info_flags {
WLAN_STA_BLOCK_BA = 1<<11,
WLAN_STA_PS_DRIVER = 1<<12,
WLAN_STA_PSPOLL = 1<<13,
WLAN_STA_PS_DRIVER_BUF = 1<<14,
};

#define STA_TID_NUM 16
Expand Down

0 comments on commit 35a8745

Please sign in to comment.