mirror of https://gitee.com/openkylin/qemu.git
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:
parent
c4020746ff
commit
234e810cce
|
@ -610,10 +610,9 @@ static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
|
||||||
p->status = USB_RET_ASYNC;
|
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)
|
USBPacket *p, uint8_t ep)
|
||||||
{
|
{
|
||||||
if (ep & USB_DIR_IN) {
|
|
||||||
/* Input interrupt endpoint, buffered packet input */
|
/* Input interrupt endpoint, buffered packet input */
|
||||||
struct buf_packet *intp;
|
struct buf_packet *intp;
|
||||||
int status, len;
|
int status, len;
|
||||||
|
@ -661,7 +660,11 @@ static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
|
||||||
usb_packet_copy(p, intp->data, len);
|
usb_packet_copy(p, intp->data, len);
|
||||||
bufp_free(dev, intp, ep);
|
bufp_free(dev, intp, ep);
|
||||||
usbredir_handle_status(dev, p, status);
|
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 */
|
/* Output interrupt endpoint, normal async operation */
|
||||||
struct usb_redir_interrupt_packet_header interrupt_packet;
|
struct usb_redir_interrupt_packet_header interrupt_packet;
|
||||||
uint8_t buf[p->iov.size];
|
uint8_t buf[p->iov.size];
|
||||||
|
@ -683,7 +686,6 @@ static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
|
||||||
&interrupt_packet, buf, p->iov.size);
|
&interrupt_packet, buf, p->iov.size);
|
||||||
usbredirparser_do_write(dev->parser);
|
usbredirparser_do_write(dev->parser);
|
||||||
p->status = USB_RET_ASYNC;
|
p->status = USB_RET_ASYNC;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
|
static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
|
||||||
|
@ -729,7 +731,11 @@ static void usbredir_handle_data(USBDevice *udev, USBPacket *p)
|
||||||
usbredir_handle_bulk_data(dev, p, ep);
|
usbredir_handle_bulk_data(dev, p, ep);
|
||||||
break;
|
break;
|
||||||
case USB_ENDPOINT_XFER_INT:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR("handle_data ep %02X has unknown type %d\n", ep,
|
ERROR("handle_data ep %02X has unknown type %d\n", ep,
|
||||||
|
|
Loading…
Reference in New Issue