input: bump to ints for deviceids - XI2 requires 16-bit deviceids.

Note: ABI break, but ABI_XINPUT_VERSION has NOT been bumped. Recompile input
drivers.

Revert "Xi: return BadImplementation for deviceids 256 and above"
This reverts commit 2b459f44f3.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-17 08:37:44 +10:00
parent cbeb73e205
commit 17f9723f48
14 changed files with 3 additions and 135 deletions

View File

@ -65,12 +65,6 @@ ProcXIAllowEvents(ClientPtr client)
REQUEST(xXIAllowEventsReq); REQUEST(xXIAllowEventsReq);
REQUEST_SIZE_MATCH(xXIAllowEventsReq); REQUEST_SIZE_MATCH(xXIAllowEventsReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success) if (ret != Success)
return ret; return ret;

View File

@ -74,12 +74,6 @@ int ProcXIChangeCursor(ClientPtr client)
REQUEST(xXIChangeCursorReq); REQUEST(xXIChangeCursorReq);
REQUEST_SIZE_MATCH(xXIChangeCursorReq); REQUEST_SIZE_MATCH(xXIChangeCursorReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;

View File

@ -238,12 +238,6 @@ ProcXIChangeHierarchy(ClientPtr client)
r->return_mode != XIFloating) r->return_mode != XIFloating)
return BadValue; return BadValue;
if (r->deviceid > 0xFF) /* FIXME */
{
client->errorValue = r->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&ptr, r->deviceid, client, rc = dixLookupDevice(&ptr, r->deviceid, client,
DixDestroyAccess); DixDestroyAccess);
if (rc != Success) if (rc != Success)
@ -344,12 +338,6 @@ ProcXIChangeHierarchy(ClientPtr client)
newptr, newptr,
newkeybd; newkeybd;
if (r->return_pointer > 0xFF) /* FIXME */
{
client->errorValue = r->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&newptr, r->return_pointer, rc = dixLookupDevice(&newptr, r->return_pointer,
client, DixWriteAccess); client, DixWriteAccess);
if (rc != Success) if (rc != Success)
@ -362,12 +350,6 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind; goto unwind;
} }
if (r->return_keyboard > 0xFF) /* FIXME */
{
client->errorValue = r->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&newkeybd, r->return_keyboard, rc = dixLookupDevice(&newkeybd, r->return_keyboard,
client, DixWriteAccess); client, DixWriteAccess);
if (rc != Success) if (rc != Success)
@ -431,12 +413,6 @@ ProcXIChangeHierarchy(ClientPtr client)
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any; xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
DeviceIntPtr *xtstdevice; DeviceIntPtr *xtstdevice;
if (c->deviceid > 0xFF) /* FIXME */
{
client->errorValue = c->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&ptr, c->deviceid, client, rc = dixLookupDevice(&ptr, c->deviceid, client,
DixWriteAccess); DixWriteAccess);
if (rc != Success) if (rc != Success)
@ -470,17 +446,6 @@ ProcXIChangeHierarchy(ClientPtr client)
DeviceIntPtr newmaster; DeviceIntPtr newmaster;
DeviceIntPtr *xtstdevice; DeviceIntPtr *xtstdevice;
if (c->deviceid > 0xFF) /* FIXME */
{
client->errorValue = c->deviceid;
return BadImplementation;
}
if (c->new_master > 0xFF) /* FIXME */
{
client->errorValue = c->new_master;
return BadImplementation;
}
rc = dixLookupDevice(&ptr, c->deviceid, client, rc = dixLookupDevice(&ptr, c->deviceid, client,
DixWriteAccess); DixWriteAccess);
if (rc != Success) if (rc != Success)

View File

