~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/staging/westbridge/astoria/include/linux/westbridge/cyasmtp.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Cypress West Bridge API header file (cyasmtp.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
#ifndef _INCLUDED_CYASMTP_H_
 
23
#define _INCLUDED_CYASMTP_H_
 
24
 
 
25
#include "cyasmisc.h"
 
26
 
 
27
#include "cyas_cplus_start.h"
 
28
 
 
29
/*@@Media Transfer Protocol (MTP) Overview
 
30
  Summary
 
31
  The MTP API has been designed to allow MTP enabled West Bridge
 
32
  devices to implement the MTP protocol while maintaining high
 
33
  performance. West Bridge has the capability to enter into a
 
34
  Turbo mode during a MTP SendObject or GetObject operation
 
35
  enabling it to directly stream the data into or out of the
 
36
  attached SD card with minimal involvement from the Processor.
 
37
 
 
38
  Description
 
39
  The MTP API is designed to act as a pass through implementation
 
40
  of the MTP protocol for all operations. Each MTP transaction
 
41
  received from the Host is passed through West Bridge and along
 
42
  to the Processor. The Processor can then respond to the
 
43
  transaction and pass data and/or responses back to the Host
 
44
  through West Bridge.
 
45
 
 
46
  The MTP API also allows for a high speed handling of MTP
 
47
  SendObject and GetObject operations, referred to as Turbo MTP.
 
48
  During a Turbo MTP operation West Bridge is responsible for
 
49
  reading or writing the data for the MTP operation directly from
 
50
  or to the SD card with minimal interaction from the Processor.
 
51
  The is done by having the Processor transfer a Block Table
 
52
  to West Bridge which contains the locations on the SD card that
 
53
  need to be read or written. During the handling of a Turbo
 
54
  Operation the Processor will then only periodically need to
 
55
  send a new Block Table to West Bridge when the first is used up.
 
56
  See the CyAsMTPInitSendObject and CyAsMTPInitGetObject functions
 
57
  for more details.
 
58
 
 
59
  In order to enable the MTP API you must first have a MTP enabled
 
60
  West Bridge loaded with MTP firmware. You then must start the USB
 
61
  and Storage APIs before starting the MTP API. See CyAsMTPStart
 
62
  for more details.
 
63
*/
 
64
 
 
65
/*@@Endpoints
 
66
  Summary
 
67
  When using MTP firmware endpoints 2 and 6 are dedicated
 
68
  to bulk MTP traffic and endpoint 1 is available for MTP
 
69
  events.
 
70
 
 
71
  Description
 
72
  When using a MTP enabled West Brdige device endpoints 2 and
 
73
  6 are made available for use to implement the MTP protocol.
 
74
  These endpoints have a few special restrictions noted below
 
75
  but otherwise the existing USB APIs can be used normally with
 
76
  these endpoints.
 
77
 
 
78
  1. CyAsUsbSetNak, CyAsUsbClearNak, and CyAsUsbGetNak are
 
79
        disabled for these endpoints
 
80
  2. During a turbo operation CyAsUsbSetStall, CyAsUsbClearStall,
 
81
        and CyAsUsbGetStall are disabled.
 
82
 
 
83
*/
 
84
 
 
85
 
 
86
/* Summary
 
87
   This constants defines the maximum number of
 
88
   entries in the Block Table used to describe
 
89
   the locations for Send/GetObject operations.
 
90
 
 
91
   See Also
 
92
   * CyAsMtpSendObject
 
93
   * CyAsMtpGetObject
 
94
*/
 
95
#define CY_AS_MAX_BLOCK_TABLE_ENTRIES 64
 
96
 
 
97
/* Summary
 
98
   Endpoint to be used for MTP reads from the USB host.
 
99
 */
 
100
#define CY_AS_MTP_READ_ENDPOINT          (2)
 
101
 
 
102
/* Summary
 
103
   Endpoint to be used fro MTP writes to the USB host.
 
104
 */
 
105
#define CY_AS_MTP_WRITE_ENDPOINT                (6)
 
106
 
 
107
/******************************************
 
108
 * MTP Types
 
109
 ******************************************/
 
110
 
 
111
/* Summary
 
112
   The BlockTable used for turbo operations.
 
113
 
 
114
   Description
 
115
   This struct is used to specify the blocks
 
116
   to be used for both read/write and send/getObject
 
117
   operations.
 
118
 
 
119
   The start block is a starting Logical Block Address
 
120
   and num block is the number of blocks in that contiguous
 
121
   region.
 
122
 
 
123
   start_blocks[i]->[-------] <- start_blocks[i] + num_blocks[i]
 
124
 
 
125
   If you need fewer than CY_AS_MAX_BLOCK_TABLE_ENTRIES
 
126
   the remainder should be left empty. Empty is defined
 
127
   as num_blocks equal to 0.
 
128
 
 
129
   See Also
 
130
   * CyAsMTPInitSendObject
 
131
   * CyAsMTPInitGetObject
 
132
 
 
133
*/
 
134
typedef struct cy_as_mtp_block_table {
 
135
        uint32_t start_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES];
 
136
        uint16_t num_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES];
 
