xref: /third_party/FreeBSD/sys/dev/usb/usb_dynamic.h (revision f9f848fa)
1f9f848faSopenharmony_ci/*-
2f9f848faSopenharmony_ci * SPDX-License-Identifier: BSD-2-Clause
3f9f848faSopenharmony_ci *
4f9f848faSopenharmony_ci * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
5f9f848faSopenharmony_ci *
6f9f848faSopenharmony_ci * Redistribution and use in source and binary forms, with or without
7f9f848faSopenharmony_ci * modification, are permitted provided that the following conditions
8f9f848faSopenharmony_ci * are met:
9f9f848faSopenharmony_ci * 1. Redistributions of source code must retain the above copyright
10f9f848faSopenharmony_ci *    notice, this list of conditions and the following disclaimer.
11f9f848faSopenharmony_ci * 2. Redistributions in binary form must reproduce the above copyright
12f9f848faSopenharmony_ci *    notice, this list of conditions and the following disclaimer in the
13f9f848faSopenharmony_ci *    documentation and/or other materials provided with the distribution.
14f9f848faSopenharmony_ci *
15f9f848faSopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16f9f848faSopenharmony_ci * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17f9f848faSopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18f9f848faSopenharmony_ci * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19f9f848faSopenharmony_ci * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20f9f848faSopenharmony_ci * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21f9f848faSopenharmony_ci * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22f9f848faSopenharmony_ci * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23f9f848faSopenharmony_ci * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24f9f848faSopenharmony_ci * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25f9f848faSopenharmony_ci * SUCH DAMAGE.
26f9f848faSopenharmony_ci */
27f9f848faSopenharmony_ci
28f9f848faSopenharmony_ci#ifndef _USB_DYNAMIC_H_
29f9f848faSopenharmony_ci#define	_USB_DYNAMIC_H_
30f9f848faSopenharmony_ci
31f9f848faSopenharmony_ci/* prototypes */
32f9f848faSopenharmony_ci
33f9f848faSopenharmony_cistruct usb_device;
34f9f848faSopenharmony_cistruct usbd_lookup_info;
35f9f848faSopenharmony_cistruct usb_device_request;
36f9f848faSopenharmony_ci
37f9f848faSopenharmony_ci/* typedefs */
38f9f848faSopenharmony_ci
39f9f848faSopenharmony_citypedef usb_error_t	(usb_temp_setup_by_index_t)(struct usb_device *udev,
40f9f848faSopenharmony_ci			    uint16_t index);
41f9f848faSopenharmony_citypedef uint8_t		(usb_test_quirk_t)(const struct usbd_lookup_info *info,
42f9f848faSopenharmony_ci			    uint16_t quirk);
43f9f848faSopenharmony_citypedef int		(usb_quirk_ioctl_t)(unsigned long cmd, caddr_t data,
44f9f848faSopenharmony_ci			    int fflag, struct thread *td);
45f9f848faSopenharmony_citypedef void		(usb_temp_unsetup_t)(struct usb_device *udev);
46f9f848faSopenharmony_citypedef void		(usb_linux_free_device_t)(struct usb_device *udev);
47f9f848faSopenharmony_ci
48f9f848faSopenharmony_ci/* global function pointers */
49f9f848faSopenharmony_ci
50f9f848faSopenharmony_ciextern usb_handle_req_t *usb_temp_get_desc_p;
51f9f848faSopenharmony_ciextern usb_temp_setup_by_index_t *usb_temp_setup_by_index_p;
52f9f848faSopenharmony_ciextern usb_linux_free_device_t *usb_linux_free_device_p;
53f9f848faSopenharmony_ciextern usb_temp_unsetup_t *usb_temp_unsetup_p;
54f9f848faSopenharmony_ciextern usb_test_quirk_t *usb_test_quirk_p;
55f9f848faSopenharmony_ciextern usb_quirk_ioctl_t *usb_quirk_ioctl_p;
56f9f848faSopenharmony_ciextern devclass_t usb_devclass_ptr;
57f9f848faSopenharmony_ci
58f9f848faSopenharmony_ci/* function prototypes */
59f9f848faSopenharmony_ci
60f9f848faSopenharmony_civoid	usb_linux_unload(void *);
61f9f848faSopenharmony_civoid	usb_temp_unload(void *);
62f9f848faSopenharmony_civoid	usb_quirk_unload(void *);
63f9f848faSopenharmony_civoid	usb_bus_unload(void *);
64f9f848faSopenharmony_ci
65f9f848faSopenharmony_ci#endif					/* _USB_DYNAMIC_H_ */
66