Re: searching for pci busses

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

 



On 5/30/06, Greg KH <[email protected]> wrote:
On Mon, May 29, 2006 at 05:59:39PM -0400, Jeff Garzik wrote:
> Greg KH wrote:
> >On Sun, May 28, 2006 at 01:12:26AM +0159, Jiri Slaby wrote:
> >>Hello,
> >>
> >>I want to ask, if there is any function to call (as we debated with
> >>Jeff), which
> >>does something like this:
> >>1) I have some vendor/device ids in table
> >>2) I want to traverse raws of the table and compare to system devices,
> >>and if
> >>found, stop and return pci_dev struct (or raw in the table).
> >
> >What's wrong with pci_match_id()?
> >
> >Or just using the pci_register_driver() function properly, which handles
> >all of this logic for you?
>
> These aren't PCI devices proper.  These are embedded non-PCI devices,
> which must search for an unrelated PCI device to figure out what type of
> platform they are on.

Ok, then use pci_match_id() or pci_get_device().

This is how DRM does it...

       for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) {
               pid = (struct pci_device_id *)&driver->pci_driver.id_table[i];

               pdev = NULL;
               /* pass back in pdev to account for multiple identical cards */
               while ((pdev =
                       pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
                                      pid->subdevice, pdev)) != NULL) {
                       /* stealth mode requires a manual probe */
                       pci_dev_get(pdev);
                       drm_get_dev(pdev, pid, driver);
               }
       }
       return 0;


--
Jon Smirl
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux