diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-03-29 23:14:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:46:41 -0400 |
commit | 29bffa96e9bef4fb84740a49e93d5bd6ca126bac (patch) | |
tree | acfa30d0f0568457e70317dd8315a141dda2e6eb /drivers/net/wireless/ath/ath9k/recv.c | |
parent | 8e6f5aa250d6013ec0d66f9f45f376678d3fc4ab (diff) |
ath9k: allocate tx and rx status information on stack
ath_tx_status and ath_rx_status data are only necessary for a short
time, until they have been processed and converted into mac80211 data
structures.
Because of that, it makes no sense to keep them tied to the DMA
descriptor, that only wastes precious memory.
This patch allocates the data on stack in the functions that call the
conversion functions from ath9k_hw.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 9617887907b7..94560e2fe376 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -477,7 +477,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
477 | 477 | ||
478 | struct ath_buf *bf; | 478 | struct ath_buf *bf; |
479 | struct ath_desc *ds; | 479 | struct ath_desc *ds; |
480 | struct ath_rx_status *rx_stats; | ||
481 | struct sk_buff *skb = NULL, *requeue_skb; | 480 | struct sk_buff *skb = NULL, *requeue_skb; |
482 | struct ieee80211_rx_status *rxs; | 481 | struct ieee80211_rx_status *rxs; |
483 | struct ath_hw *ah = sc->sc_ah; | 482 | struct ath_hw *ah = sc->sc_ah; |
@@ -491,6 +490,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
491 | struct ieee80211_hdr *hdr; | 490 | struct ieee80211_hdr *hdr; |
492 | int retval; | 491 | int retval; |
493 | bool decrypt_error = false; | 492 | bool decrypt_error = false; |
493 | struct ath_rx_status rs; | ||
494 | 494 | ||
495 | spin_lock_bh(&sc->rx.rxbuflock); | 495 | spin_lock_bh(&sc->rx.rxbuflock); |
496 | 496 | ||
@@ -506,7 +506,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
506 | 506 | ||
507 | bf = list_first_entry(&sc->rx.rxbuf, struct ath_buf, list); | 507 | bf = list_first_entry(&sc->rx.rxbuf, struct ath_buf, list); |
508 | ds = bf->bf_desc; | 508 | ds = bf->bf_desc; |
509 | rx_stats = &ds->ds_us.rx; | ||
510 | 509 | ||
511 | /* | 510 | /* |
512 | * Must provide the virtual address of the current | 511 | * Must provide the virtual address of the current |
@@ -519,11 +518,14 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
519 | * on. All this is necessary because of our use of | 518 | * on. All this is necessary because of our use of |
520 | * a self-linked list to avoid rx overruns. | 519 | * a self-linked list to avoid rx overruns. |
521 | */ | 520 | */ |
522 | retval = ath9k_hw_rxprocdesc(ah, ds, rx_stats, 0); | 521 | memset(&rs, 0, sizeof(rs)); |
522 | retval = ath9k_hw_rxprocdesc(ah, ds, &rs, 0); | ||
523 | if (retval == -EINPROGRESS) { | 523 | if (retval == -EINPROGRESS) { |
524 | struct ath_rx_status trs; | ||
524 | struct ath_buf *tbf; | 525 | struct ath_buf *tbf; |
525 | struct ath_desc *tds; | 526 | struct ath_desc *tds; |
526 | 527 | ||
528 | memset(&trs, 0, sizeof(trs)); | ||
527 | if (list_is_last(&bf->list, &sc->rx.rxbuf)) { | 529 | if (list_is_last(&bf->list, &sc->rx.rxbuf)) { |
528 | sc->rx.rxlink = NULL; | 530 | sc->rx.rxlink = NULL; |
529 | break; | 531 | break; |
@@ -543,7 +545,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
543 | */ | 545 | */ |
544 | 546 | ||
545 | tds = tbf->bf_desc; | 547 | tds = tbf->bf_desc; |
546 | retval = ath9k_hw_rxprocdesc(ah, tds, &tds->ds_us.rx, 0); | 548 | retval = ath9k_hw_rxprocdesc(ah, tds, &trs, 0); |
547 | if (retval == -EINPROGRESS) { | 549 | if (retval == -EINPROGRESS) { |
548 | break; | 550 | break; |
549 | } | 551 | } |
@@ -567,7 +569,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
567 | 569 | ||
568 | hw = ath_get_virt_hw(sc, hdr); | 570 | hw = ath_get_virt_hw(sc, hdr); |
569 | 571 | ||
570 | ath_debug_stat_rx(sc, rx_stats); | 572 | ath_debug_stat_rx(sc, &rs); |
571 | 573 | ||
572 | /* | 574 | /* |
573 | * If we're asked to flush receive queue, directly | 575 | * If we're asked to flush receive queue, directly |
@@ -576,7 +578,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
576 | if (flush) | 578 | if (flush) |
577 | goto requeue; | 579 | goto requeue; |
578 | 580 | ||
579 | retval = ath9k_cmn_rx_skb_preprocess(common, hw, skb, rx_stats, | 581 | retval = ath9k_cmn_rx_skb_preprocess(common, hw, skb, &rs, |
580 | rxs, &decrypt_error); | 582 | rxs, &decrypt_error); |
581 | if (retval) | 583 | if (retval) |
582 | goto requeue; | 584 | goto requeue; |
@@ -597,9 +599,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
597 | common->rx_bufsize, | 599 | common->rx_bufsize, |
598 | DMA_FROM_DEVICE); | 600 | DMA_FROM_DEVICE); |
599 | 601 | ||
600 | skb_put(skb, rx_stats->rs_datalen); | 602 | skb_put(skb, rs.rs_datalen); |
601 | 603 | ||
602 | ath9k_cmn_rx_skb_postprocess(common, skb, rx_stats, | 604 | ath9k_cmn_rx_skb_postprocess(common, skb, &rs, |
603 | rxs, decrypt_error); | 605 | rxs, decrypt_error); |
604 | 606 | ||
605 | /* We will now give hardware our shiny new allocated skb */ | 607 | /* We will now give hardware our shiny new allocated skb */ |
@@ -622,9 +624,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
622 | * change the default rx antenna if rx diversity chooses the | 624 | * change the default rx antenna if rx diversity chooses the |
623 | * other antenna 3 times in a row. | 625 | * other antenna 3 times in a row. |
624 | */ | 626 | */ |
625 | if (sc->rx.defant != rx_stats->rs_antenna) { | 627 | if (sc->rx.defant != rs.rs_antenna) { |
626 | if (++sc->rx.rxotherant >= 3) | 628 | if (++sc->rx.rxotherant >= 3) |
627 | ath_setdefantenna(sc, rx_stats->rs_antenna); | 629 | ath_setdefantenna(sc, rs.rs_antenna); |
628 | } else { | 630 | } else { |
629 | sc->rx.rxotherant = 0; | 631 | sc->rx.rxotherant = 0; |
630 | } | 632 | } |