Re: how is a device detected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 22, 2010 at 11:45 PM, Rolf Eike Beer <eike-kernel@xxxxxxxxx> wrote:
>
> The basic idea is like this:
>
> The kernels PCI core scan through all PCI busses it found, collecting a list
> of devices. These are determined by reading the PCI config space of the
> corresponding hardware devices.
Ok this is the part I want to read in the kernel code (As Greg pointed above)
which part exactly or what files inside the kernels I should be
reading to understand this part?

> Now that he knows for example there is a device with the vendor id 0x8086
> (Intel) and device id 0x1234 (randomly chosen).
I think this will happen only once the config space of all devices has
been scanned via the kernel

>Now the kernel looks if any
> already loaded driver said "hey, I take this combination". If it doesn't find
> one it will look into the modules.alias file (which is in /lib/modules/$(uname
> -r) and is created by depmod) if there is any driver that claims to be
> responsible for this device. If yes, then the corresponding module is loaded.
So that way the users of Linux systems when they install Linux they
must be running a lot of such other modules
which might not be required.Because the Linux Kernel the is shipped on
CDROMs contains all the drivers because you do not know
prior as on which hardware the ISO would be used to install Linux.
I have read linuxrc script of Suse Linux and also usbfs utility.
Is this understanding of mine correct.
> If a driver is found by any way the kernel will allocate a struct pci_dev and
> pass your drivers probe function (which you declare in your struct pci_driver)
> a pointer to this device. Now you know that a device you feel responsible for
> exists.
Right then the things are taken care by the driver.
Not a big deal.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux