summaryrefslogtreecommitdiffstats
path: root/sys/dev/cm
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2003-10-31 18:32:15 +0000
committerbrooks <brooks@FreeBSD.org>2003-10-31 18:32:15 +0000
commitf1e94c6f29b079e4ad9d9305ef3e90a719bcbbda (patch)
tree4d9e6671d486576767506230a4240131526fea49 /sys/dev/cm
parentbe546fdee455a96afdefee10d0bdba8547399f5b (diff)
downloadFreeBSD-src-f1e94c6f29b079e4ad9d9305ef3e90a719bcbbda.zip
FreeBSD-src-f1e94c6f29b079e4ad9d9305ef3e90a719bcbbda.tar.gz
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)
Diffstat (limited to 'sys/dev/cm')
-rw-r--r--sys/dev/cm/if_cm_isa.c2
-rw-r--r--sys/dev/cm/smc90cx6.c25
-rw-r--r--sys/dev/cm/smc90cx6var.h2
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 a478406..8f7732f 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 ff4bfe9..89a3415 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 ad6d09a..1703145 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);
OpenPOWER on IntegriCloud