summaryrefslogtreecommitdiff
path: root/eventcomm.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-04-12 01:27:55 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:00 +0200
commit5a3e05478ae3e641791031c241dc00eb43598726 (patch)
tree9afe8241c4ed96adedb9afd338734e980f5acc00 /eventcomm.c
parentbda42daf592497ee210868660ce6be5a0f390e98 (diff)
Some work on abstracting out the protocol differences from
synaptics.c to make supporting the FreeBSD psm driver possible.
Diffstat (limited to 'eventcomm.c')
-rw-r--r--eventcomm.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/eventcomm.c b/eventcomm.c
new file mode 100644
index 0000000..bf25a76
--- /dev/null
+++ b/eventcomm.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 Peter Osterlund <petero2@telia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "eventcomm.h"
+#include "synproto.h"
+
+#include <xf86.h>
+
+
+
+#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
+
+
+/*****************************************************************************
+ * Function Definitions
+ ****************************************************************************/
+
+static void
+EventDeviceOnHook(LocalDevicePtr local)
+{
+ /* Try to grab the event device so that data don't leak to /dev/input/mice */
+ int ret;
+ SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1));
+ if (ret < 0) {
+ xf86Msg(X_WARNING, "%s can't grab event device\n",
+ local->name, errno);
+ }
+}
+
+static void
+EventDeviceOffHook(LocalDevicePtr local)
+{
+}
+
+
+
+struct SynapticsProtocolOperations event_proto_operations = {
+ EventDeviceOnHook,
+ EventDeviceOffHook
+};