aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2014-03-01 15:16:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-03-17 13:13:08 -0400
commitf7197924d5187201e1a6e1617ad7a8c81f333330 (patch)
tree42f097f58453d45585f6a23f2b7b9911ce63d3be
parent4a4495a5fdf3f5d2e98446c94146dcaefb06a69b (diff)
ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_adhoc
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_beacon.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index b23231fea02c..81237155a1e0 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -152,16 +152,13 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,
152static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, 152static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
153 struct ath_beacon_config *bss_conf) 153 struct ath_beacon_config *bss_conf)
154{ 154{
155 struct ath_common *common = ath9k_hw_common(priv->ah); 155 struct ath_hw *ah = priv->ah;
156 enum ath9k_int imask = 0; 156 struct ath_common *common = ath9k_hw_common(ah);
157 u32 nexttbtt, intval, tsftu; 157 u32 tsftu;
158 __be32 htc_imask = 0;
159 int ret __attribute__ ((unused));
160 u8 cmd_rsp;
161 u64 tsf; 158 u64 tsf;
162 159
163 intval = bss_conf->beacon_interval; 160 bss_conf->intval = bss_conf->beacon_interval;
164 nexttbtt = intval; 161 bss_conf->nexttbtt = bss_conf->intval;
165 162
166 /* 163 /*
167 * Pull nexttbtt forward to reflect the current TSF. 164 * Pull nexttbtt forward to reflect the current TSF.
@@ -169,30 +166,26 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
169 tsf = ath9k_hw_gettsf64(priv->ah); 166 tsf = ath9k_hw_gettsf64(priv->ah);
170 tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE; 167 tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE;
171 do { 168 do {
172 nexttbtt += intval; 169 bss_conf->nexttbtt += bss_conf->intval;
173 } while (nexttbtt < tsftu); 170 } while (bss_conf->nexttbtt < tsftu);
174 171
175 /* 172 /*
176 * Only one IBSS interfce is allowed. 173 * Only one IBSS interfce is allowed.
177 */ 174 */
178 if (intval > DEFAULT_SWBA_RESPONSE) 175 if (bss_conf->intval > DEFAULT_SWBA_RESPONSE)
179 priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; 176 priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE;
180 else 177 else
181 priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; 178 priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE;
182 179
183 if (bss_conf->enable_beacon) 180 if (bss_conf->enable_beacon)
184 imask |= ATH9K_INT_SWBA; 181 ah->imask = ATH9K_INT_SWBA;
185 182
186 ath_dbg(common, CONFIG, 183 ath_dbg(common, CONFIG,
187 "IBSS Beacon config, intval: %d, nexttbtt: %u, resp_time: %d, imask: 0x%x\n", 184 "IBSS Beacon config, intval: %d, nexttbtt: %u, resp_time: %d, imask: 0x%x\n",
188 bss_conf->beacon_interval, nexttbtt, 185 bss_conf->beacon_interval, bss_conf->nexttbtt,
189 priv->ah->config.sw_beacon_response_time, imask); 186 priv->ah->config.sw_beacon_response_time, ah->imask);
190 187
191 WMI_CMD(WMI_DISABLE_INTR_CMDID); 188 ath9k_htc_beacon_init(priv, bss_conf, bss_conf->ibss_creator);
192 ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval));
193 priv->beacon.bmisscnt = 0;
194 htc_imask = cpu_to_be32(imask);
195 WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
196} 189}
197 190
198void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, 191void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,