137
} cy_as_mtp_block_table;
 
138
 
 
139
/* Summary
 
140
   This type specifies the type of MTP event that has occurred.
 
141
 
 
142
   Description
 
143
   MTP events are used to communicate that West Bridge has
 
144
   either finished the handling of the given operation, or
 
145
   that it requires additional data to complete the operation.
 
146
 
 
147
   In no case does West Bridge send any MTP protocol responses,
 
148
   this always remain the responsibility of the client.
 
149
 
 
150
   See Also
 
151
   * CyAsMTPInitSendObject
 
152
   * CyAsMTPInitGetObject
 
153
   * CyAsMTPSendBlockTable
 
154
 
 
155
*/
 
156
typedef enum cy_as_mtp_event {
 
157
        /* This event is sent when West Bridge
 
158
        has finished writing the data from a
 
159
        send_object. west bridge will -not- send
 
160
        the MTP response. */
 
161
        cy_as_mtp_send_object_complete,
 
162
 
 
163
        /* This event is sent when West Bridge
 
164
        has finished sending the data for a
 
165
        get_object operation. west bridge will
 
166
        -not- send the MTP response. */
 
167
        cy_as_mtp_get_object_complete,
 
168
 
 
169
        /* This event is called when West Bridge
 
170
        needs a new block_table. this is only a
 
171
        notification, to transfer a block_table
 
172
        to west bridge the cy_as_mtp_send_block_table
 
173
        use the function. while west bridge is waiting
 
174
        for a block_table during a send_object it
 
175
        may need to NAK the endpoint. it is important
 
176
        that the cy_as_mtp_send_block_table call is made
 
177
        in a timely manner as eventually a delay
 
178
        will result in an USB reset. this event has
 
179
        no data */
 
180
        cy_as_mtp_block_table_needed
 
181
} cy_as_mtp_event;
 
182
 
 
183
/* Summary
 
184
   Data for the CyAsMTPSendObjectComplete event.
 
185
 
 
186
   Description
 
187
   Notification that a SendObject operation has been
 
188
   completed. The status of the operation is given
 
189
   (to distinguish between a cancelled and a success
 
190
   for example) as well as the block count. The blocks
 
191
   are used in order based on the current block table.
 
192
   If more than one block table was used for a given
 
193
   SendObject the count will include the total number
 
194
   of blocks written.
 
195
 
 
196
   This callback will be made only once per SendObject
 
197
   operation and it will only be called after all of
 
198
   the data has been committed to the SD card.
 
199
 
 
200
   See Also
 
201
   * CyAsMTPEvent
 
202
 
 
203
 */
 
204
typedef struct cy_as_mtp_send_object_complete_data {
 
205
        cy_as_return_status_t status;
 
206
        uint32_t byte_count;
 
207
        uint32_t transaction_id;
 
208
} cy_as_mtp_send_object_complete_data;
 
209
 
 
210
/*  Summary
 
211
        Data for the CyAsMTPGetObjectComplete event.
 
212
 
 
213
        Description
 
214
        Notification that a GetObject has finished. This
 
215
        event allows the P side to know when to send the MTP
 
216
        response for the GetObject operation.
 
217
 
 
218
        See Also
 
219
        * CyAsMTPEvent
 
220
 
 
221
*/
 
222
typedef struct cy_as_mtp_get_object_complete_data {
 
223
        cy_as_return_status_t status;
 
224
        uint32_t byte_count;
 
225
} cy_as_mtp_get_object_complete_data;
 
226
 
 
227
/*  Summary
 
228
        MTP Event callback.
 
229
 
 
230
        Description
 
231
        Callback used to communicate that a SendObject
 
232
        operation has finished.
 
233
 
 
234
        See Also
 
235
        * CyAsMTPEvent
 
236
*/
 
