summaryrefslogtreecommitdiff
path: root/include/mtdev.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-06-21 22:43:58 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-06-22 00:44:40 +0200
commitba936eddbf88b6d8f650082f6e7d2694f8addac4 (patch)
tree100f573c6ca7e8c35ca2a02d8ad7974d2b86c4bb /include/mtdev.h
parentdbbf15a7fad8b76122061344aeddb652bd4fe442 (diff)
Unused slot is denoted by MT_TRACKING_ID == -1
The current MT slot protocol allows any tracking id outside the range specified by the device to denote an unused slot. This is difficult to handle in userspace, since the valid range is unknown. This patch tightens the definition of a valid tracking id to always lie in the range [0, MT_ID_MAX], and uses the value -1 to denote an unused slot. Acked-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include/mtdev.h')
-rw-r--r--include/mtdev.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/mtdev.h b/include/mtdev.h
index b759803..b621245 100644
--- a/include/mtdev.h
+++ b/include/mtdev.h
@@ -74,11 +74,14 @@
74 74
75#define MT_ABS_SIZE 11 75#define MT_ABS_SIZE 11
76 76
77#define MT_ID_NULL (-1)
78#define MT_ID_MIN 0
79#define MT_ID_MAX 65535
80
77/** 81/**
78 * struct mt_caps - protocol capabilities of kernel device 82 * struct mt_caps - protocol capabilities of kernel device
79 * @has_mtdata: true if the device has MT capabilities 83 * @has_mtdata: true if the device has MT capabilities
80 * @has_slot: true if the device sends MT slots 84 * @has_slot: true if the device sends MT slots
81 * @nullid: tracking id used to represent null
82 * @slot: slot event properties 85 * @slot: slot event properties
83 * @abs: ABS_MT event properties 86 * @abs: ABS_MT event properties
84 */ 87 */
@@ -86,7 +89,6 @@ struct mtdev_caps {
86 int has_mtdata; 89 int has_mtdata;
87 int has_slot; 90 int has_slot;
88 int has_abs[MT_ABS_SIZE]; 91 int has_abs[MT_ABS_SIZE];
89 int nullid;
90 struct input_absinfo slot; 92 struct input_absinfo slot;
91 struct input_absinfo abs[MT_ABS_SIZE]; 93 struct input_absinfo abs[MT_ABS_SIZE];
92}; 94};