102ac6454SAndrew Thompson /*-
2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni *
402ac6454SAndrew Thompson * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
502ac6454SAndrew Thompson *
602ac6454SAndrew Thompson * Redistribution and use in source and binary forms, with or without
702ac6454SAndrew Thompson * modification, are permitted provided that the following conditions
802ac6454SAndrew Thompson * are met:
902ac6454SAndrew Thompson * 1. Redistributions of source code must retain the above copyright
1002ac6454SAndrew Thompson * notice, this list of conditions and the following disclaimer.
1102ac6454SAndrew Thompson * 2. Redistributions in binary form must reproduce the above copyright
1202ac6454SAndrew Thompson * notice, this list of conditions and the following disclaimer in the
1302ac6454SAndrew Thompson * documentation and/or other materials provided with the distribution.
1402ac6454SAndrew Thompson *
1502ac6454SAndrew Thompson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1602ac6454SAndrew Thompson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1702ac6454SAndrew Thompson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1802ac6454SAndrew Thompson * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1902ac6454SAndrew Thompson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2002ac6454SAndrew Thompson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2102ac6454SAndrew Thompson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2202ac6454SAndrew Thompson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2302ac6454SAndrew Thompson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2402ac6454SAndrew Thompson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2502ac6454SAndrew Thompson * SUCH DAMAGE.
2602ac6454SAndrew Thompson */
2702ac6454SAndrew Thompson
2802ac6454SAndrew Thompson /*
2902ac6454SAndrew Thompson * USB specifications and other documentation can be found at
3002ac6454SAndrew Thompson * http://www.usb.org/developers/docs/ and
3102ac6454SAndrew Thompson * http://www.usb.org/developers/devclass_docs/
3202ac6454SAndrew Thompson */
3302ac6454SAndrew Thompson
34d2b99310SHans Petter Selasky #ifdef USB_GLOBAL_INCLUDE_FILE
35d2b99310SHans Petter Selasky #include USB_GLOBAL_INCLUDE_FILE
36d2b99310SHans Petter Selasky #else
37ed6d949aSAndrew Thompson #include <sys/stdint.h>
38ed6d949aSAndrew Thompson #include <sys/stddef.h>
39ed6d949aSAndrew Thompson #include <sys/param.h>
40ed6d949aSAndrew Thompson #include <sys/queue.h>
41ed6d949aSAndrew Thompson #include <sys/types.h>
42ed6d949aSAndrew Thompson #include <sys/systm.h>
43ed6d949aSAndrew Thompson #include <sys/kernel.h>
44ed6d949aSAndrew Thompson #include <sys/bus.h>
45ed6d949aSAndrew Thompson #include <sys/module.h>
46ed6d949aSAndrew Thompson #include <sys/lock.h>
47ed6d949aSAndrew Thompson #include <sys/mutex.h>
48ed6d949aSAndrew Thompson #include <sys/condvar.h>
49ed6d949aSAndrew Thompson #include <sys/sysctl.h>
50ed6d949aSAndrew Thompson #include <sys/sx.h>
51ed6d949aSAndrew Thompson #include <sys/unistd.h>
52ed6d949aSAndrew Thompson #include <sys/callout.h>
53ed6d949aSAndrew Thompson #include <sys/malloc.h>
54ed6d949aSAndrew Thompson #include <sys/priv.h>
550eb8d462SHans Petter Selasky #include <sys/proc.h>
560eb8d462SHans Petter Selasky #include <sys/kdb.h>
57ed6d949aSAndrew Thompson
58ed6d949aSAndrew Thompson #include <dev/usb/usb.h>
59ed6d949aSAndrew Thompson #include <dev/usb/usbdi.h>
60d2b99310SHans Petter Selasky #endif /* USB_GLOBAL_INCLUDE_FILE */
6102ac6454SAndrew Thompson
6223ab0871SHans Petter Selasky const struct usb_string_lang usb_string_lang_en = {
6323ab0871SHans Petter Selasky sizeof(usb_string_lang_en), UDESC_STRING,
6423ab0871SHans Petter Selasky { 0x09, 0x04 } /* American English */
6523ab0871SHans Petter Selasky };
6623ab0871SHans Petter Selasky
6702ac6454SAndrew Thompson MALLOC_DEFINE(M_USB, "USB", "USB");
6802ac6454SAndrew Thompson MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device");
6902ac6454SAndrew Thompson
700eb8d462SHans Petter Selasky int
usbd_in_polling_mode(void)710eb8d462SHans Petter Selasky usbd_in_polling_mode(void)
720eb8d462SHans Petter Selasky {
730eb8d462SHans Petter Selasky return (USB_IN_POLLING_MODE_VALUE());
740eb8d462SHans Petter Selasky }
750eb8d462SHans Petter Selasky
760eb8d462SHans Petter Selasky void
usbd_dummy_timeout(void * arg)770eb8d462SHans Petter Selasky usbd_dummy_timeout(void *arg)
780eb8d462SHans Petter Selasky {
790eb8d462SHans Petter Selasky /* NOP */
800eb8d462SHans Petter Selasky }
810eb8d462SHans Petter Selasky
8202ac6454SAndrew Thompson MODULE_VERSION(usb, 1);
83