/* Don't call this function unless you are bound to one of the interfaces on this device or you have locked the device!  */
struct usb_interface* usb_ifnum_to_if(struct usb_host_virt_dev *dev, u32 ifnum)
/* Don't call this function unless you are bound to one of the interfaces on this device or you have locked the device!  */
struct usb_interface* usb_ifnum_to_if(struct usb_host_virt_dev *dev, u32 ifnum)
{
    struct usb_host_virt_config *config = dev->actconfig;
    int i;
    if (!config)
    {
        __err("ERR: input = NULL");
        return NULL;
    }
    for (i = 0; i < config->desc.bNumInterfaces; i++)
    {
        if (config->interfac[i]->altsetting[0].desc.bInterfaceNumber == ifnum)
        {
            return config->interfac[i];
        }
    }
    return NULL;
}