Skip to content

Commit

Permalink
Change isa_get/set_flags() to device_get/set_flags().
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Rabson authored and Doug Rabson committed Sep 7, 1999
1 parent 28eb42e commit 062acdb
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 57 deletions.
10 changes: 5 additions & 5 deletions sys/dev/ed/if_ed.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ ed_probe_WD80x3(dev)
struct ed_softc *sc = device_get_softc(dev);
int error;
int i;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
u_int memsize, maddr;
u_char iptr, isa16bit, sum;
u_long conf_maddr, conf_msize, irq, junk;
Expand Down Expand Up @@ -795,7 +795,7 @@ ed_probe_3Com(dev)
struct ed_softc *sc = device_get_softc(dev);
int error;
int i;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
u_int memsize;
u_char isa16bit;
u_long conf_maddr, conf_msize, irq, junk;
Expand Down Expand Up @@ -1301,7 +1301,7 @@ static int
ed_probe_Novell(dev)
device_t dev;
{
return ed_probe_Novell_generic(dev, 0, isa_get_flags(dev));
return ed_probe_Novell_generic(dev, 0, device_get_flags(dev));
}

#if NCARDxx > 0
Expand Down Expand Up @@ -1539,7 +1539,7 @@ ed_probe_HP_pclanp(dev)

sc->tx_page_start = ED_HPP_TX_PAGE_OFFSET;