@ -70,9 +70,6 @@ ProcXIGrabDevice(ClientPtr client)
REQUEST(xXIGrabDeviceReq); REQUEST(xXIGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
if (stuff->deviceid > 0xFF) /* FIXME */
return BadImplementation;
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
if (ret != Success) if (ret != Success)
return ret; return ret;
@ -132,12 +129,6 @@ ProcXIUngrabDevice(ClientPtr client)
REQUEST(xXIUngrabDeviceReq); REQUEST(xXIUngrabDeviceReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success) if (ret != Success)
return ret; return ret;

View File

@ -90,9 +90,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
REQUEST(xXIPassiveGrabDeviceReq); REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
if (stuff->deviceid > 0xFF) /* FIXME */
return BadImplementation;
if (stuff->deviceid == XIAllDevices) if (stuff->deviceid == XIAllDevices)
dev = inputInfo.all_devices; dev = inputInfo.all_devices;
else if (stuff->deviceid == XIAllMasterDevices) else if (stuff->deviceid == XIAllMasterDevices)
@ -263,12 +260,6 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
REQUEST(xXIPassiveUngrabDeviceReq); REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;

View File

@ -1102,12 +1102,6 @@ ProcXIListProperties(ClientPtr client)
REQUEST(xXIListPropertiesReq); REQUEST(xXIListPropertiesReq);
REQUEST_SIZE_MATCH(xXIListPropertiesReq); REQUEST_SIZE_MATCH(xXIListPropertiesReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess); rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
@ -1142,12 +1136,6 @@ ProcXIChangeProperty(ClientPtr client)
REQUEST(xXIChangePropertyReq); REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
UpdateCurrentTime(); UpdateCurrentTime();
rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess); rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
@ -1176,13 +1164,6 @@ ProcXIDeleteProperty(ClientPtr client)
REQUEST(xXIDeletePropertyReq); REQUEST(xXIDeletePropertyReq);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq); REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
UpdateCurrentTime(); UpdateCurrentTime();
rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess); rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
if (rc != Success) if (rc != Success)
@ -1211,13 +1192,6 @@ ProcXIGetProperty(ClientPtr client)
Atom type; Atom type;
REQUEST_SIZE_MATCH(xXIGetPropertyReq); REQUEST_SIZE_MATCH(xXIGetPropertyReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
if (stuff->delete) if (stuff->delete)
UpdateCurrentTime(); UpdateCurrentTime();
rc = dixLookupDevice (&dev, stuff->deviceid, client, rc = dixLookupDevice (&dev, stuff->deviceid, client,

View File

@ -70,12 +70,6 @@ ProcXIQueryDevice(ClientPtr client)
REQUEST(xXIQueryDeviceReq); REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq); REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
if (stuff->deviceid != XIAllDevices && stuff->deviceid != XIAllMasterDevices) if (stuff->deviceid != XIAllDevices && stuff->deviceid != XIAllMasterDevices)
{ {
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);

View File

@ -81,12 +81,6 @@ ProcXIQueryPointer(ClientPtr client)
REQUEST(xXIQueryPointerReq); REQUEST(xXIQueryPointerReq);
REQUEST_SIZE_MATCH(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;

View File

@ -85,12 +85,6 @@ ProcXISelectEvents(ClientPtr client)
num_masks = stuff->num_masks; num_masks = stuff->num_masks;
while(num_masks--) while(num_masks--)
{ {
if (evmask->deviceid > 0xFF) /* FIXME */
{
client->errorValue = evmask->deviceid;
return BadImplementation;
}
if (evmask->deviceid != XIAllDevices && if (evmask->deviceid != XIAllDevices &&
evmask->deviceid != XIAllMasterDevices) evmask->deviceid != XIAllMasterDevices)
rc = dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess); rc = dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess);

View File

@ -71,11 +71,6 @@ ProcXISetClientPointer(ClientPtr client)
REQUEST(xXISetClientPointerReq); REQUEST(xXISetClientPointerReq);
REQUEST_SIZE_MATCH(xXISetClientPointerReq); REQUEST_SIZE_MATCH(xXISetClientPointerReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
if (rc != Success) if (rc != Success)

View File

@ -75,12 +75,6 @@ ProcXISetFocus(ClientPtr client)
REQUEST(xXISetFocusReq); REQUEST(xXISetFocusReq);
REQUEST_AT_LEAST_SIZE(xXISetFocusReq); REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess);
if (ret != Success) if (ret != Success)
return ret; return ret;
@ -101,12 +95,6 @@ ProcXIGetFocus(ClientPtr client)
REQUEST(xXIGetFocusReq); REQUEST(xXIGetFocusReq);
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
if (ret != Success) if (ret != Success)
return ret; return ret;

View File

@ -76,12 +76,6 @@ ProcXIWarpPointer(ClientPtr client)
REQUEST(xXIWarpPointerReq); REQUEST(xXIWarpPointerReq);
REQUEST_SIZE_MATCH(xXIWarpPointerReq); REQUEST_SIZE_MATCH(xXIWarpPointerReq);
if (stuff->deviceid > 0xFF) /* FIXME */
{
client->errorValue = stuff->deviceid;
return BadImplementation;
}
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */ /* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);

View File

@ -1050,11 +1050,11 @@ dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
*pDev = NULL; *pDev = NULL;
for (dev=inputInfo.devices; dev; dev=dev->next) { for (dev=inputInfo.devices; dev; dev=dev->next) {
if (dev->id == (CARD8)id) if (dev->id == id)
goto found; goto found;
} }
for (dev=inputInfo.off_devices; dev; dev=dev->next) { for (dev=inputInfo.off_devices; dev; dev=dev->next) {
if (dev->id == (CARD8)id) if (dev->id == id)
goto found; goto found;
} }
return BadDevice; return BadDevice;

View File

@ -489,7 +489,7 @@ typedef struct _DeviceIntRec {
int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */ int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
Atom xinput_type; Atom xinput_type;
char *name; char *name;
CARD8 id; int id;
KeyClassPtr key; KeyClassPtr key;
ValuatorClassPtr valuator; ValuatorClassPtr valuator;
ButtonClassPtr button; ButtonClassPtr button;