aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 14:07:04 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:35 -0500
commit25ddfa195735934256fda55bb4f2d749c19386ff (patch)
tree82824e4017674fd72df2cfa46382f61368037dc0 /drivers
parentb405086ba47678a5b8f6e7cd835a3d27ebb6f744 (diff)
ath5k: Move tx retries setting outside reset_tx_queue
* Move setting of tx retry limits on a separate function (we 'll clean up this AR5210 mess later) Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath5k/qcu.c92
1 files changed, 56 insertions, 36 deletions
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index 00c490833ba7..c422d5c92d46 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -226,11 +226,61 @@ int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type,
226\*******************************/ 226\*******************************/
227 227
228/* 228/*
229 * Set tx retry limits on DCU
230 */
231static void ath5k_hw_set_tx_retry_limits(struct ath5k_hw *ah,
232 unsigned int queue)
233{
234 u32 retry_lg, retry_sh;
235
236 /*
237 * Calculate and set retry limits
238 */
239 if (ah->ah_software_retry) {
240 /* XXX Need to test this */
241 retry_lg = ah->ah_limit_tx_retries;
242 retry_sh = retry_lg = retry_lg > AR5K_DCU_RETRY_LMT_SH_RETRY ?
243 AR5K_DCU_RETRY_LMT_SH_RETRY : retry_lg;
244 } else {
245 retry_lg = AR5K_INIT_LG_RETRY;
246 retry_sh = AR5K_INIT_SH_RETRY;
247 }
248
249 /* Single data queue on AR5210 */
250 if (ah->ah_version == AR5K_AR5210) {
251 struct ath5k_txq_info *tq = &ah->ah_txq[queue];
252
253 if (queue > 0)
254 return;
255
256 ath5k_hw_reg_write(ah,
257 (tq->tqi_cw_min << AR5K_NODCU_RETRY_LMT_CW_MIN_S)
258 | AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
259 AR5K_NODCU_RETRY_LMT_SLG_RETRY)
260 | AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
261 AR5K_NODCU_RETRY_LMT_SSH_RETRY)
262 | AR5K_REG_SM(retry_lg, AR5K_NODCU_RETRY_LMT_LG_RETRY)
263 | AR5K_REG_SM(retry_sh, AR5K_NODCU_RETRY_LMT_SH_RETRY),
264 AR5K_NODCU_RETRY_LMT);
265 /* DCU on AR5211+ */
266 } else {
267 ath5k_hw_reg_write(ah,
268 AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
269 AR5K_DCU_RETRY_LMT_SLG_RETRY) |
270 AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
271 AR5K_DCU_RETRY_LMT_SSH_RETRY) |
272 AR5K_REG_SM(retry_lg, AR5K_DCU_RETRY_LMT_LG_RETRY) |
273 AR5K_REG_SM(retry_sh, AR5K_DCU_RETRY_LMT_SH_RETRY),
274 AR5K_QUEUE_DFS_RETRY_LIMIT(queue));
275 }
276 return;
277}
278
279/*
229 * Set DFS properties for a transmit queue on DCU 280 * Set DFS properties for a transmit queue on DCU
230 */ 281 */
231int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue) 282int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
232{ 283{
233 u32 retry_lg, retry_sh;
234 struct ath5k_txq_info *tq = &ah->ah_txq[queue]; 284 struct ath5k_txq_info *tq = &ah->ah_txq[queue];
235 285
236 AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num); 286 AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
@@ -271,42 +321,7 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
271 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ? 321 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
272 AR5K_INIT_PROTO_TIME_CNTRL_TURBO : 322 AR5K_INIT_PROTO_TIME_CNTRL_TURBO :
273 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1); 323 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1);
274 }
275
276 /*
277 * Calculate and set retry limits
278 */
279 if (ah->ah_software_retry) {
280 /* XXX Need to test this */
281 retry_lg = ah->ah_limit_tx_retries;
282 retry_sh = retry_lg = retry_lg > AR5K_DCU_RETRY_LMT_SH_RETRY ?
283 AR5K_DCU_RETRY_LMT_SH_RETRY : retry_lg;
284 } else { 324 } else {
285 retry_lg = AR5K_INIT_LG_RETRY;
286 retry_sh = AR5K_INIT_SH_RETRY;
287 }
288
289 /*No QCU/DCU [5210]*/
290 if (ah->ah_version == AR5K_AR5210) {
291 ath5k_hw_reg_write(ah,
292 (tq->tqi_cw_min << AR5K_NODCU_RETRY_LMT_CW_MIN_S)
293 | AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
294 AR5K_NODCU_RETRY_LMT_SLG_RETRY)
295 | AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
296 AR5K_NODCU_RETRY_LMT_SSH_RETRY)
297 | AR5K_REG_SM(retry_lg, AR5K_NODCU_RETRY_LMT_LG_RETRY)
298 | AR5K_REG_SM(retry_sh, AR5K_NODCU_RETRY_LMT_SH_RETRY),
299 AR5K_NODCU_RETRY_LMT);
300 } else {
301 /*QCU/DCU [5211+]*/
302 ath5k_hw_reg_write(ah,
303 AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
304 AR5K_DCU_RETRY_LMT_SLG_RETRY) |
305 AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
306 AR5K_DCU_RETRY_LMT_SSH_RETRY) |
307 AR5K_REG_SM(retry_lg, AR5K_DCU_RETRY_LMT_LG_RETRY) |
308 AR5K_REG_SM(retry_sh, AR5K_DCU_RETRY_LMT_SH_RETRY),
309 AR5K_QUEUE_DFS_RETRY_LIMIT(queue));
310 325
311 /*===Rest is also for QCU/DCU only [5211+]===*/ 326 /*===Rest is also for QCU/DCU only [5211+]===*/
312 327
@@ -321,6 +336,11 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
321 AR5K_QUEUE_DFS_LOCAL_IFS(queue)); 336 AR5K_QUEUE_DFS_LOCAL_IFS(queue));
322 337
323 /* 338 /*
339 * Set tx retry limits for this queue
340 */
341 ath5k_hw_set_tx_retry_limits(ah, queue);
342
343 /*
324 * Set misc registers 344 * Set misc registers
325 */ 345 */
326 346