aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2014-03-01 15:16:00 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-03-17 13:13:08 -0400
commit4a4495a5fdf3f5d2e98446c94146dcaefb06a69b (patch)
tree10daa98eb742ed7539e86c5a67acddd969a3a2a3 /drivers/net/wireless/ath
parent7f5c4c8320f853e17ec1c6dbb78d3753ba76a6cd (diff)
ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_ap
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_beacon.c31
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
161static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, 152static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,