diff options
author | Harald Welte <laforge@osmocom.org> | 2020-01-11 17:33:08 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-03-03 21:09:50 +0100 |
commit | 6a6dcf2a27f450129318c95b94d75dbe21e79448 (patch) | |
tree | 7a9da04547a170df4c8b3bbdd38baf45d7c23f40 | |
parent | 61a01b77f6890177c13a23d19613364cf27a1e7b (diff) |
WIP: firmware: sniffer: inbound USB handlinglaforge/wip
Change-Id: Ic953148600d82285281abcb573a07e2e9b8082a7
-rw-r--r-- | firmware/libcommon/source/sniffer.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 78413ec..7fd9961 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -977,8 +977,22 @@ static void usb_send_change(uint32_t flags) /* handle incoming message from USB OUT EP */ static void dispatch_usb_out(struct msgb *msg, const struct usb_if *usb_if) { - /* currently we don't need any incoming data */ - msgb_free(msg); + struct simtrace_msg_hdr *sh = (Struct simtrace_msg_hdr *) msg->l1h; + + if (msg_length(msg) < sizeof(*sh)) { + usb_buf_free(msg); + return; + } + msg->l2h = msg->l1h + sizeof(*sh); + + switch (sh->msg_class) { + case SIMTRACE_MSGC_GENERIC: + break; + default: + break; + } + + usb_buf_free(msg); } static const struct usb_if sniffer_usb_if = { |