laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 )
Change subject: usb: Print failed USB isochronous packets ......................................................................
usb: Print failed USB isochronous packets
Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/26819/1
diff --git a/src/usb.c b/src/usb.c index d5107bc..2ccb3ac 100644 --- a/src/usb.c +++ b/src/usb.c @@ -173,6 +173,18 @@ // USB flow // ---------------------------------------------------------------------------
+/* strings for enum libusb_transfer_status */ +static const struct value_string libusb_status_str[] = { + { LIBUSB_TRANSFER_COMPLETED, "COMPLETED" }, + { LIBUSB_TRANSFER_ERROR, "ERROR" }, + { LIBUSB_TRANSFER_TIMED_OUT, "TIMED_OUT" }, + { LIBUSB_TRANSFER_CANCELLED, "CANCELLED" }, + { LIBUSB_TRANSFER_STALL, "STALL" }, + { LIBUSB_TRANSFER_NO_DEVICE, "NO_DEVICE" }, + { LIBUSB_TRANSFER_OVERFLOW, "OVERFLOW" }, + { 0, NULL } +}; + static void LIBUSB_CALL _e1uf_xfr(struct libusb_transfer *xfr) { @@ -184,18 +196,29 @@
/* FIXME: Check transfer status ? Error handling ? */
+ if (flow->ep & 0x80) { for (j=0; j<flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "IN EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } flow->cb(flow, libusb_get_iso_packet_buffer_simple(xfr, j), - (xfr->iso_packet_desc[j].status == LIBUSB_TRANSFER_COMPLETED) ? - xfr->iso_packet_desc[j].actual_length : -1 + (iso_pd->status == LIBUSB_TRANSFER_COMPLETED) ? iso_pd->actual_length : -1 ); - len += (xfr->iso_packet_desc[j].length = flow->size); + len += (iso_pd->length = flow->size); } } else { - for (j=0; j<flow->ppx; j++) - len += (xfr->iso_packet_desc[j].length = flow->cb(flow, &xfr->buffer[len], flow->size)); + for (j=0; j<flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "OUT EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } + len += (iso_pd->length = flow->cb(flow, &xfr->buffer[len], flow->size)); + } }
libusb_fill_iso_transfer(xfr, id->devh, flow->ep,
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 )
Change subject: usb: Print failed USB isochronous packets ......................................................................
Patch Set 1: Code-Review+1
Hello Jenkins Builder, tnt,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/26819
to look at the new patch set (#2).
Change subject: usb: Print failed USB isochronous packets ......................................................................
usb: Print failed USB isochronous packets
Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/26819/2
Hello Jenkins Builder, tnt,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/26819
to look at the new patch set (#3).
Change subject: usb: Print failed USB isochronous packets ......................................................................
usb: Print failed USB isochronous packets
Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/26819/3
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 )
Change subject: usb: Print failed USB isochronous packets ......................................................................
Patch Set 4:
(1 comment)
https://gerrit.osmocom.org/c/osmo-e1d/+/26819/4/src/usb.c File src/usb.c:
https://gerrit.osmocom.org/c/osmo-e1d/+/26819/4/src/usb.c@210 PS4, Line 210: (int)xfr->iso_packet_desc[j].actual_length : -1 iso_pd->actual_length ?
Hello Jenkins Builder, tnt,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/26819
to look at the new patch set (#5).
Change subject: usb: Print failed USB isochronous packets ......................................................................
usb: Print failed USB isochronous packets
Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/26819/5
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 )
Change subject: usb: Print failed USB isochronous packets ......................................................................
Patch Set 5: Code-Review+2
tnt has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 )
Change subject: usb: Print failed USB isochronous packets ......................................................................
usb: Print failed USB isochronous packets
Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 5 deletions(-)
Approvals: Jenkins Builder: Verified tnt: Looks good to me, approved
diff --git a/src/usb.c b/src/usb.c index 80963a1..8124f26 100644 --- a/src/usb.c +++ b/src/usb.c @@ -173,6 +173,18 @@ // USB flow // ---------------------------------------------------------------------------
+/* strings for enum libusb_transfer_status */ +static const struct value_string libusb_status_str[] = { + { LIBUSB_TRANSFER_COMPLETED, "COMPLETED" }, + { LIBUSB_TRANSFER_ERROR, "ERROR" }, + { LIBUSB_TRANSFER_TIMED_OUT, "TIMED_OUT" }, + { LIBUSB_TRANSFER_CANCELLED, "CANCELLED" }, + { LIBUSB_TRANSFER_STALL, "STALL" }, + { LIBUSB_TRANSFER_NO_DEVICE, "NO_DEVICE" }, + { LIBUSB_TRANSFER_OVERFLOW, "OVERFLOW" }, + { 0, NULL } +}; + static void LIBUSB_CALL _e1uf_xfr(struct libusb_transfer *xfr) { @@ -184,18 +196,29 @@
/* FIXME: Check transfer status ? Error handling ? */
+ if (flow->ep & 0x80) { for (j = 0; j < flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "IN EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } flow->cb(flow, libusb_get_iso_packet_buffer_simple(xfr, j), - (xfr->iso_packet_desc[j].status == LIBUSB_TRANSFER_COMPLETED) ? - (int)xfr->iso_packet_desc[j].actual_length : -1 + (iso_pd->status == LIBUSB_TRANSFER_COMPLETED) ? (int)iso_pd->actual_length : -1 ); - len += (xfr->iso_packet_desc[j].length = flow->size); + len += (iso_pd->length = flow->size); } } else { - for (j = 0; j < flow->ppx; j++) - len += (xfr->iso_packet_desc[j].length = flow->cb(flow, &xfr->buffer[len], flow->size)); + for (j = 0; j < flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "OUT EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } + len += (iso_pd->length = flow->cb(flow, &xfr->buffer[len], flow->size)); + } }
libusb_fill_iso_transfer(xfr, id->devh, flow->ep,