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