]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: brcm80211: Remove abstractions for pci_(un)map_single
authorBrett Rudley <brudley@broadcom.com>
Fri, 25 Feb 2011 15:39:09 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 1 Mar 2011 02:13:36 +0000 (18:13 -0800)
The driver had abstracted DMA mapping functions. As abstraction
is not required for the linux driver, these have been removed
and replaced by native linux functions.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/include/osl.h
drivers/staging/brcm80211/util/hnddma.c
drivers/staging/brcm80211/util/linux_osl.c

index 17fc274ef240524ee8471f726d2e0cb0bc2bab86..49015bdc6536e34904a63f4872267b659b86e1ab 100644 (file)
@@ -70,16 +70,6 @@ extern void osl_dma_free_consistent(struct osl_info *osh, void *va,
 #define        DMA_TX  1               /* TX direction for DMA */
 #define        DMA_RX  2               /* RX direction for DMA */
 
-/* map/unmap shared (dma-able) memory */
-#define        DMA_MAP(osh, va, size, direction, p, dmah) \
-       osl_dma_map((osh), (va), (size), (direction))
-#define        DMA_UNMAP(osh, pa, size, direction, p, dmah) \
-       osl_dma_unmap((osh), (pa), (size), (direction))
-extern uint osl_dma_map(struct osl_info *osh, void *va, uint size,
-                       int direction);
-extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
-                         int direction);
-
 /* register access macros */
 #if defined(BCMSDIO)
 #ifdef BRCM_FULLMAC
index 66ebdfdf6cd4dc4262448e1435a06d55a194d055..bd701fc64598e4d3fb202c967f2090ea7ab6bfae 100644 (file)
@@ -76,7 +76,7 @@ typedef struct dma_info {
        uint *msg_level;        /* message level pointer */
        char name[MAXNAMEL];    /* callers name for diag msgs */
 
-       void *osh;              /* os handle */
+       struct osl_info *osh;   /* os handle */
        si_t *sih;              /* sb handle */
 
        bool dma64;             /* this dma engine is operating in 64-bit mode */
@@ -866,8 +866,8 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di)
                        memset(&di->rxp_dmah[rxout], 0,
                                sizeof(hnddma_seg_map_t));
 
-               pa = DMA_MAP(di->osh, p->data,
-                            di->rxbufsize, DMA_RX, p, &di->rxp_dmah[rxout]);
+               pa = pci_map_single(di->osh->pdev, p->data,
+                       di->rxbufsize, PCI_DMA_FROMDEVICE);
 
                ASSERT(IS_ALIGNED(PHYSADDRLO(pa), 4));
 
@@ -1383,7 +1383,7 @@ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit)
        if (len == 0)
                return 0;
 
-       pa = DMA_MAP(di->osh, buf, len, DMA_TX, NULL, &di->txp_dmah[txout]);
+       pa = pci_map_single(di->osh->pdev, buf, len, PCI_DMA_TODEVICE);
 
        flags = (D64_CTRL1_SOF | D64_CTRL1_IOC | D64_CTRL1_EOF);
 
@@ -1463,8 +1463,7 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0,
                        memset(&di->txp_dmah[txout], 0,
                                sizeof(hnddma_seg_map_t));
 
-               pa = DMA_MAP(di->osh, data, len, DMA_TX, p,
-                            &di->txp_dmah[txout]);
+               pa = pci_map_single(di->osh->pdev, data, len, PCI_DMA_TODEVICE);
 
                if (DMASGLIST_ENAB) {
                        map = &di->txp_dmah[txout];
@@ -1626,7 +1625,7 @@ static void *BCMFASTPATH dma64_getnexttxp(dma_info_t *di, txd_range_t range)
                                i = NEXTTXD(i);
                }
 
-               DMA_UNMAP(di->osh, pa, size, DMA_TX, txp, map);
+               pci_unmap_single(di->osh->pdev, pa, size, PCI_DMA_TODEVICE);
        }
 
        di->txin = i;
@@ -1677,7 +1676,7 @@ static void *BCMFASTPATH dma64_getnextrxp(dma_info_t *di, bool forceall)
                       di->dataoffsethigh));
 
        /* clear this packet from the descriptor ring */
-       DMA_UNMAP(di->osh, pa, di->rxbufsize, DMA_RX, rxp, &di->rxp_dmah[i]);
+       pci_unmap_single(di->osh->pdev, pa, di->rxbufsize, PCI_DMA_FROMDEVICE);
 
        W_SM(&di->rxd64[i].addrlow, 0xdeadbeef);
        W_SM(&di->rxd64[i].addrhigh, 0xdeadbeef);
index d7c3c3f9dd8198990359fbddb08a7a93fd0d62f6..c0b06f95b48ad572b927daf534b2b0fb1b406a17 100644 (file)
@@ -161,26 +161,6 @@ void osl_dma_free_consistent(struct osl_info *osh, void *va, uint size,
        pci_free_consistent(osh->pdev, size, va, (dma_addr_t) pa);
 }
 
-uint BCMFASTPATH osl_dma_map(struct osl_info *osh, void *va, uint size,
-                            int direction)
-{
-       int dir;
-
-       ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
-       dir = (direction == DMA_TX) ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE;
-       return pci_map_single(osh->pdev, va, size, dir);
-}
-
-void BCMFASTPATH osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
-                              int direction)
-{
-       int dir;
-
-       ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
-       dir = (direction == DMA_TX) ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE;
-       pci_unmap_single(osh->pdev, (u32) pa, size, dir);
-}
-
 #if defined(BCMDBG_ASSERT)
 void osl_assert(char *exp, char *file, int line)
 {