lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110825070642.GB15655@core.coreip.homeip.net>
Date:	Thu, 25 Aug 2011 00:06:42 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	JJ Ding <jj_ding@....com.tw>
Cc:	Seth Forshee <seth.forshee@...onical.com>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	Aaron Huang <aaron_huang@....com.tw>,
	Tom Lin <tom_lin@....com.tw>,
	Éric Piel <E.A.B.Piel@...elft.nl>,
	Daniel Kurtz <djkurtz@...omium.org>,
	Chase Douglas <chase.douglas@...onical.com>,
	Henrik Rydberg <rydberg@...omail.se>,
	Alessandro Rubini <rubini@...l.unipv.it>
Subject: Re: [PATCH v2 7/7] Input: elantech - add v3 hardware support

On Thu, Aug 25, 2011 at 09:09:02AM +0800, JJ Ding wrote:
> Hi Seth,
> 
> Thank you. You are right.
> I think I somehow tested the worng touchpad for this patch.
> 

How about we change it thusly:

Input: elamtech - fix V3 packet checking

Signed-off-by: Dmitry Torokhov <dtor@...l.ru>
---

 drivers/input/mouse/elantech.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)


diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 1e2b9da..d814bf74 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -508,24 +508,18 @@ static int elantech_packet_check_v2(struct psmouse *psmouse)
  */
 static int elantech_packet_check_v3(struct psmouse *psmouse)
 {
+	const u8 debounce_packet[] = { 0xc4, 0xff, 0xff, 0x02, 0xff, 0xff };
 	unsigned char *packet = psmouse->packet;
 
-	if ((packet[0] & 0x0c) == 0x04 &&
-	    (packet[3] & 0xcf) == 0x02)
+	if (!memcmp(packet, debounce_packet, sizeof(debounce_packet)))
+		return PACKET_DEBOUNCE;
+
+	if ((packet[0] & 0x0c) == 0x04 && (packet[3] & 0xcf) == 0x02)
 		return PACKET_V3_HEAD;
 
-	if ((packet[0] & 0x0c) == 0x0c &&
-	    (packet[3] & 0xce) == 0x0c)
+	if ((packet[0] & 0x0c) == 0x0c && (packet[3] & 0xce) == 0x0c)
 		return PACKET_V3_TAIL;
 
-	if (packet[0] == 0xc4 &&
-	    packet[1] == 0xff &&
-	    packet[2] == 0xff &&
-	    packet[3] == 0x02 &&
-	    packet[4] == 0xff &&
-	    packet[5] == 0xff)
-		return PACKET_DEBOUNCE;
-
 	return PACKET_UNKNOWN;
 }
 
Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