Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/mrg-ohci-jmcneill-usbmp]: src/sys/dev/usb sync a couple more changes fro...
details: https://anonhg.NetBSD.org/src/rev/d1439563a5cb
branches: mrg-ohci-jmcneill-usbmp
changeset: 771769:d1439563a5cb
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Dec 08 08:52:24 2011 +0000
description:
sync a couple more changes from the main branch, uaudio@ohci still works.
diffstat:
sys/dev/usb/ehci.c | 113 ++++++++++++++++++++++++++++------------------------
sys/dev/usb/ohci.c | 6 +-
2 files changed, 63 insertions(+), 56 deletions(-)
diffs (236 lines):
diff -r d09c6672eb60 -r d1439563a5cb sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c Thu Dec 08 08:17:30 2011 +0000
+++ b/sys/dev/usb/ehci.c Thu Dec 08 08:52:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.181.6.2 2011/12/04 19:22:56 jmcneill Exp $ */
+/* $NetBSD: ehci.c,v 1.181.6.2.2.1 2011/12/08 08:52:24 mrg Exp $ */
/*
* Copyright (c) 2004-2011 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.181.6.2 2011/12/04 19:22:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.181.6.2.2.1 2011/12/08 08:52:24 mrg Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -220,7 +220,8 @@
Static usbd_status ehci_device_setintr(ehci_softc_t *, ehci_soft_qh_t *,
int ival);
-Static void ehci_add_qh(ehci_soft_qh_t *, ehci_soft_qh_t *);
+Static void ehci_add_qh(ehci_softc_t *, ehci_soft_qh_t *,
+ ehci_soft_qh_t *);
Static void ehci_rem_qh(ehci_softc_t *, ehci_soft_qh_t *,
ehci_soft_qh_t *);
Static void ehci_set_qh_qtd(ehci_soft_qh_t *, ehci_soft_qtd_t *);
@@ -261,68 +262,68 @@
#define ehci_active_intr_list(ex) ((ex)->inext.tqe_prev != NULL)
Static const struct usbd_bus_methods ehci_bus_methods = {
- ehci_open,
- ehci_softintr,
- ehci_poll,
- ehci_allocm,
- ehci_freem,
- ehci_allocx,
- ehci_freex,
- ehci_get_locks,
+ .open_pipe = ehci_open,
+ .soft_intr = ehci_softintr,
+ .do_poll = ehci_poll,
+ .allocm = ehci_allocm,
+ .freem = ehci_freem,
+ .allocx = ehci_allocx,
+ .freex = ehci_freex,
+ .get_locks = ehci_get_locks,
};
Static const struct usbd_pipe_methods ehci_root_ctrl_methods = {
- ehci_root_ctrl_transfer,
- ehci_root_ctrl_start,
- ehci_root_ctrl_abort,
- ehci_root_ctrl_close,
- ehci_noop,
- ehci_root_ctrl_done,
+ .transfer = ehci_root_ctrl_transfer,
+ .start = ehci_root_ctrl_start,
+ .abort = ehci_root_ctrl_abort,
+ .close = ehci_root_ctrl_close,
+ .cleartoggle = ehci_noop,
+ .done = ehci_root_ctrl_done,
};
Static const struct usbd_pipe_methods ehci_root_intr_methods = {
- ehci_root_intr_transfer,
- ehci_root_intr_start,
- ehci_root_intr_abort,
- ehci_root_intr_close,
- ehci_noop,
- ehci_root_intr_done,
+ .transfer = ehci_root_intr_transfer,
+ .start = ehci_root_intr_start,
+ .abort = ehci_root_intr_abort,
+ .close = ehci_root_intr_close,
+ .cleartoggle = ehci_noop,
+ .done = ehci_root_intr_done,
};
Static const struct usbd_pipe_methods ehci_device_ctrl_methods = {
- ehci_device_ctrl_transfer,
- ehci_device_ctrl_start,
- ehci_device_ctrl_abort,
- ehci_device_ctrl_close,
- ehci_noop,
- ehci_device_ctrl_done,
+ .transfer = ehci_device_ctrl_transfer,
+ .start = ehci_device_ctrl_start,
+ .abort = ehci_device_ctrl_abort,
+ .close = ehci_device_ctrl_close,
+ .cleartoggle = ehci_noop,
+ .done = ehci_device_ctrl_done,
};
Static const struct usbd_pipe_methods ehci_device_intr_methods = {
- ehci_device_intr_transfer,
- ehci_device_intr_start,
- ehci_device_intr_abort,
- ehci_device_intr_close,
- ehci_device_clear_toggle,
- ehci_device_intr_done,
+ .transfer = ehci_device_intr_transfer,
+ .start = ehci_device_intr_start,
+ .abort = ehci_device_intr_abort,
+ .close = ehci_device_intr_close,
+ .cleartoggle = ehci_device_clear_toggle,
+ .done = ehci_device_intr_done,
};
Static const struct usbd_pipe_methods ehci_device_bulk_methods = {
- ehci_device_bulk_transfer,
- ehci_device_bulk_start,
- ehci_device_bulk_abort,
- ehci_device_bulk_close,
- ehci_device_clear_toggle,
- ehci_device_bulk_done,
+ .transfer = ehci_device_bulk_transfer,
+ .start = ehci_device_bulk_start,
+ .abort = ehci_device_bulk_abort,
+ .close = ehci_device_bulk_close,
+ .cleartoggle = ehci_device_clear_toggle,
+ .done = ehci_device_bulk_done,
};
Static const struct usbd_pipe_methods ehci_device_isoc_methods = {
- ehci_device_isoc_transfer,
- ehci_device_isoc_start,
- ehci_device_isoc_abort,
- ehci_device_isoc_close,
- ehci_noop,
- ehci_device_isoc_done,
+ .transfer = ehci_device_isoc_transfer,
+ .start = ehci_device_isoc_start,
+ .abort = ehci_device_isoc_abort,
+ .close = ehci_device_isoc_close,
+ .cleartoggle = ehci_noop,
+ .done = ehci_device_isoc_done,
};
static const uint8_t revbits[EHCI_MAX_POLLRATE] = {
@@ -652,7 +653,9 @@
sc->sc_bus.no_intrs++;
if (eintrs & EHCI_STS_IAA) {
DPRINTF(("ehci_intr1: door bell\n"));
+ kpreempt_disable();
softint_schedule(sc->sc_doorbell_si);
+ kpreempt_enable();
eintrs &= ~EHCI_STS_IAA;
}
if (eintrs & (EHCI_STS_INT | EHCI_STS_ERRINT)) {
@@ -668,7 +671,9 @@
/* XXX what else */
}
if (eintrs & EHCI_STS_PCD) {
+ kpreempt_disable();
softint_schedule(sc->sc_pcd_si);
+ kpreempt_enable();
eintrs &= ~EHCI_STS_PCD;
}
@@ -1749,13 +1754,13 @@
goto bad;
pipe->methods = &ehci_device_ctrl_methods;
mutex_enter(&sc->sc_lock);
- ehci_add_qh(sqh, sc->sc_async_head);
+ ehci_add_qh(sc, sqh, sc->sc_async_head);
mutex_exit(&sc->sc_lock);
break;
case UE_BULK:
pipe->methods = &ehci_device_bulk_methods;
mutex_enter(&sc->sc_lock);
- ehci_add_qh(sqh, sc->sc_async_head);
+ ehci_add_qh(sc, sqh, sc->sc_async_head);
mutex_exit(&sc->sc_lock);
break;
case UE_INTERRUPT:
@@ -1811,9 +1816,10 @@
* Add an ED to the schedule. Called at splusb().
*/
Static void
-ehci_add_qh(ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
+ehci_add_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
{
- SPLUSBCHECK;
+
+ KASSERT(mutex_owned(&sc->sc_lock));
usb_syncmem(&head->dma, head->offs + offsetof(ehci_qh_t, qh_link),
sizeof(head->qh.qh_link), BUS_DMASYNC_POSTWRITE);
@@ -1842,7 +1848,8 @@
{
ehci_soft_qh_t *p;
- SPLUSBCHECK;
+ KASSERT(mutex_owned(&sc->sc_lock));
+
/* XXX */
for (p = head; p != NULL && p->next != sqh; p = p->next)
;
@@ -3707,7 +3714,7 @@
sqh->islot = islot;
isp = &sc->sc_islots[islot];
- ehci_add_qh(sqh, isp->sqh);
+ ehci_add_qh(sc, sqh, isp->sqh);
return (USBD_NORMAL_COMPLETION);
}
diff -r d09c6672eb60 -r d1439563a5cb sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c Thu Dec 08 08:17:30 2011 +0000
+++ b/sys/dev/usb/ohci.c Thu Dec 08 08:52:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.218.6.2.2.2 2011/12/08 08:17:30 mrg Exp $ */
+/* $NetBSD: ohci.c,v 1.218.6.2.2.3 2011/12/08 08:52:25 mrg Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.2.2.2 2011/12/08 08:17:30 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.2.2.3 2011/12/08 08:52:25 mrg Exp $");
#include "opt_usb.h"
@@ -1147,7 +1147,7 @@
OWRITE4(sc, OHCI_INTERRUPT_STATUS,
OREAD4(sc, OHCI_INTERRUPT_STATUS));
- return (0);
+ goto done;
}
ret = ohci_intr1(sc);
Home |
Main Index |
Thread Index |
Old Index