Expand callout compatibility macros in the main usb bridges.
This commit is contained in:
parent
a73530728e
commit
200d9c860d
@ -476,8 +476,8 @@ ehci_init(ehci_softc_t *sc)
|
|||||||
sc->sc_async_head = sqh;
|
sc->sc_async_head = sqh;
|
||||||
EOWRITE4(sc, EHCI_ASYNCLISTADDR, sqh->physaddr | EHCI_LINK_QH);
|
EOWRITE4(sc, EHCI_ASYNCLISTADDR, sqh->physaddr | EHCI_LINK_QH);
|
||||||
|
|
||||||
usb_callout_init(sc->sc_tmo_pcd);
|
callout_init(&sc->sc_tmo_pcd, 0);
|
||||||
usb_callout_init(sc->sc_tmo_intrlist);
|
callout_init(&sc->sc_tmo_intrlist, 0);
|
||||||
|
|
||||||
lockinit(&sc->sc_doorbell_lock, PZERO, "ehcidb", 0, 0);
|
lockinit(&sc->sc_doorbell_lock, PZERO, "ehcidb", 0, 0);
|
||||||
|
|
||||||
@ -594,7 +594,7 @@ ehci_intr1(ehci_softc_t *sc)
|
|||||||
*/
|
*/
|
||||||
ehci_pcd_able(sc, 0);
|
ehci_pcd_able(sc, 0);
|
||||||
/* Do not allow RHSC interrupts > 1 per second */
|
/* Do not allow RHSC interrupts > 1 per second */
|
||||||
usb_callout(sc->sc_tmo_pcd, hz, ehci_pcd_enable, sc);
|
callout_reset(&sc->sc_tmo_pcd, hz, ehci_pcd_enable, sc);
|
||||||
eintrs &= ~EHCI_STS_PCD;
|
eintrs &= ~EHCI_STS_PCD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -684,8 +684,8 @@ ehci_softintr(void *v)
|
|||||||
/* Schedule a callout to catch any dropped transactions. */
|
/* Schedule a callout to catch any dropped transactions. */
|
||||||
if ((sc->sc_flags & EHCI_SCFLG_LOSTINTRBUG) &&
|
if ((sc->sc_flags & EHCI_SCFLG_LOSTINTRBUG) &&
|
||||||
!LIST_EMPTY(&sc->sc_intrhead))
|
!LIST_EMPTY(&sc->sc_intrhead))
|
||||||
usb_callout(sc->sc_tmo_intrlist, hz / 5, ehci_intrlist_timeout,
|
callout_reset(&sc->sc_tmo_intrlist, hz / 5,
|
||||||
sc);
|
ehci_intrlist_timeout, sc);
|
||||||
|
|
||||||
#ifdef USB_USE_SOFTINTR
|
#ifdef USB_USE_SOFTINTR
|
||||||
if (sc->sc_softwake) {
|
if (sc->sc_softwake) {
|
||||||
@ -742,7 +742,7 @@ ehci_check_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
|
|||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
DPRINTFN(12, ("ehci_check_intr: ex=%p done\n", ex));
|
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);
|
||||||
usb_rem_task(ex->xfer.pipe->device, &ex->abort_task);
|
usb_rem_task(ex->xfer.pipe->device, &ex->abort_task);
|
||||||
ehci_idone(ex);
|
ehci_idone(ex);
|
||||||
}
|
}
|
||||||
@ -929,8 +929,8 @@ ehci_detach(struct ehci_softc *sc, int flags)
|
|||||||
EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
|
EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
|
||||||
EOWRITE4(sc, EHCI_USBCMD, 0);
|
EOWRITE4(sc, EHCI_USBCMD, 0);
|
||||||
EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
|
EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
|
||||||
usb_uncallout(sc->sc_tmo_intrlist, ehci_intrlist_timeout, sc);
|
callout_stop(&sc->sc_tmo_intrlist);
|
||||||
usb_uncallout(sc->sc_tmo_pcd, ehci_pcd_enable, sc);
|
callout_stop(&sc->sc_tmo_pcd);
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
if (sc->sc_powerhook != NULL)
|
if (sc->sc_powerhook != NULL)
|
||||||
@ -969,9 +969,7 @@ ehci_power(int why, void *v)
|
|||||||
s = splhardusb();
|
s = splhardusb();
|
||||||
switch (why) {
|
switch (why) {
|
||||||
case PWR_SUSPEND:
|
case PWR_SUSPEND:
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
|
||||||
case PWR_STANDBY:
|
case PWR_STANDBY:
|
||||||
#endif
|
|
||||||
sc->sc_bus.use_polling++;
|
sc->sc_bus.use_polling++;
|
||||||
|
|
||||||
for (i = 1; i <= sc->sc_noport; i++) {
|
for (i = 1; i <= sc->sc_noport; i++) {
|
||||||
@ -1069,12 +1067,10 @@ ehci_power(int why, void *v)
|
|||||||
|
|
||||||
sc->sc_bus.use_polling--;
|
sc->sc_bus.use_polling--;
|
||||||
break;
|
break;
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
|
||||||
case PWR_SOFTSUSPEND:
|
case PWR_SOFTSUSPEND:
|
||||||
case PWR_SOFTSTANDBY:
|
case PWR_SOFTSTANDBY:
|
||||||
case PWR_SOFTRESUME:
|
case PWR_SOFTRESUME:
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
||||||
@ -2523,7 +2519,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
/* If we're dying, just do the software part. */
|
/* If we're dying, just do the software part. */
|
||||||
s = splusb();
|
s = splusb();
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(epipe->pipe.device, &exfer->abort_task);
|
usb_rem_task(epipe->pipe.device, &exfer->abort_task);
|
||||||
usb_transfer_complete(xfer);
|
usb_transfer_complete(xfer);
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -2557,7 +2553,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
exfer->ehci_xfer_flags |= EHCI_XFER_ABORTING;
|
exfer->ehci_xfer_flags |= EHCI_XFER_ABORTING;
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, ehci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(epipe->pipe.device, &exfer->abort_task);
|
usb_rem_task(epipe->pipe.device, &exfer->abort_task);
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
||||||
@ -2932,7 +2928,7 @@ ehci_device_request(usbd_xfer_handle xfer)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
ehci_activate_qh(sqh, setup);
|
ehci_activate_qh(sqh, setup);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
ehci_timeout, xfer);
|
ehci_timeout, xfer);
|
||||||
}
|
}
|
||||||
ehci_add_intr_list(sc, exfer);
|
ehci_add_intr_list(sc, exfer);
|
||||||
@ -3059,7 +3055,7 @@ ehci_device_bulk_start(usbd_xfer_handle xfer)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
ehci_activate_qh(sqh, data);
|
ehci_activate_qh(sqh, data);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
ehci_timeout, xfer);
|
ehci_timeout, xfer);
|
||||||
}
|
}
|
||||||
ehci_add_intr_list(sc, exfer);
|
ehci_add_intr_list(sc, exfer);
|
||||||
@ -3244,7 +3240,7 @@ ehci_device_intr_start(usbd_xfer_handle xfer)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
ehci_activate_qh(sqh, data);
|
ehci_activate_qh(sqh, data);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
ehci_timeout, xfer);
|
ehci_timeout, xfer);
|
||||||
}
|
}
|
||||||
ehci_add_intr_list(sc, exfer);
|
ehci_add_intr_list(sc, exfer);
|
||||||
@ -3354,7 +3350,7 @@ ehci_device_intr_done(usbd_xfer_handle xfer)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
ehci_activate_qh(sqh, data);
|
ehci_activate_qh(sqh, data);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle,
|
callout_reset(&xfer->timeout_handle,
|
||||||
MS_TO_TICKS(xfer->timeout), ehci_timeout, xfer);
|
MS_TO_TICKS(xfer->timeout), ehci_timeout, xfer);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
@ -154,12 +154,9 @@ typedef struct ehci_softc {
|
|||||||
|
|
||||||
struct lock sc_doorbell_lock;
|
struct lock sc_doorbell_lock;
|
||||||
|
|
||||||
usb_callout_t sc_tmo_pcd;
|
struct callout sc_tmo_pcd;
|
||||||
usb_callout_t sc_tmo_intrlist;
|
struct callout sc_tmo_intrlist;
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
|
||||||
device_t sc_child; /* /dev/usb# device */
|
|
||||||
#endif
|
|
||||||
char sc_dying;
|
char sc_dying;
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
struct usb_dma_reserve sc_dma_reserve;
|
struct usb_dma_reserve sc_dma_reserve;
|
||||||
|
@ -338,7 +338,7 @@ ohci_detach(struct ohci_softc *sc, int flags)
|
|||||||
int i, rv = 0;
|
int i, rv = 0;
|
||||||
|
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
usb_uncallout(sc->sc_tmo_rhsc, ohci_rhsc_enable, sc);
|
callout_stop(&sc->sc_tmo_rhsc);
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
powerhook_disestablish(sc->sc_powerhook);
|
powerhook_disestablish(sc->sc_powerhook);
|
||||||
@ -793,7 +793,7 @@ ohci_init(ohci_softc_t *sc)
|
|||||||
sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
|
sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usb_callout_init(sc->sc_tmo_rhsc);
|
callout_init(&sc->sc_tmo_rhsc, 0);
|
||||||
|
|
||||||
return (USBD_NORMAL_COMPLETION);
|
return (USBD_NORMAL_COMPLETION);
|
||||||
|
|
||||||
@ -1212,7 +1212,7 @@ ohci_intr1(ohci_softc_t *sc)
|
|||||||
*/
|
*/
|
||||||
ohci_rhsc_able(sc, 0);
|
ohci_rhsc_able(sc, 0);
|
||||||
/* Do not allow RHSC interrupts > 1 per second */
|
/* Do not allow RHSC interrupts > 1 per second */
|
||||||
usb_callout(sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
|
callout_reset(&sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
|
||||||
eintrs &= ~OHCI_RHSC;
|
eintrs &= ~OHCI_RHSC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1384,7 +1384,7 @@ ohci_softintr(void *v)
|
|||||||
DPRINTFN(15,("ohci_process_done: error cc=%d (%s)\n",
|
DPRINTFN(15,("ohci_process_done: error cc=%d (%s)\n",
|
||||||
OHCI_TD_GET_CC(le32toh(std->td.td_flags)),
|
OHCI_TD_GET_CC(le32toh(std->td.td_flags)),
|
||||||
ohci_cc_strs[OHCI_TD_GET_CC(le32toh(std->td.td_flags))]));
|
ohci_cc_strs[OHCI_TD_GET_CC(le32toh(std->td.td_flags))]));
|
||||||
usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(OXFER(xfer)->xfer.pipe->device,
|
usb_rem_task(OXFER(xfer)->xfer.pipe->device,
|
||||||
&OXFER(xfer)->abort_task);
|
&OXFER(xfer)->abort_task);
|
||||||
|
|
||||||
@ -1424,7 +1424,7 @@ ohci_softintr(void *v)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Normal transfer completion */
|
/* Normal transfer completion */
|
||||||
usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(OXFER(xfer)->xfer.pipe->device,
|
usb_rem_task(OXFER(xfer)->xfer.pipe->device,
|
||||||
&OXFER(xfer)->abort_task);
|
&OXFER(xfer)->abort_task);
|
||||||
for (p = xfer->hcpriv; p->xfer == xfer; p = n) {
|
for (p = xfer->hcpriv; p->xfer == xfer; p = n) {
|
||||||
@ -1753,7 +1753,7 @@ ohci_device_request(usbd_xfer_handle xfer)
|
|||||||
opipe->tail.td = tail;
|
opipe->tail.td = tail;
|
||||||
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
|
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
ohci_timeout, xfer);
|
ohci_timeout, xfer);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -2211,7 +2211,7 @@ ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
/* If we're dying, just do the software part. */
|
/* If we're dying, just do the software part. */
|
||||||
s = splusb();
|
s = splusb();
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(xfer->pipe->device, &OXFER(xfer)->abort_task);
|
usb_rem_task(xfer->pipe->device, &OXFER(xfer)->abort_task);
|
||||||
usb_transfer_complete(xfer);
|
usb_transfer_complete(xfer);
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -2245,7 +2245,7 @@ ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
oxfer->ohci_xfer_flags |= OHCI_XFER_ABORTING;
|
oxfer->ohci_xfer_flags |= OHCI_XFER_ABORTING;
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(xfer->pipe->device, &OXFER(xfer)->abort_task);
|
usb_rem_task(xfer->pipe->device, &OXFER(xfer)->abort_task);
|
||||||
splx(s);
|
splx(s);
|
||||||
DPRINTFN(1,("ohci_abort_xfer: stop ed=%p\n", sed));
|
DPRINTFN(1,("ohci_abort_xfer: stop ed=%p\n", sed));
|
||||||
@ -2967,7 +2967,7 @@ ohci_device_bulk_start(usbd_xfer_handle xfer)
|
|||||||
sed->ed.ed_flags &= htole32(~OHCI_ED_SKIP);
|
sed->ed.ed_flags &= htole32(~OHCI_ED_SKIP);
|
||||||
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
|
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
ohci_timeout, xfer);
|
ohci_timeout, xfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ typedef struct ohci_softc {
|
|||||||
u_int sc_overrun_cnt;
|
u_int sc_overrun_cnt;
|
||||||
struct timeval sc_overrun_ntc;
|
struct timeval sc_overrun_ntc;
|
||||||
|
|
||||||
usb_callout_t sc_tmo_rhsc;
|
struct callout sc_tmo_rhsc;
|
||||||
char sc_dying;
|
char sc_dying;
|
||||||
} ohci_softc_t;
|
} ohci_softc_t;
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ uhci_init(uhci_softc_t *sc)
|
|||||||
|
|
||||||
STAILQ_INIT(&sc->sc_free_xfers);
|
STAILQ_INIT(&sc->sc_free_xfers);
|
||||||
|
|
||||||
usb_callout_init(sc->sc_poll_handle);
|
callout_init(&sc->sc_poll_handle, 0);
|
||||||
|
|
||||||
/* Set up the bus struct. */
|
/* Set up the bus struct. */
|
||||||
sc->sc_bus.methods = &uhci_bus_methods;
|
sc->sc_bus.methods = &uhci_bus_methods;
|
||||||
@ -661,8 +661,7 @@ uhci_power(int why, void *v)
|
|||||||
uhci_dumpregs(sc);
|
uhci_dumpregs(sc);
|
||||||
#endif
|
#endif
|
||||||
if (sc->sc_intr_xfer != NULL)
|
if (sc->sc_intr_xfer != NULL)
|
||||||
usb_uncallout(sc->sc_poll_handle, uhci_poll_hub,
|
callout_stop(&sc->sc_poll_handle);
|
||||||
sc->sc_intr_xfer);
|
|
||||||
sc->sc_bus.use_polling++;
|
sc->sc_bus.use_polling++;
|
||||||
uhci_run(sc, 0); /* stop the controller */
|
uhci_run(sc, 0); /* stop the controller */
|
||||||
cmd &= ~UHCI_CMD_RS;
|
cmd &= ~UHCI_CMD_RS;
|
||||||
@ -709,7 +708,7 @@ uhci_power(int why, void *v)
|
|||||||
usb_delay_ms(&sc->sc_bus, USB_RESUME_RECOVERY);
|
usb_delay_ms(&sc->sc_bus, USB_RESUME_RECOVERY);
|
||||||
sc->sc_bus.use_polling--;
|
sc->sc_bus.use_polling--;
|
||||||
if (sc->sc_intr_xfer != NULL)
|
if (sc->sc_intr_xfer != NULL)
|
||||||
usb_callout(sc->sc_poll_handle, sc->sc_ival,
|
callout_reset(&sc->sc_poll_handle, sc->sc_ival,
|
||||||
uhci_poll_hub, sc->sc_intr_xfer);
|
uhci_poll_hub, sc->sc_intr_xfer);
|
||||||
#ifdef USB_DEBUG
|
#ifdef USB_DEBUG
|
||||||
if (uhcidebug > 2)
|
if (uhcidebug > 2)
|
||||||
@ -924,7 +923,7 @@ uhci_poll_hub(void *addr)
|
|||||||
|
|
||||||
DPRINTFN(20, ("uhci_poll_hub\n"));
|
DPRINTFN(20, ("uhci_poll_hub\n"));
|
||||||
|
|
||||||
usb_callout(sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
|
callout_reset(&sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
|
||||||
|
|
||||||
p = xfer->buffer;
|
p = xfer->buffer;
|
||||||
p[0] = 0;
|
p[0] = 0;
|
||||||
@ -1320,7 +1319,7 @@ uhci_check_intr(uhci_softc_t *sc, uhci_intr_info_t *ii)
|
|||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
DPRINTFN(12, ("uhci_check_intr: ii=%p done\n", ii));
|
DPRINTFN(12, ("uhci_check_intr: ii=%p done\n", ii));
|
||||||
usb_uncallout(ii->xfer->timeout_handle, uhci_timeout, ii);
|
callout_stop(&ii->xfer->timeout_handle);
|
||||||
usb_rem_task(ii->xfer->pipe->device, &UXFER(ii->xfer)->abort_task);
|
usb_rem_task(ii->xfer->pipe->device, &UXFER(ii->xfer)->abort_task);
|
||||||
uhci_idone(ii);
|
uhci_idone(ii);
|
||||||
}
|
}
|
||||||
@ -1941,7 +1940,7 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
|
|||||||
uhci_add_intr_info(sc, ii);
|
uhci_add_intr_info(sc, ii);
|
||||||
|
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
uhci_timeout, ii);
|
uhci_timeout, ii);
|
||||||
}
|
}
|
||||||
xfer->status = USBD_IN_PROGRESS;
|
xfer->status = USBD_IN_PROGRESS;
|
||||||
@ -1994,7 +1993,7 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
/* If we're dying, just do the software part. */
|
/* If we're dying, just do the software part. */
|
||||||
s = splusb();
|
s = splusb();
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, uhci_timeout, xfer);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(xfer->pipe->device, &UXFER(xfer)->abort_task);
|
usb_rem_task(xfer->pipe->device, &UXFER(xfer)->abort_task);
|
||||||
uhci_transfer_complete(xfer);
|
uhci_transfer_complete(xfer);
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -2028,7 +2027,7 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
|||||||
s = splusb();
|
s = splusb();
|
||||||
uxfer->uhci_xfer_flags |= UHCI_XFER_ABORTING;
|
uxfer->uhci_xfer_flags |= UHCI_XFER_ABORTING;
|
||||||
xfer->status = status; /* make software ignore it */
|
xfer->status = status; /* make software ignore it */
|
||||||
usb_uncallout(xfer->timeout_handle, uhci_timeout, ii);
|
callout_stop(&xfer->timeout_handle);
|
||||||
usb_rem_task(xfer->pipe->device, &UXFER(xfer)->abort_task);
|
usb_rem_task(xfer->pipe->device, &UXFER(xfer)->abort_task);
|
||||||
DPRINTFN(1,("uhci_abort_xfer: stop ii=%p\n", ii));
|
DPRINTFN(1,("uhci_abort_xfer: stop ii=%p\n", ii));
|
||||||
for (std = ii->stdstart; std != NULL; std = std->link.std)
|
for (std = ii->stdstart; std != NULL; std = std->link.std)
|
||||||
@ -2432,7 +2431,7 @@ uhci_device_request(usbd_xfer_handle xfer)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
if (xfer->timeout && !sc->sc_bus.use_polling) {
|
||||||
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
|
||||||
uhci_timeout, ii);
|
uhci_timeout, ii);
|
||||||
}
|
}
|
||||||
xfer->status = USBD_IN_PROGRESS;
|
xfer->status = USBD_IN_PROGRESS;
|
||||||
@ -3643,7 +3642,7 @@ uhci_root_intr_abort(usbd_xfer_handle xfer)
|
|||||||
{
|
{
|
||||||
uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
|
uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
|
||||||
|
|
||||||
usb_uncallout(sc->sc_poll_handle, uhci_poll_hub, xfer);
|
callout_stop(&sc->sc_poll_handle);
|
||||||
sc->sc_intr_xfer = NULL;
|
sc->sc_intr_xfer = NULL;
|
||||||
|
|
||||||
if (xfer->pipe->intrxfer == xfer) {
|
if (xfer->pipe->intrxfer == xfer) {
|
||||||
@ -3688,7 +3687,7 @@ uhci_root_intr_start(usbd_xfer_handle xfer)
|
|||||||
return (USBD_IOERROR);
|
return (USBD_IOERROR);
|
||||||
|
|
||||||
sc->sc_ival = MS_TO_TICKS(xfer->pipe->endpoint->edesc->bInterval);
|
sc->sc_ival = MS_TO_TICKS(xfer->pipe->endpoint->edesc->bInterval);
|
||||||
usb_callout(sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
|
callout_reset(&sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
|
||||||
sc->sc_intr_xfer = xfer;
|
sc->sc_intr_xfer = xfer;
|
||||||
return (USBD_IN_PROGRESS);
|
return (USBD_IN_PROGRESS);
|
||||||
}
|
}
|
||||||
@ -3699,7 +3698,7 @@ uhci_root_intr_close(usbd_pipe_handle pipe)
|
|||||||
{
|
{
|
||||||
uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
|
uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
|
||||||
|
|
||||||
usb_uncallout(sc->sc_poll_handle, uhci_poll_hub, sc->sc_intr_xfer);
|
callout_stop(&sc->sc_poll_handle);
|
||||||
sc->sc_intr_xfer = NULL;
|
sc->sc_intr_xfer = NULL;
|
||||||
DPRINTF(("uhci_root_intr_close\n"));
|
DPRINTF(("uhci_root_intr_close\n"));
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ typedef struct uhci_softc {
|
|||||||
/* Info for the root hub interrupt channel. */
|
/* Info for the root hub interrupt channel. */
|
||||||
int sc_ival; /* time between root hub intrs */
|
int sc_ival; /* time between root hub intrs */
|
||||||
usbd_xfer_handle sc_intr_xfer; /* root hub interrupt transfer */
|
usbd_xfer_handle sc_intr_xfer; /* root hub interrupt transfer */
|
||||||
usb_callout_t sc_poll_handle;
|
struct callout sc_poll_handle;
|
||||||
|
|
||||||
char sc_vendor[16]; /* vendor string for root hub */
|
char sc_vendor[16]; /* vendor string for root hub */
|
||||||
int sc_id_vendor; /* vendor ID for root hub */
|
int sc_id_vendor; /* vendor ID for root hub */
|
||||||
|
@ -340,7 +340,7 @@ typedef struct ukbd_state {
|
|||||||
#define INTRENABLED (1 << 0)
|
#define INTRENABLED (1 << 0)
|
||||||
#define DISCONNECTED (1 << 1)
|
#define DISCONNECTED (1 << 1)
|
||||||
|
|
||||||
usb_callout_t ks_timeout_handle;
|
struct callout ks_timeout_handle;
|
||||||
|
|
||||||
int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
|
int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
|
||||||
int ks_flags; /* flags */
|
int ks_flags; /* flags */
|
||||||
@ -569,7 +569,7 @@ ukbd_init(int unit, keyboard_t **kbdp, void *arg, int flags)
|
|||||||
state->ks_iface = uaa->iface;
|
state->ks_iface = uaa->iface;
|
||||||
state->ks_uaa = uaa;
|
state->ks_uaa = uaa;
|
||||||
state->ks_ifstate = 0;
|
state->ks_ifstate = 0;
|
||||||
usb_callout_init(state->ks_timeout_handle);
|
callout_init(&state->ks_timeout_handle, 0);
|
||||||
/*
|
/*
|
||||||
* FIXME: set the initial value for lock keys in ks_state
|
* FIXME: set the initial value for lock keys in ks_state
|
||||||
* according to the BIOS data?
|
* according to the BIOS data?
|
||||||
@ -639,7 +639,7 @@ ukbd_term(keyboard_t *kbd)
|
|||||||
state = (ukbd_state_t *)kbd->kb_data;
|
state = (ukbd_state_t *)kbd->kb_data;
|
||||||
DPRINTF(("ukbd_term: ks_ifstate=0x%x\n", state->ks_ifstate));
|
DPRINTF(("ukbd_term: ks_ifstate=0x%x\n", state->ks_ifstate));
|
||||||
|
|
||||||
usb_uncallout(state->ks_timeout_handle, ukbd_timeout, kbd);
|
callout_stop(&state->ks_timeout_handle);
|
||||||
|
|
||||||
if (state->ks_ifstate & INTRENABLED)
|
if (state->ks_ifstate & INTRENABLED)
|
||||||
ukbd_enable_intr(kbd, FALSE, NULL);
|
ukbd_enable_intr(kbd, FALSE, NULL);
|
||||||
@ -680,7 +680,7 @@ ukbd_timeout(void *arg)
|
|||||||
state = (ukbd_state_t *)kbd->kb_data;
|
state = (ukbd_state_t *)kbd->kb_data;
|
||||||
s = splusb();
|
s = splusb();
|
||||||
(*kbdsw[kbd->kb_index]->intr)(kbd, (void *)USBD_NORMAL_COMPLETION);
|
(*kbdsw[kbd->kb_index]->intr)(kbd, (void *)USBD_NORMAL_COMPLETION);
|
||||||
usb_callout(state->ks_timeout_handle, hz / 40, ukbd_timeout, arg);
|
callout_reset(&state->ks_timeout_handle, hz / 40, ukbd_timeout, arg);
|
||||||
splx(s);
|
splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ struct usbd_xfer {
|
|||||||
|
|
||||||
void *hcpriv; /* private use by the HC driver */
|
void *hcpriv; /* private use by the HC driver */
|
||||||
|
|
||||||
usb_callout_t timeout_handle;
|
struct callout timeout_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
void usbd_init(void);
|
void usbd_init(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user