Subject: Re: Driver to device bindings
To: Mike M. Volokhov <>
From: Jochen Kunz <>
List: tech-kern
Date: 12/26/2003 13:23:36
On Fri, 26 Dec 2003 10:09:53 +0200
"Mike M. Volokhov" <> wrote:

> Let say I have some device (for example, NIC) and it is newest clone
> of some other well known NIC. This means, I have a drivers for it, but
> config_match() is not recognizes my NIC (please correct me if I am
> wrong).=20
Depends on the bus the hardware is sitting on and how the match routine
woks. E.g. if it is some QBus or plain ISA device and the match routine
probes the device by reading / writing IO registers and testing them for
speciffic bit patterns, then the device will be recognized.

But I think it is much more likely that you are talking about a PCI
device. ;-) Device matching on PCI is done via hardware supplied, unique
vendor- and device-IDs. The match routine gets the IDs of instaled PCI
cards from the bus driver in the attach arguments. It compares the IDs
with a list of IDs of devices supported by this driver. The list of
supported devices (device IDs) is hard coded in the PCI bus frontend.
See src/sys/dev/pci/{if_tlp_pci.c,if_fxp_pci.c}.

ISAPNP has a table where you can map a speciffic device to a generic
driver. See src/sys/dev/isapnp/isapnpdevs.

> So, is it possible to specify in my kernel config to bind some
> driver to that device?
I case of PCI: You would have to extend the list of supported IDs in the
drivers match routine / PCI bus frontend.