From 7bed2d831570c565a973c92ae5784b2c4c57ebe7 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 21 Jun 1999 20:17:13 +0000 Subject: [PATCH] When device ID lookup fails, return hexadecimal device ID instead of vendor ID. Well spotted by Axel Bodemann , I've just extended the fix to subsystem ID's. --- ChangeLog | 7 +++++++ lib/names.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb5a3b7..308ee8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Jun 21 22:11:10 1999 Martin Mares + + * lib/names.c (pci_lookup_name): When device ID lookup + fails, return hexadecimal device ID instead of vendor ID. + Well spotted by Axel Bodemann , + I've just extended the fix to subsystem ID's. + Thu Jun 17 19:48:21 1999 Martin Mares * lspci.c (show_agp): Bug fix from Petr Vandrovec diff --git a/lib/names.c b/lib/names.c index e18e47f..a052f4b 100644 --- a/lib/names.c +++ b/lib/names.c @@ -1,5 +1,5 @@ /* - * $Id: names.c,v 1.1 1999/01/22 21:05:33 mj Exp $ + * $Id: names.c,v 1.2 1999/06/21 20:17:19 mj Exp $ * * The PCI Library -- ID to Name Translation * @@ -254,7 +254,7 @@ pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, u32 arg1, if (n = nl_lookup(a, num, NL_DEVICE, arg1, arg2)) return n->name; else - res = snprintf(buf, size, "%04x", arg1); + res = snprintf(buf, size, "%04x", arg2); break; case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE: res = compound_name(a, num, buf, size, NL_VENDOR, arg1, arg2); @@ -269,7 +269,7 @@ pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, u32 arg1, if (n = nl_lookup(a, num, NL_SUBSYSTEM_DEVICE, arg1, arg2)) return n->name; else - res = snprintf(buf, size, "%04x", arg1); + res = snprintf(buf, size, "%04x", arg2); break; case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM: res = compound_name(a, num, buf, size, NL_SUBSYSTEM_VENDOR, arg1, arg2); -- 2.39.2