1 | /* |
2 | Copyright (c) 2012, Broadcom Europe Ltd |
3 | All rights reserved. |
4 | |
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the following conditions are met: |
7 | * Redistributions of source code must retain the above copyright |
8 | notice, this list of conditions and the following disclaimer. |
9 | * Redistributions in binary form must reproduce the above copyright |
10 | notice, this list of conditions and the following disclaimer in the |
11 | documentation and/or other materials provided with the distribution. |
12 | * Neither the name of the copyright holder nor the |
13 | names of its contributors may be used to endorse or promote products |
14 | derived from this software without specific prior written permission. |
15 | |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ |
27 | |
28 | #ifndef VC_VCHI_FILESERVICE_DEFS_H |
29 | #define VC_VCHI_FILESERVICE_DEFS_H |
30 | |
31 | #include "interface/vchi/vchi.h" |
32 | |
33 | /* Definitions (not used by API) */ |
34 | |
35 | /* structure used by both side to communicate */ |
36 | #define FILESERV_MAX_BULK_SECTOR 128 //must be power of two |
37 | |
38 | #define FILESERV_SECTOR_LENGTH 512 |
39 | |
40 | #define FILESERV_MAX_BULK (FILESERV_MAX_BULK_SECTOR*FILESERV_SECTOR_LENGTH) |
41 | |
42 | #define FILESERV_4CC MAKE_FOURCC("FSRV") |
43 | |
44 | typedef enum FILESERV_EVENT_T |
45 | { |
46 | FILESERV_BULK_RX = 0, |
47 | FILESERV_BULK_TX, |
48 | FILESERV_BULK_RX_0, |
49 | FILESERV_BULK_RX_1 |
50 | }FILESERV_EVENT_T; |
51 | //this following structure has to equal VCHI_MAX_MSG_SIZE |
52 | #define FILESERV_MAX_DATA (VCHI_MAX_MSG_SIZE - 40) //(VCHI_MAX_MSG_SIZE - 24) |
53 | |
54 | typedef struct{ |
55 | uint32_t xid; //4 // transaction's ID, used to match cmds with response |
56 | uint32_t cmd_code; //4 |
57 | uint32_t params[4]; //16 |
58 | char data[FILESERV_MAX_DATA]; |
59 | }FILESERV_MSG_T; |
60 | |
61 | typedef enum |
62 | { |
63 | FILESERV_RESP_OK, |
64 | FILESERV_RESP_ERROR, |
65 | FILESERV_BULK_READ, |
66 | FILESERV_BULK_WRITE, |
67 | |
68 | } FILESERV_RESP_CODE_T; |
69 | |
70 | |
71 | /* Protocol (not used by API) version 1.2 */ |
72 | |
73 | |
74 | |
75 | #endif |
76 | |