2 * Wireless USB - Cable Based Association
4 * Copyright (C) 2006 Intel Corporation
5 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
12 #ifndef __LINUX_USB_ASSOCIATION_H
13 #define __LINUX_USB_ASSOCIATION_H
17 * Association attributes
19 * Association Models Supplement to WUSB 1.0 T[3-1]
21 * Each field in the structures has it's ID, it's length and then the
22 * value. This is the actual definition of the field's ID and its
30 /* Different fields defined by the spec */
31 #define WUSB_AR_AssociationTypeId { .id = 0x0000, .len = 2 }
32 #define WUSB_AR_AssociationSubTypeId { .id = 0x0001, .len = 2 }
33 #define WUSB_AR_Length { .id = 0x0002, .len = 4 }
34 #define WUSB_AR_AssociationStatus { .id = 0x0004, .len = 4 }
35 #define WUSB_AR_LangID { .id = 0x0008, .len = 2 }
36 #define WUSB_AR_DeviceFriendlyName { .id = 0x000b, .len = 64 } /* max */
37 #define WUSB_AR_HostFriendlyName { .id = 0x000c, .len = 64 } /* max */
38 #define WUSB_AR_CHID { .id = 0x1000, .len = 16 }
39 #define WUSB_AR_CDID { .id = 0x1001, .len = 16 }
40 #define WUSB_AR_ConnectionContext { .id = 0x1002, .len = 48 }
41 #define WUSB_AR_BandGroups { .id = 0x1004, .len = 2 }
43 /* CBAF Control Requests (AMS1.0[T4-1] */
45 CBAF_REQ_GET_ASSOCIATION_INFORMATION
= 0x01,
46 CBAF_REQ_GET_ASSOCIATION_REQUEST
,
47 CBAF_REQ_SET_ASSOCIATION_RESPONSE
51 * CBAF USB-interface defitions
53 * No altsettings, one optional interrupt endpoint.
56 CBAF_IFACECLASS
= 0xef,
57 CBAF_IFACESUBCLASS
= 0x03,
58 CBAF_IFACEPROTOCOL
= 0x01,
61 /* Association Information (AMS1.0[T4-3]) */
62 struct wusb_cbaf_assoc_info
{
64 __u8 NumAssociationRequests
;
66 __u8 AssociationRequestsArray
[];
67 } __attribute__((packed
));
69 /* Association Request (AMS1.0[T4-4]) */
70 struct wusb_cbaf_assoc_request
{
71 __u8 AssociationDataIndex
;
73 __le16 AssociationTypeId
;
74 __le16 AssociationSubTypeId
;
75 __le32 AssociationTypeInfoSize
;
76 } __attribute__((packed
));
79 AR_TYPE_WUSB
= 0x0001,
80 AR_TYPE_WUSB_RETRIEVE_HOST_INFO
= 0x0000,
81 AR_TYPE_WUSB_ASSOCIATE
= 0x0001,
84 /* Association Attribute header (AMS1.0[3.8]) */
85 struct wusb_cbaf_attr_hdr
{
88 } __attribute__((packed
));
90 /* Host Info (AMS1.0[T4-7]) (yeah, more headers and fields...) */
91 struct 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
;
100 struct wusb_cbaf_attr_hdr HostFriendlyName_hdr
;
101 __u8 HostFriendlyName
[];
102 } __attribute__((packed
));
104 /* Device Info (AMS1.0[T4-8])
106 * I still don't get this tag'n'header stuff for each goddamn
109 struct wusb_cbaf_device_info
{
110 struct wusb_cbaf_attr_hdr Length_hdr
;
112 struct wusb_cbaf_attr_hdr CDID_hdr
;
113 struct wusb_ckhdid CDID
;
114 struct wusb_cbaf_attr_hdr BandGroups_hdr
;
116 struct wusb_cbaf_attr_hdr LangID_hdr
;
118 struct wusb_cbaf_attr_hdr DeviceFriendlyName_hdr
;
119 __u8 DeviceFriendlyName
[];
120 } __attribute__((packed
));
122 /* Connection Context; CC_DATA - Success case (AMS1.0[T4-9]) */
123 struct 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
;
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
;
136 } __attribute__((packed
));
138 /* CC_DATA - Failure case (AMS1.0[T4-10]) */
139 struct 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
;
146 struct wusb_cbaf_attr_hdr AssociationStatus_hdr
;
147 __u32 AssociationStatus
;
148 } __attribute__((packed
));
150 #endif /* __LINUX_USB_ASSOCIATION_H */