public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFClue] pci_get_device, new driver model
@ 2005-10-07 16:18 William D Waddington
  2005-10-07 17:28 ` Alan Cox
  2005-10-07 21:45 ` Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: William D Waddington @ 2005-10-07 16:18 UTC (permalink / raw)
  To: linux-kernel

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@beezmo.com
--------------------------------------------
"Even bugs...are unexpected signposts on
the long road of creativity..." - Ken Burtch



^ permalink raw reply	[flat|nested] 8+ messages in thread
* [RFClue] pci_get_device, new driver model
@ 2005-10-07 15:56 William D Waddington
  0 siblings, 0 replies; 8+ messages in thread
From: William D Waddington @ 2005-10-07 15:56 UTC (permalink / raw)
  To: linux-kernel

I'm missing something fundamental, and beg your indulgence.

My current 2.6 drivers support multiple indentical PCI boards.
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.




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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-10-07 22:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-07 16:18 [RFClue] pci_get_device, new driver model William D Waddington
2005-10-07 17:28 ` Alan Cox
2005-10-07 17:18   ` William D Waddington
2005-10-07 18:36     ` Alan Cox
2005-10-07 21:45 ` Greg KH
2005-10-07 22:03   ` Greg KH
2005-10-07 22:04     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2005-10-07 15:56 William D Waddington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox