Re: how does kernel detects presence of a particular device

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

 



On Wed, Nov 3, 2010 at 8:16 AM, Tapas Mishra <mightydreams@xxxxxxxxx> wrote:
> As far as I understand once the probe function(Not too sure) detects
> or kernel detects then the driver would be looked up
> and control would be handed over to driver.
> If this is correct then how does probe works?

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.


>  Or how a particular
> device's presence on PCI bus is detected.
>
>
> --
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Anuj Aggarwal

Â.''`.
: :â :ÂÂ # apt-get install hakuna-matata
`. `'`
ÂÂ `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[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