Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / westbridge / astoria / include / linux / westbridge / cyanerr.h
1 /*  Cypress West Bridge API header file (cyanerr.h)
2  ## Symbols for backward compatibility with previous releases of Antioch SDK.
3 ## ===========================
4 ## Copyright (C) 2010  Cypress Semiconductor
5 ##
6 ## This program is free software; you can redistribute it and/or
7 ## modify it under the terms of the GNU General Public License
8 ## as published by the Free Software Foundation; either version 2
9 ## of the License, or (at your option) any later version.
10 ##
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.
15 ##
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
19 ## Fifth Floor, Boston, MA  02110-1301, USA.
20 ## ===========================
21 */
22
23 #ifndef _INCLUDED_CYANERR_H_
24 #define _INCLUDED_CYANERR_H_
25
26 #include "cyaserr.h"
27
28 #ifndef __doxygen__
29
30 /*
31  * Function completed successfully.
32  */
33 #define CY_AN_ERROR_SUCCESS     (CY_AS_ERROR_SUCCESS)
34
35 /*
36  * A function trying to acquire a resource was unable to do so.
37  */
38 #define CY_AN_ERROR_NOT_ACQUIRED (CY_AS_ERROR_NOT_ACQUIRED)
39
40 /*
41  * A function trying to acquire a resource was unable to do so.
42  */
43 #define CY_AN_ERROR_NOT_RELEASED (CY_AS_ERROR_NOT_RELEASED)
44
45 /*
46  * The West Bridge firmware is not loaded.
47  */
48 #define CY_AN_ERROR_NO_FIRMWARE (CY_AS_ERROR_NO_FIRMWARE)
49
50 /*
51  * A timeout occurred waiting on a response from the West Bridge device
52  */
53 #define CY_AN_ERROR_TIMEOUT (CY_AS_ERROR_TIMEOUT)
54
55 /*
56  * A request to download firmware was made while not in the CONFIG mode
57  */
58 #define CY_AN_ERROR_NOT_IN_CONFIG_MODE (CY_AS_ERROR_NOT_IN_CONFIG_MODE)
59
60 /*
61  * This error is returned if the firmware size specified is too invalid.
62  */
63 #define CY_AN_ERROR_INVALID_SIZE (CY_AS_ERROR_INVALID_SIZE)
64
65 /*
66  * This error is returned if a request is made to acquire a resource that has
67  * already been acquired.
68  */
69 #define CY_AN_ERROR_RESOURCE_ALREADY_OWNED (CY_AS_ERROR_RESOURCE_ALREADY_OWNED)
70
71 /*
72  * This error is returned if a request is made to release a resource that has
73  * not previously been acquired.
74  */
75 #define CY_AN_ERROR_RESOURCE_NOT_OWNED (CY_AS_ERROR_RESOURCE_NOT_OWNED)
76
77 /*
78  * This error is returned when a request is made for a media that does not
79  * exist
80  */
81 #define CY_AN_ERROR_NO_SUCH_MEDIA (CY_AS_ERROR_NO_SUCH_MEDIA)
82
83 /*
84  * This error is returned when a request is made for a device that does
85  * not exist
86  */
87 #define CY_AN_ERROR_NO_SUCH_DEVICE (CY_AS_ERROR_NO_SUCH_DEVICE)
88
89 /*
90  * This error is returned when a request is made for a unit that does
91  * not exist
92  */
93 #define CY_AN_ERROR_NO_SUCH_UNIT (CY_AS_ERROR_NO_SUCH_UNIT)
94
95 /*
96  * This error is returned when a request is made for a block that does
97  * not exist
98  */
99 #define CY_AN_ERROR_INVALID_BLOCK (CY_AS_ERROR_INVALID_BLOCK)
100
101 /*
102  * This error is returned when an invalid trace level is set.
103  */
104 #define CY_AN_ERROR_INVALID_TRACE_LEVEL (CY_AS_ERROR_INVALID_TRACE_LEVEL)
105
106 /*
107  * This error is returned when West Bridge is already in the standby state
108  * and an attempt is made to put West Bridge into this state again.
109  */
110 #define CY_AN_ERROR_ALREADY_STANDBY     (CY_AS_ERROR_ALREADY_STANDBY)
111
112 /*
113  * This error is returned when the API needs to set a pin on the
114  * West Bridge device, but this is not supported by the underlying HAL
115  * layer.
116  */
117 #define CY_AN_ERROR_SETTING_WAKEUP_PIN (CY_AS_ERROR_SETTING_WAKEUP_PIN)
118
119 /*
120  * This error is returned when a module is being started that has
121  * already been started.
122  */
123 #define CY_AN_ERROR_ALREADY_RUNNING      (CY_AS_ERROR_ALREADY_RUNNING)
124
125 /*
126  * This error is returned when a module is being stopped that has
127  * already been stopped.
128  */
129 #define CY_AN_ERROR_NOT_RUNNING (CY_AS_ERROR_NOT_RUNNING)
130
131 /*
132  * This error is returned when the caller tries to claim a media that has
133  * already been claimed.
134  */
135 #define CY_AN_ERROR_MEDIA_ALREADY_CLAIMED (CY_AS_ERROR_MEDIA_ALREADY_CLAIMED)
136
137 /*
138  * This error is returned when the caller tries to release a media that
139  * has already been released.
140  */
141 #define CY_AN_ERROR_MEDIA_NOT_CLAIMED (CY_AS_ERROR_MEDIA_NOT_CLAIMED)
142
143 /*
144  * This error is returned when canceling trying to cancel an asynchronous
145  * operation when an async operation is not pending.
146  */
147 #define CY_AN_ERROR_NO_OPERATION_PENDING (CY_AS_ERROR_NO_OPERATION_PENDING)
148
149 /*
150  * This error is returned when an invalid endpoint number is provided
151  * to an API call.
152  */
153 #define CY_AN_ERROR_INVALID_ENDPOINT (CY_AS_ERROR_INVALID_ENDPOINT)
154
155 /*
156  * This error is returned when an invalid descriptor type
157  * is specified in an API call.
158  */
159 #define CY_AN_ERROR_INVALID_DESCRIPTOR (CY_AS_ERROR_INVALID_DESCRIPTOR)
160
161 /*
162  * This error is returned when an invalid descriptor index
163  * is specified in an API call.
164  */
165 #define CY_AN_ERROR_BAD_INDEX (CY_AS_ERROR_BAD_INDEX)
166
167 /*
168  * This error is returned if trying to set a USB descriptor
169  * when in the P port enumeration mode.
170  */
171 #define CY_AN_ERROR_BAD_ENUMERATION_MODE (CY_AS_ERROR_BAD_ENUMERATION_MODE)
172
173 /*
174  * This error is returned when the endpoint configuration specified
175  * is not valid.
176  */
177 #define CY_AN_ERROR_INVALID_CONFIGURATION (CY_AS_ERROR_INVALID_CONFIGURATION)
178
179 /*
180  * This error is returned when the API cannot verify it is connected
181  * to an West Bridge device.
182  */
183 #define CY_AN_ERROR_NO_ANTIOCH (CY_AS_ERROR_NO_ANTIOCH)
184
185 /*
186  * This error is returned when an API function is called and
187  * CyAnMiscConfigureDevice has not been called to configure West
188  * Bridge for the current environment.
189  */
190 #define CY_AN_ERROR_NOT_CONFIGURED (CY_AS_ERROR_NOT_CONFIGURED)
191
192 /*
193  * This error is returned when West Bridge cannot allocate memory required for
194  * internal API operations.
195  */
196 #define CY_AN_ERROR_OUT_OF_MEMORY (CY_AS_ERROR_OUT_OF_MEMORY)
197
198 /*
199  * This error is returned when a module is being started that has
200  * already been started.
201  */
202 #define CY_AN_ERROR_NESTED_SLEEP (CY_AS_ERROR_NESTED_SLEEP)
203
204 /*
205  * This error is returned when an operation is attempted on an endpoint that has
206  * been disabled.
207  */
208 #define CY_AN_ERROR_ENDPOINT_DISABLED (CY_AS_ERROR_ENDPOINT_DISABLED)
209
210 /*
211  * This error is returned when a call is made to an API function when the device
212  * is in standby.
213  */
214 #define CY_AN_ERROR_IN_STANDBY (CY_AS_ERROR_IN_STANDBY)
215
216 /*
217  * This error is returned when an API call is made with an invalid handle value.
218  */
219 #define CY_AN_ERROR_INVALID_HANDLE (CY_AS_ERROR_INVALID_HANDLE)
220
221 /*
222  * This error is returned when an invalid response is returned from the West
223  * Bridge device.
224  */
225 #define CY_AN_ERROR_INVALID_RESPONSE (CY_AS_ERROR_INVALID_RESPONSE)
226
227 /*
228  * This error is returned from the callback function for any asynchronous
229  * read or write request that is canceled.
230  */
231 #define CY_AN_ERROR_CANCELED (CY_AS_ERROR_CANCELED)
232
233 /*
234  * This error is returned when the call to create sleep channel fails
235  * in the HAL layer.
236  */
237 #define CY_AN_ERROR_CREATE_SLEEP_CHANNEL_FAILED \
238         (CY_AS_ERROR_CREATE_SLEEP_CHANNEL_FAILED)
239
240 /*
241  * This error is returned when the call to CyAnMiscLeaveStandby
242  * is made and the device is not in standby.
243  */
244 #define CY_AN_ERROR_NOT_IN_STANDBY (CY_AS_ERROR_NOT_IN_STANDBY)
245
246 /*
247  * This error is returned when the call to destroy sleep channel fails
248  * in the HAL layer.
249  */
250 #define CY_AN_ERROR_DESTROY_SLEEP_CHANNEL_FAILED \
251         (CY_AS_ERROR_DESTROY_SLEEP_CHANNEL_FAILED)
252
253 /*
254  * This error is returned when an invalid resource is specified to a call
255  * to CyAnMiscAcquireResource() or CyAnMiscReleaseResource()
256  */
257 #define CY_AN_ERROR_INVALID_RESOURCE (CY_AS_ERROR_INVALID_RESOURCE)
258
259 /*
260  * This error occurs when an operation is requested on an endpoint that has
261  * a currently pending async operation.
262  */
263 #define CY_AN_ERROR_ASYNC_PENDING (CY_AS_ERROR_ASYNC_PENDING)
264
265 /*
266  * This error is returned when a call to CyAnStorageCancelAsync() or
267  * CyAnUsbCancelAsync() is made when no asynchronous request is pending.
268  */
269 #define CY_AN_ERROR_ASYNC_NOT_PENDING (CY_AS_ERROR_ASYNC_NOT_PENDING)
270
271 /*
272  * This error is returned when a request is made to put the West Bridge device
273  * into standby mode while the USB stack is still active.
274  */
275 #define CY_AN_ERROR_USB_RUNNING (CY_AS_ERROR_USB_RUNNING)
276
277 /*
278  * A request for in the wrong direction was issued on an endpoint.
279  */
280 #define CY_AN_ERROR_USB_BAD_DIRECTION (CY_AS_ERROR_USB_BAD_DIRECTION)
281
282 /*
283  * An invalid request was received
284  */
285 #define CY_AN_ERROR_INVALID_REQUEST (CY_AS_ERROR_INVALID_REQUEST)
286
287 /*
288  * An ACK request was requested while no setup packet was pending.
289  */
290 #define CY_AN_ERROR_NO_SETUP_PACKET_PENDING     \
291         (CY_AS_ERROR_NO_SETUP_PACKET_PENDING)
292
293 /*
294  * A call was made to a API function that cannot be called from a callback.
295  */
296 #define CY_AN_ERROR_INVALID_IN_CALLBACK (CY_AS_ERROR_INVALID_IN_CALLBACK)
297
298 /*
299  * A call was made to CyAnUsbSetEndPointConfig() before
300  * CyAnUsbSetPhysicalConfiguration() was called.
301  */
302 #define CY_AN_ERROR_ENDPOINT_CONFIG_NOT_SET     \
303         (CY_AS_ERROR_ENDPOINT_CONFIG_NOT_SET)
304
305 /*
306  * The physical endpoint referenced is not valid in the current
307  * physical configuration
308  */
309 #define CY_AN_ERROR_INVALID_PHYSICAL_ENDPOINT \
310         (CY_AS_ERROR_INVALID_PHYSICAL_ENDPOINT)
311
312 /*
313  * The data supplied to the CyAnMiscDownloadFirmware() call is not aligned on a
314  * WORD (16 bit) boundary.
315  */
316 #define CY_AN_ERROR_ALIGNMENT_ERROR     (CY_AS_ERROR_ALIGNMENT_ERROR)
317
318 /*
319  * A call was made to destroy the West Bridge device, but the USB stack or the
320  * storage stack was will running.
321  */
322 #define CY_AN_ERROR_STILL_RUNNING (CY_AS_ERROR_STILL_RUNNING)
323
324 /*
325  * A call was made to the API for a function that is not yet supported.
326  */
327 #define CY_AN_ERROR_NOT_YET_SUPPORTED (CY_AS_ERROR_NOT_YET_SUPPORTED)
328
329 /*
330  * A NULL callback was provided where a non-NULL callback was required
331  */
332 #define CY_AN_ERROR_NULL_CALLBACK (CY_AS_ERROR_NULL_CALLBACK)
333
334 /*
335  * This error is returned when a request is made to put the West Bridge device
336  * into standby mode while the storage stack is still active.
337  */
338 #define CY_AN_ERROR_STORAGE_RUNNING     (CY_AS_ERROR_STORAGE_RUNNING)
339
340 /*
341  * This error is returned when an operation is attempted that cannot be
342  * completed while the USB stack is connected to a USB host.
343  */
344 #define CY_AN_ERROR_USB_CONNECTED (CY_AS_ERROR_USB_CONNECTED)
345
346 /*
347  * This error is returned when a USB disconnect is attempted and the
348  * West Bridge device is not connected.
349  */
350 #define CY_AN_ERROR_USB_NOT_CONNECTED (CY_AS_ERROR_USB_NOT_CONNECTED)
351
352 /*
353  * This error is returned when an P2S storage operation attempted and
354  * data could not be read or written to the storage media.
355  */
356 #define CY_AN_ERROR_MEDIA_ACCESS_FAILURE (CY_AS_ERROR_MEDIA_ACCESS_FAILURE)
357
358 /*
359  * This error is returned when an P2S storage operation attempted and
360  * the media is write protected.
361  */
362 #define CY_AN_ERROR_MEDIA_WRITE_PROTECTED (CY_AS_ERROR_MEDIA_WRITE_PROTECTED)
363
364 /*
365  * This error is returned when an attempt is made to cancel a request
366  * that has already been sent to the West Bridge.
367  */
368 #define CY_AN_ERROR_OPERATION_IN_TRANSIT (CY_AS_ERROR_OPERATION_IN_TRANSIT)
369
370 /*
371  * This error is returned when an invalid parameter is passed to one of
372  * the APIs.
373  */
374 #define CY_AN_ERROR_INVALID_PARAMETER (CY_AS_ERROR_INVALID_PARAMETER)
375
376 /*
377  * This error is returned if an API is not supported by the current
378  * West Bridge device or the active firmware version.
379  */
380 #define CY_AN_ERROR_NOT_SUPPORTED (CY_AS_ERROR_NOT_SUPPORTED)
381
382 /*
383  * This error is returned when a call is made to one of the Storage or
384  * USB APIs while the device is in suspend mode.
385  */
386 #define CY_AN_ERROR_IN_SUSPEND (CY_AS_ERROR_IN_SUSPEND)
387
388 /*
389  * This error is returned when the call to CyAnMiscLeaveSuspend
390  * is made and the device is not in suspend mode.
391  */
392 #define CY_AN_ERROR_NOT_IN_SUSPEND (CY_AS_ERROR_NOT_IN_SUSPEND)
393
394 /*
395  * This error is returned when a command that is disabled by USB is called.
396  */
397 #define CY_AN_ERROR_FEATURE_NOT_ENABLED (CY_AS_ERROR_FEATURE_NOT_ENABLED)
398
399 /*
400  * This error is returned when an Async storage read or write is called before a
401  * query device call is issued.
402  */
403 #define CY_AN_ERROR_QUERY_DEVICE_NEEDED (CY_AS_ERROR_QUERY_DEVICE_NEEDED)
404
405 /*
406  * This error is returned when a call is made to USB or STORAGE Start or
407  * Stop before a prior Start or Stop has finished.
408  */
409 #define CY_AN_ERROR_STARTSTOP_PENDING (CY_AS_ERROR_STARTSTOP_PENDING)
410
411 /*
412  * This error is returned when a request is made for a bus that does not exist
413  */
414 #define CY_AN_ERROR_NO_SUCH_BUS  (CY_AS_ERROR_NO_SUCH_BUS)
415
416 #endif /* __doxygen__ */
417
418 #endif /* _INCLUDED_CYANERR_H_ */