Subject: Re: XF86Setup-3.3.3.1 pkg on i386
To: maximum entropy <entropy@zippy.bernstein.com>
From: Matthieu Herrb <matthieu@laas.fr>
List: current-users
Date: 04/21/1999 08:53:23
You wrote (in your message from Wednesday 21)
 > 
 > The XF86Setup-3.3.3.1 pkg on my i386 system doesn't offer me "wsmouse"
 > as a protocol choice.
 > 
 > Am I an idiot, or is something very wrong with this?  ("both" is an
 > acceptable answer :-)

No, you're right, there isn't support for wsmouse in XF86Setup as
distributed. But I happen to  have integrated support for it in XFree86
for the next release recently. 

Appended below are the relevant part of the diffs between my XFree86
tree and NetBSD's xsrc. 

Note1: there are some required modifications to the server code
too. You must rebuild at least the XF86_VGA16 server for this to work.

Note2: Unfortunatly  this patch interferes with the atari mouse
support in xf86_Mouse.c. I edited the patch manually to remove those
conflicts, but it means that the patch will apply with some fuzz, as I
was too lazy to recompute line numbers. 

Note3: having mouse protocols names and numbers duplicated in so many
places sucks. I hope this will be fixed in the future.

						Matthieu

--- xc/include/extensions/xf86misc.h	Sun Mar  8 13:37:43 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/include/extensions/xf86misc.h	Tue Apr 20 22:17:06 1999
@@ -52,6 +52,8 @@
 #define MTYPE_NETSCROLLPS2	16
 #define MTYPE_SYSMOUSE		17
 #define MTYPE_AUTOMOUSE		18
+#define MTYPE_ACECAD		19
+#define MTYPE_WSMOUSE		20
 
 #define MTYPE_XQUEUE		127
 #define MTYPE_OSMOUSE		126
--- xc/programs/Xserver/Xext/xf86misc.c	Sun Mar  8 13:38:43 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/Xext/xf86misc.c	Tue Apr 20 23:46:12 1999
@@ -349,7 +349,8 @@
 	    && stuff->mousetype != MTYPE_GLIDEPOINTPS2
 	    && stuff->mousetype != MTYPE_NETPS2
 	    && stuff->mousetype != MTYPE_NETSCROLLPS2
-	    && stuff->mousetype != MTYPE_SYSMOUSE)
+	    && stuff->mousetype != MTYPE_SYSMOUSE
+	    && stuff->mousetype != MTYPE_WSMOUSE)
     {
         if (stuff->baudrate < 1200)
 	    return miscErrorBase + XF86MiscBadMouseBaudRate;
--- xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl	Sun Mar  8 13:39:38 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl	Tue Apr 20 08:35:11 1999
@@ -40,7 +40,7 @@
 	$canv itemconfigure coord -fill black
 	if {[lsearch -exact {BusMouse Xqueue OSMouse PS/2 IMPS/2
 			     ThinkingMousePS/2 MouseManPlusPS/2 GlidePointPS/2 
-			     NetMousePS/2 NetScrollPS/2 SysMouse} \
+			     NetMousePS/2 NetScrollPS/2 SysMouse wsmouse} \
 			     $mseType] == -1} {
 		foreach rate {1200 2400 4800 9600} {
 			$w.mouse.brate.$rate configure -state normal
@@ -667,6 +667,8 @@
 					/dev/.*bm|/dev/mse.* ] }
 		SysMouse { set idx [lsearch -regexp $mseDevices \
 					/dev/sysmouse.* ] }
