Clean up attach messages.

This commit is contained in:
mycroft 2004-08-07 05:27:39 +00:00
parent dddef3e3c4
commit c4fbc53cad
6 changed files with 85 additions and 83 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_pcmcia.c,v 1.38 2004/08/07 04:55:25 mycroft Exp $ */
/* $NetBSD: com_pcmcia.c,v 1.39 2004/08/07 05:27:39 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.38 2004/08/07 04:55:25 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.39 2004/08/07 05:27:39 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -258,16 +258,14 @@ retry:
autoalloc = 1;
goto retry;
} else if (!cfe) {
aprint_error("%s: can't allocate i/o space\n",
sc->sc_dev.dv_xname);
aprint_error("%s: can't allocate i/o space\n", self->dv_xname);
return;
}
found:
/* Enable the card. */
pcmcia_function_init(pa->pf, cfe);
if (com_pcmcia_enable1(sc))
aprint_error("%s: function enable failed\n",
sc->sc_dev.dv_xname);
aprint_error("%s: function enable failed\n", self->dv_xname);
sc->enabled = 1;
@ -276,7 +274,7 @@ found:
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0, psc->sc_pcioh.size,
&psc->sc_pcioh, &psc->sc_io_window)) {
aprint_error("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
aprint_error("%s: can't map i/o space\n", self->dv_xname);
return;
}
sc->sc_iot = psc->sc_pcioh.iot;
@ -288,7 +286,7 @@ found:
sc->enable = com_pcmcia_enable;
sc->disable = com_pcmcia_disable;
aprint_normal("%s", sc->sc_dev.dv_xname);
aprint_normal("%s", self->dv_xname);
com_attach_subr(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ne_pcmcia.c,v 1.124 2004/08/06 19:07:12 mycroft Exp $ */
/* $NetBSD: if_ne_pcmcia.c,v 1.125 2004/08/07 05:27:39 mycroft 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.124 2004/08/06 19:07:12 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.125 2004/08/07 05:27:39 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -542,6 +542,8 @@ ne_pcmcia_attach(parent, self, aux)
u_int8_t myea[6], *enaddr;
const char *typestr = "";
aprint_normal("\n");
psc->sc_pf = pa->pf;
SIMPLEQ_FOREACH(cfe, &pa->pf->cfe_head, cfe_list) {
@ -552,16 +554,18 @@ ne_pcmcia_attach(parent, self, aux)
*/
if (cfe->num_memspace != 1) {
printf(": unexpected number of memory spaces "
" %d should be 1\n", cfe->num_memspace);
aprint_error("%s: unexpected number of memory spaces "
" %d should be 1\n", self->dv_xname,
cfe->num_memspace);
continue;
}
#endif
if (cfe->num_iospace == 1) {
if (cfe->iospace[0].length != NE2000_NPORTS) {
printf(": unexpected I/O space configuration"
" (continued)\n%s", dsc->sc_dev.dv_xname);
aprint_error("%s: unexpected I/O space"
" configuration (continued)\n",
self->dv_xname);
/* XXX really safe for all other cards? */
}
} else if (cfe->num_iospace == 2) {
@ -574,17 +578,17 @@ ne_pcmcia_attach(parent, self, aux)
if (cfe->iospace[0].length + cfe->iospace[1].length !=
NE2000_NPORTS) {
#ifdef DIAGNOSTIC
printf(": unexpected I/O "
"space configuration; ignored\n%s",
dsc->sc_dev.dv_xname);
aprint_error("%s: unexpected I/O space"
" configuration (ignored)\n",
self->dv_xname);
#endif
continue;
}
} else {
#ifdef DIAGNOSTIC
printf(": unexpected number of i/o spaces %d"
" should be 1 or 2; ignored\n%s",
cfe->num_iospace, dsc->sc_dev.dv_xname);
aprint_error("%s: unexpected number of i/o spaces %d"
" should be 1 or 2 (ignored)\n",
self->dv_xname, cfe->num_iospace);
#endif
continue;
}
@ -592,8 +596,8 @@ ne_pcmcia_attach(parent, self, aux)
if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start,
NE2000_NPORTS, NE2000_NPORTS, &psc->sc_pcioh)) {
#ifdef DIAGNOSTIC
printf(": can't allocate i/o space %lx; ignored\n%s",
cfe->iospace[0].start, dsc->sc_dev.dv_xname);
aprint_error("%s: can't allocate i/o space %lx (ignored\n)",
self->dv_xname, cfe->iospace[0].start);
#endif
continue;
}
@ -603,7 +607,7 @@ ne_pcmcia_attach(parent, self, aux)
}
if (cfe == NULL) {
printf(": no suitable config entry\n");
aprint_error("%s: no suitable config entry\n", self->dv_xname);
goto fail_1;
}
@ -614,7 +618,8 @@ ne_pcmcia_attach(parent, self, aux)
if (bus_space_subregion(dsc->sc_regt, dsc->sc_regh,
NE2000_ASIC_OFFSET, NE2000_ASIC_NPORTS,
&nsc->sc_asich)) {
printf(": can't get subregion for asic\n");
aprint_error("%s: can't get subregion for asic\n",
self->dv_xname);
goto fail_2;
}
@ -625,7 +630,7 @@ ne_pcmcia_attach(parent, self, aux)
/* Enable the card. */
pcmcia_function_init(pa->pf, cfe);
if (pcmcia_function_enable(pa->pf)) {
printf(": function enable failed\n");
aprint_error("%s: function enable failed\n", self->dv_xname);
goto fail_2;
}
@ -633,19 +638,17 @@ ne_pcmcia_attach(parent, self, aux)
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO8,
NE2000_NIC_OFFSET, NE2000_NIC_NPORTS,
&psc->sc_pcioh, &psc->sc_nic_io_window)) {
printf(": can't map NIC i/o space\n");
aprint_error("%s: can't map NIC i/o space\n", self->dv_xname);
goto fail_3;
}
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16,
NE2000_ASIC_OFFSET, NE2000_ASIC_NPORTS,
&psc->sc_pcioh, &psc->sc_asic_io_window)) {
printf(": can't map ASIC i/o space\n");
aprint_error("%s: can't map ASIC i/o space\n", self->dv_xname);
goto fail_4;
}
aprint_normal("\n");
/*
* Read the station address from the board.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ray.c,v 1.45 2004/07/07 06:43:22 mycroft Exp $ */
/* $NetBSD: if_ray.c,v 1.46 2004/08/07 05:35:50 mycroft Exp $ */
/*
* Copyright (c) 2000 Christian E. Hopps
* All rights reserved.
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.45 2004/07/07 06:43:22 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.46 2004/08/07 05:35:50 mycroft Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -515,7 +515,7 @@ ray_attach(parent, self, aux)
/* enable the card */
pcmcia_function_init(sc->sc_pf, SIMPLEQ_FIRST(&sc->sc_pf->cfe_head));
if (pcmcia_function_enable(sc->sc_pf)) {
printf(": failed to enable the card");
aprint_error("%s: failed to enable the card\n", self->dv_xname);
return;
}
@ -523,14 +523,14 @@ ray_attach(parent, self, aux)
* map in the memory
*/
if (pcmcia_mem_alloc(sc->sc_pf, RAY_SRAM_MEM_SIZE, &sc->sc_mem)) {
printf(": can\'t alloc shared memory\n");
aprint_error("%s: can't alloc shared memory\n", self->dv_xname);
goto fail;
}
if (pcmcia_mem_map(sc->sc_pf, PCMCIA_WIDTH_MEM8|PCMCIA_MEM_COMMON,
RAY_SRAM_MEM_BASE, RAY_SRAM_MEM_SIZE, &sc->sc_mem, &memoff,
&sc->sc_window)) {
printf(": can\'t map shared memory\n");
aprint_error("%s: can't map shared memory\n", self->dv_xname);
pcmcia_mem_free(sc->sc_pf, &sc->sc_mem);
goto fail;
}
@ -542,15 +542,15 @@ ray_attach(parent, self, aux)
/* check to see that card initialized properly */
if (ep->e_status != RAY_ECFS_CARD_OK) {
printf(": card failed self test: status %d\n",
sc->sc_ecf_startup.e_status);
aprint_error("%s: card failed self test: status %d\n",
self->dv_xname, sc->sc_ecf_startup.e_status);
goto fail;
}
/* check firmware version */
if (sc->sc_version != SC_BUILD_4 && sc->sc_version != SC_BUILD_5) {
printf(": unsupported firmware version %d\n",
ep->e_fw_build_string);
aprint_error("%s: unsupported firmware version %d\n",
self->dv_xname, ep->e_fw_build_string);
goto fail;
}
@ -582,17 +582,17 @@ ray_attach(parent, self, aux)
* attach the interface
*/
/* The version isn't the most accurate way, but it's easy. */
printf("%s: firmware version %d\n", sc->sc_dev.dv_xname,
aprint_normal("%s: firmware version %d\n", self->dv_xname,
sc->sc_version);
if (sc->sc_version != SC_BUILD_4)
printf("%s: supported rates %0x:%0x:%0x:%0x:%0x:%0x:%0x:%0x\n",
sc->sc_xname, ep->e_rates[0], ep->e_rates[1],
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],
ep->e_rates[2], ep->e_rates[3], ep->e_rates[4],
ep->e_rates[5], ep->e_rates[6], ep->e_rates[7]);
printf("%s: 802.11 address %s\n", sc->sc_xname,
aprint_normal("%s: 802.11 address %s\n", self->dv_xname,
ether_sprintf(ep->e_station_addr));
memcpy(ifp->if_xname, sc->sc_xname, IFNAMSIZ);
memcpy(ifp->if_xname, self->dv_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_start = ray_if_start;
ifp->if_ioctl = ray_ioctl;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sm_pcmcia.c,v 1.32 2004/08/07 01:07:31 mycroft Exp $ */
/* $NetBSD: if_sm_pcmcia.c,v 1.33 2004/08/07 05:27:39 mycroft Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.32 2004/08/07 01:07:31 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.33 2004/08/07 05:27:39 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -142,13 +142,15 @@ sm_pcmcia_attach(parent, self, aux)
u_int8_t enaddr[ETHER_ADDR_LEN];
const struct pcmcia_product *pp;
aprint_normal("\n");
psc->sc_pf = pa->pf;
cfe = SIMPLEQ_FIRST(&pa->pf->cfe_head);
/* Enable the card. */
pcmcia_function_init(pa->pf, cfe);
if (pcmcia_function_enable(pa->pf)) {
printf(": function enable failed\n");
aprint_error("%s: function enable failed\n", self->dv_xname);
goto enable_failed;
}
@ -157,7 +159,7 @@ sm_pcmcia_attach(parent, self, aux)
/* Allocate and map i/o space for the card. */
if (pcmcia_io_alloc(pa->pf, 0, cfe->iospace[0].length,
cfe->iospace[0].length, &psc->sc_pcioh)) {
printf(": can't allocate i/o space\n");
aprint_error("%s: can't allocate i/o space\n", self->dv_xname);
goto ioalloc_failed;
}
@ -170,12 +172,10 @@ sm_pcmcia_attach(parent, self, aux)
if (pcmcia_io_map(pa->pf, (cfe->flags & PCMCIA_CFE_IO16) ?
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8, 0, cfe->iospace[0].length,
&psc->sc_pcioh, &psc->sc_io_window)) {
printf(": can't map i/o space\n");
aprint_error("%s: can't map i/o space\n", self->dv_xname);
goto iomap_failed;
}
printf("\n");
pp = pcmcia_product_lookup(pa, sm_pcmcia_products,
sizeof sm_pcmcia_products[0], NULL);
if (pp == NULL)
@ -190,8 +190,8 @@ sm_pcmcia_attach(parent, self, 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))
printf("%s: unable to get Ethernet address\n",
sc->sc_dev.dv_xname);
aprint_error("%s: unable to get Ethernet address\n",
self->dv_xname);
}
/* Perform generic intialization. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wi_pcmcia.c,v 1.45 2004/08/05 21:53:04 mycroft Exp $ */
/* $NetBSD: if_wi_pcmcia.c,v 1.46 2004/08/07 05:27:39 mycroft Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.45 2004/08/05 21:53:04 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.46 2004/08/07 05:27:39 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -383,7 +383,7 @@ wi_pcmcia_attach(parent, self, aux)
break;
}
if (cfe == NULL) {
printf(": no suitable CIS info found\n");
aprint_error("%s: no suitable CIS info found\n", self->dv_xname);
goto no_config_entry;
}
@ -412,8 +412,8 @@ wi_pcmcia_attach(parent, self, aux)
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("%s: couldn't load firmware\n",
self->dv_xname);
goto no_interrupt;
}
}
@ -421,16 +421,15 @@ wi_pcmcia_attach(parent, self, aux)
/* establish the interrupt. */
sc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET, wi_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n",
sc->sc_dev.dv_xname);
aprint_error("%s: couldn't establish interrupt\n", self->dv_xname);
goto no_interrupt;
}
printf("%s:", sc->sc_dev.dv_xname);
printf("%s:", self->dv_xname);
if (wi_attach(sc) != 0) {
printf("%s: failed to attach controller\n",
sc->sc_dev.dv_xname);
goto attach_failed;
aprint_error("%s: failed to attach controller\n", self->dv_xname);
goto attach_failed;
}
psc->sc_sdhook = shutdownhook_establish(wi_pcmcia_shutdown, psc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mhzc.c,v 1.15 2004/08/06 19:07:13 mycroft Exp $ */
/* $NetBSD: mhzc.c,v 1.16 2004/08/07 05:27:39 mycroft Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.15 2004/08/06 19:07:13 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.16 2004/08/07 05:27:39 mycroft Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -204,7 +204,7 @@ mhzc_attach(parent, self, aux)
struct pcmcia_attach_args *pa = aux;
struct pcmcia_config_entry *cfe;
printf("\n");
aprint_normal("\n");
sc->sc_pf = pa->pf;
@ -242,21 +242,21 @@ mhzc_attach(parent, self, aux)
}
}
if (cfe == NULL) {
printf("%s: unable to find suitable config table entry\n",
sc->sc_dev.dv_xname);
aprint_error("%s: unable to find suitable config table entry\n",
self->dv_xname);
return;
}
if (mhzc_alloc_ethernet(sc, cfe) == 0) {
printf("%s: unable to allocate space for Ethernet portion\n",
sc->sc_dev.dv_xname);
aprint_error("%s: unable to allocate space for Ethernet portion\n",
self->dv_xname);
goto alloc_ethernet_failed;
}
/* Enable the card. */
pcmcia_function_init(pa->pf, cfe);
if (pcmcia_function_enable(pa->pf)) {
printf(": function enable failed\n");
aprint_error("%s: function enable failed\n", self->dv_xname);
goto enable_failed;
}
sc->sc_flags |= MHZC_IOSPACE_ALLOCED;
@ -264,8 +264,8 @@ mhzc_attach(parent, self, aux)
if (sc->sc_product->mp_enable != NULL)
(*sc->sc_product->mp_enable)(sc);
sc->sc_modem = config_found(&sc->sc_dev, "com", mhzc_print);
sc->sc_ethernet = config_found(&sc->sc_dev, "sm", mhzc_print);
sc->sc_modem = config_found(self, "com", mhzc_print);
sc->sc_ethernet = config_found(self, "sm", mhzc_print);
pcmcia_function_disable(pa->pf);
return;
@ -691,16 +691,15 @@ com_mhzc_attach(parent, self, aux)
struct com_softc *sc = (void *)self;
struct mhzc_softc *msc = (void *)parent;
printf(":");
aprint_normal("\n");
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO8, 0,
msc->sc_modem_pcioh.size, &msc->sc_modem_pcioh,
&msc->sc_modem_io_window)) {
printf("unable to map I/O space\n");
aprint_error("%s: unable to map I/O space\n",
sc->sc_dev.dv_xname);
return;
}
printf(" io 0x%x-0x%x",
(int)msc->sc_modem_pcioh.addr,
(int)(msc->sc_modem_pcioh.addr + msc->sc_modem_pcioh.size - 1));
msc->sc_flags |= MHZC_MODEM_MAPPED;
@ -715,6 +714,8 @@ com_mhzc_attach(parent, self, aux)
sc->enable = com_mhzc_enable;
sc->disable = com_mhzc_disable;
aprint_normal("%s", sc->sc_dev.dv_xname);
com_attach_subr(sc);
sc->enabled = 0;
@ -778,16 +779,15 @@ sm_mhzc_attach(parent, self, aux)
struct mhzc_softc *msc = (void *)parent;
u_int8_t myla[ETHER_ADDR_LEN];
printf(":");
aprint_normal("\n ");
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO16, 0,
msc->sc_ethernet_pcioh.size, &msc->sc_ethernet_pcioh,
&msc->sc_ethernet_io_window)) {
printf("unable to map I/O space\n");
aprint_error("%s: unable to map I/O space\n",
sc->sc_dev.dv_xname);
return;
}
printf(" io 0x%x-0x%x\n",
(int)msc->sc_ethernet_pcioh.addr,
(int)(msc->sc_ethernet_pcioh.addr + msc->sc_ethernet_pcioh.size - 1));
msc->sc_flags |= MHZC_ETHERNET_MAPPED;
@ -800,6 +800,8 @@ sm_mhzc_attach(parent, self, aux)
if ((*msc->sc_product->mp_enaddr)(msc, myla) != 1)
return;
aprint_normal("%s", sc->sc_dev.dv_xname);
/* Perform generic initialization. */
smc91cxx_attach(sc, myla);
}