summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-01-27 23:25:58 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-01-27 23:25:58 +0000
commit5674e933817d6931a868ea3d12dd39b130380136 (patch)
tree89a4b832e416b3cd25e19a5d8dbba471a9bd5a6e /sys
parent64633582ac7c6713645376abd755ca2c12fbdff5 (diff)
downloadFreeBSD-src-5674e933817d6931a868ea3d12dd39b130380136.zip
FreeBSD-src-5674e933817d6931a868ea3d12dd39b130380136.tar.gz
Move the defines to the right location.
Add a DIAGNOSTIC when closing interrupt pipes. Insert splx(s) which were left out with iso pipes (non-functional yet) and in a DIAGNOSTIC.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ohci.c21
-rw-r--r--sys/dev/usb/ohcireg.h4
-rw-r--r--sys/dev/usb/ohcivar.h3
3 files changed, 18 insertions, 10 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index e42d60f..0ae4c16 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -788,6 +788,7 @@ ohci_init(sc)
#if defined(__NetBSD__) || defined(__OpenBSD__)
sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
#endif
+
return (USBD_NORMAL_COMPLETION);
bad5:
@@ -1115,7 +1116,7 @@ ohci_process_done(sc, done)
for (std = sdone; std; std = stdnext) {
xfer = std->xfer;
stdnext = std->dnext;
- DPRINTFN(10, ("ohci_process_done: std=%p xfer=%p hcpriv=%p\n",
+ DPRINTFN(5, ("ohci_process_done: std=%p xfer=%p hcpriv=%p\n",
std, xfer, xfer->hcpriv));
cc = OHCI_TD_GET_CC(LE(std->td.td_flags));
usb_untimeout(ohci_timeout, xfer, xfer->timo_handle);
@@ -1556,6 +1557,7 @@ ohci_hash_find_td(sc, a)
std = LIST_NEXT(std, hnext))
if (std->physaddr == a)
return (std);
+
panic("ohci_hash_find_td: addr 0x%08lx not found\n", (u_long)a);
}
@@ -1740,8 +1742,7 @@ ohci_close_pipe(pipe, head)
s = splusb();
#ifdef DIAGNOSTIC
sed->ed.ed_flags |= LE(OHCI_ED_SKIP);
- if ((sed->ed.ed_tailp & LE(OHCI_TAILMASK)) !=
- (sed->ed.ed_headp & LE(OHCI_TAILMASK))) {
+ if (sed->ed.ed_tailp != (sed->ed.ed_headp & LE(OHCI_HEADMASK))) {
ohci_physaddr_t td = sed->ed.ed_headp;
ohci_soft_td_t *std;
for (std = LIST_FIRST(&sc->sc_hash_tds[HASH(td)]);
@@ -1754,8 +1755,7 @@ ohci_close_pipe(pipe, head)
(int)LE(sed->ed.ed_headp), (int)LE(sed->ed.ed_tailp),
pipe, std);
usb_delay_ms(&sc->sc_bus, 2);
- if ((sed->ed.ed_tailp & LE(OHCI_TAILMASK)) !=
- (sed->ed.ed_headp & LE(OHCI_TAILMASK)))
+ if (sed->ed.ed_tailp != (sed->ed.ed_headp & LE(OHCI_HEADMASK)))
printf("ohci_close_pipe: pipe still not empty\n");
}
#endif
@@ -1827,6 +1827,7 @@ ohci_abort_xfer_end(v)
#ifdef DIAGNOSTIC
if (p == NULL) {
printf("ohci_abort_xfer: hcpriv==0\n");
+ splx(s);
return;
}
#endif
@@ -2649,9 +2650,13 @@ ohci_device_intr_close(pipe)
pipe, nslots, pos));
s = splusb();
sed->ed.ed_flags |= LE(OHCI_ED_SKIP);
- if ((sed->ed.ed_tailp & LE(OHCI_TAILMASK)) !=
- (sed->ed.ed_headp & LE(OHCI_TAILMASK)))
+ if (sed->ed.ed_tailp != (sed->ed.ed_headp & LE(OHCI_HEADMASK)))
usb_delay_ms(&sc->sc_bus, 2);
+#ifdef DIAGNOSTIC
+ if (sed->ed.ed_tailp != (sed->ed.ed_headp & LE(OHCI_HEADMASK)))
+ panic("%s: Intr pipe %p still has TDs queued\n",
+ USBDEVNAME(sc->sc_bus.bdev), pipe);
+#endif
for (p = sc->sc_eds[pos]; p && p->next != sed; p = p->next)
;
@@ -2792,6 +2797,7 @@ ohci_device_isoc_enter(xfer)
nsitd = ohci_alloc_sitd(sc);
if (nsitd == NULL) {
/* XXX what now? */
+ splx(s);
return;
}
sitd->nextitd = nsitd;
@@ -2817,6 +2823,7 @@ ohci_device_isoc_enter(xfer)
nsitd = ohci_alloc_sitd(sc);
if (nsitd == NULL) {
/* XXX what now? */
+ splx(s);
return;
}
sitd->nextitd = nsitd;
diff --git a/sys/dev/usb/ohcireg.h b/sys/dev/usb/ohcireg.h
index 0939368..8372e8b 100644
--- a/sys/dev/usb/ohcireg.h
+++ b/sys/dev/usb/ohcireg.h
@@ -163,10 +163,10 @@ typedef struct {
#define OHCI_ED_SET_MAXP(s) ((s) << 16)
#define OHCI_ED_MAXPMASK (0x7ff << 16)
ohci_physaddr_t ed_tailp;
+ ohci_physaddr_t ed_headp;
#define OHCI_HALTED 0x00000002
#define OHCI_TOGGLECARRY 0x00000001
-#define OHCI_TAILMASK 0xfffffffc
- ohci_physaddr_t ed_headp;
+#define OHCI_HEADMASK 0xfffffffc
ohci_physaddr_t ed_nexted;
} ohci_ed_t;
/* #define OHCI_ED_SIZE 16 */
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 555e09b..9d8005c 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -83,7 +83,8 @@ typedef struct ohci_softc {
ohci_soft_ed_t *sc_eds[OHCI_NO_EDS];
u_int sc_bws[OHCI_NO_INTRS];
- u_int32_t sc_eintrs;
+ u_int32_t sc_eintrs; /* enabled interrupts */
+
ohci_soft_ed_t *sc_isoc_head;
ohci_soft_ed_t *sc_ctrl_head;
ohci_soft_ed_t *sc_bulk_head;
OpenPOWER on IntegriCloud