1
2
3
4
5
6
7
8
9
10
11
12#ifndef __LINUX_USB_ASSOCIATION_H
13#define __LINUX_USB_ASSOCIATION_H
14
15
16
17
18
19
20
21
22
23
24
25struct wusb_am_attr {
26 __u8 id;
27 __u8 len;
28};
29
30
31#define WUSB_AR_AssociationTypeId { .id = cpu_to_le16(0x0000), .len = cpu_to_le16(2) }
32#define WUSB_AR_AssociationSubTypeId { .id = cpu_to_le16(0x0001), .len = cpu_to_le16(2) }
33#define WUSB_AR_Length { .id = cpu_to_le16(0x0002), .len = cpu_to_le16(4) }
34#define WUSB_AR_AssociationStatus { .id = cpu_to_le16(0x0004), .len = cpu_to_le16(4) }
35#define WUSB_AR_LangID { .id = cpu_to_le16(0x0008), .len = cpu_to_le16(2) }
36#define WUSB_AR_DeviceFriendlyName { .id = cpu_to_le16(0x000b), .len = cpu_to_le16(64) }
37#define WUSB_AR_HostFriendlyName { .id = cpu_to_le16(0x000c), .len = cpu_to_le16(64) }
38#define WUSB_AR_CHID { .id = cpu_to_le16(0x1000), .len = cpu_to_le16(16) }
39#define WUSB_AR_CDID { .id = cpu_to_le16(0x1001), .len = cpu_to_le16(16) }
40#define WUSB_AR_ConnectionContext { .id = cpu_to_le16(0x1002), .len = cpu_to_le16(48) }
41#define WUSB_AR_BandGroups { .id = cpu_to_le16(0x1004), .len = cpu_to_le16(2) }
42
43
44enum {
45 CBAF_REQ_GET_ASSOCIATION_INFORMATION = 0x01,
46 CBAF_REQ_GET_ASSOCIATION_REQUEST,
47 CBAF_REQ_SET_ASSOCIATION_RESPONSE
48};
49
50
51
52
53
54
55enum {
56 CBAF_IFACECLASS = 0xef,
57 CBAF_IFACESUBCLASS = 0x03,
58 CBAF_IFACEPROTOCOL = 0x01,
59};
60
61
62struct wusb_cbaf_assoc_info {
63 __le16 Length;
64 __u8 NumAssociationRequests;
65 __le16 Flags;
66 __u8 AssociationRequestsArray[];
67} __attribute__((packed));
68
69
70struct wusb_cbaf_assoc_request {
71 __u8 AssociationDataIndex;
72 __u8 Reserved;
73 __le16 AssociationTypeId;
74 __le16 AssociationSubTypeId;
75 __le32 AssociationTypeInfoSize;
76} __attribute__((packed));
77
78enum {
79 AR_TYPE_WUSB = 0x0001,
80 AR_TYPE_WUSB_RETRIEVE_HOST_INFO = 0x0000,
81 AR_TYPE_WUSB_ASSOCIATE = 0x0001,
82};
83
84
85struct wusb_cbaf_attr_hdr {
86 __le16 id;
87 __le16 len;
88} __attribute__((packed));
89
90
91struct wusb_cbaf_host_info {
92 struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
93 __le16 AssociationTypeId;
94 struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
95 __le16 AssociationSubTypeId;
96 struct wusb_cbaf_attr_hdr CHID_hdr;
97 struct wusb_ckhdid CHID;
98 struct wusb_cbaf_attr_hdr LangID_hdr;
99 __le16 LangID;
100 struct wusb_cbaf_attr_hdr HostFriendlyName_hdr;
101 __u8 HostFriendlyName[];
102} __attribute__((packed));
103
104
105
106
107
108
109struct wusb_cbaf_device_info {
110 struct wusb_cbaf_attr_hdr Length_hdr;
111 __le32 Length;
112 struct wusb_cbaf_attr_hdr CDID_hdr;
113 struct wusb_ckhdid CDID;
114 struct wusb_cbaf_attr_hdr BandGroups_hdr;
115 __le16 BandGroups;
116 struct wusb_cbaf_attr_hdr LangID_hdr;
117 __le16 LangID;
118 struct wusb_cbaf_attr_hdr DeviceFriendlyName_hdr;
119 __u8 DeviceFriendlyName[];
120} __attribute__((packed));
121
122
123struct wusb_cbaf_cc_data {
124 struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
125 __le16 AssociationTypeId;
126 struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
127 __le16 AssociationSubTypeId;
128 struct wusb_cbaf_attr_hdr Length_hdr;
129 __le32 Length;
130 struct wusb_cbaf_attr_hdr ConnectionContext_hdr;
131 struct wusb_ckhdid CHID;
132 struct wusb_ckhdid CDID;
133 struct wusb_ckhdid CK;
134 struct wusb_cbaf_attr_hdr BandGroups_hdr;
135 __le16 BandGroups;
136} __attribute__((packed));
137
138
139struct wusb_cbaf_cc_data_fail {
140 struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
141 __le16 AssociationTypeId;
142 struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
143 __le16 AssociationSubTypeId;
144 struct wusb_cbaf_attr_hdr Length_hdr;
145 __le16 Length;
146 struct wusb_cbaf_attr_hdr AssociationStatus_hdr;
147 __u32 AssociationStatus;
148} __attribute__((packed));
149
150#endif
151