diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/recv.c')
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 743ad228b833..e49e32356e92 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -41,9 +41,12 @@ static void ath_rx_buf_link(struct ath_softc *sc, struct ath_buf *bf) | |||
41 | ASSERT(skb != NULL); | 41 | ASSERT(skb != NULL); |
42 | ds->ds_vdata = skb->data; | 42 | ds->ds_vdata = skb->data; |
43 | 43 | ||
44 | /* setup rx descriptors */ | 44 | /* setup rx descriptors. The sc_rxbufsize here tells the harware |
45 | ath9k_hw_setuprxdesc(ah, ds, | 45 | * how much data it can DMA to us and that we are prepared |
46 | skb_tailroom(skb), /* buffer size */ | 46 | * to process */ |
47 | ath9k_hw_setuprxdesc(ah, | ||
48 | ds, | ||
49 | sc->sc_rxbufsize, | ||
47 | 0); | 50 | 0); |
48 | 51 | ||
49 | if (sc->sc_rxlink == NULL) | 52 | if (sc->sc_rxlink == NULL) |
@@ -88,6 +91,13 @@ static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc, u32 len) | |||
88 | * in rx'd frames. | 91 | * in rx'd frames. |
89 | */ | 92 | */ |
90 | 93 | ||
94 | /* Note: the kernel can allocate a value greater than | ||
95 | * what we ask it to give us. We really only need 4 KB as that | ||
96 | * is this hardware supports and in fact we need at least 3849 | ||
97 | * as that is the MAX AMSDU size this hardware supports. | ||
98 | * Unfortunately this means we may get 8 KB here from the | ||
99 | * kernel... and that is actually what is observed on some | ||
100 | * systems :( */ | ||
91 | skb = dev_alloc_skb(len + sc->sc_cachelsz - 1); | 101 | skb = dev_alloc_skb(len + sc->sc_cachelsz - 1); |
92 | if (skb != NULL) { | 102 | if (skb != NULL) { |
93 | off = ((unsigned long) skb->data) % sc->sc_cachelsz; | 103 | off = ((unsigned long) skb->data) % sc->sc_cachelsz; |
@@ -298,7 +308,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) | |||
298 | 308 | ||
299 | bf->bf_mpdu = skb; | 309 | bf->bf_mpdu = skb; |
300 | bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data, | 310 | bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data, |
301 | skb_end_pointer(skb) - skb->head, | 311 | sc->sc_rxbufsize, |
302 | PCI_DMA_FROMDEVICE); | 312 | PCI_DMA_FROMDEVICE); |
303 | bf->bf_dmacontext = bf->bf_buf_addr; | 313 | bf->bf_dmacontext = bf->bf_buf_addr; |
304 | } | 314 | } |
@@ -544,9 +554,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
544 | if (!requeue_skb) | 554 | if (!requeue_skb) |
545 | goto requeue; | 555 | goto requeue; |
546 | 556 | ||
547 | /* Sync and unmap the frame */ | 557 | pci_dma_sync_single_for_cpu(sc->pdev, |
548 | pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr, | 558 | bf->bf_buf_addr, |
549 | skb_tailroom(skb), | 559 | sc->sc_rxbufsize, |
550 | PCI_DMA_FROMDEVICE); | 560 | PCI_DMA_FROMDEVICE); |
551 | pci_unmap_single(sc->pdev, bf->bf_buf_addr, | 561 | pci_unmap_single(sc->pdev, bf->bf_buf_addr, |
552 | sc->sc_rxbufsize, | 562 | sc->sc_rxbufsize, |