237
typedef void (*cy_as_mtp_event_callback)(
 
238
        cy_as_device_handle handle,
 
239
        cy_as_mtp_event evtype,
 
240
        void *evdata
 
241
        );
 
242
 
 
243
/* Summary
 
244
   This is the callback function called after asynchronous API
 
245
   functions have completed.
 
246
 
 
247
   Description
 
248
   When calling API functions from callback routines (interrupt
 
249
   handlers usually) the async version of these functions must
 
250
   be used. This callback is called when an asynchronous API
 
251
   function has completed.
 
252
*/
 
253
typedef void (*cy_as_mtp_function_callback)(
 
254
        /* Handle to the device to configure */
 
255
        cy_as_device_handle     handle,
 
256
        /* The error status of the operation */
 
257
        cy_as_return_status_t   status,
 
258
        /* A client supplied 32 bit tag */
 
259
        uint32_t client
 
260
);
 
261
 
 
262
/**************************************
 
263
 * MTP Functions
 
264
 **************************************/
 
265
 
 
266
/* Summary
 
267
   This function starts the MTP stack.
 
268
 
 
269
   Description
 
270
   Initializes West Bridge for MTP activity and registers the MTP
 
271
   event callback.
 
272
 
 
273
   Before calling CyAsMTPStart, CyAsUsbStart and CyAsStorageStart must be
 
274
   called (in either order).
 
275
 
 
276
   MTPStart must be called before the device is enumerated. Please
 
277
   see the documentation for CyAsUsbSetEnumConfig and CyAsUsbEnumControl
 
278
   for details on enumerating a device for MTP.
 
279
 
 
280
   Calling MTPStart will not affect any ongoing P<->S traffic.
 
281
 
 
282
   This requires a MTP firmware image to be loaded on West Bridge.
 
283
 
 
284
   Returns
 
285
   * CY_AS_ERROR_SUCCESS
 
286
   * CY_AS_ERROR_INVALID_HANDLE
 
287
   * CY_AS_ERROR_NOT_CONFIGURED
 
288
   * CY_AS_ERROR_NO_FIRMWARE
 
289
   * CY_AS_ERROR_IN_SUSPEND
 
290
   * CY_AS_ERROR_INVALID_IN_CALLBACK
 
291
   * CY_AS_ERROR_STARTSTOP_PENDING
 
292
   * CY_AS_ERROR_NOT_RUNNING - CyAsUsbStart or CyAsStorageStart
 
293
   *    have not been called
 
294
   * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
295
   *    firmware with MTP support
 
296
   * CY_AS_ERROR_OUT_OF_MEMORY
 
297
   * CY_AS_ERROR_INVALID_RESPONSE
 
298
 
 
299
 
 
300
   See Also
 
301
   * CyAsMTPStop
 
302
   * CyAsUsbStart
 
303
   * CyAsStorageStart
 
304
   * CyAsUsbSetEnumConfig
 
305
   * CyAsUsbEnumControl
 
306
*/
 
307
cy_as_return_status_t
 
308
cy_as_mtp_start(
 
309
        cy_as_device_handle handle,
 
310
        cy_as_mtp_event_callback event_c_b,
 
311
        cy_as_function_callback cb,
 
312
        uint32_t client
 
313
        );
 
314
 
 
315
 
 
316
/*  Summary
 
317
        This function stops the MTP stack.
 
318
 
 
319
        Description
 
320
        Stops all MTP activity. Any ongoing transfers are
 
321
        canceled.
 
322
 
 
323
        This will not cause a UsbDisconnect but all
 
324
        MTP activity (both pass through and turbo) will
 
325
        stop.
 
326
 
 
327
        Returns
 
328
   * CY_AS_ERROR_SUCCESS
 
329
   * CY_AS_ERROR_INVALID_HANDLE
 
330
   * CY_AS_ERROR_NOT_CONFIGURED
 
331
   * CY_AS_ERROR_NO_FIRMWARE
 
332
   * CY_AS_ERROR_NOT_RUNNING
 
333
   * CY_AS_ERROR_IN_SUSPEND
 
334
   * CY_AS_ERROR_INVALID_IN_CALLBACK
 
335
   * CY_AS_ERROR_STARTSTOP_PENDING
 
336
   * CY_AS_ERROR_OUT_OF_MEMORY
 
337
   * CY_AS_ERROR_INVALID_RESPONSE
 
338
 
 
339
 
 
340
        See Also
 
341
        * CyAsMTPStart
 
342
*/
 
