b43legacy: dma: cache translation (routing bits)
authorRafał Miłecki <zajec5@gmail.com>
Thu, 21 Jul 2011 22:25:00 +0000 (00:25 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 22 Jul 2011 14:47:10 +0000 (10:47 -0400)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43legacy/b43legacy.h
drivers/net/wireless/b43legacy/dma.c

index 23583be1ee0b797d2999babc53bbc719e2c4569d..17a130d18dc9a70c33dc1a5150c14a721ab98d85 100644 (file)
@@ -532,6 +532,8 @@ struct b43legacy_dma {
 
        struct b43legacy_dmaring *rx_ring0;
        struct b43legacy_dmaring *rx_ring3; /* only on core.rev < 5 */
+
+       u32 translation; /* Routing bits */
 };
 
 /* Data structures for PIO transmission, per 80211 core. */
index c33934ad6cd2fbb80b3e1c60ba7bc24a60e305bc..704ee62101bd31b31ba2c79d380d6370e694f058 100644 (file)
@@ -73,7 +73,7 @@ static void op32_fill_descriptor(struct b43legacy_dmaring *ring,
        addr = (u32)(dmaaddr & ~SSB_DMA_TRANSLATION_MASK);
        addrext = (u32)(dmaaddr & SSB_DMA_TRANSLATION_MASK)
                   >> SSB_DMA_TRANSLATION_SHIFT;
-       addr |= ssb_dma_translation(ring->dev->dev);
+       addr |= ring->dev->dma.translation;
        ctl = (bufsize - ring->frameoffset)
              & B43legacy_DMA32_DCTL_BYTECNT;
        if (slot == ring->nr_slots - 1)
@@ -175,7 +175,7 @@ static void op64_fill_descriptor(struct b43legacy_dmaring *ring,
        addrhi = (((u64)dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
        addrext = (((u64)dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
                  >> SSB_DMA_TRANSLATION_SHIFT;
-       addrhi |= ssb_dma_translation(ring->dev->dev);
+       addrhi |= ring->dev->dma.translation;
        if (slot == ring->nr_slots - 1)
                ctl0 |= B43legacy_DMA64_DCTL0_DTABLEEND;
        if (start)
@@ -709,7 +709,7 @@ static int dmacontroller_setup(struct b43legacy_dmaring *ring)
        int err = 0;
        u32 value;
        u32 addrext;
-       u32 trans = ssb_dma_translation(ring->dev->dev);
+       u32 trans = ring->dev->dma.translation;
 
        if (ring->tx) {
                if (ring->type == B43legacy_DMA_64BIT) {
@@ -1093,6 +1093,7 @@ int b43legacy_dma_init(struct b43legacy_wldev *dev)
                return -EOPNOTSUPP;
 #endif
        }
+       dma->translation = ssb_dma_translation(dev->dev);
 
        err = -ENOMEM;
        /* setup TX DMA channels. */