Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Sep 1995 21:08:25 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        deischen@iworks.InterWorks.org, rgrimes@gndrsh.aac.dev.com
Cc:        FreeBSD-current@FreeBSD.Org
Subject:   Re: Getting around conflicts for a driver w/out base address
Message-ID:  <199509031108.VAA08130@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I've written an driver for an ISA device that does not have an IO base
>> address; it is strictly a memory mapped device.  What is the proper method
>> of informing the isa probes to not check the IO base address (id_iobase in
>> isa_device) for conflicts with other drivers?  The opposite holds true also;
>> when checking other ISA devices for IO base address conflicts, we want to
>> avoid that check with this device.

Just return -1 from the probe:

	-1: probe succeeded, i/o size is 0
	0: probe failed
	n > 0: probe succeeded, i/o size is n.

>> I can't test this out until I'm at work Tuesday, but this looks like what
>> I want to do.  Given that, what about placing a define in isa_device.h
>> for this:
>> 
>>   /*
>>    * Drivers that do not have IO base addresses should return this
>>    * in the probe routine.
>>    */
>>   #define ISA_NO_IOBASE  -1
>> 
>> or something like that.  That way it becomes apparent what a driver should
>> do.

It would be better to fix the interface (introduce an id_iosize field ...).
In in any case, it is more important to document the requirement to return
the i/o size for i/o mapped devices.  Many old little-used drivers still
do this wrong:

	ctx: memory mapped, returns 1.
	gpib: i/o mapped, returns 1.
	gsc: i/o mapped, returns PROBE_SUCCESS = 1.
	if_cx: memory mapped, returns 1.
	if_el: i/o mapped, returns 1.
	if_ie: various (?), some return 1.
	if_ze: OK, except it returns NULL for failure.
	if_zp: OK, except it returns NULL for failure.
	mse: i/o mapped, returns 1.
	seagate: memory mapped, returns 1.
	tw: i/o mapped, returns 1.

Several other drivers return 1 without appearing to know that this is the
i/o size and not just a status.

>Seems reasonable but I would like to see this passed by a few people, and
>not so sure about the location of the define or the need for ISA_ in the
>name of it, this is also applicable to EISA and MCA devices.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509031108.VAA08130>