aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-09-16 22:37:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-21 11:05:18 -0400
commite0b1cc52e5da3e2fa79666b8df81a953c95c91e4 (patch)
treeeee5ffdd024beb0af165b69b6ec6c6cbe6fcc49e
parentde8af45520f47d14397b603beefae3d2983ce787 (diff)
ath5k: Add tx queue configuration function
Add the mac80211 callback function to configure the tx queue properties like cw_min, cw_max and aifs. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 6bd8dd6f327b..504c6d648ecf 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3140,6 +3140,44 @@ static void ath5k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
3140 mutex_unlock(&sc->lock); 3140 mutex_unlock(&sc->lock);
3141} 3141}
3142 3142
3143static int ath5k_conf_tx(struct ieee80211_hw *hw, u16 queue,
3144 const struct ieee80211_tx_queue_params *params)
3145{
3146 struct ath5k_softc *sc = hw->priv;
3147 struct ath5k_hw *ah = sc->ah;
3148 struct ath5k_txq_info qi;
3149 int ret = 0;
3150
3151 if (queue >= ah->ah_capabilities.cap_queues.q_tx_num)
3152 return 0;
3153
3154 mutex_lock(&sc->lock);
3155
3156 ath5k_hw_get_tx_queueprops(ah, queue, &qi);
3157
3158 qi.tqi_aifs = params->aifs;
3159 qi.tqi_cw_min = params->cw_min;
3160 qi.tqi_cw_max = params->cw_max;
3161 qi.tqi_burst_time = params->txop;
3162
3163 ATH5K_DBG(sc, ATH5K_DEBUG_ANY,
3164 "Configure tx [queue %d], "
3165 "aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n",
3166 queue, params->aifs, params->cw_min,
3167 params->cw_max, params->txop);
3168
3169 if (ath5k_hw_set_tx_queueprops(ah, queue, &qi)) {
3170 ATH5K_ERR(sc,
3171 "Unable to update hardware queue %u!\n", queue);
3172 ret = -EIO;
3173 } else
3174 ath5k_hw_reset_tx_queue(ah, queue);
3175
3176 mutex_unlock(&sc->lock);
3177
3178 return ret;
3179}
3180
3143static const struct ieee80211_ops ath5k_hw_ops = { 3181static const struct ieee80211_ops ath5k_hw_ops = {
3144 .tx = ath5k_tx, 3182 .tx = ath5k_tx,
3145 .start = ath5k_start, 3183 .start = ath5k_start,
@@ -3152,7 +3190,7 @@ static const struct ieee80211_ops ath5k_hw_ops = {
3152 .set_key = ath5k_set_key, 3190 .set_key = ath5k_set_key,
3153 .get_stats = ath5k_get_stats, 3191 .get_stats = ath5k_get_stats,
3154 .get_survey = ath5k_get_survey, 3192 .get_survey = ath5k_get_survey,
3155 .conf_tx = NULL, 3193 .conf_tx = ath5k_conf_tx,
3156 .get_tsf = ath5k_get_tsf, 3194 .get_tsf = ath5k_get_tsf,
3157 .set_tsf = ath5k_set_tsf, 3195 .set_tsf = ath5k_set_tsf,
3158 .reset_tsf = ath5k_reset_tsf, 3196 .reset_tsf = ath5k_reset_tsf,