From 47c10af317faae9184d5d9e1f1f37c2913a16ef7 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Mon, 30 Jun 2008 17:35:58 -0300 Subject: 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. --- hardinfo2/devices.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'hardinfo2/devices.c') 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} }; -- cgit v1.2.3