#define PCI_FILL_EXT_CAPS 128
#define PCI_FILL_PHYS_SLOT 256
#define PCI_FILL_MODULE_ALIAS 512
+#define PCI_FILL_LABEL 1024
#define PCI_FILL_RESCAN 0x10000
void pci_setup_cache(struct pci_dev *, u8 *cache, int len) PCI_ABI;
static void sysfs_scan(struct pci_access *a)
{
- char dirname[1024], buf[OBJBUFSIZE];
+ char dirname[1024];
DIR *dir;
struct dirent *entry;
int n;
d->vendor_id = sysfs_get_value(d, "vendor");
d->device_id = sysfs_get_value(d, "device");
d->device_class = sysfs_get_value(d, "class") >> 8;
- if (sysfs_get_string(d, "label", buf, 0))
- d->label = pci_strdup(d->access, buf);
-
d->known_fields = PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES;
}
pci_link_dev(a, d);
d->module_alias = pci_strdup(d->access, buf);
}
+ if ((flags & PCI_FILL_LABEL) && !(d->known_fields & PCI_FILL_LABEL))
+ {
+ char buf[OBJBUFSIZE];
+ if (sysfs_get_string(d, "label", buf, 0))
+ d->label = pci_strdup(d->access, buf);
+ }
+
return pci_generic_fill_info(d, flags);
}
d->config_cached += 64;
}
pci_setup_cache(p, d->config, d->config_cached);
- pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES | PCI_FILL_PHYS_SLOT);
+ pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES | PCI_FILL_PHYS_SLOT | PCI_FILL_LABEL);
return d;
}