diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-03-01 15:16:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-17 13:13:08 -0400 |
commit | 12f53c308ecbe2b76798a5091f8452eeed0a732b (patch) | |
tree | a918eeec1f136a0c9721a8f2c18aee20569f3f9a /drivers/net/wireless/ath/ath9k | |
parent | f7197924d5187201e1a6e1617ad7a8c81f333330 (diff) |
ath9k_htc: use ath9k_cmn_beacon_config_adhoc
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/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index 81237155a1e0..50937d014542 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -150,42 +150,21 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, | |||
150 | } | 150 | } |
151 | 151 | ||
152 | 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, |
153 | struct ath_beacon_config *bss_conf) | 153 | struct ath_beacon_config *conf) |
154 | { | 154 | { |
155 | struct ath_hw *ah = priv->ah; | 155 | struct ath_hw *ah = priv->ah; |
156 | struct ath_common *common = ath9k_hw_common(ah); | 156 | ah->imask = 0; |
157 | u32 tsftu; | ||
158 | u64 tsf; | ||
159 | |||
160 | bss_conf->intval = bss_conf->beacon_interval; | ||
161 | bss_conf->nexttbtt = bss_conf->intval; | ||
162 | |||
163 | /* | ||
164 | * Pull nexttbtt forward to reflect the current TSF. | ||
165 | */ | ||
166 | tsf = ath9k_hw_gettsf64(priv->ah); | ||
167 | tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE; | ||
168 | do { | ||
169 | bss_conf->nexttbtt += bss_conf->intval; | ||
170 | } while (bss_conf->nexttbtt < tsftu); | ||
171 | 157 | ||
158 | ath9k_cmn_beacon_config_adhoc(ah, conf); | ||
172 | /* | 159 | /* |
173 | * Only one IBSS interfce is allowed. | 160 | * Only one IBSS interfce is allowed. |
174 | */ | 161 | */ |
175 | if (bss_conf->intval > DEFAULT_SWBA_RESPONSE) | 162 | if (conf->intval >= TU_TO_USEC(DEFAULT_SWBA_RESPONSE)) |
176 | priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; | 163 | ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; |
177 | else | 164 | else |
178 | priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; | 165 | ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; |
179 | |||
180 | if (bss_conf->enable_beacon) | ||
181 | ah->imask = ATH9K_INT_SWBA; | ||
182 | |||
183 | ath_dbg(common, CONFIG, | ||
184 | "IBSS Beacon config, intval: %d, nexttbtt: %u, resp_time: %d, imask: 0x%x\n", | ||
185 | bss_conf->beacon_interval, bss_conf->nexttbtt, | ||
186 | priv->ah->config.sw_beacon_response_time, ah->imask); | ||
187 | 166 | ||
188 | ath9k_htc_beacon_init(priv, bss_conf, bss_conf->ibss_creator); | 167 | ath9k_htc_beacon_init(priv, conf, conf->ibss_creator); |
189 | } | 168 | } |
190 | 169 | ||
191 | void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, | 170 | void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, |