* [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable
@ 2009-12-16 16:51 Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 1/5] ath9k: Fix TX hang poll routine Luis R. Rodriguez
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable; +Cc: linux-wireless, Luis R. Rodriguez
Greg, here's a few patches which are stable fixes for which we missed
to CC stable on. They are all upstream on Linus' tree now. A few required
some backport work so I took the time to do this for you.
Felix Fietkau (1):
ath9k: fix tx status reporting
Luis R. Rodriguez (2):
ath9k: fix processing of TX PS null data frames
ath9k: Fix maximum tx fifo settings for single stream devices
Sujith (1):
ath9k: Fix TX hang poll routine
Vivek Natarajan (1):
mac80211: Fix dynamic power save for scanning.
drivers/net/wireless/ath/ath9k/ath9k.h | 3 +++
drivers/net/wireless/ath/ath9k/hw.c | 11 ++++++++++-
drivers/net/wireless/ath/ath9k/hw.h | 1 +
drivers/net/wireless/ath/ath9k/mac.c | 6 ++++--
drivers/net/wireless/ath/ath9k/mac.h | 1 +
drivers/net/wireless/ath/ath9k/main.c | 9 ++++++++-
drivers/net/wireless/ath/ath9k/xmit.c | 20 +++++++++++++++++++-
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/scan.c | 20 ++++++++++++++++----
9 files changed, 63 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] ath9k: Fix TX hang poll routine
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
@ 2009-12-16 16:51 ` Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 2/5] ath9k: fix processing of TX PS null data frames Luis R. Rodriguez
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable; +Cc: linux-wireless, Sujith, Luis R. Rodriguez
From: Sujith <Sujith.Manoharan@atheros.com>
When TX is hung, the chip is reset. Ensure that
the chip is awake by using the PS wrappers.
This is a backport of upstream commit:
332c556633b8c5fb4e890b1783122f2315526590
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 42551a4..972e775 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2065,7 +2065,9 @@ static void ath_tx_complete_poll_work(struct work_struct *work)
if (needreset) {
DPRINTF(sc, ATH_DBG_RESET, "tx hung, resetting the chip\n");
+ ath9k_ps_wakeup(sc);
ath_reset(sc, false);
+ ath9k_ps_restore(sc);
}
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] ath9k: fix processing of TX PS null data frames
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 1/5] ath9k: Fix TX hang poll routine Luis R. Rodriguez
@ 2009-12-16 16:51 ` Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 3/5] ath9k: Fix maximum tx fifo settings for single stream devices Luis R. Rodriguez
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable
Cc: linux-wireless, Luis R. Rodriguez, Vasanthakumar Thiagarajan,
Vivek Natarajan
When mac80211 was telling us to go into Powersave we listened
and immediately turned RX off. This meant hardware would not
see the ACKs from the AP we're associated with and hardware
we'd end up retransmiting the null data frame in a loop
helplessly.
Fix this by keeping track of the transmitted nullfunc frames
and only when we are sure the AP has sent back an ACK do we
go ahead and shut RX off.
This is a backport of upstream commit:
e7824a50662f7f79b1a739f705b4d906c31cf221
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Vivek Natarajan <Vivek.Natarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 3 +++
drivers/net/wireless/ath/ath9k/mac.c | 2 ++
drivers/net/wireless/ath/ath9k/mac.h | 1 +
drivers/net/wireless/ath/ath9k/main.c | 9 ++++++++-
drivers/net/wireless/ath/ath9k/xmit.c | 16 ++++++++++++++++
5 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 1d59f10..cdb90c5 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -139,6 +139,7 @@ struct ath_buf {
dma_addr_t bf_daddr; /* physical addr of desc */
dma_addr_t bf_buf_addr; /* physical addr of data buffer */
bool bf_stale;
+ bool bf_isnullfunc;
u16 bf_flags;
struct ath_buf_state bf_state;
dma_addr_t bf_dmacontext;
@@ -524,6 +525,8 @@ struct ath_led {
#define SC_OP_BEACON_SYNC BIT(19)
#define SC_OP_BTCOEX_ENABLED BIT(20)
#define SC_OP_BT_PRIORITY_DETECTED BIT(21)
+#define SC_OP_NULLFUNC_COMPLETED BIT(22)
+#define SC_OP_PS_ENABLED BIT(23)
struct ath_bus_ops {
void (*read_cachesize)(struct ath_softc *sc, int *csz);
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 800bfab..561a40e 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -222,6 +222,8 @@ int ath9k_hw_txprocdesc(struct ath_hw *ah, struct ath_desc *ds)
ds->ds_txstat.ts_status = 0;
ds->ds_txstat.ts_flags = 0;
+ if (ads->ds_txstatus1 & AR_FrmXmitOK)
+ ds->ds_txstat.ts_status |= ATH9K_TX_ACKED;
if (ads->ds_txstatus1 & AR_ExcessiveRetries)
ds->ds_txstat.ts_status |= ATH9K_TXERR_XRETRY;
if (ads->ds_txstatus1 & AR_Filtered)
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index f56e77d..ff65f85 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -76,6 +76,7 @@
#define ATH9K_TXERR_FIFO 0x04
#define ATH9K_TXERR_XTXOP 0x08
#define ATH9K_TXERR_TIMER_EXPIRED 0x10
+#define ATH9K_TX_ACKED 0x20
#define ATH9K_TX_BA 0x01
#define ATH9K_TX_PWRMGMT 0x02
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 43d2be9..59359e3 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2327,6 +2327,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_PS) {
if (conf->flags & IEEE80211_CONF_PS) {
+ sc->sc_flags |= SC_OP_PS_ENABLED;
if (!(ah->caps.hw_caps &
ATH9K_HW_CAP_AUTOSLEEP)) {
if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) {
@@ -2334,11 +2335,17 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
ath9k_hw_set_interrupts(sc->sc_ah,
sc->imask);
}
- ath9k_hw_setrxabort(sc->sc_ah, 1);
}
sc->ps_enabled = true;
+ if ((sc->sc_flags & SC_OP_NULLFUNC_COMPLETED)) {
+ sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED;
+ sc->ps_enabled = true;
+ ath9k_hw_setrxabort(sc->sc_ah, 1);
+ }
} else {
sc->ps_enabled = false;
+ sc->sc_flags &= ~(SC_OP_PS_ENABLED |
+ SC_OP_NULLFUNC_COMPLETED);
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
if (!(ah->caps.hw_caps &
ATH9K_HW_CAP_AUTOSLEEP)) {
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 972e775..e78bd57 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1592,6 +1592,13 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
}
bf->bf_buf_addr = bf->bf_dmacontext;
+
+ if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc)) {
+ bf->bf_isnullfunc = true;
+ sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED;
+ } else
+ bf->bf_isnullfunc = false;
+
return 0;
}
@@ -1989,6 +1996,15 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
if (ds == txq->axq_gatingds)
txq->axq_gatingds = NULL;
+ if (bf->bf_isnullfunc &&
+ (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) {
+ if ((sc->sc_flags & SC_OP_PS_ENABLED)) {
+ sc->ps_enabled = true;
+ ath9k_hw_setrxabort(sc->sc_ah, 1);
+ } else
+ sc->sc_flags |= SC_OP_NULLFUNC_COMPLETED;
+ }
+
/*
* Remove ath_buf's of the same transmit unit from txq,
* however leave the last descriptor back as the holding
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] ath9k: Fix maximum tx fifo settings for single stream devices
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 1/5] ath9k: Fix TX hang poll routine Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 2/5] ath9k: fix processing of TX PS null data frames Luis R. Rodriguez
@ 2009-12-16 16:51 ` Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 4/5] ath9k: fix tx status reporting Luis R. Rodriguez
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable
Cc: linux-wireless, Luis R. Rodriguez, Kyungwan Nam, Bennyam Malavazi,
Stephen Chen, Shan Palanisamy, Paul Shaw,
Vasanthakumar Thiagarajan
Atheros single stream AR9285 and AR9271 have half the PCU TX FIFO
buffer size of that of dual stream devices. Dual stream devices
have a max PCU TX FIFO size of 8 KB while single stream devices
have 4 KB. Single stream devices have an issue though and require
hardware only to use half of the amount of its capable PCU TX FIFO
size, 2 KB and this requires a change in software.
Technically a change would not have been required (except for frame
burst considerations of 128 bytes) if these devices would have been
able to use the full 4 KB of the PCU TX FIFO size but our systems
engineers recommend 2 KB to be used only. We enforce this through
software by reducing the max frame triggger level to 2 KB.
Fixing the max frame trigger level should then have a few benefits:
* The PER will now be adjusted as designed for underruns when the
max trigger level is reached. This should help alleviate the
bus as the rate control algorithm chooses a slower rate which
should ensure frames are transmitted properly under high system
bus load.
* The poll we use on our TX queues should now trigger and work
as designed for single stream devices. The hardware passes
data from each TX queue on the PCU TX FIFO queue respecting each
queue's priority. The new trigger level ensures this seeding of
the PCU TX FIFO queue occurs as designed which could mean avoiding
false resets and actually reseting hw correctly when a TX queue
is indeed stuck.
* Some undocumented / unsupported behaviour could have been triggered
when the max trigger level level was being set to 4 KB on single
stream devices. Its not clear what this issue was to me yet.
This is a backport of upstream commit:
f4709fdf683e1ed37b321c258b614ebe39752bf3
Cc: Kyungwan Nam <kyungwan.nam@atheros.com>
Cc: Bennyam Malavazi <bennyam.malavazi@atheros.com>
Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Shan Palanisamy <shan.palanisamy@atheros.com>
Cc: Paul Shaw <paul.shaw@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/hw.c | 11 ++++++++++-
drivers/net/wireless/ath/ath9k/hw.h | 1 +
drivers/net/wireless/ath/ath9k/mac.c | 4 ++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index ca7694c..c7aa05a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -937,6 +937,11 @@ int ath9k_hw_init(struct ath_hw *ah)
DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
ah->config.serialize_regmode);
+ if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
+ ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD >> 1;
+ else
+ ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
+
if (!ath9k_hw_macversion_supported(ah->hw_version.macVersion)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
"Mac Chip Rev 0x%02x.%x is not supported by "
@@ -3670,7 +3675,11 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
pCap->keycache_size = AR_KEYTABLE_SIZE;
pCap->hw_caps |= ATH9K_HW_CAP_FASTCC;
- pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD;
+
+ if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
+ pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD >> 1;
+ else
+ pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD;
if (AR_SREV_9285_10_OR_LATER(ah))
pCap->num_gpio_pins = AR9285_NUM_GPIO;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index b892345..57f1463 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -218,6 +218,7 @@ struct ath9k_ops_config {
#define AR_SPUR_FEEQ_BOUND_HT20 10
int spurmode;
u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
+ u8 max_txtrig_level;
};
enum ath9k_int {
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 561a40e..d4d9d82 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -70,7 +70,7 @@ bool ath9k_hw_updatetxtriglevel(struct ath_hw *ah, bool bIncTrigLevel)
u32 txcfg, curLevel, newLevel;
enum ath9k_int omask;
- if (ah->tx_trig_level >= MAX_TX_FIFO_THRESHOLD)
+ if (ah->tx_trig_level >= ah->config.max_txtrig_level)
return false;
omask = ath9k_hw_set_interrupts(ah, ah->mask_reg & ~ATH9K_INT_GLOBAL);
@@ -79,7 +79,7 @@ bool ath9k_hw_updatetxtriglevel(struct ath_hw *ah, bool bIncTrigLevel)
curLevel = MS(txcfg, AR_FTRIG);
newLevel = curLevel;
if (bIncTrigLevel) {
- if (curLevel < MAX_TX_FIFO_THRESHOLD)
+ if (curLevel < ah->config.max_txtrig_level)
newLevel++;
} else if (curLevel > MIN_TX_FIFO_THRESHOLD)
newLevel--;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] ath9k: fix tx status reporting
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
` (2 preceding siblings ...)
2009-12-16 16:51 ` [PATCH 3/5] ath9k: Fix maximum tx fifo settings for single stream devices Luis R. Rodriguez
@ 2009-12-16 16:51 ` Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 5/5] mac80211: Fix dynamic power save for scanning Luis R. Rodriguez
2009-12-16 19:10 ` [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable John W. Linville
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable; +Cc: linux-wireless, Felix Fietkau, Luis R. Rodriguez
From: Felix Fietkau <nbd@openwrt.org>
This patch fixes a bug in ath9k's tx status check, which
caused mac80211 to consider regularly transmitted unicast frames
as un-acked.
When checking the ts_status field for errors, it needs to be masked
with ATH9K_TXERR_FILT, because this field also contains other fields
like ATH9K_TX_ACKED.
Without this patch, AP mode is pretty much unusable, as hostapd
checks the ACK status for the frames that it injects.
This is a backport of upstream commit:
e8c6342d989e241513baeba4b05a04b6b1f3bc8b
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index e78bd57..4753909 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2020,7 +2020,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
if (bf_isaggr(bf))
txq->axq_aggr_depth--;
- txok = (ds->ds_txstat.ts_status == 0);
+ txok = !(ds->ds_txstat.ts_status & ATH9K_TXERR_FILT);
txq->axq_tx_inprogress = false;
spin_unlock_bh(&txq->axq_lock);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] mac80211: Fix dynamic power save for scanning.
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
` (3 preceding siblings ...)
2009-12-16 16:51 ` [PATCH 4/5] ath9k: fix tx status reporting Luis R. Rodriguez
@ 2009-12-16 16:51 ` Luis R. Rodriguez
2009-12-16 19:10 ` [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable John W. Linville
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2009-12-16 16:51 UTC (permalink / raw)
To: greg, stable; +Cc: linux-wireless, Vivek Natarajan, John W. Linville
From: Vivek Natarajan <vnatarajan@atheros.com>
Not only ps_sdata but also IEEE80211_CONF_PS is to be considered
before restoring PS in scan_ps_disable(). For instance, when ps_sdata
is set but CONF_PS is not set just because the dynamic timer is still
running, a sw scan leads to setting of CONF_PS in scan_ps_disable
instead of restarting the dynamic PS timer.
Also for the above case, a null data frame is to be sent after
returning to operating channel which was not happening with the
current implementation. This patch fixes this too.
Upstream commit:
7c3f4bbedc241ddcd3abe1f419c356e625231da1
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/scan.c | 20 ++++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 10d316e..5a46164 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -808,6 +808,7 @@ struct ieee80211_local {
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
bool pspolling;
+ bool scan_ps_enabled;
/*
* PS can only be enabled when we have exactly one managed
* interface (and monitors) in PS, this then points there.
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 71e10ca..eb9bebe 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -196,7 +196,8 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
- bool ps = false;
+
+ local->scan_ps_enabled = false;
/* FIXME: what to do when local->pspolling is true? */
@@ -204,12 +205,13 @@ static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata)
cancel_work_sync(&local->dynamic_ps_enable_work);
if (local->hw.conf.flags & IEEE80211_CONF_PS) {
- ps = true;
+ local->scan_ps_enabled = true;
local->hw.conf.flags &= ~IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
}
- if (!ps || !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
+ if (!(local->scan_ps_enabled) ||
+ !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
/*
* If power save was enabled, no need to send a nullfunc
* frame because AP knows that we are sleeping. But if the
@@ -230,7 +232,7 @@ static void ieee80211_scan_ps_disable(struct ieee80211_sub_if_data *sdata)
if (!local->ps_sdata)
ieee80211_send_nullfunc(local, sdata, 0);
- else {
+ else if (local->scan_ps_enabled) {
/*
* In !IEEE80211_HW_PS_NULLFUNC_STACK case the hardware
* will send a nullfunc frame with the powersave bit set
@@ -246,6 +248,16 @@ static void ieee80211_scan_ps_disable(struct ieee80211_sub_if_data *sdata)
*/
local->hw.conf.flags |= IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
+ } else if (local->hw.conf.dynamic_ps_timeout > 0) {
+ /*
+ * If IEEE80211_CONF_PS was not set and the dynamic_ps_timer
+ * had been running before leaving the operating channel,
+ * restart the timer now and send a nullfunc frame to inform
+ * the AP that we are awake.
+ */
+ ieee80211_send_nullfunc(local, sdata, 0);
+ mod_timer(&local->dynamic_ps_timer, jiffies +
+ msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
}
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
` (4 preceding siblings ...)
2009-12-16 16:51 ` [PATCH 5/5] mac80211: Fix dynamic power save for scanning Luis R. Rodriguez
@ 2009-12-16 19:10 ` John W. Linville
5 siblings, 0 replies; 7+ messages in thread
From: John W. Linville @ 2009-12-16 19:10 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: greg, stable, linux-wireless
On Wed, Dec 16, 2009 at 11:51:40AM -0500, Luis R. Rodriguez wrote:
> Greg, here's a few patches which are stable fixes for which we missed
> to CC stable on. They are all upstream on Linus' tree now. A few required
> some backport work so I took the time to do this for you.
>
> Felix Fietkau (1):
> ath9k: fix tx status reporting
>
> Luis R. Rodriguez (2):
> ath9k: fix processing of TX PS null data frames
> ath9k: Fix maximum tx fifo settings for single stream devices
>
> Sujith (1):
> ath9k: Fix TX hang poll routine
>
> Vivek Natarajan (1):
> mac80211: Fix dynamic power save for scanning.
ACK
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-16 19:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-16 16:51 [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 1/5] ath9k: Fix TX hang poll routine Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 2/5] ath9k: fix processing of TX PS null data frames Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 3/5] ath9k: Fix maximum tx fifo settings for single stream devices Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 4/5] ath9k: fix tx status reporting Luis R. Rodriguez
2009-12-16 16:51 ` [PATCH 5/5] mac80211: Fix dynamic power save for scanning Luis R. Rodriguez
2009-12-16 19:10 ` [PATCH 0/5] stable-2.6.32: few ath9k fixes/mac80211 which missed CC'ing stable John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).