+		wsmouse { set idx [lsearch -regexp $mseDevices \
+					/dev/wsmouse.* ] }
 		OsMouse  -
 		Xqueue	 { return "" }
 		default	 { set idx [lsearch -regexp $mseDevices \
--- xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp	Thu Jan 21 13:53:18 1999
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp	Tue Apr 20 08:24:08 1999
@@ -52,10 +52,16 @@
 set ExtraMouseTypes [list \
 	"SysMouse" \
 ]
+
 #define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \
 			$PnpMouseTypes $ExtraMouseTypes
 #elif defined(__NetBSD__)
-#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $PnpMouseTypes
+set ExtraMouseTypes [list \
+	"wsmouse" \
+]
+
+#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $ExtraMouseTypes \
+			$PnpMouseTypes 
 #elif defined(__OpenBSD__)
 #define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \
 			$PnpMouseTypes
--- xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c	Sun Mar  8 13:39:41 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c	Tue Apr 20 22:17:41 1999
@@ -311,7 +311,7 @@
 			    "ThinkingMouse", "IMPS/2", "ThinkingMousePS/2",
 			    "MouseManPlusPS/2", "GlidePointPS/2", 
 			    "NetMousePS/2", "NetScrollPS/2", "SysMouse",
-			    "Auto", "Xqueue", "OSMouse" };
+			    "Auto", "AceCad", "wsmouse" };
 #define MSETABLESIZE	(sizeof(msetable)/sizeof(char *))
 
 /*
--- xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c	Sun Mar  8 13:39:42 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c	Tue Apr 20 08:40:07 1999
@@ -516,7 +516,7 @@
 		"Logitech", "BusMouse", "Mouseman", "PS/2", "MMHitTab",
 		"GlidePoint", "IntelliMouse", "ThinkingMouse", "IMPS/2",
 		"ThinkingMousePS/2", "MouseManPlusPS/2", "GlidePointPS/2",
-		"NetMousePS/2", "NetScrollPS/2", "SysMouse", "Auto", };
+		"NetMousePS/2", "NetScrollPS/2", "SysMouse", "wsmouse", "Auto", };
 
 
 int
--- xc/programs/Xserver/hw/xfree86/common/xf86_Config.h	Tue Dec 29 13:56:36 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/common/xf86_Config.h	Tue Apr 20 23:35:27 1999
@@ -186,10 +186,9 @@
 #define SYSMOUSE	1037
 #define AUTOMOUSE	1038
 #define ACECAD		1039
-#define XQUE      	1040
-#define OSMOUSE   	1041
-#define WSMOUSE   	1042
-#define SUNMOUSE	1043
+#define WSMOUSE   	1040
+#define XQUE      	1041
+#define OSMOUSE   	1042
 
 #ifdef INIT_CONFIG
 static SymTabRec MouseTab[] = {
@@ -213,10 +212,9 @@
   { SYSMOUSE,	"sysmouse" },
   { AUTOMOUSE,	"auto" },
   { ACECAD,	"acecad" },
+  { WSMOUSE,	"wsmouse" },
   { XQUE,	"xqueue" },
   { OSMOUSE,	"osmouse" },
-  { WSMOUSE,	"wsmouse" },
-  { SUNMOUSE,	"sun" },
   { -1,		"" },
 };
 #endif /* INIT_CONFIG */
@@ -558,10 +556,7 @@
 #define P_SYSMOUSE	17		/* SysMouse */
 #define P_AUTO		18		/* automatic */
 #define P_ACECAD	19		/* ACECAD protocol */
-#define P_XQUE		20		/* xque */
-#define P_OSMOUSE	21		/* osmouse */
-#define P_WSMOUSE	22		/* NetBSD wsmouse */
-#define P_SUN		23		/* sun */
+#define P_WSMOUSE	20		/* NetBSD wsmouse */
 
 #define EMULATE3	50
 #define BAUDRATE	51
--- xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c	Sat Feb  6 14:05:50 1999
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c	Tue Apr 20 22:28:10 1999
@@ -131,8 +131,6 @@
 	FALSE,	/* auto */
 #endif
 	TRUE,	/* ACECAD */
-	FALSE,	/* xque */
-	FALSE,	/* osmouse */
 #if defined(__NetBSD__) && __NetBSD_Version__ >= 103060000
 	TRUE,	/* wsmouse */
 #else
@@ -231,8 +224,6 @@
   {  0xf8,   0x80, 0x00,   0x00, 5,    0x00,   0xff },  /* sysmouse */
   {  0xf8,   0x80, 0x00,   0x00, 5,    0x00,   0xff },  /* dummy entry for auto - used only to fill space */
   {  0x80,   0x80, 0x80,   0x00, 3,    0x00,   0xff },  /* ACECAD */
-  {  0x00,   0x00, 0x00,   0x00, 0,    0x00,   0x00 },  /* xque */
-  {  0x00,   0x00, 0x00,   0x00, 0,    0x00,   0x00 },  /* osmouse */
 #if defined(__NetBSD__) && __NetBSD_Version__ >= 103060000
   {  0x00,   0x00, 0x00,   0x00, sizeof(struct wscons_event),
      				       0x00,   0x00 },  /* wsmouse */
--- xc/programs/xdpyinfo/xdpyinfo.c	Sun Mar  8 13:47:22 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/xdpyinfo/xdpyinfo.c	Tue Apr 20 23:19:58 1999
@@ -682,7 +682,8 @@
 		     "GlidePoint", "IntelliMouse", "ThinkingMouse",
 		     "IMPS/2", "ThinkingMousePS/2", "MouseManPlusPS/2",
 		     "GlidePointPS/2", "NetMousePS/2", "NetScrollPS/2",
-		     "SysMouse", "Auto" };
+		     "SysMouse", "Auto", "AceCad", "wsmouse" };
+
 char *flgtable[] = { "None", "ClearDTR", "ClearRTS",
 		     "ClearDTR and ClearRTS" };
 
@@ -713,10 +714,10 @@
 	printf("Xqueue\n");
       else if (mouseinfo.type == MTYPE_OSMOUSE)
 	printf("OSMouse\n");
-      else if (mouseinfo.type <= MTYPE_AUTOMOUSE)
+      else if (mouseinfo.type <= MTYPE_WSMOUSE)
 	printf("%s\n", msetable[mouseinfo.type+1]);
       else
-	printf("Unknown\n");
+	  printf("Unknown\n");
       printf("                        BaudRate: %d, SampleRate: %d, Resolution: %d\n",
 	mouseinfo.baudrate, mouseinfo.samplerate, mouseinfo.resolution);
       printf("                        Emulate3Buttons: %s, Emulate3Timeout: %d ms\n",