<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10319">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">remsim: fix USB hanging USB transfer<br><br>After a couple of seconds of USB data exchange between remsim and<br>cardem, the USB transfer hangs.<br>On host side (remsim) I can see the USB BULK IN request.<br>On device side (cardem) I see that data has been submitted and<br>"sent" over USB, but on wireshark with USBmon I don't see the<br>corresponding USB BULK IN response.<br>When exiting remsim or just after powering of qmod (causing an<br>error in remsim) the USB BULK IN is show in wireshark. Thus it<br>must have been in a buffer, but not read by libusb_bulk_transfer.<br>By shortening the timeout a new libusb_bulk_transfer is made more<br>frequently, and the data gets read successfully.<br><br>T;his change also fixes the URB data display.<br><br>Change-Id: I1d124a41cc90893506933f6d76dc7331e52a74f9<br>---<br>M host/simtrace2-remsim.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c</span><br><span>index 52c5051..9a681b4 100644</span><br><span>--- a/host/simtrace2-remsim.c</span><br><span>+++ b/host/simtrace2-remsim.c</span><br><span>@@ -536,7 +536,7 @@</span><br><span>             /* read data from SIMtrace2 device (local or via USB) */</span><br><span>             if (transp->udp_fd < 0) {</span><br><span>                      rc = libusb_bulk_transfer(transp->usb_devh, transp->usb_ep.in,</span><br><span style="color: hsl(0, 100%, 40%);">-                                              buf, sizeof(buf), &xfer_len, 100000);</span><br><span style="color: hsl(120, 100%, 40%);">+                                             buf, sizeof(buf), &xfer_len, 100);</span><br><span>                     if (rc < 0 && rc != LIBUSB_ERROR_TIMEOUT &&</span><br><span>                                     rc != LIBUSB_ERROR_INTERRUPTED &&</span><br><span>                                    rc != LIBUSB_ERROR_IO) {</span><br><span>@@ -553,7 +553,7 @@</span><br><span>                 }</span><br><span>            /* dispatch any incoming data */</span><br><span>             if (xfer_len > 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  printf("URB: %s\n", osmo_hexdump(buf, rc));</span><br><span style="color: hsl(120, 100%, 40%);">+                 printf("URB: %s\n", osmo_hexdump(buf, xfer_len));</span><br><span>                  process_usb_msg(ci, buf, xfer_len);</span><br><span>                  msg_count++;</span><br><span>                         byte_count += xfer_len;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10319">change 10319</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10319"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1d124a41cc90893506933f6d76dc7331e52a74f9 </div>
<div style="display:none"> Gerrit-Change-Number: 10319 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>