/* This function is the main entry of usb hub thread, it is in charge of processing all messages received from the usb message buffer. */
static void rt_usbh_hub_thread_entry(void *parameter)
/* This function is the main entry of usb hub thread, it is in charge of processing all messages received from the usb message buffer. */
static void rt_usbh_hub_thread_entry(void *parameter)
{
    uhcd_t hcd = (uhcd_t)parameter;
    while(1)
    {
        struct uhost_msg msg;
        if (rt_mq_recv(hcd->usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER) < 0)
            continue;
        switch (msg.type)
        {
        case USB_MSG_CONNECT_CHANGE:
            rt_usbh_hub_port_change(msg.content.hub);
            break;
        case USB_MSG_CALLBACK:
            msg.content.cb.function(msg.content.cb.context);
            break;
        default:
            break;
        }
    }
}