Change in simtrace2[master]: remsim: fix USB hanging USB transfer

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Aug 5 06:56:14 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10319 )

Change subject: remsim: fix USB hanging USB transfer
......................................................................

remsim: fix USB hanging USB transfer

After a couple of seconds of USB data exchange between remsim and
cardem, the USB transfer hangs.
On host side (remsim) I can see the USB BULK IN request.
On device side (cardem) I see that data has been submitted and
"sent" over USB, but on wireshark with USBmon I don't see the
corresponding USB BULK IN response.
When exiting remsim or just after powering of qmod (causing an
error in remsim) the USB BULK IN is show in wireshark. Thus it
must have been in a buffer, but not read by libusb_bulk_transfer.
By shortening the timeout a new libusb_bulk_transfer is made more
frequently, and the data gets read successfully.

T;his change also fixes the URB data display.

Change-Id: I1d124a41cc90893506933f6d76dc7331e52a74f9
---
M host/simtrace2-remsim.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 52c5051..9a681b4 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -536,7 +536,7 @@
 		/* read data from SIMtrace2 device (local or via USB) */
 		if (transp->udp_fd < 0) {
 			rc = libusb_bulk_transfer(transp->usb_devh, transp->usb_ep.in,
-						  buf, sizeof(buf), &xfer_len, 100000);
+						  buf, sizeof(buf), &xfer_len, 100);
 			if (rc < 0 && rc != LIBUSB_ERROR_TIMEOUT &&
 				      rc != LIBUSB_ERROR_INTERRUPTED &&
 				      rc != LIBUSB_ERROR_IO) {
@@ -553,7 +553,7 @@
 		}
 		/* dispatch any incoming data */
 		if (xfer_len > 0) {
-			printf("URB: %s\n", osmo_hexdump(buf, rc));
+			printf("URB: %s\n", osmo_hexdump(buf, xfer_len));
 			process_usb_msg(ci, buf, xfer_len);
 			msg_count++;
 			byte_count += xfer_len;

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1d124a41cc90893506933f6d76dc7331e52a74f9
Gerrit-Change-Number: 10319
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180805/1faa858e/attachment.htm>


More information about the gerrit-log mailing list