Subject: adb_direct code hanging on PB180 -- suggestions?
To: None <jpw@netscape.com, jpw@netwizards.net>
From: Tim Bessie <tbessie@eci.net>
List: port-mac68k
Date: 12/04/1997 08:36:35
Well folks, I have been trying to find out where in the
adb_direct code things are going wrong, and there are
two (possibly related) things happening:

	1. Within adb_reinit (in adb_direct.c):

-----------------------------------------

        nonewtimes = 0;         /* no loops w/o new devices */
        while (nonewtimes++ < 11) {
                for (i = 1; i <= ADBNumDevices; i++) {
			...
			...
			...
                        /* send TALK R3 - anything at old address? */
                        command = (int) (0x0f | ((int) (device & 0x000f) <<
4));
                        result = adb_op_sync((Ptr) send_string, (Ptr) 0,
(Ptr) 0, (short) command);
                        if (send_string[0] != 0) {
                                /* new device found */
                                /* update data for previously moved device */
                                ADBDevTable[i].currentAddr = saveptr;
                                /* printf_intr("old device at index
%i\n",i); */
                                /* add new device in table */
                                /* printf_intr("new device found\n"); */
                                ADBDevTable[++ADBNumDevices].devType =
(u_char) send_string[2];

			...
			...
-----------------------------------------

	This bit of code loops forever, as the "if (send_string[0]..." condition
	is always true.  That is, ADBNumDevices is constantly bumped up, and
	it is always greater than 'i', and it loops forever.  Since ADBDevTable[]
	is only 16-elements long, this is a problem anyway.  Does anyone
	know why this might be happening?

	2. I put a limit on the inner loop on 'i' to be no greater than 15,
	   just to see what would happen when the loop ended.  ADBReInit()
	   finishes, apparently, but then the system hangs elsewhere.

	   Looking at the code just now, I noticed that adb_intr() has no
	   code for case ADB_HW_PB.  Is this desired, or has it just happened
	   that nobody's written an interrupt routine for powerbooks?

Any suggestions for making this stuff work would be greatly
appreciated.  I don't know anything about apple architecture,
so writing ADB driver code is rather out of the question,
unless somebody can point me in the direction of good
documenation and/or give me a list of what code needs to
be written at this point.

- Tim Bessie
tbessie@eci.net

------------------------------------------------------------
Tim Bessie
tbessie@eci.net
bessie@apshit.com