aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorWilliam Steidtmann <billstei@hbci.com>2013-04-15 16:17:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-16 17:53:34 -0400
commit76dea4cf52784474ca6adc4a2addf55e128b3634 (patch)
tree8cb8448e86da3d07a29347dbbcaa59bfe8ed1912 /drivers/media/rc
parentbebe3c69de77fed87c1e36cc18e9c80985391918 (diff)
[media] mceusb: add some missing cmd sizes
Fix mceusb_cmdsize() which returns incorrect datasize=0 for sub-commands MCE_RSP_GETPORTSTATUS, MCE_RSP_GETWAKESOURCE, MCE_RSP_EQDEVDETAILS, MCE_RSP_EQEMVER, and MCE_RSP_EQIRNUMPORTS. While here, change mceusb_cmdsize() name to reflect that it returns data size not cmd size. Signed-off-by: William Steidtmann <billstei@hbci.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/mceusb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 5b5b6e6f79e8..3c761014d3ce 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -482,7 +482,7 @@ static char SET_RX_SENSOR[] = {MCE_CMD_PORT_IR,
482 MCE_RSP_EQIRRXPORTEN, 0x00}; 482 MCE_RSP_EQIRRXPORTEN, 0x00};
483*/ 483*/
484 484
485static int mceusb_cmdsize(u8 cmd, u8 subcmd) 485static int mceusb_cmd_datasize(u8 cmd, u8 subcmd)
486{ 486{
487 int datasize = 0; 487 int datasize = 0;
488 488
@@ -493,6 +493,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
493 break; 493 break;
494 case MCE_CMD_PORT_SYS: 494 case MCE_CMD_PORT_SYS:
495 switch (subcmd) { 495 switch (subcmd) {
496 case MCE_RSP_GETPORTSTATUS:
497 datasize = 5;
498 break;
496 case MCE_RSP_EQWAKEVERSION: 499 case MCE_RSP_EQWAKEVERSION:
497 datasize = 4; 500 datasize = 4;
498 break; 501 break;
@@ -500,6 +503,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
500 datasize = 2; 503 datasize = 2;
501 break; 504 break;
502 case MCE_RSP_EQWAKESUPPORT: 505 case MCE_RSP_EQWAKESUPPORT:
506 case MCE_RSP_GETWAKESOURCE:
507 case MCE_RSP_EQDEVDETAILS:
508 case MCE_RSP_EQEMVER:
503 datasize = 1; 509 datasize = 1;
504 break; 510 break;
505 } 511 }
@@ -509,6 +515,7 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
509 case MCE_RSP_EQIRCFS: 515 case MCE_RSP_EQIRCFS:
510 case MCE_RSP_EQIRTIMEOUT: 516 case MCE_RSP_EQIRTIMEOUT:
511 case MCE_RSP_EQIRRXCFCNT: 517 case MCE_RSP_EQIRRXCFCNT:
518 case MCE_RSP_EQIRNUMPORTS:
512 datasize = 2; 519 datasize = 2;
513 break; 520 break;
514 case MCE_CMD_SIG_END: 521 case MCE_CMD_SIG_END:
@@ -968,7 +975,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
968 for (; i < buf_len; i++) { 975 for (; i < buf_len; i++) {
969 switch (ir->parser_state) { 976 switch (ir->parser_state) {
970 case SUBCMD: 977 case SUBCMD:
971 ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]); 978 ir->rem = mceusb_cmd_datasize(ir->cmd, ir->buf_in[i]);
972 mceusb_dev_printdata(ir, ir->buf_in, i - 1, 979 mceusb_dev_printdata(ir, ir->buf_in, i - 1,
973 ir->rem + 2, false); 980 ir->rem + 2, false);
974 mceusb_handle_command(ir, i); 981 mceusb_handle_command(ir, i);