1 // SPDX-License-Identifier: GPL-2.0
3 * Wireless USB Wire Adapter constants and structures.
5 * Copyright (C) 2005-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.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * FIXME: organize properly, group logically
26 * All the event structures are defined in uwb/spec.h, as they are
27 * common to the WHCI and WUSB radio control interfaces.
30 * [WUSB] Wireless Universal Serial Bus Specification, revision 1.0, ch8
32 #ifndef __LINUX_USB_WUSB_WA_H
33 #define __LINUX_USB_WUSB_WA_H
36 * Radio Command Request for the Radio Control Interface
38 * Radio Control Interface command and event codes are the same as
39 * WHCI, and listed in include/linux/uwb.h:UWB_RC_{CMD,EVT}_*
42 WA_EXEC_RC_CMD
= 40, /* Radio Control command Request */
45 /* Wireless Adapter Requests ([WUSB] table 8-51) */
47 WUSB_REQ_ADD_MMC_IE
= 20,
48 WUSB_REQ_REMOVE_MMC_IE
= 21,
49 WUSB_REQ_SET_NUM_DNTS
= 22,
50 WUSB_REQ_SET_CLUSTER_ID
= 23,
51 WUSB_REQ_SET_DEV_INFO
= 24,
52 WUSB_REQ_GET_TIME
= 25,
53 WUSB_REQ_SET_STREAM_IDX
= 26,
54 WUSB_REQ_SET_WUSB_MAS
= 27,
55 WUSB_REQ_CHAN_STOP
= 28,
59 /* Wireless Adapter WUSB Channel Time types ([WUSB] table 8-52) */
73 /* Responses from Get Status request ([WUSB] section 8.3.1.6) */
75 WA_STATUS_ENABLED
= 0x01,
76 WA_STATUS_RESETTING
= 0x02
82 RPIPE_CRS_BULK
= 0x04,
87 * RPipe descriptor ([WUSB] section 8.5.2.11)
89 * FIXME: explain rpipes
91 struct usb_rpipe_descriptor
{
96 __le16 wBlocks
; /* rw if 0 */
97 __le16 wMaxPacketSize
; /* rw */
99 u8 dwa_bHSHubAddress
; /* rw: DWA. */
100 u8 hwa_bMaxBurst
; /* rw: HWA. */
103 u8 dwa_bHSHubPort
; /* rw: DWA. */
104 u8 hwa_bDeviceInfoIndex
; /* rw: HWA. */
106 u8 bSpeed
; /* rw: xfer rate 'enum uwb_phy_rate' */
108 u8 dwa_bDeviceAddress
; /* rw: DWA Target device address. */
109 u8 hwa_reserved
; /* rw: HWA. */
111 u8 bEndpointAddress
; /* rw: Target EP address */
112 u8 bDataSequence
; /* ro: Current Data sequence */
113 __le32 dwCurrentWindow
; /* ro */
114 u8 bMaxDataSequence
; /* ro?: max supported seq */
115 u8 bInterval
; /* rw: */
116 u8 bOverTheAirInterval
; /* rw: */
117 u8 bmAttribute
; /* ro? */
118 u8 bmCharacteristics
; /* ro? enum rpipe_attr, supported xsactions */
119 u8 bmRetryOptions
; /* rw? */
120 __le16 wNumTransactionErrors
; /* rw */
121 } __attribute__ ((packed
));
124 * Wire Adapter Notification types ([WUSB] sections 8.4.5 & 8.5.4)
126 * These are the notifications coming on the notification endpoint of
130 DWA_NOTIF_RWAKE
= 0x91,
131 DWA_NOTIF_PORTSTATUS
= 0x92,
132 WA_NOTIF_TRANSFER
= 0x93,
133 HWA_NOTIF_BPST_ADJ
= 0x94,
138 * Wire Adapter notification header
140 * Notifications coming from a wire adapter use a common header
141 * defined in [WUSB] sections 8.4.5 & 8.5.4.
143 struct wa_notif_hdr
{
145 u8 bNotifyType
; /* enum wa_notif_type */
149 * HWA DN Received notification [(WUSB] section 8.5.4.2)
151 * The DNData is specified in WUSB1.0[7.6]. For each device
152 * notification we received, we just need to dispatch it.
154 * @dndata: this is really an array of notifications, but all start
155 * with the same header.
157 struct hwa_notif_dn
{
158 struct wa_notif_hdr hdr
;
159 u8 bSourceDeviceAddr
; /* from errata 2005/07 */
161 struct wusb_dn_hdr dndata
[];
164 /* [WUSB] section 8.3.3 */
166 WA_XFER_TYPE_CTL
= 0x80,
167 WA_XFER_TYPE_BI
= 0x81, /* bulk/interrupt */
168 WA_XFER_TYPE_ISO
= 0x82,
169 WA_XFER_RESULT
= 0x83,
170 WA_XFER_ABORT
= 0x84,
171 WA_XFER_ISO_PACKET_INFO
= 0xA0,
172 WA_XFER_ISO_PACKET_STATUS
= 0xA1,
175 /* [WUSB] section 8.3.3 */
177 u8 bLength
; /* 0x18 */
178 u8 bRequestType
; /* 0x80 WA_REQUEST_TYPE_CTL */
179 __le16 wRPipe
; /* RPipe index */
180 __le32 dwTransferID
; /* Host-assigned ID */
181 __le32 dwTransferLength
; /* Length of data to xfer */
186 struct wa_xfer_hdr hdr
;
189 struct usb_ctrlrequest baSetupData
;
193 struct wa_xfer_hdr hdr
;
198 /* [WUSB] section 8.5.5 */
199 struct wa_xfer_hwaiso
{
200 struct wa_xfer_hdr hdr
;
202 __le16 wPresentationTime
;
203 __le32 dwNumOfPackets
;
206 struct wa_xfer_packet_info_hwaiso
{
210 __le16 PacketLength
[0];
213 struct wa_xfer_packet_status_len_hwaiso
{
218 struct wa_xfer_packet_status_hwaiso
{
222 struct wa_xfer_packet_status_len_hwaiso PacketStatus
[0];
225 /* [WUSB] section 8.3.3.5 */
226 struct wa_xfer_abort
{
229 __le16 wRPipe
; /* RPipe index */
230 __le32 dwTransferID
; /* Host-assigned ID */
234 * WA Transfer Complete notification ([WUSB] section 8.3.3.3)
237 struct wa_notif_xfer
{
238 struct wa_notif_hdr hdr
;
243 /** Transfer result basic codes [WUSB] table 8-15 */
245 WA_XFER_STATUS_SUCCESS
,
246 WA_XFER_STATUS_HALTED
,
247 WA_XFER_STATUS_DATA_BUFFER_ERROR
,
248 WA_XFER_STATUS_BABBLE
,
250 WA_XFER_STATUS_NOT_FOUND
,
251 WA_XFER_STATUS_INSUFFICIENT_RESOURCE
,
252 WA_XFER_STATUS_TRANSACTION_ERROR
,
253 WA_XFER_STATUS_ABORTED
,
254 WA_XFER_STATUS_RPIPE_NOT_READY
,
255 WA_XFER_INVALID_FORMAT
,
256 WA_XFER_UNEXPECTED_SEGMENT_NUMBER
,
257 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH
,
260 /** [WUSB] section 8.3.3.4 */
261 struct wa_xfer_result
{
262 struct wa_notif_hdr hdr
;
264 __le32 dwTransferLength
;
267 __le32 dwNumOfPackets
;
271 * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7).
273 * NOTE: u16 fields are read Little Endian from the hardware.
275 * @bNumPorts is the original max number of devices that the host can
276 * connect; we might chop this so the stack can handle
277 * it. In case you need to access it, use wusbhc->ports_max
278 * if it is a Wireless USB WA.
280 struct usb_wa_descriptor
{
284 u8 bNumPorts
; /* don't use!! */
285 u8 bmAttributes
; /* Reserved == 0 */
287 __le16 wRPipeMaxBlock
;
291 u8 DeviceRemovable
; /* FIXME: in DWA this is up to 16 bytes */
295 * HWA Device Information Buffer (WUSB1.0[T8.54])
297 struct hwa_dev_info
{
298 u8 bmDeviceAvailability
[32]; /* FIXME: ignored for now */
301 u8 bmDeviceAttribute
;
304 #endif /* #ifndef __LINUX_USB_WUSB_WA_H */