How disable attachment of sio(4) driver to device?

John Baldwin jhb at freebsd.org
Fri Oct 21 09:38:03 PDT 2005


On Friday 21 October 2005 12:06 pm, M. Warner Losh wrote:
> In message: <200510210835.j9L8Zn2P001846 at pinky.frank-behrens.de>
>
>             "Frank Behrens" <frank at pinky.sax.de> writes:
> : I want to use the second port  with my driver. I had no luck with
> : hint.sio.1.disabled="1", but hint.sio.1.flags="0x40"
> : gave me the desired result:
> : sio1: reserved for low-level i/o
>
> Allocate the resources it uses, and sio can't probe.
>
> : One partly working workaround I found is to patch the sio driver. If
> : it does in DEVICE_PROBE(9) not return (0), but the value
> : BUS_PROBE_DEFAULT, then my driver has a chance to attach.
> : If my driver does not attach or another driver is loaded, the sio(4)
> : attaches again and I have lost. Then I see only a reboot as solution
> : to try my driver again.
>
> Right.  There's a weakness in the current scheme in that one can't
> rebid a device.  I've been working on some patches for that.  That's
> the real way to solve this problem.
>
> Another "soltution" is to not have sio in your kernel while you are
> debugging your driver.
>
> Another solution would be to have your driver use the tty layer
> instead of banging the hardware directly, if that is compatible with
> the goals of your driver.  This solution isn't in quotes because for
> some class of devices (say a keyboard driver for a sun or apple newton
> keyboard that does serial), it might be the right one.
>
> : I think I did miss some important information, e.g. I could not find
> : how the associations between PCI selectors (pciconf(8)) and device
> : numers are made and what to insert in device.hints to modify this
> : associations.
>
> There's no way to tie the plug and play location to a device instance
> at this time.

But you could hack the sio(4) driver to check its IO port and return ENXIO if 
it has a certain value, for example.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-hackers mailing list