diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-12-14 16:08:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-15 14:46:36 -0500 |
commit | b047701383cf886ee18124db0a8c027af6ccc07b (patch) | |
tree | 9c7a2e7f7a329b2f7c28013086c3614e9e7abdee /drivers | |
parent | 156369faa3f49c4fa37cf1f5254b1f3903b23dfd (diff) |
ath9k: reduce indentation level in a few places
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 125 |
1 files changed, 60 insertions, 65 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 649a11e52030..b1a37d28deee 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -480,27 +480,25 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
480 | } else if (!isaggr && txok) { | 480 | } else if (!isaggr && txok) { |
481 | /* transmit completion */ | 481 | /* transmit completion */ |
482 | acked_cnt++; | 482 | acked_cnt++; |
483 | } else if ((tid->state & AGGR_CLEANUP) || !retry) { | ||
484 | /* | ||
485 | * cleanup in progress, just fail | ||
486 | * the un-acked sub-frames | ||
487 | */ | ||
488 | txfail = 1; | ||
489 | } else if (flush) { | ||
490 | txpending = 1; | ||
491 | } else if (fi->retries < ATH_MAX_SW_RETRIES) { | ||
492 | if (txok || !an->sleeping) | ||
493 | ath_tx_set_retry(sc, txq, bf->bf_mpdu, | ||
494 | retries); | ||
495 | |||
496 | txpending = 1; | ||
483 | } else { | 497 | } else { |
484 | if ((tid->state & AGGR_CLEANUP) || !retry) { | 498 | txfail = 1; |
485 | /* | 499 | txfail_cnt++; |
486 | * cleanup in progress, just fail | 500 | bar_index = max_t(int, bar_index, |
487 | * the un-acked sub-frames | 501 | ATH_BA_INDEX(seq_first, seqno)); |
488 | */ | ||
489 | txfail = 1; | ||
490 | } else if (flush) { | ||
491 | txpending = 1; | ||
492 | } else if (fi->retries < ATH_MAX_SW_RETRIES) { | ||
493 | if (txok || !an->sleeping) | ||
494 | ath_tx_set_retry(sc, txq, bf->bf_mpdu, | ||
495 | retries); | ||
496 | |||
497 | txpending = 1; | ||
498 | } else { | ||
499 | txfail = 1; | ||
500 | txfail_cnt++; | ||
501 | bar_index = max_t(int, bar_index, | ||
502 | ATH_BA_INDEX(seq_first, seqno)); | ||
503 | } | ||
504 | } | 502 | } |
505 | 503 | ||
506 | /* | 504 | /* |
@@ -531,32 +529,29 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
531 | !txfail); | 529 | !txfail); |
532 | } else { | 530 | } else { |
533 | /* retry the un-acked ones */ | 531 | /* retry the un-acked ones */ |
534 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) { | 532 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) && |
535 | if (bf->bf_next == NULL && bf_last->bf_stale) { | 533 | bf->bf_next == NULL && bf_last->bf_stale) { |
536 | struct ath_buf *tbf; | 534 | struct ath_buf *tbf; |
537 | 535 | ||
538 | tbf = ath_clone_txbuf(sc, bf_last); | 536 | tbf = ath_clone_txbuf(sc, bf_last); |
539 | /* | 537 | /* |
540 | * Update tx baw and complete the | 538 | * Update tx baw and complete the |
541 | * frame with failed status if we | 539 | * frame with failed status if we |
542 | * run out of tx buf. | 540 | * run out of tx buf. |
543 | */ | 541 | */ |
544 | if (!tbf) { | 542 | if (!tbf) { |
545 | spin_lock_bh(&txq->axq_lock); | 543 | spin_lock_bh(&txq->axq_lock); |
546 | ath_tx_update_baw(sc, tid, seqno); | 544 | ath_tx_update_baw(sc, tid, seqno); |
547 | spin_unlock_bh(&txq->axq_lock); | 545 | spin_unlock_bh(&txq->axq_lock); |
548 | 546 | ||
549 | ath_tx_complete_buf(sc, bf, txq, | 547 | ath_tx_complete_buf(sc, bf, txq, |
550 | &bf_head, | 548 | &bf_head, ts, 0); |
551 | ts, 0); | 549 | bar_index = max_t(int, bar_index, |
552 | bar_index = max_t(int, bar_index, | 550 | ATH_BA_INDEX(seq_first, seqno)); |
553 | ATH_BA_INDEX(seq_first, | 551 | break; |
554 | seqno)); | ||
555 | break; | ||
556 | } | ||
557 | |||
558 | fi->bf = tbf; | ||
559 | } | 552 | } |
553 | |||
554 | fi->bf = tbf; | ||
560 | } | 555 | } |
561 | 556 | ||
562 | /* | 557 | /* |
@@ -644,24 +639,26 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
644 | max_4ms_framelen = ATH_AMPDU_LIMIT_MAX; | 639 | max_4ms_framelen = ATH_AMPDU_LIMIT_MAX; |
645 | 640 | ||
646 | for (i = 0; i < 4; i++) { | 641 | for (i = 0; i < 4; i++) { |
647 | if (rates[i].count) { | 642 | int modeidx; |
648 | int modeidx; | ||
649 | if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) { | ||
650 | legacy = 1; | ||
651 | break; | ||
652 | } | ||
653 | |||
654 | if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) | ||
655 | modeidx = MCS_HT40; | ||
656 | else | ||
657 | modeidx = MCS_HT20; | ||
658 | 643 | ||
659 | if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) | 644 | if (!rates[i].count) |
660 | modeidx++; | 645 | continue; |
661 | 646 | ||
662 | frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; | 647 | if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) { |
663 | max_4ms_framelen = min(max_4ms_framelen, frmlen); | 648 | legacy = 1; |
649 | break; | ||
664 | } | 650 | } |
651 | |||
652 | if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) | ||
653 | modeidx = MCS_HT40; | ||
654 | else | ||
655 | modeidx = MCS_HT20; | ||
656 | |||
657 | if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) | ||
658 | modeidx++; | ||
659 | |||
660 | frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; | ||
661 | max_4ms_framelen = min(max_4ms_framelen, frmlen); | ||
665 | } | 662 | } |
666 | 663 | ||
667 | /* | 664 | /* |
@@ -1587,11 +1584,9 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) | |||
1587 | break; | 1584 | break; |
1588 | } | 1585 | } |
1589 | 1586 | ||
1590 | if (!list_empty(&ac->tid_q)) { | 1587 | if (!list_empty(&ac->tid_q) && !ac->sched) { |
1591 | if (!ac->sched) { | 1588 | ac->sched = true; |
1592 | ac->sched = true; | 1589 | list_add_tail(&ac->list, &txq->axq_acq); |
1593 | list_add_tail(&ac->list, &txq->axq_acq); | ||
1594 | } | ||
1595 | } | 1590 | } |
1596 | 1591 | ||
1597 | if (ac == last_ac || | 1592 | if (ac == last_ac || |