diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-14 12:32:43 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-14 12:32:43 +0000 |
commit | 4fcbd8f87cab61e77ce04d958991ca59604b7e86 (patch) | |
tree | 8a087c2c5eba1cac85556d307daad7304efd6e96 /lspcidrake.c | |
parent | 869c403c497d881a099e401ebd9e3f3db0f75599 (diff) | |
download | ldetect-4fcbd8f87cab61e77ce04d958991ca59604b7e86.tar ldetect-4fcbd8f87cab61e77ce04d958991ca59604b7e86.tar.gz ldetect-4fcbd8f87cab61e77ce04d958991ca59604b7e86.tar.bz2 ldetect-4fcbd8f87cab61e77ce04d958991ca59604b7e86.tar.xz ldetect-4fcbd8f87cab61e77ce04d958991ca59604b7e86.zip |
add dmitable use
Diffstat (limited to 'lspcidrake.c')
-rw-r--r-- | lspcidrake.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lspcidrake.c b/lspcidrake.c index e1026a7..c398aa1 100644 --- a/lspcidrake.c +++ b/lspcidrake.c @@ -44,6 +44,11 @@ static void print_usb_class(unsigned long class_) { } } +static void print_dmi_entries(struct dmi_entries entries) { + unsigned int i; + for (i = 0; i < entries.nb; i++) + printf("%-16s: %s\n", entries.entries[i].module, entries.entries[i].constraints); +} int main(int argc, char **argv) { char ** ptr = argv; @@ -54,6 +59,7 @@ int main(int argc, char **argv) { "-p <file>: pci devices source [/proc/bus/pci/devices by default]\n" "-u <file>: usb devices source [/proc/bus/usb/devices by default]\n" "-v : verbose mode [print ids and sub-ids], implies full probe\n" + "--dmidecode <file>: to use this dmidecode output instead of calling dmidecode\n" ); return 0; } @@ -63,10 +69,17 @@ int main(int argc, char **argv) { proc_usb_path = *++ptr; else if (!strcmp(*ptr, "-p")) proc_pci_path = *++ptr; + else if (!strcmp(*ptr, "--dmidecode")) + dmidecode_file = *++ptr; ptr++; } printit(pci_probe(), print_pci_class); printit(usb_probe(), print_usb_class); + + struct dmi_entries dmi_entries = dmi_probe(); + print_dmi_entries(dmi_entries); + free_dmi_entries(dmi_entries); + return 0; } |