From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: Linux USB HID should ignore values outside Logical Minimum/Maximum range Date: Mon, 24 Oct 2011 13:32:04 -0700 Message-ID: <20111024203204.GA31721@core.coreip.homeip.net> References: <1319476183.3210.12.camel@lovely> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1319476183.3210.12.camel@lovely> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Fritz Cc: Denilson Figueiredo de =?iso-8859-1?Q?S=E1?= , linux-kernel@vger.kernel.org, Jiri Kosina , linux-input@vger.kernel.org, linux-usb@vger.kernel.org List-Id: linux-input@vger.kernel.org Hi Christoph, On Mon, Oct 24, 2011 at 07:09:43PM +0200, Christoph Fritz wrote: > Hi Denilson, >=20 > please see my comment below. >=20 > On Sat, 2011-10-22 at 09:42 -0200, Denilson Figueiredo de S=E1 wrote: > > Short description: > >=20 > > An absolute pointing device using USB HID defines a LOGICAL_MINIMUM= and > > a LOGICAL_MAXIMUM for X, Y axes, and then sends a HID report contai= ning > > values outside that range. > >=20 > > Linux kernel should ignore values outside that range, as they are n= ot > > meaningful. >=20 > To answer with a quote from the comment above input.h:"struct > input_absinfo": >=20 > * > * Note that input core does not clamp reported values to the > * [minimum, maximum] limits, such task is left to userspace. > * >=20 > to do so, use this from input.h: >=20 > #define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo)= /* get abs value/limits */ > #define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo)= /* set abs value/limits */ While input core does not clam or validate the values reported by the driver it might make sense to do so in hid-input; I am not sure how often these limits programmed intorrectly. Jiri i sprobably the best person to answer this question. Thanks. --=20 Dmitry