- Use aprint*() instead of printf() in xxx_attach().

- Add missing aprint_naive("\n");
- KNF
This commit is contained in:
msaitoh 2016-07-14 04:00:45 +00:00
parent fdd524d4cc
commit d21ffc75e5
36 changed files with 489 additions and 427 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahc_cardbus.c,v 1.35 2011/08/01 11:20:27 drochner Exp $ */
/* $NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.35 2011/08/01 11:20:27 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_ahc_cardbus.h"
@ -138,7 +138,7 @@ ahc_cardbus_attach(device_t parent, device_t self, void *aux)
csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
} else {
csc->sc_bar = 0;
printf("%s: unable to map device registers\n",
aprint_error("%s: unable to map device registers\n",
ahc_name(ahc));
return;
}
@ -194,7 +194,7 @@ ahc_cardbus_attach(device_t parent, device_t self, void *aux)
*/
ahc->ih = Cardbus_intr_establish(ct, IPL_BIO, ahc_intr, ahc);
if (ahc->ih == NULL) {
printf("%s: unable to establish interrupt\n",
aprint_error("%s: unable to establish interrupt\n",
ahc_name(ahc));
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ehci_cardbus.c,v 1.33 2016/04/23 10:15:31 skrll Exp $ */
/* $NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.33 2016/04/23 10:15:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -78,7 +78,8 @@ struct ehci_cardbus_softc {
};
CFATTACH_DECL_NEW(ehci_cardbus, sizeof(struct ehci_cardbus_softc),
ehci_cardbus_match, ehci_cardbus_attach, ehci_cardbus_detach, ehci_activate);
ehci_cardbus_match, ehci_cardbus_attach, ehci_cardbus_detach,
ehci_activate);
static TAILQ_HEAD(, usb_cardbus) ehci_cardbus_alldevs =
TAILQ_HEAD_INITIALIZER(ehci_cardbus_alldevs);
@ -135,14 +136,15 @@ ehci_cardbus_attach(device_t parent, device_t self, void *aux)
sc->sc.sc_dev = self;
sc->sc.sc_bus.ub_hcpriv = sc;
aprint_naive("\n");
pci_devinfo(ca->ca_id, ca->ca_class, 0, devinfo, sizeof(devinfo));
printf(": %s (rev. 0x%02x)\n", devinfo,
aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
PCI_REVISION(ca->ca_class));
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map mem space\n", devname);
aprint_error("%s: can't map mem space\n", devname);
return;
}
@ -164,7 +166,7 @@ ehci_cardbus_attach(device_t parent, device_t self, void *aux)
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, ehci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@ -191,7 +193,7 @@ ehci_cardbus_attach(device_t parent, device_t self, void *aux)
int err = ehci_init(&sc->sc);
if (err) {
printf("%s: init failed, error=%d\n", devname, err);
aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);
@ -231,7 +233,8 @@ ehci_cardbus_detach(device_t self, int flags)
}
void
usb_cardbus_add(struct usb_cardbus *up, struct cardbus_attach_args *ca, device_t bu)
usb_cardbus_add(struct usb_cardbus *up, struct cardbus_attach_args *ca,
device_t bu)
{
TAILQ_INSERT_TAIL(&ehci_cardbus_alldevs, up, next);
up->bus = ca->ca_bus;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ohci_cardbus.c,v 1.42 2016/07/07 06:55:41 msaitoh Exp $ */
/* $NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.42 2016/07/07 06:55:41 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $");
#include "ehci_cardbus.h"
@ -121,7 +121,7 @@ ohci_cardbus_attach(device_t parent, device_t self, void *aux)
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map mem space\n", devname);
aprint_error("%s: can't map mem space\n", devname);
return;
}
@ -131,8 +131,7 @@ ohci_cardbus_attach(device_t parent, device_t self, void *aux)
sc->sc.sc_bus.ub_dmatag = ca->ca_dmat;
/* Enable the device. */
csr = Cardbus_conf_read(ct, ca->ca_tag,
PCI_COMMAND_STATUS_REG);
csr = Cardbus_conf_read(ct, ca->ca_tag, PCI_COMMAND_STATUS_REG);
Cardbus_conf_write(ct, ca->ca_tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE
| PCI_COMMAND_MEM_ENABLE);
@ -143,7 +142,7 @@ ohci_cardbus_attach(device_t parent, device_t self, void *aux)
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, ohci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@ -154,7 +153,7 @@ ohci_cardbus_attach(device_t parent, device_t self, void *aux)
int err = ohci_init(&sc->sc);
if (err) {
printf("%s: init failed, error=%d\n", devname, err);
aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci_cardbus.c,v 1.23 2016/07/07 06:55:41 msaitoh Exp $ */
/* $NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998-2005 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.23 2016/07/07 06:55:41 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $");
#include "ehci_cardbus.h"
@ -89,8 +89,7 @@ uhci_cardbus_match(device_t parent, cfdata_t match, void *aux)
}
static void
uhci_cardbus_attach(device_t parent, device_t self,
void *aux)
uhci_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct uhci_cardbus_softc *sc = device_private(self);
struct cardbus_attach_args *ca = (struct cardbus_attach_args *)aux;
@ -111,7 +110,7 @@ uhci_cardbus_attach(device_t parent, device_t self,
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map i/o space\n", devname);
aprint_error("%s: can't map i/o space\n", devname);
return;
}
@ -132,7 +131,7 @@ uhci_cardbus_attach(device_t parent, device_t self,
/* Map and establish the interrupt. */
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, uhci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@ -161,7 +160,7 @@ uhci_cardbus_attach(device_t parent, device_t self,
int err = uhci_init(&sc->sc);
if (err) {
printf("%s: init failed, error=%d\n", devname, err);
aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $ */
/* $NetBSD: ahb.c,v 1.64 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.64 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_ddb.h"
@ -148,8 +148,7 @@ CFATTACH_DECL_NEW(ahb, sizeof(struct ahb_softc),
* the actual probe routine to check it out.
*/
static int
ahbmatch(device_t parent, cfdata_t match,
void *aux)
ahbmatch(device_t parent, cfdata_t match, void *aux)
{
struct eisa_attach_args *ea = aux;
bus_space_tag_t iot = ea->ea_iot;
@ -205,7 +204,8 @@ ahbattach(device_t parent, device_t self, void *aux)
model = EISA_PRODUCT_ADP0400;
else
model = "unknown model!";
printf(": %s\n", model);
aprint_naive("\n");
aprint_normal(": %s\n", model);
if (bus_space_map(iot,
EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET,
@ -574,7 +574,8 @@ ahb_done(struct ahb_softc *sc, struct ahb_ecb *ecb)
break;
default: /* Other scsi protocol messes */
printf("%s: host_stat %x\n",
device_xname(sc->sc_dev), ecb->ecb_status.host_stat);
device_xname(sc->sc_dev),
ecb->ecb_status.host_stat);
xs->error = XS_DRIVER_STUFFUP;
}
} else if (ecb->ecb_status.target_stat != SCSI_OK) {
@ -590,7 +591,8 @@ ahb_done(struct ahb_softc *sc, struct ahb_ecb *ecb)
break;
default:
printf("%s: target_stat %x\n",
device_xname(sc->sc_dev), ecb->ecb_status.target_stat);
device_xname(sc->sc_dev),
ecb->ecb_status.target_stat);
xs->error = XS_DRIVER_STUFFUP;
}
} else
@ -706,8 +708,8 @@ ahb_init(struct ahb_softc *sc)
*/
if ((error = bus_dmamem_alloc(sc->sc_dmat, ECBSIZE,
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
aprint_error_dev(sc->sc_dev, "unable to allocate ecbs, error = %d\n",
error);
aprint_error_dev(sc->sc_dev,
"unable to allocate ecbs, error = %d\n", error);
return (error);
}
if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,

View File

@ -1,4 +1,4 @@
/* $NetBSD: dpt_eisa.c,v 1.22 2014/03/29 19:28:24 christos Exp $ */
/* $NetBSD: dpt_eisa.c,v 1.23 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Andrew Doran <ad@NetBSD.org>
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dpt_eisa.c,v 1.22 2014/03/29 19:28:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: dpt_eisa.c,v 1.23 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -140,7 +140,7 @@ dpt_eisa_attach(device_t parent, device_t self, void *aux)
if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot) +
DPT_EISA_SLOT_OFFSET, DPT_EISA_IOSIZE, 0, &ioh)) {
printf("can't map i/o space\n");
aprint_error("can't map i/o space\n");
return;
}
@ -150,12 +150,12 @@ dpt_eisa_attach(device_t parent, device_t self, void *aux)
/* Map and establish the interrupt. */
if (dpt_eisa_irq(iot, ioh, &irq)) {
printf("HBA on invalid IRQ\n");
aprint_error("HBA on invalid IRQ\n");
return;
}
if (eisa_intr_map(ec, irq, &ih)) {
printf("can't map interrupt (%d)\n", irq);
aprint_error("can't map interrupt (%d)\n", irq);
return;
}
@ -163,10 +163,10 @@ dpt_eisa_attach(device_t parent, device_t self, void *aux)
sc->sc_ih = eisa_intr_establish(ec, ih, IST_LEVEL, IPL_BIO,
dpt_intr, sc);
if (sc->sc_ih == NULL) {
printf("can't establish interrupt");
aprint_error("can't establish interrupt");
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
aprint_error(" at %s", intrstr);
aprint_error("\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tlp_eisa.c,v 1.26 2014/10/17 17:09:44 snj Exp $ */
/* $NetBSD: if_tlp_eisa.c,v 1.27 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tlp_eisa.c,v 1.26 2014/10/17 17:09:44 snj Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_tlp_eisa.c,v 1.27 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_inet.h"
@ -169,7 +169,7 @@ tlp_eisa_attach(device_t parent, device_t self, void *aux)
*/
if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot),
EISA_SLOT_SIZE, 0, &ioh)) {
printf(": unable to map I/O space\n");
aprint_error(": unable to map I/O space\n");
return;
}
@ -179,7 +179,7 @@ tlp_eisa_attach(device_t parent, device_t self, void *aux)
tep = tlp_eisa_lookup(ea);
if (tep == NULL) {
printf("\n");
aprint_normal("\n");
panic("tlp_eisa_attach: impossible");
}
sc->sc_chip = tep->tep_chip;
@ -209,7 +209,7 @@ tlp_eisa_attach(device_t parent, device_t self, void *aux)
*/
sc->sc_rev = bus_space_read_4(iot, ioh, DE425_CFRV) & 0xff;
printf(": %s Ethernet, pass %d.%d\n",
aprint_normal(": %s Ethernet, pass %d.%d\n",
tep->tep_name, (sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf);
sc->sc_dmat = ea->ea_dmat;
@ -261,8 +261,7 @@ tlp_eisa_attach(device_t parent, device_t self, void *aux)
* Map and establish our interrupt.
*/
if (eisa_intr_map(ec, irq, &ih)) {
aprint_error_dev(self, "unable to map interrupt (%u)\n",
irq);
aprint_error_dev(self, "unable to map interrupt (%u)\n", irq);
return;
}
intrstr = eisa_intr_string(ec, ih, intrbuf, sizeof(intrbuf));

View File

@ -1,4 +1,4 @@
/* $NetBSD: mt.c,v 1.29 2014/07/25 08:10:36 dholland Exp $ */
/* $NetBSD: mt.c,v 1.30 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.29 2014/07/25 08:10:36 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.30 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -236,7 +236,8 @@ mtattach(device_t parent, device_t self, void *aux)
if ((type = mtlookup(ca->ca_id, ca->ca_slave, ca->ca_punit)) < 0)
return;
printf(": %s tape\n", mtinfo[type].desc);
aprint_naive("\n");
aprint_normal(": %s tape\n", mtinfo[type].desc);
sc->sc_type = type;
sc->sc_flags = MTF_EXISTS;
@ -319,7 +320,8 @@ getstats:
sc->sc_flags |= MTF_STATTIMEO;
return (-2);
}
printf("%s readdsj: can't read status", device_xname(sc->sc_dev));
printf("%s readdsj: can't read status",
device_xname(sc->sc_dev));
return (-1);
}
sc->sc_recvtimeo = 0;
@ -510,8 +512,8 @@ mtstrategy(struct buf *bp)
#if 0
if (bp->b_bcount & ((1 << WRITE_BITS_IGNORED) - 1)) {
tprintf(sc->sc_ttyp,
"%s: write record must be multiple of %d\n",
device_xname(sc->sc_dev), 1 << WRITE_BITS_IGNORED);
"%s: write record must be multiple of %d\n",
device_xname(sc->sc_dev), 1 << WRITE_BITS_IGNORED);
goto error;
}
#endif
@ -853,7 +855,8 @@ mtintr(struct mt_softc *sc)
return;
default:
printf("%s intr: can't get drive stat", device_xname(sc->sc_dev));
printf("%s intr: can't get drive stat",
device_xname(sc->sc_dev));
goto error;
}
if (sc->sc_stat1 & (SR1_ERR | SR1_REJECT)) {
@ -925,7 +928,8 @@ mtintr(struct mt_softc *sc)
} else {
i = gpibrecv(sc->sc_ic, slave, MTT_BCNT, cmdbuf, 2);
if (i != 2) {
aprint_error_dev(sc->sc_dev, "intr: can't get xfer length\n");
aprint_error_dev(sc->sc_dev,
"intr: can't get xfer length\n");
goto error;
}
i = (int) *((u_short *) cmdbuf);

View File

@ -1,4 +1,4 @@
/* $NetBSD: gpiopwm.c,v 1.4 2014/02/25 18:30:09 pooka Exp $ */
/* $NetBSD: gpiopwm.c,v 1.5 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 2011 Marc Balmer <marc@msys.ch>
@ -109,29 +109,29 @@ gpiopwm_attach(device_t parent, device_t self, void *aux)
callout_init(&sc->sc_pulse, CALLOUT_MPSAFE);
callout_setfunc(&sc->sc_pulse, gpiopwm_pulse, sc);
sysctl_createv(&sc->sc_log, 0, NULL, &node,
0,
CTLTYPE_NODE, device_xname(sc->sc_dev),
SYSCTL_DESCR("GPIO software PWM"),
NULL, 0, NULL, 0,
CTL_HW, CTL_CREATE, CTL_EOL);
sysctl_createv(&sc->sc_log, 0, NULL, &node,
0,
CTLTYPE_NODE, device_xname(sc->sc_dev),
SYSCTL_DESCR("GPIO software PWM"),
NULL, 0, NULL, 0,
CTL_HW, CTL_CREATE, CTL_EOL);
if (node == NULL) {
printf(": can't create sysctl node\n");
return;
if (node == NULL) {
aprint_error(": can't create sysctl node\n");
return;
}
sysctl_createv(&sc->sc_log, 0, &node, NULL,
CTLFLAG_READWRITE,
CTLTYPE_INT, "on",
SYSCTL_DESCR("PWM 'on' period in ticks"),
gpiopwm_set_on, 0, (void *)sc, 0,
sysctl_createv(&sc->sc_log, 0, &node, NULL,
CTLFLAG_READWRITE,
CTLTYPE_INT, "on",
SYSCTL_DESCR("PWM 'on' period in ticks"),
gpiopwm_set_on, 0, (void *)sc, 0,
CTL_CREATE, CTL_EOL);
sysctl_createv(&sc->sc_log, 0, &node, NULL,
CTLFLAG_READWRITE,
CTLTYPE_INT, "off",
SYSCTL_DESCR("PWM 'off' period in ticks"),
gpiopwm_set_off, 0, (void *)sc, 0,
sysctl_createv(&sc->sc_log, 0, &node, NULL,
CTLFLAG_READWRITE,
CTLTYPE_INT, "off",
SYSCTL_DESCR("PWM 'off' period in ticks"),
gpiopwm_set_off, 0, (void *)sc, 0,
CTL_CREATE, CTL_EOL);
aprint_normal("\n");
@ -238,5 +238,4 @@ gpiopwm_activate(device_t self, enum devact act)
default:
return EOPNOTSUPP;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: gpiosim.c,v 1.18 2015/08/20 14:40:18 christos Exp $ */
/* $NetBSD: gpiosim.c,v 1.19 2016/07/14 04:00:45 msaitoh Exp $ */
/* $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $ */
/*
@ -131,7 +131,7 @@ gpiosim_attach(device_t parent, device_t self, void *aux)
CTL_HW, CTL_CREATE, CTL_EOL);
if (node == NULL) {
printf(": can't create sysctl node\n");
aprint_error(": can't create sysctl node\n");
return;
}
@ -142,7 +142,7 @@ gpiosim_attach(device_t parent, device_t self, void *aux)
gpiosim_sysctl, 0, (void *)sc, 0,
CTL_CREATE, CTL_EOL);
printf(": simulating %d pins\n", GPIOSIM_NPINS);
aprint_normal(": simulating %d pins\n", GPIOSIM_NPINS);
sc->sc_gdev = config_found_ia(self, "gpiobus", &gba, gpiobus_print);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: aic79xx_osm.c,v 1.32 2013/10/17 21:24:24 christos Exp $ */
/* $NetBSD: aic79xx_osm.c,v 1.33 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.32 2013/10/17 21:24:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.33 2016/07/14 04:00:45 msaitoh Exp $");
#include <dev/ic/aic79xx_osm.h>
#include <dev/ic/aic79xx_inline.h>
@ -78,7 +78,7 @@ ahd_attach(struct ahd_softc *ahd)
char ahd_info[256];
ahd_controller_info(ahd, ahd_info, sizeof(ahd_info));
printf("%s: %s\n", ahd_name(ahd), ahd_info);
aprint_normal("%s: %s\n", ahd_name(ahd), ahd_info);
ahd_lock(ahd, &s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ciss.c,v 1.35 2015/03/12 19:56:51 christos Exp $ */
/* $NetBSD: ciss.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $ */
/* $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $ */
/*
@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.35 2015/03/12 19:56:51 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $");
#include "bio.h"
@ -142,12 +142,12 @@ ciss_attach(struct ciss_softc *sc)
(u_int32_t *)&sc->cfg, sizeof(sc->cfg) / 4);
if (sc->cfg.signature != CISS_SIGNATURE) {
printf(": bad sign 0x%08x\n", sc->cfg.signature);
aprint_error(": bad sign 0x%08x\n", sc->cfg.signature);
return -1;
}
if (!(sc->cfg.methods & CISS_METH_SIMPL)) {
printf(": not simple 0x%08x\n", sc->cfg.methods);
aprint_error(": not simple 0x%08x\n", sc->cfg.methods);
return -1;
}
@ -202,7 +202,7 @@ ciss_attach(struct ciss_softc *sc)
if (!(bus_space_read_4(sc->sc_iot, sc->cfg_ioh, sc->cfgoff +
offsetof(struct ciss_config, amethod)) & CISS_METH_READY)) {
printf(": she never came ready for me 0x%08x\n",
aprint_error(": she never came ready for me 0x%08x\n",
sc->cfg.amethod);
return -1;
}
@ -221,27 +221,27 @@ ciss_attach(struct ciss_softc *sc)
total = sc->ccblen * sc->maxcmd;
if ((error = bus_dmamem_alloc(sc->sc_dmat, total, PAGE_SIZE, 0,
sc->cmdseg, 1, &rseg, BUS_DMA_NOWAIT))) {
printf(": cannot allocate CCBs (%d)\n", error);
aprint_error(": cannot allocate CCBs (%d)\n", error);
return -1;
}
if ((error = bus_dmamem_map(sc->sc_dmat, sc->cmdseg, rseg, total,
(void **)&sc->ccbs, BUS_DMA_NOWAIT))) {
printf(": cannot map CCBs (%d)\n", error);
aprint_error(": cannot map CCBs (%d)\n", error);
return -1;
}
memset(sc->ccbs, 0, total);
if ((error = bus_dmamap_create(sc->sc_dmat, total, 1,
total, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &sc->cmdmap))) {
printf(": cannot create CCBs dmamap (%d)\n", error);
aprint_error(": cannot create CCBs dmamap (%d)\n", error);
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
return -1;
}
if ((error = bus_dmamap_load(sc->sc_dmat, sc->cmdmap, sc->ccbs, total,
NULL, BUS_DMA_NOWAIT))) {
printf(": cannot load CCBs dmamap (%d)\n", error);
aprint_error(": cannot load CCBs dmamap (%d)\n", error);
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
bus_dmamap_destroy(sc->sc_dmat, sc->cmdmap);
return -1;
@ -278,7 +278,7 @@ ciss_attach(struct ciss_softc *sc)
}
if (i < sc->maxcmd) {
printf(": cannot create ccb#%d dmamap (%d)\n", i, error);
aprint_error(": cannot create ccb#%d dmamap (%d)\n", i, error);
if (i == 0) {
/* TODO leaking cmd's dmamaps and shitz */
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
@ -289,22 +289,22 @@ ciss_attach(struct ciss_softc *sc)
if ((error = bus_dmamem_alloc(sc->sc_dmat, PAGE_SIZE, PAGE_SIZE, 0,
seg, 1, &rseg, BUS_DMA_NOWAIT))) {
printf(": cannot allocate scratch buffer (%d)\n", error);
aprint_error(": cannot allocate scratch buffer (%d)\n", error);
return -1;
}
if ((error = bus_dmamem_map(sc->sc_dmat, seg, rseg, PAGE_SIZE,
(void **)&sc->scratch, BUS_DMA_NOWAIT))) {
printf(": cannot map scratch buffer (%d)\n", error);
aprint_error(": cannot map scratch buffer (%d)\n", error);
return -1;
}
memset(sc->scratch, 0, PAGE_SIZE);
sc->sc_waitflag = XS_CTL_NOSLEEP; /* can't sleep yet */
mutex_enter(&sc->sc_mutex_scratch); /* is this really needed? */
mutex_enter(&sc->sc_mutex_scratch); /* is this really needed? */
inq = sc->scratch;
if (ciss_inq(sc, inq)) {
printf(": adapter inquiry failed\n");
aprint_error(": adapter inquiry failed\n");
mutex_exit(&sc->sc_mutex_scratch);
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
bus_dmamap_destroy(sc->sc_dmat, sc->cmdmap);
@ -312,7 +312,7 @@ ciss_attach(struct ciss_softc *sc)
}
if (!(inq->flags & CISS_INQ_BIGMAP)) {
printf(": big map is not supported, flags=0x%x\n",
aprint_error(": big map is not supported, flags=0x%x\n",
inq->flags);
mutex_exit(&sc->sc_mutex_scratch);
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
@ -323,15 +323,15 @@ ciss_attach(struct ciss_softc *sc)
sc->maxunits = inq->numld;
sc->nbus = inq->nscsi_bus;
sc->ndrives = inq->buswidth ? inq->buswidth : 256;
printf(": %d LD%s, HW rev %d, FW %4.4s/%4.4s",
aprint_normal(": %d LD%s, HW rev %d, FW %4.4s/%4.4s",
inq->numld, inq->numld == 1? "" : "s",
inq->hw_rev, inq->fw_running, inq->fw_stored);
if (sc->cfg.methods & CISS_METH_FIFO64)
printf(", 64bit fifo");
aprint_normal(", 64bit fifo");
else if (sc->cfg.methods & CISS_METH_FIFO64_RRO)
printf(", 64bit fifo rro");
printf("\n");
aprint_normal(", 64bit fifo rro");
aprint_normal("\n");
mutex_exit(&sc->sc_mutex_scratch);
@ -357,7 +357,8 @@ ciss_attach(struct ciss_softc *sc)
sc->sc_flush = CISS_FLUSH_ENABLE;
if (!(sc->sc_sh = shutdownhook_establish(ciss_shutdown, sc))) {
printf(": unable to establish shutdown hook\n");
aprint_error_dev(sc->sc_dev,
"unable to establish shutdown hook\n");
bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
bus_dmamap_destroy(sc->sc_dmat, sc->cmdmap);
return -1;
@ -976,7 +977,7 @@ ciss_pdscan(struct ciss_softc *sc, int ld)
pdid = sc->scratch;
if (sc->ndrives == 256) {
for (i = 0; i < CISS_BIGBIT; i++)
if (!ciss_pdid(sc, i, pdid,
if (!ciss_pdid(sc, i, pdid,
XS_CTL_POLL|XS_CTL_NOSLEEP) &&
(pdid->present & CISS_PD_PRESENT))
buf[k++] = i;
@ -1352,7 +1353,7 @@ ciss_ioctl(device_t dev, u_long cmd, void *addr)
}
bd->bd_size = (u_int64_t)le32toh(pdid->nblocks) *
le16toh(pdid->blksz);
bd->bd_channel = pdid->bus;
bd->bd_channel = pdid->bus;
bd->bd_target = pdid->target;
bd->bd_lun = 0;
strlcpy(bd->bd_vendor, pdid->model,

View File

@ -1,4 +1,4 @@
/* $NetBSD: igsfb.c,v 1.52 2012/01/11 20:41:28 macallan Exp $ */
/* $NetBSD: igsfb.c,v 1.53 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 2002, 2003 Valeriy E. Ushakov
@ -31,7 +31,7 @@
* Integraphics Systems IGA 168x and CyberPro series.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.52 2012/01/11 20:41:28 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.53 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -193,7 +193,7 @@ igsfb_attach_subr(struct igsfb_softc *sc, int isconsole)
vcons_init_screen(&dc->dc_vd, &dc->dc_console, 1, &defattr);
dc->dc_console.scr_flags |= VCONS_SCREEN_IS_STATIC;
printf("%s: %dMB, %s%dx%d, %dbpp\n",
aprint_normal("%s: %dMB, %s%dx%d, %dbpp\n",
device_xname(sc->sc_dev),
(uint32_t)(dc->dc_vmemsz >> 20),
(dc->dc_hwflags & IGSFB_HW_BSWAP)
@ -201,7 +201,7 @@ igsfb_attach_subr(struct igsfb_softc *sc, int isconsole)
? "hardware bswap, " : "software bswap, "
: "",
dc->dc_width, dc->dc_height, dc->dc_depth);
printf("%s: using %dbpp for X\n", device_xname(sc->sc_dev),
aprint_normal("%s: using %dbpp for X\n", device_xname(sc->sc_dev),
dc->dc_maxdepth);
ri = &dc->dc_console.scr_ri;
ri->ri_ops.eraserows(ri, 0, ri->ri_rows, defattr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tropic.c,v 1.46 2016/06/10 13:27:14 ozaki-r Exp $ */
/* $NetBSD: tropic.c,v 1.47 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Ported to NetBSD by Onno van der Linden
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.46 2016/06/10 13:27:14 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.47 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_inet.h"
@ -187,7 +187,8 @@ tr_config(struct tr_softc *sc)
}
if (i == 30000 && sc->sc_srb == ACA_RDW(sc, ACA_WRBR)) {
aprint_error_dev(sc->sc_dev, "no response for fast path cfg\n");
aprint_error_dev(sc->sc_dev,
"no response for fast path cfg\n");
return 1;
}
@ -202,8 +203,7 @@ tr_config(struct tr_softc *sc)
sc->sc_txca = SRB_INW(sc, sc->sc_srb, SRB_CFPRESP_FPXMIT);
sc->sc_srb = SRB_INW(sc, sc->sc_srb, SRB_CFPRESP_SRBADDR);
}
else {
} else {
if (sc->sc_init_status & RSP_16)
sc->sc_maxmtu = sc->sc_dhb16maxsz;
else
@ -255,8 +255,7 @@ tr_attach(struct tr_softc *sc)
/*
* Create circular queues caching the buffer pointers ?
*/
}
else {
} else {
/*
* MAX_MACFRAME_SIZE = DHB_SIZE - 6
* IPMTU = MAX_MACFRAME_SIZE - (14 + 18 + 8)
@ -408,8 +407,7 @@ tr_attach(struct tr_softc *sc)
ifmedia_set(&sc->sc_media, *defmediaptr);
else
ifmedia_set(&sc->sc_media, 0);
}
else {
} else {
ifmedia_add(&sc->sc_media, IFM_TOKEN | IFM_MANUAL, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_TOKEN | IFM_MANUAL);
}
@ -423,7 +421,7 @@ tr_attach(struct tr_softc *sc)
token_ifattach(ifp, myaddr);
printf("%s: address %s ring speed %d Mbps\n", device_xname(sc->sc_dev),
aprint_error_dev(sc->sc_dev, "address %s ring speed %d Mbps\n",
token_sprintf(myaddr), (sc->sc_init_status & RSP_16) ? 16 : 4);
callout_init(&sc->sc_init_callout, 0);
@ -447,7 +445,8 @@ tr_setspeed(struct tr_softc *sc, u_int8_t speed)
if ((SRB_INB(sc, sc->sc_srb, SRB_RETCODE) != 0)) {
printf("%s: set default ringspeed returned: 0x%02x\n",
device_xname(sc->sc_dev), SRB_INB(sc, sc->sc_srb, SRB_RETCODE));
device_xname(sc->sc_dev),
SRB_INB(sc, sc->sc_srb, SRB_RETCODE));
return 1;
}
return 0;
@ -505,7 +504,8 @@ tr_reset(struct tr_softc *sc)
}
if (i == 35000 && sc->sc_srb == 0) {
aprint_error_dev(sc->sc_dev, "no response from adapter after reset\n");
aprint_error_dev(sc->sc_dev,
"no response from adapter after reset\n");
return 1;
}
@ -514,7 +514,8 @@ tr_reset(struct tr_softc *sc)
ACA_OUTB(sc, ACA_RRR_e, (sc->sc_maddr >> 12));
sc->sc_srb = ACA_RDW(sc, ACA_WRBR);
if (SRB_INB(sc, sc->sc_srb, SRB_CMD) != 0x80) {
aprint_error_dev(sc->sc_dev, "initialization incomplete, status: 0x%02x\n",
aprint_error_dev(sc->sc_dev,
"initialization incomplete, status: 0x%02x\n",
SRB_INB(sc, sc->sc_srb, SRB_CMD));
return 1;
}
@ -641,8 +642,7 @@ tr_init(void *arg)
if (sc->sc_init_status & RSP_16) {
dhbsize = sc->sc_dhb16maxsz;
}
else {
} else {
dhbsize = sc->sc_dhb4maxsz;
}
#if 0 /* XXXchb unneeded? */
@ -661,8 +661,7 @@ tr_init(void *arg)
num_dhb = 2; /* firmware can't cope with more DHBs */
if (num_dhb < 1)
num_dhb = 1; /* we need at least one */
}
else
} else
SRB_OUTW(sc, open_srb, SRB_OPEN_DHBLEN, DHB_LENGTH);
SRB_OUTB(sc, open_srb, SRB_OPEN_NUMDHB, num_dhb);
@ -808,8 +807,7 @@ tr_intr(void *arg)
rc = 1; /* Claim interrupt. */
break; /* Terminate loop. */
}
else if (status & XMIT_COMPLETE) {
} else if (status & XMIT_COMPLETE) {
ACA_RSTB(sc, ACA_ISRP_o, ~(XMIT_COMPLETE));
tr_xint(sc);
rc = 1;
@ -838,8 +836,9 @@ tr_intr(void *arg)
case XMIT_UI_FRM: /* Response to xmit request */
/* Response not valid? */
if (retcode != 0xff)
aprint_error_dev(sc->sc_dev, "error on xmit request = "
"0x%x\n", retcode);
aprint_error_dev(sc->sc_dev, "error "
"on xmit request = 0x%x\n",
retcode);
break;
case DIR_OPEN_ADAPTER: /* open-adapter-cmd response */
@ -874,12 +873,11 @@ tr_intr(void *arg)
#endif
sc->sc_xmit_correlator = 0;
wakeup(&sc->tr_sleepevent);
}
else
} else
tr_opensap(sc, LLC_SNAP_LSAP);
}
else {
aprint_error_dev(sc->sc_dev, "open error = 0x%x\n",
} else {
aprint_error_dev(sc->sc_dev,
"open error = 0x%x\n",
SRB_INB(sc, srb, SRB_RETCODE));
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_flags &= ~IFF_UP;
@ -895,7 +893,8 @@ tr_intr(void *arg)
case DIR_CLOSE: /* Response to close adapter command */
/* Close not successful? */
if (retcode != 0)
aprint_error_dev(sc->sc_dev, "close error = 0x%x\n", retcode);
aprint_error_dev(sc->sc_dev,
"close error = 0x%x\n", retcode);
else {
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_flags &= ~IFF_UP;
@ -924,11 +923,13 @@ tr_intr(void *arg)
case DIR_READ_LOG: /* Response to read log */
/* Cmd not successful? */
if (retcode != 0)
aprint_error_dev(sc->sc_dev, "read error log cmd err = "
"0x%x\n", retcode);
aprint_error_dev(sc->sc_dev, "read "
"error log cmd err = 0x%x\n",
retcode);
#ifdef TROPICDEBUG
log_srb = sc->sc_srb;
printf("%s: ERROR LOG:\n", device_xname(sc->sc_dev));
printf("%s: ERROR LOG:\n",
device_xname(sc->sc_dev));
printf("%s: Line=%d, Internal=%d, Burst=%d\n",
device_xname(sc->sc_dev),
(SRB_INB(sc, log_srb, SRB_LOG_LINEERRS)),
@ -939,12 +940,14 @@ tr_intr(void *arg)
(SRB_INB(sc, log_srb, SRB_LOG_ACERRS)),
(SRB_INB(sc, log_srb, SRB_LOG_ABRTERRS)),
(SRB_INB(sc, log_srb, SRB_LOG_LOSTFRMS)));
printf("%s: Receive congestion=%d, Frame copied=%d, Frequency=%d\n",
printf("%s: Receive congestion=%d, "
"Frame copied=%d, Frequency=%d\n",
device_xname(sc->sc_dev),
(SRB_INB(sc, log_srb, SRB_LOG_RCVCONG)),
(SRB_INB(sc, log_srb, SRB_LOG_FCPYERRS)),
(SRB_INB(sc, log_srb, SRB_LOG_FREQERRS)));
printf("%s: Token=%d\n", device_xname(sc->sc_dev),
printf("%s: Token=%d\n",
device_xname(sc->sc_dev),
(SRB_INB(sc, log_srb, SRB_LOG_TOKENERRS)));
#endif /* TROPICDEBUG */
ifp->if_flags &= ~IFF_OACTIVE;
@ -974,22 +977,26 @@ tr_intr(void *arg)
case REC_DATA: /* Receive */
/* Response not valid? */
if (retcode != 0xff)
aprint_error_dev(sc->sc_dev, "ASB bad receive response = 0x%x\n", retcode);
aprint_error_dev(sc->sc_dev, "ASB bad "
"receive response = 0x%x\n",
retcode);
break;
case XMIT_DIR_FRAME: /* Transmit */
case XMIT_UI_FRM: /* Transmit */
/* Response not valid? */
if (retcode != 0xff)
aprint_error_dev(sc->sc_dev, "ASB response err on xmit = 0x%x\n", retcode);
aprint_error_dev(sc->sc_dev,
"ASB response err on xmit = "
"0x%x\n", retcode);
break;
default:
aprint_error_dev(sc->sc_dev, "invalid command in ASB = 0x%x\n", command);
aprint_error_dev(sc->sc_dev,
"invalid command in ASB = 0x%x\n",command);
break;
}
/* Clear this interrupt bit */
ACA_RSTB(sc, ACA_ISRP_o, ~(ASB_FREE_INT));
}
else if (status & ARB_CMD_INT) { /* Command for PC to handle? */
} else if (status & ARB_CMD_INT) { /* Command for PC to handle? */
bus_size_t arb = sc->sc_arb;
command = ARB_INB(sc, arb, ARB_CMD);
@ -1007,14 +1014,14 @@ tr_intr(void *arg)
case RING_STAT_CHANGE: /* Ring status change */
if (ARB_INW(sc, arb, ARB_RINGSTATUS) &
(SIGNAL_LOSS + LOBE_FAULT)){
aprint_error_dev(sc->sc_dev, "signal loss / lobe fault\n");
aprint_error_dev(sc->sc_dev,
"signal loss / lobe fault\n");
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_flags &= ~IFF_UP;
IFQ_PURGE(&ifp->if_snd);
callout_reset(&sc->sc_reinit_callout,
hz * 30, tr_reinit, sc);
}
else {
} else {
#ifdef TROPICDEBUG
if (ARB_INW(sc, arb, ARB_RINGSTATUS) &
~(SOFT_ERR))
@ -1044,7 +1051,8 @@ tr_intr(void *arg)
break;
default:
aprint_error_dev(sc->sc_dev, "invalid command in ARB = 0x%x\n", command);
aprint_error_dev(sc->sc_dev,
"invalid command in ARB = 0x%x\n",command);
break;
}
@ -1076,8 +1084,7 @@ tr_intr(void *arg)
SSB_XMITERR));
}
ifp->if_oerrors++;
}
else
} else
ifp->if_opackets++;
ifp->if_flags &= ~IFF_OACTIVE;
@ -1094,7 +1101,9 @@ tr_intr(void *arg)
retcode);
break;
default:
aprint_error_dev(sc->sc_dev, "SSB error, invalid command =%x\n", command);
aprint_error_dev(sc->sc_dev,
"SSB error, invalid command =%x\n",
command);
}
/* clear this interrupt bit */
ACA_RSTB(sc, ACA_ISRP_o, ~(SSB_RESP_INT));
@ -1122,20 +1131,22 @@ tr_intr(void *arg)
}
#ifdef notyet
int asb_reply_rcv(void)
int
asb_reply_rcv(void)
{
}
int asb_reply_xmit(void)
int
asb_reply_xmit(void)
{
}
int asb_response(bus_size_t asb, size_t len)
int
asb_response(bus_size_t asb, size_t len)
{
if (empty_queue) {
answer with RESP_IN_ASB | ASB_FREE
}
else {
} else {
put asb in queue
}
}
@ -1241,8 +1252,7 @@ tr_rint(struct tr_softc *sc)
#ifdef TROPICDEBUG
printf("tr_rint: packet dropped\n");
#endif /* TROPICDEBUG */
}
else {
} else {
/*
* Indicate successful receive.
*/
@ -1307,8 +1317,7 @@ tr_oldxint(struct tr_softc *sc)
SR_OUTB(sc, (dhb + 2 + i), 0xff);
SR_OUTB(sc, (dhb + 8 + i), 0x00);
}
}
else {
} else {
/*
* XXX what's command here ? command = 0x0d (always ?)
*/
@ -1336,9 +1345,9 @@ tr_oldxint(struct tr_softc *sc)
/* Set size of transmission frame in ASB. */
ASB_OUTW(sc, asb, XMIT_FRAMELEN, size);
}
else {
aprint_error_dev(sc->sc_dev, "unexpected empty mbuf send queue\n");
} else {
aprint_error_dev(sc->sc_dev,
"unexpected empty mbuf send queue\n");
/* Set size of transmission frame in ASB to zero. */
ASB_OUTW(sc, asb, XMIT_FRAMELEN, 0);
@ -1596,8 +1605,7 @@ tr_bcopy(struct tr_softc *sc, u_char *dest, int len)
/* Get length of data in current receive buffer. */
rbc->data_len = RB_INW(sc, rbc->rbufp, RB_BUFLEN);
}
else {
} else {
if (len != 0) /* len should equal zero. */
printf("tr_bcopy: residual data not copied\n");
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: slhci_isa.c,v 1.14 2016/06/30 20:39:54 skrll Exp $ */
/* $NetBSD: slhci_isa.c,v 1.15 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 2001 Kiyoshi Ikehara. All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: slhci_isa.c,v 1.14 2016/06/30 20:39:54 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: slhci_isa.c,v 1.15 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -129,7 +129,7 @@ slhci_isa_attach(device_t parent, device_t self, void *aux)
/* Map I/O space */
if (bus_space_map(iot, ia->ia_io[0].ir_addr, SL11_PORTSIZE, 0, &ioh)) {
printf("%s: can't map I/O space\n", SC_NAME(sc));
aprint_error("%s: can't map I/O space\n", SC_NAME(sc));
return;
}
@ -140,11 +140,11 @@ slhci_isa_attach(device_t parent, device_t self, void *aux)
isc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq,
IST_EDGE, IPL_USB, slhci_intr, sc);
if (isc->sc_ih == NULL) {
printf("%s: can't establish interrupt\n", SC_NAME(sc));
aprint_error("%s: can't establish interrupt\n", SC_NAME(sc));
return;
}
/* Attach SL811HS/T */
if (slhci_attach(sc))
printf("%s: slhci_attach failed\n", SC_NAME(sc));
aprint_error("%s: slhci_attach failed\n", SC_NAME(sc));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cs_isapnp.c,v 1.19 2015/04/13 16:33:24 riastradh Exp $ */
/* $NetBSD: if_cs_isapnp.c,v 1.20 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c)2001 YAMAMOTO Takashi,
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_cs_isapnp.c,v 1.19 2015/04/13 16:33:24 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_cs_isapnp.c,v 1.20 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -93,28 +93,28 @@ cs_isapnp_attach(device_t parent, device_t self, void *aux)
printf("\n");
if (ipa->ipa_nio != 1 || ipa->ipa_nirq != 1 || ipa->ipa_ndrq) {
printf("%s: unexpected resource requirements\n",
DEVNAME(sc));
aprint_error_dev(self, "unexpected resource requirements\n");
return;
}
if (ipa->ipa_io[0].length != CS8900_IOSIZE) {
printf("%s: unexpected io size\n", DEVNAME(sc));
aprint_error_dev(self, "unexpected io size\n");
return;
}
if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) {
printf("%s: unable to allocate resources\n", DEVNAME(sc));
aprint_error_dev(self, "unable to allocate resources\n");
return;
}
printf("%s: %s %s\n", DEVNAME(sc), ipa->ipa_devident,
ipa->ipa_devclass);
aprint_normal_dev(self, "%s %s\n", ipa->ipa_devident,
ipa->ipa_devclass);
#ifdef notyet
#ifdef DEBUG
printf("%s: nio=%u, nmem=%u, nmem32=%u, ndrq=%u, nirq=%u\n", DEVNAME(sc),
ipa->ipa_nio, ipa->ipa_nmem, ipa->ipa_nmem32, ipa->ipa_ndrq, ipa->ipa_nirq);
printf("%s: nio=%u, nmem=%u, nmem32=%u, ndrq=%u, nirq=%u\n",
DEVNAME(sc), ipa->ipa_nio, ipa->ipa_nmem, ipa->ipa_nmem32,
ipa->ipa_ndrq, ipa->ipa_nirq);
#endif
isc->sc_ic = ipa->ipa_ic;
isc->sc_drq = -1;
@ -131,19 +131,19 @@ cs_isapnp_attach(device_t parent, device_t self, void *aux)
id = CS_READ_PACKET_PAGE_MEM(sc, PKTPG_EISA_NUM);
if (id != EISA_NUM_CRYSTAL) {
printf("%s: unexpected id(%u)\n",
DEVNAME(sc), id);
aprint_verbose_dev(self, "unexpected id(%u)\n",
id);
continue;
}
printf("%s: correct id(%u) from mem=%u\n",
DEVNAME(sc), id, (u_int)ipa->ipa_mem[i].h);
aprint_verbose_dev(self,"correct id(%u) from mem=%u\n",
id, (u_int)ipa->ipa_mem[i].h);
#endif
sc->sc_memt = ipa->ipa_memt;
sc->sc_memh = ipa->ipa_mem[i].h;
sc->sc_pktpgaddr = ipa->ipa_mem[i].base;
sc->sc_cfgflags |= CFGFLG_MEM_MODE;
printf("%s: memory mode\n", DEVNAME(sc));
aprint_normal_dev(self, "memory mode\n");
break;
}
}
@ -152,13 +152,12 @@ cs_isapnp_attach(device_t parent, device_t self, void *aux)
sc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
ipa->ipa_irq[0].type, IPL_NET, cs_intr, sc);
if (sc->sc_ih == 0) {
printf("%s: unable to establish interrupt\n",
DEVNAME(sc));
aprint_error_dev(self, "unable to establish interrupt\n");
goto fail;
}
if (cs_attach(sc, 0, 0, 0, 0)) {
printf("%s: unable to attach\n", DEVNAME(sc));
aprint_error_dev(self, "unable to attach\n");
goto fail;
}

View File

@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.32 2012/10/27 17:18:26 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.33 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -79,20 +79,24 @@ static void isic_isapnp_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(isic_isapnp, sizeof(struct isic_softc),
isic_isapnp_probe, isic_isapnp_attach, NULL, NULL);
typedef void (*allocmaps_func)(struct isapnp_attach_args *ipa, struct isic_softc *sc);
typedef void (*allocmaps_func)(struct isapnp_attach_args *ipa,
struct isic_softc *sc);
typedef void (*attach_func)(struct isic_softc *sc);
/* map allocators */
#if defined(ISICPNP_ELSA_QS1ISA) || defined(ISICPNP_SEDLBAUER) \
|| defined(ISICPNP_DYNALINK) || defined(ISICPNP_SIEMENS_ISURF2) \
|| defined(ISICPNP_ITKIX)
static void generic_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
static void generic_pnp_mapalloc(struct isapnp_attach_args *ipa,
struct isic_softc *sc);
#endif
#ifdef ISICPNP_DRN_NGO
static void ngo_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
static void ngo_pnp_mapalloc(struct isapnp_attach_args *ipa,
struct isic_softc *sc);
#endif
#if defined(ISICPNP_CRTX_S0_P) || defined(ISICPNP_TEL_S0_16_3_P)
static void tls_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
static void tls_pnp_mapalloc(struct isapnp_attach_args *ipa,
struct isic_softc *sc);
#endif
/* card attach functions */
@ -154,8 +158,7 @@ isic_isapnp_descriptions[] =
* Probe card
*/
static int
isic_isapnp_probe(device_t parent,
cfdata_t cf, void *aux)
isic_isapnp_probe(device_t parent, cfdata_t cf, void *aux)
{
struct isapnp_attach_args *ipa = aux;
const struct isic_isapnp_card_desc *desc = isic_isapnp_descriptions;
@ -231,9 +234,10 @@ isic_isapnp_attach(device_t parent, device_t self, void *aux)
printf(": %s\n", desc->name);
/* establish interrupt handler */
if (isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, ipa->ipa_irq[0].type,
IPL_NET, isicintr, sc) == NULL)
aprint_error_dev(sc->sc_dev, "couldn't establish interrupt handler\n");
if (isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
ipa->ipa_irq[0].type, IPL_NET, isicintr, sc) == NULL)
aprint_error_dev(sc->sc_dev,
"couldn't establish interrupt handler\n");
/* init card */
desc->attach(sc);
@ -242,8 +246,7 @@ isic_isapnp_attach(device_t parent, device_t self, void *aux)
sc->sc_isac_version = 0;
sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
switch(sc->sc_isac_version)
{
switch (sc->sc_isac_version) {
case ISAC_VA:
case ISAC_VB1:
case ISAC_VB2:
@ -251,16 +254,16 @@ isic_isapnp_attach(device_t parent, device_t self, void *aux)
break;
default:
printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
ISIC_PARM, sc->sc_isac_version);
aprint_error(ISIC_FMT
"Error, ISAC version %d unknown!\n",
ISIC_PARM, sc->sc_isac_version);
return;
break;
}
sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
switch(sc->sc_hscx_version)
{
switch (sc->sc_hscx_version) {
case HSCX_VA1:
case HSCX_VA2:
case HSCX_VA3:
@ -268,8 +271,9 @@ isic_isapnp_attach(device_t parent, device_t self, void *aux)
break;
default:
printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
ISIC_PARM, sc->sc_hscx_version);
aprint_error(ISIC_FMT
"Error, HSCX version %d unknown!\n",
ISIC_PARM, sc->sc_hscx_version);
return;
break;
};
@ -311,33 +315,24 @@ isic_isapnp_attach(device_t parent, device_t self, void *aux)
/* announce chip versions */
if(sc->sc_isac_version >= ISAC_UNKN)
{
printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
ISIC_PARM,
sc->sc_isac_version);
if (sc->sc_isac_version >= ISAC_UNKN) {
aprint_error(ISIC_FMT
"ISAC Version UNKNOWN (VN=0x%x)" TERMFMT, ISIC_PARM,
sc->sc_isac_version);
sc->sc_isac_version = ISAC_UNKN;
}
else
{
printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
ISIC_PARM,
ISACversion[sc->sc_isac_version],
sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
} else {
aprint_error(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT, ISIC_PARM,
ISACversion[sc->sc_isac_version],
sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
}
if(sc->sc_hscx_version >= HSCX_UNKN)
{
printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
ISIC_PARM,
sc->sc_hscx_version);
if (sc->sc_hscx_version >= HSCX_UNKN) {
aprint_error(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
ISIC_PARM, sc->sc_hscx_version);
sc->sc_hscx_version = HSCX_UNKN;
}
else
{
printf(ISIC_FMT "HSCX %s" TERMFMT,
ISIC_PARM,
HSCXversion[sc->sc_hscx_version]);
} else {
aprint_error(ISIC_FMT "HSCX %s" TERMFMT, ISIC_PARM,
HSCXversion[sc->sc_hscx_version]);
}
/* init higher protocol layers and save l2 handle */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ed_mca.c,v 1.65 2016/07/11 11:31:51 msaitoh Exp $ */
/* $NetBSD: ed_mca.c,v 1.66 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.65 2016/07/11 11:31:51 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.66 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -166,25 +166,24 @@ ed_mca_attach(device_t parent, device_t self, void *aux)
mutex_init(&ed->sc_q_lock, MUTEX_DEFAULT, IPL_VM);
if (ed_get_params(ed, &drv_flags)) {
printf(": IDENTIFY failed, no disk found\n");
aprint_error(": IDENTIFY failed, no disk found\n");
return;
}
format_bytes(pbuf, sizeof(pbuf),
(u_int64_t) ed->sc_capacity * DEV_BSIZE);
printf(": %s, %u cyl, %u head, %u sec, 512 bytes/sect x %u sectors\n",
pbuf,
ed->cyl, ed->heads, ed->sectors,
ed->sc_capacity);
aprint_normal(": %s, %u cyl, %u head, %u sec, 512 bytes/sect x "
"%u sectors\n", pbuf,
ed->cyl, ed->heads, ed->sectors,
ed->sc_capacity);
printf("%s: %u spares/cyl, %s, %s, %s, %s, %s\n",
device_xname(ed->sc_dev), ed->spares,
(drv_flags & (1 << 0)) ? "NoRetries" : "Retries",
(drv_flags & (1 << 1)) ? "Removable" : "Fixed",
(drv_flags & (1 << 2)) ? "SkewedFormat" : "NoSkew",
(drv_flags & (1 << 3)) ? "ZeroDefect" : "Defects",
(drv_flags & (1 << 4)) ? "InvalidSecondary" : "SecondaryOK"
);
aprint_normal("%s: %u spares/cyl, %s, %s, %s, %s, %s\n",
device_xname(ed->sc_dev), ed->spares,
(drv_flags & (1 << 0)) ? "NoRetries" : "Retries",
(drv_flags & (1 << 1)) ? "Removable" : "Fixed",
(drv_flags & (1 << 2)) ? "SkewedFormat" : "NoSkew",
(drv_flags & (1 << 3)) ? "ZeroDefect" : "Defects",
(drv_flags & (1 << 4)) ? "InvalidSecondary" : "SecondaryOK");
/*
* Initialize and attach the disk structure.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_elmc_mca.c,v 1.31 2016/07/11 11:31:51 msaitoh Exp $ */
/* $NetBSD: if_elmc_mca.c,v 1.32 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.31 2016/07/11 11:31:51 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.32 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -140,15 +140,15 @@ elmc_mca_attach(device_t parent, device_t self, void *aux)
case 8: irq = 9; break;
case 1: irq = 12; break;
default:
printf(": cannot determine irq\n");
aprint_error(": cannot determine irq\n");
return;
}
sc->sc_dev = self;
pbram_addr = ELMC_MADDR_BASE + (((pos2 & 0x18) >> 3) * 0x8000);
printf(" slot %d irq %d: 3Com EtherLink/MC Ethernet Adapter (3C523)\n",
ma->ma_slot + 1, irq);
aprint_normal(" slot %d irq %d: 3Com EtherLink/MC Ethernet Adapter "
"(3C523)\n", ma->ma_slot + 1, irq);
/* map the pio registers */
if (bus_space_map(ma->ma_iot, iobase, ELMC_IOADDR_SIZE, 0, &ioh)) {
@ -249,11 +249,12 @@ elmc_mca_attach(device_t parent, device_t self, void *aux)
ELMC_REVISION) & ELMC_REVISION_MASK;
/* dump known info */
printf("%s: rev %d, i/o %#04x-%#04x, mem %#06x-%#06x, %sternal xcvr\n",
device_xname(self), revision,
iobase, iobase + ELMC_IOADDR_SIZE - 1,
pbram_addr, pbram_addr + ELMC_MADDR_SIZE - 1,
(pos2 & 0x20) ? "ex" : "in");
aprint_normal("%s: rev %d, i/o %#04x-%#04x, mem %#06x-%#06x, "
"%sternal xcvr\n",
device_xname(self), revision,
iobase, iobase + ELMC_IOADDR_SIZE - 1,
pbram_addr, pbram_addr + ELMC_MADDR_SIZE - 1,
(pos2 & 0x20) ? "ex" : "in");
/*
* Hardware ethernet address is stored in the first six bytes

View File

@ -39,7 +39,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: ahc_pci.c,v 1.70 2014/03/29 19:28:24 christos Exp $
* $Id: ahc_pci.c,v 1.71 2016/07/14 04:00:46 msaitoh Exp $
*
* //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
*
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.70 2014/03/29 19:28:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.71 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -791,12 +791,13 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
entry = ahc_find_pci_device(pa->pa_id, subid, pa->pa_function);
if (entry == NULL)
return;
printf(": %s\n", entry->name);
aprint_naive("\n");
aprint_normal(": %s\n", entry->name);
/* Keep information about the PCI bus */
bd = malloc(sizeof (struct ahc_pci_busdata), M_DEVBUF, M_NOWAIT);
if (bd == NULL) {
printf("%s: unable to allocate bus-specific data\n",
aprint_error("%s: unable to allocate bus-specific data\n",
ahc_name(ahc));
return;
}
@ -825,7 +826,7 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
memh_valid = (pci_mapreg_map(pa, AHC_PCI_MEMADDR,
memtype, 0, &memt, &memh, NULL, NULL) == 0);
memtype, 0, &memt, &memh, NULL, NULL) == 0);
break;
default:
memh_valid = 0;
@ -851,7 +852,7 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
st = iot;
sh = ioh;
} else {
printf(": unable to map registers\n");
aprint_error(": unable to map registers\n");
return;
}
ahc->tag = st;
@ -883,7 +884,7 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
if (1/*bootverbose*/)
printf("%s: Enabling 39Bit Addressing\n",
aprint_normal("%s: Enabling 39Bit Addressing\n",
ahc_name(ahc));
devconfig |= DACEN;
}
@ -950,7 +951,7 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
}
if (pci_intr_map(pa, &ih)) {
printf("%s: couldn't map interrupt\n", ahc_name(ahc));
aprint_error("%s: couldn't map interrupt\n", ahc_name(ahc));
ahc_free(ahc);
return;
}
@ -966,7 +967,8 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
return;
}
if (intrstr != NULL)
printf("%s: interrupting at %s\n", ahc_name(ahc), intrstr);
aprint_normal("%s: interrupting at %s\n", ahc_name(ahc),
intrstr);
dscommand0 = ahc_inb(ahc, DSCOMMAND0);
dscommand0 |= MPARCKEN|CACHETHEN;
@ -1061,7 +1063,7 @@ ahc_pci_attach(device_t parent, device_t self, void *aux)
* conservative settings (async, no tagged
* queuing etc.) and machine dependent device
* property is set.
*/
*/
usetd = prop_dictionary_get(
device_properties(ahc->sc_dev),
"aic7xxx-use-target-defaults");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ciss_pci.c,v 1.12 2016/06/17 17:35:21 christos Exp $ */
/* $NetBSD: ciss_pci.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $ */
/* $OpenBSD: ciss_pci.c,v 1.9 2005/12/13 15:56:01 brad Exp $ */
/*
@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.12 2016/06/17 17:35:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -63,7 +63,7 @@ const struct {
"Compaq Smart Array 5300 V1"
},
{
PCI_VENDOR_COMPAQ,
PCI_VENDOR_COMPAQ,
PCI_PRODUCT_COMPAQ_CSA5300_2,
"Compaq Smart Array 5300 V2"
},
@ -258,6 +258,7 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
aprint_naive("\n");
for (i = 0; ciss_pci_devices[i].vendor; i++)
{
if ((PCI_VENDOR(pa->pa_id) == ciss_pci_devices[i].vendor &&
@ -265,7 +266,7 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
(PCI_VENDOR(reg) == ciss_pci_devices[i].vendor &&
PCI_PRODUCT(reg) == ciss_pci_devices[i].product))
{
printf(": %s\n", ciss_pci_devices[i].name);
aprint_normal(": %s\n", ciss_pci_devices[i].name);
break;
}
}
@ -273,12 +274,12 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, CISS_BAR);
if (memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT) &&
memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT)) {
printf(": wrong BAR type\n");
aprint_error_dev(self, "wrong BAR type\n");
return;
}
if (pci_mapreg_map(pa, CISS_BAR, memtype, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, &size)) {
printf(": can't map controller i/o space\n");
aprint_error_dev(self, "can't map controller i/o space\n");
return;
}
sc->sc_dmat = pa->pa_dmat;
@ -296,7 +297,8 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
if (cfg_bar != CISS_BAR) {
if (pci_mapreg_map(pa, cfg_bar, PCI_MAPREG_TYPE_MEM, 0,
NULL, &sc->cfg_ioh, NULL, &cfgsz)) {
printf(": can't map controller config space\n");
aprint_error_dev(self,
"can't map controller config space\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
return;
}
@ -306,7 +308,7 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
}
if (sc->cfgoff + sizeof(struct ciss_config) > cfgsz) {
printf(": unfit config space\n");
aprint_error_dev(self, "unfit config space\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
if (cfg_bar != CISS_BAR)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
@ -318,7 +320,7 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) | sc->iem);
if (pci_intr_map(pa, &ih)) {
printf(": can't map interrupt\n");
aprint_error_dev(self, "can't map interrupt\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
if (cfg_bar != CISS_BAR)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
@ -336,7 +338,7 @@ ciss_pci_attach(device_t parent, device_t self, void *aux)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
}
printf("%s: interrupting at %s\n%s", device_xname(sc->sc_dev), intrstr,
aprint_normal_dev(self, "interrupting at %s\n%s", intrstr,
device_xname(sc->sc_dev));
if (ciss_attach(sc)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_atw_pci.c,v 1.26 2014/03/29 19:28:24 christos Exp $ */
/* $NetBSD: if_atw_pci.c,v 1.27 2016/07/14 04:00:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.26 2014/03/29 19:28:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.27 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -188,11 +188,12 @@ atw_pci_attach(device_t parent, device_t self, void *aux)
panic("atw_pci_attach: impossible");
}
aprint_naive("\n");
/*
* Get revision info, and set some chip-specific variables.
*/
sc->sc_rev = PCI_REVISION(pa->pa_class);
printf(": %s, revision %d.%d\n", app->app_product_name,
aprint_normal(": %s, revision %d.%d\n", app->app_product_name,
(sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf);
/* power up chip */
@ -219,7 +220,7 @@ atw_pci_attach(device_t parent, device_t self, void *aux)
sc->sc_st = iot;
sc->sc_sh = ioh;
} else {
printf(": unable to map device registers\n");
aprint_error_dev(self, "unable to map device registers\n");
return;
}
@ -277,8 +278,7 @@ atw_pci_attach(device_t parent, device_t self, void *aux)
atw_shutdown))
pmf_class_network_register(sc->sc_dev, &sc->sc_if);
else
aprint_error_dev(sc->sc_dev,
"couldn't establish power handler\n");
aprint_error_dev(self, "couldn't establish power handler\n");
/*
* Power down the socket.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_txp.c,v 1.43 2016/06/10 13:27:14 ozaki-r Exp $ */
/* $NetBSD: if_txp.c,v 1.44 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (c) 2001
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.43 2016/06/10 13:27:14 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.44 2016/07/14 04:00:46 msaitoh Exp $");
#include "opt_inet.h"
@ -216,25 +216,27 @@ txp_attach(device_t parent, device_t self, void *aux)
}
sc->sc_flags = flags;
aprint_naive("\n");
pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof(devinfo));
#define TXP_EXTRAINFO ((flags & (TXP_USESUBSYSTEM|TXP_SERVERVERSION)) == \
(TXP_USESUBSYSTEM|TXP_SERVERVERSION) ? " (SVR)" : "")
printf(": %s%s\n%s", devinfo, TXP_EXTRAINFO, device_xname(sc->sc_dev));
aprint_normal(": %s%s\n%s", devinfo, TXP_EXTRAINFO,
device_xname(sc->sc_dev));
command = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
if (!(command & PCI_COMMAND_MASTER_ENABLE)) {
printf(": failed to enable bus mastering\n");
aprint_error(": failed to enable bus mastering\n");
return;
}
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
printf(": failed to enable memory mapping\n");
aprint_error(": failed to enable memory mapping\n");
return;
}
if (pci_mapreg_map(pa, TXP_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_bt, &sc->sc_bh, NULL, NULL)) {
printf(": can't map mem space %d\n", 0);
aprint_error(": can't map mem space %d\n", 0);
return;
}
@ -244,20 +246,20 @@ txp_attach(device_t parent, device_t self, void *aux)
* Allocate our interrupt.
*/
if (pci_intr_map(pa, &ih)) {
printf(": couldn't map interrupt\n");
aprint_error(": couldn't map interrupt\n");
return;
}
intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, txp_intr, sc);
if (sc->sc_ih == NULL) {
printf(": couldn't establish interrupt");
aprint_error(": couldn't establish interrupt");
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
return;
}
printf(": interrupting at %s\n", intrstr);
aprint_error(": interrupting at %s\n", intrstr);
if (txp_chip_init(sc))
goto cleanupintr;
@ -287,8 +289,8 @@ txp_attach(device_t parent, device_t self, void *aux)
enaddr[4] = ((u_int8_t *)&p2)[1];
enaddr[5] = ((u_int8_t *)&p2)[0];
printf("%s: Ethernet address %s\n", device_xname(sc->sc_dev),
ether_sprintf(enaddr));
aprint_normal_dev(self, "Ethernet address %s\n",
ether_sprintf(enaddr));
sc->sc_cold = 0;
ifmedia_init(&sc->sc_ifmedia, 0, txp_ifmedia_upd, txp_ifmedia_sts);
@ -449,7 +451,8 @@ txp_download_fw(struct txp_softc *sc)
WRITE_REG(sc, TXP_ISR, TXP_INT_A2H_0);
fileheader = (const struct txp_fw_file_header *)tc990image;
if (memcmp("TYPHOON", fileheader->magicid, sizeof(fileheader->magicid))) {
if (memcmp("TYPHOON", fileheader->magicid,
sizeof(fileheader->magicid))) {
printf(": fw invalid magic\n");
return (-1);
}
@ -459,7 +462,8 @@ txp_download_fw(struct txp_softc *sc)
WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_RUNTIME_IMAGE);
if (txp_download_fw_wait(sc)) {
printf("%s: fw wait failed, initial\n", device_xname(sc->sc_dev));
printf("%s: fw wait failed, initial\n",
device_xname(sc->sc_dev));
return (-1);
}
@ -522,7 +526,8 @@ txp_download_fw_wait(struct txp_softc *sc)
}
int
txp_download_fw_section(struct txp_softc *sc, const struct txp_fw_section_header *sect, int sectnum)
txp_download_fw_section(struct txp_softc *sc,
const struct txp_fw_section_header *sect, int sectnum)
{
struct txp_dma_alloc dma;
int rseg, err = 0;
@ -653,7 +658,8 @@ txp_intr(void *vsc)
}
void
txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r, struct txp_dma_alloc *dma)
txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r,
struct txp_dma_alloc *dma)
{
struct ifnet *ifp = &sc->sc_arpcom.ec_if;
struct txp_rx_desc *rxd;
@ -671,8 +677,8 @@ txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r, struct txp_dma_alloc
while (roff != woff) {
bus_dmamap_sync(sc->sc_dmat, dma->dma_map,
idx * sizeof(struct txp_rx_desc), sizeof(struct txp_rx_desc),
BUS_DMASYNC_POSTREAD);
idx * sizeof(struct txp_rx_desc),
sizeof(struct txp_rx_desc), BUS_DMASYNC_POSTREAD);
if (rxd->rx_flags & RX_FLAGS_ERROR) {
printf("%s: error 0x%x\n", device_xname(sc->sc_dev),
@ -755,8 +761,8 @@ txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r, struct txp_dma_alloc
next:
bus_dmamap_sync(sc->sc_dmat, dma->dma_map,
idx * sizeof(struct txp_rx_desc), sizeof(struct txp_rx_desc),
BUS_DMASYNC_PREREAD);
idx * sizeof(struct txp_rx_desc),
sizeof(struct txp_rx_desc), BUS_DMASYNC_PREREAD);
roff += sizeof(struct txp_rx_desc);
if (roff == (RX_ENTRIES * sizeof(struct txp_rx_desc))) {
@ -853,7 +859,8 @@ err_sd:
* Reclaim mbufs and entries from a transmit ring.
*/
void
txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r, struct txp_dma_alloc *dma)
txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r,
struct txp_dma_alloc *dma)
{
struct ifnet *ifp = &sc->sc_arpcom.ec_if;
u_int32_t idx = TXP_OFFSET2IDX(le32toh(*(r->r_off)));
@ -934,8 +941,8 @@ txp_alloc_rings(struct txp_softc *sc)
int i, j, nb;
/* boot record */
if (txp_dma_malloc(sc, sizeof(struct txp_boot_record), &sc->sc_boot_dma,
BUS_DMA_COHERENT)) {
if (txp_dma_malloc(sc, sizeof(struct txp_boot_record),
&sc->sc_boot_dma, BUS_DMA_COHERENT)) {
printf(": can't allocate boot record\n");
return (-1);
}
@ -960,7 +967,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate high tx ring\n");
goto bail_host;
}
memset(sc->sc_txhiring_dma.dma_vaddr, 0, sizeof(struct txp_tx_desc) * TX_ENTRIES);
memset(sc->sc_txhiring_dma.dma_vaddr, 0,
sizeof(struct txp_tx_desc) * TX_ENTRIES);
boot->br_txhipri_lo = htole32(sc->sc_txhiring_dma.dma_paddr & 0xffffffff);
boot->br_txhipri_hi = htole32(sc->sc_txhiring_dma.dma_paddr >> 32);
boot->br_txhipri_siz = htole32(TX_ENTRIES * sizeof(struct txp_tx_desc));
@ -987,7 +995,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate low tx ring\n");
goto bail_txhiring;
}
memset(sc->sc_txloring_dma.dma_vaddr, 0, sizeof(struct txp_tx_desc) * TX_ENTRIES);
memset(sc->sc_txloring_dma.dma_vaddr, 0,
sizeof(struct txp_tx_desc) * TX_ENTRIES);
boot->br_txlopri_lo = htole32(sc->sc_txloring_dma.dma_paddr & 0xffffffff);
boot->br_txlopri_hi = htole32(sc->sc_txloring_dma.dma_paddr >> 32);
boot->br_txlopri_siz = htole32(TX_ENTRIES * sizeof(struct txp_tx_desc));
@ -1002,7 +1011,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate high rx ring\n");
goto bail_txloring;
}
memset(sc->sc_rxhiring_dma.dma_vaddr, 0, sizeof(struct txp_rx_desc) * RX_ENTRIES);
memset(sc->sc_rxhiring_dma.dma_vaddr, 0,
sizeof(struct txp_rx_desc) * RX_ENTRIES);
boot->br_rxhipri_lo = htole32(sc->sc_rxhiring_dma.dma_paddr & 0xffffffff);
boot->br_rxhipri_hi = htole32(sc->sc_rxhiring_dma.dma_paddr >> 32);
boot->br_rxhipri_siz = htole32(RX_ENTRIES * sizeof(struct txp_rx_desc));
@ -1019,7 +1029,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate low rx ring\n");
goto bail_rxhiring;
}
memset(sc->sc_rxloring_dma.dma_vaddr, 0, sizeof(struct txp_rx_desc) * RX_ENTRIES);
memset(sc->sc_rxloring_dma.dma_vaddr, 0,
sizeof(struct txp_rx_desc) * RX_ENTRIES);
boot->br_rxlopri_lo = htole32(sc->sc_rxloring_dma.dma_paddr & 0xffffffff);
boot->br_rxlopri_hi = htole32(sc->sc_rxloring_dma.dma_paddr >> 32);
boot->br_rxlopri_siz = htole32(RX_ENTRIES * sizeof(struct txp_rx_desc));
@ -1036,7 +1047,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate command ring\n");
goto bail_rxloring;
}
memset(sc->sc_cmdring_dma.dma_vaddr, 0, sizeof(struct txp_cmd_desc) * CMD_ENTRIES);
memset(sc->sc_cmdring_dma.dma_vaddr, 0,
sizeof(struct txp_cmd_desc) * CMD_ENTRIES);
boot->br_cmd_lo = htole32(sc->sc_cmdring_dma.dma_paddr & 0xffffffff);
boot->br_cmd_hi = htole32(sc->sc_cmdring_dma.dma_paddr >> 32);
boot->br_cmd_siz = htole32(CMD_ENTRIES * sizeof(struct txp_cmd_desc));
@ -1050,7 +1062,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate response ring\n");
goto bail_cmdring;
}
memset(sc->sc_rspring_dma.dma_vaddr, 0, sizeof(struct txp_rsp_desc) * RSP_ENTRIES);
memset(sc->sc_rspring_dma.dma_vaddr, 0,
sizeof(struct txp_rsp_desc) * RSP_ENTRIES);
boot->br_resp_lo = htole32(sc->sc_rspring_dma.dma_paddr & 0xffffffff);
boot->br_resp_hi = htole32(sc->sc_rspring_dma.dma_paddr >> 32);
boot->br_resp_siz = htole32(CMD_ENTRIES * sizeof(struct txp_rsp_desc));
@ -1064,7 +1077,8 @@ txp_alloc_rings(struct txp_softc *sc)
printf(": can't allocate rx buffer ring\n");
goto bail_rspring;
}
memset(sc->sc_rxbufring_dma.dma_vaddr, 0, sizeof(struct txp_rxbuf_desc) * RXBUF_ENTRIES);
memset(sc->sc_rxbufring_dma.dma_vaddr, 0,
sizeof(struct txp_rxbuf_desc) * RXBUF_ENTRIES);
boot->br_rxbuf_lo = htole32(sc->sc_rxbufring_dma.dma_paddr & 0xffffffff);
boot->br_rxbuf_hi = htole32(sc->sc_rxbufring_dma.dma_paddr >> 32);
boot->br_rxbuf_siz = htole32(RXBUF_ENTRIES * sizeof(struct txp_rxbuf_desc));
@ -1073,7 +1087,8 @@ txp_alloc_rings(struct txp_softc *sc)
sd = (struct txp_swdesc *)malloc(sizeof(struct txp_swdesc),
M_DEVBUF, M_NOWAIT);
/* stash away pointer */
memcpy(__UNVOLATILE(&sc->sc_rxbufs[nb].rb_vaddrlo), &sd, sizeof(sd));
memcpy(__UNVOLATILE(&sc->sc_rxbufs[nb].rb_vaddrlo), &sd,
sizeof(sd));
if (sd == NULL)
break;
@ -1189,7 +1204,8 @@ bail_boot:
}
int
txp_dma_malloc(struct txp_softc *sc, bus_size_t size, struct txp_dma_alloc *dma, int mapflags)
txp_dma_malloc(struct txp_softc *sc, bus_size_t size,
struct txp_dma_alloc *dma, int mapflags)
{
int r;
@ -1551,7 +1567,8 @@ oactive1:
* Handle simple commands sent to the typhoon
*/
int
txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, u_int32_t in3, u_int16_t *out1, u_int32_t *out2, u_int32_t *out3, int wait)
txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2,
u_int32_t in3, u_int16_t *out1, u_int32_t *out2, u_int32_t *out3, int wait)
{
struct txp_rsp_desc *rsp = NULL;
@ -1572,7 +1589,9 @@ txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, u_
}
int
txp_command2(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, u_int32_t in3, struct txp_ext_desc *in_extp, u_int8_t in_extn, struct txp_rsp_desc **rspp, int wait)
txp_command2(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2,
u_int32_t in3, struct txp_ext_desc *in_extp, u_int8_t in_extn,
struct txp_rsp_desc **rspp, int wait)
{
struct txp_hostvar *hv = sc->sc_hostvar;
struct txp_cmd_desc *cmd;
@ -1645,7 +1664,8 @@ txp_command2(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, u
}
int
txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq, struct txp_rsp_desc **rspp)
txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq,
struct txp_rsp_desc **rspp)
{
struct txp_hostvar *hv = sc->sc_hostvar;
struct txp_rsp_desc *rsp;
@ -1692,7 +1712,8 @@ txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq,
}
void
txp_rsp_fixup(struct txp_softc *sc, struct txp_rsp_desc *rsp, struct txp_rsp_desc *dst)
txp_rsp_fixup(struct txp_softc *sc, struct txp_rsp_desc *rsp,
struct txp_rsp_desc *dst)
{
struct txp_rsp_desc *src = rsp;
struct txp_hostvar *hv = sc->sc_hostvar;
@ -1931,7 +1952,8 @@ again:
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
ETHER_ADDR_LEN)) {
/*
* We must listen to a range of multicast
* addresses. For now, just accept all

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vr.c,v 1.118 2016/07/07 06:55:41 msaitoh Exp $ */
/* $NetBSD: if_vr.c,v 1.119 2016/07/14 04:00:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.118 2016/07/07 06:55:41 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.119 2016/07/14 04:00:46 msaitoh Exp $");
@ -1514,8 +1514,7 @@ vr_attach(device_t parent, device_t self, void *aux)
/* power up chip */
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
vr_restore_state)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n",
error);
aprint_error_dev(self, "cannot activate %d\n", error);
return;
}
@ -1562,7 +1561,7 @@ vr_attach(device_t parent, device_t self, void *aux)
}
#endif
else {
printf(": unable to map device registers\n");
aprint_error(": unable to map device registers\n");
return;
}
@ -1571,7 +1570,8 @@ vr_attach(device_t parent, device_t self, void *aux)
aprint_error_dev(self, "couldn't map interrupt\n");
return;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle, intrbuf, sizeof(intrbuf));
intrstr = pci_intr_string(pa->pa_pc, intrhandle, intrbuf,
sizeof(intrbuf));
sc->vr_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_NET,
vr_intr, sc);
if (sc->vr_ih == NULL) {
@ -1672,7 +1672,8 @@ vr_attach(device_t parent, device_t self, void *aux)
if ((error = bus_dmamap_load(sc->vr_dmat, sc->vr_cddmamap,
sc->vr_control_data, sizeof(struct vr_control_data), NULL,
0)) != 0) {
aprint_error_dev(self, "unable to load control data DMA map, error = %d\n",
aprint_error_dev(self,
"unable to load control data DMA map, error = %d\n",
error);
goto fail_3;
}
@ -1684,8 +1685,9 @@ vr_attach(device_t parent, device_t self, void *aux)
if ((error = bus_dmamap_create(sc->vr_dmat, MCLBYTES,
1, MCLBYTES, 0, 0,
&VR_DSTX(sc, i)->ds_dmamap)) != 0) {
aprint_error_dev(self, "unable to create tx DMA map %d, "
"error = %d\n", i, error);
aprint_error_dev(self,
"unable to create tx DMA map %d, error = %d\n", i,
error);
goto fail_4;
}
}
@ -1697,8 +1699,9 @@ vr_attach(device_t parent, device_t self, void *aux)
if ((error = bus_dmamap_create(sc->vr_dmat, MCLBYTES, 1,
MCLBYTES, 0, 0,
&VR_DSRX(sc, i)->ds_dmamap)) != 0) {
aprint_error_dev(self, "unable to create rx DMA map %d, "
"error = %d\n", i, error);
aprint_error_dev(self,
"unable to create rx DMA map %d, error = %d\n", i,
error);
goto fail_5;
}
VR_DSRX(sc, i)->ds_mbuf = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wi_pci.c,v 1.55 2014/03/29 19:28:25 christos Exp $ */
/* $NetBSD: if_wi_pci.c,v 1.56 2016/07/14 04:00:46 msaitoh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.55 2014/03/29 19:28:25 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.56 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -239,12 +239,12 @@ wi_pci_attach(device_t parent, device_t self, void *aux)
/* Map memory and I/O registers. */
if (pci_mapreg_map(pa, WI_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&memt, &memh, NULL, NULL) != 0) {
printf(": can't map mem space\n");
aprint_error(": can't map mem space\n");
return;
}
if (pci_mapreg_map(pa, WI_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL) != 0) {
printf(": can't map I/O space\n");
aprint_error(": can't map I/O space\n");
return;
}
@ -252,11 +252,11 @@ wi_pci_attach(device_t parent, device_t self, void *aux)
/* The PLX 9052 doesn't have IO at 0x14. Perhaps
other chips have, so we'll make this conditional. */
if (pci_mapreg_map(pa, WI_PCI_PLX_LOIO,
PCI_MAPREG_TYPE_IO, 0, &plxt,
&plxh, NULL, NULL) != 0) {
printf(": can't map PLX\n");
return;
}
PCI_MAPREG_TYPE_IO, 0, &plxt, &plxh, NULL, NULL)
!= 0) {
aprint_error(": can't map PLX\n");
return;
}
}
break;
case CHIP_TMD_7160:
@ -268,12 +268,12 @@ wi_pci_attach(device_t parent, device_t self, void *aux)
/* Map COR and I/O registers. */
if (pci_mapreg_map(pa, WI_TMD_COR, PCI_MAPREG_TYPE_IO, 0,
&tmdt, &tmdh, NULL, NULL) != 0) {
printf(": can't map TMD\n");
aprint_error(": can't map TMD\n");
return;
}
if (pci_mapreg_map(pa, WI_TMD_IO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL) != 0) {
printf(": can't map I/O space\n");
aprint_error(": can't map I/O space\n");
return;
}
break;
@ -281,7 +281,7 @@ wi_pci_attach(device_t parent, device_t self, void *aux)
if (pci_mapreg_map(pa, WI_PCI_CBMA,
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
0, &iot, &ioh, NULL, NULL) != 0) {
printf(": can't map mem space\n");
aprint_error(": can't map mem space\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_xge.c,v 1.22 2016/06/10 13:27:14 ozaki-r Exp $ */
/* $NetBSD: if_xge.c,v 1.23 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.22 2016/06/10 13:27:14 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.23 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
@ -321,9 +321,11 @@ xge_attach(device_t parent, device_t self, void *aux)
#error bad endianness!
#endif
if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC)
return printf("%s: failed configuring endian, %llx != %llx!\n",
if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC) {
aprint_error("%s: failed configuring endian, %llx != %llx!\n",
XNAME, (unsigned long long)val, SWAPPER_MAGIC);
return;
}
/*
* The MAC addr may be all FF's, which is not good.
@ -357,9 +359,11 @@ xge_attach(device_t parent, device_t self, void *aux)
#error bad endianness!
#endif
if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC)
return printf("%s: failed configuring endian2, %llx != %llx!\n",
if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC) {
aprint_error("%s: failed configuring endian2, %llx != %llx!\n",
XNAME, (unsigned long long)val, SWAPPER_MAGIC);
return;
}
/*
* XGXS initialization.
@ -384,8 +388,10 @@ xge_attach(device_t parent, device_t self, void *aux)
/*
* Get memory for transmit descriptor lists.
*/
if (xge_alloc_txmem(sc))
return printf("%s: failed allocating txmem.\n", XNAME);
if (xge_alloc_txmem(sc)) {
aprint_error("%s: failed allocating txmem.\n", XNAME);
return;
}
/* 9 and 10 - set FIFO number/prio */
PIF_WCSR(TX_FIFO_P0, TX_FIFO_LEN0(NTXDESCS));
@ -410,8 +416,10 @@ xge_attach(device_t parent, device_t self, void *aux)
*/
for (i = 0; i < NTXDESCS; i++) {
if (bus_dmamap_create(sc->sc_dmat, XGE_IP_MAXPACKET,
NTXFRAGS, MCLBYTES, 0, 0, &sc->sc_txm[i]))
return printf("%s: cannot create TX DMA maps\n", XNAME);
NTXFRAGS, MCLBYTES, 0, 0, &sc->sc_txm[i])) {
aprint_error("%s: cannot create TX DMA maps\n", XNAME);
return;
}
}
sc->sc_lasttx = NTXDESCS-1;
@ -420,14 +428,18 @@ xge_attach(device_t parent, device_t self, void *aux)
* RxDMA initialization.
* Only use one out of 8 possible receive queues.
*/
if (xge_alloc_rxmem(sc)) /* allocate rx descriptor memory */
return printf("%s: failed allocating rxmem\n", XNAME);
if (xge_alloc_rxmem(sc)) { /* allocate rx descriptor memory */
aprint_error("%s: failed allocating rxmem\n", XNAME);
return;
}
/* Create receive buffer DMA maps */
for (i = 0; i < NRXREAL; i++) {
if (bus_dmamap_create(sc->sc_dmat, XGE_MAX_MTU,
NRXFRAGS, MCLBYTES, 0, 0, &sc->sc_rxm[i]))
return printf("%s: cannot create RX DMA maps\n", XNAME);
NRXFRAGS, MCLBYTES, 0, 0, &sc->sc_rxm[i])) {
aprint_error("%s: cannot create RX DMA maps\n", XNAME);
return;
}
}
/* allocate mbufs to receive descriptors */
@ -546,13 +558,18 @@ xge_attach(device_t parent, device_t self, void *aux)
/*
* Setup interrupt vector before initializing.
*/
if (pci_intr_map(pa, &ih))
return aprint_error_dev(sc->sc_dev, "unable to map interrupt\n");
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->sc_dev, "unable to map interrupt\n");
return;
}
intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
if ((sc->sc_ih =
pci_intr_establish(pc, ih, IPL_NET, xge_intr, sc)) == NULL)
return aprint_error_dev(sc->sc_dev, "unable to establish interrupt at %s\n",
pci_intr_establish(pc, ih, IPL_NET, xge_intr, sc)) == NULL) {
aprint_error_dev(sc->sc_dev,
"unable to establish interrupt at %s\n",
intrstr ? intrstr : "<unknown>");
return;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
#ifdef XGE_EVENT_COUNTERS
@ -694,7 +711,7 @@ xge_intr(void *pv)
while ((PIF_RCSR(ADAPTER_STATUS) & QUIESCENT) != QUIESCENT)
;
PIF_WCSR(MAC_RMAC_ERR_REG, RMAC_LINK_STATE_CHANGE_INT);
val = PIF_RCSR(ADAPTER_STATUS);
if ((val & (RMAC_REMOTE_FAULT|RMAC_LOCAL_FAULT)) == 0)
xge_enable(sc); /* Only if link restored */

View File

@ -1,4 +1,4 @@
/* $NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $ */
/* $NetBSD: igsfb_pci.c,v 1.24 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (c) 2002, 2003 Valeriy E. Ushakov
@ -31,7 +31,7 @@
* Integraphics Systems IGA 168x and CyberPro series.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.24 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -185,7 +185,7 @@ igsfb_pci_attach(device_t parent, device_t self, void *aux)
pa->pa_iot, pa->pa_memt, pa->pa_pc,
pa->pa_tag, PCI_PRODUCT(pa->pa_id)) != 0)
{
printf("unable to map device registers\n");
aprint_error("unable to map device registers\n");
free(sc->sc_dc, M_DEVBUF);
sc->sc_dc = NULL;
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: isp_pci.c,v 1.118 2016/07/07 06:55:41 msaitoh Exp $ */
/* $NetBSD: isp_pci.c,v 1.119 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (C) 1997, 1998, 1999 National Aeronautics & Space Administration
* All rights reserved.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isp_pci.c,v 1.118 2016/07/07 06:55:41 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: isp_pci.c,v 1.119 2016/07/14 04:00:46 msaitoh Exp $");
#include <dev/ic/isp_netbsd.h>
#include <dev/pci/pcireg.h>
@ -517,7 +517,7 @@ isp_pci_attach(device_t parent, device_t self, void *aux)
st = iot;
sh = ioh;
} else {
printf(": unable to map device registers\n");
aprint_error(": unable to map device registers\n");
return;
}
dstring = "\n";
@ -689,7 +689,7 @@ isp_pci_attach(device_t parent, device_t self, void *aux)
isp->isp_param = malloc(mamt, M_DEVBUF, M_NOWAIT);
if (isp->isp_param == NULL) {
printf(nomem, device_xname(self));
aprint_error(nomem, device_xname(self));
return;
}
memset(isp->isp_param, 0, mamt);
@ -697,7 +697,7 @@ isp_pci_attach(device_t parent, device_t self, void *aux)
isp->isp_osinfo.chan = malloc(mamt, M_DEVBUF, M_NOWAIT);
if (isp->isp_osinfo.chan == NULL) {
free(isp->isp_param, M_DEVBUF);
printf(nomem, device_xname(self));
aprint_error(nomem, device_xname(self));
return;
}
memset(isp->isp_osinfo.chan, 0, mamt);
@ -717,9 +717,9 @@ isp_pci_attach(device_t parent, device_t self, void *aux)
#endif
#endif
if (isp->isp_dblev & ISP_LOGCONFIG) {
printf("\n");
aprint_normal("\n");
} else {
printf("%s", dstring);
aprint_normal("%s", dstring);
}
isp->isp_dmatag = pa->pa_dmat;
@ -775,7 +775,7 @@ isp_pci_attach(device_t parent, device_t self, void *aux)
return;
}
printf("%s: interrupting at %s\n", device_xname(self), intrstr);
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
isp->isp_confopts = device_cfdata(self)->cf_flags;
ISP_LOCK(isp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfi_pci.c,v 1.18 2014/03/29 19:28:25 christos Exp $ */
/* $NetBSD: mfi_pci.c,v 1.19 2016/07/14 04:00:46 msaitoh Exp $ */
/* $OpenBSD: mfi_pci.c,v 1.11 2006/08/06 04:40:08 brad Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.18 2014/03/29 19:28:25 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.19 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -206,7 +206,7 @@ mfi_pci_attach(device_t parent, device_t self, void *aux)
mpd = mfi_pci_find_device(pa);
if (mpd == NULL) {
printf(": can't find matching pci device\n");
aprint_error(": can't find matching pci device\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: st.c,v 1.227 2015/08/24 23:13:15 pooka Exp $ */
/* $NetBSD: st.c,v 1.228 2016/07/14 04:00:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.227 2015/08/24 23:13:15 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.228 2016/07/14 04:00:46 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_scsi.h"
@ -401,22 +401,22 @@ stattach(device_t parent, device_t self, void *aux)
* Any steps needed to bring it into line
*/
st_identify_drive(st, &sa->sa_inqbuf);
printf("\n");
aprint_naive("\n");
aprint_normal("\n");
/* Use the subdriver to request information regarding the drive. */
printf("%s : %s", device_xname(st->sc_dev), st->quirkdata
? "quirks apply, " : "");
aprint_normal_dev(self, "%s", st->quirkdata ? "quirks apply, " : "");
if (scsipi_test_unit_ready(periph,
XS_CTL_DISCOVERY | XS_CTL_SILENT | XS_CTL_IGNORE_MEDIA_CHANGE) ||
st->ops(st, ST_OPS_MODESENSE,
XS_CTL_DISCOVERY | XS_CTL_SILENT | XS_CTL_IGNORE_MEDIA_CHANGE))
printf("drive empty\n");
aprint_normal("drive empty\n");
else {
printf("density code %d, ", st->media_density);
aprint_normal("density code %d, ", st->media_density);
if (st->media_blksize > 0)
printf("%d-byte", st->media_blksize);
aprint_normal("%d-byte", st->media_blksize);
else
printf("variable");
printf(" blocks, write-%s\n",
aprint_normal("variable");
aprint_normal(" blocks, write-%s\n",
(st->flags & ST_READONLY) ? "protected" : "enabled");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: st_atapi.c,v 1.30 2015/08/24 23:13:15 pooka Exp $ */
/* $NetBSD: st_atapi.c,v 1.31 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (c) 2001 Manuel Bouyer.
@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: st_atapi.c,v 1.30 2015/08/24 23:13:15 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: st_atapi.c,v 1.31 2016/07/14 04:00:46 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_scsi.h"
@ -94,7 +94,8 @@ st_atapibus_attach(device_t parent, device_t self, void *aux)
sizeof(identify), XS_CTL_DISCOVERY,
ST_RETRIES, ST_CTL_TIME);
if (error) {
printf("onstream get identify: error %d\n", error);
aprint_error_dev(self,
"onstream get identify: error %d\n", error);
return;
}
strncpy(identify.ident, "NBSD", 4);
@ -102,7 +103,8 @@ st_atapibus_attach(device_t parent, device_t self, void *aux)
&identify.header, sizeof(identify),
XS_CTL_DISCOVERY, ST_RETRIES, ST_CTL_TIME);
if (error) {
printf("onstream set identify: error %d\n", error);
aprint_error_dev(self,
"onstream set identify: error %d\n", error);
return;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uk.c,v 1.62 2014/07/25 08:10:39 dholland Exp $ */
/* $NetBSD: uk.c,v 1.63 2016/07/14 04:00:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uk.c,v 1.62 2014/07/25 08:10:39 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: uk.c,v 1.63 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -114,7 +114,8 @@ ukattach(device_t parent, device_t self, void *aux)
uk->sc_periph = periph;
periph->periph_dev = uk->sc_dev;
printf("\n");
aprint_naive("\n");
aprint_normal("\n");
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbt.c,v 1.4 2014/05/20 18:25:54 rmind Exp $ */
/* $NetBSD: sbt.c,v 1.5 2016/07/14 04:00:46 msaitoh Exp $ */
/* $OpenBSD: sbt.c,v 1.9 2007/06/19 07:59:57 uwe Exp $ */
/*
@ -20,7 +20,7 @@
/* Driver for Type-A/B SDIO Bluetooth cards */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbt.c,v 1.4 2014/05/20 18:25:54 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbt.c,v 1.5 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -175,7 +175,7 @@ sbt_attach(device_t parent, device_t self, void *aux)
(void)sdmmc_io_function_disable(sc->sc_sf);
if (sdmmc_io_function_enable(sc->sc_sf)) {
printf("%s: function not ready\n", DEVNAME(sc));
aprint_error("%s: function not ready\n", DEVNAME(sc));
return;
}
@ -184,7 +184,7 @@ sbt_attach(device_t parent, device_t self, void *aux)
sc->sc_buf = malloc(SBT_PKT_BUFSIZ, M_DEVBUF, M_NOWAIT | M_CANFAIL);
if (sc->sc_buf == NULL) {
printf("%s: can't allocate cmd buffer\n", DEVNAME(sc));
aprint_error("%s: can't allocate cmd buffer\n", DEVNAME(sc));
return;
}
@ -194,7 +194,7 @@ sbt_attach(device_t parent, device_t self, void *aux)
/* Enable the card interrupt for this function. */
sc->sc_ih = sdmmc_intr_establish(parent, sbt_intr, sc, DEVNAME(sc));
if (sc->sc_ih == NULL) {
printf("%s: can't establish interrupt\n", DEVNAME(sc));
aprint_error("%s: can't establish interrupt\n", DEVNAME(sc));
return;
}
sdmmc_intr_enable(sc->sc_sf);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_urndis.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $ */
/* $NetBSD: if_urndis.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $ */
/* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */
/*
@ -21,7 +21,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -99,7 +99,8 @@ static uint32_t urndis_ctrl_halt(struct urndis_softc *);
#endif
static uint32_t urndis_ctrl_query(struct urndis_softc *, uint32_t, void *,
size_t, void **, size_t *);
static uint32_t urndis_ctrl_set(struct urndis_softc *, uint32_t, void *, size_t);
static uint32_t urndis_ctrl_set(struct urndis_softc *, uint32_t, void *,
size_t);
#if 0
static uint32_t urndis_ctrl_set_param(struct urndis_softc *, const char *,
uint32_t, void *, size_t);
@ -108,7 +109,8 @@ static uint32_t urndis_ctrl_keepalive(struct urndis_softc *);
#endif
static int urndis_encap(struct urndis_softc *, struct mbuf *, int);
static void urndis_decap(struct urndis_softc *, struct urndis_chain *, uint32_t);
static void urndis_decap(struct urndis_softc *, struct urndis_chain *,
uint32_t);
static int urndis_match(device_t, cfdata_t, void *);
static void urndis_attach(device_t, device_t, void *);
@ -1385,7 +1387,7 @@ urndis_attach(device_t parent, device_t self, void *aux)
}
if (sc->sc_iface_data == NULL) {
printf("%s: no data interface\n", DEVNAME(sc));
aprint_error("%s: no data interface\n", DEVNAME(sc));
return;
}
@ -1395,8 +1397,8 @@ urndis_attach(device_t parent, device_t self, void *aux)
for (j = 0; j < altcnt; j++) {
if (usbd_set_interface(sc->sc_iface_data, j)) {
printf("%s: interface alternate setting %u failed\n",
DEVNAME(sc), j);
aprint_error("%s: interface alternate setting %u "
"failed\n", DEVNAME(sc), j);
return;
}
/* Find endpoints. */
@ -1406,8 +1408,8 @@ urndis_attach(device_t parent, device_t self, void *aux)
ed = usbd_interface2endpoint_descriptor(
sc->sc_iface_data, i);
if (!ed) {
printf("%s: no descriptor for bulk endpoint "
"%u\n", DEVNAME(sc), i);
aprint_error("%s: no descriptor for bulk "
"endpoint %u\n", DEVNAME(sc), i);
return;
}
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
@ -1431,9 +1433,9 @@ urndis_attach(device_t parent, device_t self, void *aux)
}
if (sc->sc_bulkin_no == -1)
printf("%s: could not find data bulk in\n", DEVNAME(sc));
aprint_error("%s: could not find data bulk in\n", DEVNAME(sc));
if (sc->sc_bulkout_no == -1 )
printf("%s: could not find data bulk out\n", DEVNAME(sc));
aprint_error("%s: could not find data bulk out\n",DEVNAME(sc));
return;
found:
@ -1458,7 +1460,8 @@ urndis_attach(device_t parent, device_t self, void *aux)
if (urndis_ctrl_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0,
&buf, &bufsz) != RNDIS_STATUS_SUCCESS) {
printf("%s: unable to get hardware address\n", DEVNAME(sc));
aprint_error("%s: unable to get hardware address\n",
DEVNAME(sc));
urndis_stop(ifp);
splx(s);
return;
@ -1466,10 +1469,11 @@ urndis_attach(device_t parent, device_t self, void *aux)
if (bufsz == ETHER_ADDR_LEN) {
memcpy(eaddr, buf, ETHER_ADDR_LEN);
printf("%s: address %s\n", DEVNAME(sc), ether_sprintf(eaddr));
aprint_normal("%s: address %s\n", DEVNAME(sc),
ether_sprintf(eaddr));
kmem_free(buf, bufsz);
} else {
printf("%s: invalid address\n", DEVNAME(sc));
aprint_error("%s: invalid address\n", DEVNAME(sc));
kmem_free(buf, bufsz);
urndis_stop(ifp);
splx(s);
@ -1482,7 +1486,7 @@ urndis_attach(device_t parent, device_t self, void *aux)
filter = htole32(sc->sc_filter);
if (urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, &filter,
sizeof(filter)) != RNDIS_STATUS_SUCCESS) {
printf("%s: unable to set data filters\n", DEVNAME(sc));
aprint_error("%s: unable to set data filters\n", DEVNAME(sc));
urndis_stop(ifp);
splx(s);
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_urtw.c,v 1.10 2016/06/10 13:27:15 ozaki-r Exp $ */
/* $NetBSD: if_urtw.c,v 1.11 2016/07/14 04:00:46 msaitoh Exp $ */
/* $OpenBSD: if_urtw.c,v 1.39 2011/07/03 15:47:17 matthew Exp $ */
/*-
@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.10 2016/06/10 13:27:15 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.11 2016/07/14 04:00:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@ -611,7 +611,8 @@ urtw_attach(device_t parent, device_t self, void *aux)
sc->sc_udev = uaa->uaa_device;
sc->sc_hwrev = urtw_lookup(uaa->uaa_vendor, uaa->uaa_product)->rev;
printf(": ");
aprint_naive("\n");
aprint_normal(": ");
if (sc->sc_hwrev & URTW_HWREV_8187) {
urtw_read32_m(sc, URTW_TX_CONF, &data);
@ -619,7 +620,7 @@ urtw_attach(device_t parent, device_t self, void *aux)
switch (data) {
case URTW_TX_HWREV_8187_D:
sc->sc_hwrev |= URTW_HWREV_8187_D;
printf("RTL8187 rev D");
aprint_normal("RTL8187 rev D");
break;
case URTW_TX_HWREV_8187B_D:
/*
@ -627,11 +628,11 @@ urtw_attach(device_t parent, device_t self, void *aux)
* USB IDs of RTL8187.
*/
sc->sc_hwrev = URTW_HWREV_8187B | URTW_HWREV_8187B_B;
printf("RTL8187B rev B (early)");
aprint_normal("RTL8187B rev B (early)");
break;
default:
sc->sc_hwrev |= URTW_HWREV_8187_B;
printf("RTL8187 rev 0x%02x", data >> 25);
aprint_normal("RTL8187 rev 0x%02x", data >> 25);
break;
}
} else {
@ -640,19 +641,19 @@ urtw_attach(device_t parent, device_t self, void *aux)
switch (data8) {
case URTW_8187B_HWREV_8187B_B:
sc->sc_hwrev |= URTW_HWREV_8187B_B;
printf("RTL8187B rev B");
aprint_normal("RTL8187B rev B");
break;
case URTW_8187B_HWREV_8187B_D:
sc->sc_hwrev |= URTW_HWREV_8187B_D;
printf("RTL8187B rev D");
aprint_normal("RTL8187B rev D");
break;
case URTW_8187B_HWREV_8187B_E:
sc->sc_hwrev |= URTW_HWREV_8187B_E;
printf("RTL8187B rev E");
aprint_normal("RTL8187B rev E");
break;
default:
sc->sc_hwrev |= URTW_HWREV_8187B_B;
printf("RTL8187B rev 0x%02x", data8);
aprint_normal("RTL8187B rev 0x%02x", data8);
break;
}
}
@ -748,13 +749,13 @@ urtw_attach(device_t parent, device_t self, void *aux)
sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
sc->sc_txtap.wt_ihdr.it_present = htole32(URTW_TX_RADIOTAP_PRESENT);
printf(", address %s\n", ether_sprintf(ic->ic_myaddr));
aprint_normal(", address %s\n", ether_sprintf(ic->ic_myaddr));
ieee80211_announce(ic);
return;
fail:
printf(": %s failed!\n", __func__);
aprint_error(": %s failed!\n", __func__);
sc->sc_dying = true;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lua.c,v 1.17 2016/05/21 12:39:32 salazar Exp $ */
/* $NetBSD: lua.c,v 1.18 2016/07/14 04:00:46 msaitoh Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto@NetBSD.org>.
@ -152,7 +152,7 @@ lua_attach(device_t parent, device_t self, void *aux)
CTL_KERN, CTL_CREATE, CTL_EOL);
if (node == NULL) {
printf(": can't create sysctl node\n");
aprint_error(": can't create sysctl node\n");
return;
}