block: fix warning with calling smp_processor_id() in preemptible section
[pandora-kernel.git] / drivers / staging / westbridge / astoria / include / linux / westbridge / cyasusb_dep.h
1 /* Cypress West Bridge API header file (cyasusb_dep.h)
2 ## ===========================
3 ## Copyright (C) 2010  Cypress Semiconductor
4 ##
5 ## This program is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License
7 ## as published by the Free Software Foundation; either version 2
8 ## of the License, or (at your option) any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 51 Franklin Street
18 ## Fifth Floor, Boston, MA  02110-1301, USA.
19 ## ===========================
20 */
21
22 /*
23  * This header will contain Antioch specific declaration
24  * of the APIs that are deprecated in Astoria SDK. This is
25  * for maintaining backward compatibility.
26  */
27
28 #ifndef __INCLUDED_CYASUSB_DEP_H__
29 #define __INCLUDED_CYASUSB_DEP_H__
30
31 #ifndef __doxygen__
32
33 /*
34    This data structure is the data passed via the evdata
35    paramater on a usb event callback for the inquiry request.
36 */
37
38 typedef struct cy_as_usb_inquiry_data_dep {
39         /* The media for the event */
40         cy_as_media_type media;
41         /* The EVPD bit from the SCSI INQUIRY request */
42         uint8_t evpd;
43         /* The codepage in the inquiry request */
44         uint8_t codepage;
45         /* This bool must be set to CyTrue indicate
46          * that the inquiry data was changed */
47         cy_bool updated;
48         /* The length of the data */
49         uint16_t length;
50         /* The inquiry data */
51         void *data;
52 } cy_as_usb_inquiry_data_dep;
53
54
55 typedef struct cy_as_usb_unknown_command_data_dep {
56         /* The media for the event */
57         cy_as_media_type media;
58         /* The length of the requst (should be 16 bytes) */
59         uint16_t reqlen;
60         /* The request */
61         void *request;
62         /* The returned status value for the command */
63         uint8_t status;
64         /* If status is failed, the sense key */
65         uint8_t key;
66         /* If status is failed, the additional sense code */
67         uint8_t asc;
68         /* If status if failed, the additional sense code qualifier */
69         uint8_t ascq;
70 } cy_as_usb_unknown_command_data_dep;
71
72
73 typedef struct cy_as_usb_start_stop_data_dep {
74         /* The media type for the event */
75         cy_as_media_type media;
76         /* CyTrue means start request, CyFalse means stop request */
77         cy_bool start;
78         /* CyTrue means LoEj bit set, otherwise false */
79         cy_bool loej;
80 } cy_as_usb_start_stop_data_dep;
81
82
83 typedef struct cy_as_usb_enum_control_dep {
84         /* The bits in this member determine which mass storage devices
85         are enumerated.  see cy_as_usb_mass_storage_enum for more details. */
86         uint8_t enum_mass_storage;
87         /* If true, West Bridge will control enumeration.  If this is false the
88         pport controls enumeration.  if the P port is controlling
89         enumeration, traffic will be received via endpoint zero. */
90         cy_bool antioch_enumeration;
91         /* This is the interface # to use for the mass storage interface,
92         if mass storage is enumerated.  if mass storage is not enumerated
93         this value should be zero. */
94         uint8_t mass_storage_interface;
95         /* If true, Inquiry, START/STOP, and unknown mass storage
96         requests cause a callback to occur for handling by the
97         baseband processor. */
98         cy_bool mass_storage_callbacks;
99 } cy_as_usb_enum_control_dep;
100
101
102 typedef void (*cy_as_usb_event_callback_dep)(
103         /* Handle to the device to configure */
104         cy_as_device_handle                     handle,
105         /* The event type being reported */
106         cy_as_usb_event                 ev,
107         /* The data assocaited with the event being reported */
108         void *evdata
109 );
110
111
112
113 /* Register Callback api */
114 EXTERN cy_as_return_status_t
115 cy_as_usb_register_callback_dep(
116         /* Handle to the West Bridge device */
117         cy_as_device_handle                             handle,
118         /* The function to call */
119         cy_as_usb_event_callback_dep            callback
120         );
121
122
123 extern cy_as_return_status_t
124 cy_as_usb_set_enum_config_dep(
125         /* Handle to the West Bridge device */
126         cy_as_device_handle                     handle,
127         /* The USB configuration information */
128         cy_as_usb_enum_control_dep *config_p,
129         /* The callback if async call */
130         cy_as_function_callback         cb,
131         /* Client supplied data */
132         uint32_t client
133         );
134
135
136 extern cy_as_return_status_t
137 cy_as_usb_get_enum_config_dep(
138         /* Handle to the West Bridge device */
139         cy_as_device_handle                     handle,
140         /* The return value for USB congifuration information */
141         cy_as_usb_enum_control_dep *config_p,
142         /* The callback if async call */
143         cy_as_function_callback         cb,
144         /* Client supplied data */
145         uint32_t                                        client
146         );
147
148 extern cy_as_return_status_t
149 cy_as_usb_get_descriptor_dep(
150         /* Handle to the West Bridge device */
151         cy_as_device_handle     handle,
152         /* The type of descriptor */
153         cy_as_usb_desc_type             type,
154         /* Index for string descriptor */
155         uint8_t                         index,
156         /* The buffer to hold the returned descriptor */
157         void *desc_p,
158         /* This is an input and output parameter.  Before the code this pointer
159         points to a uint32_t that contains the length of the buffer.  after
160         the call, this value contains the amount of data actually returned. */
161         uint32_t *length_p
162         );
163
164 extern cy_as_return_status_t
165 cy_as_usb_set_stall_dep(
166         /* Handle to the West Bridge device */
167         cy_as_device_handle             handle,
168         /* The endpoint of interest */
169         cy_as_end_point_number_t                ep,
170         /* The callback if async call */
171         cy_as_usb_function_callback             cb,
172         /* Client supplied data */
173         uint32_t                        client
174 );
175
176 EXTERN cy_as_return_status_t
177 cy_as_usb_clear_stall_dep(
178         /* Handle to the West Bridge device */
179         cy_as_device_handle             handle,
180         /* The endpoint of interest */
181         cy_as_end_point_number_t                ep,
182         /* The callback if async call */
183         cy_as_usb_function_callback             cb,
184         /* Client supplied data */
185         uint32_t                        client
186         );
187
188 EXTERN cy_as_return_status_t
189 cy_as_usb_set_nak_dep(
190         /* Handle to the West Bridge device */
191         cy_as_device_handle             handle,
192         /* The endpoint of interest */
193         cy_as_end_point_number_t                ep,
194         /* The callback if async call */
195         cy_as_usb_function_callback             cb,
196         /* Client supplied data */
197         uint32_t                        client
198 );
199
200 EXTERN cy_as_return_status_t
201 cy_as_usb_clear_nak_dep(
202         /* Handle to the West Bridge device */
203         cy_as_device_handle             handle,
204         /* The endpoint of interest */
205         cy_as_end_point_number_t                ep,
206         /* The callback if async call */
207         cy_as_usb_function_callback             cb,
208         /* Client supplied data */
209         uint32_t                        client
210         );
211
212 EXTERN cy_as_return_status_t
213 cy_as_usb_select_m_s_partitions_dep(
214                 cy_as_device_handle     handle,
215                 cy_as_media_type        media,
216                 uint32_t device,
217                 cy_as_usb_m_s_type_t type,
218                 cy_as_function_callback  cb,
219                 uint32_t client
220                 );
221
222 #endif /*__doxygen*/
223
224 #endif /*__INCLUDED_CYANSTORAGE_DEP_H__*/