linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Doubt about Linux PCIe infraestructure
@ 2010-09-28 11:16 Carlos Roberto Moratelli
  2010-09-28 13:46 ` Micha Nelissen
  2010-09-28 14:20 ` david.hagood
  0 siblings, 2 replies; 3+ messages in thread
From: Carlos Roberto Moratelli @ 2010-09-28 11:16 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

I have a simple doubt about linux PCI/PCIe infraestructure.  

When I register a PCI driver using pci_register_driver() will the 
probe function be automatically called or will it just be called if PCI 
infraestructure match a Vendor and Device id on bus?

I am loading a PCI driver that register itself using 
pci_register_driver() but the probe function isn't called.

thanks,

Carlos R. Moratelli

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

* Re: Doubt about Linux PCIe infraestructure
  2010-09-28 11:16 Doubt about Linux PCIe infraestructure Carlos Roberto Moratelli
@ 2010-09-28 13:46 ` Micha Nelissen
  2010-09-28 14:20 ` david.hagood
  1 sibling, 0 replies; 3+ messages in thread
From: Micha Nelissen @ 2010-09-28 13:46 UTC (permalink / raw)
  To: Carlos Roberto Moratelli; +Cc: linuxppc-dev

Carlos Roberto Moratelli wrote:
> When I register a PCI driver using pci_register_driver() will the 
> probe function be automatically called or will it just be called if PCI 
> infraestructure match a Vendor and Device id on bus?

Yes, vendor and device id must match. You can find those in lspci.

Micha

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

* Re: Doubt about Linux PCIe infraestructure
  2010-09-28 11:16 Doubt about Linux PCIe infraestructure Carlos Roberto Moratelli
  2010-09-28 13:46 ` Micha Nelissen
@ 2010-09-28 14:20 ` david.hagood
  1 sibling, 0 replies; 3+ messages in thread
From: david.hagood @ 2010-09-28 14:20 UTC (permalink / raw)
  To: Carlos Roberto Moratelli; +Cc: linuxppc-dev

> Hi,
>
> I have a simple doubt about linux PCI/PCIe infraestructure.
>
> When I register a PCI driver using pci_register_driver() will the
> probe function be automatically called or will it just be called if PCI
> infraestructure match a Vendor and Device id on bus?
When you register your driver, you supply a list of VID/DID pairs for
which your driver is applicable, and if those devices are on the bus, your
probe will be called.

>
> I am loading a PCI driver that register itself using
> pci_register_driver() but the probe function isn't called.
>
If you didn't indicate your driver was for the VID/DID of the device, your
probe won't be called - why should it? As far as you told the kernel,
there's no hardware pertaining to your driver.

The old days of "every driver probes every device" are gone.

Here's an example code fragment:

/* define the list of devices we support */
static struct pci_device_id ppc_ep_device_ids[] =
{
      {PCI_DEVICE(PCI_VENDOR_ID_FREESCALE,PCI_DEVICE_ID_MPC8641D)},
      {0} /* end of list indicator */
};
MODULE_DEVICE_TABLE(pci, ppc_ep_device_ids); /* tell udev to load our
module for these devices */

pci_register_driver(&ppc_ep_device_driver); /* tell the kernel we handle
these devices */

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

end of thread, other threads:[~2010-09-28 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-28 11:16 Doubt about Linux PCIe infraestructure Carlos Roberto Moratelli
2010-09-28 13:46 ` Micha Nelissen
2010-09-28 14:20 ` david.hagood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).