1181624Skmacy/*-
2181624Skmacy * SPDX-License-Identifier: BSD-2-Clause
3181624Skmacy *
4181624Skmacy * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
5181624Skmacy *
6181624Skmacy * Redistribution and use in source and binary forms, with or without
7181624Skmacy * modification, are permitted provided that the following conditions
8181624Skmacy * are met:
9181624Skmacy * 1. Redistributions of source code must retain the above copyright
10181624Skmacy *    notice, this list of conditions and the following disclaimer.
11181624Skmacy * 2. Redistributions in binary form must reproduce the above copyright
12181624Skmacy *    notice, this list of conditions and the following disclaimer in the
13181624Skmacy *    documentation and/or other materials provided with the distribution.
14181624Skmacy *
15181624Skmacy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16181624Skmacy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17181624Skmacy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18181624Skmacy * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19181624Skmacy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20181624Skmacy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21181624Skmacy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22181624Skmacy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23181624Skmacy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24181624Skmacy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25181624Skmacy * SUCH DAMAGE.
26181624Skmacy */
27181624Skmacy
28181624Skmacy#ifndef _USB_DYNAMIC_H_
29181624Skmacy#define	_USB_DYNAMIC_H_
30181624Skmacy
31181624Skmacy/* prototypes */
32181624Skmacy
33181624Skmacystruct usb_device;
34181624Skmacystruct usbd_lookup_info;
35181624Skmacystruct usb_device_request;
36181624Skmacy
37181624Skmacy/* typedefs */
38181624Skmacy
39181624Skmacytypedef usb_error_t	(usb_temp_setup_by_index_t)(struct usb_device *udev,
40181624Skmacy			    uint16_t index);
41181624Skmacytypedef uint8_t		(usb_test_quirk_t)(const struct usbd_lookup_info *info,
42181624Skmacy			    uint16_t quirk);
43181624Skmacytypedef int		(usb_quirk_ioctl_t)(unsigned long cmd, caddr_t data,
44181624Skmacy			    int fflag, struct thread *td);
45181624Skmacytypedef void		(usb_temp_unsetup_t)(struct usb_device *udev);
46181624Skmacytypedef void		(usb_linux_free_device_t)(struct usb_device *udev);
47181624Skmacy
48181624Skmacy/* global function pointers */
49181624Skmacy
50181624Skmacyextern usb_handle_req_t *usb_temp_get_desc_p;
51181624Skmacyextern usb_temp_setup_by_index_t *usb_temp_setup_by_index_p;
52181624Skmacyextern usb_linux_free_device_t *usb_linux_free_device_p;
53181624Skmacyextern usb_temp_unsetup_t *usb_temp_unsetup_p;
54181624Skmacyextern usb_test_quirk_t *usb_test_quirk_p;
55181624Skmacyextern usb_quirk_ioctl_t *usb_quirk_ioctl_p;
56181624Skmacyextern devclass_t usb_devclass_ptr;
57181624Skmacy
58181624Skmacy/* function prototypes */
59181624Skmacy
60181624Skmacyvoid	usb_linux_unload(void *);
61181624Skmacyvoid	usb_temp_unload(void *);
62181624Skmacyvoid	usb_quirk_unload(void *);
63181624Skmacyvoid	usb_bus_unload(void *);
64181624Skmacy
65181624Skmacy#endif					/* _USB_DYNAMIC_H_ */
66181624Skmacy