linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: david.hagood@gmail.com
To: "Carlos Roberto Moratelli" <carlos.moratelli@digitel.com.br>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: Doubt about Linux PCIe infraestructure
Date: Tue, 28 Sep 2010 09:20:24 -0500	[thread overview]
Message-ID: <e7c7327df154359eb271364b5b579a52.squirrel@localhost> (raw)
In-Reply-To: <1285672565.6920.3.camel@parana.digitel.com.br>

> 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 */

      parent reply	other threads:[~2010-09-28 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7c7327df154359eb271364b5b579a52.squirrel@localhost \
    --to=david.hagood@gmail.com \
    --cc=carlos.moratelli@digitel.com.br \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).