Subject: port-i386/2951: pcvt kbd does not work on the Thinkpad 755C
To: None <gnats-bugs@gnats.netbsd.org>
From: Christos Zoulas <christos@deshaw.com>
List: netbsd-bugs
Date: 11/18/1996 18:53:07
>Number:         2951
>Category:       port-i386
>Synopsis:       pcvt kbd does not work on the Thinkpad 755C
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 18 16:05:01 1996
>Last-Modified:
>Originator:     Christos Zoulas
>Organization:
Foo and Bar baz.
>Release:        Mon Nov 18 18:51:52 EST 1996
>Environment:
	
System: NetBSD ramoth.nyc.deshaw.com 1.2B NetBSD 1.2B (ZEOS_AIC) #20: Mon Nov 4 19:28:16 EST 1996 christos@ramoth.nyc.deshaw.com:/usr/src/sys/arch/i386/compile/ZEOS_AIC i386


>Description:
	The pcvt driver does not work properly with an IBM thinkpad 755C.
	It seems that the 755C resets to scanset = 2...

>How-To-Repeat:
	Plug one in and try to type.
>Fix:

	- recognize another mfII keyboard code for the 755C thinkpad.
	- make this a switch statement, it is getting too large.

	- the 755C also resets on scanset 2, so we put it back to scanset 1.
	  Is there a better way to do this?


*** ./pcvt_hdr.h	Mon Nov 18 18:39:23 1996
--- /usr/src/sys/arch/i386/isa/pcvt/pcvt_hdr.h	Mon Nov 18 16:45:41 1996
***************
*** 274,284 ****
  #define	KEYB_R_OVERRUN1	0xff	/* keyboard buffer overflow */
  
  /* MF II Keyboard id-byte #1 */	/* Default keybd's id-byte #1 */
! #define KEYB_R_MF2ID1	0xab	
  /* MF II Keyboard id-byte #2 */
! #define KEYB_R_MF2ID2	0x41	/* Default keybd's id-byte #2 */
! #define KEYB_R_MF2ID2TP	0x54	/* IBM ThinkPad 76X keybd's id-byte #2 */
! #define KEYB_R_MF2ID2HP	0x83	/* HP kybd's id-byte #2 */
  
  /* internal Keyboard Type */
  
--- 274,285 ----
  #define	KEYB_R_OVERRUN1	0xff	/* keyboard buffer overflow */
  
  /* MF II Keyboard id-byte #1 */	/* Default keybd's id-byte #1 */
! #define KEYB_R_MF2ID1		0xab	
  /* MF II Keyboard id-byte #2 */
! #define KEYB_R_MF2ID2		0x41	/* Default id-byte #2 */
! #define KEYB_R_MF2ID2TP76X	0x54	/* IBM ThinkPad 76X, id-byte #2 */
! #define KEYB_R_MF2ID2HP		0x83	/* HP id-byte #2 */
! #define KEYB_R_MF2ID2TP75X	0x84	/* IBM ThinkPad 755, id-byte #2 */
  
  /* internal Keyboard Type */
  
diff -rc ./pcvt_kbd.c /usr/src/sys/arch/i386/isa/pcvt/pcvt_kbd.c
*** ./pcvt_kbd.c	Mon Nov 18 18:41:04 1996
--- /usr/src/sys/arch/i386/isa/pcvt/pcvt_kbd.c	Mon Nov 18 17:12:34 1996
***************
*** 511,543 ****
  r_entry:
  		if((response = kbd_response()) == KEYB_R_MF2ID1)
  		{
! 			if((response = kbd_response()) == KEYB_R_MF2ID2)
  			{
! 				keyboard_type = KB_MFII;
! 			}
! 			else if(response == KEYB_R_RESEND)
! 			{
! 				/*
! 				 *  Let's give other priority levels
! 				 *  a chance instead of blocking at
! 				 *  tty level.
! 				 */
! 				splx(opri);
! 				goto query_kbd_id;
! 			}
! 			else if(response == KEYB_R_MF2ID2HP ||
! 				response == KEYB_R_MF2ID2TP)
! 			{
! 				/*
! 				 * Handle particular vendor responses
! 				 */
! 				keyboard_type = KB_MFII;
! 			}
! 			else
! 			{
! 				printf("\npcvt: doreset() - kbdid, response 2 = [%d]\n",
  				       response);
! 				keyboard_type = KB_UNKNOWN;
  			}
  		}
  		else if(response == KEYB_R_ACK)
--- 511,550 ----
  r_entry:
  		if((response = kbd_response()) == KEYB_R_MF2ID1)
  		{
! 			switch ((response = kbd_response())) 
  			{
! 				case KEYB_R_MF2ID2:
! 					keyboard_type = KB_MFII;
! 					break;
! 
! 				case KEYB_R_RESEND:
! 					/*
! 					 *  Let's give other priority levels
! 					 *  a chance instead of blocking at
! 					 *  tty level.
! 					 */
! 					splx(opri);
! 					goto query_kbd_id;
! 
! 				case KEYB_R_MF2ID2TP75X:
! 					/* set scan = 1 */
! 					kbd_cmd(0xf0);
! 					kbd_cmd(0x1);
! 					/*FALLTHROUGH*/
! 
! 				case KEYB_R_MF2ID2HP:
! 				case KEYB_R_MF2ID2TP76X:
! 					/*
! 					 * Handle particular vendor responses
! 					 */
! 					keyboard_type = KB_MFII;
! 					break;
! 
! 				default:
! 					printf("\npcvt: doreset() - kbdid, response 2 = [%d]\n",
  				       response);
! 					keyboard_type = KB_UNKNOWN;
! 					break;
  			}
  		}
  		else if(response == KEYB_R_ACK)
>Audit-Trail:
>Unformatted: