2017-02-15 19:01:51

by Gucea Doru

[permalink] [raw]
Subject: [PATCH 2/2] ath9k_htc: Adjust beacon timers for power save

From: Doru Gucea <[email protected]>

Each time we receive a beacon we need to adjust the hardware
timers for next DTIM and next TBTT.

Before this commit, the Power Save behaviour was incorrect.
The scenario was:
- STA receives a beacon from AP with TIM unset;
- mac80211 layers puts the chip to sleep;
- chip is woken up by mac80211's software timer reponsible for
beacon miss after 7 * beacon_interval period.

Normally the chip should sleep at most DTIM period. This commit
configures hardware timers for waking up the chip correctly.

More details on the wiki:
https://github.com/doru91/linux-stable/wiki/Single-Interface-Power-Save

Signed-off-by: Doru Gucea <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c27143b..d2934e1 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1749,6 +1749,10 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex);

+ /* adjust beacon timers */
+ if (changed && BSS_CHANGED_BEACON_INFO)
+ ath9k_htc_beacon_config(priv, vif);
+
if (changed & BSS_CHANGED_ASSOC) {
ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n",
bss_conf->bssid, bss_conf->assoc);
--
1.9.1


2017-02-15 20:32:30

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/2] ath9k_htc: Adjust beacon timers for power save

Hi Doru,

[auto build test ERROR on mac80211-next/master]
[also build test ERROR on v4.10-rc8 next-20170215]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Doru/mac80211-Update-the-driver-with-beacon-info-constantly/20170216-034614
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: i386-randconfig-s1-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

drivers/net/wireless/ath/ath9k/main.c: In function 'ath9k_bss_info_changed':
>> drivers/net/wireless/ath/ath9k/main.c:1774:3: error: implicit declaration of function 'ath9k_htc_beacon_config' [-Werror=implicit-function-declaration]
ath9k_htc_beacon_config(priv, vif);
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/ath9k/main.c:1774:27: error: 'priv' undeclared (first use in this function)
ath9k_htc_beacon_config(priv, vif);
^~~~
drivers/net/wireless/ath/ath9k/main.c:1774:27: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors

vim +/ath9k_htc_beacon_config +1774 drivers/net/wireless/ath/ath9k/main.c

1768
1769 ath9k_ps_wakeup(sc);
1770 mutex_lock(&sc->mutex);
1771
1772 /* adjust beacon timers */
1773 if (changed && BSS_CHANGED_BEACON_INFO)
> 1774 ath9k_htc_beacon_config(priv, vif);
1775
1776 if (changed & BSS_CHANGED_ASSOC) {
1777 ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n",

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.84 kB)
.config.gz (28.05 kB)
Download all attachments