summaryrefslogtreecommitdiff
path: root/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index d399b5c76f94..65313fa0cf4a 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -17,8 +17,6 @@
#include <linux/netdevice.h>
#include <bcmdefs.h>
#include <bcmdevs.h>
-#include <bcmendian.h>
-#include <osl.h>
#include <bcmutils.h>
#include <sdio.h> /* SDIO Device and Protocol Specs */
#include <sdioh.h> /* SDIO Host Controller Specification */
@@ -112,7 +110,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
/*
* Public entry points & extern's
*/
-extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq)
+sdioh_info_t *sdioh_attach(void *bar0, uint irq)
{
sdioh_info_t *sd;
int err_ret;
@@ -129,7 +127,6 @@ extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq)
sd_err(("sdioh_attach: out of memory\n"));
return NULL;
}
- sd->osh = osh;
if (sdioh_sdmmc_osinit(sd) != 0) {
sd_err(("%s:sdioh_sdmmc_osinit() failed\n", __func__));
kfree(sd);
@@ -175,7 +172,7 @@ extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq)
return sd;
}
-extern SDIOH_API_RC sdioh_detach(struct osl_info *osh, sdioh_info_t *sd)
+extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
{
sd_trace(("%s\n", __func__));
@@ -441,7 +438,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
val_size = sizeof(int);
if (plen >= (int)sizeof(int_val))
- bcopy(params, &int_val, sizeof(int_val));
+ memcpy(&int_val, params, sizeof(int_val));
bool_val = (int_val != 0) ? true : false;
@@ -449,7 +446,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
switch (actionid) {
case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) sd_msglevel;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_MSGLEVEL):
@@ -458,7 +455,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_BLOCKMODE):
int_val = (s32) si->sd_blockmode;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_BLOCKMODE):
@@ -472,7 +469,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
break;
}
int_val = (s32) si->client_block_size[int_val];
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_BLOCKSIZE):
@@ -514,12 +511,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_RXCHAIN):
int_val = false;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_GVAL(IOV_DMA):
int_val = (s32) si->sd_use_dma;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_DMA):
@@ -528,7 +525,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_USEINTS):
int_val = (s32) si->use_client_ints;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_USEINTS):
@@ -542,7 +539,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_DIVISOR):
int_val = (u32) sd_divisor;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_DIVISOR):
@@ -551,7 +548,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_POWER):
int_val = (u32) sd_power;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_POWER):
@@ -560,7 +557,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_CLOCK):
int_val = (u32) sd_clock;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_CLOCK):
@@ -569,7 +566,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_SDMODE):
int_val = (u32) sd_sdmode;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_SDMODE):
@@ -578,7 +575,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_HISPEED):
int_val = (u32) sd_hiok;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_HISPEED):
@@ -587,12 +584,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_NUMINTS):
int_val = (s32) si->intrcount;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_GVAL(IOV_NUMLOCALINTS):
int_val = (s32) 0;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;
case IOV_GVAL(IOV_HOSTREG):
@@ -621,7 +618,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
int_val = 32; /* sdioh_sdmmc_rreg(si,
sd_ptr->offset); */
- bcopy(&int_val, arg, sizeof(int_val));
+ memcpy(arg, &int_val, sizeof(int_val));
break;
}
@@ -657,7 +654,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
}
int_val = (int)data;
- bcopy(&int_val, arg, sizeof(int_val));
+ memcpy(arg, &int_val, sizeof(int_val));
break;
}
@@ -735,7 +732,7 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
}
/* Only the lower 17-bits are valid */
- scratch = ltoh32(scratch);
+ scratch = le32_to_cpu(scratch);
scratch &= 0x0001FFFF;
return scratch;
}
@@ -1039,7 +1036,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", buflen_u));
- mypkt = pkt_buf_get_skb(sd->osh, buflen_u);
+ mypkt = pkt_buf_get_skb(buflen_u);
if (!mypkt) {
sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
__func__, buflen_u));
@@ -1048,16 +1045,16 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
/* For a write, copy the buffer data into the packet. */
if (write)
- bcopy(buffer, mypkt->data, buflen_u);
+ memcpy(mypkt->data, buffer, buflen_u);
Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
- bcopy(mypkt->data, buffer, buflen_u);
+ memcpy(buffer, mypkt->data, buflen_u);
- pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
+ pkt_buf_free_skb(mypkt);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */
@@ -1066,7 +1063,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", pkt->len));
- mypkt = pkt_buf_get_skb(sd->osh, pkt->len);
+ mypkt = pkt_buf_get_skb(pkt->len);
if (!mypkt) {
sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
__func__, pkt->len));
@@ -1075,16 +1072,16 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
/* For a write, copy the buffer data into the packet. */
if (write)
- bcopy(pkt->data, mypkt->data, pkt->len);
+ memcpy(mypkt->data, pkt->data, pkt->len);
Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
- bcopy(mypkt->data, pkt->data, mypkt->len);
+ memcpy(pkt->data, mypkt->data, mypkt->len);
- pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
+ pkt_buf_free_skb(mypkt);
} else { /* case 3: We have a packet and
it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n",