diff options
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/dma.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/b43/dma.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 43 |
3 files changed, 40 insertions, 26 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 523355b87659..f7c70b3a6ea9 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -1728,6 +1728,25 @@ drop_recycle_buffer: | |||
1728 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); | 1728 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | void b43_dma_handle_rx_overflow(struct b43_dmaring *ring) | ||
1732 | { | ||
1733 | int current_slot, previous_slot; | ||
1734 | |||
1735 | B43_WARN_ON(ring->tx); | ||
1736 | |||
1737 | /* Device has filled all buffers, drop all packets and let TCP | ||
1738 | * decrease speed. | ||
1739 | * Decrement RX index by one will let the device to see all slots | ||
1740 | * as free again | ||
1741 | */ | ||
1742 | /* | ||
1743 | *TODO: How to increase rx_drop in mac80211? | ||
1744 | */ | ||
1745 | current_slot = ring->ops->get_current_rxslot(ring); | ||
1746 | previous_slot = prev_slot(ring, current_slot); | ||
1747 | ring->ops->set_current_rxslot(ring, previous_slot); | ||
1748 | } | ||
1749 | |||
1731 | void b43_dma_rx(struct b43_dmaring *ring) | 1750 | void b43_dma_rx(struct b43_dmaring *ring) |
1732 | { | 1751 | { |
1733 | const struct b43_dma_ops *ops = ring->ops; | 1752 | const struct b43_dma_ops *ops = ring->ops; |
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h index 9fdd1983079c..df8c8cdcbdb5 100644 --- a/drivers/net/wireless/b43/dma.h +++ b/drivers/net/wireless/b43/dma.h | |||
@@ -9,7 +9,7 @@ | |||
9 | /* DMA-Interrupt reasons. */ | 9 | /* DMA-Interrupt reasons. */ |
10 | #define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \ | 10 | #define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \ |
11 | | (1 << 14) | (1 << 15)) | 11 | | (1 << 14) | (1 << 15)) |
12 | #define B43_DMAIRQ_NONFATALMASK (1 << 13) | 12 | #define B43_DMAIRQ_RDESC_UFLOW (1 << 13) |
13 | #define B43_DMAIRQ_RX_DONE (1 << 16) | 13 | #define B43_DMAIRQ_RX_DONE (1 << 16) |
14 | 14 | ||
15 | /*** 32-bit DMA Engine. ***/ | 15 | /*** 32-bit DMA Engine. ***/ |
@@ -295,6 +295,8 @@ int b43_dma_tx(struct b43_wldev *dev, | |||
295 | void b43_dma_handle_txstatus(struct b43_wldev *dev, | 295 | void b43_dma_handle_txstatus(struct b43_wldev *dev, |
296 | const struct b43_txstatus *status); | 296 | const struct b43_txstatus *status); |
297 | 297 | ||
298 | void b43_dma_handle_rx_overflow(struct b43_dmaring *ring); | ||
299 | |||
298 | void b43_dma_rx(struct b43_dmaring *ring); | 300 | void b43_dma_rx(struct b43_dmaring *ring); |
299 | 301 | ||
300 | void b43_dma_direct_fifo_rx(struct b43_wldev *dev, | 302 | void b43_dma_direct_fifo_rx(struct b43_wldev *dev, |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d377f77d30b5..6dd07e2ec595 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1902,30 +1902,18 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev) | |||
1902 | } | 1902 | } |
1903 | } | 1903 | } |
1904 | 1904 | ||
1905 | if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK | | 1905 | if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK))) { |
1906 | B43_DMAIRQ_NONFATALMASK))) { | 1906 | b43err(dev->wl, |
1907 | if (merged_dma_reason & B43_DMAIRQ_FATALMASK) { | 1907 | "Fatal DMA error: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X\n", |
1908 | b43err(dev->wl, "Fatal DMA error: " | 1908 | dma_reason[0], dma_reason[1], |
1909 | "0x%08X, 0x%08X, 0x%08X, " | 1909 | dma_reason[2], dma_reason[3], |
1910 | "0x%08X, 0x%08X, 0x%08X\n", | 1910 | dma_reason[4], dma_reason[5]); |
1911 | dma_reason[0], dma_reason[1], | 1911 | b43err(dev->wl, "This device does not support DMA " |
1912 | dma_reason[2], dma_reason[3], | ||
1913 | dma_reason[4], dma_reason[5]); | ||
1914 | b43err(dev->wl, "This device does not support DMA " | ||
1915 | "on your system. It will now be switched to PIO.\n"); | 1912 | "on your system. It will now be switched to PIO.\n"); |
1916 | /* Fall back to PIO transfers if we get fatal DMA errors! */ | 1913 | /* Fall back to PIO transfers if we get fatal DMA errors! */ |
1917 | dev->use_pio = true; | 1914 | dev->use_pio = true; |
1918 | b43_controller_restart(dev, "DMA error"); | 1915 | b43_controller_restart(dev, "DMA error"); |
1919 | return; | 1916 | return; |
1920 | } | ||
1921 | if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { | ||
1922 | b43err(dev->wl, "DMA error: " | ||
1923 | "0x%08X, 0x%08X, 0x%08X, " | ||
1924 | "0x%08X, 0x%08X, 0x%08X\n", | ||
1925 | dma_reason[0], dma_reason[1], | ||
1926 | dma_reason[2], dma_reason[3], | ||
1927 | dma_reason[4], dma_reason[5]); | ||
1928 | } | ||
1929 | } | 1917 | } |
1930 | 1918 | ||
1931 | if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) | 1919 | if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) |
@@ -1944,6 +1932,11 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev) | |||
1944 | handle_irq_noise(dev); | 1932 | handle_irq_noise(dev); |
1945 | 1933 | ||
1946 | /* Check the DMA reason registers for received data. */ | 1934 | /* Check the DMA reason registers for received data. */ |
1935 | if (dma_reason[0] & B43_DMAIRQ_RDESC_UFLOW) { | ||
1936 | if (B43_DEBUG) | ||
1937 | b43warn(dev->wl, "RX descriptor underrun\n"); | ||
1938 | b43_dma_handle_rx_overflow(dev->dma.rx_ring); | ||
1939 | } | ||
1947 | if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { | 1940 | if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { |
1948 | if (b43_using_pio_transfers(dev)) | 1941 | if (b43_using_pio_transfers(dev)) |
1949 | b43_pio_rx(dev->pio.rx_queue); | 1942 | b43_pio_rx(dev->pio.rx_queue); |
@@ -2001,7 +1994,7 @@ static irqreturn_t b43_do_interrupt(struct b43_wldev *dev) | |||
2001 | return IRQ_NONE; | 1994 | return IRQ_NONE; |
2002 | 1995 | ||
2003 | dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) | 1996 | dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) |
2004 | & 0x0001DC00; | 1997 | & 0x0001FC00; |
2005 | dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) | 1998 | dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) |
2006 | & 0x0000DC00; | 1999 | & 0x0000DC00; |
2007 | dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) | 2000 | dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) |
@@ -3130,7 +3123,7 @@ static int b43_chip_init(struct b43_wldev *dev) | |||
3130 | b43_write32(dev, 0x018C, 0x02000000); | 3123 | b43_write32(dev, 0x018C, 0x02000000); |
3131 | } | 3124 | } |
3132 | b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); | 3125 | b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); |
3133 | b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001DC00); | 3126 | b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001FC00); |
3134 | b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); | 3127 | b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); |
3135 | b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); | 3128 | b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); |
3136 | b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); | 3129 | b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); |