RE: Putting PCI-class/vendor/deviceinfo into source of PCI-driver

Bret Indrelee (bindrelee@sbs-cp.com)
Mon, 29 Nov 1999 11:03:23 -0600


Magnus Damm [mailto:damm@kieraypc01.p.y.ki.era.ericsson.se] wrote:
[ snippity do-dah ]
> > Couple of ways to do the detection:
> >
> > 1. The device driver has an external configuration file
> that creates the
> > link between vendor/device id/sub-vendor/sub-device-id and
> the driver to
> > handle that. A varient of insmod searchs this file to
> determine which driver
> > to load when it detects a new device.
>
> I am with you.
>
> > The driver just concatenates it's declaration on the end of
> the existing file.
>
> Sorry, I don't understand what declaration / file you mean.

OK, here is an example based on Solaris:

You have an /etc/devlink.tab file.

A device driver would have a file something like:
type=ddi_pseudo;name=pci108a,1 \M0
type=ddi_pseudo;name=pci108a,2 \M0
type=ddi_pseudo;name=pci108a,3 \M0
type=ddi_pseudo;name=SBSE,NanoBus \M0

And if a grep for "name=pci108a,1" failed, they would
cat my_devlink.tab >>etc/devlink.tab

Then you do:
add_drv -i '"pci108a,1" "SBSE,NanoBus"' btp

It automatically looks for an executable btp and configuration btp.conf file
in /kernel/drv/.

The file /etc/system allows you to add a line like "forceload: drv/btp" to
force the driver to load.

Permissions are given on the add_drv line.

That is how Solaris basically does it.

I would suggest it is probably easier to just have the /etc/devlink file
allow you to parse a PCI vendor,device,sub-vendor,sub-device and associate a
driver file with it.

Something like:
pci 108a,1 btp "SBS Technologies, Inc PCI to VMEbus Adapter"

Format is:
pci
^- bus type
108a,1
^- vendor,device, optional sub-vendor and sub-device
btp
^- driver name, with an assumed default location. Installation program looks
for both the driver configuration file (btp.conf) and the driver (btp.o) in
the same location.
"SBS Technologies, Inc PCI to VMEbus Adapter"
^- verbose text string defining exactly what the device is.

Make sure you define some sort of comment character for the file, so that
people can add notes where necessary.

Hopefully this makes it lots clearer.

[ snippity day ]

-Bret

-------------------------------------------------------------
SBS Technologies, Connectivity Products
... solutions for real-time connectivity

Bret Indrelee, Engineer
SBS Technologies, Inc., Connectivity Products
1284 Corporate Center Drive, St. Paul MN 55121
Direct: (651) 905-4731
Main: (651) 905-4700 Fax: (651) 905-4701
E-mail: bindrelee@sbs-cp.com http://www.sbs.com
-------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/