From ba936eddbf88b6d8f650082f6e7d2694f8addac4 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 21 Jun 2010 22:43:58 +0200 Subject: 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 Signed-off-by: Henrik Rydberg --- include/mtdev.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/mtdev.h') 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 @@ #define MT_ABS_SIZE 11 +#define MT_ID_NULL (-1) +#define MT_ID_MIN 0 +#define MT_ID_MAX 65535 + /** * struct mt_caps - protocol capabilities of kernel device * @has_mtdata: true if the device has MT capabilities * @has_slot: true if the device sends MT slots - * @nullid: tracking id used to represent null * @slot: slot event properties * @abs: ABS_MT event properties */ @@ -86,7 +89,6 @@ struct mtdev_caps { int has_mtdata; int has_slot; int has_abs[MT_ABS_SIZE]; - int nullid; struct input_absinfo slot; struct input_absinfo abs[MT_ABS_SIZE]; }; -- cgit v1.2.3