use aprint_*_dev and device_xname
This commit is contained in:
parent
09275ba76d
commit
cc658c528f
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_etherip.c,v 1.17 2008/02/20 17:05:53 matt Exp $ */
|
||||
/* $NetBSD: if_etherip.c,v 1.18 2008/04/05 13:53:07 cegger Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006, Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
|
||||
@ -86,7 +86,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.17 2008/02/20 17:05:53 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.18 2008/04/05 13:53:07 cegger Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "bpfilter.h"
|
||||
@ -221,7 +221,7 @@ etherip_attach(struct device *parent, struct device *self, void *aux)
|
||||
ui = (tv.tv_sec ^ tv.tv_usec) & 0xffffff;
|
||||
memcpy(enaddr+3, (uint8_t *)&ui, 3);
|
||||
|
||||
aprint_verbose("%s: Ethernet address %s\n", sc->sc_dev.dv_xname,
|
||||
aprint_verbose_dev(&sc->sc_dev, "Ethernet address %s\n",
|
||||
ether_snprintf(enaddrstr, sizeof(enaddrstr), enaddr));
|
||||
|
||||
/*
|
||||
@ -246,7 +246,7 @@ etherip_attach(struct device *parent, struct device *self, void *aux)
|
||||
* to support IPv6.
|
||||
*/
|
||||
ifp = &sc->sc_ec.ec_if;
|
||||
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
|
||||
strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = etherip_ioctl;
|
||||
@ -273,13 +273,13 @@ etherip_attach(struct device *parent, struct device *self, void *aux)
|
||||
* etherip_sysctl_handler for details.
|
||||
*/
|
||||
error = sysctl_createv(NULL, 0, NULL, &node, CTLFLAG_READWRITE,
|
||||
CTLTYPE_STRING, sc->sc_dev.dv_xname, NULL,
|
||||
CTLTYPE_STRING, device_xname(&sc->sc_dev), NULL,
|
||||
etherip_sysctl_handler, 0, sc, 18, CTL_NET,
|
||||
AF_LINK, etherip_node, device_unit(&sc->sc_dev),
|
||||
CTL_EOL);
|
||||
if (error)
|
||||
aprint_error("%s: sysctl_createv returned %d, ignoring\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
aprint_error_dev(&sc->sc_dev, "sysctl_createv returned %d, ignoring\n",
|
||||
error);
|
||||
|
||||
/* insert into etherip_softc_list */
|
||||
LIST_INSERT_HEAD(ðerip_softc_list, sc, etherip_list);
|
||||
@ -309,8 +309,8 @@ etherip_detach(struct device* self, int flags)
|
||||
error = sysctl_destroyv(NULL, CTL_NET, AF_LINK, etherip_node,
|
||||
device_unit(&sc->sc_dev), CTL_EOL);
|
||||
if (error)
|
||||
aprint_error("%s: sysctl_destroyv returned %d, ignoring\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
aprint_error_dev(&sc->sc_dev, "sysctl_destroyv returned %d, ignoring\n",
|
||||
error);
|
||||
|
||||
LIST_REMOVE(sc, etherip_list);
|
||||
etherip_delete_tunnel(ifp);
|
||||
@ -625,8 +625,7 @@ etherip_clone_destroy(struct ifnet *ifp)
|
||||
int error;
|
||||
|
||||
if ((error = config_detach(dev, 0)) != 0)
|
||||
aprint_error("%s: unable to detach instance\n",
|
||||
dev->dv_xname);
|
||||
aprint_error_dev(dev, "unable to detach instance\n");
|
||||
FREE(cf, M_DEVBUF);
|
||||
|
||||
return error;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_boot.c,v 1.69 2007/08/31 22:02:58 dyoung Exp $ */
|
||||
/* $NetBSD: nfs_boot.c,v 1.70 2008/04/05 13:49:36 cegger Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.69 2007/08/31 22:02:58 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.70 2008/04/05 13:49:36 cegger Exp $");
|
||||
|
||||
#include "opt_nfs.h"
|
||||
#include "opt_tftproot.h"
|
||||
@ -119,10 +119,10 @@ nfs_boot_init(nd, lwp)
|
||||
/*
|
||||
* Find the network interface.
|
||||
*/
|
||||
ifp = ifunit(root_device->dv_xname);
|
||||
ifp = ifunit(device_xname(root_device));
|
||||
if (ifp == NULL) {
|
||||
printf("nfs_boot: '%s' not found\n",
|
||||
root_device->dv_xname);
|
||||
device_xname(root_device));
|
||||
return (ENXIO);
|
||||
}
|
||||
nd->nd_ifp = ifp;
|
||||
|
Loading…
Reference in New Issue
Block a user