diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-02-19 23:39:26 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:47 -0500 |
commit | 8eccb53f1b858c9bd0b745f839174725b76508ec (patch) | |
tree | 434ed31a9409936670c1c06f867ad541a08f2e2d /drivers/net/wireless/b43/dma.c | |
parent | ca2d559e1a41d62a5b49fb9ab513025ea27f1e7c (diff) | |
download | kernel_samsung_smdk4412-8eccb53f1b858c9bd0b745f839174725b76508ec.tar.gz kernel_samsung_smdk4412-8eccb53f1b858c9bd0b745f839174725b76508ec.tar.bz2 kernel_samsung_smdk4412-8eccb53f1b858c9bd0b745f839174725b76508ec.zip |
b43: Fix DMA buffer size handling
This fixes hidden bugs in the size handling of the DMA buffers.
This sets the RX buffer size to the theoretical max packet size and
fixes passing of the size values to the device (must not subtract the header offset).
These bugs are hidden and don't actually trigger due to the magic +100
offset for the buffer size.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/dma.c')
-rw-r--r-- | drivers/net/wireless/b43/dma.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 0f021c666d0..38246046a42 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c @@ -74,8 +74,7 @@ static void op32_fill_descriptor(struct b43_dmaring *ring, addrext = (u32) (dmaaddr & SSB_DMA_TRANSLATION_MASK) >> SSB_DMA_TRANSLATION_SHIFT; addr |= ssb_dma_translation(ring->dev->dev); - ctl = (bufsize - ring->frameoffset) - & B43_DMA32_DCTL_BYTECNT; + ctl = bufsize & B43_DMA32_DCTL_BYTECNT; if (slot == ring->nr_slots - 1) ctl |= B43_DMA32_DCTL_DTABLEEND; if (start) @@ -177,8 +176,7 @@ static void op64_fill_descriptor(struct b43_dmaring *ring, ctl0 |= B43_DMA64_DCTL0_FRAMEEND; if (irq) ctl0 |= B43_DMA64_DCTL0_IRQ; - ctl1 |= (bufsize - ring->frameoffset) - & B43_DMA64_DCTL1_BYTECNT; + ctl1 |= bufsize & B43_DMA64_DCTL1_BYTECNT; ctl1 |= (addrext << B43_DMA64_DCTL1_ADDREXT_SHIFT) & B43_DMA64_DCTL1_ADDREXT_MASK; @@ -830,9 +828,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, if (ring->index == 0) { ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE; ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET; - } else if (ring->index == 3) { - ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE; - ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET; } else B43_WARN_ON(1); } |