diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-03-01 15:16:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-17 13:13:08 -0400 |
commit | fa7b52fadbbbec855fb13ccc508128f6d234e08d (patch) | |
tree | 51324edb8f855924e8eb5885dae5956c6aa2ee1c | |
parent | 12f53c308ecbe2b76798a5091f8452eeed0a732b (diff) |
ath9k: move ath9k_beacon_config_ap common
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/beacon.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-beacon.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-beacon.h | 3 |
3 files changed, 34 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 01322a41e0fc..e1887438f8c5 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -483,26 +483,9 @@ static void ath9k_beacon_config_ap(struct ath_softc *sc, | |||
483 | struct ath_beacon_config *conf) | 483 | struct ath_beacon_config *conf) |
484 | { | 484 | { |
485 | struct ath_hw *ah = sc->sc_ah; | 485 | struct ath_hw *ah = sc->sc_ah; |
486 | struct ath_common *common = ath9k_hw_common(ah); | ||
487 | u32 nexttbtt, intval; | ||
488 | |||
489 | /* NB: the beacon interval is kept internally in TU's */ | ||
490 | intval = TU_TO_USEC(conf->beacon_interval); | ||
491 | intval /= ATH_BCBUF; | ||
492 | nexttbtt = ath9k_get_next_tbtt(sc, ath9k_hw_gettsf64(ah), | ||
493 | conf->beacon_interval); | ||
494 | |||
495 | if (conf->enable_beacon) | ||
496 | ah->imask |= ATH9K_INT_SWBA; | ||
497 | else | ||
498 | ah->imask &= ~ATH9K_INT_SWBA; | ||
499 | |||
500 | ath_dbg(common, BEACON, | ||
501 | "AP (%s) nexttbtt: %u intval: %u conf_intval: %u\n", | ||
502 | (conf->enable_beacon) ? "Enable" : "Disable", | ||
503 | nexttbtt, intval, conf->beacon_interval); | ||
504 | 486 | ||
505 | ath9k_beacon_init(sc, nexttbtt, intval, false); | 487 | ath9k_cmn_beacon_config_ap(ah, conf, ATH_BCBUF); |
488 | ath9k_beacon_init(sc, conf->nexttbtt, conf->intval, false); | ||
506 | } | 489 | } |
507 | 490 | ||
508 | static void ath9k_beacon_config_sta(struct ath_hw *ah, | 491 | static void ath9k_beacon_config_sta(struct ath_hw *ah, |
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.c b/drivers/net/wireless/ath/ath9k/common-beacon.c index 45bc899cbeb0..775d1d20ce0b 100644 --- a/drivers/net/wireless/ath/ath9k/common-beacon.c +++ b/drivers/net/wireless/ath/ath9k/common-beacon.c | |||
@@ -149,3 +149,32 @@ void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah, | |||
149 | conf->nexttbtt, conf->intval, conf->beacon_interval); | 149 | conf->nexttbtt, conf->intval, conf->beacon_interval); |
150 | } | 150 | } |
151 | EXPORT_SYMBOL(ath9k_cmn_beacon_config_adhoc); | 151 | EXPORT_SYMBOL(ath9k_cmn_beacon_config_adhoc); |
152 | |||
153 | /* | ||
154 | * For multi-bss ap support beacons are either staggered evenly over N slots or | ||
155 | * burst together. For the former arrange for the SWBA to be delivered for each | ||
156 | * slot. Slots that are not occupied will generate nothing. | ||
157 | */ | ||
158 | void ath9k_cmn_beacon_config_ap(struct ath_hw *ah, | ||
159 | struct ath_beacon_config *conf, | ||
160 | unsigned int bc_buf) | ||
161 | { | ||
162 | struct ath_common *common = ath9k_hw_common(ah); | ||
163 | |||
164 | /* NB: the beacon interval is kept internally in TU's */ | ||
165 | conf->intval = TU_TO_USEC(conf->beacon_interval); | ||
166 | conf->intval /= bc_buf; | ||
167 | conf->nexttbtt = ath9k_get_next_tbtt(ah, ath9k_hw_gettsf64(ah), | ||
168 | conf->beacon_interval); | ||
169 | |||
170 | if (conf->enable_beacon) | ||
171 | ah->imask |= ATH9K_INT_SWBA; | ||
172 | else | ||
173 | ah->imask &= ~ATH9K_INT_SWBA; | ||
174 | |||
175 | ath_dbg(common, BEACON, | ||
176 | "AP (%s) nexttbtt: %u intval: %u conf_intval: %u\n", | ||
177 | (conf->enable_beacon) ? "Enable" : "Disable", | ||
178 | conf->nexttbtt, conf->intval, conf->beacon_interval); | ||
179 | } | ||
180 | EXPORT_SYMBOL(ath9k_cmn_beacon_config_ap); | ||
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.h b/drivers/net/wireless/ath/ath9k/common-beacon.h index d8e7c0db08a9..3665d27f0dc7 100644 --- a/drivers/net/wireless/ath/ath9k/common-beacon.h +++ b/drivers/net/wireless/ath/ath9k/common-beacon.h | |||
@@ -21,3 +21,6 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, | |||
21 | struct ath9k_beacon_state *bs); | 21 | struct ath9k_beacon_state *bs); |
22 | void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah, | 22 | void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah, |
23 | struct ath_beacon_config *conf); | 23 | struct ath_beacon_config *conf); |
24 | void ath9k_cmn_beacon_config_ap(struct ath_hw *ah, | ||
25 | struct ath_beacon_config *conf, | ||
26 | unsigned int bc_buf); | ||