dump.c (1de7b4b805ddbf2429da511c053686ac4591ed89) dump.c (fa6d8b65d3956f69cde9043a3c5e77fb57788904)
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 469 unchanged lines hidden (view full) ---

478 str_index, pbuf, 256)) {
479 printf("STRING_0x%02x = <read error>\n", str_index);
480 } else {
481 printf("STRING_0x%02x = <%s>\n", str_index, pbuf);
482 }
483 }
484 free(pbuf);
485}
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 469 unchanged lines hidden (view full) ---

478 str_index, pbuf, 256)) {
479 printf("STRING_0x%02x = <read error>\n", str_index);
480 } else {
481 printf("STRING_0x%02x = <%s>\n", str_index, pbuf);
482 }
483 }
484 free(pbuf);
485}
486
487void
488dump_device_stats(struct libusb20_device *pdev)
489{
490 struct libusb20_device_stats st;
491
492 if (libusb20_dev_get_stats(pdev, &st)) {
493 printf("{}\n");
494 } else {
495 printf("{\n"
496 " UE_CONTROL_OK : %llu\n"
497 " UE_ISOCHRONOUS_OK : %llu\n"
498 " UE_BULK_OK : %llu\n"
499 " UE_INTERRUPT_OK : %llu\n"
500 " UE_CONTROL_FAIL : %llu\n"
501 " UE_ISOCHRONOUS_FAIL : %llu\n"
502 " UE_BULK_FAIL : %llu\n"
503 " UE_INTERRUPT_FAIL : %llu\n"
504 "}\n",
505 (unsigned long long)st.xfer_ok[0],
506 (unsigned long long)st.xfer_ok[1],
507 (unsigned long long)st.xfer_ok[2],
508 (unsigned long long)st.xfer_ok[3],
509 (unsigned long long)st.xfer_fail[0],
510 (unsigned long long)st.xfer_fail[1],
511 (unsigned long long)st.xfer_fail[2],
512 (unsigned long long)st.xfer_fail[3]);
513 }
514}