summaryrefslogtreecommitdiff
path: root/Xi/chgdctl.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-10-20 00:28:40 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-10-20 00:43:11 +0300
commita8d3dad9d9f2b9053843e655abe463a68ba8dcb7 (patch)
treeecdd1935f9aa2b76a65504c2fb95af6e19ce5016 /Xi/chgdctl.c
parentb0780312d80ea4af0136227f90fdd7ada3db71c5 (diff)
xi: add DEVICE_ENABLE control
Add DEVICE_ENABLE control, which allows runtime enabling and disabling of specific devices.
Diffstat (limited to 'Xi/chgdctl.c')
-rw-r--r--Xi/chgdctl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index ebe086548..4b9c2b6ed 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -106,6 +106,7 @@ ProcXChangeDeviceControl(ClientPtr client)
CARD32 *resolution;
xDeviceTSCtl *ts;
xDeviceCoreCtl *c;
+ xDeviceEnableCtl *e;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
@@ -218,6 +219,28 @@ ProcXChangeDeviceControl(ClientPtr client)
}
break;
+ case DEVICE_ENABLE:
+ e = (xDeviceEnableCtl *)&stuff[1];
+
+ status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e);
+
+ if (status == Success) {
+ if (e->enable)
+ EnableDevice(dev);
+ else
+ DisableDevice(dev);
+ } else if (status == DeviceBusy) {
+ rep.status = DeviceBusy;
+ WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
+ &rep);
+ return Success;
+ } else {
+ SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+
+ break;
default:
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue);
return Success;