diff options
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index b9b03c1b4010..b23231fea02c 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -107,22 +107,19 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, | |||
107 | struct ath_beacon_config *bss_conf) | 107 | struct ath_beacon_config *bss_conf) |
108 | { | 108 | { |
109 | struct ath_common *common = ath9k_hw_common(priv->ah); | 109 | struct ath_common *common = ath9k_hw_common(priv->ah); |
110 | enum ath9k_int imask = 0; | 110 | u32 tsftu; |
111 | u32 nexttbtt, intval, tsftu; | ||
112 | __be32 htc_imask = 0; | ||
113 | int ret __attribute__ ((unused)); | 111 | int ret __attribute__ ((unused)); |
114 | u8 cmd_rsp; | ||
115 | u64 tsf; | 112 | u64 tsf; |
116 | 113 | ||
117 | intval = bss_conf->beacon_interval; | 114 | bss_conf->intval = bss_conf->beacon_interval; |
118 | intval /= ATH9K_HTC_MAX_BCN_VIF; | 115 | bss_conf->intval /= ATH9K_HTC_MAX_BCN_VIF; |
119 | nexttbtt = intval; | 116 | bss_conf->nexttbtt = bss_conf->intval; |
120 | 117 | ||
121 | /* | 118 | /* |
122 | * To reduce beacon misses under heavy TX load, | 119 | * To reduce beacon misses under heavy TX load, |
123 | * set the beacon response time to a larger value. | 120 | * set the beacon response time to a larger value. |
124 | */ | 121 | */ |
125 | if (intval > DEFAULT_SWBA_RESPONSE) | 122 | if (bss_conf->intval > DEFAULT_SWBA_RESPONSE) |
126 | priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; | 123 | priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; |
127 | else | 124 | else |
128 | priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; | 125 | priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; |
@@ -137,25 +134,19 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, | |||
137 | tsf = ath9k_hw_gettsf64(priv->ah); | 134 | tsf = ath9k_hw_gettsf64(priv->ah); |
138 | tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE; | 135 | tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE; |
139 | do { | 136 | do { |
140 | nexttbtt += intval; | 137 | bss_conf->nexttbtt += bss_conf->intval; |
141 | } while (nexttbtt < tsftu); | 138 | } while (bss_conf->nexttbtt < tsftu); |
142 | } | 139 | } |
143 | 140 | ||
144 | if (bss_conf->enable_beacon) | 141 | if (bss_conf->enable_beacon) |
145 | imask |= ATH9K_INT_SWBA; | 142 | priv->ah->imask = ATH9K_INT_SWBA; |
146 | 143 | ||
147 | ath_dbg(common, CONFIG, | 144 | ath_dbg(common, CONFIG, |
148 | "AP Beacon config, intval: %d, nexttbtt: %u, resp_time: %d imask: 0x%x\n", | 145 | "AP Beacon config, intval: %d, nexttbtt: %u, resp_time: %d imask: 0x%x\n", |
149 | bss_conf->beacon_interval, nexttbtt, | 146 | bss_conf->beacon_interval, bss_conf->nexttbtt, |
150 | priv->ah->config.sw_beacon_response_time, imask); | 147 | priv->ah->config.sw_beacon_response_time, priv->ah->imask); |
151 | 148 | ||
152 | ath9k_htc_beaconq_config(priv); | 149 | ath9k_htc_beacon_init(priv, bss_conf, false); |
153 | |||
154 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | ||
155 | ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval)); | ||
156 | priv->beacon.bmisscnt = 0; | ||
157 | htc_imask = cpu_to_be32(imask); | ||
158 | WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask); | ||
159 | } | 150 | } |
160 | 151 | ||
161 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, | 152 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, |