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) */
71 /* Responses from Get Status request ([WUSB] section 8.3.1.6) */
73 WA_STATUS_ENABLED
= 0x01,
74 WA_STATUS_RESETTING
= 0x02
80 RPIPE_CRS_BULK
= 0x04,
85 * RPipe descriptor ([WUSB] section 8.5.2.11)
87 * FIXME: explain rpipes
89 struct usb_rpipe_descriptor
{
94 __le16 wBlocks
; /* rw if 0 */
95 __le16 wMaxPacketSize
; /* rw? */
96 u8 bHSHubAddress
; /* reserved: 0 */
97 u8 bHSHubPort
; /* ??? FIXME ??? */
98 u8 bSpeed
; /* rw: xfer rate 'enum uwb_phy_rate' */
99 u8 bDeviceAddress
; /* rw: Target device address */
100 u8 bEndpointAddress
; /* rw: Target EP address */
101 u8 bDataSequence
; /* ro: Current Data sequence */
102 __le32 dwCurrentWindow
; /* ro */
103 u8 bMaxDataSequence
; /* ro?: max supported seq */
104 u8 bInterval
; /* rw: */
105 u8 bOverTheAirInterval
; /* rw: */
106 u8 bmAttribute
; /* ro? */
107 u8 bmCharacteristics
; /* ro? enum rpipe_attr, supported xsactions */
108 u8 bmRetryOptions
; /* rw? */
109 __le16 wNumTransactionErrors
; /* rw */
110 } __attribute__ ((packed
));
113 * Wire Adapter Notification types ([WUSB] sections 8.4.5 & 8.5.4)
115 * These are the notifications coming on the notification endpoint of
119 DWA_NOTIF_RWAKE
= 0x91,
120 DWA_NOTIF_PORTSTATUS
= 0x92,
121 WA_NOTIF_TRANSFER
= 0x93,
122 HWA_NOTIF_BPST_ADJ
= 0x94,
127 * Wire Adapter notification header
129 * Notifications coming from a wire adapter use a common header
130 * defined in [WUSB] sections 8.4.5 & 8.5.4.
132 struct wa_notif_hdr
{
134 u8 bNotifyType
; /* enum wa_notif_type */
135 } __attribute__((packed
));
138 * HWA DN Received notification [(WUSB] section 8.5.4.2)
140 * The DNData is specified in WUSB1.0[7.6]. For each device
141 * notification we received, we just need to dispatch it.
143 * @dndata: this is really an array of notifications, but all start
144 * with the same header.
146 struct hwa_notif_dn
{
147 struct wa_notif_hdr hdr
;
148 u8 bSourceDeviceAddr
; /* from errata 2005/07 */
150 struct wusb_dn_hdr dndata
[];
151 } __attribute__((packed
));
153 /* [WUSB] section 8.3.3 */
155 WA_XFER_TYPE_CTL
= 0x80,
156 WA_XFER_TYPE_BI
= 0x81, /* bulk/interrupt */
157 WA_XFER_TYPE_ISO
= 0x82,
158 WA_XFER_RESULT
= 0x83,
159 WA_XFER_ABORT
= 0x84,
162 /* [WUSB] section 8.3.3 */
164 u8 bLength
; /* 0x18 */
165 u8 bRequestType
; /* 0x80 WA_REQUEST_TYPE_CTL */
166 __le16 wRPipe
; /* RPipe index */
167 __le32 dwTransferID
; /* Host-assigned ID */
168 __le32 dwTransferLength
; /* Length of data to xfer */
170 } __attribute__((packed
));
173 struct wa_xfer_hdr hdr
;
176 struct usb_ctrlrequest baSetupData
;
177 } __attribute__((packed
));
180 struct wa_xfer_hdr hdr
;
183 } __attribute__((packed
));
185 struct wa_xfer_hwaiso
{
186 struct wa_xfer_hdr hdr
;
188 __le16 wPresentationTime
;
189 __le32 dwNumOfPackets
;
190 /* FIXME: u8 pktdata[]? */
191 } __attribute__((packed
));
193 /* [WUSB] section 8.3.3.5 */
194 struct wa_xfer_abort
{
197 __le16 wRPipe
; /* RPipe index */
198 __le32 dwTransferID
; /* Host-assigned ID */
199 } __attribute__((packed
));
202 * WA Transfer Complete notification ([WUSB] section 8.3.3.3)
205 struct wa_notif_xfer
{
206 struct wa_notif_hdr hdr
;
209 } __attribute__((packed
));
211 /** Transfer result basic codes [WUSB] table 8-15 */
213 WA_XFER_STATUS_SUCCESS
,
214 WA_XFER_STATUS_HALTED
,
215 WA_XFER_STATUS_DATA_BUFFER_ERROR
,
216 WA_XFER_STATUS_BABBLE
,
218 WA_XFER_STATUS_NOT_FOUND
,
219 WA_XFER_STATUS_INSUFFICIENT_RESOURCE
,
220 WA_XFER_STATUS_TRANSACTION_ERROR
,
221 WA_XFER_STATUS_ABORTED
,
222 WA_XFER_STATUS_RPIPE_NOT_READY
,
223 WA_XFER_INVALID_FORMAT
,
224 WA_XFER_UNEXPECTED_SEGMENT_NUMBER
,
225 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH
,
228 /** [WUSB] section 8.3.3.4 */
229 struct wa_xfer_result
{
230 struct wa_notif_hdr hdr
;
232 __le32 dwTransferLength
;
235 __le32 dwNumOfPackets
;
236 } __attribute__((packed
));
239 * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7).
241 * NOTE: u16 fields are read Little Endian from the hardware.
243 * @bNumPorts is the original max number of devices that the host can
244 * connect; we might chop this so the stack can handle
245 * it. In case you need to access it, use wusbhc->ports_max
246 * if it is a Wireless USB WA.
248 struct usb_wa_descriptor
{
252 u8 bNumPorts
; /* don't use!! */
253 u8 bmAttributes
; /* Reserved == 0 */
259 u8 DeviceRemovable
; /* FIXME: in DWA this is up to 16 bytes */
260 } __attribute__((packed
));
263 * HWA Device Information Buffer (WUSB1.0[T8.54])
265 struct hwa_dev_info
{
266 u8 bmDeviceAvailability
[32]; /* FIXME: ignored for now */
269 u8 bmDeviceAttribute
;
270 } __attribute__((packed
));
272 #endif /* #ifndef __LINUX_USB_WUSB_WA_H */