[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/54] usb-redir: Get rid of local shadow copy of pa
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 20/54] usb-redir: Get rid of local shadow copy of packet headers |
Date: |
Thu, 6 Sep 2012 09:12:21 +0200 |
From: Hans de Goede <address@hidden>
The shadow copy only serves as an extra check (besides the packet-id) to
ensure the packet we get back is a reply to the packet we think it is.
This check has never triggered in all the time usb-redir is in use now,
and since the verified data in the returned packet-header is not used
otherwise, removing the check does not open any possibilities for the
usbredirhost to confuse us.
This is a preparation patch for completely getting rid of the async-packet
struct in usb-redir, instead relying on the (new) per ep queues in the
qemu usb core.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/redirect.c | 27 ---------------------------
1 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 2cae8c5..e4ef372 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -99,11 +99,6 @@ struct AsyncURB {
USBRedirDevice *dev;
USBPacket *packet;
uint32_t packet_id;
- union {
- struct usb_redir_control_packet_header control_packet;
- struct usb_redir_bulk_packet_header bulk_packet;
- struct usb_redir_interrupt_packet_header interrupt_packet;
- };
QTAILQ_ENTRY(AsyncURB)next;
};
@@ -500,7 +495,6 @@ static int usbredir_handle_bulk_data(USBRedirDevice *dev,
USBPacket *p,
bulk_packet.endpoint = ep;
bulk_packet.length = p->iov.size;
bulk_packet.stream_id = 0;
- aurb->bulk_packet = bulk_packet;
if (ep & USB_DIR_IN) {
usbredirparser_send_bulk_packet(dev->parser, aurb->packet_id,
@@ -581,7 +575,6 @@ static int usbredir_handle_interrupt_data(USBRedirDevice
*dev,
interrupt_packet.endpoint = ep;
interrupt_packet.length = p->iov.size;
- aurb->interrupt_packet = interrupt_packet;
usb_packet_copy(p, buf, p->iov.size);
usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);
@@ -762,7 +755,6 @@ static int usbredir_handle_control(USBDevice *udev,
USBPacket *p,
control_packet.value = value;
control_packet.index = index;
control_packet.length = length;
- aurb->control_packet = control_packet;
if (control_packet.requesttype & USB_DIR_IN) {
usbredirparser_send_control_packet(dev->parser, aurb->packet_id,
@@ -1326,14 +1318,6 @@ static void usbredir_control_packet(void *priv, uint32_t
id,
return;
}
- aurb->control_packet.status = control_packet->status;
- aurb->control_packet.length = control_packet->length;
- if (memcmp(&aurb->control_packet, control_packet,
- sizeof(*control_packet))) {
- ERROR("return control packet mismatch, please report this!\n");
- len = USB_RET_NAK;
- }
-
if (aurb->packet) {
len = usbredir_handle_status(dev, control_packet->status, len);
if (len > 0) {
@@ -1371,12 +1355,6 @@ static void usbredir_bulk_packet(void *priv, uint32_t id,
return;
}
- if (aurb->bulk_packet.endpoint != bulk_packet->endpoint ||
- aurb->bulk_packet.stream_id != bulk_packet->stream_id) {
- ERROR("return bulk packet mismatch, please report this!\n");
- len = USB_RET_NAK;
- }
-
if (aurb->packet) {
len = usbredir_handle_status(dev, bulk_packet->status, len);
if (len > 0) {
@@ -1455,11 +1433,6 @@ static void usbredir_interrupt_packet(void *priv,
uint32_t id,
return;
}
- if (aurb->interrupt_packet.endpoint != interrupt_packet->endpoint) {
- ERROR("return int packet mismatch, please report this!\n");
- len = USB_RET_NAK;
- }
-
if (aurb->packet) {
aurb->packet->result = usbredir_handle_status(dev,
interrupt_packet->status, len);
--
1.7.1
- [Qemu-devel] [PATCH 25/54] usb-redir: Set ep max_packet_size if available, (continued)
- [Qemu-devel] [PATCH 25/54] usb-redir: Set ep max_packet_size if available, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 30/54] usb-audio: fix usb version, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 43/54] usb3: bos decriptor, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 52/54] xhci: support multiple interrupters, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 21/54] usb-redir: Get rid of unused async-struct dev member, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 27/54] usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 24/54] usb-redir: Convert to new libusbredirparser 0.5 API, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 15/54] ehci: Handle USB_RET_PROCERR in ehci_fill_queue, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 18/54] usb-redir: Don't delay handling of open events to a bottom half, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 23/54] usb-redir: Return babble when getting more bulk data then requested, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 20/54] usb-redir: Get rid of local shadow copy of packet headers,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 37/54] xhci: add trace_usb_xhci_ep_set_dequeue, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 33/54] xhci: move device lookup into xhci_setup_packet, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 09/54] ehci: Properly report completed but not yet processed packets to the guest, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 36/54] xhci: trace cc codes in cleartext, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 38/54] xhci: fix runtime write tracepoint, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 31/54] xhci: rip out background transfer code, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 42/54] usb3: superspeed endpoint companion, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 34/54] xhci: implement mfindex, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 35/54] xhci: iso xfer support, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 47/54] xhci: add msix support, Gerd Hoffmann, 2012/09/06