usb-redir: Split usb_handle_interrupt_data into separate in/out functions

No functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2012-11-17 12:26:56 +01:00 committed by Gerd Hoffmann
parent c4020746ff
commit 234e810cce

View File

@ -610,10 +610,9 @@ static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
p->status = USB_RET_ASYNC;
}
static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
static void usbredir_handle_interrupt_in_data(USBRedirDevice *dev,
USBPacket *p, uint8_t ep)
{
if (ep & USB_DIR_IN) {
/* Input interrupt endpoint, buffered packet input */
struct buf_packet *intp;
int status, len;
@ -661,7 +660,11 @@ static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
usb_packet_copy(p, intp->data, len);
bufp_free(dev, intp, ep);
usbredir_handle_status(dev, p, status);
} else {
}
static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
USBPacket *p, uint8_t ep)
{
/* Output interrupt endpoint, normal async operation */
struct usb_redir_interrupt_packet_header interrupt_packet;
uint8_t buf[p->iov.size];
@ -684,7 +687,6 @@ static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
usbredirparser_do_write(dev->parser);
p->status = USB_RET_ASYNC;
}
}
static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
uint8_t ep)
@ -729,7 +731,11 @@ static void usbredir_handle_data(USBDevice *udev, USBPacket *p)
usbredir_handle_bulk_data(dev, p, ep);
break;
case USB_ENDPOINT_XFER_INT:
usbredir_handle_interrupt_data(dev, p, ep);
if (ep & USB_DIR_IN) {
usbredir_handle_interrupt_in_data(dev, p, ep);
} else {
usbredir_handle_interrupt_out_data(dev, p, ep);
}
break;
default:
ERROR("handle_data ep %02X has unknown type %d\n", ep,