Subject: port-mac68k/10557: config prints old addr of ADB device instead of current
To: None <>
From: Dave Huang <>
List: netbsd-bugs
Date: 07/10/2000 08:31:13
>Number:         10557
>Category:       port-mac68k
>Synopsis:       config prints old addr of ADB device instead of current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-mac68k-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 10 08:32:00 PDT 2000
>Originator:     Dave Huang
>Release:        NetBSD-1.5_ALPHA as of July 9, 2000
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet:   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 24 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
System: NetBSD 1.5_ALPHA NetBSD 1.5_ALPHA (GEDD) #613: Mon Jul 10 10:08:32 CDT 2000 mac68k

	If more than one ADB device is at an address, the kernel will
move the colliding devices around until all devices have a unique address.
However, the boot configuration messages print the old address of the
device, rather than the current address, making it look like the devices
are still colliding.

adb0 (direct, Cuda): 3 targets
aed0 at adb0 addr 0: ADB Event device
akbd0 at adb0 addr 2: extended keyboard
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: Mouse Systems A3 mouse, 3-button, 300 dpi
wsmouse0 at ams0
akbd1 at adb0 addr 2: standard keyboard
wskbd at akbd1 not configured

Note the two keyboards at addr 2... actually, while the extended keyboard
was originally at address 2, it's now at 15.

	Plug more than one keyboard into a system, or more than one mouse,
or a keyboard and a mouse that has a "fake" keyboard, such as the Mouse
Systems A3.
	It looks like the code has always been like this... was it working
before, but is broken now that ADB devices are probed later in the boot
process? Or was it always broken? I dunno :) This seems to do the trick

Index: adb.c
RCS file: /cvsroot/syssrc/sys/arch/mac68k/dev/adb.c,v
retrieving revision 1.36
diff -u -r1.36 adb.c
--- adb.c	2000/06/18 22:58:45	1.36
+++ adb.c	2000/07/10 15:27:23
@@ -197,7 +197,7 @@
 		rv = UNSUPP; /* most ADB device types are unsupported */
 		/* print out what kind of ADB device we have found */
-		printf("%s addr %d: ", name, aa_args->origaddr);
+		printf("%s addr %d: ", name, aa_args->adbaddr);
 		switch(aa_args->origaddr) {
 		case 0:
@@ -251,7 +251,7 @@
 #endif /* DIAGNOSTIC */
 	} else		/* a device matched and was configured */
-		printf(" addr %d: ", aa_args->origaddr);
+		printf(" addr %d: ", aa_args->adbaddr);
 	return (rv);