2011-02-08 21:31:50 +02:00
|
|
|
--- a/include/net/mac80211.h
|
|
|
|
+++ b/include/net/mac80211.h
|
2011-03-13 20:38:37 +02:00
|
|
|
@@ -2216,6 +2216,18 @@ static inline int ieee80211_sta_ps_trans
|
2011-02-08 21:31:50 +02:00
|
|
|
#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.
|
|
|
|
+ *
|
2011-02-27 23:46:15 +02:00
|
|
|
+ * This function sets the station's TIM bit - it will be cleared when the
|
|
|
|
+ * station wakes up.
|
2011-02-08 21:31:50 +02:00
|
|
|
+ */
|
|
|
|
+void ieee80211_sta_set_tim(struct ieee80211_sta *sta);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
* ieee80211_tx_status - transmit status callback
|
|
|
|
*
|
|
|
|
* Call this function for all transmitted frames after they have been
|
|
|
|
--- a/net/mac80211/sta_info.c
|
|
|
|
+++ b/net/mac80211/sta_info.c
|
2011-03-22 23:00:58 +02:00
|
|
|
@@ -609,7 +609,8 @@ static bool sta_info_cleanup_expire_buff
|
2011-02-27 23:46:15 +02:00
|
|
|
#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);
|
|
|
|
}
|
|
|
|
|
2011-03-25 23:12:28 +02:00
|
|
|
@@ -902,6 +903,7 @@ void ieee80211_sta_ps_deliver_wakeup(str
|
2011-02-27 23:46:15 +02:00
|
|
|
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);
|
|
|
|
|
2011-03-25 23:12:28 +02:00
|
|
|
@@ -994,3 +996,12 @@ void ieee80211_sta_block_awake(struct ie
|
2011-02-08 21:31:50 +02:00
|
|
|
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);
|
|
|
|
+
|
2011-02-27 23:46:15 +02:00
|
|
|
+ set_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF);
|
2011-02-08 21:31:50 +02:00
|
|
|
+ sta_info_set_tim_bit(sta);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(ieee80211_sta_set_tim);
|
2011-02-27 23:46:15 +02:00
|
|
|
--- a/net/mac80211/sta_info.h
|
|
|
|
+++ b/net/mac80211/sta_info.h
|
|
|
|
@@ -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,
|
|
|
|
@@ -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
|