[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/26] usbredir: Add an usbredir_stop_ep helper func
From: |
Hans de Goede |
Subject: |
[Qemu-devel] [PATCH 20/26] usbredir: Add an usbredir_stop_ep helper function |
Date: |
Fri, 14 Dec 2012 14:35:41 +0100 |
Signed-off-by: Hans de Goede <address@hidden>
---
hw/usb/redirect.c | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index a4d324f..4cf8780 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -761,6 +761,23 @@ static void usbredir_flush_ep_queue(USBDevice *dev,
USBEndpoint *ep)
}
}
+static void usbredir_stop_ep(USBRedirDevice *dev, int i)
+{
+ uint8_t ep = I2EP(i);
+
+ switch (dev->endpoint[i].type) {
+ 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_set_config(USBRedirDevice *dev, USBPacket *p,
int config)
{
@@ -770,17 +787,7 @@ static void usbredir_set_config(USBRedirDevice *dev,
USBPacket *p,
DPRINTF("set config %d id %"PRIu64"\n", config, p->id);
for (i = 0; i < MAX_ENDPOINTS; i++) {
- switch (dev->endpoint[i].type) {
- case USB_ENDPOINT_XFER_ISOC:
- usbredir_stop_iso_stream(dev, I2EP(i));
- break;
- case USB_ENDPOINT_XFER_INT:
- if (i & 0x10) {
- usbredir_stop_interrupt_receiving(dev, I2EP(i));
- }
- break;
- }
- usbredir_free_bufpq(dev, I2EP(i));
+ usbredir_stop_ep(dev, i);
}
set_config.configuration = config;
@@ -808,17 +815,7 @@ static void usbredir_set_interface(USBRedirDevice *dev,
USBPacket *p,
for (i = 0; i < MAX_ENDPOINTS; i++) {
if (dev->endpoint[i].interface == interface) {
- switch (dev->endpoint[i].type) {
- case USB_ENDPOINT_XFER_ISOC:
- usbredir_stop_iso_stream(dev, I2EP(i));
- break;
- case USB_ENDPOINT_XFER_INT:
- if (i & 0x10) {
- usbredir_stop_interrupt_receiving(dev, I2EP(i));
- }
- break;
- }
- usbredir_free_bufpq(dev, I2EP(i));
+ usbredir_stop_ep(dev, i);
}
}
--
1.8.0.1
- Re: [Qemu-devel] [PATCH 09/26] ehci: Use uframe precision for interrupt threshold checking, (continued)
[Qemu-devel] [PATCH 12/26] uhci: Fix 1 ms delay in interrupt reporting to the guest, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 10/26] ehci: Further speedup rescanning if async schedule after raising an interrupt, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 11/26] ehci: Don't call commit_irq after raising PCD, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 13/26] uhci: Fix pending interrupts getting lost on migration, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 14/26] uhci: Add a QH_VALID define, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 17/26] hid: Change idle handling to use a timer, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 15/26] uhci: Limit amount of frames processed in one go, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 20/26] usbredir: Add an usbredir_stop_ep helper function,
Hans de Goede <=
[Qemu-devel] [PATCH 19/26] usb: Add an usb_device_ep_stopped USBDevice method, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 16/26] uhci: Maximize how many frames we catch up when behind, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 21/26] usbredir: Add USBEP2I and I2USBEP helper macros, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 22/26] usbredir: Add ep_stopped USBDevice method, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 23/26] usbredir: Verify we have 32 bits bulk length cap when redirecting to xhci, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 26/26] usbredir: Add support for buffered bulk input, Hans de Goede, 2012/12/14