bcopy -> memcpy, strcpy
This commit is contained in:
parent
7e84e14950
commit
150ca9d41a
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dp8390.c,v 1.45 2001/07/07 05:35:39 thorpej Exp $ */
|
||||
/* $NetBSD: dp8390.c,v 1.46 2001/07/07 15:59:37 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
|
||||
|
@ -132,7 +132,7 @@ dp8390_config(sc)
|
|||
dp8390_stop(sc);
|
||||
|
||||
/* Initialize ifnet structure. */
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = dp8390_start;
|
||||
ifp->if_ioctl = dp8390_ioctl;
|
||||
|
@ -899,8 +899,8 @@ dp8390_ioctl(ifp, cmd, data)
|
|||
ina->x_host =
|
||||
*(union ns_host *)LLADDR(ifp->if_sadl);
|
||||
else
|
||||
bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
|
||||
ETHER_ADDR_LEN);
|
||||
memcpy(LLADDR(ifp->if_sadl),
|
||||
ina->x_host.c_host, ETHER_ADDR_LEN);
|
||||
/* Set new address. */
|
||||
dp8390_init(sc);
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hme.c,v 1.20 2000/12/14 06:27:25 thorpej Exp $ */
|
||||
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -243,7 +243,7 @@ hme_config(sc)
|
|||
printf(": address %s\n", ether_sprintf(sc->sc_enaddr));
|
||||
|
||||
/* Initialize ifnet structure. */
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = hme_start;
|
||||
ifp->if_ioctl = hme_ioctl;
|
||||
|
@ -678,7 +678,7 @@ hme_put(sc, ri, m)
|
|||
MFREE(m, n);
|
||||
continue;
|
||||
}
|
||||
bcopy(mtod(m, caddr_t), bp, len);
|
||||
memcpy(bp, mtod(m, caddr_t), len);
|
||||
bp += len;
|
||||
tlen += len;
|
||||
MFREE(m, n);
|
||||
|
@ -729,7 +729,7 @@ hme_get(sc, ri, totlen)
|
|||
}
|
||||
|
||||
m->m_len = len = min(totlen, len);
|
||||
bcopy(bp, mtod(m, caddr_t), len);
|
||||
memcpy(mtod(m, caddr_t), bp, len);
|
||||
bp += len;
|
||||
|
||||
totlen -= len;
|
||||
|
@ -1211,9 +1211,8 @@ hme_ioctl(ifp, cmd, data)
|
|||
ina->x_host =
|
||||
*(union ns_host *)LLADDR(ifp->if_sadl);
|
||||
else {
|
||||
bcopy(ina->x_host.c_host,
|
||||
LLADDR(ifp->if_sadl),
|
||||
sizeof(sc->sc_enaddr));
|
||||
memcpy(LLADDR(ifp->if_sadl),
|
||||
ina->x_host.c_host, sizeof(sc->sc_enaddr));
|
||||
}
|
||||
/* Set new address. */
|
||||
hme_init(sc);
|
||||
|
@ -1417,9 +1416,9 @@ hme_copytobuf_contig(sc, from, ri, len)
|
|||
volatile caddr_t buf = sc->sc_rb.rb_txbuf + (ri * _HME_BUFSZ);
|
||||
|
||||
/*
|
||||
* Just call bcopy() to do the work.
|
||||
* Just call memcpy() to do the work.
|
||||
*/
|
||||
bcopy(from, buf, len);
|
||||
memcpy(buf, from, len);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1431,8 +1430,8 @@ hme_copyfrombuf_contig(sc, to, boff, len)
|
|||
volatile caddr_t buf = sc->sc_rb.rb_rxbuf + (ri * _HME_BUFSZ);
|
||||
|
||||
/*
|
||||
* Just call bcopy() to do the work.
|
||||
* Just call memcpy() to do the work.
|
||||
*/
|
||||
bcopy(buf, to, len);
|
||||
memcpy(to, buf, len);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: i82586.c,v 1.38 2001/07/07 05:35:39 thorpej Exp $ */
|
||||
/* $NetBSD: i82586.c,v 1.39 2001/07/07 15:59:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -147,7 +147,7 @@ Mode of operation:
|
|||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.38 2001/07/07 05:35:39 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.39 2001/07/07 15:59:37 thorpej Exp $");
|
||||
|
||||
#include <sys/systm.h>
|
||||
#include <sys/mbuf.h>
|
||||
|
@ -252,7 +252,7 @@ i82586_attach(sc, name, etheraddr, media, nmedia, defmedia)
|
|||
int i;
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = i82586_start;
|
||||
ifp->if_ioctl = i82586_ioctl;
|
||||
|
@ -1858,7 +1858,7 @@ again:
|
|||
if (sc->mcast_count >= IE_MAXMCAST)
|
||||
goto again; /* Just in case */
|
||||
|
||||
bcopy(enm->enm_addrlo, &sc->mcast_addrs[sc->mcast_count], 6);
|
||||
memcpy(&sc->mcast_addrs[sc->mcast_count], enm->enm_addrlo, 6);
|
||||
sc->mcast_count++;
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lance.c,v 1.23 2001/07/07 05:35:40 thorpej Exp $ */
|
||||
/* $NetBSD: lance.c,v 1.24 2001/07/07 15:59:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -197,7 +197,7 @@ lance_config(sc)
|
|||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
|
||||
/* Initialize ifnet structure. */
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = sc->sc_start;
|
||||
ifp->if_ioctl = lance_ioctl;
|
||||
|
@ -712,9 +712,9 @@ lance_copytobuf_contig(sc, from, boff, len)
|
|||
volatile caddr_t buf = sc->sc_mem;
|
||||
|
||||
/*
|
||||
* Just call bcopy() to do the work.
|
||||
* Just call memcpy() to do the work.
|
||||
*/
|
||||
bcopy(from, buf + boff, len);
|
||||
memcpy(buf + boff, from, len);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -726,9 +726,9 @@ lance_copyfrombuf_contig(sc, to, boff, len)
|
|||
volatile caddr_t buf = sc->sc_mem;
|
||||
|
||||
/*
|
||||
* Just call bcopy() to do the work.
|
||||
* Just call memcpy() to do the work.
|
||||
*/
|
||||
bcopy(buf + boff, to, len);
|
||||
memcpy(to, buf + boff, len);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -860,7 +860,7 @@ lance_copytobuf_gap16(sc, fromv, boff, len)
|
|||
boff &= 0xf;
|
||||
xfer = min(len, 16 - boff);
|
||||
while (len > 0) {
|
||||
bcopy(from, bptr + boff, xfer);
|
||||
memcpy(bptr + boff, from, xfer);
|
||||
from += xfer;
|
||||
bptr += 32;
|
||||
boff = 0;
|
||||
|
@ -884,7 +884,7 @@ lance_copyfrombuf_gap16(sc, tov, boff, len)
|
|||
boff &= 0xf;
|
||||
xfer = min(len, 16 - boff);
|
||||
while (len > 0) {
|
||||
bcopy(bptr + boff, to, xfer);
|
||||
memcpy(to, bptr + boff, xfer);
|
||||
to += xfer;
|
||||
bptr += 32;
|
||||
boff = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */
|
||||
/* $NetBSD: lemac.c,v 1.21 2001/07/07 15:59:38 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
|
||||
|
@ -236,7 +236,7 @@ lemac_read_eeprom(
|
|||
if (sc->sc_eeprom[LEMAC_EEP_SWFLAGS] & LEMAC_EEP_SW_LAB)
|
||||
sc->sc_txctl |= LEMAC_TX_LAB;
|
||||
|
||||
bcopy(&sc->sc_eeprom[LEMAC_EEP_PRDNM], sc->sc_prodname, LEMAC_EEP_PRDNMSZ);
|
||||
memcpy(sc->sc_prodname, &sc->sc_eeprom[LEMAC_EEP_PRDNM], LEMAC_EEP_PRDNMSZ);
|
||||
sc->sc_prodname[LEMAC_EEP_PRDNMSZ] = '\0';
|
||||
|
||||
return cksum % 256;
|
||||
|
@ -298,7 +298,7 @@ lemac_input(
|
|||
}
|
||||
}
|
||||
m->m_data += 2;
|
||||
bcopy((caddr_t)&eh, m->m_data, sizeof(eh));
|
||||
memcpy(m->m_data, (caddr_t)&eh, sizeof(eh));
|
||||
if (LEMAC_USE_PIO_MODE(sc)) {
|
||||
LEMAC_INSB(sc, LEMAC_REG_DAT, length - sizeof(eh),
|
||||
mtod(m, caddr_t) + sizeof(eh));
|
||||
|
@ -596,7 +596,8 @@ lemac_init(
|
|||
LEMAC_INTR_DISABLE(sc);
|
||||
lemac_multicast_filter(sc);
|
||||
if (sc->sc_flags & LEMAC_ALLMULTI)
|
||||
bcopy(lemac_allmulti_mctbl, sc->sc_mctbl, sizeof(sc->sc_mctbl));
|
||||
memcpy(sc->sc_mctbl, lemac_allmulti_mctbl,
|
||||
sizeof(sc->sc_mctbl));
|
||||
if (LEMAC_USE_PIO_MODE(sc)) {
|
||||
LEMAC_OUTB(sc, LEMAC_REG_IOP, 0);
|
||||
LEMAC_OUTB(sc, LEMAC_REG_PI1, LEMAC_MCTBL_OFF & 0xFF);
|
||||
|
@ -777,7 +778,7 @@ lemac_ifioctl(
|
|||
if (ns_nullhost(*ina)) {
|
||||
ina->x_host = *(union ns_host *)sc->sc_enaddr;
|
||||
} else {
|
||||
bcopy((caddr_t)ina->x_host.c_host, sc->sc_enaddr,
|
||||
memcpy(sc->sc_enaddr, (caddr_t)ina->x_host.c_host,
|
||||
ifp->if_addrlen);
|
||||
}
|
||||
break;
|
||||
|
@ -1009,7 +1010,7 @@ lemac_ifattach(
|
|||
{
|
||||
struct ifnet * const ifp = &sc->sc_if;
|
||||
|
||||
bcopy(sc->sc_dv.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dv.dv_xname);
|
||||
|
||||
lemac_reset(sc);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mb86960.c,v 1.47 2001/07/07 05:35:40 thorpej Exp $ */
|
||||
/* $NetBSD: mb86960.c,v 1.48 2001/07/07 15:59:38 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
||||
|
@ -180,7 +180,7 @@ mb86960_attach(sc, type, myea)
|
|||
panic("NULL ethernet address");
|
||||
}
|
||||
#endif
|
||||
bcopy(myea, sc->sc_enaddr, sizeof(sc->sc_enaddr));
|
||||
memcpy(sc->sc_enaddr, myea, sizeof(sc->sc_enaddr));
|
||||
|
||||
/* Disable all interrupts. */
|
||||
bus_space_write_1(bst, bsh, FE_DLCR2, 0);
|
||||
|
@ -203,7 +203,7 @@ mb86960_config(sc, media, nmedia, defmedia)
|
|||
mb86960_stop(sc);
|
||||
|
||||
/* Initialize ifnet structure. */
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = mb86960_start;
|
||||
ifp->if_ioctl = mb86960_ioctl;
|
||||
|
@ -1229,8 +1229,8 @@ mb86960_ioctl(ifp, cmd, data)
|
|||
ina->x_host =
|
||||
*(union ns_host *)LLADDR(ifp->if_sadl);
|
||||
else {
|
||||
bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
|
||||
ETHER_ADDR_LEN);
|
||||
memcpy(LLADDR(ifp->if_sadl),
|
||||
ina->x_host.c_host, ETHER_ADDR_LEN);
|
||||
}
|
||||
/* Set new address. */
|
||||
mb86960_init(sc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rrunner.c,v 1.24 2001/06/19 13:45:56 wiz Exp $ */
|
||||
/* $NetBSD: rrunner.c,v 1.25 2001/07/07 15:59:38 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -407,7 +407,7 @@ eshconfig(sc)
|
|||
|
||||
bus_space_write_4(iot, ioh, RR_MISC_LOCAL_CTL, misc_local_ctl);
|
||||
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = eshstart;
|
||||
ifp->if_ioctl = eshioctl;
|
||||
|
@ -693,7 +693,7 @@ bad_init:
|
|||
/*
|
||||
* Code to handle the Framing Protocol (FP) interface to the esh.
|
||||
* This will allow us to write directly to the wire, with no
|
||||
* intervening bcopy's to slow us down.
|
||||
* intervening memcpy's to slow us down.
|
||||
*/
|
||||
|
||||
int
|
||||
|
@ -3039,9 +3039,8 @@ eshioctl(ifp, cmd, data)
|
|||
ina->x_host = *(union ns_host *)
|
||||
LLADDR(ifp->if_sadl);
|
||||
else
|
||||
bcopy(ina->x_host.c_host,
|
||||
LLADDR(ifp->if_sadl),
|
||||
ifp->if_addrlen);
|
||||
memcpy(LLADDR(ifp->if_sadl),
|
||||
ina->x_host.c_host, ifp->if_addrlen);
|
||||
/* Set new address. */
|
||||
eshinit(sc);
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: smc91cxx.c,v 1.33 2001/06/14 05:44:27 itojun Exp $ */
|
||||
/* $NetBSD: smc91cxx.c,v 1.34 2001/07/07 15:59:38 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -276,7 +276,7 @@ smc91cxx_attach(sc, myea)
|
|||
ether_sprintf(myea));
|
||||
|
||||
/* Initialize the ifnet structure. */
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = smc91cxx_start;
|
||||
ifp->if_ioctl = smc91cxx_ioctl;
|
||||
|
@ -1108,7 +1108,7 @@ smc91cxx_ioctl(ifp, cmd, data)
|
|||
ina->x_host =
|
||||
*(union ns_host *)LLADDR(ifp->if_sadl);
|
||||
else {
|
||||
bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
|
||||
memcpy(LLADDR(ifp->if_sadl), ina->x_host.c_host,
|
||||
ETHER_ADDR_LEN);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue