blob: 7a5d1a27ed43aee19113dba07c4932586a853908 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_FUNCTIONFS_H__
20#define _UAPI__LINUX_FUNCTIONFS_H__
21#include <linux/types.h>
22#include <linux/ioctl.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/usb/ch9.h>
24enum {
Tao Baod7db5942015-01-28 10:07:51 -080025 FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
26 FUNCTIONFS_STRINGS_MAGIC = 2,
Tao Baod7db5942015-01-28 10:07:51 -080027 FUNCTIONFS_DESCRIPTORS_MAGIC_V2 = 3,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070028};
29enum functionfs_flags {
Tao Baod7db5942015-01-28 10:07:51 -080030 FUNCTIONFS_HAS_FS_DESC = 1,
Tao Baod7db5942015-01-28 10:07:51 -080031 FUNCTIONFS_HAS_HS_DESC = 2,
32 FUNCTIONFS_HAS_SS_DESC = 4,
33 FUNCTIONFS_HAS_MS_OS_DESC = 8,
34 FUNCTIONFS_VIRTUAL_ADDR = 16,
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 FUNCTIONFS_EVENTFD = 32,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080036 FUNCTIONFS_ALL_CTRL_RECIP = 64,
37 FUNCTIONFS_CONFIG0_SETUP = 128,
Ben Cheng655a7c02013-10-16 16:09:24 -070038};
39struct usb_endpoint_descriptor_no_audio {
Tao Baod7db5942015-01-28 10:07:51 -080040 __u8 bLength;
Christopher Ferris05d08e92016-02-04 13:16:38 -080041 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -080042 __u8 bEndpointAddress;
43 __u8 bmAttributes;
44 __le16 wMaxPacketSize;
Christopher Ferris05d08e92016-02-04 13:16:38 -080045 __u8 bInterval;
Christopher Ferris82d75042015-01-26 10:57:07 -080046} __attribute__((packed));
47struct usb_functionfs_descs_head_v2 {
Tao Baod7db5942015-01-28 10:07:51 -080048 __le32 magic;
Christopher Ferris05d08e92016-02-04 13:16:38 -080049 __le32 length;
Tao Baod7db5942015-01-28 10:07:51 -080050 __le32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070051} __attribute__((packed));
52struct usb_functionfs_descs_head {
Christopher Ferris05d08e92016-02-04 13:16:38 -080053 __le32 magic;
Tao Baod7db5942015-01-28 10:07:51 -080054 __le32 length;
55 __le32 fs_count;
56 __le32 hs_count;
Christopher Ferris05d08e92016-02-04 13:16:38 -080057} __attribute__((packed, deprecated));
Christopher Ferris82d75042015-01-26 10:57:07 -080058struct usb_os_desc_header {
Tao Baod7db5942015-01-28 10:07:51 -080059 __u8 interface;
60 __le32 dwLength;
Christopher Ferris05d08e92016-02-04 13:16:38 -080061 __le16 bcdVersion;
Tao Baod7db5942015-01-28 10:07:51 -080062 __le16 wIndex;
63 union {
64 struct {
Christopher Ferris05d08e92016-02-04 13:16:38 -080065 __u8 bCount;
Tao Baod7db5942015-01-28 10:07:51 -080066 __u8 Reserved;
67 };
68 __le16 wCount;
Christopher Ferris05d08e92016-02-04 13:16:38 -080069 };
Christopher Ferris82d75042015-01-26 10:57:07 -080070} __attribute__((packed));
71struct usb_ext_compat_desc {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u8 bFirstInterfaceNumber;
Christopher Ferris05d08e92016-02-04 13:16:38 -080073 __u8 Reserved1;
Tao Baod7db5942015-01-28 10:07:51 -080074 __u8 CompatibleID[8];
75 __u8 SubCompatibleID[8];
76 __u8 Reserved2[6];
Christopher Ferris05d08e92016-02-04 13:16:38 -080077};
Christopher Ferris82d75042015-01-26 10:57:07 -080078struct usb_ext_prop_desc {
Tao Baod7db5942015-01-28 10:07:51 -080079 __le32 dwSize;
80 __le32 dwPropertyDataType;
Christopher Ferris05d08e92016-02-04 13:16:38 -080081 __le16 wPropertyNameLength;
Christopher Ferris82d75042015-01-26 10:57:07 -080082} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070083struct usb_functionfs_strings_head {
Tao Baod7db5942015-01-28 10:07:51 -080084 __le32 magic;
Christopher Ferris05d08e92016-02-04 13:16:38 -080085 __le32 length;
Tao Baod7db5942015-01-28 10:07:51 -080086 __le32 str_count;
87 __le32 lang_count;
Ben Cheng655a7c02013-10-16 16:09:24 -070088} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -080089enum usb_functionfs_event_type {
Tao Baod7db5942015-01-28 10:07:51 -080090 FUNCTIONFS_BIND,
91 FUNCTIONFS_UNBIND,
92 FUNCTIONFS_ENABLE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080093 FUNCTIONFS_DISABLE,
Tao Baod7db5942015-01-28 10:07:51 -080094 FUNCTIONFS_SETUP,
95 FUNCTIONFS_SUSPEND,
96 FUNCTIONFS_RESUME
Christopher Ferris05d08e92016-02-04 13:16:38 -080097};
Ben Cheng655a7c02013-10-16 16:09:24 -070098struct usb_functionfs_event {
Tao Baod7db5942015-01-28 10:07:51 -080099 union {
100 struct usb_ctrlrequest setup;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101 } __attribute__((packed)) u;
Tao Baod7db5942015-01-28 10:07:51 -0800102 __u8 type;
103 __u8 _pad[3];
Ben Cheng655a7c02013-10-16 16:09:24 -0700104} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105#define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
107#define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109#define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
Tao Baod7db5942015-01-28 10:07:51 -0800110#define FUNCTIONFS_ENDPOINT_DESC _IOR('g', 130, struct usb_endpoint_descriptor)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#endif