aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch/linux/common/modules.h
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/arch/linux/common/modules.h
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/arch/linux/common/modules.h')
-rw-r--r--hardinfo2/arch/linux/common/modules.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/hardinfo2/arch/linux/common/modules.h b/hardinfo2/arch/linux/common/modules.h
index 46f73d2f..32c9c0d6 100644
--- a/hardinfo2/arch/linux/common/modules.h
+++ b/hardinfo2/arch/linux/common/modules.h
@@ -29,12 +29,18 @@ remove_module_devices(gpointer key, gpointer value, gpointer data)
return g_str_has_prefix(key, "MOD");
}
+static GHashTable *_module_hash_table = NULL;
+
static void
scan_modules_do(void)
{
FILE *lsmod;
gchar buffer[1024];
+ if (!_module_hash_table) {
+ _module_hash_table = g_hash_table_new(g_str_hash, g_str_equal);
+ }
+
if (module_list) {
g_free(module_list);
}
@@ -95,7 +101,15 @@ scan_modules_do(void)
if (description && g_str_equal(description, "&lt;none&gt;")) {
g_free(description);
description = g_strdup("");
- }
+
+ g_hash_table_insert(_module_hash_table,
+ g_strdup(modname),
+ g_strdup_printf("Kernel module (%s)", modname));
+ } else {
+ g_hash_table_insert(_module_hash_table,
+ g_strdup(modname),
+ g_strdup(description));
+ }
/* append this module to the list of modules */
module_list = h_strdup_cprintf("$%s$%s=%s\n",