aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-11 01:11:43 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-11 01:11:43 +0200
commit23c00b6ad319fcbdaa3d82dbd47d356ae03df5d8 (patch)
tree6664d0279b7ebb9150289f5dacdef1aba70b0bed
parent253991789a007836475eef9f3e846636bd8acb59 (diff)
cardemu: Fix interpretation of MSGC_MODEM messages
msg->l2h should always point at the first byte of the header after the generic simtrace header. For some reason this doesn't work if used globally, but it is required for the MSGC_MODEM messages to be interpreted correctly.
-rw-r--r--firmware/libcommon/source/mode_cardemu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c
index 3b6236d..16fd224 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -577,6 +577,9 @@ static void dispatch_usb_command(struct msgb *msg, struct cardem_inst *ci)
dispatch_usb_command_cardem(msg, ci);
break;
case SIMTRACE_MSGC_MODEM:
+ /* FIXME: Find out why this fails if used for !=
+ * MSGC_MODEM ?!? */
+ msg->l2h = msg->l1h + sizeof(*sh);
dispatch_usb_command_modem(msg, ci);
break;
default: