Changeset e387d0f in mainline
- Timestamp:
- 2011-03-21T12:04:12Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8e1a2c
- Parents:
- eece178
- Location:
- uspace/app/usbinfo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/info.c
reece178 re387d0f 166 166 167 167 168 static void dump_descriptor_tree_ brief_callback(uint8_t *descriptor,168 static void dump_descriptor_tree_callback(uint8_t *descriptor, 169 169 size_t depth, void *arg) 170 170 { … … 183 183 if (descr_size >= sizeof(descriptor_type)) { \ 184 184 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 } \ 185 190 } else { \ 186 191 descr_type = -1; \ … … 222 227 void dump_descriptor_tree_brief(usbinfo_device_t *dev) 223 228 { 224 dump_descriptor_tree_ brief_callback((uint8_t *)&dev->device_descriptor,229 dump_descriptor_tree_callback((uint8_t *)&dev->device_descriptor, 225 230 (size_t) -1, NULL); 226 231 usb_dp_walk_simple(dev->full_configuration_descriptor, 227 232 dev->full_configuration_descriptor_size, 228 233 usb_dp_standard_descriptor_nesting, 229 dump_descriptor_tree_ brief_callback,234 dump_descriptor_tree_callback, 230 235 NULL); 231 236 } 237 238 void 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 232 249 233 250 void dump_strings(usbinfo_device_t *dev) -
uspace/app/usbinfo/main.c
reece178 re387d0f 134 134 _OPTION("-m --match-ids", "Print match ids generated for the device."); 135 135 _OPTION("-t --descriptor-tree", "Print descriptor tree."); 136 _OPTION("-T --descriptor-tree-full", "Print detailed descriptor tree"); 136 137 _OPTION("-s --strings", "Try to print all string descriptors."); 137 138 … … 149 150 {"match-ids", no_argument, NULL, 'm'}, 150 151 {"descriptor-tree", no_argument, NULL, 't'}, 152 {"descriptor-tree-full", no_argument, NULL, 'T'}, 151 153 {"strings", no_argument, NULL, 's'}, 152 154 {0, 0, NULL, 0} 153 155 }; 154 static const char *short_options = "himt s";156 static const char *short_options = "himtTs"; 155 157 156 158 static usbinfo_action_t actions[] = { … … 168 170 .opt = 't', 169 171 .action = dump_descriptor_tree_brief, 172 .active = false 173 }, 174 { 175 .opt = 'T', 176 .action = dump_descriptor_tree_full, 170 177 .active = false 171 178 }, -
uspace/app/usbinfo/usbinfo.h
reece178 re387d0f 82 82 void dump_device_match_ids(usbinfo_device_t *); 83 83 void dump_descriptor_tree_brief(usbinfo_device_t *); 84 void dump_descriptor_tree_full(usbinfo_device_t *); 84 85 void dump_strings(usbinfo_device_t *); 85 86
Note:
See TracChangeset
for help on using the changeset viewer.