343
cy_as_return_status_t
 
344
cy_as_mtp_stop(
 
345
        cy_as_device_handle handle,
 
346
        cy_as_function_callback cb,
 
347
        uint32_t client
 
348
        );
 
349
 
 
350
/*  Summary
 
351
        This function sets up a Turbo SendObject operation.
 
352
 
 
353
        Description
 
354
        Calling this function will setup West Bridge to
 
355
        enable Tubo handling of the next SendObject
 
356
        operation received. This will pass down the initial
 
357
        block table to the firmware and setup a direct u->s
 
358
        write for the SendObject operation.
 
359
 
 
360
        If this function is not called before a SendObject
 
361
        operation is seen  the SendObject operation and data
 
362
        will be passed along to the P port like any other MTP
 
363
        command. It would then be the responsibility of the
 
364
        client to perform a normal StorageWrite call to
 
365
        store the data on the SD card. N.B. This will be
 
366
        very slow compared with the Turbo handling.
 
367
 
 
368
        The completion of this function only signals that
 
369
        West Bridge has been set up to receive the next SendObject
 
370
        operation. When the SendObject operation has been fully
 
371
        handled and the data written to the SD card a separate
 
372
        event will be triggered.
 
373
 
 
374
        Returns
 
375
        * CY_AS_ERROR_SUCCESS
 
376
        * CY_AS_ERROR_INVALID_HANDLE
 
377
        * CY_AS_ERROR_NOT_CONFIGURED
 
378
        * CY_AS_ERROR_NO_FIRMWARE
 
379
        * CY_AS_ERROR_IN_SUSPEND
 
380
        * CY_AS_ERROR_NOT_RUNNING
 
381
        * CY_AS_ERROR_OUT_OF_MEMORY
 
382
        * CY_AS_ERROR_ASYNC_PENDING
 
383
        * CY_AS_ERROR_INVALID_RESPONSE
 
384
        * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
385
        *       firmware with MTP support
 
386
 
 
387
        See Also
 
388
        * CyAsMTPCancelSendObject
 
389
        * CyAsMTPInitGetObject
 
390
        * CyAsMTPEvent
 
391
        * CyAsMTPSendBlockTable
 
392
*/
 
393
cy_as_return_status_t
 
394
cy_as_mtp_init_send_object(
 
395
        cy_as_device_handle handle,
 
396
        cy_as_mtp_block_table *blk_table,
 
397
        uint32_t num_bytes,
 
398
        cy_as_function_callback cb,
 
399
        uint32_t client
 
400
        );
 
401
 
 
402
/* Summary
 
403
   This function cancels an ongoing MTP operation.
 
404
 
 
405
   Description
 
406
   Causes West Bridge to cancel an ongoing SendObject
 
407
   operation. Note this is only a cancel to West Bridge,
 
408
   the MTP operation still needs to be canceled by
 
409
   sending a response.
 
410
 
 
411
   West Bridge will automatically set a Stall on the endpoint
 
412
   when the cancel is received.
 
413
 
 
414
   This function is only valid after CyAsMTPInitSendObject
 
415
   has been called, but before the CyAsMTPSendObjectComplete
 
416
   event has been sent.
 
417
 
 
418
   Returns
 
419
   * CY_AS_ERROR_SUCCESS
 
420
   * CY_AS_ERROR_INVALID_HANDLE
 
421
   * CY_AS_ERROR_NOT_RUNNING
 
422
   * CY_AS_ERROR_OUT_OF_MEMORY
 
423
   * CY_AS_ERROR_INVALID_RESPONSE
 
424
   * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
425
   *    firmware with MTP support
 
426
   * CY_AS_ERROR_NO_OPERATION_PENDING
 
427
 
 
428
   See Also
 
429
   * CyAsMTPInitSendObject
 
430
*/
 
431
cy_as_return_status_t
 
432
cy_as_mtp_cancel_send_object(
 
433
        cy_as_device_handle handle,
 
434
        cy_as_function_callback cb,
 
435
        uint32_t client
 
436
        );
 
