Commit 8968af14 authored by Brett Rudley's avatar Brett Rudley Committed by Greg Kroah-Hartman

staging: brcm80211: move dma specific macros from osl to dma code

Signed-off-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 411ee44a
......@@ -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 */
......
......@@ -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))
......
......@@ -29,6 +29,10 @@
#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
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment