]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
brcmsmac: fix DMA on SoCs
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 30 Jun 2012 13:16:18 +0000 (15:16 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Jul 2012 16:16:55 +0000 (12:16 -0400)
These extra offsets are only needed by PCIe devices and not when
running on an SoC.

This partly reverts commit:
commit 821e4e93172e4f7d5ac1eade04665c3dc5049c4a
Author: Roland Vossen <rvossen@broadcom.com>
Date:   Mon Aug 8 15:58:58 2011 +0200

    staging: brcm80211: removed unused bus code from softmac

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/dma.c

index b67b20c957123a428d2b820cd8e8602995f2aac2..f64c5cf3fccc02f54fd3ceb3753563a3548e2e35 100644 (file)
@@ -573,6 +573,7 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
        struct dma_info *di;
        u8 rev = core->id.rev;
        uint size;
+       struct si_info *sii = container_of(sih, struct si_info, pub);
 
        /* allocate private info structure */
        di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC);
@@ -633,11 +634,15 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
         */
        di->ddoffsetlow = 0;
        di->dataoffsetlow = 0;
-       /* add offset for pcie with DMA64 bus */
-       di->ddoffsetlow = 0;
-       di->ddoffsethigh = SI_PCIE_DMA_H32;
+       /* for pci bus, add offset */
+       if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) {
+               /* add offset for pcie with DMA64 bus */
+               di->ddoffsetlow = 0;
+               di->ddoffsethigh = SI_PCIE_DMA_H32;
+       }
        di->dataoffsetlow = di->ddoffsetlow;
        di->dataoffsethigh = di->ddoffsethigh;
+
        /* WAR64450 : DMACtl.Addr ext fields are not supported in SDIOD core. */
        if ((core->id.id == BCMA_CORE_SDIO_DEV)
            && ((rev > 0) && (rev <= 2)))