Re: how does kernel detects presence of a particular device

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

 



2010/11/3 àààà <anuj01@xxxxxxxxx>:
>
> Simply, whenever either a device or driver is registered with the bus,
> then probe function of matching driver is called by the bus subsystem.
>
> Refer : http://lxr.linux.no/#linux+v2.6.36/Documentation/PCI/pci.txt
>
>    probe        This probing function gets called (during execution
> Â88 Â Â Â Â Â Â Â Â Â Â Â Âof pci_register_driver() for already existing
> Â89 Â Â Â Â Â Â Â Â Â Â Â Âdevices or later if a new device gets inserted) for
> Â90 Â Â Â Â Â Â Â Â Â Â Â Âall PCI devices which match the ID table and are not
> Â91 Â Â Â Â Â Â Â Â Â Â Â Â"owned" by the other drivers yet. This function gets
> Â92 Â Â Â Â Â Â Â Â Â Â Â Âpassed a "struct pci_dev *" for each device whose
> Â93 Â Â Â Â Â Â Â Â Â Â Â Âentry in the ID table matches the device. The probe
> Â94 Â Â Â Â Â Â Â Â Â Â Â Âfunction returns zero when the driver chooses to
> Â95 Â Â Â Â Â Â Â Â Â Â Â Âtake "ownership" of the device or an error code
> Â96 Â Â Â Â Â Â Â Â Â Â Â Â(negative number) otherwise.
> Â97 Â Â Â Â Â Â Â Â Â Â Â ÂThe probe function always gets called from process
> Â98 Â Â Â Â Â Â Â Â Â Â Â Âcontext, so it can sleep.
>
That links talks about WHAT is done.
"As pci_register_driver() looks for existing devices or which match
the ID table and not owned by id table."

I am looking for HOW it is done.
I am not in a position to understand the source code right now.So I asked list.
I had read that doc before posting here.
ÿô.nlj·Ÿ®‰­†+%ŠË±éw¦j)pŠØº{.nlj·¤z¹Þw°n'¬þÚqªíçbžì¸•æ·švضm§ÿÿ‘êYÞ¸ž³ú



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux