staging: brcm80211: move dma specific macros from osl to dma code
authorBrett Rudley <brudley@broadcom.com>
Sat, 4 Dec 2010 02:00:24 +0000 (18:00 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Dec 2010 00:07:33 +0000 (16:07 -0800)
Signed-off-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/include/bcmutils.h
drivers/staging/brcm80211/include/osl.h
drivers/staging/brcm80211/util/hnddma.c
drivers/staging/brcm80211/util/siutils.c

index e673dfd216224eec1ce73950076d81db1dfb1119..3628fd6a997bc79b0d2047e2b25c974b01c5260d 100644 (file)
@@ -361,6 +361,14 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
 #define CEIL(x, y)             (((x) + ((y)-1)) / (y))
 #define        ISPOWEROF2(x)           ((((x)-1)&(x)) == 0)
 
+/* map physical to virtual I/O */
+#if !defined(CONFIG_MMC_MSM7X00A)
+#define REG_MAP(pa, size)       ioremap_nocache((unsigned long)(pa), \
+                                       (unsigned long)(size))
+#else
+#define REG_MAP(pa, size)       (void *)(0)
+#endif
+
 /* bit map related macros */
 #ifndef setbit
 #ifndef NBBY                   /* the BSD family defines NBBY */
index 4e7d07e3878290096d64014a75957301ba3dce8e..b066f14734686d7c9092448c9f6542c294959b0c 100644 (file)
@@ -219,29 +219,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
 
 #define        bcopy(src, dst, len)    memcpy((dst), (src), (len))
 
-/* uncached/cached virtual address */
-#ifdef __mips__
-#include <asm/addrspace.h>
-#define OSL_UNCACHED(va)       ((void *)KSEG1ADDR((va)))
-#define OSL_CACHED(va)         ((void *)KSEG0ADDR((va)))
-#else
-#define OSL_UNCACHED(va)       ((void *)va)
-#define OSL_CACHED(va)         ((void *)va)
-#endif                         /* mips */
-
-/* map/unmap physical to virtual I/O */
-#if !defined(CONFIG_MMC_MSM7X00A)
-#define        REG_MAP(pa, size)       ioremap_nocache((unsigned long)(pa), \
-                                       (unsigned long)(size))
-#else
-#define REG_MAP(pa, size)       (void *)(0)
-#endif                         /* !defined(CONFIG_MMC_MSM7X00A */
-#define        REG_UNMAP(va)           iounmap((va))
-
-#define        R_SM(r)                 (*(r))
-#define        W_SM(r, v)              (*(r) = (v))
-#define        BZERO_SM(r, len)        memset((r), '\0', (len))
-
 /* packet primitives */
 #define        PKTGET(osh, len, send)  osl_pktget((osh), (len))
 #define        PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send))
index 996998d805e06a3edddeccbc5c40377fb512cb82..0c8a1d25d98bac6431c8718f303c371d6ed8aa6c 100644 (file)
 #include <sbhnddma.h>
 #include <hnddma.h>
 
+#if defined(__mips__)
+#include <asm/addrspace.h>
+#endif
+
 /* debug/trace */
 #ifdef BCMDBG
 #define        DMA_ERROR(args) \
@@ -69,6 +73,9 @@ static uint dma_msg_level;
 
 #define        DI_INFO(dmah)   ((dma_info_t *)dmah)
 
+#define R_SM(r)                (*(r))
+#define W_SM(r, v)     (*(r) = (v))
+
 /* dma engine software state */
 typedef struct dma_info {
        struct hnddma_pub hnddma;       /* exported structure, don't use hnddma_t,
@@ -903,7 +910,7 @@ static void _dma_rxinit(dma_info_t *di)
 
        /* clear rx descriptor ring */
        if (DMA64_ENAB(di) && DMA64_MODE(di)) {
-               BZERO_SM((void *)di->rxd64,
+               memset((void *)di->rxd64, '\0',
                         (di->nrxd * sizeof(dma64dd_t)));
 
                /* DMA engine with out alignment requirement requires table to be inited
@@ -917,7 +924,7 @@ static void _dma_rxinit(dma_info_t *di)
                if (di->aligndesc_4k)
                        _dma_ddtable_init(di, DMA_RX, di->rxdpa);
        } else if (DMA32_ENAB(di)) {
-               BZERO_SM((void *)di->rxd32,
+               memset((void *)di->rxd32, '\0',
                         (di->nrxd * sizeof(dma32dd_t)));
                _dma_rxenable(di);
                _dma_ddtable_init(di, DMA_RX, di->rxdpa);
@@ -993,6 +1000,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di)
        DMA_TRACE(("%s: dma_rx len %d\n", di->name, len));
 
 #if defined(__mips__)
+#define OSL_UNCACHED(va)        ((void *)KSEG1ADDR((va)))
        if (!len) {
                while (!(len = *(u16 *) OSL_UNCACHED(head->data)))
                        udelay(1);
@@ -1436,7 +1444,7 @@ static void dma32_txinit(dma_info_t *di)
        di->hnddma.txavail = di->ntxd - 1;
 
        /* clear tx descriptor ring */
-       BZERO_SM((void *)di->txd32, (di->ntxd * sizeof(dma32dd_t)));
+       memset((void *)di->txd32, '\0', (di->ntxd * sizeof(dma32dd_t)));
 
        if ((di->hnddma.dmactrlflags & DMA_CTRL_PEN) == 0)
                control |= XC_PD;
@@ -1992,7 +2000,7 @@ static void dma64_txinit(dma_info_t *di)
        di->hnddma.txavail = di->ntxd - 1;
 
        /* clear tx descriptor ring */
-       BZERO_SM((void *)di->txd64, (di->ntxd * sizeof(dma64dd_t)));
+       memset((void *)di->txd64, '\0', (di->ntxd * sizeof(dma64dd_t)));
 
        /* DMA engine with out alignment requirement requires table to be inited
         * before enabling the engine
index 59167122943c6a5c1bd5b26511ae59cebb8a16d4..b66de9b35a5a6fdf6b4b0483ed2b11951992d28d 100644 (file)
@@ -710,7 +710,7 @@ void si_detach(si_t *sih)
        if (sih->bustype == SI_BUS)
                for (idx = 0; idx < SI_MAXCORES; idx++)
                        if (sii->regs[idx]) {
-                               REG_UNMAP(sii->regs[idx]);
+                               iounmap(sii->regs[idx]);
                                sii->regs[idx] = NULL;
                        }