summaryrefslogtreecommitdiffstats
path: root/sys/net/if_sl.c
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/net/if_sl.c
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/net/if_sl.c')
-rw-r--r--sys/net/if_sl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index 1d3fa0b..39fce74 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -288,7 +288,6 @@ slcreate()
sl_compress_init(&sc->sc_comp, -1);
sc->sc_if.if_softc = sc;
- sc->sc_if.if_name = "sl";
sc->sc_if.if_mtu = SLMTU;
sc->sc_if.if_flags =
#ifdef SLIP_IFF_OPTS
@@ -312,12 +311,12 @@ slcreate()
if (slisstatic(unit))
continue;
LIST_FOREACH(nc, &sl_list, sl_next) {
- if (nc->sc_if.if_unit == unit)
+ if (nc->sc_if.if_dunit == unit)
continue;
}
break;
}
- sc->sc_if.if_unit = unit;
+ if_initname(&sc->sc_if, "sl", unit);
LIST_INSERT_HEAD(&sl_list, sc, sl_next);
if_attach(&sc->sc_if);
@@ -450,7 +449,7 @@ sltioctl(tp, cmd, data, flag, td)
s = splimp();
switch (cmd) {
case SLIOCGUNIT:
- *(int *)data = sc->sc_if.if_unit;
+ *(int *)data = sc->sc_if.if_dunit;
break;
case SLIOCSUNIT:
@@ -459,9 +458,9 @@ sltioctl(tp, cmd, data, flag, td)
splx(s);
return (ENXIO);
}
- if (sc->sc_if.if_unit != unit) {
+ if (sc->sc_if.if_dunit != unit) {
LIST_FOREACH(nc, &sl_list, sl_next) {
- if (nc->sc_if.if_unit == *(u_int *)data) {
+ if (nc->sc_if.if_dunit == *(u_int *)data) {
splx(s);
return (ENXIO);
}
@@ -471,7 +470,7 @@ sltioctl(tp, cmd, data, flag, td)
bpfdetach(&sc->sc_if);
if_detach(&sc->sc_if);
LIST_REMOVE(sc, sl_next);
- sc->sc_if.if_unit = unit;
+ if_initname(&sc->sc_if, "sl", unit);
LIST_INSERT_HEAD(&sl_list, sc, sl_next);
if_attach(&sc->sc_if);
bpfattach(&sc->sc_if, DLT_SLIP, SLIP_HDRLEN);
OpenPOWER on IntegriCloud