Use mstohz() in <sys/param.h> rather than homegrown MS_TO_TICKS().

This commit is contained in:
tsutsui 2003-02-22 05:24:16 +00:00
parent fa7988ee3e
commit 881b65ce01
4 changed files with 14 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ehci.c,v 1.44 2003/02/16 23:15:27 augustss Exp $ */
/* $NetBSD: ehci.c,v 1.45 2003/02/22 05:24:16 tsutsui Exp $ */
/*
* TODO
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.44 2003/02/16 23:15:27 augustss Exp $");
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.45 2003/02/22 05:24:16 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -212,8 +212,6 @@ Static void ehci_dump_exfer(struct ehci_xfer *);
#endif
#endif
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
#define EHCI_NULL htole32(EHCI_LINK_TERMINATE)
#define EHCI_INTR_ENDPT 1
@ -2569,7 +2567,7 @@ ehci_device_request(usbd_xfer_handle xfer)
s = splusb();
ehci_set_qh_qtd(sqh, setup);
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
ehci_timeout, xfer);
}
ehci_add_intr_list(sc, exfer);
@ -2679,7 +2677,7 @@ ehci_device_bulk_start(usbd_xfer_handle xfer)
s = splusb();
ehci_set_qh_qtd(sqh, data);
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
ehci_timeout, xfer);
}
ehci_add_intr_list(sc, exfer);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ohci.c,v 1.138 2003/02/08 03:32:50 ichiro Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.138 2003/02/08 03:32:50 ichiro Exp $");
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1728,7 +1728,7 @@ ohci_device_request(usbd_xfer_handle xfer)
opipe->tail.td = tail;
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
ohci_timeout, xfer);
}
splx(s);
@ -2897,7 +2897,7 @@ ohci_device_bulk_start(usbd_xfer_handle xfer)
sed->ed.ed_flags &= htole32(~OHCI_ED_SKIP);
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
ohci_timeout, xfer);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ohcivar.h,v 1.31 2002/09/30 16:36:20 augustss Exp $ */
/* $NetBSD: ohcivar.h,v 1.32 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@ -154,5 +154,3 @@ int ohci_intr(void *);
int ohci_detach(ohci_softc_t *, int);
int ohci_activate(device_ptr_t, enum devact);
#endif
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci.c,v 1.170 2003/02/19 01:35:04 augustss Exp $ */
/* $NetBSD: uhci.c,v 1.171 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.170 2003/02/19 01:35:04 augustss Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.171 2003/02/22 05:24:17 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -90,8 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.170 2003/02/19 01:35:04 augustss Exp $");
#define delay(d) DELAY(d)
#endif
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
#if defined(__OpenBSD__)
struct cfdriver uhci_cd = {
NULL, "uhci", DV_DULL
@ -1864,7 +1862,7 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
uhci_add_intr_info(sc, ii);
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
uhci_timeout, ii);
}
xfer->status = USBD_IN_PROGRESS;
@ -2280,7 +2278,7 @@ uhci_device_request(usbd_xfer_handle xfer)
}
#endif
if (xfer->timeout && !sc->sc_bus.use_polling) {
usb_callout(xfer->timeout_handle, MS_TO_TICKS(xfer->timeout),
usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
uhci_timeout, ii);
}
xfer->status = USBD_IN_PROGRESS;
@ -3482,7 +3480,7 @@ uhci_root_intr_start(usbd_xfer_handle xfer)
if (sc->sc_dying)
return (USBD_IOERROR);
sc->sc_ival = MS_TO_TICKS(xfer->pipe->endpoint->edesc->bInterval);
sc->sc_ival = mstohz(xfer->pipe->endpoint->edesc->bInterval);
usb_callout(sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
sc->sc_intr_xfer = xfer;
return (USBD_IN_PROGRESS);