diff options
Diffstat (limited to 'include/uapi/linux/usb/functionfs.h')
-rw-r--r-- | include/uapi/linux/usb/functionfs.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index d6b01283f85c..2a4b4a72a4f9 100644 --- a/include/uapi/linux/usb/functionfs.h +++ b/include/uapi/linux/usb/functionfs.h | |||
@@ -10,9 +10,15 @@ | |||
10 | 10 | ||
11 | enum { | 11 | enum { |
12 | FUNCTIONFS_DESCRIPTORS_MAGIC = 1, | 12 | FUNCTIONFS_DESCRIPTORS_MAGIC = 1, |
13 | FUNCTIONFS_STRINGS_MAGIC = 2 | 13 | FUNCTIONFS_STRINGS_MAGIC = 2, |
14 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 = 3, | ||
14 | }; | 15 | }; |
15 | 16 | ||
17 | enum functionfs_flags { | ||
18 | FUNCTIONFS_HAS_FS_DESC = 1, | ||
19 | FUNCTIONFS_HAS_HS_DESC = 2, | ||
20 | FUNCTIONFS_HAS_SS_DESC = 4, | ||
21 | }; | ||
16 | 22 | ||
17 | #ifndef __KERNEL__ | 23 | #ifndef __KERNEL__ |
18 | 24 | ||
@@ -29,29 +35,39 @@ struct usb_endpoint_descriptor_no_audio { | |||
29 | 35 | ||
30 | 36 | ||
31 | /* | 37 | /* |
32 | * All numbers must be in little endian order. | ||
33 | */ | ||
34 | |||
35 | struct usb_functionfs_descs_head { | ||
36 | __le32 magic; | ||
37 | __le32 length; | ||
38 | __le32 fs_count; | ||
39 | __le32 hs_count; | ||
40 | } __attribute__((packed)); | ||
41 | |||
42 | /* | ||
43 | * Descriptors format: | 38 | * Descriptors format: |
44 | * | 39 | * |
45 | * | off | name | type | description | | 40 | * | off | name | type | description | |
46 | * |-----+-----------+--------------+--------------------------------------| | 41 | * |-----+-----------+--------------+--------------------------------------| |
47 | * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC | | 42 | * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 | |
43 | * | 4 | length | LE32 | length of the whole data chunk | | ||
44 | * | 8 | flags | LE32 | combination of functionfs_flags | | ||
45 | * | | fs_count | LE32 | number of full-speed descriptors | | ||
46 | * | | hs_count | LE32 | number of high-speed descriptors | | ||
47 | * | | ss_count | LE32 | number of super-speed descriptors | | ||
48 | * | | fs_descrs | Descriptor[] | list of full-speed descriptors | | ||
49 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | ||
50 | * | | ss_descrs | Descriptor[] | list of super-speed descriptors | | ||
51 | * | ||
52 | * Depending on which flags are set, various fields may be missing in the | ||
53 | * structure. Any flags that are not recognised cause the whole block to be | ||
54 | * rejected with -ENOSYS. | ||
55 | * | ||
56 | * Legacy descriptors format: | ||
57 | * | ||
58 | * | off | name | type | description | | ||
59 | * |-----+-----------+--------------+--------------------------------------| | ||
60 | * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC | | ||
48 | * | 4 | length | LE32 | length of the whole data chunk | | 61 | * | 4 | length | LE32 | length of the whole data chunk | |
49 | * | 8 | fs_count | LE32 | number of full-speed descriptors | | 62 | * | 8 | fs_count | LE32 | number of full-speed descriptors | |
50 | * | 12 | hs_count | LE32 | number of high-speed descriptors | | 63 | * | 12 | hs_count | LE32 | number of high-speed descriptors | |
51 | * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors | | 64 | * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors | |
52 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | 65 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | |
53 | * | 66 | * |
54 | * descs are just valid USB descriptors and have the following format: | 67 | * All numbers must be in little endian order. |
68 | * | ||
69 | * Descriptor[] is an array of valid USB descriptors which have the following | ||
70 | * format: | ||
55 | * | 71 | * |
56 | * | off | name | type | description | | 72 | * | off | name | type | description | |
57 | * |-----+-----------------+------+--------------------------| | 73 | * |-----+-----------------+------+--------------------------| |