[RFClue] pci_get_device, new driver model

From: William D Waddington
Date: Fri Oct 07 2005 - 11:19:10 EST


CRAP, I think this one got sent when half written - sorry about that.

I'm missing something fundamental, and beg your indulgence. Read LDD 3,
googled, and looked around in the code (but not in the right places...)

My current 2.6 drivers support multiple identical PCI boards per host.
The init code spins on pci_find_device and assigns instance/minor
numbers as boards are found. Load script insmods the driver,
gets the major # from /proc/devices, and creates the /dev/ entries
on the fly.

If I convert to pci_get_device, it looks like subsequent calls in the
loop "put" the previously "gotten" device. I need the pci_dev struct
to persist for later use (DMA, etc). Do I take an additional bump to
the ref count for each board found before looping, and "put" each when
the driver is unloaded?

If I just give in to the new driver model how/when do I associate
instance/minor numbers with boards found? Is it ever possible for
ordinary PCI boards to be (logically) removed and re-added w/out
removing the driver? If so, how to maintain association between
a particular board and minor number?

I don't have any control over the tools available on the user's
target host.

Pointers to code supporting multiple boards per driver would be
very helpful.

Not subscribed but lurking. Thanks,
Bill
--
--------------------------------------------
William D Waddington
Bainbridge Island, WA, USA
william.waddington@xxxxxxxxxx
--------------------------------------------
"Even bugs...are unexpected signposts on
the long road of creativity..." - Ken Burtch


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