Connection between struct pci_dev (probe) and struct dev (open) on 2.6 kernel
From: Jonathan Edwards (jonatha_at_qx.net)
Date: 02/27/05
- Next message: Pete Zaitcev (OTID3): "Re: sending urb to usb device"
- Previous message: Kasper Dupont: "Re: read vs fread"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 27 Feb 2005 17:31:41 -0500 To: greg@kroah.com
When a new PCI device is discovered (either at boot or after a
hotpluggable card is inserted), the system calls the "probe" entry point
in the appropriate driver and passes it a pointer to a struct pci_dev that
describes the new device. The pci_dev structure includes things like
which bus the device is on, what its vendor and device IDs are, etc.
When the device is opened later, the system calls the "open" entry point
inthe driver and passes it a pointer to a struct cdev for the new device.
The cdev structure includes the major and minor numbers for the device.
Somebody has to make the connection between a particular physical device
(described by the pci_dev structure) and a particular entry in the /dev
filesystem (descrbed by the major and minor numbers). It would seem to me
the driver would have to do that by calling cdev_add, and presumably the
point at which that would be done would be in the driver's "probe" entry
point.
What I can't figure out is how the "probe" entry point can tell the
major/minor to associate with a particular physical device. Any
suggestions would be greatly appreciated.
- Next message: Pete Zaitcev (OTID3): "Re: sending urb to usb device"
- Previous message: Kasper Dupont: "Re: read vs fread"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|