1
/* Cypress West Bridge API header file (cyasusb_dep.h)
2
## ===========================
3
## Copyright (C) 2010 Cypress Semiconductor
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.
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.
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
## ===========================
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.
28
#ifndef __INCLUDED_CYASUSB_DEP_H__
29
#define __INCLUDED_CYASUSB_DEP_H__
34
This data structure is the data passed via the evdata
35
paramater on a usb event callback for the inquiry request.
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 */
43
/* The codepage in the inquiry request */
45
/* This bool must be set to CyTrue indicate
46
* that the inquiry data was changed */
48
/* The length of the data */
50
/* The inquiry data */
52
} cy_as_usb_inquiry_data_dep;
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) */
62
/* The returned status value for the command */
64
/* If status is failed, the sense key */
66
/* If status is failed, the additional sense code */
68
/* If status if failed, the additional sense code qualifier */
70
} cy_as_usb_unknown_command_data_dep;
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 */
78
/* CyTrue means LoEj bit set, otherwise false */
80
} cy_as_usb_start_stop_data_dep;
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;
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 */
107
/* The data assocaited with the event being reported */
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
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 */
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 */
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 */
156
/* The buffer to hold the returned descriptor */
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. */
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 */
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 */
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 */
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 */
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,
217
cy_as_usb_m_s_type_t type,
218
cy_as_function_callback cb,
224
#endif /*__INCLUDED_CYANSTORAGE_DEP_H__*/