437
 
 
438
/* Summary
 
439
   This function sets up a turbo GetObject operation.
 
440
 
 
441
   Description
 
442
   Called by the P in response to a GetObject
 
443
   operation. This provides West Bridge with the block
 
444
   addresses for the Object data that needs to be
 
445
   transferred.
 
446
 
 
447
   It is the responsibility of the Processor to send the MTP
 
448
   operation before calling CyAsMTPInitGetObject. West Bridge
 
449
   will then send the data phase of the transaction,
 
450
   automatically creating the required container for Data.
 
451
   Once all of the Data has been transferred a callback will
 
452
   be issued to inform the Processor that the Data phase has
 
453
   completed allowing it to send the required MTP response.
 
454
 
 
455
   If an entire Block Table is used then after the
 
456
   last block is transferred the CyAsMTPBtCallback
 
457
   will be called to allow an additional Block Table(s)
 
458
   to be specified.
 
459
 
 
460
   Returns
 
461
   * CY_AS_ERROR_SUCCESS
 
462
   * CY_AS_ERROR_INVALID_HANDLE
 
463
   * CY_AS_ERROR_NOT_CONFIGURED
 
464
   * CY_AS_ERROR_NO_FIRMWARE
 
465
   * CY_AS_ERROR_NOT_RUNNING
 
466
   * CY_AS_ERROR_IN_SUSPEND
 
467
   * CY_AS_ERROR_OUT_OF_MEMORY
 
468
   * CY_AS_ERROR_ASYNC_PENDING
 
469
   * CY_AS_ERROR_INVALID_RESPONSE
 
470
   * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
471
   *    firmware with MTP support
 
472
 
 
473
   See Also
 
474
   * CyAsMTPInitSendObject
 
475
   * CyAsMTPCancelGetObject
 
476
   * CyAsMTPEvent
 
477
   * CyAsMTPSendBlockTable
 
478
*/
 
479
cy_as_return_status_t
 
480
cy_as_mtp_init_get_object(
 
481
        cy_as_device_handle handle,
 
482
        cy_as_mtp_block_table *table_p,
 
483
        uint32_t num_bytes,
 
484
        uint32_t transaction_id,
 
485
        cy_as_function_callback cb,
 
486
        uint32_t client
 
487
        );
 
488
 
 
489
/* Summary
 
490
   This function cancels an ongoing turbo GetObject
 
491
   operation.
 
492
 
 
493
   Description
 
494
   Causes West Bridge to cancel an ongoing GetObject
 
495
   operation. Note this is only a cancel to West Bridge,
 
496
   the MTP operation still needs to be canceled by
 
497
   sending a response.
 
498
 
 
499
   This function is only valid after CyAsMTPGetSendObject
 
500
   has been called, but before the CyAsMTPGetObjectComplete
 
501
   event has been sent.
 
502
 
 
503
   Returns
 
504
   * CY_AS_ERROR_SUCCESS
 
505
   * CY_AS_ERROR_INVALID_HANDLE
 
506
   * CY_AS_ERROR_NOT_RUNNING
 
507
   * CY_AS_ERROR_OUT_OF_MEMORY
 
508
   * CY_AS_ERROR_INVALID_RESPONSE
 
509
   * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
510
   *    firmware with MTP support
 
511
   * CY_AS_ERROR_NO_OPERATION_PENDING
 
512
 
 
513
   See Also
 
514
   * CyAsMTPInitGetObject
 
515
*/
 
516
cy_as_return_status_t
 
517
cy_as_mtp_cancel_get_object(
 
518
        cy_as_device_handle handle,
 
519
        cy_as_function_callback cb,
 
520
        uint32_t client
 
521
        );
 
522
 
 
523
/* Summary
 
524
   This function is used to transfer a BlockTable as part of
 
525
   an ongoing MTP operation.
 
526
 
 
527
   Description
 
528
   This function is called in response to the
 
529
   CyAsMTPBlockTableNeeded event. This allows the client to
 
530
   pass in a BlockTable structure to West Bridge.
 
531
 
 
532
   The memory associated with the table will be copied and
 
533
   can be safely disposed of when the function returns if
 
534
   called synchronously, or when the callback is made if
 
535
   called asynchronously.
 
536
 
 
537
   This function is used for both SendObject and GetObject
 
538
   as both can generate the CyAsMTPBlockTableNeeded event.
 
539
 
 
540
   Returns
 
541
   * CY_AS_ERROR_SUCCESS
 
542
   * CY_AS_ERROR_INVALID_HANDLE
 
543
   * CY_AS_ERROR_NOT_CONFIGURED
 
544
   * CY_AS_ERROR_NO_FIRMWARE
 
545
   * CY_AS_ERROR_NOT_RUNNING
 
546
   * CY_AS_ERROR_IN_SUSPEND
 
547
   * CY_AS_ERROR_OUT_OF_MEMORY
 
548
   * CY_AS_ERROR_ASYNC_PENDING
 
549
   * CY_AS_ERROR_INVALID_RESPONSE
 
550
   * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running
 
551
   *    firmware with MTP support
 
552
 
 
553
   See Also
 
554
   * CyAsMTPInitSendObject
 
555
   * CyAsMTPInitGetObject
 
556
*/
 
