static void usbredir_stop_ep(USBRedirDevice *dev, int i)
{
    uint8_t ep = I2EP(i);

    switch (dev->endpoint[i].type) {
    case USB_ENDPOINT_XFER_BULK:
        if (ep & USB_DIR_IN) {
            usbredir_stop_bulk_receiving(dev, ep);
        }
        break;
    case USB_ENDPOINT_XFER_ISOC:
        usbredir_stop_iso_stream(dev, ep);
        break;
    case USB_ENDPOINT_XFER_INT:
        if (ep & USB_DIR_IN) {
            usbredir_stop_interrupt_receiving(dev, ep);
        }
        break;
    }
    usbredir_free_bufpq(dev, ep);
}
static void usbredir_stop_ep(USBRedirDevice *dev, int i)
{
    uint8_t ep = I2EP(i);

    switch (dev->endpoint[i].type) {
    case USB_ENDPOINT_XFER_BULK:
        if (ep & USB_DIR_IN) {
            usbredir_stop_bulk_receiving(dev, ep);
        }
        break;
    case USB_ENDPOINT_XFER_ISOC:
        usbredir_stop_iso_stream(dev, ep);
        break;
    case USB_ENDPOINT_XFER_INT:
        if (ep & USB_DIR_IN) {
            usbredir_stop_interrupt_receiving(dev, ep);
        }
        break;
    }
    usbredir_free_bufpq(dev, ep);
}