ThinkPad X60 Tablet PC (pen only device) sometime posts
packets that are larger than W8001_PKTLEN_TPCPEN.

NOTE: The w8001 struct has no touch_dev member in 2.6.36
or 2.6.30.

Reported-by: Chris J Arges <[email protected]>
Tested-by: Chris J Arges <[email protected]>
Signed-off-by: Ping Cheng <[email protected]>
Reviewed-by: Peter Hutterer <[email protected]>
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
[[email protected]: Imported into input-wacom repository (9e72ac7)]
Signed-off-by: Jason Gerecke <[email protected]>
[[email protected]: backported from input-wacom repository (0ae81e81)]
Signed-off-by: Aaron Skomra <[email protected]>
---
 2.6.38/wacom_w8001.c | 9 +++++++++
 3.7/wacom_w8001.c    | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/2.6.38/wacom_w8001.c b/2.6.38/wacom_w8001.c
index ed04bb9..de7b8ef 100644
--- a/2.6.38/wacom_w8001.c
+++ b/2.6.38/wacom_w8001.c
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
                w8001->idx = 0;
                parse_multi_touch(w8001);
                break;
+
+       default:
+               /*
+                * ThinkPad X60 Tablet PC (pen only device) sometimes
+                * sends invalid data packets that are larger than
+                * W8001_PKTLEN_TPCPEN. Let's start over again.
+                */
+               if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+                       w8001->idx = 0;
        }
 
        return IRQ_HANDLED;
diff --git a/3.7/wacom_w8001.c b/3.7/wacom_w8001.c
index b1b4127..0c9191c 100644
--- a/3.7/wacom_w8001.c
+++ b/3.7/wacom_w8001.c
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
                w8001->idx = 0;
                parse_multi_touch(w8001);
                break;
+
+       default:
+               /*
+                * ThinkPad X60 Tablet PC (pen only device) sometimes
+                * sends invalid data packets that are larger than
+                * W8001_PKTLEN_TPCPEN. Let's start over again.
+                */
+               if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+                       w8001->idx = 0;
        }
 
        return IRQ_HANDLED;
-- 
1.9.1


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to