This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] ati_remote: Check the checksum
Author:  George Spelvin <li...@horizon.com>
Date:    Sun May 11 08:12:09 2014 -0300

An input report is 4 bytes long, but there are only 12 bits
of actual payload.  The 4 bytes are:
data[0] = 0x14
data[1] = data[2] + data[3] + 0xd5 (a checksum byte)
data[2] = the raw scancode (plus toggle bit in msbit)
data[3] = channel << 4 (the low 4 bits must be zero)

Ignore reports with a bad checksum.

Signed-off-by: George Spelvin <li...@horizon.com>
Signed-off-by: Mauro Carvalho Chehab <m.che...@samsung.com>

 drivers/media/rc/ati_remote.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=20d7e3ca1be76a13fb4ea22246bb9d0c4c365809

diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 2e13353..52a5af6 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -507,8 +507,9 @@ static void ati_remote_input_report(struct urb *urb)
         */
 
        /* Deal with strange looking inputs */
-       if ( (urb->actual_length != 4) || (data[0] != 0x14) ||
-               ((data[3] & 0x0f) != 0x00) ) {
+       if ( urb->actual_length != 4 || data[0] != 0x14 ||
+            data[1] != (unsigned char)(data[2] + data[3] + 0xD5) ||
+            (data[3] & 0x0f) != 0x00) {
                ati_remote_dump(&urb->dev->dev, data, urb->actual_length);
                return;
        }
@@ -524,9 +525,9 @@ static void ati_remote_input_report(struct urb *urb)
        remote_num = (data[3] >> 4) & 0x0f;
        if (channel_mask & (1 << (remote_num + 1))) {
                dbginfo(&ati_remote->interface->dev,
-                       "Masked input from channel 0x%02x: data %02x,%02x, "
+                       "Masked input from channel 0x%02x: data %02x, "
                        "mask= 0x%02lx\n",
-                       remote_num, data[1], data[2], channel_mask);
+                       remote_num, data[2], channel_mask);
                return;
        }
 

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to