data, sizeof(struct usb_hub_status), USB_CNTL_TIMEOUT);
}
-static int usb_get_port_status(struct usb_device *dev, int port, void *data)
+int usb_get_port_status(struct usb_device *dev, int port, void *data)
{
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port,
portstatus = le16_to_cpu(portsts->wPortStatus);
portchange = le16_to_cpu(portsts->wPortChange);
- if ((portchange & USB_PORT_STAT_C_CONNECTION) ==
- (portstatus & USB_PORT_STAT_CONNECTION))
+ /* No connection change happened, wait a bit more. */
+ if (!(portchange & USB_PORT_STAT_C_CONNECTION))
+ continue;
+
+ /* Test if the connection came up, and if so, exit. */
+ if (portstatus & USB_PORT_STAT_CONNECTION)
break;
- } while (get_timer(start) < CONFIG_SYS_HZ * 10);
+ } while (get_timer(start) < CONFIG_SYS_HZ * 1);
if (ret < 0)
continue;
{ } /* Terminating entry */
};
-USB_DEVICE(usb_generic_hub, hub_id_table);
+U_BOOT_USB_DEVICE(usb_generic_hub, hub_id_table);
#endif