aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-02-25 21:52:40 +0100
committerH. Peter Anvin <hpa@linux.intel.com>2009-02-26 13:25:25 -0800
commitdb3d9fd124f8971e38fb8b44b83f9d739b10ef7e (patch)
treee22f4a2726f737df7937b640a039ff082b67e77d
parent6d95a9c6ce277173f8cfbc70772fd93a2a41cd66 (diff)
downloadsyslinux-elf-db3d9fd124f8971e38fb8b44b83f9d739b10ef7e.tar.gz
syslinux-elf-db3d9fd124f8971e38fb8b44b83f9d739b10ef7e.tar.xz
syslinux-elf-db3d9fd124f8971e38fb8b44b83f9d739b10ef7e.zip
hdt: PCI: Adding category
-rw-r--r--com32/include/sys/pci.h4
-rw-r--r--com32/lib/pci/scan.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h
index feab9e82..374ccf89 100644
--- a/com32/include/sys/pci.h
+++ b/com32/include/sys/pci.h
@@ -12,6 +12,7 @@
#define PCI_PRODUCT_NAME_SIZE 256
#define PCI_CLASS_NAME_SIZE 256
#define MAX_KERNEL_MODULES_PER_PCI_DEVICE 10
+#define MAX_PCI_CLASSES 256
typedef uint32_t pciaddr_t;
@@ -27,7 +28,8 @@ struct pci_dev_info {
char product_name[PCI_PRODUCT_NAME_SIZE];
char linux_kernel_module[LINUX_KERNEL_MODULE_SIZE][MAX_KERNEL_MODULES_PER_PCI_DEVICE];
int linux_kernel_module_count;
- char class_name[PCI_CLASS_NAME_SIZE];
+ char class_name[PCI_CLASS_NAME_SIZE]; /* The most precise class name */
+ char category_name[PCI_CLASS_NAME_SIZE]; /*The general category*/
};
/* PCI device (really, function) */
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index d7c189f8..598ca9b4 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -216,8 +216,11 @@ int get_class_name_from_pci_ids(struct pci_domain *domain)
int int_class_id_str=hex_to_int(class_id_str);
/* assign the class_name to any matching pci device */
for_each_pci_func(dev, domain) {
- if (int_class_id_str == dev->class[2])
+ if (int_class_id_str == dev->class[2]) {
strlcpy(dev->dev_info->class_name,class_name,PCI_CLASS_NAME_SIZE-1);
+ /* This value is usually the main category*/
+ strlcpy(dev->dev_info->category_name,class_name+4,PCI_CLASS_NAME_SIZE-1);
+ }
}
/* if we have a tab + a char, it means this is a sub class name */
} else if ((line[0] == '\t') && (line[1] != '\t')) {