diff options
| author | Oleksij Rempel <linux@rempel-privat.de> | 2014-03-01 15:16:05 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2014-03-17 13:13:08 -0400 |
| commit | 4b2d841f5bc3143f5a019b6a441c19bf2986bdf4 (patch) | |
| tree | bdde507415d8483331c6525265444cee08af9f6e | |
| parent | 6a77dd33fcfbfcf48f77fed599a0ce763e65a894 (diff) | |
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>
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index 50937d014542..cbaf4e0429f0 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
| @@ -104,49 +104,22 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, | 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); | 109 | struct ath_hw *ah = priv->ah; |
| 110 | u32 tsftu; | 110 | ah->imask = 0; |
| 111 | int ret __attribute__ ((unused)); | ||
| 112 | u64 tsf; | ||
| 113 | |||
| 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 | 111 | ||
| 112 | ath9k_cmn_beacon_config_ap(ah, conf, ATH9K_HTC_MAX_BCN_VIF); | ||
| 118 | /* | 113 | /* |
| 119 | * To reduce beacon misses under heavy TX load, | 114 | * To reduce beacon misses under heavy TX load, |
| 120 | * set the beacon response time to a larger value. | 115 | * set the beacon response time to a larger value. |
| 121 | */ | 116 | */ |
| 122 | if (bss_conf->intval > DEFAULT_SWBA_RESPONSE) | 117 | if (conf->intval >= TU_TO_USEC(DEFAULT_SWBA_RESPONSE)) |
| 123 | priv->ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; | 118 | ah->config.sw_beacon_response_time = DEFAULT_SWBA_RESPONSE; |
| 124 | else | 119 | else |
| 125 | priv->ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; | 120 | ah->config.sw_beacon_response_time = MIN_SWBA_RESPONSE; |
| 126 | |||
| 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 | 121 | ||
| 149 | ath9k_htc_beacon_init(priv, bss_conf, false); | 122 | ath9k_htc_beacon_init(priv, conf, false); |
| 150 | } | 123 | } |
| 151 | 124 | ||
| 152 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, | 125 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, |
