Change in osmo-e1d[master]: usb: Print failed USB isochronous packets
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, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-MessageType: newchange
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-Comment-Date: Sun, 09 Jan 2022 17:09:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-MessageType: newpatchset
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-MessageType: newpatchset
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 ? -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-Comment-Date: Sun, 09 Jan 2022 22:50:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-MessageType: newpatchset
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-Comment-Date: Mon, 10 Jan 2022 10:04:27 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
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, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-MessageType: merged
participants (2)
-
laforge -
tnt