From 9bf40ede4a299f315bc4b0ae5329631b8c7dc271 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 31 Oct 2003 18:32:15 +0000 Subject: 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) --- sys/dev/awi/if_awi_pccard.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/dev/awi') diff --git a/sys/dev/awi/if_awi_pccard.c b/sys/dev/awi/if_awi_pccard.c index 346802ef2da1..4b0887c61ed3 100644 --- a/sys/dev/awi/if_awi_pccard.c +++ b/sys/dev/awi/if_awi_pccard.c @@ -141,10 +141,9 @@ awi_pccard_attach(device_t dev) psc->sc_mem_res = 0; psc->sc_intrhand = 0; - ifp->if_name = "awi"; - ifp->if_unit = device_get_unit(dev); - snprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), - "%s%d", ifp->if_name, ifp->if_unit); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + strlcpy(sc->sc_dev.dv_xname, ifp->if_xname, + sizeof(sc->sc_dev.dv_xname)); psc->sc_port_rid = 0; psc->sc_port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, -- cgit v1.3