Changeset e387d0f in mainline


Ignore:
Timestamp:
2011-03-21T12:04:12Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f8e1a2c
Parents:
eece178
Message:

Add back full descriptor dump to usbinfo

Location:
uspace/app/usbinfo
Files:
3 edited

Legend:

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

    reece178 re387d0f  
    166166
    167167
    168 static void dump_descriptor_tree_brief_callback(uint8_t *descriptor,
     168static void dump_descriptor_tree_callback(uint8_t *descriptor,
    169169    size_t depth, void *arg)
    170170{
     
    183183                if (descr_size >= sizeof(descriptor_type)) { \
    184184                        callback(indent, (descriptor_type *) descriptor); \
     185                        if (arg != NULL) { \
     186                                usb_dump_standard_descriptor(stdout, \
     187                                    get_indent(depth +2), "\n", \
     188                                    descriptor, descr_size); \
     189                        } \
    185190                } else { \
    186191                        descr_type = -1; \
     
    222227void dump_descriptor_tree_brief(usbinfo_device_t *dev)
    223228{
    224         dump_descriptor_tree_brief_callback((uint8_t *)&dev->device_descriptor,
     229        dump_descriptor_tree_callback((uint8_t *)&dev->device_descriptor,
    225230            (size_t) -1, NULL);
    226231        usb_dp_walk_simple(dev->full_configuration_descriptor,
    227232            dev->full_configuration_descriptor_size,
    228233            usb_dp_standard_descriptor_nesting,
    229             dump_descriptor_tree_brief_callback,
     234            dump_descriptor_tree_callback,
    230235            NULL);
    231236}
     237
     238void dump_descriptor_tree_full(usbinfo_device_t *dev)
     239{
     240        dump_descriptor_tree_callback((uint8_t *)&dev->device_descriptor,
     241            (size_t) -1, dev);
     242        usb_dp_walk_simple(dev->full_configuration_descriptor,
     243            dev->full_configuration_descriptor_size,
     244            usb_dp_standard_descriptor_nesting,
     245            dump_descriptor_tree_callback,
     246            dev);
     247}
     248
    232249
    233250void dump_strings(usbinfo_device_t *dev)
  • uspace/app/usbinfo/main.c

    reece178 re387d0f  
    134134        _OPTION("-m --match-ids", "Print match ids generated for the device.");
    135135        _OPTION("-t --descriptor-tree", "Print descriptor tree.");
     136        _OPTION("-T --descriptor-tree-full", "Print detailed descriptor tree");
    136137        _OPTION("-s --strings", "Try to print all string descriptors.");
    137138
     
    149150        {"match-ids", no_argument, NULL, 'm'},
    150151        {"descriptor-tree", no_argument, NULL, 't'},
     152        {"descriptor-tree-full", no_argument, NULL, 'T'},
    151153        {"strings", no_argument, NULL, 's'},
    152154        {0, 0, NULL, 0}
    153155};
    154 static const char *short_options = "himts";
     156static const char *short_options = "himtTs";
    155157
    156158static usbinfo_action_t actions[] = {
     
    168170                .opt = 't',
    169171                .action = dump_descriptor_tree_brief,
     172                .active = false
     173        },
     174        {
     175                .opt = 'T',
     176                .action = dump_descriptor_tree_full,
    170177                .active = false
    171178        },
  • uspace/app/usbinfo/usbinfo.h

    reece178 re387d0f  
    8282void dump_device_match_ids(usbinfo_device_t *);
    8383void dump_descriptor_tree_brief(usbinfo_device_t *);
     84void dump_descriptor_tree_full(usbinfo_device_t *);
    8485void dump_strings(usbinfo_device_t *);
    8586
Note: See TracChangeset for help on using the changeset viewer.