summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorcegger <cegger@NetBSD.org>2008-04-05 21:31:23 +0000
committercegger <cegger@NetBSD.org>2008-04-05 21:31:23 +0000
commitbebbf57b687ff849c8d5308e39a79c28baeeb3e1 (patch)
tree33ae1a0ed6776be305b63fb6076a9df66ff5db7b /sys/dev
parent8a487dca063cec630d2e07cfa9cbeb0d530be748 (diff)
use aprint_*_dev and device_xname
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/adb/adb_bt.c6
-rw-r--r--sys/dev/pcmcia/aic_pcmcia.c8
-rw-r--r--sys/dev/pcmcia/esl.c22
-rw-r--r--sys/dev/pcmcia/esl_pcmcia.c8
-rw-r--r--sys/dev/pcmcia/esp_pcmcia.c12
-rw-r--r--sys/dev/pcmcia/if_an_pcmcia.c9
-rw-r--r--sys/dev/pcmcia/if_awi_pcmcia.c8
-rw-r--r--sys/dev/pcmcia/if_cnw.c41
-rw-r--r--sys/dev/pcmcia/if_cs_pcmcia.c8
-rw-r--r--sys/dev/pcmcia/if_ep_pcmcia.c17
-rw-r--r--sys/dev/pcmcia/if_mbe_pcmcia.c22
-rw-r--r--sys/dev/pcmcia/if_ne_pcmcia.c6
-rw-r--r--sys/dev/pcmcia/if_ray.c154
-rw-r--r--sys/dev/pcmcia/if_sm_pcmcia.c9
-rw-r--r--sys/dev/pcmcia/if_tr_pcmcia.c21
-rw-r--r--sys/dev/pcmcia/if_wi_pcmcia.c16
-rw-r--r--sys/dev/pcmcia/if_xi.c14
-rw-r--r--sys/dev/pcmcia/isic_pcmcia.c15
-rw-r--r--sys/dev/pcmcia/mhzc.c28
-rw-r--r--sys/dev/pcmcia/pcmcia.c28
-rw-r--r--sys/dev/pcmcia/pcmcia_cis.c29
-rw-r--r--sys/dev/pcmcia/pcmcia_cis_quirks.c6
-rw-r--r--sys/dev/pcmcia/pcmcom.c8
-rw-r--r--sys/dev/pcmcia/xirc.c25
24 files changed, 242 insertions, 278 deletions
diff --git a/sys/dev/adb/adb_bt.c b/sys/dev/adb/adb_bt.c
index ae7421443bb..c77694d3d38 100644
--- a/sys/dev/adb/adb_bt.c
+++ b/sys/dev/adb/adb_bt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_bt.c,v 1.2 2008/03/26 18:04:15 matt Exp $ */
+/* $NetBSD: adb_bt.c,v 1.3 2008/04/05 21:33:33 cegger Exp $ */
/*-
* Copyright (c) 2006 Michael Lorenz
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_bt.c,v 1.2 2008/03/26 18:04:15 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_bt.c,v 1.3 2008/04/05 21:33:33 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,7 +171,7 @@ adbbt_handler(void *cookie, int len, uint8_t *data)
#ifdef ADBBT_DEBUG
int i;
- printf("%s: %02x - ", sc->sc_dev.dv_xname, sc->sc_us);
+ printf("%s: %02x - ", device_xname(&sc->sc_dev), sc->sc_us);
for (i = 0; i < len; i++) {
printf(" %02x", data[i]);
}
diff --git a/sys/dev/pcmcia/aic_pcmcia.c b/sys/dev/pcmcia/aic_pcmcia.c
index 122839a584f..285f613c954 100644
--- a/sys/dev/pcmcia/aic_pcmcia.c
+++ b/sys/dev/pcmcia/aic_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aic_pcmcia.c,v 1.36 2007/10/19 12:01:03 ad Exp $ */
+/* $NetBSD: aic_pcmcia.c,v 1.37 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.36 2007/10/19 12:01:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.37 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,7 +122,7 @@ aic_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pf, aic_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -136,7 +136,7 @@ aic_pcmcia_attach(struct device *parent, struct device *self,
goto fail;
if (!aic_find(sc->sc_iot, sc->sc_ioh)) {
- aprint_error("%s: unable to detect chip!\n", self->dv_xname);
+ aprint_error_dev(self, "unable to detect chip!\n");
goto fail2;
}
diff --git a/sys/dev/pcmcia/esl.c b/sys/dev/pcmcia/esl.c
index 1e62968d8c1..beeca9818e3 100644
--- a/sys/dev/pcmcia/esl.c
+++ b/sys/dev/pcmcia/esl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esl.c,v 1.22 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: esl.c,v 1.23 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 2001 Jared D. McNeill <jmcneill@invisible.ca>
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esl.c,v 1.22 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esl.c,v 1.23 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -155,8 +155,7 @@ esl_open(void *hdl, int flags)
return ENXIO;
if (esl_reset(sc) != 0) {
- printf("%s: esl_open: esl_reset failed\n",
- sc->sc_esl.sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_esl.sc_dev, "esl_open: esl_reset failed\n");
return ENXIO;
}
@@ -485,8 +484,7 @@ esl_trigger_output(void *hdl, void *start, void *end, int blksize,
iot = sc->sc_iot;
ioh = sc->sc_ioh;
if (sc->sc_esl.active) {
- printf("%s: esl_trigger_output: already running\n",
- sc->sc_esl.sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_esl.sc_dev, "esl_trigger_output: already running\n");
return 1;
}
@@ -535,7 +533,7 @@ esl_trigger_output(void *hdl, void *start, void *end, int blksize,
esl_write_x_reg(sc, ESS_XCMD_AUDIO1_CTRL2, reg);
cnt = (char *)end - (char *)start;
if (cnt == 0)
- printf("%s: no count left\n", sc->sc_esl.sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_esl.sc_dev, "no count left\n");
sc->sc_esl.sc_dmaaddr = sc->sc_esl.sc_dmastart = start;
sc->sc_esl.sc_dmaend = end;
@@ -572,14 +570,12 @@ esl_init(struct esl_pcmcia_softc *sc)
for (i = 0; ENABLE_ORDER[i] != -1; i++)
bus_space_read_1(iot, ioh, ENABLE[i]);
if (esl_reset(sc)) {
- printf("%s: esl_init: esl_reset failed\n",
- sc->sc_esl.sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_esl.sc_dev, "esl_init: esl_reset failed\n");
return 1;
}
if (esl_identify(sc)) {
- printf("%s: esl_init: esl_identify failed\n",
- sc->sc_esl.sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_esl.sc_dev, "esl_init: esl_identify failed\n");
return 1;
}
@@ -600,12 +596,12 @@ esl_init(struct esl_pcmcia_softc *sc)
if (model == ESS_UNSUPPORTED) {
printf("%s: unknown model 0x%04x\n",
- sc->sc_esl.sc_dev.dv_xname, sc->sc_esl.sc_version);
+ device_xname(&sc->sc_esl.sc_dev), sc->sc_esl.sc_version);
return 1;
}
printf("%s: ESS AudioDrive %s [version 0x%04x]\n",
- sc->sc_esl.sc_dev.dv_xname, eslmodel[model],
+ device_xname(&sc->sc_esl.sc_dev), eslmodel[model],
sc->sc_esl.sc_version);
/* Set volumes to 50% */
diff --git a/sys/dev/pcmcia/esl_pcmcia.c b/sys/dev/pcmcia/esl_pcmcia.c
index 0115ae33a3d..d0dfecd395f 100644
--- a/sys/dev/pcmcia/esl_pcmcia.c
+++ b/sys/dev/pcmcia/esl_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esl_pcmcia.c,v 1.18 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: esl_pcmcia.c,v 1.19 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 2000 Jared D. McNeill <jmcneill@invisible.ca>
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esl_pcmcia.c,v 1.18 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esl_pcmcia.c,v 1.19 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -113,7 +113,7 @@ esl_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pf, esl_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -131,7 +131,7 @@ esl_pcmcia_attach(struct device *parent, struct device *self,
esc->sc_disable = esl_pcmcia_disable;
if (!esl_init(esc))
- aprint_error("%s: initialization failed\n", self->dv_xname);
+ aprint_error_dev(self, "initialization failed\n");
esl_pcmcia_disable(esc);
esc->sc_state = ESL_PCMCIA_ATTACHED;
diff --git a/sys/dev/pcmcia/esp_pcmcia.c b/sys/dev/pcmcia/esp_pcmcia.c
index 1b09c5a4baf..53cf4cdd55e 100644
--- a/sys/dev/pcmcia/esp_pcmcia.c
+++ b/sys/dev/pcmcia/esp_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_pcmcia.c,v 1.33 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: esp_pcmcia.c,v 1.34 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 2000, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.33 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.34 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -170,7 +170,7 @@ esp_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pf, esp_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -180,7 +180,7 @@ esp_pcmcia_attach(struct device *parent, struct device *self,
esc->sc_ioh = cfe->iospace[0].handle.ioh;
esp_pcmcia_init(esc);
- printf("%s", self->dv_xname);
+ printf("%s", device_xname(self));
sc->sc_adapter.adapt_minphys = minphys;
sc->sc_adapter.adapt_request = ncr53c9x_scsipi_request;
@@ -351,7 +351,7 @@ esp_pcmcia_dma_intr(sc)
int cnt;
if (esc->sc_active == 0) {
- printf("%s: dma_intr--inactive DMA\n", sc->sc_dev.dv_xname);
+ printf("%s: dma_intr--inactive DMA\n", device_xname(&sc->sc_dev));
return -1;
}
@@ -363,7 +363,7 @@ esp_pcmcia_dma_intr(sc)
cnt = *esc->sc_pdmalen;
if (*esc->sc_pdmalen == 0) {
printf("%s: data interrupt, but no count left\n",
- sc->sc_dev.dv_xname);
+ device_xname(&sc->sc_dev));
}
p = *esc->sc_dmaaddr;
diff --git a/sys/dev/pcmcia/if_an_pcmcia.c b/sys/dev/pcmcia/if_an_pcmcia.c
index 6ebb53be71e..177dbcee4bb 100644
--- a/sys/dev/pcmcia/if_an_pcmcia.c
+++ b/sys/dev/pcmcia/if_an_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_an_pcmcia.c,v 1.33 2007/12/09 20:28:14 jmcneill Exp $ */
+/* $NetBSD: if_an_pcmcia.c,v 1.34 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 2000, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_an_pcmcia.c,v 1.33 2007/12/09 20:28:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_an_pcmcia.c,v 1.34 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -139,7 +139,7 @@ an_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pa->pf, an_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -158,8 +158,7 @@ an_pcmcia_attach(struct device *parent, struct device *self,
error = an_attach(sc);
if (error) {
- aprint_error("%s: failed to attach controller\n",
- self->dv_xname);
+ aprint_error_dev(self, "failed to attach controller\n");
goto fail2;
}
diff --git a/sys/dev/pcmcia/if_awi_pcmcia.c b/sys/dev/pcmcia/if_awi_pcmcia.c
index b69917b5218..c8a9cc0048d 100644
--- a/sys/dev/pcmcia/if_awi_pcmcia.c
+++ b/sys/dev/pcmcia/if_awi_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_awi_pcmcia.c,v 1.38 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: if_awi_pcmcia.c,v 1.39 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1999, 2004 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.38 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.39 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -201,7 +201,7 @@ awi_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pa->pf, awi_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -232,7 +232,7 @@ awi_pcmcia_attach(struct device *parent, struct device *self,
sc->sc_cansleep = 1;
if (awi_attach(sc) != 0) {
- printf("%s: failed to attach controller\n", self->dv_xname);
+ aprint_error_dev(self, "failed to attach controller\n");
goto fail2;
}
diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c
index 9e65cd52bd9..ae504fb675a 100644
--- a/sys/dev/pcmcia/if_cnw.c
+++ b/sys/dev/pcmcia/if_cnw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cnw.c,v 1.42 2007/09/01 07:32:31 dyoung Exp $ */
+/* $NetBSD: if_cnw.c,v 1.43 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.42 2007/09/01 07:32:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.43 2008/04/05 21:31:23 cegger Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -270,7 +270,7 @@ wait_WOC(sc, line)
DELAY(100);
}
if (line > 0)
- printf("%s: wedged at line %d\n", sc->sc_dev.dv_xname, line);
+ printf("%s: wedged at line %d\n", device_xname(&sc->sc_dev), line);
return (1);
}
#define WAIT_WOC(sc) wait_WOC(sc, __LINE__)
@@ -310,7 +310,7 @@ cnw_cmd(sc, cmd, count, arg1, arg2)
if (wait_WOC(sc, 0)) {
printf("%s: wedged when issuing cmd 0x%x\n",
- sc->sc_dev.dv_xname, cmd);
+ device_xname(&sc->sc_dev), cmd);
/*
* We'll continue anyway, as that's probably the best
* thing we can do; at least the user knows there's a
@@ -348,7 +348,7 @@ cnw_reset(sc)
{
#ifdef CNW_DEBUG
if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG)
- printf("%s: resetting\n", sc->sc_dev.dv_xname);
+ printf("%s: resetting\n", device_xname(&sc->sc_dev));
#endif
wait_WOC(sc, 0);
#ifndef MEMORY_MAPPED
@@ -439,12 +439,11 @@ cnw_enable(sc)
sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_NET, cnw_intr, sc);
if (sc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt handler\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n");
return (EIO);
}
if (pcmcia_function_enable(sc->sc_pf) != 0) {
- printf("%s: couldn't enable card\n", sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "couldn't enable card\n");
return (EIO);
}
sc->sc_resource |= CNW_RES_PCIC;
@@ -513,7 +512,7 @@ cnw_attach(struct device *parent, struct device *self, void *aux)
sc->sc_pf = pa->pf;
pcmcia_function_init(sc->sc_pf, SIMPLEQ_FIRST(&sc->sc_pf->cfe_head));
if (pcmcia_function_enable(sc->sc_pf)) {
- printf("%s: function enable failed\n", self->dv_xname);
+ aprint_error_dev(self, "function enable failed\n");
return;
}
sc->sc_resource |= CNW_RES_PCIC;
@@ -522,12 +521,12 @@ cnw_attach(struct device *parent, struct device *self, void *aux)
#ifndef MEMORY_MAPPED
if (pcmcia_io_alloc(sc->sc_pf, 0, CNW_IO_SIZE, CNW_IO_SIZE,
&sc->sc_pcioh) != 0) {
- printf("%s: can't allocate i/o space\n", self->dv_xname);
+ aprint_error_dev(self, "can't allocate i/o space\n");
goto fail;
}
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO16, &sc->sc_pcioh,
&sc->sc_iowin) != 0) {
- printf("%s: can't map i/o space\n", self->dv_xname);
+ aprint_error_dev(self, "can't map i/o space\n");
pcmcia_io_free(sc->sc_pf, &sc->sc_pcioh);
goto fail;
}
@@ -541,13 +540,13 @@ cnw_attach(struct device *parent, struct device *self, void *aux)
memsize = CNW_MEM_SIZE + CNW_IOM_SIZE;
#endif
if (pcmcia_mem_alloc(sc->sc_pf, memsize, &sc->sc_pcmemh) != 0) {
- printf("%s: can't allocate memory\n", self->dv_xname);
+ aprint_error_dev(self, "can't allocate memory\n");
goto fail;
}
if (pcmcia_mem_map(sc->sc_pf, PCMCIA_WIDTH_MEM8|PCMCIA_MEM_COMMON,
CNW_MEM_ADDR, memsize, &sc->sc_pcmemh, &sc->sc_memoff,
&sc->sc_memwin) != 0) {
- printf("%s: can't map memory\n", self->dv_xname);
+ aprint_error_dev(self, "can't map memory\n");
pcmcia_mem_free(sc->sc_pf, &sc->sc_pcmemh);
goto fail;
}
@@ -564,11 +563,11 @@ cnw_attach(struct device *parent, struct device *self, void *aux)
for (i = 0; i < ETHER_ADDR_LEN; i++)
macaddr[i] = bus_space_read_1(sc->sc_memt, sc->sc_memh,
sc->sc_memoff + CNW_EREG_PA + i);
- printf("%s: address %s\n", sc->sc_dev.dv_xname,
+ printf("%s: address %s\n", device_xname(&sc->sc_dev),
ether_sprintf(macaddr));
/* Set up ifnet structure */
- 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_start = cnw_start;
ifp->if_ioctl = cnw_ioctl;
@@ -725,7 +724,7 @@ cnw_transmit(sc, m0)
#ifdef CNW_DEBUG
if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG)
printf("%s: cnw_transmit b=0x%x s=%d o=0x%x\n",
- sc->sc_dev.dv_xname, buffer, bufsize, bufoffset);
+ device_xname(&sc->sc_dev), buffer, bufsize, bufoffset);
#endif
/* Copy data from mbuf chain to card buffers */
@@ -744,7 +743,7 @@ cnw_transmit(sc, m0)
#ifdef CNW_DEBUG
if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG)
printf("%s: next buffer @0x%x\n",
- sc->sc_dev.dv_xname, buffer);
+ device_xname(&sc->sc_dev), buffer);
#endif
}
n = mbytes <= bufspace ? mbytes : bufspace;
@@ -779,7 +778,7 @@ cnw_read(sc)
totbytes = read16(sc, CNW_EREG_RDP);
#ifdef CNW_DEBUG
if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG)
- printf("%s: recv %d bytes\n", sc->sc_dev.dv_xname, totbytes);
+ printf("%s: recv %d bytes\n", device_xname(&sc->sc_dev), totbytes);
#endif
buffer = CNW_EREG_RDP + 2;
bufbytes = 0;
@@ -830,7 +829,7 @@ cnw_read(sc)
#ifdef CNW_DEBUG
if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG)
printf("%s: %d bytes @0x%x+0x%lx\n",
- sc->sc_dev.dv_xname, bufbytes,
+ device_xname(&sc->sc_dev), bufbytes,
buffer, bufptr - buffer -
sc->sc_memoff);
#endif
@@ -922,7 +921,7 @@ cnw_intr(arg)
if (!(status & 0x02)) {
if (ret == 0)
printf("%s: spurious interrupt\n",
- sc->sc_dev.dv_xname);
+ device_xname(&sc->sc_dev));
return (ret);
}
ret = 1;
@@ -1151,7 +1150,7 @@ cnw_watchdog(ifp)
{
struct cnw_softc *sc = ifp->if_softc;
- printf("%s: device timeout; card reset\n", sc->sc_dev.dv_xname);
+ printf("%s: device timeout; card reset\n", device_xname(&sc->sc_dev));
++ifp->if_oerrors;
cnw_init(sc);
}
diff --git a/sys/dev/pcmcia/if_cs_pcmcia.c b/sys/dev/pcmcia/if_cs_pcmcia.c
index 70842df41b4..7a494b6af41 100644
--- a/sys/dev/pcmcia/if_cs_pcmcia.c
+++ b/sys/dev/pcmcia/if_cs_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cs_pcmcia.c,v 1.15 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: if_cs_pcmcia.c,v 1.16 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c)2001 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cs_pcmcia.c,v 1.15 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cs_pcmcia.c,v 1.16 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,8 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_cs_pcmcia.c,v 1.15 2007/10/19 12:01:04 ad Exp $")
#include <dev/ic/cs89x0reg.h>
#include <dev/ic/cs89x0var.h>
-#define DEVNAME(sc) ((sc)->sc_dev.dv_xname)
-
struct cs_pcmcia_softc;
static int cs_pcmcia_match(struct device *, struct cfdata *, void *);
@@ -114,7 +112,7 @@ cs_pcmcia_attach(struct device *parent, struct device *self, void *aux)
error = pcmcia_function_configure(pa->pf, cs_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c
index 22e6e961958..dee3daf93fd 100644
--- a/sys/dev/pcmcia/if_ep_pcmcia.c
+++ b/sys/dev/pcmcia/if_ep_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ep_pcmcia.c,v 1.59 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: if_ep_pcmcia.c,v 1.60 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ep_pcmcia.c,v 1.59 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ep_pcmcia.c,v 1.60 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -281,8 +281,7 @@ ep_pcmcia_attach(parent, self, aux)
}
}
if (!cfe) {
- aprint_error("%s: failed to allocate I/O space\n",
- self->dv_xname);
+ aprint_error_dev(self, "failed to allocate I/O space\n");
goto ioalloc_failed;
}
@@ -295,7 +294,7 @@ ep_pcmcia_attach(parent, self, aux)
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
PCMCIA_WIDTH_AUTO : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
&psc->sc_io_window)) {
- aprint_error("%s: can't map i/o space\n", self->dv_xname);
+ aprint_error_dev(self, "can't map i/o space\n");
goto iomap_failed;
}
@@ -334,13 +333,11 @@ ep_pcmcia_attach(parent, self, aux)
sc->disable = ep_pcmcia_disable;
if (epconfig(sc, epp->epp_chipset, enaddr))
- aprint_error("%s: couldn't configure controller\n",
- self->dv_xname);
+ aprint_error_dev(self, "couldn't configure controller\n");
- psc->sc_powerhook = powerhook_establish(self->dv_xname, ep_power, sc);
+ psc->sc_powerhook = powerhook_establish(device_xname(self), ep_power, sc);
if (psc->sc_powerhook == NULL)
- aprint_error("%s: WARNING: unable to establish power hook\n",
- self->dv_xname);
+ aprint_error_dev(self, "WARNING: unable to establish power hook\n");
sc->enabled = 0;
ep_pcmcia_disable(sc);
diff --git a/sys/dev/pcmcia/if_mbe_pcmcia.c b/sys/dev/pcmcia/if_mbe_pcmcia.c
index 45dd768c419..25cb6594ac5 100644
--- a/sys/dev/pcmcia/if_mbe_pcmcia.c
+++ b/sys/dev/pcmcia/if_mbe_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mbe_pcmcia.c,v 1.42 2007/10/19 12:01:04 ad Exp $ */
+/* $NetBSD: if_mbe_pcmcia.c,v 1.43 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmcia.c,v 1.42 2007/10/19 12:01:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmcia.c,v 1.43 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -182,7 +182,7 @@ mbe_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pa->pf, mbe_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -200,22 +200,20 @@ mbe_pcmcia_attach(struct device *parent, struct device *self,
if (mpp->mpp_enet_maddr >= 0) {
pgea.maddr = mpp->mpp_enet_maddr;
if (mbe_pcmcia_get_enaddr_from_mem(psc, &pgea) != 0) {
- printf("%s: couldn't get ethernet address "
- "from memory\n", self->dv_xname);
+ aprint_error_dev(self, "couldn't get ethernet address "
+ "from memory\n");
goto fail;
}
} else if (mpp->mpp_flags & MBH10302) {
bus_space_write_1(sc->sc_bst, sc->sc_bsh, FE_MBH0 ,
FE_MBH0_MASK | FE_MBH0_INTR_ENABLE);
if (mbe_pcmcia_get_enaddr_from_io(psc, &pgea) != 0) {
- printf("%s: couldn't get ethernet address from i/o\n",
- self->dv_xname);
+ aprint_error_dev(self, "couldn't get ethernet address from i/o\n");
goto fail;
}
} else {
if (pa->pf->pf_funce_lan_nidlen != ETHER_ADDR_LEN) {
- printf("%s: couldn't get ethernet address from CIS\n",
- self->dv_xname);
+ aprint_error_dev(self, "couldn't get ethernet address from CIS\n");
goto fail;
}
memcpy(pgea.enaddr, pa->pf->pf_funce_lan_nid, ETHER_ADDR_LEN);
@@ -322,15 +320,13 @@ mbe_pcmcia_get_enaddr_from_mem(psc, ea)
goto bad_memaddr;
if (pcmcia_mem_alloc(psc->sc_pf, ETHER_ADDR_LEN * 2, &pcmh)) {
- printf("%s: can't alloc mem for enet addr\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "can't alloc mem for enet addr\n");
goto memalloc_failed;
}
if (pcmcia_mem_map(psc->sc_pf, PCMCIA_MEM_ATTR, ea->maddr,
ETHER_ADDR_LEN * 2, &pcmh, &offset, &mwindow)) {
- printf("%s: can't map mem for enet addr\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "can't map mem for enet addr\n");
goto memmap_failed;
}
diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c
index 5e0df9b8c7b..6a913a28cf1 100644
--- a/sys/dev/pcmcia/if_ne_pcmcia.c
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ne_pcmcia.c,v 1.153 2008/03/28 01:37:25 uwe Exp $ */
+/* $NetBSD: if_ne_pcmcia.c,v 1.154 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.153 2008/03/28 01:37:25 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.154 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -729,7 +729,7 @@ found:
if (ne2000_attach(nsc, enaddr))
goto fail2;
- psc->sc_powerhook = powerhook_establish(self->dv_xname,
+ psc->sc_powerhook = powerhook_establish(device_xname(self),
ne2000_power, nsc);
if (psc->sc_powerhook == NULL)
aprint_error_dev(self,
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index 50a1694601b..44406445262 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ray.c,v 1.69 2008/03/10 03:28:34 dholland Exp $ */
+/* $NetBSD: if_ray.c,v 1.70 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 2000 Christian E. Hopps
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.69 2008/03/10 03:28:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.70 2008/04/05 21:31:23 cegger Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -226,7 +226,6 @@ struct ray_softc {
#define sc_version sc_ecf_startup.e_fw_build_string
#define sc_tibsize sc_ecf_startup.e_tib_size
#define sc_if sc_ec.ec_if
-#define sc_xname sc_dev.dv_xname
/* modes of operation */
#define SC_MODE_ADHOC 0 /* ad-hoc mode */
@@ -514,7 +513,7 @@ ray_attach(struct device *parent, struct device *self, void *aux)
/*XXXmem8|common*/
error = pcmcia_function_configure(pa->pf, ray_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -538,15 +537,15 @@ ray_attach(struct device *parent, struct device *self, void *aux)
/* check to see that card initialized properly */
if (ep->e_status != RAY_ECFS_CARD_OK) {
- aprint_error("%s: card failed self test: status %d\n",
- self->dv_xname, sc->sc_ecf_startup.e_status);
+ aprint_error_dev(self, "card failed self test: status %d\n",
+ sc->sc_ecf_startup.e_status);
goto fail2;
}
/* check firmware version */
if (sc->sc_version != SC_BUILD_4 && sc->sc_version != SC_BUILD_5) {
- aprint_error("%s: unsupported firmware version %d\n",
- self->dv_xname, ep->e_fw_build_string);
+ aprint_error_dev(self, "unsupported firmware version %d\n",
+ ep->e_fw_build_string);
goto fail2;
}
@@ -571,17 +570,17 @@ ray_attach(struct device *parent, struct device *self, void *aux)
* attach the interface
*/
/* The version isn't the most accurate way, but it's easy. */
- aprint_normal("%s: firmware version %d\n", self->dv_xname,
+ aprint_normal_dev(self, "firmware version %d\n",
sc->sc_version);
if (sc->sc_version != SC_BUILD_4)
- aprint_normal("%s: supported rates %0x:%0x:%0x:%0x:%0x:%0x:%0x:%0x\n",
- self->dv_xname, ep->e_rates[0], ep->e_rates[1],
+ aprint_normal_dev(self, "supported rates %0x:%0x:%0x:%0x:%0x:%0x:%0x:%0x\n",
+ ep->e_rates[0], ep->e_rates[1],
ep->e_rates[2], ep->e_rates[3], ep->e_rates[4],
ep->e_rates[5], ep->e_rates[6], ep->e_rates[7]);
- aprint_normal("%s: 802.11 address %s\n", self->dv_xname,
+ aprint_normal_dev(self, "802.11 address %s\n",
ether_sprintf(ep->e_station_addr));
- memcpy(ifp->if_xname, self->dv_xname, IFNAMSIZ);
+ memcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_start = ray_if_start;
ifp->if_stop = ray_if_stop;
@@ -630,7 +629,7 @@ ray_activate(dev, act)
int s;
int rv = 0;
- RAY_DPRINTF(("%s: activate\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: activate\n", device_xname(&sc->sc_dev)));
s = splnet();
switch (act) {
@@ -654,7 +653,7 @@ ray_detach(struct device *self, int flags)
sc = device_private(self);
ifp = &sc->sc_if;
- RAY_DPRINTF(("%s: detach\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: detach\n", device_xname(&sc->sc_dev)));
if (!sc->sc_attached)
return (0);
@@ -682,7 +681,7 @@ ray_enable(sc)
{
int error;
- RAY_DPRINTF(("%s: enable\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: enable\n", device_xname(&sc->sc_dev)));
sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_NET,
ray_intr, sc);
@@ -705,7 +704,7 @@ static void
ray_disable(sc)
struct ray_softc *sc;
{
- RAY_DPRINTF(("%s: disable\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: disable\n", device_xname(&sc->sc_dev)));
ray_stop(sc);
@@ -732,7 +731,7 @@ ray_init(sc)
bus_size_t ccs;
int i;
- RAY_DPRINTF(("%s: init\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: init\n", device_xname(&sc->sc_dev)));
if ((sc->sc_if.if_flags & IFF_RUNNING))
ray_stop(sc);
@@ -740,7 +739,7 @@ ray_init(sc)
if (pcmcia_function_enable(sc->sc_pf))
return (EIO);
- RAY_DPRINTF(("%s: init post-enable\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: init post-enable\n", device_xname(&sc->sc_dev)));
/* reset some values */
memset(sc->sc_ccsinuse, 0, sizeof(sc->sc_ccsinuse));
@@ -765,7 +764,7 @@ ray_init(sc)
if (ep->e_status != RAY_ECFS_CARD_OK) {
pcmcia_function_disable(sc->sc_pf);
printf("%s: card failed self test: status %d\n",
- sc->sc_xname, sc->sc_ecf_startup.e_status);
+ device_xname(&sc->sc_dev), sc->sc_ecf_startup.e_status);
return (EIO);
}
@@ -809,7 +808,7 @@ static void
ray_stop(sc)
struct ray_softc *sc;
{
- RAY_DPRINTF(("%s: stop\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: stop\n", device_xname(&sc->sc_dev)));
callout_stop(&sc->sc_check_ccs_ch);
sc->sc_timocheck = 0;
@@ -839,15 +838,14 @@ ray_reset(sc)
{
if (++sc->sc_resetloop >= RAY_MAX_RESETS) {
if (sc->sc_resetloop == RAY_MAX_RESETS) {
- printf("%s: unable to correct, disabling\n",
- sc->sc_xname);
+ aprint_error_dev(&sc->sc_dev, "unable to correct, disabling\n");
callout_stop(&sc->sc_reset_resetloop_ch);
callout_reset(&sc->sc_disable_ch, 1,
(void (*)(void *))ray_disable, sc);
}
} else {
- printf("%s: unexpected failure resetting hw [%d more]\n",
- sc->sc_xname, RAY_MAX_RESETS - sc->sc_resetloop);
+ aprint_error_dev(&sc->sc_dev, "unexpected failure resetting hw [%d more]\n",
+ RAY_MAX_RESETS - sc->sc_resetloop);
callout_stop(&sc->sc_reset_resetloop_ch);
ray_init(sc);
callout_reset(&sc->sc_reset_resetloop_ch, 30 * hz,
@@ -1272,7 +1270,7 @@ ray_intr_start(sc)
pcount++;
m_freem(m0);
- RAY_DPRINTF_XMIT(("%s: sent packet: len %ld\n", sc->sc_xname,
+ RAY_DPRINTF_XMIT(("%s: sent packet: len %ld\n", device_xname(&sc->sc_dev),
(u_long)pktlen));
}
@@ -1286,14 +1284,14 @@ ray_intr_start(sc)
* be a confused state though because we check above
* and don't issue any commands between.
*/
- printf("%s: dropping tx packets device busy\n", sc->sc_xname);
+ printf("%s: dropping tx packets device busy\n", device_xname(&sc->sc_dev));
ray_free_ccs_chain(sc, firsti);
ifp->if_oerrors += pcount;
return;
}
/* send it off */
- RAY_DPRINTF(("%s: ray_start issuing %d \n", sc->sc_xname, firsti));
+ RAY_DPRINTF(("%s: ray_start issuing %d \n", device_xname(&sc->sc_dev), firsti));
SRAM_WRITE_1(sc, RAY_SCB_CCSI, firsti);
RAY_ECF_START_CMD(sc);
@@ -1350,19 +1348,19 @@ ray_recv(sc, ccs)
siglev = SRAM_READ_FIELD_1(sc, ccs, ray_cmd_rx, c_siglev);
#endif
- RAY_DPRINTF(("%s: recv pktlen %ld frag %d\n", sc->sc_xname,
+ RAY_DPRINTF(("%s: recv pktlen %ld frag %d\n", device_xname(&sc->sc_dev),
(u_long)pktlen, frag));
- RAY_DPRINTF_XMIT(("%s: received packet: len %ld\n", sc->sc_xname,
+ RAY_DPRINTF_XMIT(("%s: received packet: len %ld\n", device_xname(&sc->sc_dev),
(u_long)pktlen));
if (pktlen > MCLBYTES || pktlen < sizeof(*frame)) {
RAY_DPRINTF(("%s: PKTLEN TOO BIG OR TOO SMALL\n",
- sc->sc_xname));
+ device_xname(&sc->sc_dev)));
ifp->if_ierrors++;
goto done;
}
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (!m) {
- RAY_DPRINTF(("%s: MGETHDR FAILED\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: MGETHDR FAILED\n", device_xname(&sc->sc_dev)));
ifp->if_ierrors++;
goto done;
}
@@ -1370,7 +1368,7 @@ ray_recv(sc, ccs)
/* XXX should allow chaining? */
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
- RAY_DPRINTF(("%s: MCLGET FAILED\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: MCLGET FAILED\n", device_xname(&sc->sc_dev)));
ifp->if_ierrors++;
m_freem(m);
m = 0;
@@ -1383,7 +1381,7 @@ ray_recv(sc, ccs)
m->m_data += fudge;
d = mtod(m, u_int8_t *);
- RAY_DPRINTF(("%s: recv ccs index %d\n", sc->sc_xname, first));
+ RAY_DPRINTF(("%s: recv ccs index %d\n", device_xname(&sc->sc_dev), first));
i = ni = first;
while ((i = ni) && i != RAY_CCS_LINK_NULL) {
ccs = RAY_GET_CCS(i);
@@ -1398,11 +1396,11 @@ ray_recv(sc, ccs)
ni = SRAM_READ_FIELD_1(sc, ccs, ray_cmd_rx, c_nextfrag);
RAY_DPRINTF((
"%s: recv frag index %d len %ld bufp 0x%llx ni %d\n",
- sc->sc_xname, i, (u_long)len, (unsigned long long)bufp,
+ device_xname(&sc->sc_dev), i, (u_long)len, (unsigned long long)bufp,
ni));
if (len + lenread > pktlen) {
RAY_DPRINTF(("%s: BAD LEN current 0x%lx pktlen 0x%lx\n",
- sc->sc_xname, (u_long)(len + lenread),
+ device_xname(&sc->sc_dev), (u_long)(len + lenread),
(u_long)pktlen));
ifp->if_ierrors++;
m_freem(m);
@@ -1429,7 +1427,7 @@ ray_recv(sc, ccs)
}
done:
- RAY_DPRINTF(("%s: recv frag count %d\n", sc->sc_xname, frag));
+ RAY_DPRINTF(("%s: recv frag count %d\n", device_xname(&sc->sc_dev), frag));
/* free the rcss */
ni = first;
@@ -1444,7 +1442,7 @@ done:
return;
RAY_DPRINTF(("%s: recv got packet pktlen %ld actual %ld\n",
- sc->sc_xname, (u_long)pktlen, (u_long)lenread));
+ device_xname(&sc->sc_dev), (u_long)pktlen, (u_long)lenread));
#ifdef RAY_DEBUG
if (ray_debug && ray_debug_dump_rx)
ray_dump_mbuf(sc, m);
@@ -1455,7 +1453,7 @@ done:
& (IEEE80211_FC0_VERSION_MASK|IEEE80211_FC0_TYPE_MASK);
if ((fc0 & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) {
RAY_DPRINTF(("%s: pkt not version 0 fc 0x%x\n",
- sc->sc_xname, fc0));
+ device_xname(&sc->sc_dev), fc0));
m_freem(m);
return;
}
@@ -1472,7 +1470,7 @@ done:
break;
default:
RAY_DPRINTF(("%s: mgt packet not supported\n",
- sc->sc_dev.dv_xname));
+ device_xname(&sc->sc_dev)));
#ifdef RAY_DEBUG
hexdump((const u_int8_t*)frame, pktlen, 16, 4, 0);
#endif
@@ -1483,14 +1481,14 @@ done:
return;
} else if ((fc0 & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) {
RAY_DPRINTF(("%s: pkt not type data fc0 0x%x\n",
- sc->sc_xname, fc0));
+ device_xname(&sc->sc_dev), fc0));
m_freem(m);
return;
}
if (pktlen < sizeof(*frame) + sizeof(struct llc)) {
RAY_DPRINTF(("%s: pkt too small for llc (%ld)\n",
- sc->sc_xname, (u_long)pktlen));
+ device_xname(&sc->sc_dev), (u_long)pktlen));
m_freem(m);
return;
}
@@ -1503,7 +1501,7 @@ done:
* Ethernet2 in 802.11 encapsulation produced by
* the windows driver for the WebGear card
*/
- RAY_DPRINTF(("%s: pkt not snap 0\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: pkt not snap 0\n", device_xname(&sc->sc_dev)));
if ((ifp->if_flags & IFF_LINK0) == 0) {
m_freem(m);
return;
@@ -1518,11 +1516,11 @@ done:
src = frame->i_addr3;
break;
case IEEE80211_FC1_DIR_TODS:
- RAY_DPRINTF(("%s: pkt ap2ap\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: pkt ap2ap\n", device_xname(&sc->sc_dev)));
m_freem(m);
return;
default:
- RAY_DPRINTF(("%s: pkt type unknown\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: pkt type unknown\n", device_xname(&sc->sc_dev)));
m_freem(m);
return;
}
@@ -1564,7 +1562,7 @@ ray_recv_auth(sc, frame)
u_int8_t *var = (u_int8_t *)(frame + 1);
if (sc->sc_mode == SC_MODE_ADHOC) {
- RAY_DPRINTF(("%s: recv auth packet:\n", sc->sc_dev.dv_xname));
+ RAY_DPRINTF(("%s: recv auth packet:\n", device_xname(&sc->sc_dev)));
#ifdef RAY_DEBUG
hexdump((const u_int8_t *)frame, sizeof(*frame) + 6, 16, 4, 0);
#endif
@@ -1572,7 +1570,7 @@ ray_recv_auth(sc, frame)
if (var[2] == OPEN_AUTH_REQUEST) {
RAY_DPRINTF(("%s: Sending authentication response.\n",
- sc->sc_dev.dv_xname));
+ device_xname(&sc->sc_dev)));
if (ray_send_auth(sc, frame->i_addr2,
OPEN_AUTH_RESPONSE) == 0) {
sc->sc_authstate = RAY_AUTH_NEEDED;
@@ -1581,7 +1579,7 @@ ray_recv_auth(sc, frame)
}
} else if (var[2] == OPEN_AUTH_RESPONSE) {
RAY_DPRINTF(("%s: Authenticated!\n",
- sc->sc_dev.dv_xname));
+ device_xname(&sc->sc_dev)));
sc->sc_authstate = RAY_AUTH_AUTH;
}
}
@@ -1604,7 +1602,7 @@ ray_send_auth(sc, dest, auth_type)
ccsindex = ray_find_free_tx_ccs(sc, RAY_CCS_TX_FIRST);
if (ccsindex == RAY_CCS_LINK_NULL) {
RAY_DPRINTF(("%s: send auth failed -- no free tx slots\n",
- sc->sc_dev.dv_xname));
+ device_xname(&sc->sc_dev)));
return (ENOMEM);
}
@@ -1628,7 +1626,7 @@ ray_send_auth(sc, dest, auth_type)
RAY_ECF_START_CMD(sc);
RAY_DPRINTF_XMIT(("%s: sent auth packet: len %lu\n",
- sc->sc_dev.dv_xname, (u_long) sizeof(packet)));
+ device_xname(&sc->sc_dev), (u_long) sizeof(packet)));
return (0);
}
@@ -1695,7 +1693,7 @@ ray_fill_in_tx_ccs(sc, pktlen, i, pi)
SRAM_WRITE_FIELD_1(sc, RAY_GET_CCS(pi), ray_cmd_tx, c_link, i);
RAY_DPRINTF(("%s: ray_alloc_tx_ccs bufp 0x%llx idx %u pidx %u\n",
- sc->sc_xname, (unsigned long long)bufp, i, pi));
+ device_xname(&sc->sc_dev), (unsigned long long)bufp, i, pi));
return (bufp + RAY_TX_PHY_SIZE);
}
@@ -1715,11 +1713,11 @@ ray_update_params_done(sc, ccs, stat)
rcmd = 0;
RAY_DPRINTF(("%s: ray_update_params_done stat %d\n",
- sc->sc_xname, stat));
+ device_xname(&sc->sc_dev), stat));
/* this will get more complex as we add commands */
if (stat == RAY_CCS_STATUS_FAIL) {
- printf("%s: failed to update a promisc\n", sc->sc_xname);
+ printf("%s: failed to update a promisc\n", device_xname(&sc->sc_dev));
/* XXX should probably reset */
/* rcmd = ray_reset; */
}
@@ -1727,7 +1725,7 @@ ray_update_params_done(sc, ccs, stat)
if (sc->sc_running & SCP_UPD_PROMISC) {
ray_cmd_done(sc, SCP_UPD_PROMISC);
sc->sc_promisc = SRAM_READ_1(sc, RAY_HOST_TO_ECF_BASE);
- RAY_DPRINTF(("%s: new promisc value %d\n", sc->sc_xname,
+ RAY_DPRINTF(("%s: new promisc value %d\n", device_xname(&sc->sc_dev),
sc->sc_promisc));
} else if (sc->sc_updreq) {
ray_cmd_done(sc, SCP_UPD_UPDATEPARAMS);
@@ -1757,7 +1755,7 @@ ray_check_scheduled(arg)
sc = arg;
RAY_DPRINTF((
"%s: ray_check_scheduled enter schd 0x%x running 0x%x ready %d\n",
- sc->sc_xname, sc->sc_scheduled, sc->sc_running, RAY_ECF_READY(sc)));
+ device_xname(&sc->sc_dev), sc->sc_scheduled, sc->sc_running, RAY_ECF_READY(sc)));
if (sc->sc_timoneed) {
callout_stop(&sc->sc_check_scheduled_ch);
@@ -1780,7 +1778,7 @@ ray_check_scheduled(arg)
RAY_DPRINTF((
"%s: ray_check_scheduled exit sched 0x%x running 0x%x ready %d\n",
- sc->sc_xname, sc->sc_scheduled, sc->sc_running, RAY_ECF_READY(sc)));
+ device_xname(&sc->sc_dev), sc->sc_scheduled, sc->sc_running, RAY_ECF_READY(sc)));
if (sc->sc_scheduled & ~SCP_UPD_MASK)
ray_set_pending(sc, sc->sc_scheduled);
@@ -1808,7 +1806,7 @@ ray_check_ccs(arg)
s = splnet();
sc = arg;
- RAY_DPRINTF(("%s: ray_check_ccs\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: ray_check_ccs\n", device_xname(&sc->sc_dev)));
sc->sc_timocheck = 0;
for (i = RAY_CCS_CMD_FIRST; i <= RAY_CCS_CMD_LAST; i++) {
@@ -1822,7 +1820,7 @@ ray_check_ccs(arg)
case RAY_CMD_UPDATE_PARAMS:
stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
RAY_DPRINTF(("%s: check ccs idx %u ccs 0x%llx "
- "cmd 0x%x stat %u\n", sc->sc_xname, i,
+ "cmd 0x%x stat %u\n", device_xname(&sc->sc_dev), i,
(unsigned long long)ccs, cmd, stat));
goto breakout;
}
@@ -1903,7 +1901,7 @@ ray_ccs_done(sc, ccs)
stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
RAY_DPRINTF(("%s: ray_ccs_done idx %llu cmd 0x%x stat %u\n",
- sc->sc_xname, (unsigned long long)RAY_GET_INDEX(ccs), cmd, stat));
+ device_xname(&sc->sc_dev), (unsigned long long)RAY_GET_INDEX(ccs), cmd, stat));
rcmd = 0;
switch (cmd) {
@@ -2004,7 +2002,7 @@ ray_rccs_intr(sc, ccs)
stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
RAY_DPRINTF(("%s: ray_rccs_intr idx %llu cmd 0x%x stat %u\n",
- sc->sc_xname, (unsigned long long)RAY_GET_INDEX(ccs), cmd, stat));
+ device_xname(&sc->sc_dev), (unsigned long long)RAY_GET_INDEX(ccs), cmd, stat));
rcmd = 0;
switch (cmd) {
@@ -2059,7 +2057,7 @@ ray_intr(arg)
sc = arg;
- RAY_DPRINTF(("%s: ray_intr\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: ray_intr\n", device_xname(&sc->sc_dev)));
if ((++sc->sc_checkcounters % 32) == 0)
ray_update_error_counters(sc);
@@ -2076,7 +2074,7 @@ ray_intr(arg)
else if (i <= RAY_RCCS_LAST)
rcmd = ray_rccs_intr(sc, RAY_GET_CCS(i));
else
- printf("%s: intr: bad cmd index %d\n", sc->sc_xname, i);
+ printf("%s: intr: bad cmd index %d\n", device_xname(&sc->sc_dev), i);
}
if (rcmd)
@@ -2085,7 +2083,7 @@ ray_intr(arg)
if (count)
REG_WRITE(sc, RAY_HCSIR, 0);
- RAY_DPRINTF(("%s: interrupt handled %d\n", sc->sc_xname, count));
+ RAY_DPRINTF(("%s: interrupt handled %d\n", device_xname(&sc->sc_dev), count));
return (count ? 1 : 0);
}
@@ -2123,7 +2121,7 @@ ray_free_ccs(sc, ccs)
{
u_int8_t stat;
- RAY_DPRINTF(("%s: free_ccs idx %llu\n", sc->sc_xname,
+ RAY_DPRINTF(("%s: free_ccs idx %llu\n", device_xname(&sc->sc_dev),
(unsigned long long)RAY_GET_INDEX(ccs)));
stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
@@ -2153,7 +2151,7 @@ ray_alloc_ccs(sc, ccsp, cmd, track)
bus_size_t ccs;
u_int i;
- RAY_DPRINTF(("%s: alloc_ccs cmd %d\n", sc->sc_xname, cmd));
+ RAY_DPRINTF(("%s: alloc_ccs cmd %d\n", device_xname(&sc->sc_dev), cmd));
/* for tracked commands, if not ready just set pending */
if (track && !RAY_ECF_READY(sc)) {
@@ -2194,11 +2192,11 @@ ray_set_pending(sc, cmdf)
struct ray_softc *sc;
u_int cmdf;
{
- RAY_DPRINTF(("%s: ray_set_pending 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_set_pending 0x%x\n", device_xname(&sc->sc_dev), cmdf));
sc->sc_scheduled |= cmdf;
if (!sc->sc_timoneed) {
- RAY_DPRINTF(("%s: ray_set_pending new timo\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: ray_set_pending new timo\n", device_xname(&sc->sc_dev)));
callout_reset(&sc->sc_check_scheduled_ch,
RAY_CHECK_SCHED_TIMEOUT, ray_check_scheduled, sc);
sc->sc_timoneed = 1;
@@ -2215,7 +2213,7 @@ ray_cmd_schedule(sc, cmdf)
{
int track;
- RAY_DPRINTF(("%s: ray_cmd_schedule 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_schedule 0x%x\n", device_xname(&sc->sc_dev), cmdf));
track = cmdf;
if ((cmdf & SCP_UPD_MASK) == 0)
@@ -2235,7 +2233,7 @@ ray_cmd_is_scheduled(sc, cmdf)
struct ray_softc *sc;
int cmdf;
{
- RAY_DPRINTF(("%s: ray_cmd_is_scheduled 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_is_scheduled 0x%x\n", device_xname(&sc->sc_dev), cmdf));
return ((sc->sc_scheduled & cmdf) ? 1 : 0);
}
@@ -2248,7 +2246,7 @@ ray_cmd_cancel(sc, cmdf)
struct ray_softc *sc;
int cmdf;
{
- RAY_DPRINTF(("%s: ray_cmd_cancel 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_cancel 0x%x\n", device_xname(&sc->sc_dev), cmdf));
sc->sc_scheduled &= ~cmdf;
if ((cmdf & SCP_UPD_MASK) && (sc->sc_scheduled & SCP_UPD_MASK) == 0)
@@ -2269,7 +2267,7 @@ ray_cmd_ran(sc, cmdf)
struct ray_softc *sc;
int cmdf;
{
- RAY_DPRINTF(("%s: ray_cmd_ran 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_ran 0x%x\n", device_xname(&sc->sc_dev), cmdf));
if (cmdf & SCP_UPD_MASK)
sc->sc_running |= cmdf | SCP_UPDATESUBCMD;
@@ -2291,7 +2289,7 @@ ray_cmd_is_running(sc, cmdf)
struct ray_softc *sc;
int cmdf;
{
- RAY_DPRINTF(("%s: ray_cmd_is_running 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_is_running 0x%x\n", device_xname(&sc->sc_dev), cmdf));
return ((sc->sc_running & cmdf) ? 1 : 0);
}
@@ -2304,7 +2302,7 @@ ray_cmd_done(sc, cmdf)
struct ray_softc *sc;
int cmdf;
{
- RAY_DPRINTF(("%s: ray_cmd_done 0x%x\n", sc->sc_xname, cmdf));
+ RAY_DPRINTF(("%s: ray_cmd_done 0x%x\n", device_xname(&sc->sc_dev), cmdf));
sc->sc_running &= ~cmdf;
if (cmdf & SCP_UPD_MASK) {
@@ -2330,7 +2328,7 @@ ray_issue_cmd(sc, ccs, track)
{
u_int i;
- RAY_DPRINTF(("%s: ray_cmd_issue 0x%x\n", sc->sc_xname, track));
+ RAY_DPRINTF(("%s: ray_cmd_issue 0x%x\n", device_xname(&sc->sc_dev), track));
/*
* XXX other drivers did this, but I think
@@ -2380,7 +2378,7 @@ ray_update_subcmd(sc)
{
int submask, i;
- RAY_DPRINTF(("%s: ray_update_subcmd\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: ray_update_subcmd\n", device_xname(&sc->sc_dev)));
ray_cmd_cancel(sc, SCP_UPDATESUBCMD);
if ((sc->sc_if.if_flags & IFF_RUNNING) == 0)
@@ -2469,7 +2467,7 @@ ray_download_params(sc)
struct ray_startup_params_tail_4 *sp4;
bus_size_t off;
- RAY_DPRINTF(("%s: init_startup_params\n", sc->sc_xname));
+ RAY_DPRINTF(("%s: init_startup_params\n", device_xname(&sc->sc_dev)));
ray_cmd_cancel(sc, SCP_UPD_STARTUP);
@@ -2798,7 +2796,7 @@ ray_start_join_net_done(sc, cmd, ccs, stat)
return (ray_start_join_net);
}
RAY_DPRINTF(("%s: net start/join nwid %.32s bssid %s inited %d\n",
- sc->sc_xname, sc->sc_cnwid.i_nwid, ether_sprintf(sc->sc_bssid),
+ device_xname(&sc->sc_dev), sc->sc_cnwid.i_nwid, ether_sprintf(sc->sc_bssid),
SRAM_READ_FIELD_1(sc, ccs, ray_cmd_net, c_inited)));
/* network is now active */
@@ -3236,7 +3234,7 @@ ray_dump_mbuf(sc, m)
u_int8_t *d, *ed;
u_int i;
- printf("%s: pkt dump:", sc->sc_xname);
+ printf("%s: pkt dump:", device_xname(&sc->sc_dev));
i = 0;
for (; m; m = m->m_next) {
d = mtod(m, u_int8_t *);
diff --git a/sys/dev/pcmcia/if_sm_pcmcia.c b/sys/dev/pcmcia/if_sm_pcmcia.c
index 588088f5c70..1d579ca9513 100644
--- a/sys/dev/pcmcia/if_sm_pcmcia.c
+++ b/sys/dev/pcmcia/if_sm_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sm_pcmcia.c,v 1.49 2007/10/19 12:01:05 ad Exp $ */
+/* $NetBSD: if_sm_pcmcia.c,v 1.50 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.49 2007/10/19 12:01:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.50 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -153,7 +153,7 @@ sm_pcmcia_attach(struct device *parent, struct device *self, void *aux)
error = pcmcia_function_configure(pa->pf, sm_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -178,8 +178,7 @@ sm_pcmcia_attach(struct device *parent, struct device *self, void *aux)
} else {
if (!sm_pcmcia_ascii_enaddr(pa->pf->sc->card.cis1_info[3], enaddr) &&
!sm_pcmcia_ascii_enaddr(pa->pf->sc->card.cis1_info[2], enaddr))
- aprint_error("%s: unable to get Ethernet address\n",
- self->dv_xname);
+ aprint_error_dev(self, "unable to get Ethernet address\n");
}
/* Perform generic intialization. */
diff --git a/sys/dev/pcmcia/if_tr_pcmcia.c b/sys/dev/pcmcia/if_tr_pcmcia.c
index a9b544da0ce..d17e0ad2e3d 100644
--- a/sys/dev/pcmcia/if_tr_pcmcia.c
+++ b/sys/dev/pcmcia/if_tr_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tr_pcmcia.c,v 1.19 2007/10/19 12:01:05 ad Exp $ */
+/* $NetBSD: if_tr_pcmcia.c,v 1.20 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.19 2007/10/19 12:01:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.20 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -135,39 +135,39 @@ tr_pcmcia_attach(struct device *parent, struct device *self, void *aux)
pcmcia_function_init(pa->pf, cfe);
if (pcmcia_function_enable(pa->pf) != 0) {
- printf("%s: function enable failed\n", self->dv_xname);
+ aprint_error_dev(self, "function enable failed\n");
return;
}
if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start,
cfe->iospace[0].length, cfe->iospace[0].length, &psc->sc_pioh) != 0) {
- printf("%s: can't allocate pio space\n", self->dv_xname);
+ aprint_error_dev(self, "can't allocate pio space\n");
goto fail1;
}
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_IO8, /* XXX _AUTO? */
&psc->sc_pioh, &psc->sc_pio_window) != 0) {
- printf("%s: can't map pio space\n", self->dv_xname);
+ aprint_error_dev(self, "can't map pio space\n");
goto fail2;
}
if (pcmcia_mem_alloc(psc->sc_pf, TR_SRAM_SIZE, &psc->sc_sramh) != 0) {
- printf("%s: can't allocate sram space\n", self->dv_xname);
+ aprint_error_dev(self, "can't allocate sram space\n");
goto fail3;
}
if (pcmcia_mem_map(psc->sc_pf, PCMCIA_MEM_COMMON, TR_PCMCIA_SRAM_ADDR,
TR_SRAM_SIZE, &psc->sc_sramh, &offset, &psc->sc_sram_window) != 0) {
- printf("%s: can't map sram space\n", self->dv_xname);
+ aprint_error_dev(self, "can't map sram space\n");
goto fail4;
}
if (pcmcia_mem_alloc(psc->sc_pf, TR_MMIO_SIZE, &psc->sc_mmioh) != 0) {
- printf("%s: can't allocate mmio space\n", self->dv_xname);
+ aprint_error_dev(self, "can't allocate mmio space\n");
goto fail5;
return;
}
if (pcmcia_mem_map(psc->sc_pf, PCMCIA_MEM_COMMON, TR_PCMCIA_MMIO_ADDR,
TR_MMIO_SIZE, &psc->sc_mmioh, &offset, &psc->sc_mmio_window) != 0) {
- printf("%s: can't map mmio space\n", self->dv_xname);
+ aprint_error_dev(self, "can't map mmio space\n");
goto fail6;
}
@@ -219,8 +219,7 @@ tr_pcmcia_enable(sc)
sc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET, tr_intr, psc);
if (sc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt\n",
- psc->sc_tr.sc_dev.dv_xname);
+ aprint_error_dev(&psc->sc_tr.sc_dev, "couldn't establish interrupt\n");
return 1;
}
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c
index 609c02df62d..b05a1b13231 100644
--- a/sys/dev/pcmcia/if_wi_pcmcia.c
+++ b/sys/dev/pcmcia/if_wi_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pcmcia.c,v 1.77 2007/12/09 20:28:14 jmcneill Exp $ */
+/* $NetBSD: if_wi_pcmcia.c,v 1.78 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.77 2007/12/09 20:28:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.78 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -294,14 +294,12 @@ wi_pcmcia_enable(sc)
if (wi_pcmcia_load_firm(sc,
spectrum24t_primsym, sizeof(spectrum24t_primsym),
spectrum24t_secsym, sizeof(spectrum24t_secsym))) {
- printf("%s: couldn't load firmware\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "couldn't load firmware\n");
wi_pcmcia_disable(sc);
return (EIO);
}
#else
- printf("%s: firmware load not configured\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "firmware load not configured\n");
return EIO;
#endif
}
@@ -350,7 +348,7 @@ wi_pcmcia_attach(struct device *parent, struct device *self,
error = pcmcia_function_configure(pa->pf, wi_pcmcia_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -380,11 +378,11 @@ wi_pcmcia_attach(struct device *parent, struct device *self,
sc->sc_enable = wi_pcmcia_enable;
sc->sc_disable = wi_pcmcia_disable;
- printf("%s:", self->dv_xname);
+ printf("%s:", device_xname(self));
haveaddr = pa->pf->pf_funce_lan_nidlen == IEEE80211_ADDR_LEN;
if (wi_attach(sc, haveaddr ? pa->pf->pf_funce_lan_nid : 0) != 0) {
- aprint_error("%s: failed to attach controller\n", self->dv_xname);
+ aprint_error_dev(self, "failed to attach controller\n");
goto fail2;
}
diff --git a/sys/dev/pcmcia/if_xi.c b/sys/dev/pcmcia/if_xi.c
index 935fe9e92cc..655d6bb2957 100644
--- a/sys/dev/pcmcia/if_xi.c
+++ b/sys/dev/pcmcia/if_xi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xi.c,v 1.63 2008/01/19 22:10:21 dyoung Exp $ */
+/* $NetBSD: if_xi.c,v 1.64 2008/04/05 21:31:23 cegger Exp $ */
/* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */
/*
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.63 2008/01/19 22:10:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.64 2008/04/05 21:31:23 cegger Exp $");
#include "opt_inet.h"
#include "opt_ipx.h"
@@ -213,11 +213,11 @@ xi_attach(sc, myea)
/* Reset and initialize the card. */
xi_full_reset(sc);
- printf("%s: MAC address %s\n", sc->sc_dev.dv_xname, ether_sprintf(myea));
+ printf("%s: MAC address %s\n", device_xname(&sc->sc_dev), ether_sprintf(myea));
ifp = &sc->sc_ethercom.ec_if;
/* Initialize the ifnet structure. */
- 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_start = xi_start;
ifp->if_ioctl = xi_ioctl;
@@ -254,7 +254,7 @@ xi_attach(sc, myea)
ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_AUTO);
#if NRND > 0
- rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET, 0);
+ rnd_attach_source(&sc->sc_rnd_source, device_xname(&sc->sc_dev), RND_TYPE_NET, 0);
#endif
}
@@ -334,7 +334,7 @@ xi_intr(arg)
/* Check to see if card has been ejected. */
if (isr == 0xff) {
#ifdef DIAGNOSTIC
- printf("%s: interrupt for dead card\n", sc->sc_dev.dv_xname);
+ printf("%s: interrupt for dead card\n", device_xname(&sc->sc_dev));
#endif
goto end;
}
@@ -709,7 +709,7 @@ xi_watchdog(ifp)
{
struct xi_softc *sc = ifp->if_softc;
- printf("%s: device timeout\n", sc->sc_dev.dv_xname);
+ printf("%s: device timeout\n", device_xname(&sc->sc_dev));
++ifp->if_oerrors;
xi_reset(sc);
diff --git a/sys/dev/pcmcia/isic_pcmcia.c b/sys/dev/pcmcia/isic_pcmcia.c
index 63747529d67..f15366bfd51 100644
--- a/sys/dev/pcmcia/isic_pcmcia.c
+++ b/sys/dev/pcmcia/isic_pcmcia.c
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.33 2007/10/19 12:01:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.34 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -210,11 +210,10 @@ isic_pcmcia_attach(struct device *parent,
/* Which card is it? */
cde = find_matching_card(pa);
if (cde == NULL) {
- printf("%s: attach failed, couldn't find matching card\n",
- psc->sc_isic.sc_dev.dv_xname);
+ aprint_errir_dev(&psc->sc_isic.sc_dev, "attach failed, couldn't find matching card\n");
return;
}
- printf("%s: %s\n", cde->name, self->dv_xname);
+ printf("%s: %s\n", cde->name, device_xname(self));
/* Enable the card */
pcmcia_function_init(pa->pf, cfe);
@@ -222,16 +221,14 @@ isic_pcmcia_attach(struct device *parent,
pcmcia_function_enable(pa->pf);
if (!cde->attach(psc, cfe, pa)) {
- printf("%s: attach failed, card-specific attach unsuccesful\n",
- psc->sc_isic.sc_dev.dv_xname);
+ aprint_error_dev(&psc->sc_isic.sc_dev, "attach failed, card-specific attach unsuccesful\n");
goto fail;
}
/* MI initilization */
sc->sc_cardtyp = cde->card_type;
if (isic_pcmcia_isdn_attach(sc, cde->name)) {
- printf("%s: attach failed, generic attach unsuccesful\n",
- psc->sc_isic.sc_dev.dv_xname);
+ aprint_error_dev(&psc->sc_isic.sc_dev, "attach failed, generic attach unsuccesful\n");
goto fail;
}
@@ -290,7 +287,7 @@ isic_pcmcia_activate(struct device *self, enum devact act)
#define TERMFMT " "
#else
#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
+#define ISIC_PARM device_xname(&sc->sc_dev)
#define TERMFMT "\n"
#endif
diff --git a/sys/dev/pcmcia/mhzc.c b/sys/dev/pcmcia/mhzc.c
index ecaf4141e1f..4bdcdaff537 100644
--- a/sys/dev/pcmcia/mhzc.c
+++ b/sys/dev/pcmcia/mhzc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mhzc.c,v 1.41 2008/03/14 15:09:11 cube Exp $ */
+/* $NetBSD: mhzc.c,v 1.42 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.41 2008/03/14 15:09:11 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.42 2008/04/05 21:31:23 cegger Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -226,14 +226,12 @@ mhzc_attach(struct device *parent, struct device *self, void *aux)
}
}
if (cfe == NULL) {
- aprint_error("%s: unable to find suitable config table entry\n",
- self->dv_xname);
+ aprint_error_dev(self, "unable to find suitable config table entry\n");
goto fail;
}
if (mhzc_alloc_ethernet(sc, cfe) == 0) {
- aprint_error("%s: unable to allocate space for Ethernet portion\n",
- self->dv_xname);
+ aprint_error_dev(self, "unable to allocate space for Ethernet portion\n");
goto fail;
}
@@ -242,16 +240,14 @@ mhzc_attach(struct device *parent, struct device *self, void *aux)
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO8, &sc->sc_modem_pcioh,
&sc->sc_modem_io_window)) {
- aprint_error("%s: unable to map I/O space\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "unable to map I/O space\n");
goto fail;
}
sc->sc_flags |= MHZC_MODEM_MAPPED;
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_AUTO, &sc->sc_ethernet_pcioh,
&sc->sc_ethernet_io_window)) {
- aprint_error("%s: unable to map I/O space\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "unable to map I/O space\n");
goto fail;
}
sc->sc_flags |= MHZC_ETHERNET_MAPPED;
@@ -442,7 +438,7 @@ mhzc_enable(sc, flag)
int error;
if ((sc->sc_flags & flag) == flag) {
- printf("%s: already enabled\n", sc->sc_dev.dv_xname);
+ printf("%s: already enabled\n", device_xname(&sc->sc_dev));
return (0);
}
@@ -494,7 +490,7 @@ mhzc_disable(sc, flag)
{
if ((sc->sc_flags & flag) == 0) {
- printf("%s: already disabled\n", sc->sc_dev.dv_xname);
+ printf("%s: already disabled\n", device_xname(&sc->sc_dev));
return;
}
@@ -524,7 +520,7 @@ mhzc_em3336_enaddr(sc, myla)
if (pcmcia_scan_cis(device_parent(&sc->sc_dev),
mhzc_em3336_lannid_ciscallback, myla) != 1) {
printf("%s: unable to get Ethernet address from CIS\n",
- sc->sc_dev.dv_xname);
+ device_xname(&sc->sc_dev));
return (0);
}
@@ -547,15 +543,13 @@ mhzc_em3336_enable(sc)
/* Map the ISRPOWEREG. */
if (pcmcia_mem_alloc(sc->sc_pf, 0x1000, &memh) != 0) {
- printf("%s: unable to allocate memory space\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "unable to allocate memory space\n");
return (1);
}
if (pcmcia_mem_map(sc->sc_pf, PCMCIA_MEM_ATTR, 0, 0x1000,
&memh, &memoff, &memwin)) {
- printf("%s: unable to map memory space\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(&sc->sc_dev, "unable to map memory space\n");
pcmcia_mem_free(sc->sc_pf, &memh);
return (1);
}
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index f29c1f1f4b3..5bb53d535d3 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcia.c,v 1.85 2007/12/16 21:28:30 dyoung Exp $ */
+/* $NetBSD: pcmcia.c,v 1.86 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.85 2007/12/16 21:28:30 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.86 2008/04/05 21:31:23 cegger Exp $");
#include "opt_pcmciaverbose.h"
@@ -187,7 +187,7 @@ pcmcia_card_attach(dev)
if (sc->card.error ||
SIMPLEQ_EMPTY(&sc->card.pf_head)) {
printf("%s: card appears to have bogus CIS\n",
- sc->dev.dv_xname);
+ device_xname(&sc->dev));
error = EIO;
goto done;
}
@@ -203,7 +203,7 @@ pcmcia_card_attach(dev)
#ifdef DIAGNOSTIC
if (pf->child != NULL) {
printf("%s: %s still attached to function %d!\n",
- sc->dev.dv_xname, pf->child->dv_xname,
+ device_xname(&sc->dev), device_xname(pf->child),
pf->number);
panic("pcmcia_card_attach");
}
@@ -281,10 +281,10 @@ pcmcia_card_detach(dev, flags)
if (pf->child == NULL)
continue;
DPRINTF(("%s: detaching %s (function %d)\n",
- sc->dev.dv_xname, pf->child->dv_xname, pf->number));
+ device_xname(&sc->dev), device_xname(pf->child), pf->number));
if ((error = config_detach(pf->child, flags)) != 0) {
printf("%s: error %d detaching %s (function %d)\n",
- sc->dev.dv_xname, error, pf->child->dv_xname,
+ device_xname(&sc->dev), error, device_xname(pf->child),
pf->number);
}
}
@@ -315,8 +315,8 @@ pcmcia_childdetached(struct device *self, struct device *child)
}
}
- printf("%s: pcmcia_childdetached: %s not found\n",
- self->dv_xname, child->dv_xname);
+ aprint_error_dev(self, "pcmcia_childdetached: %s not found\n",
+ device_xname(child));
}
void
@@ -337,7 +337,7 @@ pcmcia_card_deactivate(dev)
if (pf->child == NULL)
continue;
DPRINTF(("%s: deactivating %s (function %d)\n",
- sc->dev.dv_xname, pf->child->dv_xname, pf->number));
+ device_xname(&sc->dev), device_xname(pf->child), pf->number));
config_deactivate(pf->child);
}
}
@@ -478,7 +478,7 @@ pcmcia_socket_enable(dev)
if (sc->sc_enabled_count++ == 0)
pcmcia_chip_socket_enable(sc->pct, sc->pch);
- DPRINTF(("%s: ++enabled_count = %d\n", sc->dev.dv_xname,
+ DPRINTF(("%s: ++enabled_count = %d\n", device_xname(&sc->dev),
sc->sc_enabled_count));
}
@@ -490,7 +490,7 @@ pcmcia_socket_disable(dev)
if (--sc->sc_enabled_count == 0)
pcmcia_chip_socket_disable(sc->pct, sc->pch);
- DPRINTF(("%s: --enabled_count = %d\n", sc->dev.dv_xname,
+ DPRINTF(("%s: --enabled_count = %d\n", device_xname(&sc->dev),
sc->sc_enabled_count));
}
@@ -598,7 +598,7 @@ pcmcia_function_enable(pf)
SIMPLEQ_FOREACH(tmp, &sc->card.pf_head, pf_list) {
printf("%s: function %d CCR at %d offset %lx: "
"%x %x %x %x, %x %x %x %x, %x\n",
- tmp->sc->dev.dv_xname, tmp->number,
+ device_xname(&tmp->sc->dev), tmp->number,
tmp->pf_ccr_window,
(unsigned long) tmp->pf_ccr_offset,
pcmcia_ccr_read(tmp, 0),
@@ -629,7 +629,7 @@ bad:
* Decrement the reference count, and power down the socket, if
* necessary.
*/
- printf("%s: couldn't map the CCR\n", pf->child->dv_xname);
+ printf("%s: couldn't map the CCR\n", device_xname(pf->child));
pcmcia_socket_disable(&sc->dev);
return (error);
@@ -767,7 +767,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg)
pf->pf_ih = pcmcia_chip_intr_establish(pf->sc->pct, pf->sc->pch,
pf, ipl, ih_fct, ih_arg);
if (!pf->pf_ih)
- printf("%s: interrupt establish failed\n", pf->child->dv_xname);
+ aprint_error_dev(pf->child, "interrupt establish failed\n");
return (pf->pf_ih);
}
diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c
index 52977638278..7f247f10a15 100644
--- a/sys/dev/pcmcia/pcmcia_cis.c
+++ b/sys/dev/pcmcia/pcmcia_cis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcia_cis.c,v 1.50 2006/11/16 01:33:20 christos Exp $ */
+/* $NetBSD: pcmcia_cis.c,v 1.51 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis.c,v 1.50 2006/11/16 01:33:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis.c,v 1.51 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -162,8 +162,7 @@ pcmcia_scan_cis(dev, fct, arg)
if (pcmcia_chip_mem_alloc(pct, pch, PCMCIA_CIS_SIZE, &pcmh)) {
#ifdef DIAGNOSTIC
- printf("%s: can't alloc memory to read attributes\n",
- sc->dev.dv_xname);
+ aprint_error_dev(&sc->dev, "can't alloc memory to read attributes\n");
#endif
return -1;
}
@@ -172,8 +171,7 @@ pcmcia_scan_cis(dev, fct, arg)
PCMCIA_CIS_SIZE, &pcmh, &tuple.ptr, &window)) {
pcmcia_chip_mem_free(pct, pch, &pcmh);
#ifdef DIAGNOSTIC
- printf("%s: can't map memory to read attributes\n",
- sc->dev.dv_xname);
+ aprint_error_dev(&sc->dev, "can't map memory to read attributes\n");
#endif
return -1;
}
@@ -191,7 +189,7 @@ pcmcia_scan_cis(dev, fct, arg)
mfc_count = 0;
mfc_index = 0;
- DPRINTF(("%s: CIS tuple chain:\n", sc->dev.dv_xname));
+ DPRINTF(("%s: CIS tuple chain:\n", device_xname(&sc->dev)));
while (1) {
DELAY(1000);
@@ -323,9 +321,8 @@ pcmcia_scan_cis(dev, fct, arg)
if (cksum != (sum & 0xff)) {
DPRINTF((" failed sum=%x\n",
sum));
- printf("%s: CIS checksum "
- "failed\n",
- sc->dev.dv_xname);
+ aprint_error_dev(&sc->dev, "CIS checksum "
+ "failed\n");
#if 0
/*
* XXX Some working cards have
@@ -545,7 +542,7 @@ pcmcia_print_cis(sc)
struct pcmcia_config_entry *cfe;
int i;
- printf("%s: CIS version ", sc->dev.dv_xname);
+ printf("%s: CIS version ", device_xname(&sc->dev));
if (card->cis1_major == 4) {
if (card->cis1_minor == 0)
printf("PCMCIA 1.0\n");
@@ -557,7 +554,7 @@ pcmcia_print_cis(sc)
printf("unknown (major=%d, minor=%d)\n",
card->cis1_major, card->cis1_minor);
- printf("%s: CIS info: ", sc->dev.dv_xname);
+ printf("%s: CIS info: ", device_xname(&sc->dev));
for (i = 0; i < 4; i++) {
if (card->cis1_info[i] == NULL)
break;
@@ -568,10 +565,10 @@ pcmcia_print_cis(sc)
printf("\n");
printf("%s: Manufacturer code 0x%x, product 0x%x\n",
- sc->dev.dv_xname, card->manufacturer, card->product);
+ device_xname(&sc->dev), card->manufacturer, card->product);
SIMPLEQ_FOREACH(pf, &card->pf_head, pf_list) {
- printf("%s: function %d: ", sc->dev.dv_xname, pf->number);
+ printf("%s: function %d: ", device_xname(&sc->dev), pf->number);
switch (pf->function) {
case PCMCIA_FUNCTION_UNSPEC:
@@ -626,7 +623,7 @@ pcmcia_print_cis(sc)
SIMPLEQ_FOREACH(cfe, &pf->cfe_head, cfe_list) {
printf("%s: function %d, config table entry %d: ",
- sc->dev.dv_xname, pf->number, cfe->number);
+ device_xname(&sc->dev), pf->number, cfe->number);
switch (cfe->iftype) {
case PCMCIA_IFTYPE_MEMORY:
@@ -704,7 +701,7 @@ pcmcia_print_cis(sc)
if (card->error)
printf("%s: %d errors found while parsing CIS\n",
- sc->dev.dv_xname, card->error);
+ device_xname(&sc->dev), card->error);
}
int
diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c
index 84d67fd536c..0024f5cbda5 100644
--- a/sys/dev/pcmcia/pcmcia_cis_quirks.c
+++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcia_cis_quirks.c,v 1.30 2007/02/10 03:16:07 ichiro Exp $ */
+/* $NetBSD: pcmcia_cis_quirks.c,v 1.31 2008/04/05 21:31:23 cegger Exp $ */
/*
* Copyright (c) 1998 Marc Horowitz. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis_quirks.c,v 1.30 2007/02/10 03:16:07 ichiro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis_quirks.c,v 1.31 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -291,7 +291,7 @@ match:
if (!wiped) {
if (pcmcia_verbose) {
printf("%s: using CIS quirks for ",
- sc->dev.dv_xname);
+ device_xname(&sc->dev));
for (j = 0; j < 4; j++) {
if (card->cis1_info[j] == NULL)
break;
diff --git a/sys/dev/pcmcia/pcmcom.c b/sys/dev/pcmcia/pcmcom.c
index 65f762bbbcb..1b056b4fcfd 100644
--- a/sys/dev/pcmcia/pcmcom.c
+++ b/sys/dev/pcmcia/pcmcom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcom.c,v 1.32 2008/03/14 15:09:11 cube Exp $ */
+/* $NetBSD: pcmcom.c,v 1.33 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.32 2008/03/14 15:09:11 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.33 2008/04/05 21:31:23 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -158,7 +158,7 @@ pcmcom_attach(struct device *parent, struct device *self, void *aux)
error = pcmcia_function_configure(pa->pf, pcmcom_validate_config);
if (error) {
- aprint_error("%s: configure failed, error=%d\n", self->dv_xname,
+ aprint_error_dev(self, "configure failed, error=%d\n",
error);
return;
}
@@ -174,7 +174,7 @@ pcmcom_attach(struct device *parent, struct device *self, void *aux)
for (slave = 0; slave < sc->sc_nslaves; slave++) {
struct pcmcom_attach_args pca;
- printf("%s: slave %d\n", self->dv_xname, slave);
+ printf("%s: slave %d\n", device_xname(self), slave);
pca.pca_iot = cfe->iospace[slave].handle.iot;
pca.pca_ioh = cfe->iospace[slave].handle.ioh;
diff --git a/sys/dev/pcmcia/xirc.c b/sys/dev/pcmcia/xirc.c
index 87cba85cbbc..76ad924539b 100644
--- a/sys/dev/pcmcia/xirc.c
+++ b/sys/dev/pcmcia/xirc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xirc.c,v 1.22 2008/03/14 15:09:11 cube Exp $ */
+/* $NetBSD: xirc.c,v 1.23 2008/04/05 21:31:23 cegger Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.22 2008/03/14 15:09:11 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.23 2008/04/05 21:31:23 cegger Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -191,7 +191,7 @@ xirc_attach(parent, self, aux)
rv = pcmcia_scan_cis(parent, xirc_manfid_ciscallback, &sc->sc_id);
pcmcia_socket_disable(parent);
if (!rv) {
- aprint_error("%s: failed to find ID\n", self->dv_xname);
+ aprint_error_dev(self, "failed to find ID\n");
return;
}
@@ -217,12 +217,12 @@ xirc_attach(parent, self, aux)
sc->sc_chipset = XI_CHIPSET_DINGO;
break;
default:
- aprint_error("%s: unknown ID %04x\n", self->dv_xname,
+ aprint_error_dev(self, "unknown ID %04x\n",
sc->sc_id);
return;
}
- aprint_normal("%s: id=%04x\n", self->dv_xname, sc->sc_id);
+ aprint_normal_dev(self, "id=%04x\n", sc->sc_id);
if (sc->sc_id & (XIMEDIA_MODEM << 8)) {
if (sc->sc_chipset >= XI_CHIPSET_DINGO) {
@@ -239,8 +239,7 @@ xirc_attach(parent, self, aux)
} else
cfe = xirc_dingo_alloc_ethernet(sc);
if (!cfe) {
- aprint_error("%s: failed to allocate I/O space\n",
- self->dv_xname);
+ aprint_error_dev(self, "failed to allocate I/O space\n");
goto fail;
}
@@ -250,8 +249,7 @@ xirc_attach(parent, self, aux)
if (sc->sc_id & (XIMEDIA_MODEM << 8)) {
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO8,
&sc->sc_modem_pcioh, &sc->sc_modem_io_window)) {
- aprint_error("%s: unable to map I/O space\n",
- self->dv_xname);
+ aprint_error_dev(self, "unable to map I/O space\n");
goto fail;
}
sc->sc_flags |= XIRC_MODEM_MAPPED;
@@ -260,8 +258,7 @@ xirc_attach(parent, self, aux)
if (sc->sc_id & (XIMEDIA_ETHER << 8)) {
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_AUTO,
&sc->sc_ethernet_pcioh, &sc->sc_ethernet_io_window)) {
- aprint_error("%s: unable to map I/O space\n",
- self->dv_xname);
+ aprint_error_dev(self, "unable to map I/O space\n");
goto fail;
}
sc->sc_flags |= XIRC_ETHERNET_MAPPED;
@@ -503,7 +500,7 @@ xirc_enable(sc, flag, media)
int error;
if ((sc->sc_flags & flag) == flag) {
- printf("%s: already enabled\n", sc->sc_dev.dv_xname);
+ printf("%s: already enabled\n", device_xname(&sc->sc_dev));
return (0);
}
@@ -552,7 +549,7 @@ xirc_disable(sc, flag, media)
{
if ((sc->sc_flags & flag) == 0) {
- printf("%s: already disabled\n", sc->sc_dev.dv_xname);
+ printf("%s: already disabled\n", device_xname(&sc->sc_dev));
return;
}
@@ -693,7 +690,7 @@ xi_xirc_attach(struct device *parent, struct device *self, void *aux)
if (!pcmcia_scan_cis(device_parent(&msc->sc_dev),
xi_xirc_lan_nid_ciscallback, myla)) {
- aprint_error("%s: can't find MAC address\n", self->dv_xname);
+ aprint_error_dev(self, "can't find MAC address\n");
return;
}