xref: /aosp_15_r20/prebuilts/build-tools/sysroots/i686-unknown-linux-musl/include/linux/usb/raw_gadget.h (revision cda5da8d549138a6648c5ee6d7a49cf8f4a657be)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI__LINUX_USB_RAW_GADGET_H
8 #define _UAPI__LINUX_USB_RAW_GADGET_H
9 #include <asm/ioctl.h>
10 #include <linux/types.h>
11 #include <linux/usb/ch9.h>
12 #define UDC_NAME_LENGTH_MAX 128
13 struct usb_raw_init {
14   __u8 driver_name[UDC_NAME_LENGTH_MAX];
15   __u8 device_name[UDC_NAME_LENGTH_MAX];
16   __u8 speed;
17 };
18 enum usb_raw_event_type {
19   USB_RAW_EVENT_INVALID = 0,
20   USB_RAW_EVENT_CONNECT = 1,
21   USB_RAW_EVENT_CONTROL = 2,
22   USB_RAW_EVENT_SUSPEND = 3,
23   USB_RAW_EVENT_RESUME = 4,
24   USB_RAW_EVENT_RESET = 5,
25   USB_RAW_EVENT_DISCONNECT = 6,
26 };
27 struct usb_raw_event {
28   __u32 type;
29   __u32 length;
30   __u8 data[];
31 };
32 #define USB_RAW_IO_FLAGS_ZERO 0x0001
33 #define USB_RAW_IO_FLAGS_MASK 0x0001
34 struct usb_raw_ep_io {
35   __u16 ep;
36   __u16 flags;
37   __u32 length;
38   __u8 data[];
39 };
40 #define USB_RAW_EPS_NUM_MAX 30
41 #define USB_RAW_EP_NAME_MAX 16
42 #define USB_RAW_EP_ADDR_ANY 0xff
43 struct usb_raw_ep_caps {
44   __u32 type_control : 1;
45   __u32 type_iso : 1;
46   __u32 type_bulk : 1;
47   __u32 type_int : 1;
48   __u32 dir_in : 1;
49   __u32 dir_out : 1;
50 };
51 struct usb_raw_ep_limits {
52   __u16 maxpacket_limit;
53   __u16 max_streams;
54   __u32 reserved;
55 };
56 struct usb_raw_ep_info {
57   __u8 name[USB_RAW_EP_NAME_MAX];
58   __u32 addr;
59   struct usb_raw_ep_caps caps;
60   struct usb_raw_ep_limits limits;
61 };
62 struct usb_raw_eps_info {
63   struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
64 };
65 #define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
66 #define USB_RAW_IOCTL_RUN _IO('U', 1)
67 #define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
68 #define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
69 #define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
70 #define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
71 #define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
72 #define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
73 #define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
74 #define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
75 #define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
76 #define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
77 #define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
78 #define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
79 #define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
80 #define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)
81 #endif
82