Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266516
b: refs/heads/master
c: 042ec45
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 30, 2011
1 parent 5643917 commit 69bfd84
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 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: 941c93cd039852b7ab02c74f4698c99d82bd6cfe
refs/heads/master: 042ec4533720122e6cb93dd9f3b6a75fe2fcff16
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);

void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
bool ath_tx_aggr_sleep(struct ath_softc *sc, struct ath_node *an);
void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
struct ath_node *an);

/********/
/* VIFs */
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,8 +1833,7 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
switch (cmd) {
case STA_NOTIFY_SLEEP:
an->sleeping = true;
if (ath_tx_aggr_sleep(sc, an))
ieee80211_sta_set_tim(sta);
ath_tx_aggr_sleep(sta, sc, an);
break;
case STA_NOTIFY_AWAKE:
an->sleeping = false;
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
/* prepend un-acked frames to the beginning of the pending frame queue */
if (!skb_queue_empty(&bf_pending)) {
if (an->sleeping)
ieee80211_sta_set_tim(sta);
ieee80211_sta_set_buffered(sta, tid->tidno, true);

spin_lock_bh(&txq->axq_lock);
if (clear_filter)
Expand Down Expand Up @@ -1153,12 +1153,13 @@ void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
ath_tx_flush_tid(sc, txtid);
}

bool ath_tx_aggr_sleep(struct ath_softc *sc, struct ath_node *an)
void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
struct ath_node *an)
{
struct ath_atx_tid *tid;
struct ath_atx_ac *ac;
struct ath_txq *txq;
bool buffered = false;
bool buffered;
int tidno;

for (tidno = 0, tid = &an->tid[tidno];
Expand All @@ -1172,8 +1173,7 @@ bool ath_tx_aggr_sleep(struct ath_softc *sc, struct ath_node *an)

spin_lock_bh(&txq->axq_lock);

if (!skb_queue_empty(&tid->buf_q))
buffered = true;
buffered = !skb_queue_empty(&tid->buf_q);

tid->sched = false;
list_del(&tid->list);
Expand All @@ -1184,9 +1184,9 @@ bool ath_tx_aggr_sleep(struct ath_softc *sc, struct ath_node *an)
}

spin_unlock_bh(&txq->axq_lock);
}

return buffered;
ieee80211_sta_set_buffered(sta, tidno, buffered);
}
}

void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an)
Expand Down
34 changes: 26 additions & 8 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2361,17 +2361,35 @@ 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
* ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
* @sta: &struct ieee80211_sta pointer for the sleeping station
* @tid: the TID that has buffered frames
* @buffered: indicates whether or not frames are buffered for this TID
*
* 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);
* them back to mac80211 for retransmission, the station may still need
* to be told that there are buffered frames via the TIM bit.
*
* This function informs mac80211 whether or not there are frames that are
* buffered in the driver for a given TID; mac80211 can then use this data
* to set the TIM bit (NOTE: This may call back into the driver's set_tim
* call! Beware of the locking!)
*
* If all frames are released to the station (due to PS-poll or uAPSD)
* then the driver needs to inform mac80211 that there no longer are
* frames buffered. However, when the station wakes up mac80211 assumes
* that all buffered frames will be transmitted and clears this data,
* drivers need to make sure they inform mac80211 about all buffered
* frames on the sleep transition (sta_notify() with %STA_NOTIFY_SLEEP).
*
* Note that technically mac80211 only needs to know this per AC, not per
* TID, but since driver buffering will inevitably happen per TID (since
* it is related to aggregation) it is easier to make mac80211 map the
* TID to the AC as required instead of keeping track in all drivers that
* use this API.
*/
void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
u8 tid, bool buffered);

/**
* ieee80211_tx_status - transmit status callback
Expand Down
8 changes: 6 additions & 2 deletions trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,11 +1117,15 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL(ieee80211_sta_block_awake);

void ieee80211_sta_set_tim(struct ieee80211_sta *pubsta)
void ieee80211_sta_set_buffered(struct ieee80211_sta *pubsta,
u8 tid, bool buffered)
{
struct sta_info *sta = container_of(pubsta, struct sta_info, sta);

if (!buffered)
return;

set_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF);
sta_info_set_tim_bit(sta);
}
EXPORT_SYMBOL(ieee80211_sta_set_tim);
EXPORT_SYMBOL(ieee80211_sta_set_buffered);

0 comments on commit 69bfd84

Please sign in to comment.