Subject: kern/10025: pciide should display revision ID's like most drivers
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 05/01/2000 05:39:08
>Number:         10025
>Category:       kern
>Synopsis:       pciide should display revision ID's like most drivers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 01 05:40:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Dave Sainty
>Release:        Recent NetBSD-current
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Environment:
System: NetBSD tequila.dave.dtsp.co.nz 1.4R NetBSD 1.4R (TEQUILA) #3: Wed Feb 16 20:01:31 NZDT 2000 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userB/u2/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386


>Description:
	The pciide driver does not display the PCI function revision if the
	device is recognised.  This can be a nuisance if you want to know
	it...

>How-To-Repeat:
	Boot a machine with a PCI IDE interface.
>Fix:

--- src/sys/dev/pci/pciide.c.orig	Sun Apr  2 10:40:25 2000
+++ src/sys/dev/pci/pciide.c	Tue May  2 00:27:13 2000
@@ -463,16 +463,18 @@
 	struct pciide_softc *sc = (struct pciide_softc *)self;
 	pcireg_t csr;
 	char devinfo[256];
+	const char *displaydev;
 
 	sc->sc_pp = pciide_lookup_product(pa->pa_id);
 	if (sc->sc_pp == NULL) {
 		sc->sc_pp = &default_product_desc;
 		pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
-		printf(": %s (rev. 0x%02x)\n", devinfo,
-		    PCI_REVISION(pa->pa_class));
-	} else {
-		printf(": %s\n", sc->sc_pp->ide_name);
-	}
+		displaydev = devinfo;
+	} else
+		displaydev = sc->sc_pp->ide_name;
+
+	printf(": %s (rev. 0x%02x)\n", displaydev, PCI_REVISION(pa->pa_class));
+
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_tag = pa->pa_tag;
 #ifdef WDCDEBUG

>Release-Note:
>Audit-Trail:
>Unformatted: