1 /******************************************************************************
2  *
3  *  Copyright (C) 2003-2014 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  This is the interface file for non valtile memory call-in functions.
22  *
23  ******************************************************************************/
24 #ifndef NFA_NV_CI_H
25 #define NFA_NV_CI_H
26 
27 #include "nfa_nv_co.h"
28 
29 /*****************************************************************************
30 **  Constants and data types
31 *****************************************************************************/
32 
33 /* Read Ready Event */
34 typedef struct {
35   NFC_HDR hdr;
36   tNFA_NV_CO_STATUS status;
37   int fd;
38   uint16_t num_read;
39 } tNFA_NV_CI_READ_EVT;
40 
41 /* Write Ready Event */
42 typedef struct {
43   NFC_HDR hdr;
44   tNFA_NV_CO_STATUS status;
45   int fd;
46 } tNFA_NV_CI_WRITE_EVT;
47 
48 /*****************************************************************************
49 **  Function Declarations
50 *****************************************************************************/
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*******************************************************************************
56 **
57 ** Function         nfa_nv_ci_write
58 **
59 ** Description      This function sends an event to NFAA indicating the phone
60 **                  has written the number of bytes specified in the call-out
61 **                  function, nfa_nv_co_write (), and is ready for more data.
62 **                  This function is used to control the TX data flow.
63 **                  Note: The data buffer is released by the stack aioer
64 **                        calling this function.
65 **
66 ** Parameters       status - NFA_NV_CO_OK, NFA_NV_CO_NOSPACE, or NFA_NV_CO_FAIL
67 **                  evt - Used Internally by NFA -> MUST be same value passed
68 **                       in call-out function.
69 **
70 ** Returns          void
71 **
72 *******************************************************************************/
73 extern void nfa_nv_ci_write(tNFA_NV_CO_STATUS status);
74 
75 /*******************************************************************************
76 **
77 ** Function         nfa_nv_ci_read
78 **
79 ** Description      This function sends an event to NFA indicating the phone has
80 **                  read in the requested amount of data specified in the
81 **                  nfa_nv_co_read () call-out function.  It should only be
82 **                  called when the requested number of bytes has been read.
83 **
84 ** Parameters       num_bytes_read - number of bytes read into the buffer
85 **                      specified in the read callout-function.
86 **                  status - NFA_NV_CO_OK if full buffer of data,
87 **                           NFA_NV_CO_EOF if the end of file has been reached,
88 **                           NFA_NV_CO_FAIL if an error has occurred.
89 **                  evt - Used Internally by NFA -> MUST be same value passed
90 **                       in call-out function.
91 **
92 ** Returns          void
93 **
94 *******************************************************************************/
95 extern void nfa_nv_ci_read(uint16_t num_bytes_read, tNFA_NV_CO_STATUS status,
96                            uint8_t block);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* BTA_FS_CI_H */
103