From wollman@hergotha.lcs.mit.edu  Sun Mar 19 15:42:36 2000
Return-Path: <wollman@hergotha.lcs.mit.edu>
Received: from hergotha.lcs.mit.edu (wollman-bogus-56k.lcs.mit.edu [18.23.23.23])
	by hub.freebsd.org (Postfix) with ESMTP id AAF8D37B805
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Mar 2000 15:42:33 -0800 (PST)
	(envelope-from wollman@hergotha.lcs.mit.edu)
Received: (from wollman@localhost)
	by hergotha.lcs.mit.edu (8.9.3/8.9.3) id SAA00419;
	Sun, 19 Mar 2000 18:42:26 -0500 (EST)
	(envelope-from wollman)
Message-Id: <200003192342.SAA00419@hergotha.lcs.mit.edu>
Date: Sun, 19 Mar 2000 18:42:26 -0500 (EST)
From: Garrett Wollman <wollman@hergotha.lcs.mit.edu>
Reply-To: wollman@hergotha.lcs.mit.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: ppc driver does not accept PNP attachments
X-Send-Pr-Version: 3.2

>Number:         17495
>Category:       kern
>Synopsis:       ppc driver does not accept PNP attachments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 19 15:50:01 PST 2000
>Closed-Date:    Sat Apr 22 08:10:04 PDT 2000
>Last-Modified:  Sat Apr 22 08:10:38 PDT 2000
>Originator:     Garrett Wollman
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
MIT Laboratory for Computer Science
>Environment:

	-current as of a couple of days ago (world just built today)

>Description:

	The ppc (parallel printer controller) driver does not accept
	ISA PNP (and most importantly, PNPBIOS) attachments.

>How-To-Repeat:

	Configure `device ppc0' in your kernel.  Reboot.  Notice its absence.

>Fix:

Index: ppc.c
===================================================================
RCS file: /home/ncvs/src/sys/isa/ppc.c,v
retrieving revision 1.26
diff -u -r1.26 ppc.c
--- ppc.c	2000/01/29 14:02:30	1.26
+++ ppc.c	2000/03/19 23:31:57
@@ -1692,6 +1692,12 @@
 	return (ENXIO);
 }
 
+static struct isa_pnp_id lpc_ids[] = {
+	{ 0x0004d041, "Standard parallel printer port" }, /* PNP0400 */
+	{ 0x0104d041, "ECP parallel printer port" }, /* PNP0401 */
+	{ 0 }
+};
+
 static int
 ppc_probe(device_t dev)
 {
@@ -1703,14 +1709,13 @@
 	int error;
 	u_long port;
 
-	/* If we are a PNP device, abort.  Otherwise we attach to *everthing* */
-	if (isa_get_logicalid(dev))
-                return ENXIO;
-
 	parent = device_get_parent(dev);
 
-	/* XXX shall be set after detection */
-	device_set_desc(dev, "Parallel port");
+	error = ISA_PNP_PROBE(parent, dev, lpc_ids);
+	if (error == ENXIO)
+		return (ENXIO);
+	else if (error != 0)	/* XXX shall be set after detection */
+		device_set_desc(dev, "Parallel port");
 
 	/*
 	 * Allocate the ppc_data structure.



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->nsouch 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Mar 20 02:13:42 PST 2000 
Responsible-Changed-Why:  
Nicolas looks like this driver's maintainer. 
Responsible-Changed-From-To: nsouch->freebsd-bugs 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Mar 23 03:44:00 PST 2000 
Responsible-Changed-Why:  
Unfortunately, it would seem that the maintainer doesn't have time  
to be involved ATM. 
State-Changed-From-To: open->closed 
State-Changed-By: wollman 
State-Changed-When: Sat Apr 22 08:10:04 PDT 2000 
State-Changed-Why:  
Patch applied in rev. 1.27 of ppc.c. 
>Unformatted:
