GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / include / linux / usb / wusb-wa.h
blobe261ca79fbbfb4a47a986622cfb28680b2d9ccf9
2 #ifndef __LINUX_USB_WUSB_WA_H
3 #define __LINUX_USB_WUSB_WA_H
5 /**
6 * Radio Command Request for the Radio Control Interface
8 * Radio Control Interface command and event codes are the same as
9 * WHCI, and listed in include/linux/uwb.h:UWB_RC_{CMD,EVT}_*
11 enum {
12 WA_EXEC_RC_CMD = 40, /* Radio Control command Request */
15 /* Wireless Adapter Requests ([WUSB] table 8-51) */
16 enum {
17 WUSB_REQ_ADD_MMC_IE = 20,
18 WUSB_REQ_REMOVE_MMC_IE = 21,
19 WUSB_REQ_SET_NUM_DNTS = 22,
20 WUSB_REQ_SET_CLUSTER_ID = 23,
21 WUSB_REQ_SET_DEV_INFO = 24,
22 WUSB_REQ_GET_TIME = 25,
23 WUSB_REQ_SET_STREAM_IDX = 26,
24 WUSB_REQ_SET_WUSB_MAS = 27,
25 WUSB_REQ_CHAN_STOP = 28,
29 /* Wireless Adapter WUSB Channel Time types ([WUSB] table 8-52) */
30 enum {
31 WUSB_TIME_ADJ = 0,
32 WUSB_TIME_BPST = 1,
33 WUSB_TIME_WUSB = 2,
36 enum {
37 WA_ENABLE = 0x01,
38 WA_RESET = 0x02,
39 RPIPE_PAUSE = 0x1,
42 /* Responses from Get Status request ([WUSB] section 8.3.1.6) */
43 enum {
44 WA_STATUS_ENABLED = 0x01,
45 WA_STATUS_RESETTING = 0x02
48 enum rpipe_crs {
49 RPIPE_CRS_CTL = 0x01,
50 RPIPE_CRS_ISO = 0x02,
51 RPIPE_CRS_BULK = 0x04,
52 RPIPE_CRS_INTR = 0x08
55 struct usb_rpipe_descriptor {
56 u8 bLength;
57 u8 bDescriptorType;
58 __le16 wRPipeIndex;
59 __le16 wRequests;
60 __le16 wBlocks; /* rw if 0 */
61 __le16 wMaxPacketSize; /* rw? */
62 u8 bHSHubAddress; /* reserved: 0 */
63 u8 bHSHubPort;
64 u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */
65 u8 bDeviceAddress; /* rw: Target device address */
66 u8 bEndpointAddress; /* rw: Target EP address */
67 u8 bDataSequence; /* ro: Current Data sequence */
68 __le32 dwCurrentWindow; /* ro */
69 u8 bMaxDataSequence; /* ro?: max supported seq */
70 u8 bInterval; /* rw: */
71 u8 bOverTheAirInterval; /* rw: */
72 u8 bmAttribute; /* ro? */
73 u8 bmCharacteristics; /* ro? enum rpipe_attr, supported xsactions */
74 u8 bmRetryOptions; /* rw? */
75 __le16 wNumTransactionErrors; /* rw */
76 } __attribute__ ((packed));
78 /**
79 * Wire Adapter Notification types ([WUSB] sections 8.4.5 & 8.5.4)
81 * These are the notifications coming on the notification endpoint of
82 * an HWA and a DWA.
84 enum wa_notif_type {
85 DWA_NOTIF_RWAKE = 0x91,
86 DWA_NOTIF_PORTSTATUS = 0x92,
87 WA_NOTIF_TRANSFER = 0x93,
88 HWA_NOTIF_BPST_ADJ = 0x94,
89 HWA_NOTIF_DN = 0x95,
92 /**
93 * Wire Adapter notification header
95 * Notifications coming from a wire adapter use a common header
96 * defined in [WUSB] sections 8.4.5 & 8.5.4.
98 struct wa_notif_hdr {
99 u8 bLength;
100 u8 bNotifyType; /* enum wa_notif_type */
101 } __attribute__((packed));
104 * HWA DN Received notification [(WUSB] section 8.5.4.2)
106 * The DNData is specified in WUSB1.0[7.6]. For each device
107 * notification we received, we just need to dispatch it.
109 * @dndata: this is really an array of notifications, but all start
110 * with the same header.
112 struct hwa_notif_dn {
113 struct wa_notif_hdr hdr;
114 u8 bSourceDeviceAddr; /* from errata 2005/07 */
115 u8 bmAttributes;
116 struct wusb_dn_hdr dndata[];
117 } __attribute__((packed));
119 /* [WUSB] section 8.3.3 */
120 enum wa_xfer_type {
121 WA_XFER_TYPE_CTL = 0x80,
122 WA_XFER_TYPE_BI = 0x81, /* bulk/interrupt */
123 WA_XFER_TYPE_ISO = 0x82,
124 WA_XFER_RESULT = 0x83,
125 WA_XFER_ABORT = 0x84,
128 /* [WUSB] section 8.3.3 */
129 struct wa_xfer_hdr {
130 u8 bLength; /* 0x18 */
131 u8 bRequestType; /* 0x80 WA_REQUEST_TYPE_CTL */
132 __le16 wRPipe; /* RPipe index */
133 __le32 dwTransferID; /* Host-assigned ID */
134 __le32 dwTransferLength; /* Length of data to xfer */
135 u8 bTransferSegment;
136 } __attribute__((packed));
138 struct wa_xfer_ctl {
139 struct wa_xfer_hdr hdr;
140 u8 bmAttribute;
141 __le16 wReserved;
142 struct usb_ctrlrequest baSetupData;
143 } __attribute__((packed));
145 struct wa_xfer_bi {
146 struct wa_xfer_hdr hdr;
147 u8 bReserved;
148 __le16 wReserved;
149 } __attribute__((packed));
151 struct wa_xfer_hwaiso {
152 struct wa_xfer_hdr hdr;
153 u8 bReserved;
154 __le16 wPresentationTime;
155 __le32 dwNumOfPackets;
156 } __attribute__((packed));
158 /* [WUSB] section 8.3.3.5 */
159 struct wa_xfer_abort {
160 u8 bLength;
161 u8 bRequestType;
162 __le16 wRPipe; /* RPipe index */
163 __le32 dwTransferID; /* Host-assigned ID */
164 } __attribute__((packed));
167 * WA Transfer Complete notification ([WUSB] section 8.3.3.3)
170 struct wa_notif_xfer {
171 struct wa_notif_hdr hdr;
172 u8 bEndpoint;
173 u8 Reserved;
174 } __attribute__((packed));
176 /** Transfer result basic codes [WUSB] table 8-15 */
177 enum {
178 WA_XFER_STATUS_SUCCESS,
179 WA_XFER_STATUS_HALTED,
180 WA_XFER_STATUS_DATA_BUFFER_ERROR,
181 WA_XFER_STATUS_BABBLE,
182 WA_XFER_RESERVED,
183 WA_XFER_STATUS_NOT_FOUND,
184 WA_XFER_STATUS_INSUFFICIENT_RESOURCE,
185 WA_XFER_STATUS_TRANSACTION_ERROR,
186 WA_XFER_STATUS_ABORTED,
187 WA_XFER_STATUS_RPIPE_NOT_READY,
188 WA_XFER_INVALID_FORMAT,
189 WA_XFER_UNEXPECTED_SEGMENT_NUMBER,
190 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH,
193 /** [WUSB] section 8.3.3.4 */
194 struct wa_xfer_result {
195 struct wa_notif_hdr hdr;
196 __le32 dwTransferID;
197 __le32 dwTransferLength;
198 u8 bTransferSegment;
199 u8 bTransferStatus;
200 __le32 dwNumOfPackets;
201 } __attribute__((packed));
204 * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7).
206 * NOTE: u16 fields are read Little Endian from the hardware.
208 * @bNumPorts is the original max number of devices that the host can
209 * connect; we might chop this so the stack can handle
210 * it. In case you need to access it, use wusbhc->ports_max
211 * if it is a Wireless USB WA.
213 struct usb_wa_descriptor {
214 u8 bLength;
215 u8 bDescriptorType;
216 u16 bcdWAVersion;
217 u8 bNumPorts; /* don't use!! */
218 u8 bmAttributes; /* Reserved == 0 */
219 u16 wNumRPipes;
220 u16 wRPipeMaxBlock;
221 u8 bRPipeBlockSize;
222 u8 bPwrOn2PwrGood;
223 u8 bNumMMCIEs;
224 u8 DeviceRemovable;
225 } __attribute__((packed));
228 * HWA Device Information Buffer (WUSB1.0[T8.54])
230 struct hwa_dev_info {
231 u8 bmDeviceAvailability[32];
232 u8 bDeviceAddress;
233 __le16 wPHYRates;
234 u8 bmDeviceAttribute;
235 } __attribute__((packed));
237 #endif /* #ifndef __LINUX_USB_WUSB_WA_H */