Commit 76dea4cf authored by William Steidtmann's avatar William Steidtmann Committed by Mauro Carvalho Chehab

[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: default avatarWilliam Steidtmann <billstei@hbci.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bebe3c69
...@@ -482,7 +482,7 @@ static char SET_RX_SENSOR[] = {MCE_CMD_PORT_IR, ...@@ -482,7 +482,7 @@ static char SET_RX_SENSOR[] = {MCE_CMD_PORT_IR,
MCE_RSP_EQIRRXPORTEN, 0x00}; MCE_RSP_EQIRRXPORTEN, 0x00};
*/ */
static int mceusb_cmdsize(u8 cmd, u8 subcmd) static int mceusb_cmd_datasize(u8 cmd, u8 subcmd)
{ {
int datasize = 0; int datasize = 0;
...@@ -493,6 +493,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd) ...@@ -493,6 +493,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
break; break;
case MCE_CMD_PORT_SYS: case MCE_CMD_PORT_SYS:
switch (subcmd) { switch (subcmd) {
case MCE_RSP_GETPORTSTATUS:
datasize = 5;
break;
case MCE_RSP_EQWAKEVERSION: case MCE_RSP_EQWAKEVERSION:
datasize = 4; datasize = 4;
break; break;
...@@ -500,6 +503,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd) ...@@ -500,6 +503,9 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
datasize = 2; datasize = 2;
break; break;
case MCE_RSP_EQWAKESUPPORT: case MCE_RSP_EQWAKESUPPORT:
case MCE_RSP_GETWAKESOURCE:
case MCE_RSP_EQDEVDETAILS:
case MCE_RSP_EQEMVER:
datasize = 1; datasize = 1;
break; break;
} }
...@@ -509,6 +515,7 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd) ...@@ -509,6 +515,7 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
case MCE_RSP_EQIRCFS: case MCE_RSP_EQIRCFS:
case MCE_RSP_EQIRTIMEOUT: case MCE_RSP_EQIRTIMEOUT:
case MCE_RSP_EQIRRXCFCNT: case MCE_RSP_EQIRRXCFCNT:
case MCE_RSP_EQIRNUMPORTS:
datasize = 2; datasize = 2;
break; break;
case MCE_CMD_SIG_END: case MCE_CMD_SIG_END:
...@@ -968,7 +975,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) ...@@ -968,7 +975,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
for (; i < buf_len; i++) { for (; i < buf_len; i++) {
switch (ir->parser_state) { switch (ir->parser_state) {
case SUBCMD: case SUBCMD:
ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]); ir->rem = mceusb_cmd_datasize(ir->cmd, ir->buf_in[i]);
mceusb_dev_printdata(ir, ir->buf_in, i - 1, mceusb_dev_printdata(ir, ir->buf_in, i - 1,
ir->rem + 2, false); ir->rem + 2, false);
mceusb_handle_command(ir, i); mceusb_handle_command(ir, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment