Re: Multi-function PCI devices

Jeff Garzik
2001-04-07T08:58:21Z

Michael Reinelt wrote:
> I've got a problem with my communication card: It's a PCI card with a
> NetMos chip, and it provides two serial and one parallel port. It's not
> officially supported by the linux kernel, so I wrote my own patch and
> sent it to the parallel, serial and pci maintainer. The patch itself is
> basically an extension of the pci id tables; and I hope it's in the
> queue for the official kernel.

Where is this patch available? I haven't heard of an extension to the
pci id tables, so I wonder if it's really in the queue for the official
kernel.

> The card shows up on the PCI bus as one device. For the card provides
> both serial and parallel ports, it will be driven by two subsystems, the
> serial and the parallel driver.
[...]
> pci_announce_device() will be called only if there's no other driver
> claiming the device. This explains why either the parallel or the serial
> port will be detected: The first driver loaded will see the device, the
> next drivers won't.
>
> I'm afraid this is not a bug, but a design issue, and will be hard to
> solve. Maybe we need a flag for such devices which allows it to be
> claimed ba more thean one driver?

Not so hard.

There is no need to register more than one driver per PCI device -- just
create a PCI driver whose probe routine registers serial and parallel,
and whose remove routine unregisters same.

Jeff

--
Jeff Garzik | Sam: "Mind if I drive?"
Building 1024 | Max: "Not if you don't mind me clawing at the dash
MandrakeSoft | and shrieking like a cheerleader."