• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_FUNCTIONFS_H__
8 #define _UAPI__LINUX_FUNCTIONFS_H__
9 #include <linux/types.h>
10 #include <linux/ioctl.h>
11 #include <linux/usb/ch9.h>
12 enum {
13   FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
14   FUNCTIONFS_STRINGS_MAGIC = 2,
15   FUNCTIONFS_DESCRIPTORS_MAGIC_V2 = 3,
16 };
17 enum functionfs_flags {
18   FUNCTIONFS_HAS_FS_DESC = 1,
19   FUNCTIONFS_HAS_HS_DESC = 2,
20   FUNCTIONFS_HAS_SS_DESC = 4,
21   FUNCTIONFS_HAS_MS_OS_DESC = 8,
22   FUNCTIONFS_VIRTUAL_ADDR = 16,
23   FUNCTIONFS_EVENTFD = 32,
24   FUNCTIONFS_ALL_CTRL_RECIP = 64,
25   FUNCTIONFS_CONFIG0_SETUP = 128,
26 };
27 struct usb_endpoint_descriptor_no_audio {
28   __u8 bLength;
29   __u8 bDescriptorType;
30   __u8 bEndpointAddress;
31   __u8 bmAttributes;
32   __le16 wMaxPacketSize;
33   __u8 bInterval;
34 } __attribute__((packed));
35 struct usb_functionfs_descs_head_v2 {
36   __le32 magic;
37   __le32 length;
38   __le32 flags;
39 } __attribute__((packed));
40 struct usb_functionfs_descs_head {
41   __le32 magic;
42   __le32 length;
43   __le32 fs_count;
44   __le32 hs_count;
45 } __attribute__((packed, deprecated));
46 struct usb_os_desc_header {
47   __u8 interface;
48   __le32 dwLength;
49   __le16 bcdVersion;
50   __le16 wIndex;
51   union {
52     struct {
53       __u8 bCount;
54       __u8 Reserved;
55     };
56     __le16 wCount;
57   };
58 } __attribute__((packed));
59 struct usb_ext_compat_desc {
60   __u8 bFirstInterfaceNumber;
61   __u8 Reserved1;
62   __struct_group(, IDs,, __u8 CompatibleID[8];
63   __u8 SubCompatibleID[8];
64  );
65   __u8 Reserved2[6];
66 };
67 struct usb_ext_prop_desc {
68   __le32 dwSize;
69   __le32 dwPropertyDataType;
70   __le16 wPropertyNameLength;
71 } __attribute__((packed));
72 #define USB_FFS_DMABUF_TRANSFER_MASK 0x0
73 struct usb_ffs_dmabuf_transfer_req {
74   int fd;
75   __u32 flags;
76   __u64 length;
77 } __attribute__((packed));
78 struct usb_functionfs_strings_head {
79   __le32 magic;
80   __le32 length;
81   __le32 str_count;
82   __le32 lang_count;
83 } __attribute__((packed));
84 enum usb_functionfs_event_type {
85   FUNCTIONFS_BIND,
86   FUNCTIONFS_UNBIND,
87   FUNCTIONFS_ENABLE,
88   FUNCTIONFS_DISABLE,
89   FUNCTIONFS_SETUP,
90   FUNCTIONFS_SUSPEND,
91   FUNCTIONFS_RESUME
92 };
93 struct usb_functionfs_event {
94   union {
95     struct usb_ctrlrequest setup;
96   } __attribute__((packed)) u;
97   __u8 type;
98   __u8 _pad[3];
99 } __attribute__((packed));
100 #define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
101 #define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
102 #define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
103 #define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
104 #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
105 #define FUNCTIONFS_ENDPOINT_DESC _IOR('g', 130, struct usb_endpoint_descriptor)
106 #define FUNCTIONFS_DMABUF_ATTACH _IOW('g', 131, int)
107 #define FUNCTIONFS_DMABUF_DETACH _IOW('g', 132, int)
108 #define FUNCTIONFS_DMABUF_TRANSFER _IOW('g', 133, struct usb_ffs_dmabuf_transfer_req)
109 #endif
110