mirror of https://gerrit.osmocom.org/simtrace2
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
This commit is contained in:
parent
910e6830b9
commit
04ccb770fd
|
@ -536,7 +536,7 @@ static void run_mainloop(struct cardem_inst *ci)
|
|||
/* 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 @@ static void run_mainloop(struct cardem_inst *ci)
|
|||
}
|
||||
/* 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;
|
||||
|
|
Loading…
Reference in New Issue