merge with master
[adaptation/devices/nfc-plugin-nxp.git] / src / phHciNfc_Pipe.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_Pipe.h                                                      *\r
22 * \brief HCI Header for the Pipe Management.                                  *\r
23 *                                                                             *\r
24 *                                                                             *\r
25 * Project: NFC-FRI-1.1                                                        *\r
26 *                                                                             *\r
27 * $Date: Fri Aug 14 17:01:27 2009 $                                           *\r
28 * $Author: ing04880 $                                                         *\r
29 * $Revision: 1.17 $                                                            *\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 /*@{*/\r
36 \r
37 #ifndef PHHCINFC_PIPE_H\r
38 #define PHHCINFC_PIPE_H\r
39 \r
40 /*@}*/\r
41 \r
42 \r
43 /**\r
44  *  \name HCI\r
45  *\r
46  * File: \ref phHciNfc_Pipe.h\r
47  *\r
48  */\r
49 /*@{*/\r
50 #define PHHCINFC_PIPE_FILEREVISION "$Revision: 1.17 $" /**< \ingroup grp_file_attributes */\r
51 #define PHHCINFC_PIPE_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
52 /*@}*/\r
53 \r
54 /*\r
55 ***************************** Header File Inclusion ****************************\r
56 */\r
57 \r
58 #include <phHciNfc.h>\r
59 #include <phHciNfc_Generic.h>\r
60 \r
61 /*\r
62 ****************************** Macro Definitions *******************************\r
63 */\r
64 \r
65 #define PIPEINFO_SIZE               0x04U\r
66 #define PIPEID_LEN                  0x01U\r
67 \r
68 #define RESPONSE_GATEID_OFFSET      0x03U\r
69 #define RESPONSE_PIPEID_OFFSET      0x04U\r
70 \r
71 \r
72 #define PIPETYPE_STATIC_LINK        0x00U\r
73 #define PIPETYPE_STATIC_ADMIN       0x01U\r
74 #define PIPETYPE_DYNAMIC            0x02U\r
75 \r
76 /*\r
77 ******************** Enumeration and Structure Definition **********************\r
78 */\r
79 \r
80 typedef enum phHciNfc_PipeMgmt_Seq{\r
81     /* Pipe for Identitiy Management   */\r
82     PIPE_IDMGMT_CREATE      = 0x00U,\r
83     /* Pipe for Configuring PN544 Nfc Device  */\r
84     PIPE_PN544MGMT_CREATE,\r
85     /* Pipe for Configuring Polling Wheel  */\r
86     PIPE_POLLINGLOOP_CREATE,\r
87     /* Pipes for Configuring the RF Readers  */\r
88     PIPE_READER_A_CREATE,\r
89     PIPE_READER_B_CREATE,\r
90     PIPE_READER_F_CREATE,\r
91     PIPE_READER_JWL_CREATE,\r
92     PIPE_READER_ISO15693_CREATE,\r
93     /* Pipes for configuring the Card Emulation  */\r
94     PIPE_CARD_A_CREATE,\r
95     PIPE_CARD_A_DELETE,\r
96     PIPE_CARD_B_CREATE,\r
97     PIPE_CARD_B_DELETE,\r
98     PIPE_CARD_F_CREATE,\r
99     PIPE_CARD_F_DELETE,\r
100     /* Pipes for Peer to Peer Communication  */\r
101     PIPE_NFC_INITIATOR_CREATE,\r
102     PIPE_NFC_TARGET_CREATE,\r
103     /* Secure Element Commands */\r
104     PIPE_WI_CREATE,\r
105     PIPE_SWP_CREATE,\r
106     /* Connectiviy Gate Pipe */\r
107     PIPE_CONNECTIVITY,\r
108 \r
109     /* Clearing all the created Pipes  */\r
110     PIPE_DELETE_ALL,\r
111     PIPE_MGMT_END\r
112 } phHciNfc_PipeMgmt_Seq_t;\r
113 \r
114 /** \defgroup grp_hci_nfc HCI Component\r
115  *\r
116  *\r
117  */\r
118 \r
119 /*\r
120 *********************** Function Prototype Declaration *************************\r
121 */\r
122 \r
123 /*!\r
124  * \brief Creates the Pipes of all the Supported Gates .\r
125  *\r
126  * This function Creates the pipes for all the supported gates \r
127  */\r
128 \r
129 extern\r
130 NFCSTATUS\r
131 phHciNfc_Create_All_Pipes(\r
132                                 phHciNfc_sContext_t          *psHciContext,\r
133                                 void                         *pHwRef,\r
134                                 phHciNfc_PipeMgmt_Seq_t      *p_pipe_seq\r
135                           );\r
136 \r
137 /*!\r
138  * \brief Deletes the Pipes of all the Supported Gates .\r
139  *\r
140  * This function Deletes the pipes for all the supported gates \r
141  */\r
142 extern\r
143 NFCSTATUS\r
144 phHciNfc_Delete_All_Pipes(\r
145                                 phHciNfc_sContext_t             *psHciContext,\r
146                                 void                            *pHwRef,\r
147                                 phHciNfc_PipeMgmt_Seq_t         pipeSeq\r
148                           );\r
149 \r
150 /*!\r
151  * \brief Updates the Information of Pipes of all the Supported Gates .\r
152  *\r
153  * This function Updates the pipe information for all the supported gates \r
154  */\r
155 \r
156 extern\r
157 NFCSTATUS\r
158 phHciNfc_Update_PipeInfo(\r
159                                 phHciNfc_sContext_t             *psHciContext,\r
160                                 phHciNfc_PipeMgmt_Seq_t         *pPipeSeq,\r
161                                 uint8_t                         pipe_id,\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_Open_Pipe function opens\r
169  *  .\r
170  *\r
171  *  \param[in]  psContext               psContext is pointer to the context\r
172  *                                      Structure of the HCI Layer.\r
173  *  \param[in]  pHwRef                  pHwRef is the Information of\r
174  *                                      the Device Interface Link .\r
175  *  \param[in]  pPipeHandle             pPipeHandle is the handle used to open\r
176  *                                      the Static or Dynamically Created Pipe.\r
177  *\r
178  *  \retval NFCSTATUS_PENDING           Pipe Open is pending.\r
179  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
180  *                                      could not be interpreted properly.\r
181  *  \retval Other errors                Errors related to the lower layers\r
182  *\r
183  */\r
184 \r
185  extern\r
186  NFCSTATUS\r
187  phHciNfc_Open_Pipe (\r
188                         phHciNfc_sContext_t     *psContext,\r
189                         void                    *pHwRef,\r
190                         phHciNfc_Pipe_Info_t    *pPipeHandle\r
191                         );\r
192 \r
193 /**\r
194  * \ingroup grp_hci_nfc\r
195  *\r
196  *  The phHciNfc_Close_Pipe function closes\r
197  *  .\r
198  *\r
199  *  \param[in]  psContext               psContext is pointer to the context\r
200  *                                      Structure of the HCI Layer.\r
201  *  \param[in]  pHwRef                  pHwRef is the Information of\r
202  *                                      the Device Interface Link .\r
203  *  \param[in]  pPipeHandle             pPipeHandle is the handle used to closes\r
204  *                                      the Static or Dynamically Created Pipe.\r
205  *\r
206  *  \retval NFCSTATUS_PENDING           Pipe close is pending.\r
207  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
208  *                                      could not be interpreted properly.\r
209  *  \retval Other errors                Errors related to the lower layers\r
210  *\r
211  */\r
212 \r
213  extern\r
214  NFCSTATUS\r
215  phHciNfc_Close_Pipe (\r
216                         phHciNfc_sContext_t     *psContext,\r
217                         void                    *pHwRef,\r
218                         phHciNfc_Pipe_Info_t    *pPipeHandle\r
219                         );\r
220 \r
221 /**\r
222  * \ingroup grp_hci_nfc\r
223  *\r
224  *  The phHciNfc_Delete_Pipe function deletes the dynamically created pipe\r
225  *  using the supplied pipe handle.\r
226  *\r
227  *  \param[in]  psContext               psContext is pointer to the context\r
228  *                                      Structure of the HCI Layer.\r
229  *  \param[in]  pHwRef                  pHwRef is the Information of\r
230  *                                      the Device Interface Link .\r
231  *  \param[in]  pPipeHandle             pPipeHandle is the handle used to delete\r
232  *                                      the Dynamically Created Pipe.\r
233  *\r
234  *  \retval NFCSTATUS_PENDING           Pipe Deletion is pending.\r
235  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
236  *                                      could not be interpreted properly.\r
237  *\r
238  */\r
239 \r
240 extern\r
241 NFCSTATUS\r
242 phHciNfc_Delete_Pipe(\r
243                         phHciNfc_sContext_t     *psHciContext,\r
244                         void                    *pHwRef,\r
245                         phHciNfc_Pipe_Info_t    *pPipeHandle\r
246                     );\r
247 \r
248 /*!\r
249  * \brief Creates and Update the Pipes during the Session\r
250  *\r
251  * This function Creates and Update the Pipes of all the Supported Gates \r
252  * for the already initialised session.\r
253  */\r
254 \r
255 extern\r
256 NFCSTATUS\r
257 phHciNfc_Update_Pipe(\r
258                         phHciNfc_sContext_t     *psHciContext,\r
259                         void                    *pHwRef,\r
260                         phHciNfc_PipeMgmt_Seq_t *p_pipe_seq\r
261                     );\r
262 \r
263 \r
264 extern\r
265 NFCSTATUS\r
266 phHciNfc_CE_Pipes_OP(\r
267                             phHciNfc_sContext_t             *psHciContext,\r
268                             void                            *pHwRef,\r
269                             phHciNfc_PipeMgmt_Seq_t         *p_pipe_seq\r
270                      );\r
271 \r
272 #endif\r
273 \r