GC some unused stuff relating to the old conflict checking and other lint.
Change haveseen_isadev() to something a little easier to emulate. Store the device_t for the wrapper in isa_device. Implement a replacement for haveseen_isadev - namely haveseen_ioport() which takes a port size as an extra argument for a proper range check. This (haveseen_ioport()) has not been tested, but I think it'll work.
This commit is contained in:
parent
1a738e4be7
commit
479232a2e7
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: isa_compat.c,v 1.6 1999/04/24 07:04:51 peter Exp $
|
||||
* $Id: isa_compat.c,v 1.7 1999/04/26 12:49:39 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -153,7 +153,8 @@ isa_compat_probe(device_t dev)
|
||||
dvp->id_msize = isa_get_msize(dev);
|
||||
dvp->id_unit = device_get_unit(dev);
|
||||
dvp->id_flags = isa_get_flags(dev);
|
||||
dvp->id_enabled = device_is_enabled(dev);
|
||||
dvp->id_enabled = device_is_enabled(dev); /* XXX unused */
|
||||
dvp->id_device = dev;
|
||||
|
||||
/*
|
||||
* Do the wrapped probe.
|
||||
@ -249,17 +250,30 @@ isa_wrap_old_drivers(void)
|
||||
driver->type = op->type;
|
||||
driver->softc = sizeof(struct isa_device);
|
||||
driver->priv = op->driver;
|
||||
if (op->driver->sensitive_hw)
|
||||
resource_set_int(op->driver->name, -1, "sensitive", 1);
|
||||
devclass_add_driver(isa_devclass, driver);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
haveseen_isadev(dvp, checkbits)
|
||||
struct isa_device *dvp;
|
||||
u_int checkbits;
|
||||
haveseen_iobase(struct isa_device *dvp, int size)
|
||||
{
|
||||
printf("haveseen_isadev() called - FIXME!\n");
|
||||
return 0;
|
||||
int rid;
|
||||
struct resource *res;
|
||||
device_t dev = dvp->id_device;
|
||||
int base = dvp->id_iobase;
|
||||
|
||||
/*
|
||||
* Ask for resource 1 so that we don't hurt our hints. In theory
|
||||
* this should work, but....
|
||||
*/
|
||||
rid = 1;
|
||||
res = bus_alloc_resource(dev, SYS_RES_IOPORT,
|
||||
&rid, base, base + size, size, RF_ACTIVE);
|
||||
if (res)
|
||||
bus_release_resource(dev, SYS_RES_IOPORT, rid, res);
|
||||
return res ? 0 : 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id: isa_device.h,v 1.59 1999/04/19 20:16:22 peter Exp $
|
||||
* $Id: isa_device.h,v 1.60 1999/04/21 07:26:28 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_ISA_ISA_DEVICE_H_
|
||||
@ -69,7 +69,6 @@ struct isa_device {
|
||||
#define id_ointr id_iu.id_oi
|
||||
int id_unit; /* unit number */
|
||||
int id_flags; /* flags */
|
||||
int id_scsiid; /* scsi id if needed */
|
||||
int id_alive; /* device is present */
|
||||
#define RI_FAST 1 /* fast interrupt handler */
|
||||
u_int id_ri_flags; /* flags for register_intr() */
|
||||
@ -77,18 +76,9 @@ struct isa_device {
|
||||
int id_enabled; /* is device enabled */
|
||||
int id_conflicts; /* we're allowed to conflict with things */
|
||||
struct isa_device *id_next; /* used in isa_devlist in userconfig() */
|
||||
struct device *id_device; /* new-bus wrapper device */
|
||||
};
|
||||
|
||||
/*
|
||||
* Bits to specify the type and amount of conflict checking.
|
||||
*/
|
||||
#define CC_ATTACH (1 << 0)
|
||||
#define CC_DRQ (1 << 1)
|
||||
#define CC_IOADDR (1 << 2)
|
||||
#define CC_IRQ (1 << 3)
|
||||
#define CC_MEMADDR (1 << 4)
|
||||
#define CC_QUIET (1 << 5)
|
||||
|
||||
/*
|
||||
* Per-driver structure.
|
||||
*
|
||||
@ -107,10 +97,9 @@ struct isa_driver {
|
||||
|
||||
#ifdef KERNEL
|
||||
|
||||
int haveseen_isadev __P((struct isa_device *dvp, u_int checkbits));
|
||||
int haveseen_iobase __P((struct isa_device *dvp, int iosize));
|
||||
void reconfig_isadev __P((struct isa_device *isdp, u_int *mp));
|
||||
int isa_compat_nextid __P((void));
|
||||
void isa_wrap_old_drivers __P((void));
|
||||
|
||||
#endif /* KERNEL */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user