提交 02160695 编写于 作者: S Stanislav Fomichev 提交者: Greg Kroah-Hartman

staging: brcm80211: replace bcopy with memcpy

Use native linux memcpy instead of legacy bcopy
Signed-off-by: NStanislav Fomichev <kernel@fomichev.me>
Reviewed-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 70de655c
...@@ -324,7 +324,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length) ...@@ -324,7 +324,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
BCMSDH_ERROR(("%s: out of memory\n", __func__)); BCMSDH_ERROR(("%s: out of memory\n", __func__));
return BCME_NOMEM; return BCME_NOMEM;
} }
bcopy(cis, tmp_buf, length); memcpy(tmp_buf, cis, length);
for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4); for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4);
tmp_ptr++) { tmp_ptr++) {
ptr += sprintf((char *)ptr, "%.2x ", *tmp_ptr & 0xff); ptr += sprintf((char *)ptr, "%.2x ", *tmp_ptr & 0xff);
......
...@@ -441,7 +441,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -441,7 +441,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
val_size = sizeof(int); val_size = sizeof(int);
if (plen >= (int)sizeof(int_val)) 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; bool_val = (int_val != 0) ? true : false;
...@@ -449,7 +449,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -449,7 +449,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
switch (actionid) { switch (actionid) {
case IOV_GVAL(IOV_MSGLEVEL): case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) sd_msglevel; int_val = (s32) sd_msglevel;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_MSGLEVEL): case IOV_SVAL(IOV_MSGLEVEL):
...@@ -458,7 +458,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -458,7 +458,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_BLOCKMODE): case IOV_GVAL(IOV_BLOCKMODE):
int_val = (s32) si->sd_blockmode; int_val = (s32) si->sd_blockmode;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_BLOCKMODE): case IOV_SVAL(IOV_BLOCKMODE):
...@@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
break; break;
} }
int_val = (s32) si->client_block_size[int_val]; int_val = (s32) si->client_block_size[int_val];
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_BLOCKSIZE): case IOV_SVAL(IOV_BLOCKSIZE):
...@@ -514,12 +514,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -514,12 +514,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_RXCHAIN): case IOV_GVAL(IOV_RXCHAIN):
int_val = false; int_val = false;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_DMA): case IOV_GVAL(IOV_DMA):
int_val = (s32) si->sd_use_dma; int_val = (s32) si->sd_use_dma;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_DMA): case IOV_SVAL(IOV_DMA):
...@@ -528,7 +528,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -528,7 +528,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_USEINTS): case IOV_GVAL(IOV_USEINTS):
int_val = (s32) si->use_client_ints; int_val = (s32) si->use_client_ints;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_USEINTS): case IOV_SVAL(IOV_USEINTS):
...@@ -542,7 +542,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -542,7 +542,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_DIVISOR): case IOV_GVAL(IOV_DIVISOR):
int_val = (u32) sd_divisor; int_val = (u32) sd_divisor;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_DIVISOR): case IOV_SVAL(IOV_DIVISOR):
...@@ -551,7 +551,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -551,7 +551,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_POWER): case IOV_GVAL(IOV_POWER):
int_val = (u32) sd_power; int_val = (u32) sd_power;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_POWER): case IOV_SVAL(IOV_POWER):
...@@ -560,7 +560,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -560,7 +560,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_CLOCK): case IOV_GVAL(IOV_CLOCK):
int_val = (u32) sd_clock; int_val = (u32) sd_clock;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_CLOCK): case IOV_SVAL(IOV_CLOCK):
...@@ -569,7 +569,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -569,7 +569,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_SDMODE): case IOV_GVAL(IOV_SDMODE):
int_val = (u32) sd_sdmode; int_val = (u32) sd_sdmode;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_SDMODE): case IOV_SVAL(IOV_SDMODE):
...@@ -578,7 +578,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -578,7 +578,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_HISPEED): case IOV_GVAL(IOV_HISPEED):
int_val = (u32) sd_hiok; int_val = (u32) sd_hiok;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_HISPEED): case IOV_SVAL(IOV_HISPEED):
...@@ -587,12 +587,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -587,12 +587,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_NUMINTS): case IOV_GVAL(IOV_NUMINTS):
int_val = (s32) si->intrcount; int_val = (s32) si->intrcount;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_NUMLOCALINTS): case IOV_GVAL(IOV_NUMLOCALINTS):
int_val = (s32) 0; int_val = (s32) 0;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_HOSTREG): case IOV_GVAL(IOV_HOSTREG):
...@@ -621,7 +621,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -621,7 +621,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
int_val = 32; /* sdioh_sdmmc_rreg(si, int_val = 32; /* sdioh_sdmmc_rreg(si,
sd_ptr->offset); */ sd_ptr->offset); */
bcopy(&int_val, arg, sizeof(int_val)); memcpy(arg, &int_val, sizeof(int_val));
break; break;
} }
...@@ -657,7 +657,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -657,7 +657,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
} }
int_val = (int)data; int_val = (int)data;
bcopy(&int_val, arg, sizeof(int_val)); memcpy(arg, &int_val, sizeof(int_val));
break; break;
} }
...@@ -1048,14 +1048,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1048,14 +1048,14 @@ 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. */ /* For a write, copy the buffer data into the packet. */
if (write) if (write)
bcopy(buffer, mypkt->data, buflen_u); memcpy(mypkt->data, buffer, buflen_u);
Status = Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt); sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
/* For a read, copy the packet data back to the buffer. */ /* For a read, copy the packet data back to the buffer. */
if (!write) 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(sd->osh, mypkt, write ? true : false);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) { } else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
...@@ -1075,14 +1075,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1075,14 +1075,14 @@ 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. */ /* For a write, copy the buffer data into the packet. */
if (write) if (write)
bcopy(pkt->data, mypkt->data, pkt->len); memcpy(mypkt->data, pkt->data, pkt->len);
Status = Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt); sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
/* For a read, copy the packet data back to the buffer. */ /* For a read, copy the packet data back to the buffer. */
if (!write) 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(sd->osh, mypkt, write ? true : false);
} else { /* case 3: We have a packet and } else { /* case 3: We have a packet and
......
...@@ -286,7 +286,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len) ...@@ -286,7 +286,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
slen = strlen("wme_dp") + 1; slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int))) if (len >= (int)(slen + sizeof(int)))
bcopy(((char *)buf + slen), &val, sizeof(int)); memcpy(&val, (char *)buf + slen, sizeof(int));
dhd->wme_dp = (u8) ltoh32(val); dhd->wme_dp = (u8) ltoh32(val);
} }
......
...@@ -214,7 +214,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -214,7 +214,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
goto exit; goto exit;
if (plen >= (int)sizeof(int_val)) if (plen >= (int)sizeof(int_val))
bcopy(params, &int_val, sizeof(int_val)); memcpy(&int_val, params, sizeof(int_val));
switch (actionid) { switch (actionid) {
case IOV_GVAL(IOV_VERSION): case IOV_GVAL(IOV_VERSION):
...@@ -224,7 +224,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -224,7 +224,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_MSGLEVEL): case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) dhd_msg_level; int_val = (s32) dhd_msg_level;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_MSGLEVEL): case IOV_SVAL(IOV_MSGLEVEL):
...@@ -239,12 +239,12 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -239,12 +239,12 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_BCMERROR): case IOV_GVAL(IOV_BCMERROR):
int_val = (s32) dhd_pub->bcmerror; int_val = (s32) dhd_pub->bcmerror;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_WDTICK): case IOV_GVAL(IOV_WDTICK):
int_val = (s32) dhd_watchdog_ms; int_val = (s32) dhd_watchdog_ms;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_WDTICK): case IOV_SVAL(IOV_WDTICK):
...@@ -262,7 +262,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -262,7 +262,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
case IOV_GVAL(IOV_DCONSOLE_POLL): case IOV_GVAL(IOV_DCONSOLE_POLL):
int_val = (s32) dhd_console_ms; int_val = (s32) dhd_console_ms;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_DCONSOLE_POLL): case IOV_SVAL(IOV_DCONSOLE_POLL):
...@@ -290,7 +290,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -290,7 +290,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_IOCTLTIMEOUT):{ case IOV_GVAL(IOV_IOCTLTIMEOUT):{
int_val = (s32) dhd_os_get_ioctl_resp_timeout(); int_val = (s32) dhd_os_get_ioctl_resp_timeout();
bcopy(&int_val, arg, sizeof(int_val)); memcpy(arg, &int_val, sizeof(int_val));
break; break;
} }
...@@ -1498,7 +1498,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip) ...@@ -1498,7 +1498,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(bi->length)); (bi->length));
/* /*
if(bi && bi_new) { if(bi && bi_new) {
bcopy(bi, bi_new, results->buflen - memcpy(bi_new, bi, results->buflen -
dtoh32(bi_new->length)); dtoh32(bi_new->length));
results->buflen -= dtoh32(bi_new->length); results->buflen -= dtoh32(bi_new->length);
} }
...@@ -1522,7 +1522,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip) ...@@ -1522,7 +1522,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(wl_bss_info_t *)((unsigned long)bi + (wl_bss_info_t *)((unsigned long)bi +
dtoh32 dtoh32
(bi->length)); (bi->length));
bcopy(bi, bi_new, memcpy(bi_new, bi,
dtoh32 dtoh32
(bi->length)); (bi->length));
bi_new = bi_new =
......
...@@ -149,9 +149,8 @@ int dhd_custom_get_mac_address(unsigned char *buf) ...@@ -149,9 +149,8 @@ int dhd_custom_get_mac_address(unsigned char *buf)
#ifdef EXAMPLE_GET_MAC #ifdef EXAMPLE_GET_MAC
/* EXAMPLE code */ /* EXAMPLE code */
{ {
u8 ea_example[ETH_ALEN] = { u8 ea_example[ETH_ALEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xFF};
{0x00, 0x11, 0x22, 0x33, 0x44, 0xFF} }; memcpy(buf, ea_example, ETH_ALEN);
bcopy((char *)ea_example, buf, ETH_ALEN);
} }
#endif /* EXAMPLE_GET_MAC */ #endif /* EXAMPLE_GET_MAC */
......
...@@ -2167,7 +2167,7 @@ int dhd_bus_start(dhd_pub_t *dhdp) ...@@ -2167,7 +2167,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf, bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
bcopy(iovbuf, dhdp->eventmask, WL_EVENTING_MASK_LEN); memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
setbit(dhdp->eventmask, WLC_E_SET_SSID); setbit(dhdp->eventmask, WLC_E_SET_SSID);
setbit(dhdp->eventmask, WLC_E_PRUNE); setbit(dhdp->eventmask, WLC_E_PRUNE);
......
...@@ -945,7 +945,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, ...@@ -945,7 +945,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
} }
PKTALIGN(osh, new, pkt->len, DHD_SDALIGN); PKTALIGN(osh, new, pkt->len, DHD_SDALIGN);
bcopy(pkt->data, new->data, pkt->len); memcpy(new->data, pkt->data, pkt->len);
if (free_pkt) if (free_pkt)
pkt_buf_free_skb(osh, pkt, true); pkt_buf_free_skb(osh, pkt, true);
/* free the pkt if canned one is not used */ /* free the pkt if canned one is not used */
...@@ -1395,7 +1395,7 @@ int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen) ...@@ -1395,7 +1395,7 @@ int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
dhd_os_sdlock(bus->dhd); dhd_os_sdlock(bus->dhd);
rxlen = bus->rxlen; rxlen = bus->rxlen;
bcopy(bus->rxctl, msg, min(msglen, rxlen)); memcpy(msg, bus->rxctl, min(msglen, rxlen));
bus->rxlen = 0; bus->rxlen = 0;
dhd_os_sdunlock(bus->dhd); dhd_os_sdunlock(bus->dhd);
...@@ -1658,7 +1658,7 @@ static int dhdsdio_pktgen_get(dhd_bus_t *bus, u8 *arg) ...@@ -1658,7 +1658,7 @@ static int dhdsdio_pktgen_get(dhd_bus_t *bus, u8 *arg)
pktgen.mode = bus->pktgen_mode; pktgen.mode = bus->pktgen_mode;
pktgen.stop = bus->pktgen_stop; pktgen.stop = bus->pktgen_stop;
bcopy(&pktgen, arg, sizeof(pktgen)); memcpy(arg, &pktgen, sizeof(pktgen));
return 0; return 0;
} }
...@@ -1668,7 +1668,7 @@ static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg) ...@@ -1668,7 +1668,7 @@ static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg)
dhd_pktgen_t pktgen; dhd_pktgen_t pktgen;
uint oldcnt, oldmode; uint oldcnt, oldmode;
bcopy(arg, &pktgen, sizeof(pktgen)); memcpy(&pktgen, arg, sizeof(pktgen));
if (pktgen.version != DHD_PKTGEN_VERSION) if (pktgen.version != DHD_PKTGEN_VERSION)
return BCME_BADARG; return BCME_BADARG;
...@@ -2094,7 +2094,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len) ...@@ -2094,7 +2094,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
/* Copy the passed variables, which should include the /* Copy the passed variables, which should include the
terminating double-null */ terminating double-null */
bcopy(arg, bus->vars, bus->varsz); memcpy(bus->vars, arg, bus->varsz);
err: err:
return bcmerror; return bcmerror;
} }
...@@ -2117,7 +2117,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2117,7 +2117,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
goto exit; goto exit;
if (plen >= (int)sizeof(int_val)) 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; bool_val = (int_val != 0) ? true : false;
...@@ -2137,7 +2137,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2137,7 +2137,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
bcmerror = dhdsdio_bussleep(bus, bool_val); bcmerror = dhdsdio_bussleep(bus, bool_val);
} else { } else {
int_val = (s32) bus->sleeping; int_val = (s32) bus->sleeping;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
} }
goto exit; goto exit;
} }
...@@ -2151,7 +2151,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2151,7 +2151,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
switch (actionid) { switch (actionid) {
case IOV_GVAL(IOV_INTR): case IOV_GVAL(IOV_INTR):
int_val = (s32) bus->intr; int_val = (s32) bus->intr;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_INTR): case IOV_SVAL(IOV_INTR):
...@@ -2172,7 +2172,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2172,7 +2172,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_POLLRATE): case IOV_GVAL(IOV_POLLRATE):
int_val = (s32) bus->pollrate; int_val = (s32) bus->pollrate;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_POLLRATE): case IOV_SVAL(IOV_POLLRATE):
...@@ -2182,7 +2182,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2182,7 +2182,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_IDLETIME): case IOV_GVAL(IOV_IDLETIME):
int_val = bus->idletime; int_val = bus->idletime;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_IDLETIME): case IOV_SVAL(IOV_IDLETIME):
...@@ -2194,7 +2194,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2194,7 +2194,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_IDLECLOCK): case IOV_GVAL(IOV_IDLECLOCK):
int_val = (s32) bus->idleclock; int_val = (s32) bus->idleclock;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_IDLECLOCK): case IOV_SVAL(IOV_IDLECLOCK):
...@@ -2203,7 +2203,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2203,7 +2203,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_SD1IDLE): case IOV_GVAL(IOV_SD1IDLE):
int_val = (s32) sd1idle; int_val = (s32) sd1idle;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_SD1IDLE): case IOV_SVAL(IOV_SD1IDLE):
...@@ -2222,8 +2222,8 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2222,8 +2222,8 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
ASSERT(plen >= 2 * sizeof(int)); ASSERT(plen >= 2 * sizeof(int));
address = (u32) int_val; address = (u32) int_val;
bcopy((char *)params + sizeof(int_val), &int_val, memcpy(&int_val, (char *)params + sizeof(int_val),
sizeof(int_val)); sizeof(int_val));
size = (uint) int_val; size = (uint) int_val;
/* Do some validation */ /* Do some validation */
...@@ -2266,12 +2266,12 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2266,12 +2266,12 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_MEMSIZE): case IOV_GVAL(IOV_MEMSIZE):
int_val = (s32) bus->ramsize; int_val = (s32) bus->ramsize;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_SDIOD_DRIVE): case IOV_GVAL(IOV_SDIOD_DRIVE):
int_val = (s32) dhd_sdiod_drive_strength; int_val = (s32) dhd_sdiod_drive_strength;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_SDIOD_DRIVE): case IOV_SVAL(IOV_SDIOD_DRIVE):
...@@ -2290,7 +2290,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2290,7 +2290,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_READAHEAD): case IOV_GVAL(IOV_READAHEAD):
int_val = (s32) dhd_readahead; int_val = (s32) dhd_readahead;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_READAHEAD): case IOV_SVAL(IOV_READAHEAD):
...@@ -2301,7 +2301,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2301,7 +2301,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_SDRXCHAIN): case IOV_GVAL(IOV_SDRXCHAIN):
int_val = (s32) bus->use_rxchain; int_val = (s32) bus->use_rxchain;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_SDRXCHAIN): case IOV_SVAL(IOV_SDRXCHAIN):
...@@ -2312,7 +2312,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2312,7 +2312,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
break; break;
case IOV_GVAL(IOV_ALIGNCTL): case IOV_GVAL(IOV_ALIGNCTL):
int_val = (s32) dhd_alignctl; int_val = (s32) dhd_alignctl;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_ALIGNCTL): case IOV_SVAL(IOV_ALIGNCTL):
...@@ -2321,13 +2321,13 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2321,13 +2321,13 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_SDALIGN): case IOV_GVAL(IOV_SDALIGN):
int_val = DHD_SDALIGN; int_val = DHD_SDALIGN;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
case IOV_GVAL(IOV_VARS): case IOV_GVAL(IOV_VARS):
if (bus->varsz < (uint) len) if (bus->varsz < (uint) len)
bcopy(bus->vars, arg, bus->varsz); memcpy(arg, bus->vars, bus->varsz);
else else
bcmerror = BCME_BUFTOOSHORT; bcmerror = BCME_BUFTOOSHORT;
break; break;
...@@ -2346,7 +2346,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2346,7 +2346,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size); int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
if (bcmsdh_regfail(bus->sdh)) if (bcmsdh_regfail(bus->sdh))
bcmerror = BCME_SDIO_ERROR; bcmerror = BCME_SDIO_ERROR;
bcopy(&int_val, arg, sizeof(s32)); memcpy(arg, &int_val, sizeof(s32));
break; break;
} }
...@@ -2372,14 +2372,14 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2372,14 +2372,14 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
sdreg_t sdreg; sdreg_t sdreg;
u32 addr, size; u32 addr, size;
bcopy(params, &sdreg, sizeof(sdreg)); memcpy(&sdreg, params, sizeof(sdreg));
addr = SI_ENUM_BASE + sdreg.offset; addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func; size = sdreg.func;
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size); int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
if (bcmsdh_regfail(bus->sdh)) if (bcmsdh_regfail(bus->sdh))
bcmerror = BCME_SDIO_ERROR; bcmerror = BCME_SDIO_ERROR;
bcopy(&int_val, arg, sizeof(s32)); memcpy(arg, &int_val, sizeof(s32));
break; break;
} }
...@@ -2388,7 +2388,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2388,7 +2388,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
sdreg_t sdreg; sdreg_t sdreg;
u32 addr, size; u32 addr, size;
bcopy(params, &sdreg, sizeof(sdreg)); memcpy(&sdreg, params, sizeof(sdreg));
addr = SI_ENUM_BASE + sdreg.offset; addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func; size = sdreg.func;
...@@ -2419,7 +2419,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2419,7 +2419,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_FORCEEVEN): case IOV_GVAL(IOV_FORCEEVEN):
int_val = (s32) forcealign; int_val = (s32) forcealign;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_FORCEEVEN): case IOV_SVAL(IOV_FORCEEVEN):
...@@ -2428,7 +2428,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2428,7 +2428,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_TXBOUND): case IOV_GVAL(IOV_TXBOUND):
int_val = (s32) dhd_txbound; int_val = (s32) dhd_txbound;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_TXBOUND): case IOV_SVAL(IOV_TXBOUND):
...@@ -2437,7 +2437,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2437,7 +2437,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_RXBOUND): case IOV_GVAL(IOV_RXBOUND):
int_val = (s32) dhd_rxbound; int_val = (s32) dhd_rxbound;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_RXBOUND): case IOV_SVAL(IOV_RXBOUND):
...@@ -2446,7 +2446,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2446,7 +2446,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_GVAL(IOV_TXMINMAX): case IOV_GVAL(IOV_TXMINMAX):
int_val = (s32) dhd_txminmax; int_val = (s32) dhd_txminmax;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_TXMINMAX): case IOV_SVAL(IOV_TXMINMAX):
...@@ -2457,7 +2457,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2457,7 +2457,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
#ifdef SDTEST #ifdef SDTEST
case IOV_GVAL(IOV_EXTLOOP): case IOV_GVAL(IOV_EXTLOOP):
int_val = (s32) bus->ext_loop; int_val = (s32) bus->ext_loop;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_SVAL(IOV_EXTLOOP): case IOV_SVAL(IOV_EXTLOOP):
...@@ -2491,7 +2491,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, ...@@ -2491,7 +2491,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
/* Get its status */ /* Get its status */
int_val = (bool) bus->dhd->dongle_reset; int_val = (bool) bus->dhd->dongle_reset;
bcopy(&int_val, arg, val_size); memcpy(arg, &int_val, val_size);
break; break;
...@@ -2536,7 +2536,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus) ...@@ -2536,7 +2536,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
return BCME_NOMEM; return BCME_NOMEM;
memset(vbuffer, 0, varsize); memset(vbuffer, 0, varsize);
bcopy(bus->vars, vbuffer, bus->varsz); memcpy(vbuffer, bus->vars, bus->varsz);
/* Write the vars list */ /* Write the vars list */
bcmerror = bcmerror =
...@@ -3099,13 +3099,13 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff) ...@@ -3099,13 +3099,13 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
ASSERT(bus->rxctl >= bus->rxbuf); ASSERT(bus->rxctl >= bus->rxbuf);
/* Copy the already-read portion over */ /* Copy the already-read portion over */
bcopy(hdr, bus->rxctl, firstread); memcpy(bus->rxctl, hdr, firstread);
if (len <= firstread) if (len <= firstread)
goto gotpkt; goto gotpkt;
/* Copy the full data pkt in gSPI case and process ioctl. */ /* Copy the full data pkt in gSPI case and process ioctl. */
if (bus->bus == SPI_BUS) { if (bus->bus == SPI_BUS) {
bcopy(hdr, bus->rxctl, len); memcpy(bus->rxctl, hdr, len);
goto gotpkt; goto gotpkt;
} }
...@@ -3769,7 +3769,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -3769,7 +3769,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
/* Now check the header */ /* Now check the header */
bcopy(rxbuf, bus->rxhdr, SDPCM_HDRLEN); memcpy(bus->rxhdr, rxbuf, SDPCM_HDRLEN);
/* Extract hardware header fields */ /* Extract hardware header fields */
len = ltoh16_ua(bus->rxhdr); len = ltoh16_ua(bus->rxhdr);
...@@ -4135,7 +4135,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -4135,7 +4135,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
/* Copy the already-read portion */ /* Copy the already-read portion */
skb_push(pkt, firstread); skb_push(pkt, firstread);
bcopy(bus->rxhdr, pkt->data, firstread); memcpy(pkt->data, bus->rxhdr, firstread);
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON()) if (DHD_BYTES_ON() && DHD_DATA_ON())
......
...@@ -289,7 +289,7 @@ dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen) ...@@ -289,7 +289,7 @@ dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen)
dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf, dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf,
MAX_WLIW_IOCTL_LEN); MAX_WLIW_IOCTL_LEN);
if (!error) if (!error)
bcopy(ioctlbuf, buf, buflen); memcpy(buf, ioctlbuf, buflen);
return error; return error;
} }
...@@ -841,7 +841,7 @@ wl_iw_mlme(struct net_device *dev, ...@@ -841,7 +841,7 @@ wl_iw_mlme(struct net_device *dev,
} }
scbval.val = mlme->reason_code; scbval.val = mlme->reason_code;
bcopy(&mlme->addr.sa_data, &scbval.ea, ETH_ALEN); memcpy(&scbval.ea, &mlme->addr.sa_data, ETH_ALEN);
if (mlme->cmd == IW_MLME_DISASSOC) { if (mlme->cmd == IW_MLME_DISASSOC) {
scbval.val = htod32(scbval.val); scbval.val = htod32(scbval.val);
...@@ -1078,7 +1078,7 @@ static void wl_iw_set_event_mask(struct net_device *dev) ...@@ -1078,7 +1078,7 @@ static void wl_iw_set_event_mask(struct net_device *dev)
char iovbuf[WL_EVENTING_MASK_LEN + 12]; char iovbuf[WL_EVENTING_MASK_LEN + 12];
dev_iw_iovar_getbuf(dev, "event_msgs", "", 0, iovbuf, sizeof(iovbuf)); dev_iw_iovar_getbuf(dev, "event_msgs", "", 0, iovbuf, sizeof(iovbuf));
bcopy(iovbuf, eventmask, WL_EVENTING_MASK_LEN); memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
setbit(eventmask, WLC_E_SCAN_COMPLETE); setbit(eventmask, WLC_E_SCAN_COMPLETE);
dev_iw_iovar_setbuf(dev, "event_msgs", eventmask, WL_EVENTING_MASK_LEN, dev_iw_iovar_setbuf(dev, "event_msgs", eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf)); iovbuf, sizeof(iovbuf));
...@@ -2555,8 +2555,7 @@ wl_iw_set_encodeext(struct net_device *dev, ...@@ -2555,8 +2555,7 @@ wl_iw_set_encodeext(struct net_device *dev,
key.len = iwe->key_len; key.len = iwe->key_len;
if (!is_multicast_ether_addr(iwe->addr.sa_data)) if (!is_multicast_ether_addr(iwe->addr.sa_data))
bcopy((void *)&iwe->addr.sa_data, (char *)&key.ea, memcpy(&key.ea, &iwe->addr.sa_data, ETH_ALEN);
ETH_ALEN);
if (key.len == 0) { if (key.len == 0) {
if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
...@@ -2581,13 +2580,13 @@ wl_iw_set_encodeext(struct net_device *dev, ...@@ -2581,13 +2580,13 @@ wl_iw_set_encodeext(struct net_device *dev,
key.flags = WL_PRIMARY_KEY; key.flags = WL_PRIMARY_KEY;
} }
bcopy((void *)iwe->key, key.data, iwe->key_len); memcpy(key.data, iwe->key, iwe->key_len);
if (iwe->alg == IW_ENCODE_ALG_TKIP) { if (iwe->alg == IW_ENCODE_ALG_TKIP) {
u8 keybuf[8]; u8 keybuf[8];
bcopy(&key.data[24], keybuf, sizeof(keybuf)); memcpy(keybuf, &key.data[24], sizeof(keybuf));
bcopy(&key.data[16], &key.data[24], sizeof(keybuf)); memcpy(&key.data[24], &key.data[16], sizeof(keybuf));
bcopy(keybuf, &key.data[16], sizeof(keybuf)); memcpy(&key.data[16], keybuf, sizeof(keybuf));
} }
if (iwe->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { if (iwe->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
...@@ -2661,10 +2660,12 @@ wl_iw_set_pmksa(struct net_device *dev, ...@@ -2661,10 +2660,12 @@ wl_iw_set_pmksa(struct net_device *dev,
uint j; uint j;
pmkidptr = &pmkid; pmkidptr = &pmkid;
bcopy(&iwpmksa->bssid.sa_data[0], memcpy(&pmkidptr->pmkid[0].BSSID,
&pmkidptr->pmkid[0].BSSID, ETH_ALEN); &iwpmksa->bssid.sa_data[0],
bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, ETH_ALEN);
WLAN_PMKID_LEN); memcpy(&pmkidptr->pmkid[0].PMKID,
&iwpmksa->pmkid[0],
WLAN_PMKID_LEN);
WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: " WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: "
"%pM = ", &pmkidptr->pmkid[0].BSSID); "%pM = ", &pmkidptr->pmkid[0].BSSID);
...@@ -2683,12 +2684,12 @@ wl_iw_set_pmksa(struct net_device *dev, ...@@ -2683,12 +2684,12 @@ wl_iw_set_pmksa(struct net_device *dev,
&& (i < pmkid_list.pmkids.npmkid)) { && (i < pmkid_list.pmkids.npmkid)) {
memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t)); memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t));
for (; i < (pmkid_list.pmkids.npmkid - 1); i++) { for (; i < (pmkid_list.pmkids.npmkid - 1); i++) {
bcopy(&pmkid_list.pmkids.pmkid[i + 1].BSSID, memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
&pmkid_list.pmkids.pmkid[i].BSSID, &pmkid_list.pmkids.pmkid[i + 1].BSSID,
ETH_ALEN); ETH_ALEN);
bcopy(&pmkid_list.pmkids.pmkid[i + 1].PMKID, memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
&pmkid_list.pmkids.pmkid[i].PMKID, &pmkid_list.pmkids.pmkid[i + 1].PMKID,
WLAN_PMKID_LEN); WLAN_PMKID_LEN);
} }
pmkid_list.pmkids.npmkid--; pmkid_list.pmkids.npmkid--;
} else } else
...@@ -2702,12 +2703,12 @@ wl_iw_set_pmksa(struct net_device *dev, ...@@ -2702,12 +2703,12 @@ wl_iw_set_pmksa(struct net_device *dev,
&pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN)) &pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
break; break;
if (i < MAXPMKID) { if (i < MAXPMKID) {
bcopy(&iwpmksa->bssid.sa_data[0], memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
&pmkid_list.pmkids.pmkid[i].BSSID, &iwpmksa->bssid.sa_data[0],
ETH_ALEN); ETH_ALEN);
bcopy(&iwpmksa->pmkid[0], memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
&pmkid_list.pmkids.pmkid[i].PMKID, &iwpmksa->pmkid[0],
WLAN_PMKID_LEN); WLAN_PMKID_LEN);
if (i == pmkid_list.pmkids.npmkid) if (i == pmkid_list.pmkids.npmkid)
pmkid_list.pmkids.npmkid++; pmkid_list.pmkids.npmkid++;
} else } else
...@@ -3491,9 +3492,9 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data) ...@@ -3491,9 +3492,9 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
if (pmkidcand->preauth) if (pmkidcand->preauth)
iwpmkidcand->flags |= iwpmkidcand->flags |=
IW_PMKID_CAND_PREAUTH; IW_PMKID_CAND_PREAUTH;
bcopy(&pmkidcand->BSSID, memcpy(&iwpmkidcand->bssid.sa_data,
&iwpmkidcand->bssid.sa_data, &pmkidcand->BSSID,
ETH_ALEN); ETH_ALEN);
#ifndef SANDGATE2G #ifndef SANDGATE2G
wireless_send_event(dev, cmd, &wrqu, wireless_send_event(dev, cmd, &wrqu,
extra); extra);
......
...@@ -779,7 +779,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars ...@@ -779,7 +779,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars
pi->vars = (char *)&pi->vars; pi->vars = (char *)&pi->vars;
bcopy(&pi->pubpi, &pi->pubpi_ro, sizeof(wlc_phy_t)); memcpy(&pi->pubpi_ro, &pi->pubpi, sizeof(wlc_phy_t));
return &pi->pubpi_ro; return &pi->pubpi_ro;
...@@ -1619,40 +1619,36 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr) ...@@ -1619,40 +1619,36 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
bool mac_enabled = false; bool mac_enabled = false;
phy_info_t *pi = (phy_info_t *) ppi; phy_info_t *pi = (phy_info_t *) ppi;
bcopy(&txpwr->cck[0], &pi->tx_user_target[TXP_FIRST_CCK], memcpy(&pi->tx_user_target[TXP_FIRST_CCK],
WLC_NUM_RATES_CCK); &txpwr->cck[0], WLC_NUM_RATES_CCK);
bcopy(&txpwr->ofdm[0], &pi->tx_user_target[TXP_FIRST_OFDM], memcpy(&pi->tx_user_target[TXP_FIRST_OFDM],
WLC_NUM_RATES_OFDM); &txpwr->ofdm[0], WLC_NUM_RATES_OFDM);
bcopy(&txpwr->ofdm_cdd[0], &pi->tx_user_target[TXP_FIRST_OFDM_20_CDD], memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_20_CDD],
WLC_NUM_RATES_OFDM); &txpwr->ofdm_cdd[0], WLC_NUM_RATES_OFDM);
bcopy(&txpwr->ofdm_40_siso[0], memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_SISO],
&pi->tx_user_target[TXP_FIRST_OFDM_40_SISO], WLC_NUM_RATES_OFDM); &txpwr->ofdm_40_siso[0], WLC_NUM_RATES_OFDM);
bcopy(&txpwr->ofdm_40_cdd[0], memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_CDD],
&pi->tx_user_target[TXP_FIRST_OFDM_40_CDD], WLC_NUM_RATES_OFDM); &txpwr->ofdm_40_cdd[0], WLC_NUM_RATES_OFDM);
bcopy(&txpwr->mcs_20_siso[0], memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SISO],
&pi->tx_user_target[TXP_FIRST_MCS_20_SISO], &txpwr->mcs_20_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
WLC_NUM_RATES_MCS_1_STREAM); memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_CDD],
bcopy(&txpwr->mcs_20_cdd[0], &pi->tx_user_target[TXP_FIRST_MCS_20_CDD], &txpwr->mcs_20_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
WLC_NUM_RATES_MCS_1_STREAM); memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_STBC],
bcopy(&txpwr->mcs_20_stbc[0], &txpwr->mcs_20_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
&pi->tx_user_target[TXP_FIRST_MCS_20_STBC], memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SDM],
WLC_NUM_RATES_MCS_1_STREAM); &txpwr->mcs_20_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);
bcopy(&txpwr->mcs_20_mimo[0], &pi->tx_user_target[TXP_FIRST_MCS_20_SDM],
WLC_NUM_RATES_MCS_2_STREAM); memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SISO],
&txpwr->mcs_40_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
bcopy(&txpwr->mcs_40_siso[0], memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_CDD],
&pi->tx_user_target[TXP_FIRST_MCS_40_SISO], &txpwr->mcs_40_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
WLC_NUM_RATES_MCS_1_STREAM); memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_STBC],
bcopy(&txpwr->mcs_40_cdd[0], &pi->tx_user_target[TXP_FIRST_MCS_40_CDD], &txpwr->mcs_40_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
WLC_NUM_RATES_MCS_1_STREAM); memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SDM],
bcopy(&txpwr->mcs_40_stbc[0], &txpwr->mcs_40_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);
&pi->tx_user_target[TXP_FIRST_MCS_40_STBC],
WLC_NUM_RATES_MCS_1_STREAM);
bcopy(&txpwr->mcs_40_mimo[0], &pi->tx_user_target[TXP_FIRST_MCS_40_SDM],
WLC_NUM_RATES_MCS_2_STREAM);
if (R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC) if (R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC)
mac_enabled = true; mac_enabled = true;
......
...@@ -1965,8 +1965,9 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, ...@@ -1965,8 +1965,9 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
tbl_iqcal_gainparams_lcnphy[band_idx][j][2]; tbl_iqcal_gainparams_lcnphy[band_idx][j][2];
cal_gains.pad_gain = cal_gains.pad_gain =
tbl_iqcal_gainparams_lcnphy[band_idx][j][3]; tbl_iqcal_gainparams_lcnphy[band_idx][j][3];
bcopy(&tbl_iqcal_gainparams_lcnphy[band_idx][j][3], memcpy(ncorr_override,
ncorr_override, sizeof(ncorr_override)); &tbl_iqcal_gainparams_lcnphy[band_idx][j][3],
sizeof(ncorr_override));
break; break;
} }
} }
......
...@@ -799,7 +799,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, ...@@ -799,7 +799,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
goto fail; goto fail;
} }
bcopy(&wl->pub->cur_etheraddr, perm, ETH_ALEN); memcpy(perm, &wl->pub->cur_etheraddr, ETH_ALEN);
ASSERT(is_valid_ether_addr(perm)); ASSERT(is_valid_ether_addr(perm));
SET_IEEE80211_PERM_ADDR(hw, perm); SET_IEEE80211_PERM_ADDR(hw, perm);
...@@ -1754,7 +1754,7 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx) ...@@ -1754,7 +1754,7 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx)
hdr->len); hdr->len);
goto fail; goto fail;
} }
bcopy(pdata, *pbuf, hdr->len); memcpy(*pbuf, pdata, hdr->len);
return 0; return 0;
} }
} }
......
...@@ -1324,7 +1324,7 @@ void wlc_ampdu_macaddr_upd(struct wlc_info *wlc) ...@@ -1324,7 +1324,7 @@ void wlc_ampdu_macaddr_upd(struct wlc_info *wlc)
/* driver needs to write the ta in the template; ta is at offset 16 */ /* driver needs to write the ta in the template; ta is at offset 16 */
memset(template, 0, sizeof(template)); memset(template, 0, sizeof(template));
bcopy((char *)wlc->pub->cur_etheraddr, template, ETH_ALEN); memcpy(template, wlc->pub->cur_etheraddr, ETH_ALEN);
wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2), wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2),
template); template);
} }
......
...@@ -1275,7 +1275,7 @@ void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw) ...@@ -1275,7 +1275,7 @@ void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw)
void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea) void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea)
{ {
bcopy(wlc_hw->etheraddr, ea, ETH_ALEN); memcpy(ea, wlc_hw->etheraddr, ETH_ALEN);
} }
int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw) int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw)
...@@ -1698,7 +1698,7 @@ wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset, int len, ...@@ -1698,7 +1698,7 @@ wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset, int len,
be_bit = (R_REG(osh, &regs->maccontrol) & MCTL_BIGEND) != 0; be_bit = (R_REG(osh, &regs->maccontrol) & MCTL_BIGEND) != 0;
while (len > 0) { while (len > 0) {
bcopy((u8 *) buf, &word, sizeof(u32)); memcpy(&word, buf, sizeof(u32));
if (be_bit) if (be_bit)
word = hton32(word); word = hton32(word);
......
...@@ -1005,7 +1005,7 @@ static int wlc_get_current_txpwr(struct wlc_info *wlc, void *pwr, uint len) ...@@ -1005,7 +1005,7 @@ static int wlc_get_current_txpwr(struct wlc_info *wlc, void *pwr, uint len)
* or convert to a tx_power_legacy_t struct * or convert to a tx_power_legacy_t struct
*/ */
if (!old_power) { if (!old_power) {
bcopy(&power, pwr, sizeof(tx_power_t)); memcpy(pwr, &power, sizeof(tx_power_t));
} else { } else {
int band_idx = CHSPEC_IS2G(power.chanspec) ? 0 : 1; int band_idx = CHSPEC_IS2G(power.chanspec) ? 0 : 1;
...@@ -1855,8 +1855,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, ...@@ -1855,8 +1855,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
wlc_bmac_hw_etheraddr(wlc->hw, wlc->perm_etheraddr); wlc_bmac_hw_etheraddr(wlc->hw, wlc->perm_etheraddr);
bcopy((char *)&wlc->perm_etheraddr, (char *)&pub->cur_etheraddr, memcpy(&pub->cur_etheraddr, &wlc->perm_etheraddr, ETH_ALEN);
ETH_ALEN);
for (j = 0; j < NBANDS(wlc); j++) { for (j = 0; j < NBANDS(wlc); j++) {
/* Use band 1 for single band 11a */ /* Use band 1 for single band 11a */
...@@ -2916,8 +2915,8 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config) ...@@ -2916,8 +2915,8 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)
/* Set default bss rateset */ /* Set default bss rateset */
wlc->default_bss->rateset.count = rs.count; wlc->default_bss->rateset.count = rs.count;
bcopy((char *)rs.rates, (char *)wlc->default_bss->rateset.rates, memcpy(wlc->default_bss->rateset.rates, rs.rates,
sizeof(wlc->default_bss->rateset.rates)); sizeof(wlc->default_bss->rateset.rates));
return ret; return ret;
} }
...@@ -3010,7 +3009,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg) ...@@ -3010,7 +3009,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
wlc_rateset_t rs, new; wlc_rateset_t rs, new;
uint bandunit; uint bandunit;
bcopy((char *)rs_arg, (char *)&rs, sizeof(wlc_rateset_t)); memcpy(&rs, rs_arg, sizeof(wlc_rateset_t));
/* check for bad count value */ /* check for bad count value */
if ((rs.count == 0) || (rs.count > WLC_NUMRATES)) if ((rs.count == 0) || (rs.count > WLC_NUMRATES))
...@@ -3018,7 +3017,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg) ...@@ -3018,7 +3017,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
/* try the current band */ /* try the current band */
bandunit = wlc->band->bandunit; bandunit = wlc->band->bandunit;
bcopy((char *)&rs, (char *)&new, sizeof(wlc_rateset_t)); memcpy(&new, &rs, sizeof(wlc_rateset_t));
if (wlc_rate_hwrs_filter_sort_validate if (wlc_rate_hwrs_filter_sort_validate
(&new, &wlc->bandstate[bandunit]->hw_rateset, true, (&new, &wlc->bandstate[bandunit]->hw_rateset, true,
wlc->stf->txstreams)) wlc->stf->txstreams))
...@@ -3027,7 +3026,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg) ...@@ -3027,7 +3026,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
/* try the other band */ /* try the other band */
if (IS_MBAND_UNLOCKED(wlc)) { if (IS_MBAND_UNLOCKED(wlc)) {
bandunit = OTHERBANDUNIT(wlc); bandunit = OTHERBANDUNIT(wlc);
bcopy((char *)&rs, (char *)&new, sizeof(wlc_rateset_t)); memcpy(&new, &rs, sizeof(wlc_rateset_t));
if (wlc_rate_hwrs_filter_sort_validate(&new, if (wlc_rate_hwrs_filter_sort_validate(&new,
&wlc-> &wlc->
bandstate[bandunit]-> bandstate[bandunit]->
...@@ -3040,10 +3039,9 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg) ...@@ -3040,10 +3039,9 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
good: good:
/* apply new rateset */ /* apply new rateset */
bcopy((char *)&new, (char *)&wlc->default_bss->rateset, memcpy(&wlc->default_bss->rateset, &new, sizeof(wlc_rateset_t));
sizeof(wlc_rateset_t)); memcpy(&wlc->bandstate[bandunit]->defrateset, &new,
bcopy((char *)&new, (char *)&wlc->bandstate[bandunit]->defrateset, sizeof(wlc_rateset_t));
sizeof(wlc_rateset_t));
return 0; return 0;
} }
...@@ -3123,7 +3121,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3123,7 +3121,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
/* This will prevent the misaligned access */ /* This will prevent the misaligned access */
if (pval && (u32) len >= sizeof(val)) if (pval && (u32) len >= sizeof(val))
bcopy(pval, &val, sizeof(val)); memcpy(&val, pval, sizeof(val));
else else
val = 0; val = 0;
...@@ -3612,18 +3610,17 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3612,18 +3610,17 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
if (src_key) { if (src_key) {
key.index = src_key->id; key.index = src_key->id;
key.len = src_key->len; key.len = src_key->len;
bcopy(src_key->data, key.data, key.len); memcpy(key.data, src_key->data, key.len);
key.algo = src_key->algo; key.algo = src_key->algo;
if (WSEC_SOFTKEY(wlc, src_key, bsscfg)) if (WSEC_SOFTKEY(wlc, src_key, bsscfg))
key.flags |= WL_SOFT_KEY; key.flags |= WL_SOFT_KEY;
if (src_key->flags & WSEC_PRIMARY_KEY) if (src_key->flags & WSEC_PRIMARY_KEY)
key.flags |= WL_PRIMARY_KEY; key.flags |= WL_PRIMARY_KEY;
bcopy(src_key->ea, key.ea, memcpy(key.ea, src_key->ea, ETH_ALEN);
ETH_ALEN);
} }
bcopy((char *)&key, arg, sizeof(key)); memcpy(arg, &key, sizeof(key));
} else } else
bcmerror = BCME_BADKEYIDX; bcmerror = BCME_BADKEYIDX;
break; break;
...@@ -3674,7 +3671,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3674,7 +3671,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
seq[6] = 0; seq[6] = 0;
seq[7] = 0; seq[7] = 0;
bcopy((char *)seq, arg, sizeof(seq)); memcpy(arg, seq, sizeof(seq));
} else { } else {
bcmerror = BCME_BADKEYIDX; bcmerror = BCME_BADKEYIDX;
} }
...@@ -3697,7 +3694,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3697,7 +3694,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
/* Copy only legacy rateset section */ /* Copy only legacy rateset section */
ret_rs->count = rs->count; ret_rs->count = rs->count;
bcopy(&rs->rates, &ret_rs->rates, rs->count); memcpy(&ret_rs->rates, &rs->rates, rs->count);
break; break;
} }
...@@ -3715,7 +3712,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3715,7 +3712,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
/* Copy only legacy rateset section */ /* Copy only legacy rateset section */
ret_rs->count = rs.count; ret_rs->count = rs.count;
bcopy(&rs.rates, &ret_rs->rates, rs.count); memcpy(&ret_rs->rates, &rs.rates, rs.count);
break; break;
} }
...@@ -3737,16 +3734,18 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -3737,16 +3734,18 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
/* Copy only legacy rateset section */ /* Copy only legacy rateset section */
rs.count = in_rs->count; rs.count = in_rs->count;
bcopy(&in_rs->rates, &rs.rates, rs.count); memcpy(&rs.rates, &in_rs->rates, rs.count);
/* merge rateset coming in with the current mcsset */ /* merge rateset coming in with the current mcsset */
if (N_ENAB(wlc->pub)) { if (N_ENAB(wlc->pub)) {
if (bsscfg->associated) if (bsscfg->associated)
bcopy(&current_bss->rateset.mcs[0], memcpy(rs.mcs,
rs.mcs, MCSSET_LEN); &current_bss->rateset.mcs[0],
MCSSET_LEN);
else else
bcopy(&wlc->default_bss->rateset.mcs[0], memcpy(rs.mcs,
rs.mcs, MCSSET_LEN); &wlc->default_bss->rateset.mcs[0],
MCSSET_LEN);
} }
bcmerror = wlc_set_rateset(wlc, &rs); bcmerror = wlc_set_rateset(wlc, &rs);
...@@ -4048,7 +4047,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -4048,7 +4047,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
bcmerror = BCME_BUFTOOSHORT; bcmerror = BCME_BUFTOOSHORT;
break; break;
} }
bcopy((char *)arg, (char *)&rs, sizeof(wlc_rateset_t)); memcpy(&rs, arg, sizeof(wlc_rateset_t));
/* check for bad count value */ /* check for bad count value */
if (rs.count > WLC_NUMRATES) { if (rs.count > WLC_NUMRATES) {
...@@ -4084,7 +4083,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -4084,7 +4083,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
} }
/* apply new rateset to the override */ /* apply new rateset to the override */
bcopy((char *)&new, (char *)&wlc->sup_rates_override, memcpy(&wlc->sup_rates_override, &new,
sizeof(wlc_rateset_t)); sizeof(wlc_rateset_t));
/* update bcn and probe resp if needed */ /* update bcn and probe resp if needed */
...@@ -4108,8 +4107,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, ...@@ -4108,8 +4107,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
bcmerror = BCME_BUFTOOSHORT; bcmerror = BCME_BUFTOOSHORT;
break; break;
} }
bcopy((char *)&wlc->sup_rates_override, (char *)arg, memcpy(arg, &wlc->sup_rates_override, sizeof(wlc_rateset_t));
sizeof(wlc_rateset_t));
break; break;
...@@ -4518,7 +4516,7 @@ wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len, ...@@ -4518,7 +4516,7 @@ wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len,
case IOVT_UINT8: case IOVT_UINT8:
case IOVT_UINT16: case IOVT_UINT16:
case IOVT_UINT32: case IOVT_UINT32:
bcopy(arg, &int_val, sizeof(int)); memcpy(&int_val, arg, sizeof(int));
err = wlc_iovar_rangecheck(wlc, int_val, vi); err = wlc_iovar_rangecheck(wlc, int_val, vi);
break; break;
} }
...@@ -4562,11 +4560,12 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid, ...@@ -4562,11 +4560,12 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
/* convenience int and bool vals for first 8 bytes of buffer */ /* convenience int and bool vals for first 8 bytes of buffer */
if (p_len >= (int)sizeof(int_val)) if (p_len >= (int)sizeof(int_val))
bcopy(params, &int_val, sizeof(int_val)); memcpy(&int_val, params, sizeof(int_val));
if (p_len >= (int)sizeof(int_val) * 2) if (p_len >= (int)sizeof(int_val) * 2)
bcopy((void *)((unsigned long)params + sizeof(int_val)), &int_val2, memcpy(&int_val2,
sizeof(int_val)); (void *)((unsigned long)params + sizeof(int_val)),
sizeof(int_val));
/* convenience int ptr for 4-byte gets (requires int aligned arg) */ /* convenience int ptr for 4-byte gets (requires int aligned arg) */
ret_int_ptr = (s32 *) arg; ret_int_ptr = (s32 *) arg;
...@@ -6061,8 +6060,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6061,8 +6060,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
/* (3) PLCP: determine PLCP header and MAC duration, fill d11txh_t */ /* (3) PLCP: determine PLCP header and MAC duration, fill d11txh_t */
wlc_compute_plcp(wlc, rspec[0], phylen, plcp); wlc_compute_plcp(wlc, rspec[0], phylen, plcp);
wlc_compute_plcp(wlc, rspec[1], phylen, plcp_fallback); wlc_compute_plcp(wlc, rspec[1], phylen, plcp_fallback);
bcopy(plcp_fallback, (char *)&txh->FragPLCPFallback, memcpy(&txh->FragPLCPFallback,
sizeof(txh->FragPLCPFallback)); plcp_fallback, sizeof(txh->FragPLCPFallback));
/* Length field now put in CCK FBR CRC field */ /* Length field now put in CCK FBR CRC field */
if (IS_CCK(rspec[1])) { if (IS_CCK(rspec[1])) {
...@@ -6135,14 +6134,13 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6135,14 +6134,13 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
} }
/* MacFrameControl */ /* MacFrameControl */
bcopy((char *)&h->frame_control, (char *)&txh->MacFrameControl, memcpy(&txh->MacFrameControl, &h->frame_control, sizeof(u16));
sizeof(u16));
txh->TxFesTimeNormal = htol16(0); txh->TxFesTimeNormal = htol16(0);
txh->TxFesTimeFallback = htol16(0); txh->TxFesTimeFallback = htol16(0);
/* TxFrameRA */ /* TxFrameRA */
bcopy((char *)&h->addr1, (char *)&txh->TxFrameRA, ETH_ALEN); memcpy(&txh->TxFrameRA, &h->addr1, ETH_ALEN);
/* TxFrameID */ /* TxFrameID */
txh->TxFrameID = htol16(frameid); txh->TxFrameID = htol16(frameid);
...@@ -6207,8 +6205,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6207,8 +6205,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
/* fallback rate version of RTS PLCP header */ /* fallback rate version of RTS PLCP header */
wlc_compute_plcp(wlc, rts_rspec[1], rts_phylen, wlc_compute_plcp(wlc, rts_rspec[1], rts_phylen,
rts_plcp_fallback); rts_plcp_fallback);
bcopy(rts_plcp_fallback, (char *)&txh->RTSPLCPFallback, memcpy(&txh->RTSPLCPFallback, rts_plcp_fallback,
sizeof(txh->RTSPLCPFallback)); sizeof(txh->RTSPLCPFallback));
/* RTS frame fields... */ /* RTS frame fields... */
rts = (struct ieee80211_rts *)&txh->rts_frame; rts = (struct ieee80211_rts *)&txh->rts_frame;
...@@ -6226,11 +6224,10 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6226,11 +6224,10 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
if (use_cts) { if (use_cts) {
rts->frame_control = htol16(FC_CTS); rts->frame_control = htol16(FC_CTS);
bcopy((char *)&h->addr2, (char *)&rts->ra, ETH_ALEN); memcpy(&rts->ra, &h->addr2, ETH_ALEN);
} else { } else {
rts->frame_control = htol16((u16) FC_RTS); rts->frame_control = htol16((u16) FC_RTS);
bcopy((char *)&h->addr1, (char *)&rts->ra, memcpy(&rts->ra, &h->addr1, 2 * ETH_ALEN);
2 * ETH_ALEN);
} }
/* mainrate /* mainrate
...@@ -7726,10 +7723,9 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec, ...@@ -7726,10 +7723,9 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */ /* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */ /* A1 filled in by MAC for prb resp, broadcast for bcn */
if (type == FC_BEACON) if (type == FC_BEACON)
bcopy((const char *)&ether_bcast, (char *)&h->da, memcpy(&h->da, &ether_bcast, ETH_ALEN);
ETH_ALEN); memcpy(&h->sa, &cfg->cur_etheraddr, ETH_ALEN);
bcopy((char *)&cfg->cur_etheraddr, (char *)&h->sa, ETH_ALEN); memcpy(&h->bssid, &cfg->BSSID, ETH_ALEN);
bcopy((char *)&cfg->BSSID, (char *)&h->bssid, ETH_ALEN);
/* SEQ filled in by MAC */ /* SEQ filled in by MAC */
...@@ -7820,7 +7816,7 @@ void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg) ...@@ -7820,7 +7816,7 @@ void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg)
/* padding the ssid with zero and copy it into shm */ /* padding the ssid with zero and copy it into shm */
memset(ssidbuf, 0, IEEE80211_MAX_SSID_LEN); memset(ssidbuf, 0, IEEE80211_MAX_SSID_LEN);
bcopy(ssidptr, ssidbuf, cfg->SSID_len); memcpy(ssidbuf, ssidptr, cfg->SSID_len);
wlc_copyto_shm(wlc, base, ssidbuf, IEEE80211_MAX_SSID_LEN); wlc_copyto_shm(wlc, base, ssidbuf, IEEE80211_MAX_SSID_LEN);
......
...@@ -382,7 +382,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp) ...@@ -382,7 +382,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
/* copy rateset src to dst as-is (no masking or sorting) */ /* copy rateset src to dst as-is (no masking or sorting) */
void wlc_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst) void wlc_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst)
{ {
bcopy(src, dst, sizeof(wlc_rateset_t)); memcpy(dst, src, sizeof(wlc_rateset_t));
} }
/* /*
...@@ -417,7 +417,7 @@ wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only, ...@@ -417,7 +417,7 @@ wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
dst->htphy_membership = src->htphy_membership; dst->htphy_membership = src->htphy_membership;
if (mcsallow && rates != WLC_RATES_CCK) if (mcsallow && rates != WLC_RATES_CCK)
bcopy(&src->mcs[0], &dst->mcs[0], MCSSET_LEN); memcpy(&dst->mcs[0], &src->mcs[0], MCSSET_LEN);
else else
wlc_rateset_mcs_clear(dst); wlc_rateset_mcs_clear(dst);
} }
...@@ -487,7 +487,7 @@ void wlc_rateset_mcs_clear(wlc_rateset_t *rateset) ...@@ -487,7 +487,7 @@ void wlc_rateset_mcs_clear(wlc_rateset_t *rateset)
void wlc_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams) void wlc_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams)
{ {
bcopy(&cck_ofdm_mimo_rates.mcs[0], &rateset->mcs[0], MCSSET_LEN); memcpy(&rateset->mcs[0], &cck_ofdm_mimo_rates.mcs[0], MCSSET_LEN);
wlc_rateset_mcs_upd(rateset, txstreams); wlc_rateset_mcs_upd(rateset, txstreams);
} }
......
...@@ -489,7 +489,7 @@ void wlc_stf_phy_chain_calc(struct wlc_info *wlc) ...@@ -489,7 +489,7 @@ void wlc_stf_phy_chain_calc(struct wlc_info *wlc)
wlc->stf->rxstreams = (u8) WLC_BITSCNT(wlc->stf->hw_rxchain); wlc->stf->rxstreams = (u8) WLC_BITSCNT(wlc->stf->hw_rxchain);
/* initialize the txcore table */ /* initialize the txcore table */
bcopy(txcore_default, wlc->stf->txcore, sizeof(wlc->stf->txcore)); memcpy(wlc->stf->txcore, txcore_default, sizeof(wlc->stf->txcore));
/* default spatial_policy */ /* default spatial_policy */
wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION; wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION;
......
...@@ -110,8 +110,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, ...@@ -110,8 +110,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#include <linux/kernel.h> /* for vsn/printf's */ #include <linux/kernel.h> /* for vsn/printf's */
#include <linux/string.h> /* for mem*, str* */ #include <linux/string.h> /* for mem*, str* */
#endif #endif
/* bcopy's: Linux kernel doesn't provide these (anymore) */
#define bcopy(src, dst, len) memcpy((dst), (src), (len))
/* register access macros */ /* register access macros */
#ifndef IL_BIGENDIAN #ifndef IL_BIGENDIAN
...@@ -204,8 +202,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, ...@@ -204,8 +202,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
} while (0) } while (0)
#endif /* IL_BIGENDIAN */ #endif /* IL_BIGENDIAN */
#define bcopy(src, dst, len) memcpy((dst), (src), (len))
/* packet primitives */ /* packet primitives */
extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len); extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send); extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send);
......
...@@ -818,7 +818,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len) ...@@ -818,7 +818,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len)
if (offset + dsz >= *len) { if (offset + dsz >= *len) {
goto out; goto out;
} }
bcopy((char *)&rawotp[i + 2], &data[offset], dsz); memcpy(&data[offset], &rawotp[i + 2], dsz);
offset += dsz; offset += dsz;
/* Remove extra null characters at the end */ /* Remove extra null characters at the end */
while (offset > 1 && while (offset > 1 &&
......
...@@ -1336,8 +1336,8 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, ...@@ -1336,8 +1336,8 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars,
u8 srev = cis[i + 1 + 70]; u8 srev = cis[i + 1 + 70];
ASSERT(srev == 3); ASSERT(srev == 3);
/* make tuple value 16-bit aligned and parse it */ /* make tuple value 16-bit aligned and parse it */
bcopy(&cis[i + 1], srom, memcpy(srom, &cis[i + 1],
sizeof(srom)); sizeof(srom));
_initvars_srom_pci(srev, srom, _initvars_srom_pci(srev, srom,
SROM3_SWRGN_OFF, SROM3_SWRGN_OFF,
&b); &b);
...@@ -1518,7 +1518,7 @@ static int otp_read_pci(struct osl_info *osh, si_t *sih, u16 *buf, uint bufsz) ...@@ -1518,7 +1518,7 @@ static int otp_read_pci(struct osl_info *osh, si_t *sih, u16 *buf, uint bufsz)
err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz); err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz);
bcopy(otp, buf, bufsz); memcpy(buf, otp, bufsz);
if (otp) if (otp)
kfree(otp); kfree(otp);
...@@ -1562,7 +1562,7 @@ static int initvars_table(struct osl_info *osh, char *start, char *end, ...@@ -1562,7 +1562,7 @@ static int initvars_table(struct osl_info *osh, char *start, char *end,
ASSERT(vp != NULL); ASSERT(vp != NULL);
if (!vp) if (!vp)
return BCME_NOMEM; return BCME_NOMEM;
bcopy(start, vp, c); memcpy(vp, start, c);
*vars = vp; *vars = vp;
*count = c; *count = c;
} else { } else {
......
...@@ -50,7 +50,7 @@ uint pktfrombuf(struct osl_info *osh, struct sk_buff *p, uint offset, int len, ...@@ -50,7 +50,7 @@ uint pktfrombuf(struct osl_info *osh, struct sk_buff *p, uint offset, int len,
/* copy the data */ /* copy the data */
for (; p && len; p = p->next) { for (; p && len; p = p->next) {
n = min((uint) (p->len) - offset, (uint) len); n = min((uint) (p->len) - offset, (uint) len);
bcopy(buf, p->data + offset, n); memcpy(p->data + offset, buf, n);
buf += n; buf += n;
len -= n; len -= n;
ret += n; ret += n;
......
...@@ -1758,8 +1758,8 @@ static void dma64_txrotate(dma_info_t *di) ...@@ -1758,8 +1758,8 @@ static void dma64_txrotate(dma_info_t *di)
/* Move the map */ /* Move the map */
if (DMASGLIST_ENAB) { if (DMASGLIST_ENAB) {
bcopy(&di->txp_dmah[old], &di->txp_dmah[new], memcpy(&di->txp_dmah[new], &di->txp_dmah[old],
sizeof(hnddma_seg_map_t)); sizeof(hnddma_seg_map_t));
memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t)); memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t));
} }
......
...@@ -70,7 +70,7 @@ static void get_flash_nvram(si_t *sih, struct nvram_header *nvh) ...@@ -70,7 +70,7 @@ static void get_flash_nvram(si_t *sih, struct nvram_header *nvh)
new->next = vars; new->next = vars;
vars = new; vars = new;
bcopy((char *)(&nvh[1]), new->vars, nvs); memcpy(new->vars, &nvh[1], nvs);
NVR_MSG(("%s: flash nvram @ %p, copied %d bytes to %p\n", __func__, NVR_MSG(("%s: flash nvram @ %p, copied %d bytes to %p\n", __func__,
nvh, nvs, new->vars)); nvh, nvs, new->vars));
...@@ -195,7 +195,7 @@ int nvram_getall(char *buf, int count) ...@@ -195,7 +195,7 @@ int nvram_getall(char *buf, int count)
len = strlen(from) + 1; len = strlen(from) + 1;
if (resid < (acc + len)) if (resid < (acc + len))
return BCME_BUFTOOSHORT; return BCME_BUFTOOSHORT;
bcopy(from, to, len); memcpy(to, from, len);
acc += len; acc += len;
from += len; from += len;
to += len; to += len;
......
...@@ -697,7 +697,7 @@ void si_detach(si_t *sih) ...@@ -697,7 +697,7 @@ void si_detach(si_t *sih)
uint idx; uint idx;
struct si_pub *si_local = NULL; struct si_pub *si_local = NULL;
bcopy(&sih, &si_local, sizeof(si_t **)); memcpy(&si_local, &sih, sizeof(si_t **));
sii = SI_INFO(sih); sii = SI_INFO(sih);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册