Use device_unit().

This commit is contained in:
thorpej 2006-03-28 17:38:24 +00:00
parent d717ea85c2
commit 39cd836ee1
153 changed files with 653 additions and 611 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.9 2005/12/11 12:17:05 christos Exp $ */
/* $NetBSD: zs.c,v 1.10 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.9 2005/12/11 12:17:05 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.10 2006/03/28 17:38:24 thorpej Exp $");
#include "opt_ddb.h"
@ -116,7 +116,7 @@ zs_config(zsc, base)
struct zs_chanstate *cs;
int zsc_unit, channel, s;
zsc_unit = zsc->zsc_dev.dv_unit;
zsc_unit = device_unit(&zsc->zsc_dev);
printf(": Zilog 8530 SCC\n");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: mlcd.c,v 1.6 2005/12/24 20:06:59 perry Exp $ */
/* $NetBSD: mlcd.c,v 1.7 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mlcd.c,v 1.6 2005/12/24 20:06:59 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: mlcd.c,v 1.7 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -313,8 +313,8 @@ mlcddetach(struct device *self, int flags)
/*
* revoke vnodes
*/
minor_l = MLCD_MINOR(self->dv_unit, 0);
minor_h = MLCD_MINOR(self->dv_unit, sc->sc_npt - 1);
minor_l = MLCD_MINOR(device_unit(self), 0);
minor_h = MLCD_MINOR(device_unit(self), sc->sc_npt - 1);
vdevgone(cdevsw_lookup_major(&mlcd_cdevsw), minor_l, minor_h, VCHR);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: mmemcard.c,v 1.7 2005/12/11 12:17:06 christos Exp $ */
/* $NetBSD: mmemcard.c,v 1.8 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mmemcard.c,v 1.7 2005/12/11 12:17:06 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mmemcard.c,v 1.8 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -338,8 +338,8 @@ mmemdetach(struct device *self, int flags)
#ifdef __HAVE_OLD_DISKLABEL
#error This code assumes DISKUNIT() is contiguous in minor number.
#endif
minor_l = MMEM_DISKMINOR(self->dv_unit, 0, 0);
minor_h = MMEM_DISKMINOR(self->dv_unit, sc->sc_npt - 1,
minor_l = MMEM_DISKMINOR(device_unit(self), 0, 0);
minor_h = MMEM_DISKMINOR(device_unit(self), sc->sc_npt - 1,
MAXPARTITIONS - 1);
vdevgone(bdevsw_lookup_major(&mmem_bdevsw), minor_l, minor_h, VBLK);
vdevgone(cdevsw_lookup_major(&mmem_cdevsw), minor_l, minor_h, VCHR);

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom.c,v 1.14 2006/02/20 16:50:36 thorpej Exp $ */
/* $NetBSD: plcom.c,v 1.15 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 2001 ARM Ltd
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.14 2006/02/20 16:50:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.15 2006/03/28 17:38:24 thorpej Exp $");
#include "opt_plcom.h"
#include "opt_ddb.h"
@ -364,7 +364,9 @@ plcom_enable_debugport(struct plcom_softc *sc)
sc->sc_cr = CR_RIE | CR_RTIE | CR_UARTEN;
bus_space_write_1(sc->sc_iot, sc->sc_ioh, plcom_cr, sc->sc_cr);
SET(sc->sc_mcr, MCR_DTR | MCR_RTS);
sc->sc_set_mcr(sc->sc_set_mcr_arg, sc->sc_dev.dv_unit, sc->sc_mcr);
/* XXX device_unit() abuse */
sc->sc_set_mcr(sc->sc_set_mcr_arg, device_unit(&sc->sc_dev),
sc->sc_mcr);
PLCOM_UNLOCK(sc);
splx(s);
}
@ -437,7 +439,7 @@ plcom_attach_subr(struct plcom_softc *sc)
/* locate the major number */
maj = cdevsw_lookup_major(&plcom_cdevsw);
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
printf("%s: console\n", sc->sc_dev.dv_xname);
}
@ -500,7 +502,7 @@ plcom_detach(self, flags)
maj = cdevsw_lookup_major(&plcom_cdevsw);
/* Nuke the vnodes for any open instances. */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
mn |= PLCOMDIALOUT_MASK;
@ -1371,7 +1373,8 @@ plcom_loadchannelregs(struct plcom_softc *sc)
bus_space_write_1(iot, ioh, plcom_dlbl, sc->sc_dlbl);
bus_space_write_1(iot, ioh, plcom_dlbh, sc->sc_dlbh);
bus_space_write_1(iot, ioh, plcom_lcr, sc->sc_lcr);
sc->sc_set_mcr(sc->sc_set_mcr_arg, sc->sc_dev.dv_unit,
/* XXX device_unit() abuse */
sc->sc_set_mcr(sc->sc_set_mcr_arg, device_unit(&sc->sc_dev),
sc->sc_mcr_active = sc->sc_mcr);
bus_space_write_1(iot, ioh, plcom_cr, sc->sc_cr);
@ -1429,7 +1432,8 @@ plcom_hwiflow(struct plcom_softc *sc)
SET(sc->sc_mcr, sc->sc_mcr_rts);
SET(sc->sc_mcr_active, sc->sc_mcr_rts);
}
sc->sc_set_mcr(sc->sc_set_mcr_arg, sc->sc_dev.dv_unit,
/* XXX device_unit() abuse */
sc->sc_set_mcr(sc->sc_set_mcr_arg, device_unit(&sc->sc_dev),
sc->sc_mcr_active);
}
@ -2131,7 +2135,8 @@ plcominit(bus_space_tag_t iot, bus_addr_t iobase, int rate, int frequency,
#if 0
/* Ought to do something like this, but we have no sc to
dereference. */
sc->sc_set_mcr(sc->sc_set_mcr_arg, sc->sc_dev.dv_unit,
/* XXX device_unit() abuse */
sc->sc_set_mcr(sc->sc_set_mcr_arg, device_unit(&sc->sc_dev),
MCR_DTR | MCR_RTS);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom_ifpga.c,v 1.9 2005/12/11 12:17:09 christos Exp $ */
/* $NetBSD: plcom_ifpga.c,v 1.10 2006/03/28 17:38:24 thorpej Exp $ */
/*
* Copyright (c) 2001 ARM Ltd
@ -32,7 +32,7 @@
/* Interface to plcom (PL010) serial driver. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom_ifpga.c,v 1.9 2005/12/11 12:17:09 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom_ifpga.c,v 1.10 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/types.h>
#include <sys/device.h>
@ -75,7 +75,7 @@ plcom_ifpga_attach(struct device *parent, struct device *self, void *aux)
isc->sc_iot = ifa->ifa_iot;
isc->sc_ioh = ifa->ifa_sc_ioh;
sc->sc_iounit = sc->sc_dev.dv_unit;
sc->sc_iounit = device_unit(&sc->sc_dev);
sc->sc_frequency = IFPGA_UART_CLK;
sc->sc_iot = ifa->ifa_iot;
sc->sc_hwflags = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: obsled.c,v 1.5 2006/02/26 05:24:52 thorpej Exp $ */
/* $NetBSD: obsled.c,v 1.6 2006/03/28 17:38:24 thorpej Exp $ */
/*
* Copyright (c) 2004 Shigeyuki Fukushima.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: obsled.c,v 1.5 2006/02/26 05:24:52 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: obsled.c,v 1.6 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -83,10 +83,10 @@ obsled_attach(struct device *parent, struct device *self, void *aux)
struct sysctlnode *node;
int err, node_mib;
char led_name[5];
/* int led = (1 << sc->sc_dev.dv_unit); */
/* int led = (1 << device_unit(&sc->sc_dev)); */
snprintf(led_name, sizeof(led_name),
"led%d", (1 << sc->sc_dev.dv_unit) & 0x7);
"led%d", (1 << device_unit(&sc->sc_dev)) & 0x7);
aprint_naive(": OpenBlockS %s\n", led_name);
aprint_normal(": OpenBlockS %s\n", led_name);
@ -189,7 +189,7 @@ obs266_led_set(int led)
if (device_is_a(dp, "obsles")) {
struct obsled_softc *sc = (struct obsled_softc *)dp;
sc->sc_led_state =
(led & (1 << dp->dv_unit)) >> dp->dv_unit;
(led & (1 << device_unit(dp))) >> device_unit(dp);
obsled_set_state(sc);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs_sbdio.c,v 1.1 2005/12/29 15:20:09 tsutsui Exp $ */
/* $NetBSD: zs_sbdio.c,v 1.2 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 1996, 2005 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs_sbdio.c,v 1.1 2005/12/29 15:20:09 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs_sbdio.c,v 1.2 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -121,7 +121,7 @@ zs_sbdio_attach(struct device *parent, struct device *self, void *aux)
printf(" at %p irq %d\n", (void *)sa->sa_addr1, sa->sa_irq);
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
zs_addr = (void *)MIPS_PHYS_TO_KSEG1(sa->sa_addr1);
zsc->zsc_flags = sa->sa_flags;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ct.c,v 1.45 2006/02/23 05:37:47 thorpej Exp $ */
/* $NetBSD: ct.c,v 1.46 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.45 2006/02/23 05:37:47 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.46 2006/03/28 17:38:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -275,9 +275,10 @@ ctident(struct device *parent, struct ct_softc *sc,
cmd[0] = C_SUNIT(0);
cmd[1] = C_SVOL(0);
cmd[2] = C_DESC;
hpibsend(parent->dv_unit, ha->ha_slave, C_CMD, cmd, sizeof(cmd));
hpibrecv(parent->dv_unit, ha->ha_slave, C_EXEC, &desc, 37);
hpibrecv(parent->dv_unit, ha->ha_slave, C_QSTAT, &stat, sizeof(stat));
hpibsend(device_unit(parent), ha->ha_slave, C_CMD, cmd, sizeof(cmd));
hpibrecv(device_unit(parent), ha->ha_slave, C_EXEC, &desc, 37);
hpibrecv(device_unit(parent), ha->ha_slave, C_QSTAT, &stat,
sizeof(stat));
memset(name, 0, sizeof(name));
if (stat == 0) {
@ -322,7 +323,7 @@ ctreset(struct ct_softc *sc)
int ctlr, slave;
u_char stat;
ctlr = device_parent(&sc->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&sc->sc_dev));
slave = sc->sc_slave;
sc->sc_clear.unit = C_SUNIT(sc->sc_punit);
@ -374,7 +375,7 @@ ctopen(dev_t dev, int flag, int type, struct lwp *l)
if (sc->sc_flags & CTF_OPEN)
return (EBUSY);
ctlr = device_parent(&sc->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&sc->sc_dev));
slave = sc->sc_slave;
sc->sc_soptc.unit = C_SUNIT(sc->sc_punit);
@ -524,7 +525,7 @@ ctstart(void *arg)
struct buf *bp;
int i, ctlr, slave;
ctlr = device_parent(&sc->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&sc->sc_dev));
slave = sc->sc_slave;
bp = BUFQ_PEEK(sc->sc_tab);
@ -639,7 +640,7 @@ ctgo(void *arg)
bp = BUFQ_PEEK(sc->sc_tab);
rw = bp->b_flags & B_READ;
hpibgo(device_parent(&sc->sc_dev)->dv_unit, sc->sc_slave, C_EXEC,
hpibgo(device_unit(device_parent(&sc->sc_dev)), sc->sc_slave, C_EXEC,
sc->sc_addr, sc->sc_resid, rw, rw != 0);
}
@ -726,9 +727,9 @@ ctintr(void *arg)
u_char stat;
int ctlr, slave, unit;
ctlr = device_parent(&sc->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&sc->sc_dev));
slave = sc->sc_slave;
unit = sc->sc_dev.dv_unit;
unit = device_unit(&sc->sc_dev);
bp = BUFQ_PEEK(sc->sc_tab);
if (bp == NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: dcm.c,v 1.68 2005/12/11 12:17:13 christos Exp $ */
/* $NetBSD: dcm.c,v 1.69 2006/03/28 17:38:24 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -123,7 +123,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.68 2005/12/11 12:17:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.69 2006/03/28 17:38:24 thorpej Exp $");
#include "opt_kgdb.h"
@ -397,7 +397,7 @@ dcmattach(struct device *parent, struct device *self, void *aux)
struct dcm_softc *sc = (struct dcm_softc *)self;
struct dio_attach_args *da = aux;
struct dcmdevice *dcm;
int brd = self->dv_unit;
int brd = device_unit(self);
int scode = da->da_scode;
int i, mbits, code;
@ -720,7 +720,7 @@ dcmintr(void *arg)
struct dcm_softc *sc = arg;
struct dcmdevice *dcm = sc->sc_dcm;
struct dcmischeme *dis = &sc->sc_scheme;
int brd = sc->sc_dev.dv_unit;
int brd = device_unit(&sc->sc_dev);
int code, i;
int pcnd[4], mcode, mcnd[4];

View File

@ -1,4 +1,4 @@
/* $NetBSD: fhpib.c,v 1.31 2006/02/23 05:37:47 thorpej Exp $ */
/* $NetBSD: fhpib.c,v 1.32 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fhpib.c,v 1.31 2006/02/23 05:37:47 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: fhpib.c,v 1.32 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -495,7 +495,8 @@ fhpibdone(struct hpibbus_softc *hs)
hs->sc_addr += cnt;
hs->sc_count -= cnt;
#ifdef DEBUG
if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == sc->sc_dev.dv_unit)
if ((fhpibdebug & FDB_DMA) &&
fhpibdebugunit == device_unit(&sc->sc_dev))
printf("fhpibdone: addr %p cnt %d\n",
hs->sc_addr, hs->sc_count);
#endif
@ -552,7 +553,8 @@ fhpibintr(void *arg)
return(0);
}
#ifdef DEBUG
if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == sc->sc_dev.dv_unit)
if ((fhpibdebug & FDB_DMA) &&
fhpibdebugunit == device_unit(&sc->sc_dev))
printf("fhpibintr: flags %x\n", hs->sc_flags);
#endif
hq = hs->sc_queue.tqh_first;
@ -581,7 +583,7 @@ fhpibintr(void *arg)
#ifdef DEBUG
stat0 = fhpibppoll(hs);
if ((fhpibdebug & FDB_PPOLL) &&
fhpibdebugunit == sc->sc_dev.dv_unit)
fhpibdebugunit == device_unit(&sc->sc_dev))
printf("fhpibintr: got PPOLL status %x\n", stat0);
if ((stat0 & (0x80 >> hq->hq_slave)) == 0) {
/*
@ -592,9 +594,10 @@ fhpibintr(void *arg)
stat0 = fhpibppoll(hs);
if ((stat0 & (0x80 >> hq->hq_slave)) == 0 &&
(fhpibdebug & FDB_PPOLL) &&
fhpibdebugunit == sc->sc_dev.dv_unit)
fhpibdebugunit == device_unit(&sc->sc_dev))
printf("fhpibintr: PPOLL: unit %d slave %d stat %x\n",
sc->sc_dev.dv_unit, hq->hq_slave, stat0);
device_unit(&sc->sc_dev), hq->hq_slave,
stat0);
}
#endif
hs->sc_flags &= ~HPIBF_PPOLL;
@ -668,7 +671,8 @@ fhpibppwatch(void *arg)
callout_reset(&sc->sc_ppwatch_ch, 1, fhpibppwatch, sc);
return;
}
if ((fhpibdebug & FDB_PPOLL) && sc->sc_dev.dv_unit == fhpibdebugunit)
if ((fhpibdebug & FDB_PPOLL) &&
device_unit(&sc->sc_dev) == fhpibdebugunit)
printf("fhpibppwatch: sense request on %s\n",
sc->sc_dev.dv_xname);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpib.c,v 1.32 2006/03/19 06:13:43 tsutsui Exp $ */
/* $NetBSD: hpib.c,v 1.33 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.32 2006/03/19 06:13:43 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.33 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -163,7 +163,7 @@ hpibbusattach(struct device *parent, struct device *self, void *aux)
sc->sc_ba = ha->ha_ba;
*(ha->ha_softcpp) = sc; /* XXX */
hpibreset(self->dv_unit); /* XXX souldn't be here */
hpibreset(device_unit(self)); /* XXX souldn't be here */
/*
* Initialize the DMA queue entry.
@ -196,7 +196,7 @@ hpibbus_attach_children(struct hpibbus_softc *sc)
* Plotters won't identify themselves, and
* get the same value as non-existent devices.
*/
ha.ha_id = hpibid(sc->sc_dev.dv_unit, slave);
ha.ha_id = hpibid(device_unit(&sc->sc_dev), slave);
ha.ha_slave = slave; /* not to be modified by children */
ha.ha_punit = 0; /* children modify this */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.71 2006/03/19 06:47:35 tsutsui Exp $ */
/* $NetBSD: ite.c,v 1.72 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -119,7 +119,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.71 2006/03/19 06:47:35 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.72 2006/03/28 17:38:25 thorpej Exp $");
#include "hil.h"
@ -260,7 +260,7 @@ iteattach(struct device *parent, struct device *self, void *aux)
* the console probe, so we have to fixup cn_dev here.
*/
cn_tab->cn_dev = makedev(cdevsw_lookup_major(&ite_cdevsw),
self->dv_unit);
device_unit(self));
} else {
ite->sc_data = malloc(sizeof(struct ite_data), M_DEVBUF,
M_NOWAIT | M_ZERO);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mt.c,v 1.33 2006/03/19 06:47:35 tsutsui Exp $ */
/* $NetBSD: mt.c,v 1.34 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.33 2006/03/19 06:47:35 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.34 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -189,8 +189,8 @@ mtattach(struct device *parent, struct device *self, void *aux)
return;
}
unit = self->dv_unit;
hpibno = parent->dv_unit;
unit = device_unit(self);
hpibno = device_unit(parent);
slave = ha->ha_slave;
bufq_alloc(&sc->sc_tab, "fcfs", 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ppi.c,v 1.32 2006/02/23 05:37:47 thorpej Exp $ */
/* $NetBSD: ppi.c,v 1.33 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.32 2006/02/23 05:37:47 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.33 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -246,7 +246,7 @@ ppistart(void *arg)
#ifdef DEBUG
if (ppidebug & PDB_FOLLOW)
printf("ppistart(%x)\n", sc->sc_dev.dv_unit);
printf("ppistart(%x)\n", device_unit(&sc->sc_dev));
#endif
sc->sc_flags &= ~PPIF_DELAY;
wakeup(sc);
@ -259,7 +259,7 @@ ppitimo(void *arg)
#ifdef DEBUG
if (ppidebug & PDB_FOLLOW)
printf("ppitimo(%x)\n", sc->sc_dev.dv_unit);
printf("ppitimo(%x)\n", device_unit(&sc->sc_dev));
#endif
sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO);
wakeup(sc);
@ -301,7 +301,7 @@ ppirw(dev_t dev, struct uio *uio)
if (uio->uio_resid == 0)
return(0);
ctlr = device_parent(&sc->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&sc->sc_dev));
slave = sc->sc_slave;
#ifdef DEBUG

View File

@ -1,4 +1,4 @@
/* $NetBSD: rd.c,v 1.71 2006/02/25 02:28:56 wiz Exp $ */
/* $NetBSD: rd.c,v 1.72 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.71 2006/02/25 02:28:56 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.72 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_useleds.h"
#include "rnd.h"
@ -358,7 +358,7 @@ rdmatch(struct device *parent, struct cfdata *match, void *aux)
* XXX up and probe them again.
*/
delay(10000);
ha->ha_id = hpibid(parent->dv_unit, ha->ha_slave);
ha->ha_id = hpibid(device_unit(parent), ha->ha_slave);
return (rdident(parent, NULL, ha));
}
return (1);
@ -421,7 +421,7 @@ rdident(struct device *parent, struct rd_softc *sc,
char name[7];
int i, id, n, ctlr, slave;
ctlr = parent->dv_unit;
ctlr = device_unit(parent);
slave = ha->ha_slave;
/* Verify that we have a CS80 device. */
@ -528,7 +528,7 @@ rdident(struct device *parent, struct rd_softc *sc,
static void
rdreset(struct rd_softc *rs)
{
int ctlr = device_parent(&rs->sc_dev)->dv_unit;
int ctlr = device_unit(device_parent(&rs->sc_dev));
int slave = rs->sc_slave;
u_char stat;
@ -805,7 +805,7 @@ rdstart(void *arg)
struct buf *bp = BUFQ_PEEK(rs->sc_tab);
int part, ctlr, slave;
ctlr = device_parent(&rs->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&rs->sc_dev));
slave = rs->sc_slave;
again:
@ -883,7 +883,7 @@ rdgo(void *arg)
struct buf *bp = BUFQ_PEEK(rs->sc_tab);
int rw, ctlr, slave;
ctlr = device_parent(&rs->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&rs->sc_dev));
slave = rs->sc_slave;
rw = bp->b_flags & B_READ;
@ -902,12 +902,12 @@ static void
rdintr(void *arg)
{
struct rd_softc *rs = arg;
int unit = rs->sc_dev.dv_unit;
int unit = device_unit(&rs->sc_dev);
struct buf *bp = BUFQ_PEEK(rs->sc_tab);
u_char stat = 13; /* in case hpibrecv fails */
int rv, restart, ctlr, slave;
ctlr = device_parent(&rs->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&rs->sc_dev);
slave = rs->sc_slave;
#ifdef DEBUG
@ -977,7 +977,7 @@ rdstatus(struct rd_softc *rs)
u_char stat;
int rv;
c = device_parent(&rs->sc_dev)->dv_unit;
c = device_unit(device_parent(&rs->sc_dev));
s = rs->sc_slave;
rs->sc_rsc.c_unit = C_SUNIT(rs->sc_punit);
rs->sc_rsc.c_sram = C_SRAM;
@ -1318,7 +1318,7 @@ rddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size)
(rs->sc_flags & RDF_ALIVE) == 0)
return (ENXIO);
ctlr = device_parent(&rs->sc_dev)->dv_unit;
ctlr = device_unit(device_parent(&rs->sc_dev));
slave = rs->sc_slave;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: txcom.c,v 1.28 2006/03/07 23:19:05 he Exp $ */
/* $NetBSD: txcom.c,v 1.29 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.28 2006/03/07 23:19:05 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.29 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_tx39uart_debug.h"
@ -251,7 +251,7 @@ txcom_attach(struct device *parent, struct device *self, void *aux)
/* locate the major number */
maj = cdevsw_lookup_major(&txcom_cdevsw);
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
printf(": console");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahc_isa.c,v 1.29 2006/02/19 14:59:22 thorpej Exp $ */
/* $NetBSD: ahc_isa.c,v 1.30 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Product specific probe and attach routines for:
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.29 2006/02/19 14:59:22 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.30 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -337,7 +337,7 @@ ahc_isa_probe(struct device *parent, struct cfdata *match, void *aux)
*/
for (as = ahc_isa_all_slots.lh_first; as != NULL;
as = as->link.le_next)
if (as->bus == parent->dv_unit)
if (as->bus == device_unit(parent))
goto found_slot_marker;
/*
@ -348,7 +348,7 @@ ahc_isa_probe(struct device *parent, struct cfdata *match, void *aux)
if (as == NULL)
panic("ahc_isa_probe: can't allocate slot marker");
as->bus = parent->dv_unit;
as->bus = device_unit(parent);
as->slot = AHC_ISA_MIN_SLOT;
LIST_INSERT_HEAD(&ahc_isa_all_slots, as, link);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.175 2005/12/24 20:07:11 perry Exp $ */
/* $NetBSD: pccons.c,v 1.176 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.175 2005/12/24 20:07:11 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.176 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_xserver.h"
@ -776,7 +776,7 @@ pcattach(struct device *parent, struct device *self, void *aux)
maj = cdevsw_lookup_major(&pc_cdevsw);
/* There can be only one, but it can have any unit number. */
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
printf("%s: console\n", sc->sc_dev.dv_xname);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: macfb.c,v 1.12 2005/12/11 12:18:02 christos Exp $ */
/* $NetBSD: macfb.c,v 1.13 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright (c) 1998 Matt DeBergalis
* All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: macfb.c,v 1.12 2005/12/11 12:18:02 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: macfb.c,v 1.13 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_wsdisplay_compat.h"
#include "grf.h"
@ -240,7 +240,7 @@ macfb_attach(struct device *parent, struct device *self, void *aux)
config_found(self, &waa, wsemuldisplaydevprint);
#if NGRF > 0
grf_attach(sc, self->dv_unit);
grf_attach(sc, device_unit(self));
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.49 2005/12/11 12:18:02 christos Exp $ */
/* $NetBSD: zs.c,v 1.50 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright (c) 1996-1998 Bill Studenmund
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.49 2005/12/11 12:18:02 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.50 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_mac68k.h"
@ -320,7 +320,7 @@ zsc_attach(struct device *parent, struct device *self, void *aux)
zsc_args.hwflags |= ZS_HWFLAG_NO_CTS;
printf("zsc%d channel %d: d_speed %6d DCD clk %ld CTS clk %ld",
self->dv_unit, channel, cs->cs_defspeed,
device_unit(self), channel, cs->cs_defspeed,
xcs->cs_clocks[1].clk, xcs->cs_clocks[2].clk);
/* Set defaults in our "extended" chanstate. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.64 2005/12/11 12:18:03 christos Exp $ */
/* $NetBSD: autoconf.c,v 1.65 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.64 2005/12/11 12:18:03 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.65 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -179,7 +179,7 @@ extern struct cfdriver scsibus_cd;
if (periph != NULL) {
sc_dev = (struct device *)
periph->periph_dev;
return sc_dev->dv_unit;
return device_unit(sc_dev);
}
}
}
@ -195,7 +195,7 @@ extern struct cfdriver scsibus_cd;
target, lun);
if (periph != NULL) {
sc_dev = (struct device *) periph->periph_dev;
return sc_dev->dv_unit;
return device_unit(sc_dev);
}
}
return -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: aucom.c,v 1.19 2006/03/26 04:31:00 thorpej Exp $ */
/* $NetBSD: aucom.c,v 1.20 2006/03/28 17:38:25 thorpej Exp $ */
/* NetBSD: com.c,v 1.222 2003/11/08 02:54:47 simonb Exp */
/*-
@ -75,7 +75,7 @@
* XXX: hacked to work with almost 16550-alike Alchemy Au1X00 on-chip uarts
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aucom.c,v 1.19 2006/03/26 04:31:00 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: aucom.c,v 1.20 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -723,7 +723,7 @@ com_detach(struct device *self, int flags)
maj = cdevsw_lookup_major(&com_cdevsw);
/* Nuke the vnodes for any open instances. */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
mn |= COMDIALOUT_MASK;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbjcn.c,v 1.10 2005/12/11 12:18:12 christos Exp $ */
/* $NetBSD: sbjcn.c,v 1.11 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright 2000, 2001
@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.10 2005/12/11 12:18:12 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.11 2006/03/28 17:38:25 thorpej Exp $");
#define SBJCN_DEBUG
@ -333,7 +333,8 @@ sbjcn_attach_channel(struct sbjcn_softc *sc, int chan, int intr)
/* locate the major number */
maj = cdevsw_lookup_major(&sbjcn_cdevsw);
cn_tab->cn_dev = makedev(maj, (sc->sc_dev.dv_unit << 1) + chan);
cn_tab->cn_dev = makedev(maj,
(device_unit(&sc->sc_dev) << 1) + chan);
printf("%s: channel %d: console\n", sc->sc_dev.dv_xname, chan);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbscn.c,v 1.15 2005/12/11 12:18:13 christos Exp $ */
/* $NetBSD: sbscn.c,v 1.16 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright 2000, 2001
@ -116,7 +116,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.15 2005/12/11 12:18:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.16 2006/03/28 17:38:25 thorpej Exp $");
#define SBSCN_DEBUG
@ -363,7 +363,8 @@ sbscn_attach_channel(struct sbscn_softc *sc, int chan, int intr)
/* locate the major number */
maj = cdevsw_lookup_major(&sbscn_cdevsw);
cn_tab->cn_dev = makedev(maj, (sc->sc_dev.dv_unit << 1) + chan);
cn_tab->cn_dev = makedev(maj,
(device_unit(&sc->sc_dev) << 1) + chan);
printf("%s: channel %d: console\n", sc->sc_dev.dv_xname, chan);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbsmbus.c,v 1.12 2005/12/11 12:18:13 christos Exp $ */
/* $NetBSD: sbsmbus.c,v 1.13 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbsmbus.c,v 1.12 2005/12/11 12:18:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbsmbus.c,v 1.13 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -91,7 +91,7 @@ smbus_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
for (i = 0; i < smbus_dev_count; i++) {
if (self->dv_unit != smbus_devs[i].sa_interface)
if (device_unit(self) != smbus_devs[i].sa_interface)
continue;
memset(&sa, 0, sizeof sa);

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.16 2006/02/21 04:32:38 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.17 2006/03/28 17:38:25 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.16 2006/02/21 04:32:38 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -162,7 +162,9 @@ findroot(devpp, partp)
struct device *dv;
for (dv = TAILQ_FIRST(&alldevs); dv; dv = TAILQ_NEXT(dv, dv_list)) {
if (device_class(dv) == boot_class && dv->dv_unit == boot_id) {
if (device_class(dv) == boot_class &&
/* XXX device_unit() abuse */
device_unit(dv) == boot_id) {
*devpp = dv;
*partp = boot_part;
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.18 2005/12/11 12:18:13 christos Exp $ */
/* $NetBSD: zs.c,v 1.19 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.18 2005/12/11 12:18:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.19 2006/03/28 17:38:25 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -223,7 +223,7 @@ zs_attach(parent, self, aux)
return;
}
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
printf("\n");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.34 2005/12/11 12:18:17 christos Exp $ */
/* $NetBSD: zs.c,v 1.35 2006/03/28 17:38:25 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.34 2005/12/11 12:18:17 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.35 2006/03/28 17:38:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -143,7 +143,7 @@ zs_config(zsc, zs, vector, pclk)
struct zs_chanstate *cs;
int zsc_unit, channel, s;
zsc_unit = zsc->zsc_dev.dv_unit;
zsc_unit = device_unit(&zsc->zsc_dev);
printf(": Zilog 8530 SCC at vector 0x%x\n", vector);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs_ap.c,v 1.18 2005/12/11 12:18:24 christos Exp $ */
/* $NetBSD: zs_ap.c,v 1.19 2006/03/28 17:38:26 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.18 2005/12/11 12:18:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.19 2006/03/28 17:38:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -221,7 +221,7 @@ zs_ap_attach(struct device *parent, struct device *self, void *aux)
volatile u_int *esccregs = (void *)(apa->apa_hwbase + ESCC_REG);
static int didintr;
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
zsaddr[zs_unit] = (caddr_t)apa->apa_hwbase;
printf(" slot%d addr 0x%lx\n", apa->apa_slotno, apa->apa_hwbase);

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs_hb.c,v 1.19 2005/12/11 12:18:24 christos Exp $ */
/* $NetBSD: zs_hb.c,v 1.20 2006/03/28 17:38:26 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.19 2005/12/11 12:18:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.20 2006/03/28 17:38:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -204,7 +204,7 @@ zs_hb_attach(struct device *parent, struct device *self, void *aux)
int s, zs_unit, channel, intlevel;
static int didintr;
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
intlevel = ha->ha_level;
zsaddr[zs_unit] = (void *)ha->ha_addr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt.c,v 1.42 2005/12/11 12:18:31 christos Exp $ */
/* $NetBSD: lpt.c,v 1.43 2006/03/28 17:38:26 thorpej Exp $ */
/*
* Copyright (c) 1994 Matthias Pfaller.
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.42 2005/12/11 12:18:31 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.43 2006/03/28 17:38:26 thorpej Exp $");
#include "opt_inet.h"
@ -284,7 +284,7 @@ lptattach(parent, self, aux)
callout_init(&sc->sc_out_ch);
#if defined(INET) && defined(PLIP)
plipattach(sc, self->dv_unit);
plipattach(sc, device_unit(self));
#endif
intr_establish(sc->sc_irq, lptintr, sc, sc->sc_dev.dv_xname,
IPL_ZERO, IPL_ZERO, LOW_LEVEL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: scn.c,v 1.68 2005/12/24 20:07:24 perry Exp $ */
/* $NetBSD: scn.c,v 1.69 2006/03/28 17:38:26 thorpej Exp $ */
/*
* Copyright (c) 1991, 1992, 1993
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.68 2005/12/24 20:07:24 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.69 2006/03/28 17:38:26 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -822,7 +822,7 @@ scnattach(parent, self, aux)
boolean_t console, first;
sc = (void *) self;
unit = self->dv_unit;
unit = device_unit(self);
duartno = SCN_ADDR2DUART(ca->ca_addr); /* get chip number */
channel = SCN_ADDR2CHAN(ca->ca_addr); /* get channel on chip */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hp.c,v 1.4 2005/12/11 12:18:34 christos Exp $ */
/* $NetBSD: hp.c,v 1.5 2006/03/28 17:38:26 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -208,7 +208,7 @@ hpattach(struct device *parent, struct device *self, void *aux)
/*
* Read in label.
*/
if ((msg = readdisklabel(makedev(0, self->dv_unit * 8), hpstrategy,
if ((msg = readdisklabel(makedev(0, device_unit(self) * 8), hpstrategy,
dl, NULL)) != NULL)
printf(": %s", msg);
printf(": %s, size = %d sectors\n", dl->d_typename, dl->d_secperunit);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cfb.c,v 1.46 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: cfb.c,v 1.47 2006/03/28 17:38:26 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.46 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.47 2006/03/28 17:38:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -176,7 +176,7 @@ cfbattach(parent, self, aux)
{
struct tc_attach_args *ta = aux;
caddr_t base = (caddr_t)(ta->ta_addr);
int unit = self->dv_unit;
int unit = device_unit(self);
struct fbinfo *fi;
if (cfb_fi)

View File

@ -1,4 +1,4 @@
/* $NetBSD: dc.c,v 1.82 2005/12/13 22:08:58 christos Exp $ */
/* $NetBSD: dc.c,v 1.83 2006/03/28 17:38:26 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.82 2005/12/13 22:08:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.83 2006/03/28 17:38:26 thorpej Exp $");
/*
* devDC7085.c --
@ -293,7 +293,8 @@ dcattach(sc, addr, dtr_mask, rtscts_mask, speed,
* For a remote console, wait a while for previous output to
* complete.
*/
if (sc->sc_dv.dv_unit == 0 && major(cn_tab->cn_dev) == maj &&
/* XXX device_unit() abuse */
if (device_unit(&sc->sc_dv) == 0 && major(cn_tab->cn_dev) == maj &&
cn_tab->cn_pri == CN_REMOTE) {
DELAY(10000);
}
@ -311,7 +312,7 @@ dcattach(sc, addr, dtr_mask, rtscts_mask, speed,
tp = sc->dc_tty[line] = ttymalloc();
if (line != DCKBD_PORT && line != DCMOUSE_PORT)
tty_attach(tp);
tp->t_dev = makedev(maj, 4 * sc->sc_dv.dv_unit + line);
tp->t_dev = makedev(maj, 4 * device_unit(&sc->sc_dv) + line);
pdp->p_arg = (int) tp;
pdp->p_fcn = dcxint;
pdp++;
@ -345,7 +346,8 @@ dcattach(sc, addr, dtr_mask, rtscts_mask, speed,
/*
* Special handling for consoles.
*/
if (sc->sc_dv.dv_unit == 0) {
/* XXX device_unit() abuse */
if (device_unit(&sc->sc_dv) == 0) {
if (major(cn_tab->cn_dev) == maj) {
/* set params for serial console */
dc_tty_init(sc, cn_tab->cn_dev);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfb.c,v 1.53 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: mfb.c,v 1.54 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.53 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.54 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -219,7 +219,7 @@ mfbattach(parent, self, aux)
{
struct tc_attach_args *ta = aux;
caddr_t mfbaddr = (caddr_t)ta->ta_addr;
int unit = self->dv_unit;
int unit = device_unit(self);
struct fbinfo *fi;
if (mfb_fi)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pm.c,v 1.40 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: pm.c,v 1.41 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.40 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.41 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/param.h>
@ -166,7 +166,7 @@ pmattach(parent, self, aux)
if (pm_fi)
fi = pm_fi;
else {
if (fballoc(&fi) < 0 || pminit(fi, base, self->dv_unit) < 0)
if (fballoc(&fi) < 0 || pminit(fi, base, device_unit(self)) < 0)
return; /* failed */
}
((struct fbsoftc *)self)->sc_fi = fi;

View File

@ -1,4 +1,4 @@
/* $NetBSD: px.c,v 1.50 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: px.c,v 1.51 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
#endif
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.50 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.51 2006/03/28 17:38:27 thorpej Exp $");
/*
* px.c: driver for the DEC TURBOchannel 2D and 3D accelerated framebuffers
@ -319,10 +319,11 @@ px_attach(parent, self, aux)
/* Init the card only if it hasn't been done before... */
if (!px_cons_info || slotbase != (caddr_t)px_cons_info->pxi_slotbase)
px_init((struct fbinfo *)1, slotbase, sc->px_dv.dv_unit, 0);
px_init((struct fbinfo *)1, slotbase, device_unit(&sc->px_dv),
0);
/* px_init() fills in px_unit[#] */
pxi = px_unit[sc->px_dv.dv_unit];
pxi = px_unit[device_unit(&sc->px_dv)];
sc->px_info = pxi;
/* Now grab the interrupt */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sfb.c,v 1.43 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: sfb.c,v 1.44 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.43 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.44 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -174,7 +174,7 @@ sfbattach(parent, self, aux)
{
struct tc_attach_args *ta = aux;
caddr_t sfbaddr = (caddr_t)ta->ta_addr;
int unit = self->dv_unit;
int unit = device_unit(self);
struct fbinfo *fi;
if (sfb_fi)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sii.c,v 1.51 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: sii.c,v 1.52 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.51 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.52 2006/03/28 17:38:27 thorpej Exp $");
#include "sii.h"
/*
@ -315,7 +315,8 @@ sii_Reset(sc, reset)
/*
* Set host adapter ID (from PROM sciiidN variable).
*/
regs->id = SII_ID_IO | prom_scsiid(sc->sc_dev.dv_unit);
/* XXX device_unit() abuse */
regs->id = SII_ID_IO | prom_scsiid(device_unit(&sc->sc_dev));
/*
* Enable SII to drive the SCSI bus.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: xcfb.c,v 1.41 2005/12/11 12:18:36 christos Exp $ */
/* $NetBSD: xcfb.c,v 1.42 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.41 2005/12/11 12:18:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.42 2006/03/28 17:38:27 thorpej Exp $");
#include "dtop.h"
#if NDTOP == 0
@ -178,7 +178,7 @@ void *aux;
{
struct tc_attach_args *ta = aux;
caddr_t base = (caddr_t)ta->ta_addr;
int unit = self->dv_unit;
int unit = device_unit(self);
struct fbinfo *fi;
if (xcfb_fi)

View File

@ -1,4 +1,4 @@
/* $NetBSD: scc.c,v 1.90 2006/03/08 23:46:24 lukem Exp $ */
/* $NetBSD: scc.c,v 1.91 2006/03/28 17:38:27 thorpej Exp $ */
/*
* Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.90 2006/03/08 23:46:24 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.91 2006/03/28 17:38:27 thorpej Exp $");
/*
* Intel 82530 dual usart chip driver. Supports the serial port(s) on the
@ -370,7 +370,7 @@ sccattach(parent, self, aux)
#endif
int unit;
unit = sc->sc_dv.dv_unit;
unit = device_unit(&sc->sc_dv);
sccaddr = (void*)MIPS_PHYS_TO_KSEG1(d->iada_addr);
@ -1137,7 +1137,7 @@ sccintr(xxxsc)
void *xxxsc;
{
struct scc_softc *sc = (struct scc_softc *)xxxsc;
int unit = (long)sc->sc_dv.dv_unit;
int unit = device_unit(&sc->sc_dv);
scc_regmap_t *regs;
int rr3;
@ -1372,7 +1372,7 @@ scc_modem_intr(dev)
}
/* Break on serial console drops into the debugger */
if ((value & ZSRR0_BREAK) && CONSOLE_ON_UNIT(sc->sc_dv.dv_unit)) {
if ((value & ZSRR0_BREAK) && CONSOLE_ON_UNIT(device_unit(&sc->sc_dv))) {
#ifdef DDB
splx(s); /* spl0()? */
console_debugger();
@ -1387,7 +1387,7 @@ scc_modem_intr(dev)
* On pmax, ignore hups on a console tty.
* On alpha, a no-op, for historical reasons.
*/
if (!CONSOLE_ON_UNIT(sc->sc_dv.dv_unit)) {
if (!CONSOLE_ON_UNIT(device_unit(&sc->sc_dv))) {
if (car) {
/* carrier present */
if (!(tp->t_state & TS_CARR_ON))

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.12 2006/03/16 17:43:34 garbled Exp $ */
/* $NetBSD: autoconf.c,v 1.13 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12 2006/03/16 17:43:34 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -215,8 +215,8 @@ device_register(struct device *dev, void *aux)
sprintf(devpath, "%s%d", devpath, adev->adev_drv_data->drive);
} else if (device_is_a(dev, "fd")) {
/* XXX dv_unit abuse */
sprintf(devpath, "%s%d", devpath, dev->dv_unit);
/* XXX device_unit() abuse */
sprintf(devpath, "%s%d", devpath, device_unit(dev));
}
len = strlen(devpath) + 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.28 2005/12/11 12:18:52 christos Exp $ */
/* $NetBSD: zs.c,v 1.29 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.28 2005/12/11 12:18:52 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.29 2006/03/28 17:38:27 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -225,7 +225,7 @@ zs_hpc_attach(struct device *parent, struct device *self, void *aux)
return;
}
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
printf("\n");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.27 2006/02/26 05:31:54 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.28 2006/03/28 17:38:27 thorpej Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.27 2006/02/26 05:31:54 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.28 2006/03/28 17:38:27 thorpej Exp $");
#include "opt_ddb.h"
@ -190,7 +190,8 @@ device_register(struct device *dev, void *aux)
*/
if ( (scsiboot && device_is_a(dev, "wdsc")) ||
(scsiboot && device_is_a(dev, "ahc")) ) {
if (dev->dv_unit == booted_slot)
/* XXX device_unit() abuse */
if (device_unit(dev) == booted_slot)
booted_controller = dev;
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp_obio.c,v 1.18 2006/03/08 23:46:24 lukem Exp $ */
/* $NetBSD: esp_obio.c,v 1.19 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp_obio.c,v 1.18 2006/03/08 23:46:24 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp_obio.c,v 1.19 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -143,7 +143,7 @@ espattach_obio(struct device *parent, struct device *self, void *aux)
* Find the DMA by poking around the dma device structures
*/
esc->sc_dma = (struct lsi64854_softc *)
getdevunit("dma", sc->sc_dev.dv_unit);
getdevunit("dma", device_unit(&sc->sc_dev));
/*
* and a back pointer to us, for DMA

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.219 2006/02/28 06:30:35 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.220 2006/03/28 17:38:27 thorpej Exp $ */
/*
* Copyright (c) 1996
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.219 2006/02/28 06:30:35 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.220 2006/03/28 17:38:27 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -1685,7 +1685,7 @@ instance_match(struct device *dev, void *aux, struct bootpath *bp)
break;
}
if (bp->val[0] == -1 && bp->val[1] == dev->dv_unit)
if (bp->val[0] == -1 && bp->val[1] == device_unit(dev))
return (1);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_ebus.c,v 1.24 2006/02/11 17:57:31 cdi Exp $ */
/* $NetBSD: com_ebus.c,v 1.25 2006/03/28 17:38:27 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com_ebus.c,v 1.24 2006/02/11 17:57:31 cdi Exp $");
__KERNEL_RCSID(0, "$NetBSD: com_ebus.c,v 1.25 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -179,7 +179,7 @@ com_ebus_attach(struct device *parent, struct device *self, void *aux)
/* locate the major number */
maj = cdevsw_lookup_major(&com_cdevsw);
kma.kmta_dev = makedev(maj, sc->sc_dev.dv_unit);
kma.kmta_dev = makedev(maj, device_unit(&sc->sc_dev));
/* Attach 'em if we got 'em. */
#if (NKBD > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sab.c,v 1.25 2006/02/13 21:47:12 cdi Exp $ */
/* $NetBSD: sab.c,v 1.26 2006/03/28 17:38:27 thorpej Exp $ */
/* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */
/*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.25 2006/02/13 21:47:12 cdi Exp $");
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.26 2006/03/28 17:38:27 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -435,7 +435,7 @@ sabtty_attach(struct device *parent, struct device *self, void *aux)
cn_tab->cn_pollc = sab_cnpollc;
cn_tab->cn_getc = sab_cngetc;
maj = cdevsw_lookup_major(&sabtty_cdevsw);
cn_tab->cn_dev = makedev(maj, self->dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(self));
shutdownhook_establish(sabtty_shutdown, sc);
cn_init_magic(&sabtty_cnm_state);
cn_set_magic("\047\001"); /* default magic is BREAK */
@ -446,7 +446,7 @@ sabtty_attach(struct device *parent, struct device *self, void *aux)
sabtty_cons_output = sc;
cn_tab->cn_putc = sab_cnputc;
maj = cdevsw_lookup_major(&sabtty_cdevsw);
cn_tab->cn_dev = makedev(maj, self->dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(self));
}
aprint_normal(": console %s", acc);
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.58 2006/02/13 21:47:12 cdi Exp $ */
/* $NetBSD: zs.c,v 1.59 2006/03/28 17:38:27 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.58 2006/02/13 21:47:12 cdi Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.59 2006/03/28 17:38:27 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -206,7 +206,7 @@ zs_attach_sbus(struct device *parent, struct device *self, void *aux)
struct zsc_softc *zsc = (void *) self;
struct sbus_attach_args *sa = aux;
bus_space_handle_t bh;
int zs_unit = zsc->zsc_dev.dv_unit;
int zs_unit = device_unit(&zsc->zsc_dev);
if (sa->sa_nintr == 0) {
printf(" no interrupt lines\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.113 2006/03/03 10:32:01 cube Exp $ */
/* $NetBSD: autoconf.c,v 1.114 2006/03/28 17:38:27 thorpej Exp $ */
/*
* Copyright (c) 1996
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.113 2006/03/03 10:32:01 cube Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.114 2006/03/28 17:38:27 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -1110,7 +1110,7 @@ instance_match(struct device *dev, void *aux, struct bootpath *bp)
break;
}
if (bp->val[0] == -1 && bp->val[1] == dev->dv_unit)
if (bp->val[0] == -1 && bp->val[1] == device_unit(dev))
return (1);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs_any.c,v 1.13 2005/12/11 12:19:16 christos Exp $ */
/* $NetBSD: zs_any.c,v 1.14 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs_any.c,v 1.13 2005/12/11 12:19:16 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs_any.c,v 1.14 2006/03/28 17:38:28 thorpej Exp $");
#include "opt_kgdb.h"
@ -132,7 +132,8 @@ zs_any_attach(struct device *parent, struct device *self, void *aux)
zsc->zsc_bustag = ma->ma_bustag;
zsc->zsc_dmatag = ma->ma_dmatag;
zsc->zsc_promunit = self->dv_unit;
/* XXX device_unit() abuse */
zsc->zsc_promunit = device_unit(self);
zsc->zsc_node = 0;
/* Map in the device. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: bw2.c,v 1.28 2005/12/11 12:19:20 christos Exp $ */
/* $NetBSD: bw2.c,v 1.29 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bw2.c,v 1.28 2005/12/11 12:19:20 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: bw2.c,v 1.29 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -243,7 +243,8 @@ bw2attach(struct device *parent, struct device *self, void *args)
*/
if (fb->fb_pfour)
fb_pfour_setsize(fb);
else if (sc->sc_dev.dv_unit == 0)
/* XXX device_unit() abuse */
else if (device_unit(&sc->sc_dev) == 0)
fb_eeprom_setsize(fb);
else {
/* Guess based on machine ID. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cg4.c,v 1.33 2005/12/11 12:19:20 christos Exp $ */
/* $NetBSD: cg4.c,v 1.34 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cg4.c,v 1.33 2005/12/11 12:19:20 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cg4.c,v 1.34 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -296,7 +296,8 @@ cg4attach(struct device *parent, struct device *self, void *args)
*/
if (fb->fb_pfour)
fb_pfour_setsize(fb);
else if (sc->sc_dev.dv_unit == 0)
/* XXX device_unit() abuse */
else if (device_unit(&sc->sc_dev) == 0)
fb_eeprom_setsize(fb);
else {
/* Guess based on machine ID. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp.c,v 1.22 2006/03/08 23:46:24 lukem Exp $ */
/* $NetBSD: esp.c,v 1.23 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.22 2006/03/08 23:46:24 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.23 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -150,7 +150,7 @@ espattach(struct device *parent, struct device *self, void *aux)
/*
* Hook up the DMA driver.
*/
esc->sc_dma = espdmafind(sc->sc_dev.dv_unit);
esc->sc_dma = espdmafind(device_unit(&sc->sc_dev));
esc->sc_dma->sc_esp = sc; /* Point back to us */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.51 2005/12/11 12:19:20 christos Exp $ */
/* $NetBSD: xd.c,v 1.52 2006/03/28 17:38:28 thorpej Exp $ */
/*
*
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.51 2005/12/11 12:19:20 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.52 2006/03/28 17:38:28 thorpej Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@ -324,7 +324,7 @@ xdgetdisklabel(struct xd_softc *xd, void *b)
/* Required parameter for readdisklabel() */
xd->sc_dk.dk_label->d_secsize = XDFM_BPS;
err = readdisklabel(MAKEDISKDEV(0, xd->sc_dev.dv_unit, RAW_PART),
err = readdisklabel(MAKEDISKDEV(0, device_unit(&xd->sc_dev), RAW_PART),
xddummystrat,
xd->sc_dk.dk_label, xd->sc_dk.dk_cpulabel);
if (err) {
@ -528,7 +528,7 @@ xdmatch(struct device *parent, struct cfdata *cf, void *aux)
int xd_unit;
/* Match only on the "wired-down" controller+disk. */
xd_unit = parent->dv_unit * 2 + xa->driveno;
xd_unit = device_unit(parent) * 2 + xa->driveno;
if (cf->cf_unit != xd_unit)
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.53 2005/12/11 12:19:21 christos Exp $ */
/* $NetBSD: xy.c,v 1.54 2006/03/28 17:38:28 thorpej Exp $ */
/*
*
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.53 2005/12/11 12:19:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.54 2006/03/28 17:38:28 thorpej Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@ -262,7 +262,7 @@ xygetdisklabel(struct xy_softc *xy, void *b)
/* Required parameter for readdisklabel() */
xy->sc_dk.dk_label->d_secsize = XYFM_BPS;
err = readdisklabel(MAKEDISKDEV(0, xy->sc_dev.dv_unit, RAW_PART),
err = readdisklabel(MAKEDISKDEV(0, device_unit(&xy->sc_dev), RAW_PART),
xydummystrat,
xy->sc_dk.dk_label, xy->sc_dk.dk_cpulabel);
if (err) {
@ -472,7 +472,7 @@ xymatch(struct device *parent, struct cfdata *cf, void *aux)
int xy_unit;
/* Match only on the "wired-down" controller+disk. */
xy_unit = parent->dv_unit * 2 + xa->driveno;
xy_unit = device_parent(parent) * 2 + xa->driveno;
if (cf->cf_unit != xy_unit)
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.75 2005/12/11 12:19:21 christos Exp $ */
/* $NetBSD: zs.c,v 1.76 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.75 2005/12/11 12:19:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.76 2006/03/28 17:38:28 thorpej Exp $");
#include "opt_kgdb.h"
@ -266,7 +266,7 @@ zs_attach(struct device *parent, struct device *self, void *aux)
int s, zs_unit, channel;
static int didintr;
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
printf(": (softpri %d)\n", ZSSOFT_PRI);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme.c,v 1.17 2005/12/11 12:19:27 christos Exp $ */
/* $NetBSD: vme.c,v 1.18 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.17 2005/12/11 12:19:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.18 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -96,7 +96,7 @@ vme_attach(struct device *parent, struct device *self, void *args)
{
int unit;
unit = self->dv_unit;
unit = device_unit(self);
printf(": (%s)\n", vme_info[unit].name);
/* We know ca_bustype == BUS_VMExx */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme.c,v 1.11 2005/12/11 12:19:27 christos Exp $ */
/* $NetBSD: vme.c,v 1.12 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.11 2005/12/11 12:19:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.12 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -96,7 +96,7 @@ vme_attach(struct device *parent, struct device *self, void *args)
{
int unit;
unit = self->dv_unit;
unit = device_unit(self);
printf(": (%s)\n", vme_info[unit].name);
/* We know ca_bustype == BUS_VMExx */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_de.c,v 1.43 2006/02/23 05:37:48 thorpej Exp $ */
/* $NetBSD: if_de.c,v 1.44 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.43 2006/02/23 05:37:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.44 2006/03/28 17:38:28 thorpej Exp $");
#include "opt_inet.h"
#include "opt_iso.h"
@ -697,8 +697,8 @@ dewait(ds, fn)
addr->pchigh = csr0 >> 8;
if (csr0 & PCSR0_PCEI) {
char bits[64];
printf("de%d: %s failed, csr0=%s ", ds->ds_dev.dv_unit, fn,
bitmask_snprintf(csr0, PCSR0_BITS, bits, sizeof(bits)));
printf("de%d: %s failed, csr0=%s ", device_unit(&ds->ds_dev),
fn, bitmask_snprintf(csr0, PCSR0_BITS, bits, sizeof(bits)));
printf("csr1=%s\n", bitmask_snprintf(addr->pcsr1, PCSR1_BITS,
bits, sizeof(bits)));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hp.c,v 1.39 2005/12/11 12:19:35 christos Exp $ */
/* $NetBSD: hp.c,v 1.40 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hp.c,v 1.39 2005/12/11 12:19:35 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: hp.c,v 1.40 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -178,7 +178,7 @@ hpattach(struct device *parent, struct device *self, void *aux)
/*
* Read in label.
*/
if ((msg = readdisklabel(makedev(0, self->dv_unit * 8), hpstrategy,
if ((msg = readdisklabel(makedev(0, device_unit(self) * 8), hpstrategy,
dl, NULL)) != NULL)
printf(": %s", msg);
printf(": %s, size = %d sectors\n", dl->d_typename, dl->d_secperunit);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ts.c,v 1.30 2006/02/23 05:37:48 thorpej Exp $ */
/* $NetBSD: ts.c,v 1.31 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.30 2006/02/23 05:37:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.31 2006/03/28 17:38:28 thorpej Exp $");
#define TS11_COMPAT /* don't use extended features provided by TS05 */
@ -251,7 +251,7 @@ tsinit (sc)
struct ts_softc *sc;
{
volatile struct tsdevice *tsregs;
int unit = sc->sc_dev.dv_unit;
int unit = device_unit(&sc->sc_dev);
struct uba_unit *uu;
uu = &sc->sc_unit;
@ -427,7 +427,7 @@ tsstart (sc, bp)
register struct ts_softc *sc;
register struct buf *bp;
{
int ctlr = sc->sc_dev.dv_unit;
int ctlr = device_unit(&sc->sc_dev);
volatile struct tsdevice *tsreg = ts[ctlr].reg;
register struct tscmd *tscmdp = &ts[ctlr].cmd;
register struct buf *dp;
@ -486,7 +486,8 @@ tsstart (sc, bp)
printf ("unsupported cpu %d in tsstart.\n", vax_cputype);
} /* end switch (vax_cputype) */
if ((i = ubasetup(device_parent(&sc->sc_dev)->dv_unit, bp, i)) == 0) {
if ((i = ubasetup(device_unit(device_parent(&sc->sc_dev)),
bp, i)) == 0) {
/*
* For some reasons which I don't (yet? :) understand,
* tmscp.c initiates in this situation a GET-UNIT
@ -714,7 +715,7 @@ tsmatch(parent, match, aux)
struct uba_attach_args *ua = aux;
struct tsdevice *tsregs = (struct tsdevice*)ua->ua_addr;
volatile unsigned int sr, timeout, count;
int ctlr = sc->sc_dev.dv_unit;
int ctlr = device_unit(&sc->sc_dev);
ts_wtab[ctlr] = NULL;
sc->sc_ts = &ts[ctlr];
@ -779,7 +780,7 @@ tsattach(parent, self, aux)
void *aux;
{
struct ts_softc *sc = (void *)self;
int ctlr = sc->sc_dev.dv_unit;
int ctlr = device_unit(&sc->sc_dev);
struct tsmsg *tsmsgp = &ts[ctlr].msg;
trace (("tsslave (%x, %x)\n", ui, reg));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka750.c,v 1.38 2005/12/11 12:19:36 christos Exp $ */
/* $NetBSD: ka750.c,v 1.39 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
* All rights reserved.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka750.c,v 1.38 2005/12/11 12:19:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka750.c,v 1.39 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -175,7 +175,7 @@ ka750_memenable(struct device *parent, struct device *self, void *aux)
struct mcr750 *mcr = (struct mcr750 *)sa->sa_ioh;
int k, l, m, cardinfo;
mcraddr[self->dv_unit] = (caddr_t)sa->sa_ioh;
mcraddr[device_unit(self)] = (caddr_t)sa->sa_ioh;
/* We will use this info for error reporting - later! */
cardinfo = mcr->mc_inf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: multicpu.c,v 1.17 2005/12/11 12:19:36 christos Exp $ */
/* $NetBSD: multicpu.c,v 1.18 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.17 2005/12/11 12:19:36 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.18 2006/03/28 17:38:28 thorpej Exp $");
#include "opt_multiprocessor.h"
@ -152,7 +152,7 @@ slaverun()
((volatile struct cpu_info *)ci)->ci_flags |= CI_RUNNING;
cpu_send_ipi(IPI_DEST_MASTER, IPI_RUNNING);
printf("%s: running\n", ci->ci_dev->dv_xname);
while (sta != ci->ci_dev->dv_unit)
while (sta != device_unit(ci->ci_dev))
;
splsched();
sched_lock_idle();

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdc9224.c,v 1.35 2006/02/23 05:37:48 thorpej Exp $ */
/* $NetBSD: hdc9224.c,v 1.36 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -51,7 +51,7 @@
#undef RDDEBUG
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hdc9224.c,v 1.35 2006/02/23 05:37:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: hdc9224.c,v 1.36 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -366,7 +366,7 @@ rdattach(struct device *parent, struct device *self, void *aux)
rdmakelabel(dl, &rd->sc_xbn);
printf("%s", rd->sc_dev.dv_xname);
msg = readdisklabel(MAKEDISKDEV(cdevsw_lookup_major(&rd_cdevsw),
rd->sc_dev.dv_unit, RAW_PART),
device_unit(&rd->sc_dev), RAW_PART),
rdstrategy, dl, NULL);
if (msg)
printf(": %s", msg);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.68 2006/02/23 05:37:48 thorpej Exp $ */
/* $NetBSD: fd.c,v 1.69 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.68 2006/02/23 05:37:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.69 2006/03/28 17:38:28 thorpej Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -1655,7 +1655,8 @@ fd_mountroot_hook(struct device *dev)
struct fdc_softc *fdc = (void*) device_parent(&fd->sc_dev);
int c;
fd_do_eject(fdc, dev->dv_unit);
/* XXX device_unit() abuse */
fd_do_eject(fdc, device_unit(dev));
printf("Insert filesystem floppy and press return.");
for (;;) {
c = cngetc();

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf.c,v 1.31 2005/12/11 12:19:37 christos Exp $ */
/* $NetBSD: grf.c,v 1.32 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1990, 1993
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.31 2005/12/11 12:19:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.32 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -244,7 +244,7 @@ grfmmap(dev_t dev, off_t off, int prot)
int
grfon(struct grf_softc *gp)
{
int unit = gp->g_device.dv_unit;
int unit = device_unit(&gp->g_device);
/*
* XXX: iteoff call relies on devices being in same order
@ -259,7 +259,7 @@ grfon(struct grf_softc *gp)
int
grfoff(struct grf_softc *gp)
{
int unit = gp->g_device.dv_unit;
int unit = device_unit(&gp->g_device);
int error;
#if 0 /* always fails in EINVAL... */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.43 2005/12/24 20:07:41 perry Exp $ */
/* $NetBSD: ite.c,v 1.44 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.43 2005/12/24 20:07:41 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.44 2006/03/28 17:38:28 thorpej Exp $");
#include "ite.h"
#if NITE > 0
@ -245,7 +245,7 @@ iteattach(struct device *pdp, struct device *dp, void *auxp)
kbd_ite = ip;
}
ip->grf = gp;
iteinit(ip->device.dv_unit); /* XXX */
iteinit(device_unit(&ip->device)); /* XXX */
printf(": rows %d cols %d", ip->rows, ip->cols);
if (kbd_ite == NULL)
kbd_ite = ip;
@ -287,7 +287,7 @@ iteinit(dev_t dev)
ip->cursorx = 0;
ip->cursory = 0;
ip->isw = &itesw[ip->device.dv_unit]; /* XXX */
ip->isw = &itesw[device_unit(&ip->device)]; /* XXX */
SUBR_INIT(ip);
SUBR_CURSOR(ip, DRAW_CURSOR);
if (!ip->tabs)
@ -761,7 +761,7 @@ ite_filter(c)
struct key key;
int s, i;
if (!kbd_ite || !(kbd_tty = ite_tty[kbd_ite->device.dv_unit]))
if (!kbd_ite || !(kbd_tty = ite_tty[device_unit(&kbd_ite->device)]))
return;
/* have to make sure we're at spltty in here */
@ -2131,7 +2131,7 @@ iteputchar(int c, struct ite_softc *ip)
case BEL:
#if NBELL > 0
if (kbd_ite && ite_tty[kbd_ite->device.dv_unit])
if (kbd_ite && ite_tty[device_unit(&kbd_ite->device)])
opm_bell();
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: opm.c,v 1.15 2005/12/24 20:07:41 perry Exp $ */
/* $NetBSD: opm.c,v 1.16 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1995 Masanobu Saitoh, Takuya Harakawa.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: opm.c,v 1.15 2005/12/24 20:07:41 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: opm.c,v 1.16 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -109,7 +109,8 @@ opm_attach(struct device *parent, struct device *self, void *aux)
panic ("Cannot map IO space for OPM.");
#endif
if (sc->sc_dev.dv_unit == 0)
/* XXX device_unit() abuse */
if (device_unit(&sc->sc_dev) == 0)
opm0 = sc; /* XXX */
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: par.c,v 1.24 2005/12/11 12:19:37 christos Exp $ */
/* $NetBSD: par.c,v 1.25 2006/03/28 17:38:28 thorpej Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: par.c,v 1.24 2005/12/11 12:19:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: par.c,v 1.25 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -239,7 +239,7 @@ parstart(void *arg)
struct par_softc *sc = arg;
#ifdef DEBUG
if (pardebug & PDB_FOLLOW)
printf("parstart(%x)\n", sc->sc_dev.dv_unit);
printf("parstart(%x)\n", device_unit(&sc->sc_dev));
#endif
sc->sc_flags &= ~PARF_DELAY;
wakeup(sc);
@ -251,7 +251,7 @@ partimo(void *arg)
struct par_softc *sc = arg;
#ifdef DEBUG
if (pardebug & PDB_FOLLOW)
printf("partimo(%x)\n", sc->sc_dev.dv_unit);
printf("partimo(%x)\n", device_unit(&sc->sc_dev));
#endif
sc->sc_flags &= ~(PARF_UIO|PARF_TIMO);
wakeup(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.28 2005/12/11 12:19:38 christos Exp $ */
/* $NetBSD: zs.c,v 1.29 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1998 Minoura Makoto
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.28 2005/12/11 12:19:38 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.29 2006/03/28 17:38:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -185,7 +185,7 @@ zs_attach(struct device *parent, struct device *self, void *aux)
struct zs_chanstate *cs;
int r, s, zs_unit, channel;
zs_unit = zsc->zsc_dev.dv_unit;
zs_unit = device_unit(&zsc->zsc_dev);
zsc->zsc_addr = (void*) ia->ia_addr;
ia->ia_size = 8;

View File

@ -1,4 +1,4 @@
/* $NetBSD: x86_autoconf.c,v 1.13 2006/02/26 06:17:44 thorpej Exp $ */
/* $NetBSD: x86_autoconf.c,v 1.14 2006/03/28 17:38:28 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -151,8 +151,8 @@ matchbiosdisks(void)
if (bmajor == -1)
return;
if (bdevvp(MAKEDISKDEV(bmajor, dv->dv_unit, RAW_PART),
&tv))
if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv),
RAW_PART), &tv))
panic("matchbiosdisks: can't alloc vnode");
error = VOP_OPEN(tv, FREAD, NOCRED, 0);
@ -234,7 +234,7 @@ match_bootwedge(struct device *dv, struct btinfo_bootwedge *biw)
* Fake a temporary vnode for the disk, open it, and read
* and hash the sectors.
*/
if (bdevvp(MAKEDISKDEV(bmajor, dv->dv_unit, RAW_PART), &tmpvn))
if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv), RAW_PART), &tmpvn))
panic("findroot: can't alloc vnode");
error = VOP_OPEN(tmpvn, FREAD, NOCRED, 0);
if (error) {
@ -307,7 +307,7 @@ match_bootdisk(struct device *dv, struct btinfo_bootdisk *bid)
* Fake a temporary vnode for the disk, open it, and read
* the disklabel for comparison.
*/
if (bdevvp(MAKEDISKDEV(bmajor, dv->dv_unit, RAW_PART), &tmpvn))
if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv), RAW_PART), &tmpvn))
panic("findroot: can't alloc vnode");
error = VOP_OPEN(tmpvn, FREAD, NOCRED, 0);
if (error) {
@ -467,12 +467,10 @@ findroot(void)
* the BIOS device number. (This is the old
* behavior.) Needs some ideas how to handle
* the BIOS's "swap floppy drive" options.
*
* XXXJRT This use of the unit number is
* totally bogus!
*/
/* XXX device_unit() abuse */
if ((bid->biosdev & 0x80) != 0 ||
dv->dv_unit != bid->biosdev)
device_unit(dv) != bid->biosdev)
continue;
goto bootdisk_found;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.14 2006/03/06 22:04:18 bouyer Exp $ */
/* $NetBSD: autoconf.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $ */
/* NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp */
/*-
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2006/03/06 22:04:18 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $");
#include "opt_xen.h"
#include "opt_compat_oldboot.h"
@ -263,8 +263,8 @@ matchbiosdisks(void)
if (bmajor == -1)
return;
if (bdevvp(MAKEDISKDEV(bmajor, dv->dv_unit, RAW_PART),
&tv))
if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv),
RAW_PART), &tv))
panic("matchbiosdisks: can't alloc vnode");
error = VOP_OPEN(tv, FREAD, NOCRED, 0);
@ -348,7 +348,8 @@ match_harddisk(struct device *dv, struct btinfo_bootdisk *bid)
* Fake a temporary vnode for the disk, open
* it, and read the disklabel for comparison.
*/
if (bdevvp(MAKEDISKDEV(bmajor, dv->dv_unit, bid->partition), &tmpvn))
if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv), bid->partition),
&tmpvn))
panic("findroot can't alloc vnode");
error = VOP_OPEN(tmpvn, FREAD, NOCRED, 0);
if (error) {
@ -438,8 +439,9 @@ findroot(void)
* behaviour.) Needs some ideas how to handle
* BIOS's "swap floppy drive" options.
*/
/* XXX device_unit() abuse */
if ((bid->biosdev & 0x80) ||
dv->dv_unit != bid->biosdev)
device_unit(dv) != bid->biosdev)
continue;
goto found;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbd.c,v 1.29 2006/03/19 15:11:50 bouyer Exp $ */
/* $NetBSD: xbd.c,v 1.30 2006/03/28 17:38:29 thorpej Exp $ */
/*
*
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.29 2006/03/19 15:11:50 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.30 2006/03/28 17:38:29 thorpej Exp $");
#include "xbd_hypervisor.h"
#include "rnd.h"
@ -1054,7 +1054,7 @@ xbd_detach(struct device *dv, int flags)
cmaj = cdevsw_lookup_major(&xbd_cdevsw);
for (i = 0; i < MAXPARTITIONS; i++) {
mn = DISKMINOR(dv->dv_unit, i);
mn = DISKMINOR(device_unit(dv), i);
vdevgone(bmaj, mn, mn, VBLK);
vdevgone(cmaj, mn, mn, VCHR);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xencons.c,v 1.13 2006/03/06 20:12:09 bouyer Exp $ */
/* $NetBSD: xencons.c,v 1.14 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.13 2006/03/06 20:12:09 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.14 2006/03/28 17:38:29 thorpej Exp $");
#include "opt_xen.h"
@ -199,10 +199,10 @@ xencons_attach(struct device *parent, struct device *self, void *aux)
maj = cdevsw_lookup_major(&xencons_cdevsw);
/* There can be only one, but it can have any unit number. */
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
aprint_verbose("%s: console major %d, unit %d\n",
sc->sc_dev.dv_xname, maj, sc->sc_dev.dv_unit);
sc->sc_dev.dv_xname, maj, device_unit(&sc->sc_dev));
sc->sc_tty->t_dev = cn_tab->cn_dev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: darwin_ioframebuffer.c,v 1.34 2005/12/11 12:19:56 christos Exp $ */
/* $NetBSD: darwin_ioframebuffer.c,v 1.35 2006/03/28 17:38:29 thorpej Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: darwin_ioframebuffer.c,v 1.34 2005/12/11 12:19:56 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: darwin_ioframebuffer.c,v 1.35 2006/03/28 17:38:29 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -823,7 +823,7 @@ darwin_findscreen(dev, unit, screen)
/* Find a wsdisplay */
TAILQ_FOREACH(dv, &alldevs, dv_list)
if ((dv->dv_cfdriver == &wsdisplay_cd) &&
(dv->dv_unit == unit))
(device_unit(dv) == unit))
break;
if (dv == NULL)
return ENODEV;
@ -832,7 +832,7 @@ darwin_findscreen(dev, unit, screen)
/* Derive the device number */
major = cdevsw_lookup_major(&wsdisplay_cdevsw);
minor = WSDISPLAYMINOR(dv->dv_unit, screen);
minor = WSDISPLAYMINOR(device_unit(dv), screen);
*dev = makedev(major, minor);
#ifdef DEBUG_DARWIN

View File

@ -1,4 +1,4 @@
/* $NetBSD: darwin_iohidsystem.c,v 1.32 2006/03/01 12:38:12 yamt Exp $ */
/* $NetBSD: darwin_iohidsystem.c,v 1.33 2006/03/28 17:38:29 thorpej Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.32 2006/03/01 12:38:12 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.33 2006/03/28 17:38:29 thorpej Exp $");
#include "ioconf.h"
#include "wsmux.h"
@ -580,7 +580,7 @@ darwin_findwsmux(dev, mux)
return ENODEV;
major = cdevsw_lookup_major(&wsmux_cdevsw);
minor = wsm_sc->sc_base.me_dv.dv_unit;
minor = device_unit(&wsm_sc->sc_base.me_dv);
*dev = makedev(major, minor);
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata_raid_adaptec.c,v 1.3 2006/03/25 22:55:55 thorpej Exp $ */
/* $NetBSD: ata_raid_adaptec.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $ */
/*-
* Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata_raid_adaptec.c,v 1.3 2006/03/25 22:55:55 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ata_raid_adaptec.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -80,7 +80,7 @@ ata_raid_read_config_adaptec(struct wd_softc *sc)
bmajor = devsw_name2blk(sc->sc_dev.dv_xname, NULL, 0);
/* Get a vnode for the raw partition of this disk. */
dev = MAKEDISKDEV(bmajor, sc->sc_dev.dv_unit, RAW_PART);
dev = MAKEDISKDEV(bmajor, device_unit(&sc->sc_dev), RAW_PART);
error = bdevvp(dev, &vp);
if (error)
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata_raid_promise.c,v 1.6 2005/12/11 12:21:14 christos Exp $ */
/* $NetBSD: ata_raid_promise.c,v 1.7 2006/03/28 17:38:29 thorpej Exp $ */
/*-
* Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata_raid_promise.c,v 1.6 2005/12/11 12:21:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ata_raid_promise.c,v 1.7 2006/03/28 17:38:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -80,7 +80,7 @@ ata_raid_read_config_promise(struct wd_softc *sc)
bmajor = devsw_name2blk(sc->sc_dev.dv_xname, NULL, 0);
/* Get a vnode for the raw partition of this disk. */
dev = MAKEDISKDEV(bmajor, sc->sc_dev.dv_unit, RAW_PART);
dev = MAKEDISKDEV(bmajor, device_unit(&sc->sc_dev), RAW_PART);
error = bdevvp(dev, &vp);
if (error)
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_ataraid.c,v 1.14 2005/12/11 12:21:14 christos Exp $ */
/* $NetBSD: ld_ataraid.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.14 2005/12/11 12:21:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $");
#include "rnd.h"
@ -200,7 +200,7 @@ ld_ataraid_attach(struct device *parent, struct device *self, void *aux)
dev_t dev;
bmajor = devsw_name2blk(adi->adi_dev->dv_xname, NULL, 0);
dev = MAKEDISKDEV(bmajor, adi->adi_dev->dv_unit, RAW_PART);
dev = MAKEDISKDEV(bmajor, device_unit(adi->adi_dev), RAW_PART);
error = bdevvp(dev, &vp);
if (error)
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.320 2006/03/01 12:38:13 yamt Exp $ */
/* $NetBSD: wd.c,v 1.321 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.320 2006/03/01 12:38:13 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.321 2006/03/28 17:38:29 thorpej Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@ -441,7 +441,7 @@ wddetach(struct device *self, int flags)
/* Nuke the vnodes for any open instances. */
for (i = 0; i < MAXPARTITIONS; i++) {
mn = WDMINOR(self->dv_unit, i);
mn = WDMINOR(device_unit(self), i);
vdevgone(bmaj, mn, mn, VBLK);
vdevgone(cmaj, mn, mn, VCHR);
}
@ -1060,8 +1060,9 @@ wdgetdisklabel(struct wd_softc *wd)
wd->drvp->drive_flags |= DRIVE_RESET;
splx(s);
}
errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART),
wdstrategy, lp, wd->sc_dk.dk_cpulabel);
errstring = readdisklabel(MAKEWDDEV(0, device_unit(&wd->sc_dev),
RAW_PART), wdstrategy, lp,
wd->sc_dk.dk_cpulabel);
if (errstring) {
/*
* This probably happened because the drive's default
@ -1074,7 +1075,7 @@ wdgetdisklabel(struct wd_softc *wd)
wd->drvp->drive_flags |= DRIVE_RESET;
splx(s);
}
errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit,
errstring = readdisklabel(MAKEWDDEV(0, device_unit(&wd->sc_dev),
RAW_PART), wdstrategy, lp, wd->sc_dk.dk_cpulabel);
}
if (errstring) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio.c,v 1.201 2006/03/07 15:17:47 jmcneill Exp $ */
/* $NetBSD: audio.c,v 1.202 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.201 2006/03/07 15:17:47 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.202 2006/03/28 17:38:29 thorpej Exp $");
#include "audio.h"
#if NAUDIO > 0
@ -500,7 +500,7 @@ audiodetach(struct device *self, int flags)
maj = cdevsw_lookup_major(&audio_cdevsw);
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn | SOUND_DEVICE, mn | SOUND_DEVICE, VCHR);
vdevgone(maj, mn | AUDIO_DEVICE, mn | AUDIO_DEVICE, VCHR);
vdevgone(maj, mn | AUDIOCTL_DEVICE, mn | AUDIOCTL_DEVICE, VCHR);

View File

@ -1,4 +1,4 @@
/* $NetBSD: audiobell.c,v 1.3 2006/03/01 12:38:13 yamt Exp $ */
/* $NetBSD: audiobell.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 1999 Richard Earnshaw
@ -31,7 +31,7 @@
*/
#include <sys/types.h>
__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.3 2006/03/01 12:38:13 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $");
#include <sys/audioio.h>
#include <sys/conf.h>
@ -145,7 +145,7 @@ audiobell(void *arg, u_int pitch, u_int period, u_int volume, int poll)
if (poll) return;
/* If not configured, we can't beep. */
if (audioopen(AUDIO_DEVICE | audio->dv_unit, FWRITE, 0, NULL) != 0)
if (audioopen(AUDIO_DEVICE | device_unit(audio), FWRITE, 0, NULL) != 0)
return;
buf = malloc(period * 8, M_TEMP, M_WAITOK);
@ -161,9 +161,9 @@ audiobell(void *arg, u_int pitch, u_int period, u_int volume, int poll)
auio.uio_rw = UIO_WRITE;
UIO_SETUP_SYSSPACE(&auio);
audiowrite(AUDIO_DEVICE | audio->dv_unit, &auio, 0);
audiowrite(AUDIO_DEVICE | device_unit(audio), &auio, 0);
out:
if (buf != NULL) free(buf, M_TEMP);
audioclose(AUDIO_DEVICE | audio->dv_unit, FWRITE, 0, NULL);
audioclose(AUDIO_DEVICE | device_unit(audio), FWRITE, 0, NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: bthci.c,v 1.19 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: bthci.c,v 1.20 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bthci.c,v 1.19 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bthci.c,v 1.20 2006/03/28 17:38:29 thorpej Exp $");
#include "bthcidrv.h"
@ -210,7 +210,7 @@ bthci_detach(struct device *self, int flags)
maj = cdevsw_lookup_major(&bthci_cdevsw);
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
DPRINTFN(1, ("%s: driver detached\n", __func__));

View File

@ -1,4 +1,4 @@
/* $NetBSD: cardbus.c,v 1.68 2005/12/11 12:21:15 christos Exp $ */
/* $NetBSD: cardbus.c,v 1.69 2006/03/28 17:38:29 thorpej Exp $ */
/*
* Copyright (c) 1997, 1998, 1999 and 2000
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.68 2005/12/11 12:21:15 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.69 2006/03/28 17:38:29 thorpej Exp $");
#include "opt_cardbus.h"
@ -392,12 +392,13 @@ cardbus_attach_card(struct cardbus_softc *sc)
cc = sc->sc_cc;
cf = sc->sc_cf;
DPRINTF(("cardbus_attach_card: cb%d start\n", sc->sc_dev.dv_unit));
DPRINTF(("cardbus_attach_card: cb%d start\n",
device_unit(&sc->sc_dev)));
/* inspect initial voltage */
if ((cdstatus = (*cf->cardbus_ctrl)(cc, CARDBUS_CD)) == 0) {
DPRINTF(("cardbusattach: no CardBus card on cb%d\n",
sc->sc_dev.dv_unit));
device_unit(&sc->sc_dev)));
return (0);
}
@ -426,7 +427,7 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
/* inspect initial voltage */
if ((cdstatus = (*cf->cardbus_ctrl)(cc, CARDBUS_CD)) == 0) {
DPRINTF(("cardbusattach: no CardBus card on cb%d\n",
sc->sc_dev.dv_unit));
device_unit(&sc->sc_dev)));
return (0);
}

View File

@ -1,7 +1,7 @@
/* $NetBSD: hil_gpib.c,v 1.4 2005/12/11 12:21:21 christos Exp $ */
/* $NetBSD: hil_gpib.c,v 1.5 2006/03/28 17:38:30 thorpej Exp $ */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hil_gpib.c,v 1.4 2005/12/11 12:21:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: hil_gpib.c,v 1.5 2006/03/28 17:38:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -119,7 +119,7 @@ hilstart(v)
{
struct hil_softc *sc = v;
DPRINTF(HDB_FOLLOW, ("hilstart(%x)\n", sc->sc_dev.dv_unit));
DPRINTF(HDB_FOLLOW, ("hilstart(%x)\n", device_unit(&sc->sc_dev)));
sc->sc_flags &= ~HILF_DELAY;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ppi.c,v 1.4 2005/12/11 12:21:21 christos Exp $ */
/* $NetBSD: ppi.c,v 1.5 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.4 2005/12/11 12:21:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.5 2006/03/28 17:38:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -257,7 +257,7 @@ ppistart(v)
{
struct ppi_softc *sc = v;
DPRINTF(PDB_FOLLOW, ("ppistart(%x)\n", sc->sc_dev.dv_unit));
DPRINTF(PDB_FOLLOW, ("ppistart(%x)\n", device_unit(&sc->sc_dev)));
sc->sc_flags &= ~PPIF_DELAY;
wakeup(sc);
@ -269,7 +269,7 @@ ppitimo(arg)
{
struct ppi_softc *sc = arg;
DPRINTF(PDB_FOLLOW, ("ppitimo(%x)\n", sc->sc_dev.dv_unit));
DPRINTF(PDB_FOLLOW, ("ppitimo(%x)\n", device_unit(&sc->sc_dev)));
sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO);
wakeup(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rd.c,v 1.9 2006/03/25 22:59:59 thorpej Exp $ */
/* $NetBSD: rd.c,v 1.10 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.9 2006/03/25 22:59:59 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.10 2006/03/28 17:38:30 thorpej Exp $");
#include "rnd.h"
@ -492,7 +492,7 @@ rdgetinfo(sc)
/*
* Call the generic disklabel extraction routine
*/
msg = readdisklabel(RDMAKEDEV(0, sc->sc_dev.dv_unit, RAW_PART),
msg = readdisklabel(RDMAKEDEV(0, device_unit(&sc->sc_dev), RAW_PART),
rdstrategy, lp, NULL);
if (msg == NULL)
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: gpio.c,v 1.5 2006/02/20 03:18:36 riz Exp $ */
/* $NetBSD: gpio.c,v 1.6 2006/03/28 17:38:30 thorpej Exp $ */
/* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */
/*
@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.5 2006/02/20 03:18:36 riz Exp $");
__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.6 2006/03/28 17:38:30 thorpej Exp $");
/*
* General Purpose Input/Output framework.
@ -106,7 +106,7 @@ gpio_detach(struct device *self, int flags)
break;
/* Nuke the vnodes for any open instances (calls close) */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: dpti.c,v 1.22 2006/03/25 23:04:31 thorpej Exp $ */
/* $NetBSD: dpti.c,v 1.23 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.22 2006/03/25 23:04:31 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.23 2006/03/28 17:38:30 thorpej Exp $");
#include "opt_i2o.h"
@ -340,7 +340,7 @@ dpti_ctlrinfo(struct dpti_softc *sc, int size, caddr_t data)
memset(&info, 0, sizeof(info));
info.length = sizeof(info) - sizeof(u_int16_t);
info.drvrHBAnum = sc->sc_dv.dv_unit;
info.drvrHBAnum = device_unit(&sc->sc_dv);
info.baseAddr = iop->sc_memaddr;
if ((i = dpti_blinkled(sc)) == -1)
i = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: iop.c,v 1.52 2006/03/27 21:50:45 bouyer Exp $ */
/* $NetBSD: iop.c,v 1.53 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.52 2006/03/27 21:50:45 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.53 2006/03/28 17:38:30 thorpej Exp $");
#include "opt_i2o.h"
#include "iop.h"
@ -531,7 +531,7 @@ iop_config_interrupts(struct device *self)
continue;
ste->orgid = iop->sc_status.orgid;
ste->iopid = iop->sc_dv.dv_unit + 2;
ste->iopid = device_unit(&iop->sc_dv) + 2;
ste->segnumber =
htole32(le32toh(iop->sc_status.segnumber) & ~4095);
ste->iopcaps = iop->sc_status.iopcaps;
@ -1512,7 +1512,7 @@ iop_systab_set(struct iop_softc *sc)
mf->msgfunc = I2O_MSGFUNC(I2O_TID_IOP, I2O_EXEC_SYS_TAB_SET);
mf->msgictx = IOP_ICTX;
mf->msgtctx = im->im_tctx;
mf->iopid = (sc->sc_dv.dv_unit + 2) << 12;
mf->iopid = (device_unit(&sc->sc_dv) + 2) << 12;
mf->segnumber = 0;
mema[1] = sc->sc_status.desiredprivmemsize;

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.241 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: com.c,v 1.242 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.241 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.242 2006/03/28 17:38:30 thorpej Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -564,7 +564,8 @@ com_attach_subr(struct com_softc *sc)
/* locate the major number */
maj = cdevsw_lookup_major(&com_cdevsw);
tp->t_dev = cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
tp->t_dev = cn_tab->cn_dev = makedev(maj,
device_unit(&sc->sc_dev));
aprint_normal("%s: console\n", sc->sc_dev.dv_xname);
}
@ -669,7 +670,7 @@ com_detach(struct device *self, int flags)
maj = cdevsw_lookup_major(&com_cdevsw);
/* Nuke the vnodes for any open instances. */
mn = self->dv_unit;
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
mn |= COMDIALOUT_MASK;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64570.c,v 1.30 2005/12/11 12:21:26 christos Exp $ */
/* $NetBSD: hd64570.c,v 1.31 2006/03/28 17:38:30 thorpej Exp $ */
/*
* Copyright (c) 1999 Christian E. Hopps
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.30 2005/12/11 12:21:26 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.31 2006/03/28 17:38:30 thorpej Exp $");
#include "bpfilter.h"
#include "opt_inet.h"
@ -425,14 +425,14 @@ sca_port_attach(struct sca_softc *sc, u_int port)
scp->msci_off = SCA_MSCI_OFF_0;
scp->dmac_off = SCA_DMAC_OFF_0;
if(sc->sc_parent != NULL)
ntwo_unit=sc->sc_parent->dv_unit * 2 + 0;
ntwo_unit = device_unit(sc->sc_parent) * 2 + 0;
else
ntwo_unit = 0; /* XXX */
} else {
scp->msci_off = SCA_MSCI_OFF_1;
scp->dmac_off = SCA_DMAC_OFF_1;
if(sc->sc_parent != NULL)
ntwo_unit=sc->sc_parent->dv_unit * 2 + 1;
ntwo_unit = device_unit(sc->sc_parent) * 2 + 1;
else
ntwo_unit = 1; /* XXX */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: icp.c,v 1.18 2006/01/29 21:42:42 dsl Exp $ */
/* $NetBSD: icp.c,v 1.19 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.18 2006/01/29 21:42:42 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.19 2006/03/28 17:38:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -651,7 +651,8 @@ icp_async_event(struct icp_softc *icp, int service)
} else {
if ((icp->icp_fw_vers & 0xff) >= 0x1a) {
icp->icp_evt.size = 0;
icp->icp_evt.eu.async.ionode = icp->icp_dv.dv_unit;
icp->icp_evt.eu.async.ionode =
device_unit(&icp->icp_dv);
icp->icp_evt.eu.async.status = icp->icp_status;
/*
* Severity and event string are filled in by the
@ -661,7 +662,8 @@ icp_async_event(struct icp_softc *icp, int service)
icp->icp_evt.event_string);
} else {
icp->icp_evt.size = sizeof(icp->icp_evt.eu.async);
icp->icp_evt.eu.async.ionode = icp->icp_dv.dv_unit;
icp->icp_evt.eu.async.ionode =
device_unit(&icp->icp_dv);
icp->icp_evt.eu.async.service = service;
icp->icp_evt.eu.async.status = icp->icp_status;
icp->icp_evt.eu.async.info = icp->icp_info;
@ -706,7 +708,7 @@ icp_intr(void *cookie)
printf("%s: uninitialized or unknown service (%d/%d)\n",
icp->icp_dv.dv_xname, ctx.info, ctx.info2);
icp->icp_evt.size = sizeof(icp->icp_evt.eu.driver);
icp->icp_evt.eu.driver.ionode = icp->icp_dv.dv_unit;
icp->icp_evt.eu.driver.ionode = device_unit(&icp->icp_dv);
icp_store_event(icp, GDT_ES_DRIVER, 4, &icp->icp_evt);
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: joy.c,v 1.9 2005/12/11 12:21:27 christos Exp $ */
/* $NetBSD: joy.c,v 1.10 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 1995 Jean-Marc Zucconi
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: joy.c,v 1.9 2005/12/11 12:21:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: joy.c,v 1.10 2006/03/28 17:38:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -98,7 +98,7 @@ joydetach(sc, flags)
int maj, mn;
maj = cdevsw_lookup_major(&joy_cdevsw);
mn = sc->sc_dev.dv_unit << 1;
mn = device_unit(&sc->sc_dev) << 1;
vdevgone(maj, mn, mn, VCHR);
vdevgone(maj, mn + 1, mn + 1, VCHR);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_icp.c,v 1.13 2006/03/25 23:10:12 thorpej Exp $ */
/* $NetBSD: ld_icp.c,v 1.14 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_icp.c,v 1.13 2006/03/25 23:10:12 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ld_icp.c,v 1.14 2006/03/28 17:38:30 thorpej Exp $");
#include "rnd.h"
@ -320,7 +320,7 @@ ld_icp_intr(struct icp_ccb *ic)
bp->b_resid = bp->b_bcount;
icp->icp_evt.size = sizeof(icp->icp_evt.eu.sync);
icp->icp_evt.eu.sync.ionode = icp->icp_dv.dv_unit;
icp->icp_evt.eu.sync.ionode = device_unit(&icp->icp_dv);
icp->icp_evt.eu.sync.service = icp->icp_service;
icp->icp_evt.eu.sync.status = icp->icp_status;
icp->icp_evt.eu.sync.info = icp->icp_info;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rrunner.c,v 1.51 2005/12/11 12:21:28 christos Exp $ */
/* $NetBSD: rrunner.c,v 1.52 2006/03/28 17:38:30 thorpej Exp $ */
/*
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.51 2005/12/11 12:21:28 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.52 2006/03/28 17:38:30 thorpej Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -202,7 +202,7 @@ eshconfig(sc)
int error;
int i;
esh_softc_debug[sc->sc_dev.dv_unit] = sc;
esh_softc_debug[device_unit(&sc->sc_dev)] = sc;
sc->sc_flags = 0;
TAILQ_INIT(&sc->sc_dmainfo_freelist);
@ -726,7 +726,7 @@ esh_fpopen(dev_t dev, int oflags, int devtype, struct lwp *l)
#ifdef ESH_PRINTF
printf("esh_fpopen: opening board %d, ulp %d\n",
sc->sc_dev.dv_unit, ulp);
device_unit(&sc->sc_dev), ulp);
#endif
/* If the card is not up, initialize it. */
@ -948,7 +948,7 @@ esh_fpclose(dev_t dev, int fflag, int devtype, struct lwp *l)
#ifdef ESH_PRINTF
printf("esh_fpclose: closing unit %d, ulp %d\n",
sc->sc_dev.dv_unit, ulp);
device_unit(&sc->sc_dev), ulp);
#endif
assert(ring);
assert(ring_ctl);

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530tty.c,v 1.103 2006/03/05 19:10:30 rjs Exp $ */
/* $NetBSD: z8530tty.c,v 1.104 2006/03/28 17:38:30 thorpej Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@ -137,7 +137,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.103 2006/03/05 19:10:30 rjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.104 2006/03/28 17:38:30 thorpej Exp $");
#include "opt_kgdb.h"
#include "opt_ntp.h"
@ -345,7 +345,7 @@ zstty_attach(parent, self, aux)
callout_init(&zst->zst_diag_ch);
cn_init_magic(&zstty_cnm_state);
tty_unit = zst->zst_dev.dv_unit;
tty_unit = device_unit(&zst->zst_dev);
channel = args->channel;
cs = zsc->zsc_cs[channel];
cs->cs_private = zst;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fw_port.h,v 1.8 2006/02/16 20:17:19 perry Exp $ */
/* $NetBSD: fw_port.h,v 1.9 2006/03/28 17:38:33 thorpej Exp $ */
/*
* Copyright (c) 2004 KIYOHARA Takashi
* All rights reserved.
@ -1079,7 +1079,7 @@ typedef struct scsipi_inquiry_data sbp_scsi_inquiry_data;
#define timevalsub(tv1, tv2) timersub((tv1), (tv2), (tv1))
#define device_get_nameunit(dev) (dev)->dv_xname
#define device_get_unit(dev) (dev)->dv_unit
#define device_get_unit(dev) device_unit((dev))
/*
* queue macros for NetBSD

Some files were not shown because too many files have changed in this diff Show More