aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>2014-06-26 07:24:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-07-01 14:26:26 -0400
commit09ebb810927a110e4c354beb20308830d108a54b (patch)
tree8b44e0849ea7c503f2f7ecc563f4cf9ef1ab5076 /drivers/net/wireless/ath
parent5f2f9e44badc5e322523ef3b4583684255b80a07 (diff)
ath9k: Calculate sleep duration
Right now sleep duration is configured as beacon interval. It should be the multiple of beacon interval by listen period which helps to reduce station power consumption. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/common-beacon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.c b/drivers/net/wireless/ath/ath9k/common-beacon.c
index 775d1d20ce0b..733be5178481 100644
--- a/drivers/net/wireless/ath/ath9k/common-beacon.c
+++ b/drivers/net/wireless/ath/ath9k/common-beacon.c
@@ -57,7 +57,7 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
57 struct ath9k_beacon_state *bs) 57 struct ath9k_beacon_state *bs)
58{ 58{
59 struct ath_common *common = ath9k_hw_common(ah); 59 struct ath_common *common = ath9k_hw_common(ah);
60 int dtim_intval; 60 int dtim_intval, sleepduration;
61 u64 tsf; 61 u64 tsf;
62 62
63 /* No need to configure beacon if we are not associated */ 63 /* No need to configure beacon if we are not associated */
@@ -75,6 +75,7 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
75 * last beacon we received (which may be none). 75 * last beacon we received (which may be none).
76 */ 76 */
77 dtim_intval = conf->intval * conf->dtim_period; 77 dtim_intval = conf->intval * conf->dtim_period;
78 sleepduration = ah->hw->conf.listen_interval * conf->intval;
78 79
79 /* 80 /*
80 * Pull nexttbtt forward to reflect the current 81 * Pull nexttbtt forward to reflect the current
@@ -112,7 +113,7 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
112 */ 113 */
113 114
114 bs->bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100), 115 bs->bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100),
115 conf->intval)); 116 sleepduration));
116 if (bs->bs_sleepduration > bs->bs_dtimperiod) 117 if (bs->bs_sleepduration > bs->bs_dtimperiod)
117 bs->bs_sleepduration = bs->bs_dtimperiod; 118 bs->bs_sleepduration = bs->bs_dtimperiod;
118 119