PCI Device list

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

 



I am trying to list of the pci devices of type storage, for which I have following code,
the code does not find any device. I was expecting to see hard disk and/or drives. What am I doing
wrong.

struct pci_dev *disk=NULL;
while (1)
   {
    if ((disk = pci_find_class(PCI_BASE_CLASS_STORAGE, disk)) == NULL)
       {
        printk("End of storage devices\n");
        break;
       }
    else
       {
        pci_read_config_word(disk, PCI_VENDOR_ID, &vid);
        pci_read_config_word(disk, PCI_DEVICE_ID, &did);
        printk("Vendor id = %d, Device id = %x\n", vid, did);
        printk("Class = %d\n", disk->class);
       }
}

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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