From bc7b1d623cad00662d602303d5ee699cc08538a3 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 24 Mar 2002 12:14:40 +0000 Subject: [PATCH] (pci_lookup_name): When printing unknown subsystem vendor or device hexadecimally, don't confuse it with chip vendor/device ID. First reported by Marc Boucher . --- ChangeLog | 9 +++++++++ lib/names.c | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac5f923..72706ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-03-24 Martin Mares + + * lib/filter.c (pci_filter_parse_slot): Allow bus 0xff, slot 0x1f and + function 7. + + * lib/names.c (pci_lookup_name): When printing unknown subsystem vendor + or device hexadecimally, don't confuse it with chip vendor/device ID. + First reported by Marc Boucher . + 2001-11-04 Martin Mares * pci.ids: Synced with the PCI ID Repository at SourceForge diff --git a/lib/names.c b/lib/names.c index 704013f..896f7c1 100644 --- a/lib/names.c +++ b/lib/names.c @@ -1,9 +1,9 @@ /* - * $Id: names.c,v 1.6 2000/04/29 12:56:23 mj Exp $ + * $Id: names.c,v 1.7 2002/03/24 12:14:40 mj Exp $ * * The PCI Library -- ID to Name Translation * - * Copyright (c) 1997--2000 Martin Mares + * Copyright (c) 1997--2002 Martin Mares * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -284,7 +284,7 @@ pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, u32 arg1, if (n = nl_lookup(a, num, NL_VENDOR, arg3, 0, 0, 0)) return n->name; else - res = snprintf(buf, size, "%04x", arg1); + res = snprintf(buf, size, "%04x", arg2); break; case PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM: if (n = nl_lookup(a, num, NL_SUBSYSTEM, arg1, arg2, arg3, arg4)) @@ -292,7 +292,7 @@ pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, u32 arg1, else if (arg1 == arg3 && arg2 == arg4 && (n = nl_lookup(a, num, NL_DEVICE, arg1, arg2, 0, 0))) return n->name; else - res = snprintf(buf, size, "%04x", arg2); + res = snprintf(buf, size, "%04x", arg4); break; case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM: if (!num) -- 2.39.2