summaryrefslogtreecommitdiff
path: root/hardinfo2/devices.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2008-06-30 17:35:58 -0300
committerLeandro A. F. Pereira <leandro@hardinfo.org>2008-06-30 17:35:58 -0300
commit47c10af317faae9184d5d9e1f1f37c2913a16ef7 (patch)
tree51caf0f6eeacc1745092a744f0f27df3686972c1 /hardinfo2/devices.c
parent60a29a76b55ec3a075cc585f7bd707bc170afaf4 (diff)
Make "Resources" information a little more meaningful.
If the resource is claimed by a kernel module, use its description. If the resource is reserved by a PCI device, use its name.
Diffstat (limited to 'hardinfo2/devices.c')
-rw-r--r--hardinfo2/devices.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hardinfo2/devices.c b/hardinfo2/devices.c
index df57361d..df7277b1 100644
--- a/hardinfo2/devices.c
+++ b/hardinfo2/devices.c
@@ -170,6 +170,21 @@ gchar *get_processor_count(void)
return g_strdup_printf("%d", g_slist_length(processors));
}
+gchar *get_pci_device_description(gchar *pci_id)
+{
+ gchar *description;
+
+ if (!_pci_devices) {
+ scan_pci(FALSE);
+ }
+
+ if ((description = g_hash_table_lookup(_pci_devices, pci_id))) {
+ return g_strdup(description);
+ }
+
+ return NULL;
+}
+
ShellModuleMethod *hi_exported_methods(void)
{
static ShellModuleMethod m[] = {
@@ -178,6 +193,7 @@ ShellModuleMethod *hi_exported_methods(void)
{"getStorageDevices", get_storage_devices},
{"getPrinters", get_printers},
{"getInputDevices", get_input_devices},
+ {"getPCIDeviceDescription", get_pci_device_description},
{NULL}
};