From 23c00b6ad319fcbdaa3d82dbd47d356ae03df5d8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 11 May 2017 01:11:43 +0200 Subject: [PATCH] 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. --- firmware/libcommon/source/mode_cardemu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 3b6236da..16fd224d 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: