Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2005 10:35:43 +0200
From:      "Frank Behrens" <frank@pinky.sax.de>
To:        freebsd-hackers@freebsd.org
Subject:   How disable attachment of sio(4) driver to device?
Message-ID:  <200510210835.j9L8Zn2P001846@pinky.frank-behrens.de>

next in thread | raw e-mail | index | archive | help
Hi,

I'm writing a device driver for UART with a protocol, that can not be 
handled by the default sio(4) driver. The driver works fine - the 
only problem I have is to disable the attachment of sio(4) driver to 
the device.

Example:
I'm using FreeBSD 6.0-BETA3 on a new machine with 2 UART interfaces 
on motherboard. I use the 1st port as console, it is initialialized 
as
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A, console

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

It looks fine, but now come my problems. When I load my driver a new 
ISA probe is executed. Now there is a sio4 or sio5 device, that is 
probed and because there are no hints to disable this, the sio(4) 
driver attaches to the port.

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.

Now comes my question: 
How can I disable permanently, that sio(4) attaches to a specified 
interface? 
In FreeBSD-4 it was very easy, I removed the line from kernel 
configuration file and it worked.
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.

Regards,
   Frank
-- 
Frank Behrens, Osterwieck, Germany
PGP-key 0x5B7C47ED on public servers available.




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