• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef _UAPI__LINUX_FUNCTIONFS_H__
7 #define _UAPI__LINUX_FUNCTIONFS_H__
8 #include <linux/types.h>
9 #include <linux/ioctl.h>
10 #include <linux/usb/ch9.h>
11 enum {
12 	FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
13 	FUNCTIONFS_STRINGS_MAGIC = 2,
14 	FUNCTIONFS_DESCRIPTORS_MAGIC_V2 = 3,
15 };
16 enum functionfs_flags {
17 	FUNCTIONFS_HAS_FS_DESC = 1,
18 	FUNCTIONFS_HAS_HS_DESC = 2,
19 	FUNCTIONFS_HAS_SS_DESC = 4,
20 	FUNCTIONFS_HAS_MS_OS_DESC = 8,
21 	FUNCTIONFS_VIRTUAL_ADDR = 16,
22 	FUNCTIONFS_EVENTFD = 32,
23 	FUNCTIONFS_ALL_CTRL_RECIP = 64,
24 	FUNCTIONFS_CONFIG0_SETUP = 128,
25 };
26 struct usb_endpoint_descriptor_no_audio {
27 	__u8  bLength;
28 	__u8  bDescriptorType;
29 	__u8  bEndpointAddress;
30 	__u8  bmAttributes;
31 	__le16 wMaxPacketSize;
32 	__u8  bInterval;
33 } __attribute__((packed));
34 struct usb_functionfs_descs_head_v2 {
35 	__le32 magic;
36 	__le32 length;
37 	__le32 flags;
38 
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 	__u8	CompatibleID[8];
63 	__u8	SubCompatibleID[8];
64 	__u8	Reserved2[6];
65 };
66 struct usb_ext_prop_desc {
67 	__le32	dwSize;
68 	__le32	dwPropertyDataType;
69 	__le16	wPropertyNameLength;
70 } __attribute__((packed));
71 #ifndef __KERNEL__
72 struct usb_functionfs_strings_head {
73 	__le32 magic;
74 	__le32 length;
75 	__le32 str_count;
76 	__le32 lang_count;
77 } __attribute__((packed));
78 #endif
79 enum usb_functionfs_event_type {
80 	FUNCTIONFS_BIND,
81 	FUNCTIONFS_UNBIND,
82 	FUNCTIONFS_ENABLE,
83 	FUNCTIONFS_DISABLE,
84 	FUNCTIONFS_SETUP,
85 	FUNCTIONFS_SUSPEND,
86 	FUNCTIONFS_RESUME
87 };
88 struct usb_functionfs_event {
89 	union {
90 
91 		struct usb_ctrlrequest	setup;
92 	} __attribute__((packed)) u;
93 
94 	__u8				type;
95 	__u8				_pad[3];
96 } __attribute__((packed));
97 #define	FUNCTIONFS_FIFO_STATUS	_IO('g', 1)
98 #define	FUNCTIONFS_FIFO_FLUSH	_IO('g', 2)
99 #define	FUNCTIONFS_CLEAR_HALT	_IO('g', 3)
100 #define	FUNCTIONFS_INTERFACE_REVMAP	_IO('g', 128)
101 #define	FUNCTIONFS_ENDPOINT_REVMAP	_IO('g', 129)
102 #define	FUNCTIONFS_ENDPOINT_DESC	_IOR('g', 130, \
103 					     struct usb_endpoint_descriptor)
104 #endif
105