Changeset 7f70d1c in mainline for uspace/lib


Ignore:
Timestamp:
2017-12-19T09:07:15Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0bb4738
Parents:
32fb6bce
Message:

libusb: print also superspeed ep companion descriptor

Location:
uspace/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/dump.c

    r32fb6bce r7f70d1c  
    6161static void usb_dump_descriptor_endpoint(FILE *, const char *, const char *,
    6262    const uint8_t *, size_t);
     63static void usb_dump_descriptor_superspeed_endpoint_companion(FILE *, const char *, const char *,
     64    const uint8_t *, size_t);
    6365static void usb_dump_descriptor_hid(FILE *, const char *, const char *,
    6466    const uint8_t *, size_t);
     
    7577        { USB_DESCTYPE_INTERFACE, usb_dump_descriptor_interface },
    7678        { USB_DESCTYPE_ENDPOINT, usb_dump_descriptor_endpoint },
     79        { USB_DESCTYPE_SSPEED_EP_COMPANION, usb_dump_descriptor_superspeed_endpoint_companion },
    7780        { USB_DESCTYPE_HID, usb_dump_descriptor_hid },
    7881        { USB_DESCTYPE_HUB, usb_dump_descriptor_hub },
     
    238241        PRINTLINE("wMaxPacketSize = %d", d->max_packet_size);
    239242        PRINTLINE("bInterval = %dms", d->poll_interval);
     243}
     244
     245static void usb_dump_descriptor_superspeed_endpoint_companion(FILE *output,
     246    const char *line_prefix, const char *line_suffix,
     247    const uint8_t *descriptor, size_t descriptor_length)
     248{
     249        usb_superspeed_endpoint_companion_descriptor_t *d
     250           = (usb_superspeed_endpoint_companion_descriptor_t *) descriptor;
     251        if (descriptor_length < sizeof(*d)) {
     252                return;
     253        }
     254
     255        PRINTLINE("bLength = %u", d->length);
     256        PRINTLINE("bDescriptorType = 0x%02X", d->descriptor_type);
     257        PRINTLINE("bMaxBurst = %u", d->max_burst);
     258        PRINTLINE("bmAttributes = %d", d->attributes);
     259        PRINTLINE("wBytesPerInterval = %u", d->bytes_per_interval);
    240260}
    241261
  • uspace/lib/usbdev/src/dp.c

    r32fb6bce r7f70d1c  
    6262        NESTING(CONFIGURATION, INTERFACE),
    6363        NESTING(INTERFACE, ENDPOINT),
     64        NESTING(ENDPOINT, SSPEED_EP_COMPANION),
    6465        NESTING(INTERFACE, HUB),
    6566        NESTING(INTERFACE, HID),
Note: See TracChangeset for help on using the changeset viewer.