557
cy_as_return_status_t
 
558
cy_as_mtp_send_block_table(
 
559
        cy_as_device_handle handle,
 
560
        cy_as_mtp_block_table *table,
 
561
        cy_as_function_callback cb,
 
562
        uint32_t client
 
563
        );
 
564
 
 
565
/* Summary
 
566
   This function is used to mark the start of a storage
 
567
   read/write burst from the P port processor.
 
568
 
 
569
   Description
 
570
   This function is used to mark the start of a storage
 
571
   read/write burst from the processor. All USB host access
 
572
   into the mass storage / MTP endpoints will be blocked
 
573
   while the read/write burst is ongoing, and will be allowed
 
574
   to resume only after CyAsMTPStorageOnlyStop is called.
 
575
   The burst mode is used to reduce the firmware overhead
 
576
   due to configuring the internal data paths repeatedly,
 
577
   and can help improve performance when a sequence of
 
578
   read/writes is performed in a burst.
 
579
 
 
580
   This function will not generate a special mailbox request,
 
581
   it will only set a flag on the next Storage Read/Write
 
582
   operation. Until such a call is made West Bridge will
 
583
   continue to accept incoming packets from the Host.
 
584
 
 
585
   * Valid in Asynchronous Callback: YES
 
586
 
 
587
   Returns
 
588
   * CY_AS_ERROR_INVALID_HANDLE - Invalid West Bridge device
 
589
   *    handle was passed in.
 
590
   * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not
 
591
   *    been configured.
 
592
   * CY_AS_ERROR_NO_FIRMWARE - Firmware is not active on West
 
593
   *    Bridge device.
 
594
   * CY_AS_ERROR_NOT_RUNNING - Storage stack is not running.
 
595
   * CY_AS_ERROR_SUCCESS - Burst mode has been started.
 
596
 
 
597
   See Also
 
598
   * CyAsStorageReadWriteBurstStop
 
599
 */
 
600
cy_as_return_status_t
 
601
cy_as_mtp_storage_only_start(
 
602
        /* Handle to the West Bridge device. */
 
603
        cy_as_device_handle handle
 
604
        );
 
605
 
 
606
/* Summary
 
607
   This function is used to mark the end of a storage read/write
 
608
   burst from the P port processor.
 
609
 
 
610
   Description
 
611
   This function is used to mark the end of a storage read/write
 
612
   burst from the processor.  At this point, USB access to the
 
613
   mass storage / MTP endpoints on the West Bridge device will be
 
614
   re-enabled.
 
615
 
 
616
   * Valid in Asynchronous Callback: NO
 
617
 
 
618
   Returns
 
619
   * CY_AS_ERROR_INVALID_HANDLE - Invalid West Bridge device handle
 
620
   *    was passed in.
 
621
   * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been
 
622
   *    configured.
 
623
   * CY_AS_ERROR_NO_FIRMWARE - Firmware is not active on West Bridge
 
624
   *    device.
 
625
   * CY_AS_ERROR_NOT_RUNNING - Storage stack is not running.
 
626
   * CY_AS_ERROR_INVALID_IN_CALLBACK - This API cannot be called
 
627
   *    from a callback.
 
628
   * CY_AS_ERROR_OUT_OF_MEMORY - Failed to allocate memory to
 
629
   *    process the request.
 
630
   * CY_AS_ERROR_TIMEOUT - Failed to send request to firmware.
 
631
   * CY_AS_ERROR_SUCCESS - Burst mode has been stopped.
 
632
 
 
633
   See Also
 
634
   * CyAsStorageReadWriteBurstStart
 
635
 */
 
636
cy_as_return_status_t
 
637
cy_as_mtp_storage_only_stop(
 
638
        /* Handle to the West Bridge device. */
 
639
        cy_as_device_handle handle,
 
640
        cy_as_function_callback cb,
 
641
        uint32_t client
 
642
        );
 
643
 
 
644
#include "cyas_cplus_end.h"
 
645
 
 
646
#endif