/* This function will find an usb interface alternate setting object. */
ualtsetting_t rt_usbd_find_altsetting(uintf_t intf, rt_uint8_t value)
/* This function will find an usb interface alternate setting object. */
ualtsetting_t rt_usbd_find_altsetting(uintf_t intf, rt_uint8_t value)
{
    struct rt_list_node *i;
    ualtsetting_t setting;
    LOG_D("rt_usbd_find_altsetting");
    RT_ASSERT(intf != RT_NULL);
    if(intf->curr_setting != RT_NULL)
    {
        if(intf->curr_setting->intf_desc->bAlternateSetting == value)
            return intf->curr_setting;
    }
    for(i=intf->setting_list.next; i!=&intf->setting_list; i=i->next)
    {
        setting =(ualtsetting_t)rt_list_entry(i, struct ualtsetting, list);
        if(setting->intf_desc->bAlternateSetting == value)
            return setting;
    }
    rt_kprintf("can't find alternate setting %d\n", value);
    return RT_NULL;
}