if (isa_get_flags(dev) & ED_FLAGS_NO_MULTI_BUFFERING)
if (device_get_flags(dev) & ED_FLAGS_NO_MULTI_BUFFERING)
sc->txb_cnt = 1;
else
sc->txb_cnt = 2;
Expand Down Expand Up @@ -1864,7 +1864,7 @@ ed_isa_attach(dev)
device_t dev;
{
struct ed_softc *sc = device_get_softc(dev);
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
int error;

if (sc->port_used > 0)
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/fdc/fdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ fd_probe(device_t dev)
/* look up what bios thinks we have */
switch (fd->fdu) {
case 0:
if (isa_get_flags(fdc->fdc_dev) & FDC_PRETEND_D0)
if (device_get_flags(fdc->fdc_dev) & FDC_PRETEND_D0)
fdt = RTCFDT_144M | RTCFDT_144M_PRETENDED;
else
fdt = (rtcin(RTC_FDISKETTE) & 0xf0);
Expand Down
17 changes: 9 additions & 8 deletions sys/dev/pcm/isa/mss.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ mss_probe(device_t dev)
if (!mss->io_base) goto no;

/* got irq/dma regs? */
flags = isa_get_flags(dev);
flags = device_get_flags(dev);
irq = isa_get_irq(dev);
drq = isa_get_drq(dev);

if (!(isa_get_flags(dev) & DV_F_TRUE_MSS)) goto mss_probe_end;
if (!(device_get_flags(dev) & DV_F_TRUE_MSS)) goto mss_probe_end;

/*
* Check if the IO port returns valid signature. The original MS
Expand All @@ -480,7 +480,7 @@ mss_probe(device_t dev)
tmpx = tmp = io_rd(mss, 3);
if (tmp == 0xff) { /* Bus float */
BVDDB(printf("I/O addr inactive (%x), try pseudo_mss\n", tmp));
isa_set_flags(dev, flags & ~DV_F_TRUE_MSS);
device_set_flags(dev, flags & ~DV_F_TRUE_MSS);
goto mss_probe_end;
}
tmp &= 0x3f;
Expand Down Expand Up @@ -732,8 +732,9 @@ mss_detect(device_t dev, struct mss_info *mss)
gotit:
BVDDB(printf("mss_detect() - Detected %s\n", name));
device_set_desc(dev, name);
isa_set_flags(dev, ((isa_get_flags(dev) & ~DV_F_DEV_MASK) |
((mss->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK)));
device_set_flags(dev,
((device_get_flags(dev) & ~DV_F_DEV_MASK) |
((mss->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK)));
return 0;
no:
return ENXIO;
Expand Down Expand Up @@ -786,7 +787,7 @@ mss_doattach(device_t dev, struct mss_info *mss)
{
snddev_info *d = device_get_softc(dev);
void *ih;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
char status[SND_STATUSLEN];

if (!mss_alloc_resources(mss, dev)) goto no;
Expand Down Expand Up @@ -863,7 +864,7 @@ static int
mss_attach(device_t dev)
{
struct mss_info *mss;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

mss = (struct mss_info *)malloc(sizeof *mss, M_DEVBUF, M_NOWAIT);
if (!mss) return ENXIO;
Expand All @@ -879,7 +880,7 @@ mss_attach(device_t dev)
flags & DV_F_DRQ_MASK, 1);
mss->drq2_rid = 1;
}
mss->bd_id = (isa_get_flags(dev) & DV_F_DEV_MASK) >> DV_F_DEV_SHIFT;
mss->bd_id = (device_get_flags(dev) & DV_F_DEV_MASK) >> DV_F_DEV_SHIFT;
if (mss->bd_id == MD_YM0020) ymf_test(dev, mss);
return mss_doattach(dev, mss);
}
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/pcm/isa/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int
sb_attach(device_t dev)
{
struct sb_info *sb;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

if (flags & DV_F_DUAL_DMA) {
ISA_SET_RESOURCE(device_get_parent(dev), dev, SYS_RES_DRQ, 1,
Expand Down
17 changes: 9 additions & 8 deletions sys/dev/sound/isa/mss.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ mss_probe(device_t dev)
if (!mss->io_base) goto no;

/* got irq/dma regs? */
flags = isa_get_flags(dev);
flags = device_get_flags(dev);
irq = isa_get_irq(dev);
drq = isa_get_drq(dev);

if (!(isa_get_flags(dev) & DV_F_TRUE_MSS)) goto mss_probe_end;
if (!(device_get_flags(dev) & DV_F_TRUE_MSS)) goto mss_probe_end;

/*
* Check if the IO port returns valid signature. The original MS
Expand All @@ -480,7 +480,7 @@ mss_probe(device_t dev)
tmpx = tmp = io_rd(mss, 3);
if (tmp == 0xff) { /* Bus float */
BVDDB(printf("I/O addr inactive (%x), try pseudo_mss\n", tmp));
isa_set_flags(dev, flags & ~DV_F_TRUE_MSS);
device_set_flags(dev, flags & ~DV_F_TRUE_MSS);
goto mss_probe_end;
}
tmp &= 0x3f;
Expand Down Expand Up @@ -732,8 +732,9 @@ mss_detect(device_t dev, struct mss_info *mss)
gotit:
BVDDB(printf("mss_detect() - Detected %s\n", name));
device_set_desc(dev, name);
isa_set_flags(dev, ((isa_get_flags(dev) & ~DV_F_DEV_MASK) |
((mss->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK)));
device_set_flags(dev,
((device_get_flags(dev) & ~DV_F_DEV_MASK) |
((mss->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK)));
return 0;
no:
return ENXIO;
Expand Down Expand Up @@ -786,7 +787,7 @@ mss_doattach(device_t dev, struct mss_info *mss)
{
snddev_info *d = device_get_softc(dev);
void *ih;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
char status[SND_STATUSLEN];

if (!mss_alloc_resources(mss, dev)) goto no;
Expand Down Expand Up @@ -863,7 +864,7 @@ static int
mss_attach(device_t dev)
{
struct mss_info *mss;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

mss = (struct mss_info *)malloc(sizeof *mss, M_DEVBUF, M_NOWAIT);
if (!mss) return ENXIO;
Expand All @@ -879,7 +880,7 @@ mss_attach(device_t dev)
flags & DV_F_DRQ_MASK, 1);
mss->drq2_rid = 1;
}
mss->bd_id = (isa_get_flags(dev) & DV_F_DEV_MASK) >> DV_F_DEV_SHIFT;
mss->bd_id = (device_get_flags(dev) & DV_F_DEV_MASK) >> DV_F_DEV_SHIFT;
if (mss->bd_id == MD_YM0020) ymf_test(dev, mss);
return mss_doattach(dev, mss);
}
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/sound/isa/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int
sb_attach(device_t dev)
{
struct sb_info *sb;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

if (flags & DV_F_DUAL_DMA) {
ISA_SET_RESOURCE(device_get_parent(dev), dev, SYS_RES_DRQ, 1,
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/sound/isa/sb16.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int
sb_attach(device_t dev)
{
struct sb_info *sb;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

if (flags & DV_F_DUAL_DMA) {
ISA_SET_RESOURCE(device_get_parent(dev), dev, SYS_RES_DRQ, 1,
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/sound/isa/sb8.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int
sb_attach(device_t dev)
{
struct sb_info *sb;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);

if (flags & DV_F_DUAL_DMA) {
ISA_SET_RESOURCE(device_get_parent(dev), dev, SYS_RES_DRQ, 1,
Expand Down
10 changes: 5 additions & 5 deletions sys/i386/isa/if_ed.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ ed_probe_WD80x3(dev)
struct ed_softc *sc = device_get_softc(dev);
int error;
int i;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
u_int memsize, maddr;
u_char iptr, isa16bit, sum;
u_long conf_maddr, conf_msize, irq, junk;
Expand Down Expand Up @@ -795,7 +795,7 @@ ed_probe_3Com(dev)
struct ed_softc *sc = device_get_softc(dev);
int error;
int i;
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
u_int memsize;
u_char isa16bit;
u_long conf_maddr, conf_msize, irq, junk;
Expand Down Expand Up @@ -1301,7 +1301,7 @@ static int
ed_probe_Novell(dev)
device_t dev;
{
return ed_probe_Novell_generic(dev, 0, isa_get_flags(dev));
return ed_probe_Novell_generic(dev, 0, device_get_flags(dev));
}

#if NCARDxx > 0
Expand Down Expand Up @@ -1539,7 +1539,7 @@ ed_probe_HP_pclanp(dev)

sc->tx_page_start = ED_HPP_TX_PAGE_OFFSET;

if (isa_get_flags(dev) & ED_FLAGS_NO_MULTI_BUFFERING)
if (device_get_flags(dev) & ED_FLAGS_NO_MULTI_BUFFERING)
sc->txb_cnt = 1;
else
sc->txb_cnt = 2;
Expand Down Expand Up @@ -1864,7 +1864,7 @@ ed_isa_attach(dev)
device_t dev;
{
struct ed_softc *sc = device_get_softc(dev);
int flags = isa_get_flags(dev);
int flags = device_get_flags(dev);
int error;

if (sc->port_used > 0)
Expand Down
5 changes: 0 additions & 5 deletions sys/i386/isa/isa_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ struct old_isa_driver {

extern struct isa_driver vtdriver;
extern struct isa_driver advdriver;
extern struct isa_driver ahadriver;
extern struct isa_driver wdcdriver;
extern struct isa_driver msedriver;
extern struct isa_driver ardriver;
Expand Down Expand Up @@ -313,10 +312,6 @@ static struct old_isa_driver old_drivers[] = {
#endif
#endif

#if NAHA > 0
{ INTR_TYPE_CAM, &ahadriver },
#endif

#ifdef PC98
#if NBS > 0
{ INTR_TYPE_CAM, &bsdriver },
Expand Down
2 changes: 1 addition & 1 deletion sys/isa/fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ fd_probe(device_t dev)
/* look up what bios thinks we have */
switch (fd->fdu) {
case 0:
if (isa_get_flags(fdc->fdc_dev) & FDC_PRETEND_D0)
if (device_get_flags(fdc->fdc_dev) & FDC_PRETEND_D0)
fdt = RTCFDT_144M | RTCFDT_144M_PRETENDED;
else
fdt = (rtcin(RTC_FDISKETTE) & 0xf0);
Expand Down
15 changes: 3 additions & 12 deletions sys/isa/isa_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ isa_add_child(device_t dev, int order, const char *name, int unit)
bzero(idev, sizeof *idev);

resource_list_init(&idev->id_resources);
idev->id_flags = 0;
TAILQ_INIT(&idev->id_configs);

return device_add_child_ordered(dev, order, name, unit, idev);
Expand Down Expand Up @@ -541,15 +540,15 @@ isa_print_child(device_t bus, device_t dev)

retval += bus_print_child_header(bus, dev);

if (SLIST_FIRST(rl) || idev->id_flags)
if (SLIST_FIRST(rl) || device_get_flags(dev))
retval += printf(" at");

isa_print_resources(rl, "port", SYS_RES_IOPORT, "%#lx");
isa_print_resources(rl, "iomem", SYS_RES_MEMORY, "%#lx");
isa_print_resources(rl, "irq", SYS_RES_IRQ, "%ld");
isa_print_resources(rl, "drq", SYS_RES_DRQ, "%ld");
if (idev->id_flags)
retval += printf(" flags %#x", idev->id_flags);
if (device_get_flags(dev))
retval += printf(" flags %#x", device_get_flags(dev));

retval += bus_print_child_footer(bus, dev);

Expand Down Expand Up @@ -660,10 +659,6 @@ isa_read_ivar(device_t bus, device_t dev, int index, uintptr_t * result)
*result = -1;
break;

case ISA_IVAR_FLAGS:
*result = idev->id_flags;
break;

case ISA_IVAR_VENDORID:
*result = idev->id_vendorid;
break;
Expand Down Expand Up @@ -708,10 +703,6 @@ isa_write_ivar(device_t bus, device_t dev,
case ISA_IVAR_DRQ_1:
return EINVAL;

case ISA_IVAR_FLAGS:
idev->id_flags = value;
break;

case ISA_IVAR_VENDORID:
idev->id_vendorid = value;
break;
Expand Down
1 change: 0 additions & 1 deletion sys/isa/isa_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ struct isa_config_entry {
*/
struct isa_device {
struct resource_list id_resources;
int id_flags;
u_int32_t id_vendorid; /* pnp vendor id */
u_int32_t id_serial; /* pnp serial */
u_int32_t id_logicalid; /* pnp logical device id */
Expand Down
2 changes: 1 addition & 1 deletion sys/isa/isahint.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ isahint_add_device(device_t parent, const char *name, int unit)
ISA_SET_RESOURCE(parent, child, SYS_RES_DRQ, 0, start, 1);

if (resource_int_value(name, unit, "flags", &t) == 0)
isa_set_flags(child, t);
device_set_flags(child, t);

if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0)
device_disable(child);
Expand Down
2 changes: 0 additions & 2 deletions sys/isa/isavar.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ enum isa_device_ivars {
ISA_IVAR_MSIZE,
ISA_IVAR_MSIZE_0 = ISA_IVAR_MSIZE,
ISA_IVAR_MSIZE_1,
ISA_IVAR_FLAGS,
ISA_IVAR_IRQ,
ISA_IVAR_IRQ_0 = ISA_IVAR_IRQ,
ISA_IVAR_IRQ_1,
Expand Down Expand Up @@ -137,7 +136,6 @@ ISA_ACCESSOR(irq, IRQ, int)
ISA_ACCESSOR(drq, DRQ, int)
ISA_ACCESSOR(maddr, MADDR, int)
ISA_ACCESSOR(msize, MSIZE, int)
ISA_ACCESSOR(flags, FLAGS, int)
ISA_ACCESSOR(vendorid, VENDORID, int)
ISA_ACCESSOR(serial, SERIAL, int)
ISA_ACCESSOR(logicalid, LOGICALID, int)
Expand Down
4 changes: 2 additions & 2 deletions sys/isa/syscons_isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ scprobe(device_t dev)
return (ENXIO);

device_set_desc(dev, "System console");
return sc_probe_unit(device_get_unit(dev), isa_get_flags(dev));
return sc_probe_unit(device_get_unit(dev), device_get_flags(dev));
}

static int
scattach(device_t dev)
{
return sc_attach_unit(device_get_unit(dev), isa_get_flags(dev));
return sc_attach_unit(device_get_unit(dev), device_get_flags(dev));
}

static int
Expand Down
Loading

0 comments on commit 062acdb

Please sign in to comment.