diff options
author | dfr <dfr@FreeBSD.org> | 1999-09-07 08:42:49 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-09-07 08:42:49 +0000 |
commit | e2da291638899ecbc4fb439bebf44d5763be13f4 (patch) | |
tree | da7778a2053253c07923bdb2565c4919af210b53 | |
parent | 2325c8f0cd1729626bf053cb03df56503d5ac806 (diff) | |
download | FreeBSD-src-e2da291638899ecbc4fb439bebf44d5763be13f4.zip FreeBSD-src-e2da291638899ecbc4fb439bebf44d5763be13f4.tar.gz |
Change isa_get/set_flags() to device_get/set_flags().
-rw-r--r-- | sys/dev/ed/if_ed.c | 10 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 2 | ||||
-rw-r--r-- | sys/dev/pcm/isa/mss.c | 17 | ||||
-rw-r--r-- | sys/dev/pcm/isa/sb.c | 2 | ||||
-rw-r--r-- | sys/dev/sound/isa/mss.c | 17 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb.c | 2 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb16.c | 2 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb8.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/if_ed.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/isa_compat.h | 5 | ||||
-rw-r--r-- | sys/isa/fd.c | 2 | ||||
-rw-r--r-- | sys/isa/isa_common.c | 15 | ||||
-rw-r--r-- | sys/isa/isa_common.h | 1 | ||||
-rw-r--r-- | sys/isa/isahint.c | 2 | ||||
-rw-r--r-- | sys/isa/isavar.h | 2 | ||||
-rw-r--r-- | sys/isa/syscons_isa.c | 4 | ||||
-rw-r--r-- | sys/isa/vga_isa.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_bus.c | 13 | ||||
-rw-r--r-- | sys/sys/bus.h | 2 | ||||
-rw-r--r-- | sys/sys/bus_private.h | 1 |
20 files changed, 58 insertions, 57 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 3244b3b..78fe9ee 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -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; @@ -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; @@ -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 @@ -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; @@ -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) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 1097933..ee74217 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -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); diff --git a/sys/dev/pcm/isa/mss.c b/sys/dev/pcm/isa/mss.c index 13645d9..ee54312 100644 --- a/sys/dev/pcm/isa/mss.c +++ b/sys/dev/pcm/isa/mss.c @@ -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 @@ -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; @@ -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; @@ -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; @@ -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; @@ -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); } diff --git a/sys/dev/pcm/isa/sb.c b/sys/dev/pcm/isa/sb.c index e193ace..2c329d7 100644 --- a/sys/dev/pcm/isa/sb.c +++ b/sys/dev/pcm/isa/sb.c @@ -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, diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index 13645d9..ee54312 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -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 @@ -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; @@ -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; @@ -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; @@ -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; @@ -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); } diff --git a/sys/dev/sound/isa/sb.c b/sys/dev/sound/isa/sb.c index e193ace..2c329d7 100644 --- a/sys/dev/sound/isa/sb.c +++ b/sys/dev/sound/isa/sb.c @@ -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, diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index e193ace..2c329d7 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -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, diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index e193ace..2c329d7 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -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, diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c index 3244b3b..78fe9ee 100644 --- a/sys/i386/isa/if_ed.c +++ b/sys/i386/isa/if_ed.c @@ -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; @@ -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; @@ -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 @@ -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; @@ -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) diff --git a/sys/i386/isa/isa_compat.h b/sys/i386/isa/isa_compat.h index e7883e2..6b3e01b 100644 --- a/sys/i386/isa/isa_compat.h +++ b/sys/i386/isa/isa_compat.h @@ -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; @@ -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 }, diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 1097933..ee74217 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -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); diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index c6e736c..1fbf7d1 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -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); @@ -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); @@ -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; @@ -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; diff --git a/sys/isa/isa_common.h b/sys/isa/isa_common.h index 4a104fe..70b8b33 100644 --- a/sys/isa/isa_common.h +++ b/sys/isa/isa_common.h @@ -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 */ diff --git a/sys/isa/isahint.c b/sys/isa/isahint.c index 9bb333f..a8a5c8f 100644 --- a/sys/isa/isahint.c +++ b/sys/isa/isahint.c @@ -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); diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h index 7f912e5..5340b83 100644 --- a/sys/isa/isavar.h +++ b/sys/isa/isavar.h @@ -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, @@ -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) diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c index 2f8111d..dc0bb6f 100644 --- a/sys/isa/syscons_isa.c +++ b/sys/isa/syscons_isa.c @@ -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 diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c index decd080..95cc1b1 100644 --- a/sys/isa/vga_isa.c +++ b/sys/isa/vga_isa.c @@ -126,7 +126,7 @@ isavga_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Generic ISA VGA"); - error = vga_probe_unit(device_get_unit(dev), &adp, isa_get_flags(dev)); + error = vga_probe_unit(device_get_unit(dev), &adp, device_get_flags(dev)); if (error == 0) { bus = device_get_parent(dev); ISA_SET_RESOURCE(bus, dev, SYS_RES_IOPORT, 0, @@ -163,7 +163,7 @@ isavga_attach(device_t dev) mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); - error = vga_attach_unit(unit, sc, isa_get_flags(dev)); + error = vga_attach_unit(unit, sc, device_get_flags(dev)); if (error) return error; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d03e656..7368717 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -610,6 +610,7 @@ make_device(device_t parent, const char *name, dev->nameunit = NULL; dev->desc = NULL; dev->busy = 0; + dev->devflags = 0; dev->flags = DF_ENABLED; dev->order = 0; if (unit == -1) @@ -892,6 +893,12 @@ device_get_desc(device_t dev) return dev->desc; } +u_int32_t +device_get_flags(device_t dev) +{ + return dev->devflags; +} + int device_print_prettyname(device_t dev) { @@ -955,6 +962,12 @@ device_set_desc_copy(device_t dev, const char* desc) device_set_desc_internal(dev, desc, TRUE); } +void +device_set_flags(device_t dev, u_int32_t flags) +{ + dev->devflags = flags; +} + void * device_get_softc(device_t dev) { diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 03a6449..7f16330 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -228,6 +228,7 @@ device_t device_find_child(device_t dev, const char *classname, const char *device_get_desc(device_t dev); devclass_t device_get_devclass(device_t dev); driver_t *device_get_driver(device_t dev); +u_int32_t device_get_flags(device_t dev); device_t device_get_parent(device_t dev); int device_get_children(device_t dev, device_t **listp, int *countp); void *device_get_ivars(device_t dev); @@ -247,6 +248,7 @@ void device_set_desc(device_t dev, const char* desc); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); int device_set_driver(device_t dev, driver_t *driver); +void device_set_flags(device_t dev, u_int32_t flags); int device_shutdown(device_t dev); void device_unbusy(device_t dev); void device_verbose(device_t dev); diff --git a/sys/sys/bus_private.h b/sys/sys/bus_private.h index 27b0a6c..265a761 100644 --- a/sys/sys/bus_private.h +++ b/sys/sys/bus_private.h @@ -127,6 +127,7 @@ struct device { char* desc; /* driver specific description */ int busy; /* count of calls to device_busy() */ device_state_t state; + u_int32_t devflags; /* api level flags for device_get_flags() */ u_short flags; #define DF_ENABLED 1 /* device should be probed/attached */ #define DF_FIXEDCLASS 2 /* devclass specified at create time */ |