Continue teasing apart protocol-specific bits from core into transport
modules. This time move RS232-specific command completion handling
from core to iforce-serio module.
Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
struct input_dev *dev = iforce->dev;
int i;
-#ifdef CONFIG_JOYSTICK_IFORCE_232
- if (HI(iforce->expect_packet) == HI(cmd)) {
- iforce->expect_packet = 0;
- iforce->ecmd = cmd;
- memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
- }
-#endif
wake_up(&iforce->wait);
if (!iforce->type)
}
if (iforce->idx == iforce->len) {
- iforce_process_packet(iforce, (iforce->id << 8) | iforce->idx, iforce->data);
+ u16 cmd = (iforce->id << 8) | iforce->idx;
+
+ /* Handle command completion */
+ if (HI(iforce->expect_packet) == HI(cmd)) {
+ iforce->expect_packet = 0;
+ iforce->ecmd = cmd;
+ memcpy(iforce->edata, iforce->data, IFORCE_MAX_LENGTH);
+ }
+
+ iforce_process_packet(iforce, cmd, iforce->data);
+
iforce->pkt = 0;
iforce->id = 0;
iforce->len = 0;