jcs's openbsd hax
openbsd
1/* $OpenBSD: usbdi_util.h,v 1.31 2021/02/24 03:54:05 jsg Exp $ */
2/* $NetBSD: usbdi_util.h,v 1.28 2002/07/11 21:14:36 augustss Exp $ */
3/* $FreeBSD: src/sys/dev/usb/usbdi_util.h,v 1.9 1999/11/17 22:33:50 n_hibma Exp $ */
4
5/*
6 * Copyright (c) 1998 The NetBSD Foundation, Inc.
7 * All rights reserved.
8 *
9 * This code is derived from software contributed to The NetBSD Foundation
10 * by Lennart Augustsson (lennart@augustsson.net) at
11 * Carlstedt Research & Technology.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35usbd_status usbd_get_desc(struct usbd_device *dev, int type,
36 int index, int len, void *desc);
37usbd_status usbd_get_port_status(struct usbd_device *,
38 int, usb_port_status_t *);
39usbd_status usbd_set_hub_depth(struct usbd_device *, int);
40usbd_status usbd_set_port_feature(struct usbd_device *dev, int, int);
41usbd_status usbd_clear_port_feature(struct usbd_device *, int, int);
42usbd_status usbd_clear_endpoint_feature(struct usbd_device *, int, int);
43usbd_status usbd_get_device_status(struct usbd_device *, usb_status_t *);
44usbd_status usbd_get_hub_descriptor(struct usbd_device *,
45 usb_hub_descriptor_t *, uint8_t);
46usbd_status usbd_get_hub_ss_descriptor(struct usbd_device *,
47 usb_hub_ss_descriptor_t *, uint8_t);
48struct usb_hid_descriptor *usbd_get_hid_descriptor(struct usbd_device *,
49 usb_interface_descriptor_t *);
50usbd_status usbd_set_idle(struct usbd_device *, int, int, int);
51usbd_status usbd_get_report_descriptor(struct usbd_device *, int, void *,
52 int);
53usbd_status usbd_get_config(struct usbd_device *dev, u_int8_t *conf);
54usbd_status usbd_get_string_desc(struct usbd_device *dev, int sindex,
55 int langid,usb_string_descriptor_t *sdesc, int *sizep);
56void usbd_delay_ms(struct usbd_device *, u_int);
57
58
59usbd_status usbd_set_config_no(struct usbd_device *dev, int no, int msg);
60usbd_status usbd_set_config_index(struct usbd_device *dev, int index,
61 int msg);
62
63void usb_detach_wait(struct device *);
64void usb_detach_wakeup(struct device *);