Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/mac68k/dev Pull up revisions 1.41-1.42 (reques...
details: https://anonhg.NetBSD.org/src/rev/004532875ddb
branches: netbsd-1-4
changeset: 469725:004532875ddb
user: he <he%NetBSD.org@localhost>
date: Sun Nov 21 15:03:41 1999 +0000
description:
Pull up revisions 1.41-1.42 (requested by sr):
Clean up the ADB driver, and eliminate duplicate keystrokes under
heavy load, fixing PR#7870.
diffstat:
sys/arch/mac68k/dev/adbsys.c | 317 +------------------------------------------
1 files changed, 1 insertions(+), 316 deletions(-)
diffs (truncated from 328 to 300 lines):
diff -r 5fedd5b35ab3 -r 004532875ddb sys/arch/mac68k/dev/adbsys.c
--- a/sys/arch/mac68k/dev/adbsys.c Sun Nov 21 15:03:16 1999 +0000
+++ b/sys/arch/mac68k/dev/adbsys.c Sun Nov 21 15:03:41 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adbsys.c,v 1.40 1999/02/11 06:41:08 ender Exp $ */
+/* $NetBSD: adbsys.c,v 1.40.4.1 1999/11/21 15:03:41 he Exp $ */
/*-
* Copyright (C) 1994 Bradley A. Grantham
@@ -351,318 +351,3 @@
}
}
}
-
-void
-adb_init()
-{
- ADBDataBlock adbdata;
- ADBSetInfoBlock adbinfo;
- int totaladbs;
- int adbindex, adbaddr;
- int error, cmd, count, devtype = 0;
- u_char buffer[9];
- extern int adb_initted;
-
-#ifdef MRG_ADB
- /*
- * Even if serial console only, some models require the
- * ADB in order to get the date/time and do soft power.
- */
- if ((mac68k_machine.serial_console & 0x03)) {
- printf("adb: using serial console\n");
- return;
- }
-
- if (!mrg_romready()) {
- printf("adb: no ROM ADB driver in this kernel for this machine\n");
- return;
- }
-
- printf("adb: bus subsystem\n");
-#ifdef ADB_DEBUG
- if (adb_debug)
- printf("adb: call mrg_initadbintr\n");
-#endif
-
- mrg_initadbintr(); /* Mac ROM Glue okay to do ROM intr */
-#ifdef ADB_DEBUG
- if (adb_debug)
- printf("adb: returned from mrg_initadbintr\n");
-#endif
-
- /* ADBReInit pre/post-processing */
- JADBProc = adb_jadbproc;
-
- /* Initialize ADB */
-#ifdef ADB_DEBUG
- if (adb_debug)
- printf("adb: calling ADBAlternateInit.\n");
-#endif
-
- ADBAlternateInit();
-#else
- ADBReInit();
-#endif /* MRG_ADB */
-
-#ifdef ADB_DEBUG
- if (adb_debug)
- printf("adb: done with ADBReInit\n");
-#endif
-
- totaladbs = CountADBs();
- extdms_init(totaladbs);
-
- /* for each ADB device */
- for (adbindex = 1; adbindex <= totaladbs; adbindex++) {
- /* Get the ADB information */
- adbaddr = GetIndADB(&adbdata, adbindex);
-
- /* Print out the glory */
- printf("adb: ");
- switch (adbdata.origADBAddr) {
- case ADBADDR_SECURE:
- printf("security dongle (%d)", (int)(adbdata.devType));
- break;
- case ADBADDR_MAP:
- switch (adbdata.devType) {
- case ADB_STDKBD:
- printf("standard keyboard");
- break;
- case ADB_ISOKBD:
- printf("standard keyboard (ISO layout)");
- break;
- case ADB_EXTKBD:
- extdms_done = 0;
- /* talk R1 */
- cmd = (((adbaddr << 4) & 0xf0) | 0x0d );
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
- (Ptr)&extdms_done, cmd);
-
- /* Wait until done, but no more than 2 secs */
- count = 40000;
- while (!extdms_done && count-- > 0)
- delay(50);
-
- if (extdms_done &&
- buffer[1] == 0x9a && buffer[2] == 0x20)
- printf("Mouseman (non-EMP) pseudo keyboard");
- else if (extdms_done &&
- buffer[1] == 0x9a && buffer[2] == 0x21)
- printf("Trackman (non-EMP) pseudo keyboard");
- else
- printf("extended keyboard");
- break;
- case ADB_EXTISOKBD:
- printf("extended keyboard (ISO layout)");
- break;
- case ADB_KBDII:
- printf("keyboard II");
- break;
- case ADB_ISOKBDII:
- printf("keyboard II (ISO layout)");
- break;
- case ADB_PBKBD:
- printf("PowerBook keyboard");
- break;
- case ADB_PBISOKBD:
- printf("PowerBook keyboard (ISO layout)");
- break;
- case ADB_ADJKPD:
- printf("adjustable keypad");
- break;
- case ADB_ADJKBD:
- printf("adjustable keyboard");
- break;
- case ADB_ADJISOKBD:
- printf("adjustable keyboard (ISO layout)");
- break;
- case ADB_ADJJAPKBD:
- printf("adjustable keyboard (Japanese layout)");
- break;
- case ADB_PBEXTISOKBD:
- printf("PowerBook extended keyboard (ISO layout)");
- break;
- case ADB_PBEXTJAPKBD:
- printf("PowerBook extended keyboard (Japanese layout)");
- break;
- case ADB_PBEXTKBD:
- printf("PowerBook extended keyboard");
- break;
- case ADB_DESIGNKBD:
- printf("extended keyboard");
- break;
- default:
- printf("mapped device (%d)", (int)(adbdata.devType));
- break;
- }
- break;
- case ADBADDR_REL:
- extdms_done = 0;
- /* talk register 3 */
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
- (Ptr)&extdms_done, (adbaddr << 4) | 0xf);
-
- /* Wait until done, but no more than 2 secs */
- count = 40000;
- while (!extdms_done && count-- > 0)
- delay(50);
-
- if (!extdms_done) {
- printf("ghost mouse?");
- break;
- }
-
- devtype = buffer[2];
- switch (devtype) {
- case ADBMS_100DPI:
- printf("100 dpi mouse");
- break;
- case ADBMS_200DPI:
- printf("200 dpi mouse");
- break;
- case ADBMS_MSA3:
- printf("Mouse Systems A3 mouse, default parameters");
- break;
- case ADBMS_USPEED:
- printf("MicroSpeed mouse, default parameters");
- break;
- case ADBMS_UCONTOUR:
- printf("Contour mouse, default parameters");
- break;
- case ADBMS_EXTENDED:
- extdms_done = 0;
- /* talk register 1 */
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
- (Ptr)&extdms_done, (adbaddr << 4) | 0xd);
- while (!extdms_done)
- /* busy-wait until done */;
- if (buffer[1] == 0x9a && buffer[2] == 0x20)
- printf("Mouseman (non-EMP) mouse");
- else if (buffer[1] == 0x9a && buffer[2] == 0x21)
- printf("Trackman (non-EMP) trackball");
- else {
- printf("extended mouse <%c%c%c%c> "
- "%d-button %d dpi ",
- buffer[1], buffer[2],
- buffer[3], buffer[4],
- (int)buffer[8],
- (int)*(short *)&buffer[5]);
- if (buffer[7] == 1)
- printf("mouse");
- else if (buffer[7] == 2)
- printf("trackball");
- else
- printf("unknown device");
- }
- break;
- default:
- printf("relative positioning device (mouse?) "
- "(%d)", (int)(adbdata.devType));
- break;
- }
- break;
- case ADBADDR_ABS:
- switch (adbdata.devType) {
- case ADB_ARTPAD:
- printf("WACOM ArtPad II");
- break;
- default:
- printf("abs. pos. device (tablet?) (%d)",
- (int)(adbdata.devType));
- break;
- }
- break;
- case ADBADDR_DATATX:
- printf("data transfer device (modem?) (%d)",
- (int)(adbdata.devType));
- break;
- case ADBADDR_MISC:
- switch (adbdata.devType) {
- case ADB_POWERKEY:
- printf("Sophisticated Circuits PowerKey");
- break;
- default:
- printf("misc. device (remote control?) (%d)",
- (int)(adbdata.devType));
- break;
- }
- break;
- default:
- printf("unknown type device, (def %d, handler %d)",
- (int)(adbdata.origADBAddr), (int)(adbdata.devType));
- break;
- }
- printf(" at %d\n", adbaddr);
-
- /* Set completion routine to be NetBSD's */
- if ((adbdata.origADBAddr == ADBADDR_REL) &&
- (buffer[0] > 0) && (buffer[2] == ADBMS_MSA3)) {
- /* Special device handler for the A3 mouse */
- adbinfo.siServiceRtPtr = (Ptr)adb_msa3_asmcomplete;
- } else if ((adbdata.origADBAddr == ADBADDR_MAP) &&
- (adbdata.devType == ADB_EXTKBD) &&
- (buffer[1] == 0x9a) &&
- ((buffer[2] == 0x20) || (buffer[2] == 0x21))) {
- /* ignore non-EMP Mouseman/Trackman pseudo keyboard */
- adbinfo.siServiceRtPtr = (Ptr)0;
- } else if ((adbdata.origADBAddr == ADBADDR_REL) &&
- (devtype == ADBMS_EXTENDED) &&
- (buffer[1] == 0x9a) &&
- ((buffer[2] == 0x20) || (buffer[2] == 0x21))) {
- /*
- * Set up non-EMP Mouseman/Trackman to put button
- * bits in 3rd byte instead of sending via pseudo
- * keyboard device.
- */
- extdms_done = 0;
- /* listen register 1 */
- buffer[0] = 2;
- buffer[1] = 0x00;
- buffer[2] = 0x81;
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
- (Ptr)&extdms_done, (adbaddr << 4) | 0x9);
- while (!extdms_done)
- /* busy-wait until done */;
- extdms_done = 0;
- /* listen register 1 */
- buffer[0] = 2;
- buffer[1] = 0x01;
- buffer[2] = 0x81;
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
- (Ptr)&extdms_done, (adbaddr << 4) | 0x9);
- while (!extdms_done)
- /* busy-wait until done */;
- extdms_done = 0;
- /* listen register 1 */
- buffer[0] = 2;
- buffer[1] = 0x02;
- buffer[2] = 0x81;
- ADBOp((Ptr)buffer, (Ptr)extdms_complete,
Home |
Main Index |
Thread Index |
Old Index