diff options
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 24 |
2 files changed, 22 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index 377d2df05316..e80d9b9b61a0 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -167,7 +167,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
167 | skb = (struct sk_buff *)bf->bf_mpdu; | 167 | skb = (struct sk_buff *)bf->bf_mpdu; |
168 | if (skb) { | 168 | if (skb) { |
169 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, | 169 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, |
170 | skb_end_pointer(skb) - skb->head, | 170 | skb->len, |
171 | PCI_DMA_TODEVICE); | 171 | PCI_DMA_TODEVICE); |
172 | } | 172 | } |
173 | 173 | ||
@@ -190,7 +190,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
190 | 190 | ||
191 | bf->bf_buf_addr = bf->bf_dmacontext = | 191 | bf->bf_buf_addr = bf->bf_dmacontext = |
192 | pci_map_single(sc->pdev, skb->data, | 192 | pci_map_single(sc->pdev, skb->data, |
193 | skb_end_pointer(skb) - skb->head, | 193 | skb->len, |
194 | PCI_DMA_TODEVICE); | 194 | PCI_DMA_TODEVICE); |
195 | 195 | ||
196 | skb = ieee80211_get_buffered_bc(sc->hw, vif); | 196 | skb = ieee80211_get_buffered_bc(sc->hw, vif); |
@@ -338,7 +338,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
338 | if (bf->bf_mpdu != NULL) { | 338 | if (bf->bf_mpdu != NULL) { |
339 | skb = (struct sk_buff *)bf->bf_mpdu; | 339 | skb = (struct sk_buff *)bf->bf_mpdu; |
340 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, | 340 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, |
341 | skb_end_pointer(skb) - skb->head, | 341 | skb->len, |
342 | PCI_DMA_TODEVICE); | 342 | PCI_DMA_TODEVICE); |
343 | dev_kfree_skb_any(skb); | 343 | dev_kfree_skb_any(skb); |
344 | bf->bf_mpdu = NULL; | 344 | bf->bf_mpdu = NULL; |
@@ -398,7 +398,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
398 | 398 | ||
399 | bf->bf_buf_addr = bf->bf_dmacontext = | 399 | bf->bf_buf_addr = bf->bf_dmacontext = |
400 | pci_map_single(sc->pdev, skb->data, | 400 | pci_map_single(sc->pdev, skb->data, |
401 | skb_end_pointer(skb) - skb->head, | 401 | skb->len, |
402 | PCI_DMA_TODEVICE); | 402 | PCI_DMA_TODEVICE); |
403 | bf->bf_mpdu = skb; | 403 | bf->bf_mpdu = skb; |
404 | 404 | ||
@@ -419,7 +419,7 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp) | |||
419 | if (bf->bf_mpdu != NULL) { | 419 | if (bf->bf_mpdu != NULL) { |
420 | struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; | 420 | struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; |
421 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, | 421 | pci_unmap_single(sc->pdev, bf->bf_dmacontext, |
422 | skb_end_pointer(skb) - skb->head, | 422 | skb->len, |
423 | PCI_DMA_TODEVICE); | 423 | PCI_DMA_TODEVICE); |
424 | dev_kfree_skb_any(skb); | 424 | dev_kfree_skb_any(skb); |
425 | bf->bf_mpdu = NULL; | 425 | bf->bf_mpdu = NULL; |
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, |