Fri Oct 8 17:49:26 2010 UTC ()
Handle WSMOUSEIO_SETVERSION in legacy XFree based MD servers
for workaround until eventual Xorg migration.
Taken from Xhpc as noted in PR xsrc/41619, but tested only on dreamcast.


(tsutsui)
diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/alphaMouse.c
diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/decMouse.c
diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/dreamcast/dreamcastMouse.c
diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/ews4800mips/ews4800mipsMouse.c
diff -r1.1.1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/macppc/macppcMouse.c
diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/newsmips/newsmipsMouse.c

cvs diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/Attic/alphaMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/Attic/alphaMouse.c 2004/01/18 04:13:22 1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/Attic/alphaMouse.c 2010/10/08 17:49:25 1.2
@@ -143,26 +143,39 @@ int alphaMouseProc (device, what) @@ -143,26 +143,39 @@ int alphaMouseProc (device, what)
143 break; 143 break;
144 144
145 case DEVICE_ON: 145 case DEVICE_ON:
146#if 0 /* XXX -- deal with this rcd */ 146#if 0 /* XXX -- deal with this rcd */
147 if (ioctl (alphaPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) { 147 if (ioctl (alphaPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) {
148 Error ("alphaMouseProc ioctl VUIDGFORMAT"); 148 Error ("alphaMouseProc ioctl VUIDGFORMAT");
149 return !Success; 149 return !Success;
150 } 150 }
151 format = VUID_FIRM_EVENT; 151 format = VUID_FIRM_EVENT;
152 if (ioctl (alphaPtrPriv.fd, VUIDSFORMAT, &format) == -1) { 152 if (ioctl (alphaPtrPriv.fd, VUIDSFORMAT, &format) == -1) {
153 Error ("alphaMouseProc ioctl VUIDSFORMAT"); 153 Error ("alphaMouseProc ioctl VUIDSFORMAT");
154 return !Success; 154 return !Success;
155 } 155 }
 156#endif
 157
 158#ifdef WSMOUSEIO_SETVERSION
 159 {
 160 int version = WSMOUSE_EVENT_VERSION;
 161 if (ioctl(alphaPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 162 Error ("alphaMouseProc ioctl WSMOUSEIO_SETVERSION");
 163 return !Success;
 164 }
 165 }
 166#endif
 167
 168#if 0
156 alphaPtrPriv.bmask = 0; 169 alphaPtrPriv.bmask = 0;
157 AddEnabledDevice (alphaPtrPriv.fd); 170 AddEnabledDevice (alphaPtrPriv.fd);
158#endif 171#endif
159 pMouse->on = TRUE; 172 pMouse->on = TRUE;
160 break; 173 break;
161 174
162 case DEVICE_CLOSE: 175 case DEVICE_CLOSE:
163#if 0 /* XXX -- deal with this rcd */ 176#if 0 /* XXX -- deal with this rcd */
164 if (ioctl (alphaPtrPriv.fd, VUIDSFORMAT, &oformat) == -1) 177 if (ioctl (alphaPtrPriv.fd, VUIDSFORMAT, &oformat) == -1)
165 Error ("alphaMouseProc ioctl VUIDSFORMAT"); 178 Error ("alphaMouseProc ioctl VUIDSFORMAT");
166#endif 179#endif
167 break; 180 break;
168 181

cvs diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/Attic/decMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/Attic/decMouse.c 2004/01/18 05:21:41 1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/Attic/decMouse.c 2010/10/08 17:49:25 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: decMouse.c,v 1.1 2004/01/18 05:21:41 rtr Exp $ */ 1/* $NetBSD: decMouse.c,v 1.2 2010/10/08 17:49:25 tsutsui Exp $ */
2 2
3/* XConsortium: sunMouse.c,v 5.21 94/04/17 20:29:47 kaleb Exp */ 3/* XConsortium: sunMouse.c,v 5.21 94/04/17 20:29:47 kaleb Exp */
4/*- 4/*-
5 * Copyright (c) 1987 by the Regents of the University of California 5 * Copyright (c) 1987 by the Regents of the University of California
6 * 6 *
7 * Permission to use, copy, modify, and distribute this 7 * Permission to use, copy, modify, and distribute this
8 * software and its documentation for any purpose and without 8 * software and its documentation for any purpose and without
9 * fee is hereby granted, provided that the above copyright 9 * fee is hereby granted, provided that the above copyright
10 * notice appear in all copies. The University of California 10 * notice appear in all copies. The University of California
11 * makes no representations about the suitability of this 11 * makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without 12 * software for any purpose. It is provided "as is" without
13 * express or implied warranty. 13 * express or implied warranty.
14 */ 14 */
@@ -121,26 +121,39 @@ int decMouseProc (device, what) @@ -121,26 +121,39 @@ int decMouseProc (device, what)
121 break; 121 break;
122 122
123 case DEVICE_ON: 123 case DEVICE_ON:
124#if 0 /* XXX -- deal with this rcd */ 124#if 0 /* XXX -- deal with this rcd */
125 if (ioctl (decPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) { 125 if (ioctl (decPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) {
126 Error ("decMouseProc ioctl VUIDGFORMAT"); 126 Error ("decMouseProc ioctl VUIDGFORMAT");
127 return !Success; 127 return !Success;
128 } 128 }
129 format = VUID_FIRM_EVENT; 129 format = VUID_FIRM_EVENT;
130 if (ioctl (decPtrPriv.fd, VUIDSFORMAT, &format) == -1) { 130 if (ioctl (decPtrPriv.fd, VUIDSFORMAT, &format) == -1) {
131 Error ("decMouseProc ioctl VUIDSFORMAT"); 131 Error ("decMouseProc ioctl VUIDSFORMAT");
132 return !Success; 132 return !Success;
133 } 133 }
 134#endif
 135
 136#ifdef WSMOUSEIO_SETVERSION
 137 {
 138 int version = WSMOUSE_EVENT_VERSION;
 139 if (ioctl(decPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 140 Error ("decMouseProc ioctl WSMOUSEIO_SETVERSION");
 141 return !Success;
 142 }
 143 }
 144#endif
 145
 146#if 0
134 decPtrPriv.bmask = 0; 147 decPtrPriv.bmask = 0;
135#endif 148#endif
136 AddEnabledDevice (decPtrPriv.fd); 149 AddEnabledDevice (decPtrPriv.fd);
137 pMouse->on = TRUE; 150 pMouse->on = TRUE;
138 break; 151 break;
139 152
140 case DEVICE_CLOSE: 153 case DEVICE_CLOSE:
141#if 0 /* XXX -- deal with this rcd */ 154#if 0 /* XXX -- deal with this rcd */
142 if (ioctl (decPtrPriv.fd, VUIDSFORMAT, &oformat) == -1) 155 if (ioctl (decPtrPriv.fd, VUIDSFORMAT, &oformat) == -1)
143 Error ("decMouseProc ioctl VUIDSFORMAT"); 156 Error ("decMouseProc ioctl VUIDSFORMAT");
144#endif 157#endif
145 break; 158 break;
146 159

cvs diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/dreamcast/Attic/dreamcastMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/dreamcast/Attic/dreamcastMouse.c 2004/02/07 02:39:07 1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/dreamcast/Attic/dreamcastMouse.c 2010/10/08 17:49:25 1.2
@@ -121,26 +121,36 @@ dreamcastMouseProc(device, what) @@ -121,26 +121,36 @@ dreamcastMouseProc(device, what)
121 pMouse->on = FALSE; 121 pMouse->on = FALSE;
122 map[1] = 1; 122 map[1] = 1;
123 map[2] = 2; 123 map[2] = 2;
124 map[3] = 3; 124 map[3] = 3;
125 map[4] = 2; 125 map[4] = 2;
126 map[5] = 4; 126 map[5] = 4;
127 map[6] = 5; 127 map[6] = 5;
128 InitPointerDeviceStruct( 128 InitPointerDeviceStruct(
129 pMouse, map, 6, miPointerGetMotionEvents, 129 pMouse, map, 6, miPointerGetMotionEvents,
130 dreamcastMouseCtrl, miPointerGetMotionBufferSize()); 130 dreamcastMouseCtrl, miPointerGetMotionBufferSize());
131 break; 131 break;
132 132
133 case DEVICE_ON: 133 case DEVICE_ON:
 134#ifdef WSMOUSEIO_SETVERSION
 135 {
 136 int version = WSMOUSE_EVENT_VERSION;
 137 if (ioctl(dreamcastPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 138 Error ("dreamcastMouseProc ioctl WSMOUSEIO_SETVERSION");
 139 return !Success;
 140 }
 141 }
 142#endif
 143
134 dreamcastPtrPriv.bmask = 0; 144 dreamcastPtrPriv.bmask = 0;
135 145
136 AddEnabledDevice (dreamcastPtrPriv.fd); 146 AddEnabledDevice (dreamcastPtrPriv.fd);
137 pMouse->on = TRUE; 147 pMouse->on = TRUE;
138 break; 148 break;
139 149
140 case DEVICE_CLOSE: 150 case DEVICE_CLOSE:
141 break; 151 break;
142 152
143 case DEVICE_OFF: 153 case DEVICE_OFF:
144 pMouse->on = FALSE; 154 pMouse->on = FALSE;
145 RemoveEnabledDevice (dreamcastPtrPriv.fd); 155 RemoveEnabledDevice (dreamcastPtrPriv.fd);
146 break; 156 break;

cvs diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/ews4800mips/Attic/ews4800mipsMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/ews4800mips/Attic/ews4800mipsMouse.c 2005/12/29 15:43:40 1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/ews4800mips/Attic/ews4800mipsMouse.c 2010/10/08 17:49:25 1.2
@@ -110,26 +110,36 @@ ews4800mipsMouseProc(DeviceIntPtr device @@ -110,26 +110,36 @@ ews4800mipsMouseProc(DeviceIntPtr device
110 if (ews4800mipsPtrPriv.fd == -1) 110 if (ews4800mipsPtrPriv.fd == -1)
111 return !Success; 111 return !Success;
112 pMouse->devicePrivate = (pointer) &ews4800mipsPtrPriv; 112 pMouse->devicePrivate = (pointer) &ews4800mipsPtrPriv;
113 pMouse->on = FALSE; 113 pMouse->on = FALSE;
114 map[1] = 1; 114 map[1] = 1;
115 map[2] = 2; 115 map[2] = 2;
116 map[3] = 3; 116 map[3] = 3;
117 InitPointerDeviceStruct(pMouse, map, 6, 117 InitPointerDeviceStruct(pMouse, map, 6,
118 miPointerGetMotionEvents, ews4800mipsMouseCtrl, 118 miPointerGetMotionEvents, ews4800mipsMouseCtrl,
119 miPointerGetMotionBufferSize()); 119 miPointerGetMotionBufferSize());
120 break; 120 break;
121 121
122 case DEVICE_ON: 122 case DEVICE_ON:
 123#ifdef WSMOUSEIO_SETVERSION
 124 {
 125 int version = WSMOUSE_EVENT_VERSION;
 126 if (ioctl(ews4800mipsPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 127 Error ("ews4800mipsMouseProc ioctl WSMOUSEIO_SETVERSION");
 128 return !Success;
 129 }
 130 }
 131#endif
 132
123 ews4800mipsPtrPriv.bmask = 0; 133 ews4800mipsPtrPriv.bmask = 0;
124 134
125 AddEnabledDevice(ews4800mipsPtrPriv.fd); 135 AddEnabledDevice(ews4800mipsPtrPriv.fd);
126 pMouse->on = TRUE; 136 pMouse->on = TRUE;
127 break; 137 break;
128 138
129 case DEVICE_CLOSE: 139 case DEVICE_CLOSE:
130 break; 140 break;
131 141
132 case DEVICE_OFF: 142 case DEVICE_OFF:
133 pMouse->on = FALSE; 143 pMouse->on = FALSE;
134 RemoveEnabledDevice(ews4800mipsPtrPriv.fd); 144 RemoveEnabledDevice(ews4800mipsPtrPriv.fd);
135 break; 145 break;

cvs diff -r1.1.1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/macppc/Attic/macppcMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/macppc/Attic/macppcMouse.c 2003/12/27 05:41:22 1.1.1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/macppc/Attic/macppcMouse.c 2010/10/08 17:49:26 1.2
@@ -146,26 +146,37 @@ int macppcMouseProc (device, what) @@ -146,26 +146,37 @@ int macppcMouseProc (device, what)
146 146
147 case DEVICE_ON: 147 case DEVICE_ON:
148#if 0 148#if 0
149 if (ioctl (macppcPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) { 149 if (ioctl (macppcPtrPriv.fd, VUIDGFORMAT, &oformat) == -1) {
150 Error ("macppcMouseProc ioctl VUIDGFORMAT"); 150 Error ("macppcMouseProc ioctl VUIDGFORMAT");
151 return !Success; 151 return !Success;
152 } 152 }
153 format = VUID_FIRM_EVENT; 153 format = VUID_FIRM_EVENT;
154 if (ioctl (macppcPtrPriv.fd, VUIDSFORMAT, &format) == -1) { 154 if (ioctl (macppcPtrPriv.fd, VUIDSFORMAT, &format) == -1) {
155 Error ("macppcMouseProc ioctl VUIDSFORMAT"); 155 Error ("macppcMouseProc ioctl VUIDSFORMAT");
156 return !Success; 156 return !Success;
157 } 157 }
158#endif 158#endif
 159
 160#ifdef WSMOUSEIO_SETVERSION
 161 {
 162 int version = WSMOUSE_EVENT_VERSION;
 163 if (ioctl(macppcPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 164 Error ("macppcMouseProc ioctl WSMOUSEIO_SETVERSION");
 165 return !Success;
 166 }
 167 }
 168#endif
 169
159 macppcPtrPriv.bmask = 0; 170 macppcPtrPriv.bmask = 0;
160 AddEnabledDevice (macppcPtrPriv.fd); 171 AddEnabledDevice (macppcPtrPriv.fd);
161 pMouse->on = TRUE; 172 pMouse->on = TRUE;
162 break; 173 break;
163 174
164 case DEVICE_CLOSE: 175 case DEVICE_CLOSE:
165#if 0 176#if 0
166 if (ioctl (macppcPtrPriv.fd, VUIDSFORMAT, &oformat) == -1) 177 if (ioctl (macppcPtrPriv.fd, VUIDSFORMAT, &oformat) == -1)
167 Error ("macppcMouseProc ioctl VUIDSFORMAT"); 178 Error ("macppcMouseProc ioctl VUIDSFORMAT");
168#endif 179#endif
169 break; 180 break;
170 181
171 case DEVICE_OFF: 182 case DEVICE_OFF:

cvs diff -r1.1 -r1.2 xsrc/xfree/xc/programs/Xserver/hw/netbsd/newsmips/Attic/newsmipsMouse.c (expand / switch to unified diff)

--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/newsmips/Attic/newsmipsMouse.c 2004/08/01 18:46:49 1.1
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/newsmips/Attic/newsmipsMouse.c 2010/10/08 17:49:26 1.2
@@ -113,26 +113,36 @@ newsmipsMouseProc(DeviceIntPtr device, i @@ -113,26 +113,36 @@ newsmipsMouseProc(DeviceIntPtr device, i
113 pMouse->on = FALSE; 113 pMouse->on = FALSE;
114 map[1] = 1; 114 map[1] = 1;
115 map[2] = 2; 115 map[2] = 2;
116 map[3] = 3; 116 map[3] = 3;
117 map[4] = 2; 117 map[4] = 2;
118 map[5] = 4; 118 map[5] = 4;
119 map[6] = 5; 119 map[6] = 5;
120 InitPointerDeviceStruct(pMouse, map, 6, 120 InitPointerDeviceStruct(pMouse, map, 6,
121 miPointerGetMotionEvents, newsmipsMouseCtrl, 121 miPointerGetMotionEvents, newsmipsMouseCtrl,
122 miPointerGetMotionBufferSize()); 122 miPointerGetMotionBufferSize());
123 break; 123 break;
124 124
125 case DEVICE_ON: 125 case DEVICE_ON:
 126#ifdef WSMOUSEIO_SETVERSION
 127 {
 128 int version = WSMOUSE_EVENT_VERSION;
 129 if (ioctl(newsmipsPtrPriv.fd, WSMOUSEIO_SETVERSION, &version) == -1) {
 130 Error ("newsmipsMouseProc ioctl WSMOUSEIO_SETVERSION");
 131 return !Success;
 132 }
 133 }
 134#endif
 135
126 newsmipsPtrPriv.bmask = 0; 136 newsmipsPtrPriv.bmask = 0;
127 137
128 AddEnabledDevice(newsmipsPtrPriv.fd); 138 AddEnabledDevice(newsmipsPtrPriv.fd);
129 pMouse->on = TRUE; 139 pMouse->on = TRUE;
130 break; 140 break;
131 141
132 case DEVICE_CLOSE: 142 case DEVICE_CLOSE:
133 break; 143 break;
134 144
135 case DEVICE_OFF: 145 case DEVICE_OFF:
136 pMouse->on = FALSE; 146 pMouse->on = FALSE;
137 RemoveEnabledDevice(newsmipsPtrPriv.fd); 147 RemoveEnabledDevice(newsmipsPtrPriv.fd);
138 break; 148 break;