|
Hans de Goede |
1b1995 |
From 6177c3610b6416a7200ae6c6985f01fccdbdc7e5 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
1b1995 |
From: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
1b1995 |
Date: Thu, 1 Mar 2012 23:11:13 +0100
|
|
Hans de Goede |
1b1995 |
Subject: [PATCH 134/140] usb-ehci: Remove dead nakcnt code
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
This patch removes 2 bits of dead nakcnt code:
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
1) usb_ehci_execute calls ehci_qh_do_overlay which does:
|
|
Hans de Goede |
1b1995 |
nakcnt = reload;
|
|
Hans de Goede |
1b1995 |
and then has a block of code which is conditional on:
|
|
Hans de Goede |
1b1995 |
if (reload && !nakcnt) {
|
|
Hans de Goede |
1b1995 |
which ofcourse is never true now as nakcnt == reload.
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
2) ehci_state_fetchqh does:
|
|
Hans de Goede |
1b1995 |
nakcnt = reload;
|
|
Hans de Goede |
1b1995 |
but before nakcnt is ever used ehci_state_fetchqh is always followed
|
|
Hans de Goede |
1b1995 |
by a ehci_qh_do_overlay call which also does:
|
|
Hans de Goede |
1b1995 |
nakcnt = reload;
|
|
Hans de Goede |
1b1995 |
So doing this from ehci_state_fetchqh is redundant.
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
1b1995 |
---
|
|
Hans de Goede |
1b1995 |
hw/usb-ehci.c | 20 --------------------
|
|
Hans de Goede |
1b1995 |
1 file changed, 20 deletions(-)
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
|
|
Hans de Goede |
1b1995 |
index a3d5c11..92cdf2a 100644
|
|
Hans de Goede |
1b1995 |
--- a/hw/usb-ehci.c
|
|
Hans de Goede |
1b1995 |
+++ b/hw/usb-ehci.c
|
|
Hans de Goede |
1b1995 |
@@ -1643,7 +1643,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async)
|
|
Hans de Goede |
1b1995 |
{
|
|
Hans de Goede |
1b1995 |
uint32_t entry;
|
|
Hans de Goede |
1b1995 |
EHCIQueue *q;
|
|
Hans de Goede |
1b1995 |
- int reload;
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
entry = ehci_get_fetch_addr(ehci, async);
|
|
Hans de Goede |
1b1995 |
q = ehci_find_queue_by_qh(ehci, entry, async);
|
|
Hans de Goede |
1b1995 |
@@ -1701,11 +1700,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async)
|
|
Hans de Goede |
1b1995 |
}
|
|
Hans de Goede |
1b1995 |
#endif
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
- reload = get_field(q->qh.epchar, QH_EPCHAR_RL);
|
|
Hans de Goede |
1b1995 |
- if (reload) {
|
|
Hans de Goede |
1b1995 |
- set_field(&q->qh.altnext_qtd, reload, QH_ALTNEXT_NAKCNT);
|
|
Hans de Goede |
1b1995 |
- }
|
|
Hans de Goede |
1b1995 |
-
|
|
Hans de Goede |
1b1995 |
if (q->qh.token & QTD_TOKEN_HALT) {
|
|
Hans de Goede |
1b1995 |
ehci_set_state(ehci, async, EST_HORIZONTALQH);
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
@@ -1865,25 +1859,11 @@ static void ehci_flush_qh(EHCIQueue *q)
|
|
Hans de Goede |
1b1995 |
static int ehci_state_execute(EHCIQueue *q, int async)
|
|
Hans de Goede |
1b1995 |
{
|
|
Hans de Goede |
1b1995 |
int again = 0;
|
|
Hans de Goede |
1b1995 |
- int reload, nakcnt;
|
|
Hans de Goede |
1b1995 |
- int smask;
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
if (ehci_qh_do_overlay(q) != 0) {
|
|
Hans de Goede |
1b1995 |
return -1;
|
|
Hans de Goede |
1b1995 |
}
|
|
Hans de Goede |
1b1995 |
|
|
Hans de Goede |
1b1995 |
- smask = get_field(q->qh.epcap, QH_EPCAP_SMASK);
|
|
Hans de Goede |
1b1995 |
-
|
|
Hans de Goede |
1b1995 |
- if (!smask) {
|
|
Hans de Goede |
1b1995 |
- reload = get_field(q->qh.epchar, QH_EPCHAR_RL);
|
|
Hans de Goede |
1b1995 |
- nakcnt = get_field(q->qh.altnext_qtd, QH_ALTNEXT_NAKCNT);
|
|
Hans de Goede |
1b1995 |
- if (reload && !nakcnt) {
|
|
Hans de Goede |
1b1995 |
- ehci_set_state(q->ehci, async, EST_HORIZONTALQH);
|
|
Hans de Goede |
1b1995 |
- again = 1;
|
|
Hans de Goede |
1b1995 |
- goto out;
|
|
Hans de Goede |
1b1995 |
- }
|
|
Hans de Goede |
1b1995 |
- }
|
|
Hans de Goede |
1b1995 |
-
|
|
Hans de Goede |
1b1995 |
// TODO verify enough time remains in the uframe as in 4.4.1.1
|
|
Hans de Goede |
1b1995 |
// TODO write back ptr to async list when done or out of time
|
|
Hans de Goede |
1b1995 |
// TODO Windows does not seem to ever set the MULT field
|
|
Hans de Goede |
1b1995 |
--
|
|
Hans de Goede |
1b1995 |
1.7.9.3
|
|
Hans de Goede |
1b1995 |
|