diff options
Diffstat (limited to 'sys/dev/usb/usb_util.c')
-rw-r--r-- | sys/dev/usb/usb_util.c | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c index 5e5bf83..ab0c987 100644 --- a/sys/dev/usb/usb_util.c +++ b/sys/dev/usb/usb_util.c @@ -38,11 +38,6 @@ #include <dev/usb/usb_controller.h> #include <dev/usb/usb_bus.h> -/* function prototypes */ -#if (USB_HAVE_CONDVAR == 0) -static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, int timo); - -#endif /*------------------------------------------------------------------------* * device_delete_all_children - delete all children of a device @@ -233,101 +228,3 @@ usb2_make_str_desc(void *ptr, uint16_t max_len, const char *s) } return (totlen); } - -#if (USB_HAVE_CONDVAR == 0) - -/*------------------------------------------------------------------------* - * usb2_cv_init - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_init(struct cv *cv, const char *desc) -{ - cv_init(cv, desc); -} - -/*------------------------------------------------------------------------* - * usb2_cv_destroy - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_destroy(struct cv *cv) -{ - cv_destroy(cv); -} - -/*------------------------------------------------------------------------* - * usb2_cv_wait - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_wait(struct cv *cv, struct mtx *mtx) -{ - int err; - - err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), 0); -} - -/*------------------------------------------------------------------------* - * usb2_cv_wait_sig - wrapper function - *------------------------------------------------------------------------*/ -int -usb2_cv_wait_sig(struct cv *cv, struct mtx *mtx) -{ - int err; - - err = usb2_msleep(cv, mtx, PCATCH, cv_wmesg(cv), 0); - return (err); -} - -/*------------------------------------------------------------------------* - * usb2_cv_timedwait - wrapper function - *------------------------------------------------------------------------*/ -int -usb2_cv_timedwait(struct cv *cv, struct mtx *mtx, int timo) -{ - int err; - - if (timo == 0) - timo = 1; /* zero means no timeout */ - err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), timo); - return (err); -} - -/*------------------------------------------------------------------------* - * usb2_cv_signal - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_signal(struct cv *cv) -{ - wakeup_one(cv); -} - -/*------------------------------------------------------------------------* - * usb2_cv_broadcast - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_broadcast(struct cv *cv) -{ - wakeup(cv); -} - -/*------------------------------------------------------------------------* - * usb2_msleep - wrapper function - *------------------------------------------------------------------------*/ -static int -usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, - int timo) -{ - int err; - - if (mtx == &Giant) { - err = tsleep(chan, priority, wmesg, timo); - } else { -#ifdef mtx_sleep - err = mtx_sleep(chan, mtx, priority, wmesg, timo); -#else - err = msleep(chan, mtx, priority, wmesg, timo); -#endif - } - return (err); -} - -#endif |