Changeset 4989d73 in mainline for uspace/app/usbinfo/dump.c


Ignore:
Timestamp:
2011-01-14T14:28:46Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c9d5577
Parents:
6fe1ab4
Message:

usbinfo dumps endpoint descriptor nicely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/dump.c

    r6fe1ab4 r4989d73  
    210210void dump_descriptor_endpoint(size_t indent, uint8_t *descr, size_t size)
    211211{
    212         dump_descriptor_generic(indent, descr, size);
     212        usb_standard_endpoint_descriptor_t *d
     213           = (usb_standard_endpoint_descriptor_t *) descr;
     214       
     215        int endpoint = d->endpoint_address & 15;
     216        usb_direction_t direction = d->endpoint_address & 128
     217            ? USB_DIRECTION_IN : USB_DIRECTION_OUT;
     218       
     219        PRINTLINE(indent, "bLength = %d\n", d->length);
     220        PRINTLINE(indent, "bDescriptorType = 0x%02X\n", d->descriptor_type);
     221        PRINTLINE(indent, "bEndpointAddress = 0x%02X [%d, %s]\n",
     222            d->endpoint_address, endpoint,
     223            direction == USB_DIRECTION_IN ? "in" : "out");
     224        PRINTLINE(indent, "bmAttributes = %d\n", d->attributes);
     225        PRINTLINE(indent, "wMaxPacketSize = %d\n", d->max_packet_size);
     226        PRINTLINE(indent, "bInterval = %dms\n", d->poll_interval);
    213227}
    214228
Note: See TracChangeset for help on using the changeset viewer.