Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Oleksij Rempel and committed by
John W. Linville
fa7b52fa 12f53c30

+34 -19
+2 -19
drivers/net/wireless/ath/ath9k/beacon.c
··· 483 483 struct ath_beacon_config *conf) 484 484 { 485 485 struct ath_hw *ah = sc->sc_ah; 486 - struct ath_common *common = ath9k_hw_common(ah); 487 - u32 nexttbtt, intval; 488 486 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 - 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 491 static void ath9k_beacon_config_sta(struct ath_hw *ah,
+29
drivers/net/wireless/ath/ath9k/common-beacon.c
··· 149 149 conf->nexttbtt, conf->intval, conf->beacon_interval); 150 150 } 151 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);
+3
drivers/net/wireless/ath/ath9k/common-beacon.h
··· 21 21 struct ath9k_beacon_state *bs); 22 22 void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah, 23 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);