]> git.baikalelectronics.ru Git - kernel.git/commit
[media] ati_remote: Check the checksum
authorGeorge Spelvin <linux@horizon.com>
Sun, 11 May 2014 11:12:09 +0000 (08:12 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 26 Jul 2014 02:44:23 +0000 (23:44 -0300)
commit9dd372735e0b93734876a6bf676a275c8bbfa6a8
tree55145fffdb69774a882a38e0a4b1086271107716
parentb22defeaf7b58f5522c8e73491b65c51426dbe4c
[media] ati_remote: Check the checksum

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 <linux@horizon.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/rc/ati_remote.c