diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
commit | 9bf40ede4a299f315bc4b0ae5329631b8c7dc271 (patch) | |
tree | 4d9e6671d486576767506230a4240131526fea49 /sys/dev/cm | |
parent | dc6279b887bf4473d77b898631f74466b5f7a094 (diff) | |
download | src-9bf40ede4a299f315bc4b0ae5329631b8c7dc271.tar.gz src-9bf40ede4a299f315bc4b0ae5329631b8c7dc271.zip |
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.
Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)
Notes
Notes:
svn path=/head/; revision=121816
Diffstat (limited to 'sys/dev/cm')
-rw-r--r-- | sys/dev/cm/if_cm_isa.c | 2 | ||||
-rw-r--r-- | sys/dev/cm/smc90cx6.c | 25 | ||||
-rw-r--r-- | sys/dev/cm/smc90cx6var.h | 2 |
3 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/cm/if_cm_isa.c b/sys/dev/cm/if_cm_isa.c index a478406664c7..8f7732fd80e1 100644 --- a/sys/dev/cm/if_cm_isa.c +++ b/sys/dev/cm/if_cm_isa.c @@ -96,7 +96,7 @@ cm_isa_attach(dev) return (error); } - return cm_attach(sc, device_get_unit(dev)); + return cm_attach(dev); } static int diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index ff4bfe9fec1b..89a3415ed0d1 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -274,10 +274,10 @@ cm_release_resources(dev) } int -cm_attach(sc, unit) - struct cm_softc *sc; - int unit; +cm_attach(dev) + device_t dev; { + struct cm_softc *sc = device_get_softc(dev); struct ifnet *ifp = &sc->sc_arccom.ac_if; int s; u_int8_t linkaddress; @@ -313,8 +313,7 @@ cm_attach(sc, unit) cm_stop(sc); ifp->if_softc = sc; - ifp->if_unit = unit; - ifp->if_name = "cm"; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_output = arc_output; ifp->if_start = cm_start; ifp->if_ioctl = cm_ioctl; @@ -841,8 +840,8 @@ cmintr(arg) */ PUTREG(CMCMD, CM_CLR(CLR_POR)); log(LOG_WARNING, - "%s%d: intr: got spurious power on reset int\n", - ifp->if_name, ifp->if_unit); + "%s: intr: got spurious power on reset int\n", + ifp->if_xname); } if (maskedisr & CM_RECON) { @@ -872,9 +871,9 @@ cmintr(arg) if ((newsec - sc->sc_recontime <= 2) && (++sc->sc_reconcount == ARC_EXCESSIVE_RECONS)) { log(LOG_WARNING, - "%s%d: excessive token losses, " + "%s: excessive token losses, " "cable problem?\n", - ifp->if_name, ifp->if_unit); + ifp->if_xname); } sc->sc_recontime = newsec; callout_reset(&sc->sc_recon_ch, 15 * hz, @@ -895,8 +894,8 @@ cmintr(arg) * configured sender) */ log(LOG_WARNING, - "%s%d: spurious RX interupt or sender 0 " - " (ignored)\n", ifp->if_name, ifp->if_unit); + "%s: spurious RX interupt or sender 0 " + " (ignored)\n", ifp->if_xname); /* * restart receiver on same buffer. * XXX maybe better reset interface? @@ -958,8 +957,8 @@ cm_reconwatch(arg) if (sc->sc_reconcount >= ARC_EXCESSIVE_RECONS) { sc->sc_reconcount = 0; - log(LOG_WARNING, "%s%d: token valid again.\n", - ifp->if_name, ifp->if_unit); + log(LOG_WARNING, "%s: token valid again.\n", + ifp->if_xname); } sc->sc_reconcount = 0; } diff --git a/sys/dev/cm/smc90cx6var.h b/sys/dev/cm/smc90cx6var.h index ad6d09a8127c..1703145d4093 100644 --- a/sys/dev/cm/smc90cx6var.h +++ b/sys/dev/cm/smc90cx6var.h @@ -87,7 +87,7 @@ struct cm_softc { u_char sc_retransmits[2]; /* unused at the moment */ }; -int cm_attach(struct cm_softc *, int unit); +int cm_attach(device_t dev); void cmintr(void *); int cm_probe(device_t dev); |