2 * Wireless USB Wire Adapter constants and structures.
4 * Copyright (C) 2005-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.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * FIXME: organize properly, group logically
25 * All the event structures are defined in uwb/spec.h, as they are
26 * common to the WHCI and WUSB radio control interfaces.
29 * [WUSB] Wireless Universal Serial Bus Specification, revision 1.0, ch8
31 #ifndef __LINUX_USB_WUSB_WA_H
32 #define __LINUX_USB_WUSB_WA_H
35 * Radio Command Request for the Radio Control Interface
37 * Radio Control Interface command and event codes are the same as
38 * WHCI, and listed in include/linux/uwb.h:UWB_RC_{CMD,EVT}_*
41 WA_EXEC_RC_CMD
= 40, /* Radio Control command Request */
44 /* Wireless Adapter Requests ([WUSB] table 8-51) */
46 WUSB_REQ_ADD_MMC_IE
= 20,
47 WUSB_REQ_REMOVE_MMC_IE
= 21,
48 WUSB_REQ_SET_NUM_DNTS
= 22,
49 WUSB_REQ_SET_CLUSTER_ID
= 23,
50 WUSB_REQ_SET_DEV_INFO
= 24,
51 WUSB_REQ_GET_TIME
= 25,
52 WUSB_REQ_SET_STREAM_IDX
= 26,
53 WUSB_REQ_SET_WUSB_MAS
= 27,
54 WUSB_REQ_CHAN_STOP
= 28,
58 /* Wireless Adapter WUSB Channel Time types ([WUSB] table 8-52) */
72 /* Responses from Get Status request ([WUSB] section 8.3.1.6) */
74 WA_STATUS_ENABLED
= 0x01,
75 WA_STATUS_RESETTING
= 0x02
81 RPIPE_CRS_BULK
= 0x04,
86 * RPipe descriptor ([WUSB] section 8.5.2.11)
88 * FIXME: explain rpipes
90 struct usb_rpipe_descriptor
{
95 __le16 wBlocks
; /* rw if 0 */
96 __le16 wMaxPacketSize
; /* rw */
98 u8 dwa_bHSHubAddress
; /* rw: DWA. */
99 u8 hwa_bMaxBurst
; /* rw: HWA. */
102 u8 dwa_bHSHubPort
; /* rw: DWA. */
103 u8 hwa_bDeviceInfoIndex
; /* rw: HWA. */
105 u8 bSpeed
; /* rw: xfer rate 'enum uwb_phy_rate' */
107 u8 dwa_bDeviceAddress
; /* rw: DWA Target device address. */
108 u8 hwa_reserved
; /* rw: HWA. */
110 u8 bEndpointAddress
; /* rw: Target EP address */
111 u8 bDataSequence
; /* ro: Current Data sequence */
112 __le32 dwCurrentWindow
; /* ro */
113 u8 bMaxDataSequence
; /* ro?: max supported seq */
114 u8 bInterval
; /* rw: */
115 u8 bOverTheAirInterval
; /* rw: */
116 u8 bmAttribute
; /* ro? */
117 u8 bmCharacteristics
; /* ro? enum rpipe_attr, supported xsactions */
118 u8 bmRetryOptions
; /* rw? */
119 __le16 wNumTransactionErrors
; /* rw */
120 } __attribute__ ((packed
));
123 * Wire Adapter Notification types ([WUSB] sections 8.4.5 & 8.5.4)
125 * These are the notifications coming on the notification endpoint of
129 DWA_NOTIF_RWAKE
= 0x91,
130 DWA_NOTIF_PORTSTATUS
= 0x92,
131 WA_NOTIF_TRANSFER
= 0x93,
132 HWA_NOTIF_BPST_ADJ
= 0x94,
137 * Wire Adapter notification header
139 * Notifications coming from a wire adapter use a common header
140 * defined in [WUSB] sections 8.4.5 & 8.5.4.
142 struct wa_notif_hdr
{
144 u8 bNotifyType
; /* enum wa_notif_type */
145 } __attribute__((packed
));
148 * HWA DN Received notification [(WUSB] section 8.5.4.2)
150 * The DNData is specified in WUSB1.0[7.6]. For each device
151 * notification we received, we just need to dispatch it.
153 * @dndata: this is really an array of notifications, but all start
154 * with the same header.
156 struct hwa_notif_dn
{
157 struct wa_notif_hdr hdr
;
158 u8 bSourceDeviceAddr
; /* from errata 2005/07 */
160 struct wusb_dn_hdr dndata
[];
161 } __attribute__((packed
));
163 /* [WUSB] section 8.3.3 */
165 WA_XFER_TYPE_CTL
= 0x80,
166 WA_XFER_TYPE_BI
= 0x81, /* bulk/interrupt */
167 WA_XFER_TYPE_ISO
= 0x82,
168 WA_XFER_RESULT
= 0x83,
169 WA_XFER_ABORT
= 0x84,
172 /* [WUSB] section 8.3.3 */
174 u8 bLength
; /* 0x18 */
175 u8 bRequestType
; /* 0x80 WA_REQUEST_TYPE_CTL */
176 __le16 wRPipe
; /* RPipe index */
177 __le32 dwTransferID
; /* Host-assigned ID */
178 __le32 dwTransferLength
; /* Length of data to xfer */
180 } __attribute__((packed
));
183 struct wa_xfer_hdr hdr
;
186 struct usb_ctrlrequest baSetupData
;
187 } __attribute__((packed
));
190 struct wa_xfer_hdr hdr
;
193 } __attribute__((packed
));
195 struct wa_xfer_hwaiso
{
196 struct wa_xfer_hdr hdr
;
198 __le16 wPresentationTime
;
199 __le32 dwNumOfPackets
;
200 /* FIXME: u8 pktdata[]? */
201 } __attribute__((packed
));
203 /* [WUSB] section 8.3.3.5 */
204 struct wa_xfer_abort
{
207 __le16 wRPipe
; /* RPipe index */
208 __le32 dwTransferID
; /* Host-assigned ID */
209 } __attribute__((packed
));
212 * WA Transfer Complete notification ([WUSB] section 8.3.3.3)
215 struct wa_notif_xfer
{
216 struct wa_notif_hdr hdr
;
219 } __attribute__((packed
));
221 /** Transfer result basic codes [WUSB] table 8-15 */
223 WA_XFER_STATUS_SUCCESS
,
224 WA_XFER_STATUS_HALTED
,
225 WA_XFER_STATUS_DATA_BUFFER_ERROR
,
226 WA_XFER_STATUS_BABBLE
,
228 WA_XFER_STATUS_NOT_FOUND
,
229 WA_XFER_STATUS_INSUFFICIENT_RESOURCE
,
230 WA_XFER_STATUS_TRANSACTION_ERROR
,
231 WA_XFER_STATUS_ABORTED
,
232 WA_XFER_STATUS_RPIPE_NOT_READY
,
233 WA_XFER_INVALID_FORMAT
,
234 WA_XFER_UNEXPECTED_SEGMENT_NUMBER
,
235 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH
,
238 /** [WUSB] section 8.3.3.4 */
239 struct wa_xfer_result
{
240 struct wa_notif_hdr hdr
;
242 __le32 dwTransferLength
;
245 __le32 dwNumOfPackets
;
246 } __attribute__((packed
));
249 * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7).
251 * NOTE: u16 fields are read Little Endian from the hardware.
253 * @bNumPorts is the original max number of devices that the host can
254 * connect; we might chop this so the stack can handle
255 * it. In case you need to access it, use wusbhc->ports_max
256 * if it is a Wireless USB WA.
258 struct usb_wa_descriptor
{
262 u8 bNumPorts
; /* don't use!! */
263 u8 bmAttributes
; /* Reserved == 0 */
269 u8 DeviceRemovable
; /* FIXME: in DWA this is up to 16 bytes */
270 } __attribute__((packed
));
273 * HWA Device Information Buffer (WUSB1.0[T8.54])
275 struct hwa_dev_info
{
276 u8 bmDeviceAvailability
[32]; /* FIXME: ignored for now */
279 u8 bmDeviceAttribute
;
280 } __attribute__((packed
));
282 #endif /* #ifndef __LINUX_USB_WUSB_WA_H */