Module Name: src
Committed By: dyoung
Date: Fri Sep 4 17:55:03 UTC 2009
Modified Files:
src/sys/dev/usb: ehci.c ehcivar.h
Log Message:
Expand <dev/usb/usb_port.h> definitions, and lightly unifdef(1).
To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/ehcivar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.158 src/sys/dev/usb/ehci.c:1.159
--- src/sys/dev/usb/ehci.c:1.158 Mon Jul 27 14:41:19 2009
+++ src/sys/dev/usb/ehci.c Fri Sep 4 17:55:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.158 2009/07/27 14:41:19 sketch Exp $ */
+/* $NetBSD: ehci.c,v 1.159 2009/09/04 17:55:03 dyoung Exp $ */
/*
* Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.158 2009/07/27 14:41:19 sketch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.159 2009/09/04 17:55:03 dyoung Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -84,9 +84,6 @@
#define DPRINTF(x) do { if (ehcidebug) printf x; } while(0)
#define DPRINTFN(n,x) do { if (ehcidebug>(n)) printf x; } while (0)
int ehcidebug = 0;
-#ifndef __NetBSD__
-#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l))
-#endif
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
@@ -510,7 +507,7 @@
sc->sc_async_head = sqh;
EOWRITE4(sc, EHCI_ASYNCLISTADDR, sqh->physaddr | EHCI_LINK_QH);
- usb_callout_init(sc->sc_tmo_intrlist);
+ callout_init(&(sc->sc_tmo_intrlist), 0);
mutex_init(&sc->sc_doorbell_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -694,8 +691,8 @@
/* Schedule a callout to catch any dropped transactions. */
if ((sc->sc_flags & EHCIF_DROPPED_INTR_WORKAROUND) &&
!TAILQ_EMPTY(&sc->sc_intrhead))
- usb_callout(sc->sc_tmo_intrlist, hz,
- ehci_intrlist_timeout, sc);
+ callout_reset(&(sc->sc_tmo_intrlist),
+ (hz), (ehci_intrlist_timeout), (sc));
#ifdef USB_USE_SOFTINTR
if (sc->sc_softwake) {
@@ -781,7 +778,7 @@
}
done:
DPRINTFN(12, ("ehci_check_intr: ex=%p done\n", ex));
- usb_uncallout(ex->xfer.timeout_handle, ehci_timeout, ex);
+ callout_stop(&(ex->xfer.timeout_handle));
ehci_idone(ex);
}
@@ -828,7 +825,7 @@
return;
done:
DPRINTFN(12, ("ehci_check_itd_intr: ex=%p done\n", ex));
- usb_uncallout(ex->xfer.timeout_handle, ehci_timeout, ex);
+ callout_stop(&(ex->xfer.timeout_handle));
ehci_idone(ex);
}
@@ -1087,7 +1084,7 @@
if (rv != 0)
return (rv);
- usb_uncallout(sc->sc_tmo_intrlist, ehci_intrlist_timeout, sc);
+ callout_stop(&(sc->sc_tmo_intrlist));
usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */
@@ -2866,7 +2863,7 @@
/* If we're dying, just do the software part. */
s = splusb();
xfer->status = status; /* make software ignore it */
- usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
+ callout_stop(&(xfer->timeout_handle));
usb_transfer_complete(xfer);
splx(s);
return;
@@ -2900,7 +2897,7 @@
*/
s = splusb();
xfer->status = status; /* make software ignore it */
- usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
+ callout_stop(&(xfer->timeout_handle));
usb_syncmem(&sqh->dma,
sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
@@ -3016,7 +3013,7 @@
if (sc->sc_dying) {
s = splusb();
xfer->status = status;
- usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
+ callout_stop(&(xfer->timeout_handle));
usb_transfer_complete(xfer);
splx(s);
return;
@@ -3040,7 +3037,7 @@
xfer->hcflags |= UXFER_ABORTING;
xfer->status = status;
- usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
+ callout_stop(&(xfer->timeout_handle));
s = splusb();
for (itd = exfer->itdstart; itd != NULL; itd = itd->xfer_next) {
@@ -3342,8 +3339,8 @@
s = splusb();
ehci_set_qh_qtd(sqh, setup); /* also does usb_syncmem(sqh) */
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
- ehci_timeout, xfer);
+ callout_reset(&(xfer->timeout_handle), (mstohz(xfer->timeout)),
+ (ehci_timeout), (xfer));
}
mutex_enter(&sc->sc_intrhead_lock);
ehci_add_intr_list(sc, exfer);
@@ -3477,8 +3474,8 @@
s = splusb();
ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
- ehci_timeout, xfer);
+ callout_reset(&(xfer->timeout_handle), (mstohz(xfer->timeout)),
+ (ehci_timeout), (xfer));
}
mutex_enter(&sc->sc_intrhead_lock);
ehci_add_intr_list(sc, exfer);
@@ -3655,8 +3652,8 @@
s = splusb();
ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
- ehci_timeout, xfer);
+ callout_reset(&(xfer->timeout_handle), (mstohz(xfer->timeout)),
+ (ehci_timeout), (xfer));
}
mutex_enter(&sc->sc_intrhead_lock);
ehci_add_intr_list(sc, exfer);
@@ -3760,8 +3757,8 @@
s = splusb();
ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle,
- mstohz(xfer->timeout), ehci_timeout, xfer);
+ callout_reset(&(xfer->timeout_handle),
+ (mstohz(xfer->timeout)), (ehci_timeout), (xfer));
}
splx(s);
Index: src/sys/dev/usb/ehcivar.h
diff -u src/sys/dev/usb/ehcivar.h:1.33 src/sys/dev/usb/ehcivar.h:1.34
--- src/sys/dev/usb/ehcivar.h:1.33 Tue Oct 14 18:12:38 2008
+++ src/sys/dev/usb/ehcivar.h Fri Sep 4 17:55:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ehcivar.h,v 1.33 2008/10/14 18:12:38 jmcneill Exp $ */
+/* $NetBSD: ehcivar.h,v 1.34 2009/09/04 17:55:03 dyoung Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -162,15 +162,11 @@
kmutex_t sc_doorbell_lock;
- usb_callout_t sc_tmo_intrlist;
+ struct callout sc_tmo_intrlist;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- device_ptr_t sc_child; /* /dev/usb# device */
-#endif
+ device_t sc_child; /* /dev/usb# device */
char sc_dying;
-#if defined(__NetBSD__)
struct usb_dma_reserve sc_dma_reserve;
-#endif
} ehci_softc_t;
#define EREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (a))