Subject: kern/5207: pcmcia autoconfiguration printouts need some cleanup
To: None <>
From: None <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 03/25/1998 22:33:27
>Number:         5207
>Category:       kern
>Synopsis:       pcmcia autoconfiguration printouts need some cleanup
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 25 22:35:03 1998
>Originator:     Chris G. Demetriou
Kernel Hackers 'r' Us
>Release:        NetBSD-current as of Wed Mar 25 21:19:14 PST 1998
System: NetBSD 1.3E NetBSD 1.3E (BRICK) #47: Sun Mar 22 15:13:37 PST 1998 i386

	PCMCIA autoconfiguration printfs need some cleanup.

	Here are some example printfs, taken from my laptop:

	pcic0: controller 0 (Intel 82365SL Revision 1) has sockets A and B
	pcmcia0 at pcic0 controller 0 socket 0
	ep0 at pcmcia0 function 0pcmcia0: card irq 7
	 port 0x330-0x33f: 3Com 3C589 Ethernet
	ep0: MAC address 00:60:97:8c:fd:37
	ep0: 8KB byte-wide FIFO, 5:3 Rx:Tx split, utp/aui/bnc (default utp)
	pcmcia1 at pcic0 controller 0 socket 1
	com3 at pcmcia1 function 0pcmcia1: card irq 7
	 port 0x2f8-0x2ff: ns16550a, working fifo

	There are a couple of problems here:

	(1) the port printf is bogus.  autoconfiguration messages are
	    supposed to look like:

		<devname><devunit> at <busname><busunit>[ <loc> <val>]*: ...
		<devname><devunit>: ...

	    The bits before the : on the first line for a device
	    should be pasteable directly into a kernel configuration
	    file.  That means that locator-ish values which aren't
	    actually locators shouldn't appear there.  (Note that
	    'port' isn't a locator for PCMCIA devices, and should not
	    be, at least in my opinion.)

	    The code itself seems to understand that that printf is bogus.
	    It (i82365.c) says:

		/* XXX wtf is this doing here? */

		printf(" port 0x%lx", (u_long) ioaddr);
		if (size > 1) 
			printf("-0x%lx", (u_long) ioaddr + (u_long) size - 1);

	    This is actually a 'bug'.

	    The port printfs should be done separately, kind of like the
	    way the IRQ usage printfs are done, but...

	(2) The card irq usage printfs break up the rest of the output
	    in a way that's ugly and which messes up the pasting thing
	    mentioned above.  8-)  The code should be adjusted so that
	    the IRQ allocation printfs happen in better places.

	Boot a system with PCMCIA devices, using a kernel which supports
	those devices.

	Clean up the output.  A simple matter of programming!  8-)