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

ath9k_htc: use ath9k_cmn_beacon_config_ap

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
4b2d841f 6a77dd33

+8 -35
+8 -35
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
··· 104 104 } 105 105 106 106 static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, 107 - struct ath_beacon_config *bss_conf) 107 + struct ath_beacon_config *conf) 108 108 { 109 - struct ath_common *common = ath9k_hw_common(priv->ah); 110 - u32 tsftu; 111 - int ret __attribute__ ((unused)); 112 - u64 tsf; 109 + struct ath_hw *ah = priv->ah; 110 + ah->imask = 0; 113 111 114 - bss_conf->intval = bss_conf->beacon_interval; 115 - bss_conf->intval /= ATH9K_HTC_MAX_BCN_VIF; 116 - bss_conf->nexttbtt = bss_conf->intval; 117 - 112 + ath9k_cmn_beacon_config_ap(ah, conf, ATH9K_HTC_MAX_BCN_VIF); 118 113 /* 119 114 * To reduce beacon misses under heavy TX load, 120 115 * set the beacon response time to a larger value. 121 116 */ 122 - if (bss_conf->intval > DEFAULT_SWBA_RESPONSE) 123 - priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; 117 + if (conf->intval >= TU_TO_USEC(DEFAULT_SWBA_RESPONSE)) 118 + ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; 124 119 else 125 - priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; 120 + ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; 126 121 127 - if (test_bit(OP_TSF_RESET, &priv->op_flags)) { 128 - ath9k_hw_reset_tsf(priv->ah); 129 - clear_bit(OP_TSF_RESET, &priv->op_flags); 130 - } else { 131 - /* 132 - * Pull nexttbtt forward to reflect the current TSF. 133 - */ 134 - tsf = ath9k_hw_gettsf64(priv->ah); 135 - tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE; 136 - do { 137 - bss_conf->nexttbtt += bss_conf->intval; 138 - } while (bss_conf->nexttbtt < tsftu); 139 - } 140 - 141 - if (bss_conf->enable_beacon) 142 - priv->ah->imask = ATH9K_INT_SWBA; 143 - 144 - ath_dbg(common, CONFIG, 145 - "AP Beacon config, intval: %d, nexttbtt: %u, resp_time: %d imask: 0x%x\n", 146 - bss_conf->beacon_interval, bss_conf->nexttbtt, 147 - priv->ah->config.sw_beacon_response_time, priv->ah->imask); 148 - 149 - ath9k_htc_beacon_init(priv, bss_conf, false); 122 + ath9k_htc_beacon_init(priv, conf, false); 150 123 } 151 124 152 125 static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,