Lines Matching refs:dev
140 static void usb_display_string(struct usb_device *dev, int index) in usb_display_string() argument
145 if (usb_string(dev, index, &buffer[0], 256) > 0) in usb_display_string()
150 static void usb_display_desc(struct usb_device *dev) in usb_display_desc() argument
152 uint packet_size = dev->descriptor.bMaxPacketSize0; in usb_display_desc()
154 if (dev->descriptor.bDescriptorType == USB_DT_DEVICE) { in usb_display_desc()
155 printf("%d: %s, USB Revision %x.%x\n", dev->devnum, in usb_display_desc()
156 usb_get_class_desc(dev->config.if_desc[0].desc.bInterfaceClass), in usb_display_desc()
157 (dev->descriptor.bcdUSB>>8) & 0xff, in usb_display_desc()
158 dev->descriptor.bcdUSB & 0xff); in usb_display_desc()
160 if (strlen(dev->mf) || strlen(dev->prod) || in usb_display_desc()
161 strlen(dev->serial)) in usb_display_desc()
162 printf(" - %s %s %s\n", dev->mf, dev->prod, in usb_display_desc()
163 dev->serial); in usb_display_desc()
164 if (dev->descriptor.bDeviceClass) { in usb_display_desc()
166 usb_display_class_sub(dev->descriptor.bDeviceClass, in usb_display_desc()
167 dev->descriptor.bDeviceSubClass, in usb_display_desc()
168 dev->descriptor.bDeviceProtocol); in usb_display_desc()
173 dev->config.if_desc[0].desc.bInterfaceClass)); in usb_display_desc()
175 if (dev->descriptor.bcdUSB >= cpu_to_le16(0x0300)) in usb_display_desc()
178 packet_size, dev->descriptor.bNumConfigurations); in usb_display_desc()
180 dev->descriptor.idVendor, dev->descriptor.idProduct, in usb_display_desc()
181 (dev->descriptor.bcdDevice>>8) & 0xff, in usb_display_desc()
182 dev->descriptor.bcdDevice & 0xff); in usb_display_desc()
188 struct usb_device *dev) in usb_display_conf_desc() argument
197 usb_display_string(dev, config->iConfiguration); in usb_display_conf_desc()
203 struct usb_device *dev) in usb_display_if_desc() argument
214 usb_display_string(dev, ifdesc->iInterface); in usb_display_if_desc()
244 static void usb_display_config(struct usb_device *dev) in usb_display_config() argument
251 config = &dev->config; in usb_display_config()
252 usb_display_conf_desc(&config->desc, dev); in usb_display_config()
255 usb_display_if_desc(&ifdesc->desc, dev); in usb_display_config()
284 struct udevice *dev; in usb_find_device() local
292 for (device_find_first_child(hub, &dev); in usb_find_device()
293 dev; in usb_find_device()
294 device_find_next_child(&dev)) { in usb_find_device()
298 udev = dev_get_parent_priv(dev); in usb_find_device()
342 static void usb_show_tree_graph(struct usb_device *dev, char *pre) argument
350 has_child = device_has_active_children(dev->dev);
351 if (device_get_uclass_id(dev->dev) == UCLASS_MASS_STORAGE) {
354 for (device_find_first_child(dev->dev, &child);
366 for (i = 0; i < dev->maxchild; i++) {
367 if (dev->children[i] != NULL)
374 if (device_get_uclass_id(dev->dev->parent) != UCLASS_USB) {
375 last_child = device_is_last_sibling(dev->dev);
377 if (dev->parent != NULL) { /* not root? */
379 for (i = 0; i < dev->parent->maxchild; i++) {
381 if (dev->parent->children[i] == dev) {
385 while (i++ < dev->parent->maxchild) {
386 if (dev->parent->children[i] != NULL) {
402 printf("%d ", dev->devnum);
407 dev->config.if_desc[0].desc.bInterfaceClass),
408 portspeed(dev->speed),
409 dev->config.desc.bMaxPower * 2);
410 if (strlen(dev->mf) || strlen(dev->prod) || strlen(dev->serial))
411 printf(" %s %s %s %s\n", pre, dev->mf, dev->prod, dev->serial);
416 for (device_find_first_child(dev->dev, &child);
437 if (dev->maxchild > 0) {
438 for (i = 0; i < dev->maxchild; i++) {
439 if (dev->children[i] != NULL) {
440 usb_show_tree_graph(dev->children[i], pre);
449 static void usb_show_subtree(struct usb_device *dev) argument
454 usb_show_tree_graph(dev, &preamble[0]);
468 struct udevice *dev; local
473 device_find_first_child(bus, &dev);
474 if (dev && device_active(dev)) {
475 udev = dev_get_parent_priv(dev);
500 static int usb_test(struct usb_device *dev, int port, char* arg) argument
504 if (port > dev->maxchild) {
546 if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_FEATURE,
618 for (device_find_first_child(udev->dev, &child);