FreeBSD kernel usb device Code
usb_request.h
Go to the documentation of this file.
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#ifndef _USB_REQUEST_H_
30#define _USB_REQUEST_H_
31
32struct usb_process;
33
35 struct mtx *mtx, uint16_t sel);
37 struct mtx *mtx, uint8_t port, uint16_t sel);
39 struct mtx *mtx, uint8_t *alt_iface_no,
40 uint8_t iface_index);
41usb_error_t usbd_req_get_config(struct usb_device *udev, struct mtx *mtx,
42 uint8_t *pconf);
44 struct usb_config_descriptor **ppcd, uint16_t wValue);
45usb_error_t usbd_req_get_config_desc(struct usb_device *udev, struct mtx *mtx,
46 struct usb_config_descriptor *d, uint8_t conf_index);
48 struct mtx *mtx, struct usb_config_descriptor **ppcd,
49 uint8_t conf_index);
50usb_error_t usbd_req_get_desc(struct usb_device *udev, struct mtx *mtx,
51 uint16_t *actlen, void *desc, uint16_t min_len,
52 uint16_t max_len, uint16_t id, uint8_t type,
53 uint8_t index, uint8_t retries);
54usb_error_t usbd_req_get_device_desc(struct usb_device *udev, struct mtx *mtx,
55 struct usb_device_descriptor *d);
57 struct mtx *mtx, struct usb_status *st);
59 struct mtx *mtx, struct usb_hub_descriptor *hd,
60 uint8_t nports);
62 struct mtx *mtx, struct usb_hub_ss_descriptor *hd,
63 uint8_t nports);
64usb_error_t usbd_req_get_hub_status(struct usb_device *udev, struct mtx *mtx,
65 struct usb_hub_status *st);
66usb_error_t usbd_req_get_port_status(struct usb_device *udev, struct mtx *mtx,
67 struct usb_port_status *ps, uint8_t port);
68usb_error_t usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx,
69 uint8_t port);
71 struct mtx *mtx, uint8_t port);
72usb_error_t usbd_req_set_address(struct usb_device *udev, struct mtx *mtx,
73 uint16_t addr);
74usb_error_t usbd_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,
75 uint16_t sel);
77 struct mtx *mtx, uint8_t port, uint16_t sel);
78usb_error_t usbd_setup_device_desc(struct usb_device *udev, struct mtx *mtx);
79usb_error_t usbd_req_re_enumerate(struct usb_device *udev, struct mtx *mtx);
81 struct mtx *mtx, uint16_t sel);
83 struct mtx *mtx, uint16_t sel);
85 struct mtx *mtx, uint8_t port, uint8_t timeout);
87 struct mtx *mtx, uint8_t port, uint8_t timeout);
89 struct mtx *mtx, uint16_t depth);
90usb_error_t usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx,
91 uint8_t port);
92usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx,
93 uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint);
95 struct mtx *mtx, uint8_t port, uint8_t link_state);
96usb_error_t usbd_req_set_lpm_info(struct usb_device *udev, struct mtx *mtx,
97 uint8_t port, uint8_t besl, uint8_t addr, uint8_t rwe);
98
99void * usbd_alloc_config_desc(struct usb_device *, uint32_t);
100void usbd_free_config_desc(struct usb_device *, void *);
101
102#endif /* _USB_REQUEST_H_ */
struct usb_endpoint_descriptor desc
Definition: usb_device.h:0
struct usb_host_endpoint * endpoint
Definition: usb_device.h:2
usb_error_t usbd_req_set_hub_u2_timeout(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t timeout)
Definition: usb_request.c:1690
usb_error_t usbd_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor **ppcd, uint8_t conf_index)
Definition: usb_request.c:1342
usb_error_t usbd_req_get_hub_descriptor(struct usb_device *udev, struct mtx *mtx, struct usb_hub_descriptor *hd, uint8_t nports)
Definition: usb_request.c:1493
usb_error_t usbd_req_set_lpm_info(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t besl, uint8_t addr, uint8_t rwe)
Definition: usb_request.c:2298
usb_error_t usbd_req_get_alt_interface_no(struct usb_device *udev, struct mtx *mtx, uint8_t *alt_iface_no, uint8_t iface_index)
Definition: usb_request.c:1408
usb_error_t usbd_req_get_desc(struct usb_device *udev, struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, uint8_t index, uint8_t retries)
Definition: usb_request.c:986
usb_error_t usbd_req_get_ss_hub_descriptor(struct usb_device *udev, struct mtx *mtx, struct usb_hub_ss_descriptor *hd, uint8_t nports)
Definition: usb_request.c:1515
usb_error_t usbd_req_set_port_link_state(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t link_state)
Definition: usb_request.c:2271
usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint)
Definition: usb_request.c:2237
void * usbd_alloc_config_desc(struct usb_device *, uint32_t)
Definition: usb_request.c:1303
usb_error_t usbd_req_get_device_status(struct usb_device *udev, struct mtx *mtx, struct usb_status *st)
Definition: usb_request.c:1472
usb_error_t usbd_req_get_device_desc(struct usb_device *udev, struct mtx *mtx, struct usb_device_descriptor *d)
Definition: usb_request.c:1392
usb_error_t usbd_req_set_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel)
Definition: usb_request.c:2186
usb_error_t usbd_setup_device_desc(struct usb_device *udev, struct mtx *mtx)
Definition: usb_request.c:1961
usb_error_t usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx, uint8_t port)
Definition: usb_request.c:2207
usb_error_t usbd_req_set_hub_u1_timeout(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t timeout)
Definition: usb_request.c:1668
usb_error_t usbd_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel)
Definition: usb_request.c:1647
usb_error_t usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
Definition: usb_request.c:786
usb_error_t usbd_req_get_config(struct usb_device *udev, struct mtx *mtx, uint8_t *pconf)
Definition: usb_request.c:1945
usb_error_t usbd_req_clear_hub_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel)
Definition: usb_request.c:1626
usb_error_t usbd_req_re_enumerate(struct usb_device *udev, struct mtx *mtx)
Definition: usb_request.c:2054
usb_error_t usbd_req_set_hub_depth(struct usb_device *udev, struct mtx *mtx, uint16_t depth)
Definition: usb_request.c:1712
usb_error_t usbd_req_clear_port_feature(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel)
Definition: usb_request.c:1733
usb_error_t usbd_req_get_config_desc(struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor *d, uint8_t conf_index)
Definition: usb_request.c:1272
usb_error_t usbd_req_set_address(struct usb_device *udev, struct mtx *mtx, uint16_t addr)
Definition: usb_request.c:1561
usb_error_t usbd_req_get_hub_status(struct usb_device *udev, struct mtx *mtx, struct usb_hub_status *st)
Definition: usb_request.c:1537
usb_error_t usbd_req_get_descriptor_ptr(struct usb_device *udev, struct usb_config_descriptor **ppcd, uint16_t wValue)
Definition: usb_request.c:1226
usb_error_t usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
Definition: usb_request.c:876
usb_error_t usbd_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel)
Definition: usb_request.c:2165
usb_error_t usbd_req_set_port_feature(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel)
Definition: usb_request.c:1755
usb_error_t usbd_req_get_port_status(struct usb_device *udev, struct mtx *mtx, struct usb_port_status *ps, uint8_t port)
Definition: usb_request.c:1603
void usbd_free_config_desc(struct usb_device *, void *)
Definition: usb_request.c:1323
usb_error_t
Definition: usbdi.h:45