b43: read correct register on bcma bus.
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 23 Jul 2011 11:57:33 +0000 (13:57 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 9 Aug 2011 20:11:31 +0000 (16:11 -0400)
This causes an databus error on a Broadcom SoC using bcma.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/dma.c

index 83cba22..481e534 100644 (file)
@@ -795,9 +795,23 @@ static u64 supported_dma_mask(struct b43_wldev *dev)
        u32 tmp;
        u16 mmio_base;
 
-       tmp = b43_read32(dev, SSB_TMSHIGH);
-       if (tmp & SSB_TMSHIGH_DMA64)
-               return DMA_BIT_MASK(64);
+       switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+       case B43_BUS_BCMA:
+               tmp = bcma_aread32(dev->dev->bdev, BCMA_IOST);
+               if (tmp & BCMA_IOST_DMA64)
+                       return DMA_BIT_MASK(64);
+               break;
+#endif
+#ifdef CONFIG_B43_SSB
+       case B43_BUS_SSB:
+               tmp = ssb_read32(dev->dev->sdev, SSB_TMSHIGH);
+               if (tmp & SSB_TMSHIGH_DMA64)
+                       return DMA_BIT_MASK(64);
+               break;
+#endif
+       }
+
        mmio_base = b43_dmacontroller_base(0, 0);
        b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK);
        tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL);