1 // SPDX-License-Identifier: GPL-2.0
3 * Wireless USB - Cable Based Association
5 * Copyright (C) 2006 Intel Corporation
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation.
13 #ifndef __LINUX_USB_ASSOCIATION_H
14 #define __LINUX_USB_ASSOCIATION_H
18 * Association attributes
20 * Association Models Supplement to WUSB 1.0 T[3-1]
22 * Each field in the structures has it's ID, it's length and then the
23 * value. This is the actual definition of the field's ID and its
31 /* Different fields defined by the spec */
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) } /* max */
38 #define WUSB_AR_HostFriendlyName { .id = cpu_to_le16(0x000c), .len = cpu_to_le16(64) } /* max */
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) }
44 /* CBAF Control Requests (AMS1.0[T4-1] */
46 CBAF_REQ_GET_ASSOCIATION_INFORMATION
= 0x01,
47 CBAF_REQ_GET_ASSOCIATION_REQUEST
,
48 CBAF_REQ_SET_ASSOCIATION_RESPONSE
52 * CBAF USB-interface defitions
54 * No altsettings, one optional interrupt endpoint.
57 CBAF_IFACECLASS
= 0xef,
58 CBAF_IFACESUBCLASS
= 0x03,
59 CBAF_IFACEPROTOCOL
= 0x01,
62 /* Association Information (AMS1.0[T4-3]) */
63 struct wusb_cbaf_assoc_info
{
65 __u8 NumAssociationRequests
;
67 __u8 AssociationRequestsArray
[];
68 } __attribute__((packed
));
70 /* Association Request (AMS1.0[T4-4]) */
71 struct wusb_cbaf_assoc_request
{
72 __u8 AssociationDataIndex
;
74 __le16 AssociationTypeId
;
75 __le16 AssociationSubTypeId
;
76 __le32 AssociationTypeInfoSize
;
77 } __attribute__((packed
));
80 AR_TYPE_WUSB
= 0x0001,
81 AR_TYPE_WUSB_RETRIEVE_HOST_INFO
= 0x0000,
82 AR_TYPE_WUSB_ASSOCIATE
= 0x0001,
85 /* Association Attribute header (AMS1.0[3.8]) */
86 struct wusb_cbaf_attr_hdr
{
89 } __attribute__((packed
));
91 /* Host Info (AMS1.0[T4-7]) (yeah, more headers and fields...) */
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
;
101 struct wusb_cbaf_attr_hdr HostFriendlyName_hdr
;
102 __u8 HostFriendlyName
[];
103 } __attribute__((packed
));
105 /* Device Info (AMS1.0[T4-8])
107 * I still don't get this tag'n'header stuff for each goddamn
110 struct wusb_cbaf_device_info
{
111 struct wusb_cbaf_attr_hdr Length_hdr
;
113 struct wusb_cbaf_attr_hdr CDID_hdr
;
114 struct wusb_ckhdid CDID
;
115 struct wusb_cbaf_attr_hdr BandGroups_hdr
;
117 struct wusb_cbaf_attr_hdr LangID_hdr
;
119 struct wusb_cbaf_attr_hdr DeviceFriendlyName_hdr
;
120 __u8 DeviceFriendlyName
[];
121 } __attribute__((packed
));
123 /* Connection Context; CC_DATA - Success case (AMS1.0[T4-9]) */
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
;
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
;
137 } __attribute__((packed
));
139 /* CC_DATA - Failure case (AMS1.0[T4-10]) */
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
;
147 struct wusb_cbaf_attr_hdr AssociationStatus_hdr
;
148 __u32 AssociationStatus
;
149 } __attribute__((packed
));
151 #endif /* __LINUX_USB_ASSOCIATION_H */