Change in simtrace2[master]: WIP: firmware: sniffer: inbound USB handling

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Jan 11 16:56:23 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/16805 )


Change subject: WIP: firmware: sniffer: inbound USB handling
......................................................................

WIP: firmware: sniffer: inbound USB handling

Change-Id: Ic953148600d82285281abcb573a07e2e9b8082a7
---
M firmware/libcommon/source/sniffer.c
1 file changed, 16 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/05/16805/1

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 @@
 /* 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 = {

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/16805
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ic953148600d82285281abcb573a07e2e9b8082a7
Gerrit-Change-Number: 16805
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200111/91578046/attachment.htm>


More information about the gerrit-log mailing list