searching for pci busses

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

 



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).
I have this code for the time being:

static struct pci_device_id ids[] = {
    { PCI_DEVICE(0x1234, 0x4321) },
    /* ... whatever ... */
    { 0 }
};

for (id = ids; id->vendor; id++) {
  d = pci_get_device(id->vendor, id->device, NULL);
  if (d != NULL) {
    /* get some info */
    pci_dev_put(d);
    break;
  }
}

I'm searching for a bus or something, which is only one in the system, but would
be made by more vendors.
Simply, something like pci_dev_present(), but with a result of pci_dev or index
of the raw in the ids table corresponding to the found device (instead of
returning 0/1).

thanks,
-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   [email protected]   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E
-
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