aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-07-20 13:47:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-22 09:51:11 -0400
commit78c1ee7e61af4eb3f6c8a553ca56036e3734121f (patch)
tree4f4fcfb2be8f0eb508279028b3b450158388fff6 /drivers
parent292b11926fec139c0ff103bc229bc6c079d0862f (diff)
b43: disable parity check on BCMA devices
Analyze of MMIO dumps from BCM43224, BCM43225, BCM4313 and BCM4331 has shown that wl disables parity check for all that cards. This is required for receiving any packets from the hardware. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/b43.h1
-rw-r--r--drivers/net/wireless/b43/dma.c16
-rw-r--r--drivers/net/wireless/b43/dma.h4
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 8cf04597da44..c818b0bc88ec 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -594,6 +594,7 @@ struct b43_dma {
594 struct b43_dmaring *rx_ring; 594 struct b43_dmaring *rx_ring;
595 595
596 u32 translation; /* Routing bits */ 596 u32 translation; /* Routing bits */
597 bool parity; /* Check for parity */
597}; 598};
598 599
599struct b43_pio_txqueue; 600struct b43_pio_txqueue;
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index ce572aebeffd..78c5c82dec8d 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -659,6 +659,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
659 u32 value; 659 u32 value;
660 u32 addrext; 660 u32 addrext;
661 u32 trans = ring->dev->dma.translation; 661 u32 trans = ring->dev->dma.translation;
662 bool parity = ring->dev->dma.parity;
662 663
663 if (ring->tx) { 664 if (ring->tx) {
664 if (ring->type == B43_DMA_64BIT) { 665 if (ring->type == B43_DMA_64BIT) {
@@ -669,6 +670,8 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
669 value = B43_DMA64_TXENABLE; 670 value = B43_DMA64_TXENABLE;
670 value |= (addrext << B43_DMA64_TXADDREXT_SHIFT) 671 value |= (addrext << B43_DMA64_TXADDREXT_SHIFT)
671 & B43_DMA64_TXADDREXT_MASK; 672 & B43_DMA64_TXADDREXT_MASK;
673 if (!parity)
674 value |= B43_DMA64_TXPARITYDISABLE;
672 b43_dma_write(ring, B43_DMA64_TXCTL, value); 675 b43_dma_write(ring, B43_DMA64_TXCTL, value);
673 b43_dma_write(ring, B43_DMA64_TXRINGLO, 676 b43_dma_write(ring, B43_DMA64_TXRINGLO,
674 (ringbase & 0xFFFFFFFF)); 677 (ringbase & 0xFFFFFFFF));
@@ -684,6 +687,8 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
684 value = B43_DMA32_TXENABLE; 687 value = B43_DMA32_TXENABLE;
685 value |= (addrext << B43_DMA32_TXADDREXT_SHIFT) 688 value |= (addrext << B43_DMA32_TXADDREXT_SHIFT)
686 & B43_DMA32_TXADDREXT_MASK; 689 & B43_DMA32_TXADDREXT_MASK;
690 if (!parity)
691 value |= B43_DMA32_TXPARITYDISABLE;
687 b43_dma_write(ring, B43_DMA32_TXCTL, value); 692 b43_dma_write(ring, B43_DMA32_TXCTL, value);
688 b43_dma_write(ring, B43_DMA32_TXRING, 693 b43_dma_write(ring, B43_DMA32_TXRING,
689 (ringbase & ~SSB_DMA_TRANSLATION_MASK) 694 (ringbase & ~SSB_DMA_TRANSLATION_MASK)
@@ -702,6 +707,8 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
702 value |= B43_DMA64_RXENABLE; 707 value |= B43_DMA64_RXENABLE;
703 value |= (addrext << B43_DMA64_RXADDREXT_SHIFT) 708 value |= (addrext << B43_DMA64_RXADDREXT_SHIFT)
704 & B43_DMA64_RXADDREXT_MASK; 709 & B43_DMA64_RXADDREXT_MASK;
710 if (!parity)
711 value |= B43_DMA64_RXPARITYDISABLE;
705 b43_dma_write(ring, B43_DMA64_RXCTL, value); 712 b43_dma_write(ring, B43_DMA64_RXCTL, value);
706 b43_dma_write(ring, B43_DMA64_RXRINGLO, 713 b43_dma_write(ring, B43_DMA64_RXRINGLO,
707 (ringbase & 0xFFFFFFFF)); 714 (ringbase & 0xFFFFFFFF));
@@ -720,6 +727,8 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
720 value |= B43_DMA32_RXENABLE; 727 value |= B43_DMA32_RXENABLE;
721 value |= (addrext << B43_DMA32_RXADDREXT_SHIFT) 728 value |= (addrext << B43_DMA32_RXADDREXT_SHIFT)
722 & B43_DMA32_RXADDREXT_MASK; 729 & B43_DMA32_RXADDREXT_MASK;
730 if (!parity)
731 value |= B43_DMA32_RXPARITYDISABLE;
723 b43_dma_write(ring, B43_DMA32_RXCTL, value); 732 b43_dma_write(ring, B43_DMA32_RXCTL, value);
724 b43_dma_write(ring, B43_DMA32_RXRING, 733 b43_dma_write(ring, B43_DMA32_RXRING,
725 (ringbase & ~SSB_DMA_TRANSLATION_MASK) 734 (ringbase & ~SSB_DMA_TRANSLATION_MASK)
@@ -1064,6 +1073,13 @@ int b43_dma_init(struct b43_wldev *dev)
1064#endif 1073#endif
1065 } 1074 }
1066 1075
1076 dma->parity = true;
1077#ifdef CONFIG_B43_BCMA
1078 /* TODO: find out which SSB devices need disabling parity */
1079 if (dev->dev->bus_type == B43_BUS_BCMA)
1080 dma->parity = false;
1081#endif
1082
1067 err = -ENOMEM; 1083 err = -ENOMEM;
1068 /* setup TX DMA channels. */ 1084 /* setup TX DMA channels. */
1069 dma->tx_ring_AC_BK = b43_setup_dmaring(dev, 0, 1, type); 1085 dma->tx_ring_AC_BK = b43_setup_dmaring(dev, 0, 1, type);
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h
index e8a80a1251bf..cdf87094efe8 100644
--- a/drivers/net/wireless/b43/dma.h
+++ b/drivers/net/wireless/b43/dma.h
@@ -20,6 +20,7 @@
20#define B43_DMA32_TXSUSPEND 0x00000002 20#define B43_DMA32_TXSUSPEND 0x00000002
21#define B43_DMA32_TXLOOPBACK 0x00000004 21#define B43_DMA32_TXLOOPBACK 0x00000004
22#define B43_DMA32_TXFLUSH 0x00000010 22#define B43_DMA32_TXFLUSH 0x00000010
23#define B43_DMA32_TXPARITYDISABLE 0x00000800
23#define B43_DMA32_TXADDREXT_MASK 0x00030000 24#define B43_DMA32_TXADDREXT_MASK 0x00030000
24#define B43_DMA32_TXADDREXT_SHIFT 16 25#define B43_DMA32_TXADDREXT_SHIFT 16
25#define B43_DMA32_TXRING 0x04 26#define B43_DMA32_TXRING 0x04
@@ -44,6 +45,7 @@
44#define B43_DMA32_RXFROFF_MASK 0x000000FE 45#define B43_DMA32_RXFROFF_MASK 0x000000FE
45#define B43_DMA32_RXFROFF_SHIFT 1 46#define B43_DMA32_RXFROFF_SHIFT 1
46#define B43_DMA32_RXDIRECTFIFO 0x00000100 47#define B43_DMA32_RXDIRECTFIFO 0x00000100
48#define B43_DMA32_RXPARITYDISABLE 0x00000800
47#define B43_DMA32_RXADDREXT_MASK 0x00030000 49#define B43_DMA32_RXADDREXT_MASK 0x00030000
48#define B43_DMA32_RXADDREXT_SHIFT 16 50#define B43_DMA32_RXADDREXT_SHIFT 16
49#define B43_DMA32_RXRING 0x14 51#define B43_DMA32_RXRING 0x14
@@ -84,6 +86,7 @@ struct b43_dmadesc32 {
84#define B43_DMA64_TXSUSPEND 0x00000002 86#define B43_DMA64_TXSUSPEND 0x00000002
85#define B43_DMA64_TXLOOPBACK 0x00000004 87#define B43_DMA64_TXLOOPBACK 0x00000004
86#define B43_DMA64_TXFLUSH 0x00000010 88#define B43_DMA64_TXFLUSH 0x00000010
89#define B43_DMA64_TXPARITYDISABLE 0x00000800
87#define B43_DMA64_TXADDREXT_MASK 0x00030000 90#define B43_DMA64_TXADDREXT_MASK 0x00030000
88#define B43_DMA64_TXADDREXT_SHIFT 16 91#define B43_DMA64_TXADDREXT_SHIFT 16
89#define B43_DMA64_TXINDEX 0x04 92#define B43_DMA64_TXINDEX 0x04
@@ -111,6 +114,7 @@ struct b43_dmadesc32 {
111#define B43_DMA64_RXFROFF_MASK 0x000000FE 114#define B43_DMA64_RXFROFF_MASK 0x000000FE
112#define B43_DMA64_RXFROFF_SHIFT 1 115#define B43_DMA64_RXFROFF_SHIFT 1
113#define B43_DMA64_RXDIRECTFIFO 0x00000100 116#define B43_DMA64_RXDIRECTFIFO 0x00000100
117#define B43_DMA64_RXPARITYDISABLE 0x00000800
114#define B43_DMA64_RXADDREXT_MASK 0x00030000 118#define B43_DMA64_RXADDREXT_MASK 0x00030000
115#define B43_DMA64_RXADDREXT_SHIFT 16 119#define B43_DMA64_RXADDREXT_SHIFT 16
116#define B43_DMA64_RXINDEX 0x24 120#define B43_DMA64_RXINDEX 0x24