[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/18] ehci: make ehci_execute work on EHCIPacket in
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 02/18] ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue |
Date: |
Fri, 25 May 2012 14:40:18 +0200 |
This way it is possible to use ehci_execute to submit others than the
first EHCIPacket of the EHCIQueue.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 03ae09f..a7cf282 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1395,30 +1395,26 @@ static void ehci_execute_complete(EHCIQueue *q)
// 4.10.3
-static int ehci_execute(EHCIQueue *q)
+static int ehci_execute(EHCIPacket *p)
{
- EHCIPacket *p = QTAILQ_FIRST(&q->packets);
USBDevice *dev;
USBEndpoint *ep;
int ret;
int endp;
int devadr;
- assert(p != NULL);
- assert(p->qtdaddr == q->qtdaddr);
-
- if ( !(q->qh.token & QTD_TOKEN_ACTIVE)) {
- fprintf(stderr, "Attempting to execute inactive QH\n");
+ if (!(p->qtd.token & QTD_TOKEN_ACTIVE)) {
+ fprintf(stderr, "Attempting to execute inactive qtd\n");
return USB_RET_PROCERR;
}
- p->tbytes = (q->qh.token & QTD_TOKEN_TBYTES_MASK) >> QTD_TOKEN_TBYTES_SH;
+ p->tbytes = (p->qtd.token & QTD_TOKEN_TBYTES_MASK) >> QTD_TOKEN_TBYTES_SH;
if (p->tbytes > BUFF_SIZE) {
fprintf(stderr, "Request for more bytes than allowed\n");
return USB_RET_PROCERR;
}
- p->pid = (q->qh.token & QTD_TOKEN_PID_MASK) >> QTD_TOKEN_PID_SH;
+ p->pid = (p->qtd.token & QTD_TOKEN_PID_MASK) >> QTD_TOKEN_PID_SH;
switch (p->pid) {
case 0:
p->pid = USB_TOKEN_OUT;
@@ -1438,11 +1434,11 @@ static int ehci_execute(EHCIQueue *q)
return USB_RET_PROCERR;
}
- endp = get_field(q->qh.epchar, QH_EPCHAR_EP);
- devadr = get_field(q->qh.epchar, QH_EPCHAR_DEVADDR);
+ endp = get_field(p->queue->qh.epchar, QH_EPCHAR_EP);
+ devadr = get_field(p->queue->qh.epchar, QH_EPCHAR_DEVADDR);
/* TODO: associating device with ehci port */
- dev = ehci_find_device(q->ehci, devadr);
+ dev = ehci_find_device(p->queue->ehci, devadr);
ep = usb_ep_get(dev, p->pid, endp);
usb_packet_setup(&p->packet, p->pid, ep);
@@ -1912,7 +1908,7 @@ static int ehci_state_execute(EHCIQueue *q, int async)
ehci_set_usbsts(q->ehci, USBSTS_REC);
}
- p->usb_status = ehci_execute(q);
+ p->usb_status = ehci_execute(p);
if (p->usb_status == USB_RET_PROCERR) {
again = -1;
goto out;
--
1.7.1
- [Qemu-devel] [PATCH 04/18] ehci: move ehci_flush_qh, (continued)
- [Qemu-devel] [PATCH 04/18] ehci: move ehci_flush_qh, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 13/18] ehci: update status bits in ehci_set_state, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 03/18] ehci: cache USBDevice in EHCIQueue, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 01/18] ehci: add EHCIPacket, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 09/18] ehci: schedule async bh on async packet completion, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 17/18] ehci: adaptive wakeup rate., Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 18/18] ehci: rework frame skipping, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 15/18] ehci: remove unused attach_poll_counter, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 16/18] ehci: create ehci_update_frindex, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 07/18] ehci: add async field to EHCIQueue, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 02/18] ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 08/18] ehci: move async schedule to bottom half, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 11/18] ehci: fix reset, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 06/18] ehci: tweak queue initialization, Gerd Hoffmann, 2012/05/25