/* This function will rest hub port, it is invoked when sub device attached to the hub port. */
rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port)
/* This function will rest hub port, it is invoked when sub device attached to the hub port. */
rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port)
{
    rt_err_t ret;
    rt_uint32_t pstatus;
    RT_ASSERT(hub != RT_NULL);
    rt_thread_delay(50);
    ret = rt_usbh_hub_set_port_feature(hub, port, PORT_FEAT_RESET);
    if(ret != RT_EOK) return ret;
    while(1)
    {
        ret = rt_usbh_hub_get_port_status(hub, port, &pstatus);
        if(!(pstatus & PORT_PRS)) break;
    }
    ret = rt_usbh_hub_clear_port_feature(hub, port, PORT_FEAT_C_RESET);
    if(ret != RT_EOK) return ret;
    rt_thread_delay(50);
    return RT_EOK;
}