Changeset 7b13d8e in mainline
- Timestamp:
- 2011-03-17T22:59:37Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aad3587
- Parents:
- 4fa05a32
- Location:
- uspace/app/usbinfo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/dump.c
r4fa05a32 r7b13d8e 109 109 match_id_t *match = list_get_instance(link, match_id_t, link); 110 110 111 printf("%s% d %s\n", line_prefix, match->score, match->id);111 printf("%s%3d %s\n", line_prefix, match->score, match->id); 112 112 } 113 113 } -
uspace/app/usbinfo/info.c
r4fa05a32 r7b13d8e 50 50 } 51 51 52 static void dump_match_ids_from_interface(uint8_t *descriptor, size_t depth, 53 void *arg) 54 { 55 if (depth != 1) { 56 return; 57 } 58 size_t descr_size = descriptor[0]; 59 if (descr_size < sizeof(usb_standard_interface_descriptor_t)) { 60 return; 61 } 62 int descr_type = descriptor[1]; 63 if (descr_type != USB_DESCTYPE_INTERFACE) { 64 return; 65 } 66 67 usbinfo_device_t *dev = (usbinfo_device_t *) arg; 68 69 usb_standard_interface_descriptor_t *iface 70 = (usb_standard_interface_descriptor_t *) descriptor; 71 72 printf("%sInterface #%d match ids (%s, 0x%02x, 0x%02x)\n", 73 get_indent(0), 74 (int) iface->interface_number, 75 usb_str_class(iface->interface_class), 76 (int) iface->interface_subclass, 77 (int) iface->interface_protocol); 78 79 match_id_list_t matches; 80 init_match_ids(&matches); 81 usb_device_create_match_ids_from_interface(&dev->device_descriptor, 82 iface, &matches); 83 dump_match_ids(&matches, get_indent(1)); 84 clean_match_ids(&matches); 85 } 86 52 87 void dump_device_match_ids(usbinfo_device_t *dev) 53 88 { … … 56 91 usb_device_create_match_ids_from_device_descriptor( 57 92 &dev->device_descriptor, &matches); 58 dump_match_ids(&matches, get_indent(0)); 93 printf("%sDevice match ids (0x%04x by 0x%04x, %s)\n", get_indent(0), 94 (int) dev->device_descriptor.product_id, 95 (int) dev->device_descriptor.vendor_id, 96 usb_str_class(dev->device_descriptor.device_class)); 97 dump_match_ids(&matches, get_indent(1)); 98 clean_match_ids(&matches); 99 100 usb_dp_walk_simple(dev->full_configuration_descriptor, 101 dev->full_configuration_descriptor_size, 102 usb_dp_standard_descriptor_nesting, 103 dump_match_ids_from_interface, 104 dev); 59 105 } 60 106
Note:
See TracChangeset
for help on using the changeset viewer.