code update
[adaptation/devices/nfc-plugin-nxp.git] / src / phHciNfc_RFReaderB.h
1 /*\r
2  * Copyright (C) 2010 NXP Semiconductors\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 /*!\r
18 * =========================================================================== *\r
19 *                                                                             *\r
20 *                                                                             *\r
21 * \file  phHciNfc_RFReaderB.h                                                 *\r
22 * \brief HCI Reader B Management Routines.                                    *\r
23 *                                                                             *\r
24 *                                                                             *\r
25 * Project: NFC-FRI-1.1                                                        *\r
26 *                                                                             *\r
27 * $Date: Fri Aug 14 17:01:26 2009 $                                           *\r
28 * $Author: ing04880 $                                                         *\r
29 * $Revision: 1.5 $                                                            *\r
30 * $Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $                                                                *\r
31 *                                                                             *\r
32 * =========================================================================== *\r
33 */\r
34 \r
35 #ifndef PHHCINFC_RFREADERB_H\r
36 #define PHHCINFC_RFREADERB_H\r
37 \r
38 /*@}*/\r
39 \r
40 \r
41 /**\r
42 *  \name HCI\r
43 *\r
44 * File: \ref phHciNfc_ReaderB.h\r
45 *\r
46 */\r
47 /*@{*/\r
48 #define PHHCINFC_RFREADERB_FILEREVISION "$Revision: 1.5 $" /**< \ingroup grp_file_attributes */\r
49 #define PHHCINFC_RFREADERB_FILEALIASES  "$Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $"   /**< \ingroup grp_file_attributes */\r
50 /*@}*/\r
51 \r
52 /*\r
53 ***************************** Header File Inclusion ****************************\r
54 */\r
55 \r
56 #include <phHciNfc_Generic.h>\r
57 \r
58 /*\r
59 ****************************** Macro Definitions *******************************\r
60 */\r
61 \r
62 /* Enable the reader B */\r
63 #define HCI_READER_B_ENABLE                 0x01U\r
64 #define HCI_READER_B_INFO_SEQ               0x02U\r
65 \r
66 /*\r
67 ******************** Enumeration and Structure Definition **********************\r
68 */\r
69 typedef enum phHciNfc_ReaderB_Seq{\r
70     RDR_B_PUPI,\r
71     RDR_B_APP_DATA,\r
72     RDR_B_AFI,\r
73     RDR_B_HIGHER_LAYER_RESP,\r
74     RDR_B_HIGHER_LAYER_DATA,\r
75     RDR_B_END_SEQUENCE,\r
76     RDR_B_INVALID_SEQ\r
77 } phHciNfc_ReaderB_Seq_t;\r
78 \r
79 /* Information structure for the reader B Gate */\r
80 typedef struct phHciNfc_ReaderB_Info{\r
81     /* Current running Sequence of the reader B Management */\r
82     phHciNfc_ReaderB_Seq_t          current_seq;\r
83     /* Next running Sequence of the reader B Management */\r
84     phHciNfc_ReaderB_Seq_t          next_seq;\r
85     /* Pointer to the reader B pipe information */\r
86     phHciNfc_Pipe_Info_t            *p_pipe_info;\r
87     uint8_t                         pipe_id;\r
88     /* Flag to say about the multiple targets */\r
89     uint8_t                         multiple_tgts_found;\r
90     /* Reader B information */\r
91     phHal_sRemoteDevInformation_t   reader_b_info;\r
92     /* Enable or disable reader gate */\r
93     uint8_t                         enable_rdr_b_gate;\r
94     /* UICC re-activation status */\r
95     uint8_t                         uicc_activation;\r
96 } phHciNfc_ReaderB_Info_t;\r
97 \r
98 /*\r
99 *********************** Function Prototype Declaration *************************\r
100 */\r
101 \r
102 /*!\r
103 * \brief Allocates the resources of reader B management gate.\r
104 *\r
105 * This function Allocates the resources of the reader B management\r
106 * gate Information Structure.\r
107\r
108 */\r
109 extern\r
110 NFCSTATUS\r
111 phHciNfc_ReaderB_Init_Resources(\r
112                                 phHciNfc_sContext_t     *psHciContext\r
113                                 );\r
114 \r
115 /**\r
116 * \ingroup grp_hci_nfc\r
117 *\r
118 *   The phHciNfc_ReaderB_Get_PipeID function gives the pipe id of the reader B \r
119 *   gate\r
120 *\r
121 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
122 *                                       context Structure.\r
123 *   \param[in]  pHwRef                  pHwRef is the Information of\r
124 *                                       the Device Interface Link\r
125 *\r
126 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
127 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
128 *                                       could not be interpreted properly.\r
129 *\r
130 */\r
131 extern\r
132 NFCSTATUS\r
133 phHciNfc_ReaderB_Get_PipeID(\r
134                             phHciNfc_sContext_t     *psHciContext,\r
135                             uint8_t                 *ppipe_id\r
136                             );\r
137 \r
138 \r
139 /**\r
140 * \ingroup grp_hci_nfc\r
141 *\r
142 *  The phHciNfc_ReaderB_Update_PipeInfo function updates the pipe_id of the reader B\r
143 *  gate management Structure.\r
144 *\r
145 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
146 *                                      context Structure.\r
147 *  \param[in]  pipeID                  pipeID of the reader B gate\r
148 *  \param[in]  pPipeInfo               Update the pipe Information of the reader \r
149 *                                      A gate\r
150 *\r
151 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
152 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
153 *                                      could not be interpreted properly.\r
154 *\r
155 */\r
156 \r
157 extern\r
158 NFCSTATUS\r
159 phHciNfc_ReaderB_Update_PipeInfo(\r
160                                  phHciNfc_sContext_t     *psHciContext,\r
161                                  uint8_t                 pipeID,\r
162                                  phHciNfc_Pipe_Info_t    *pPipeInfo\r
163                                  );\r
164 \r
165 /**\r
166 * \ingroup grp_hci_nfc\r
167 *\r
168 *   The phHciNfc_ReaderB_Info_Sequence function executes the sequence of operations, to\r
169 *   get the PUPI, AFI, APPLICATION_DATA  etc.\r
170 *\r
171 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
172 *                                       context Structure.\r
173 *   \param[in]  pHwRef                  pHwRef is the Information of\r
174 *                                       the Device Interface Link\r
175 *\r
176 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
177 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
178 *                                       could not be interpreted properly.\r
179 *\r
180 */\r
181 extern\r
182 NFCSTATUS\r
183 phHciNfc_ReaderB_Info_Sequence (\r
184                                 void             *psHciHandle,\r
185                                 void             *pHwRef\r
186                                 );\r
187 \r
188 /**\r
189 * \ingroup grp_hci_nfc\r
190 *\r
191 *   The phHciNfc_ReaderB_Update_Info function updates the reader B information.\r
192 *\r
193 *   \param[in]  psHciContext     psHciContext is the pointer to HCI Layer\r
194 *                                context Structure.\r
195 *   \param[in]  infotype         To enable the reader B gate\r
196 *   \param[in]  rdr_b_info       reader B gate info\r
197 *\r
198 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
199 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
200 *                                       could not be interpreted properly.\r
201 *\r
202 */\r
203 extern \r
204 NFCSTATUS\r
205 phHciNfc_ReaderB_Update_Info(\r
206                              phHciNfc_sContext_t        *psHciContext,\r
207                              uint8_t                    infotype,\r
208                              void                       *rdr_b_info\r
209                              );\r
210 \r
211 /**\r
212 * \ingroup grp_hci_nfc\r
213 *\r
214 *   The phHciNfc_ReaderB_Set_LayerData function updates higher layer data\r
215 *   registry\r
216 *\r
217 *   \param[in]  psContext        psContext is the pointer to HCI Layer\r
218 *                                context Structure.\r
219 *   \param[in]  pHwRef           pHwRef is the Information of\r
220 *                                the Device Interface Link\r
221 *   \param[in]  layer_data_info  layer data information\r
222 *\r
223 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
224 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
225 *                                       could not be interpreted properly.\r
226 *\r
227 */\r
228 extern \r
229 NFCSTATUS\r
230 phHciNfc_ReaderB_Set_LayerData(\r
231                         void            *psContext,\r
232                         void            *pHwRef,\r
233                         phNfc_sData_t   *layer_data_info\r
234                         );\r
235 \r
236 /**\r
237 * \ingroup grp_hci_nfc\r
238 *\r
239 *   The phHciNfc_ReaderB_Set_AFI function updates application family \r
240 *   identifier registry\r
241 *\r
242 *   \param[in]  psContext        psContext is the pointer to HCI Layer\r
243 *                                context Structure.\r
244 *   \param[in]  pHwRef           pHwRef is the Information of\r
245 *                                the Device Interface Link\r
246 *   \param[in]  afi_value        to afi value update\r
247 *\r
248 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
249 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
250 *                                       could not be interpreted properly.\r
251 *\r
252 */\r
253 extern \r
254 NFCSTATUS\r
255 phHciNfc_ReaderB_Set_AFI(\r
256                         void         *psContext,\r
257                         void         *pHwRef,\r
258                         uint8_t      afi_value\r
259                         );\r
260 #endif /* #ifndef PHHCINFC_RFREADERB_H */\r
261 \r
262 \r