1 /*
2  * Copyright (C) 2010 NXP Semiconductors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*!
18 * =========================================================================== *
19 *                                                                             *
20 *                                                                             *
21 * \file  phHciNfc_NfcIPMgmt.h                                                 *
22 * \brief HCI NFCIP-1 Management Routines.                                    *
23 *                                                                             *
24 *                                                                             *
25 * Project: NFC-FRI-1.1                                                        *
26 *                                                                             *
27 * $Date: Thu Jun 11 18:45:00 2009 $                                           *
28 * $Author: ing02260 $                                                         *
29 * $Revision: 1.14 $                                                            *
30 * $Aliases: NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,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 $                                                                *
31 *                                                                             *
32 * =========================================================================== *
33 */
34 
35 #ifndef PHHCINFC_NFCIPMGMT_H
36 #define PHHCINFC_NFCIPMGMT_H
37 
38 /*@}*/
39 
40 
41 /**
42 *  \name HCI
43 *
44 * File: \ref phHciNfc_NfcIPMgmt.h
45 *
46 */
47 /*@{*/
48 #define PHHCINFC_NFCIP1MGMT_FILEREVISION "$Revision: 1.14 $" /**< \ingroup grp_file_attributes */
49 #define PHHCINFC_NFCIP1MGMT_FILEALIASES  "$Aliases: NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,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 */
50 /*@}*/
51 
52 /*
53 ***************************** Header File Inclusion ****************************
54 */
55 
56 #include <phHciNfc_Generic.h>
57 
58 /*
59 ****************************** Macro Definitions *******************************
60 */
61 
62 /* Commands exposed to the upper layer */
63 
64 
65 /*
66 ******************** Enumeration and Structure Definition **********************
67 */
68 /* LENGTH definition */
69 #define NFCIP_ATR_MAX_LENGTH                PHHAL_MAX_ATR_LENGTH
70 #define NFCIP_NFCID_LENGTH                  PHHAL_MAX_UID_LENGTH
71 #define NFCIP_MAX_DEP_REQ_HDR_LEN           0x05
72 
73 typedef enum phHciNfc_eNfcIPType{
74     NFCIP_INVALID                        = 0x00U,
75     NFCIP_INITIATOR,
76     NFCIP_TARGET
77 }phHciNfc_eNfcIPType_t;
78 
79 typedef enum phHciNfc_NfcIP_Seq{
80     NFCIP_INVALID_SEQUENCE              = 0x00U,
81     NFCIP_ATR_INFO,
82     NFCIP_STATUS,
83     NFCIP_NFCID3I,
84     NFCIP_NFCID3T,
85     NFCIP_PARAM,
86     NFCIP_END_SEQUENCE
87 } phHciNfc_NfcIP_Seq_t;
88 
89 typedef enum phHciNfc_eP2PSpeed{
90     NFCIP_SPEED_106                         = 0x00U,
91     NFCIP_SPEED_212,
92     NFCIP_SPEED_424,
93     NFCIP_SPEED_848,
94     NFCIP_SPEED_1696,
95     NFCIP_SPEED_3392,
96     NFCIP_SPEED_6784,
97     NFCIP_SPEED_RFU
98 }phHciNfc_eP2PSpeed_t;
99 
100 typedef enum phHciNfc_eNfcIPMode{
101     NFCIP_MODE_PAS_106                         = 0x01U,
102     NFCIP_MODE_PAS_212                         = 0x02U,
103     NFCIP_MODE_PAS_424                         = 0x04U,
104     NFCIP_MODE_ACT_106                         = 0x08U,
105     NFCIP_MODE_ACT_212                         = 0x10U,
106     NFCIP_MODE_ACT_424                         = 0x20U,
107     NFCIP_MODE_ALL                             = 0x3FU
108 }phHciNfc_eNfcIPMode_t;
109 
110 typedef struct phHciNfc_NfcIP_Info
111 {
112     phHciNfc_NfcIP_Seq_t            current_seq;
113     phHciNfc_NfcIP_Seq_t            next_seq;
114     phHciNfc_eNfcIPType_t           nfcip_type;
115     phHciNfc_Pipe_Info_t            *p_init_pipe_info;
116     phHciNfc_Pipe_Info_t            *p_tgt_pipe_info;
117     phHal_sRemoteDevInformation_t   rem_nfcip_tgt_info;
118     /* ATR_RES = General bytes length, Max length = 48 bytes for
119         host = target */
120     uint8_t                         atr_res_info[NFCIP_ATR_MAX_LENGTH];
121     uint8_t                         atr_res_length;
122     /* ATR_REQ = General bytes length, Max length = 48 bytes for
123         host = initiator */
124     uint8_t                         atr_req_info[NFCIP_ATR_MAX_LENGTH];
125     uint8_t                         atr_req_length;
126     /* Contains the current status of the NFCIP-1 link
127         when communication has been set.
128             0x00 -> data is expected from the host
129             0x01 -> data is expected from the RF side */
130     uint8_t                         linkstatus;
131     /* Contains the random NFCID3I conveyed with the ATR_REQ.
132         always 10 bytes length */
133     uint8_t                         nfcid3i_length;
134     uint8_t                         nfcid3i[NFCIP_NFCID_LENGTH];
135     /* Contains the random NFCID3T conveyed with the ATR_RES.
136         always 10 bytes length */
137     uint8_t                         nfcid3t_length;
138     uint8_t                         nfcid3t[NFCIP_NFCID_LENGTH];
139     /* Contains the current parameters of the NFCIP-1 link when
140     communication has been set.
141         - bits 0 to 2: data rate target to initiator
142         - bits 3 to 5: data rate initiator to target
143             0 -> Divisor equal to 1
144             1 -> Divisor equal to 2
145             2 -> Divisor equal to 4
146             3 -> Divisor equal to 8
147             4 -> Divisor equal to 16
148             5 -> Divisor equal to 32
149             6 -> Divisor equal to 64
150             7 -> RFU
151             - bits 6 to 7: maximum frame length
152             0 -> 64 bytes
153             1 -> 128 bytes
154             2 -> 192 bytes
155             3 -> 256 bytes  */
156     phHciNfc_eP2PSpeed_t            initiator_speed;
157     phHciNfc_eP2PSpeed_t            target_speed;
158     uint16_t                        max_frame_len;
159     /* Supported modes */
160     uint8_t                         nfcip_mode;
161     uint8_t                         psl1;
162     uint8_t                         psl2;
163     uint8_t                         nad;
164     uint8_t                         did;
165     uint8_t                         options;
166     uint8_t                         activation_mode;
167 }phHciNfc_NfcIP_Info_t;
168 
169 
170 /*
171 *********************** Function Prototype Declaration *************************
172 */
173 /*!
174 * \brief Allocates the resources of NFCIP-1 initiator management gate.
175 *
176 * This function Allocates the resources of the NFCIP-1 initiator management
177 * gate Information Structure.
178 *
179 */
180 extern
181 NFCSTATUS
182 phHciNfc_Initiator_Init_Resources(
183                                   phHciNfc_sContext_t     *psHciContext
184                                   );
185 
186 /**
187 * \ingroup grp_hci_nfc
188 *
189 *   The phHciNfc_Initiator_Get_PipeID function gives the pipe id of the NFCIP-1
190 *   initiator gate
191 *
192 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
193 *                                       context Structure.
194 *   \param[in]  pHwRef                  pHwRef is the Information of
195 *                                       the Device Interface Link
196 *
197 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
198 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
199 *                                       could not be interpreted properly.
200 *
201 */
202 extern
203 NFCSTATUS
204 phHciNfc_Initiator_Get_PipeID(
205                               phHciNfc_sContext_t     *psHciContext,
206                               uint8_t                 *ppipe_id
207                               );
208 
209 /**
210 * \ingroup grp_hci_nfc
211 *
212 *  The phHciNfc_Initiator_Update_PipeInfo function updates the pipe_id of the NFCIP-1
213 *  initiator gate management Structure.
214 *
215 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
216 *                                      context Structure.
217 *  \param[in]  pipeID                  pipeID of the NFCIP-1 initiator gate
218 *  \param[in]  pPipeInfo               Update the pipe Information of the NFCIP-1
219 *                                      initiator gate
220 *
221 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
222 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
223 *                                      could not be interpreted properly.
224 *
225 */
226 
227 extern
228 NFCSTATUS
229 phHciNfc_Initiator_Update_PipeInfo(
230                                    phHciNfc_sContext_t     *psHciContext,
231                                    uint8_t                 pipeID,
232                                    phHciNfc_Pipe_Info_t    *pPipeInfo
233                                    );
234 
235 /**
236 * \ingroup grp_hci_nfc
237 *
238 *   The phHciNfc_Send_Initiator_Command function executes the command sent by the
239 *   upper layer, depending on the commands defined.
240 *
241 *   \param[in]  psContext        psContext is the pointer to HCI Layer
242 *                                context Structure.
243 *   \param[in]  pHwRef           pHwRef is the Information of
244 *                                the Device Interface Link
245 *
246 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
247 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
248 *                                       could not be interpreted properly.
249 *
250 */
251 extern
252 NFCSTATUS
253 phHciNfc_NfcIP_Presence_Check(
254                                 phHciNfc_sContext_t   *psContext,
255                                 void                  *pHwRef
256                                 );
257 
258 /*!
259 * \brief Allocates the resources of NFCIP-1 target management gate.
260 *
261 * This function Allocates the resources of the NFCIP-1 target management
262 * gate Information Structure.
263 *
264 */
265 extern
266 NFCSTATUS
267 phHciNfc_Target_Init_Resources(
268                                phHciNfc_sContext_t     *psHciContext
269                                );
270 
271 /**
272 * \ingroup grp_hci_nfc
273 *
274 *   The phHciNfc_Target_Get_PipeID function gives the pipe id of the NFCIP-1
275 *   target gate
276 *
277 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
278 *                                       context Structure.
279 *   \param[in]  pHwRef                  pHwRef is the Information of
280 *                                       the Device Interface Link
281 *
282 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
283 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
284 *                                       could not be interpreted properly.
285 *
286 */
287 extern
288 NFCSTATUS
289 phHciNfc_Target_Get_PipeID(
290                            phHciNfc_sContext_t     *psHciContext,
291                            uint8_t                 *ppipe_id
292                            );
293 
294 /**
295 * \ingroup grp_hci_nfc
296 *
297 *  The phHciNfc_Target_Update_PipeInfo function updates the pipe_id of the NFCIP-1
298 *  target gate management Structure.
299 *
300 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
301 *                                      context Structure.
302 *  \param[in]  pipeID                  pipeID of the NFCIP-1 target gate
303 *  \param[in]  pPipeInfo               Update the pipe Information of the NFCIP-1
304 *                                      target gate
305 *
306 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
307 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
308 *                                      could not be interpreted properly.
309 *
310 */
311 
312 extern
313 NFCSTATUS
314 phHciNfc_Target_Update_PipeInfo(
315                                 phHciNfc_sContext_t     *psHciContext,
316                                 uint8_t                 pipeID,
317                                 phHciNfc_Pipe_Info_t    *pPipeInfo
318                                 );
319 
320 /**
321 * \ingroup grp_hci_nfc
322 *
323 *   The phHciNfc_NfcIP_Info_Sequence function executes the sequence of operations, to
324 *   get ATR_RES, NFCID3I, NFCID3T, PARAMS  etc.
325 *
326 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
327 *                                       context Structure.
328 *   \param[in]  pHwRef                  pHwRef is the Information of
329 *                                       the Device Interface Link
330 *   \param[in]  notify_reqd             if TRUE continue till END_SEQUENCE, else
331 *                                       stop the sequence
332 *
333 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
334 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
335 *                                       could not be interpreted properly.
336 *
337 */
338 extern
339 NFCSTATUS
340 phHciNfc_NfcIP_Info_Sequence (
341                               phHciNfc_sContext_t   *psHciContext,
342                               void                  *pHwRef
343 #ifdef NOTIFY_REQD
344                               ,
345                               uint8_t               notify_reqd
346 #endif /* #ifdef NOTIFY_REQD */
347                               );
348 
349 /**
350 * \ingroup grp_hci_nfc
351 *
352 *   The phHciNfc_NfcIP_SetMode function sets the value for NFCIP-1 modes
353 *
354 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
355 *                                       context Structure.
356 *   \param[in]  pHwRef                  pHwRef is the Information of
357 *                                       the Device Interface Link
358 *   \param[in]  nfciptype               Specifies initiator or target
359 *   \param[in]  nfcip_mode              nfcip_mode is the supported mode
360 *                                       information
361 *
362 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
363 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
364 *                                       could not be interpreted properly.
365 *
366 */
367 extern
368 NFCSTATUS
369 phHciNfc_NfcIP_SetMode(
370                        phHciNfc_sContext_t      *psHciContext,
371                        void                     *pHwRef,
372                        phHciNfc_eNfcIPType_t    nfciptype,
373                        uint8_t                  nfcip_mode
374                        );
375 
376 /**
377 * \ingroup grp_hci_nfc
378 *
379 *   The phHciNfc_NfcIP_SetNAD function sets the NAD value
380 *
381 *   \param[in]  psHciContext            pContext is the pointer to HCI Layer
382 *                                       context Structure.
383 *   \param[in]  pHwRef                  pHwRef is the Information of
384 *                                       the Device Interface Link
385 *   \param[in]  nfciptype               Specifies initiator or target
386 *   \param[in]  nad                     Node address, this will be used as
387 *                                       logical address of the initiator (b4 to b7)
388 *
389 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
390 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
391 *                                       could not be interpreted properly.
392 *
393 */
394 extern
395 NFCSTATUS
396 phHciNfc_NfcIP_SetNAD(
397                       phHciNfc_sContext_t   *psHciContext,
398                       void                  *pHwRef,
399                       phHciNfc_eNfcIPType_t nfciptype,
400                       uint8_t               nad
401                       );
402 
403 /**
404 * \ingroup grp_hci_nfc
405 *
406 *   The phHciNfc_NfcIP_SetDID function sets the DID value for the initiator
407 *
408 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
409 *                                       context Structure.
410 *   \param[in]  pHwRef                  pHwRef is the Information of
411 *                                       the Device Interface Link
412 *   \param[in]  did                     Device ID
413 *
414 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
415 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
416 *                                       could not be interpreted properly.
417 *
418 */
419 extern
420 NFCSTATUS
421 phHciNfc_NfcIP_SetDID(
422                       phHciNfc_sContext_t   *psHciContext,
423                       void                  *pHwRef,
424                       uint8_t               did
425                       );
426 
427 /**
428 * \ingroup grp_hci_nfc
429 *
430 *   The phHciNfc_NfcIP_SetOptions function sets the different options depending on
431 *   the host type (initiator or target) like PSL, NAD and DID
432 *
433 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
434 *                                       context Structure.
435 *   \param[in]  pHwRef                  pHwRef is the Information of
436 *                                       the Device Interface Link
437 *   \param[in]  nfciptype               Specifies initiator or target
438 *   \param[in]  nfcip_options           specifies enabled options PSL, NAD and DID
439 *
440 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
441 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
442 *                                       could not be interpreted properly.
443 *
444 */
445 extern
446 NFCSTATUS
447 phHciNfc_NfcIP_SetOptions(
448                           phHciNfc_sContext_t       *psHciContext,
449                           void                      *pHwRef,
450                           phHciNfc_eNfcIPType_t     nfciptype,
451                           uint8_t                   nfcip_options
452                           );
453 
454 /**
455 * \ingroup grp_hci_nfc
456 *
457 *   The phHciNfc_NfcIP_SetATRInfo function sets the general byte information
458 *
459 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
460 *                                       context Structure.
461 *   \param[in]  pHwRef                  pHwRef is the Information of
462 *                                       the Device Interface Link
463 *   \param[in]  nfciptype               Specifies initiator or target
464 *   \param[in]  atr_info                contains the general bytes of the ATR_REQ
465 *                                       (initiator) or ATR_RES (target) (max size =
466 *                                       48 bytes)
467 *
468 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
469 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
470 *                                       could not be interpreted properly.
471 *
472 */
473 extern
474 NFCSTATUS
475 phHciNfc_NfcIP_SetATRInfo(
476                           phHciNfc_sContext_t       *psHciContext,
477                           void                      *pHwRef,
478                           phHciNfc_eNfcIPType_t     nfciptype,
479                           phHal_sNfcIPCfg_t         *atr_info
480                           );
481 
482 /**
483 * \ingroup grp_hci_nfc
484 *
485 *   The phHciNfc_NfcIP_SetPSL1 function sets the BRS byte of PSL_REQ
486 *
487 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
488 *                                       context Structure.
489 *   \param[in]  pHwRef                  pHwRef is the Information of
490 *                                       the Device Interface Link
491 *   \param[in]  psl1                    specifies the BRS byte of PSL_REQ
492 *
493 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
494 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
495 *                                       could not be interpreted properly.
496 *
497 */
498 extern
499 NFCSTATUS
500 phHciNfc_NfcIP_SetPSL1(
501                        phHciNfc_sContext_t   *psHciContext,
502                        void                  *pHwRef,
503                        uint8_t               psl1
504                           );
505 
506 /**
507 * \ingroup grp_hci_nfc
508 *
509 *   The phHciNfc_NfcIP_SetPSL2 function sets the BRS byte of PSL_REQ
510 *
511 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
512 *                                       context Structure.
513 *   \param[in]  pHwRef                  pHwRef is the Information of
514 *                                       the Device Interface Link
515 *   \param[in]  psl2                    specifies the FSL byte of PSL_REQ
516 *
517 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
518 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
519 *                                       could not be interpreted properly.
520 *
521 */
522 extern
523 NFCSTATUS
524 phHciNfc_NfcIP_SetPSL2(
525                        phHciNfc_sContext_t      *psHciContext,
526                        void                     *pHwRef,
527                        uint8_t                  psl2
528                           );
529 
530 /**
531 * \ingroup grp_hci_nfc
532 *
533 *   The phHciNfc_NfcIP_GetStatus function receives the present status of the
534 *   NFCIP-1 link, when communication has been set.
535 *   If 0x00 is the status, then it means data is expected from the host
536 *   If 0x01 is the status, then it means data is expected from the RF side
537 *   Other status values are error
538 *
539 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
540 *                                       context Structure.
541 *   \param[in]  pHwRef                  pHwRef is the Information of
542 *                                       the Device Interface Link
543 *   \param[in]  nfciptype               Specifies initiator or target
544 *
545 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
546 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
547 *                                       could not be interpreted properly.
548 *
549 */
550 extern
551 NFCSTATUS
552 phHciNfc_NfcIP_GetStatus(
553                             phHciNfc_sContext_t      *psHciContext,
554                             void                     *pHwRef,
555                             phHciNfc_eNfcIPType_t    nfciptype
556                           );
557 
558 /**
559 * \ingroup grp_hci_nfc
560 *
561 *   The phHciNfc_NfcIP_GetStatus function receives the current parameters of the
562 *   NFCIP-1 link, when communication has been set.
563 *       - bits 0 to 2: data rate target to initiator
564 *       - bits 3 to 5: data rate initiator to target
565 *           0 -> Divisor equal to 1
566 *           1 -> Divisor equal to 2
567 *           2 -> Divisor equal to 4
568 *           3 -> Divisor equal to 8
569 *           4 -> Divisor equal to 16
570 *           5 -> Divisor equal to 32
571 *           6 -> Divisor equal to 64
572 *           7 -> RFU
573 *       - bits 6 to 7: maximum frame length
574 *           0 -> 64 bytes
575 *           1 -> 128 bytes
576 *           2 -> 192 bytes
577 *           3 -> 256 bytes
578 *
579 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
580 *                                       context Structure.
581 *   \param[in]  pHwRef                  pHwRef is the Information of
582 *                                       the Device Interface Link
583 *   \param[in]  nfciptype               Specifies initiator or target
584 *
585 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
586 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
587 *                                       could not be interpreted properly.
588 *
589 */
590 extern
591 NFCSTATUS
592 phHciNfc_NfcIP_GetParam(
593                          phHciNfc_sContext_t    *psHciContext,
594                          void                   *pHwRef,
595                          phHciNfc_eNfcIPType_t  nfciptype
596                          );
597 
598 /**
599 * \ingroup grp_hci_nfc
600 *
601 *   The phHciNfc_NfcIP_Send_Data function sends data using the SEND_DATA event
602 *
603 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
604 *                                       context Structure.
605 *   \param[in]  pHwRef                  pHwRef is the Information of
606 *                                       the Device Interface Link
607 *   \param[in]  sData                   Data to be sent to the lower layer
608 *
609 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
610 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
611 *                                       could not be interpreted properly.
612 *
613 */
614 extern
615 NFCSTATUS
616 phHciNfc_NfcIP_Send_Data (
617                          phHciNfc_sContext_t    *psHciContext,
618                          void                   *pHwRef,
619                          phHciNfc_XchgInfo_t    *sData
620                          );
621 
622 /**
623 * \ingroup grp_hci_nfc
624 *
625 *   The phHciNfc_Initiator_Cont_Activate function to activate the NFCIP initiator
626 *
627 *   \param[in]  pContext                pContext is the pointer to HCI Layer
628 *                                       context Structure.
629 *   \param[in]  pHwRef                  pHwRef is the Information of
630 *                                       the Device Interface Link
631 *
632 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
633 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
634 *                                       could not be interpreted properly.
635 *
636 */
637 extern
638 NFCSTATUS
639 phHciNfc_Initiator_Cont_Activate (
640                                   phHciNfc_sContext_t       *psHciContext,
641                                   void                      *pHwRef
642                                   );
643 
644 /**
645 * \ingroup grp_hci_nfc
646 *
647 *   The phHciNfc_NfcIP_GetATRInfo function is to get ATR information
648 *
649 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
650 *                                       context Structure.
651 *   \param[in]  pHwRef                  pHwRef is the Information of
652 *                                       the Device Interface Link
653 *   \param[in]  nfciptype               Specifies initiator or target
654 *
655 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
656 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
657 *                                       could not be interpreted properly.
658 *
659 */
660 extern
661 NFCSTATUS
662 phHciNfc_NfcIP_GetATRInfo (
663                            phHciNfc_sContext_t      *psHciContext,
664                            void                     *pHwRef,
665                            phHciNfc_eNfcIPType_t    nfciptype
666                            );
667 
668 /**
669 * \ingroup grp_hci_nfc
670 *
671 *   The phHciNfc_NfcIP_SetMergeSak function is to indicate, if the NFCIP-1
672 *   target feature must be merged with Type A RF card feature in order to
673 *   present only one type A target (set of the related bit in SAK to
674 *   reflect the ISO18092 compliancy).
675 *       0x00 -> disabled
676 *       0x01 -> enabled
677 *       Others values are RFU : error code returned as NFCSTATUS_INVALID_PARAMETER
678 *
679 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
680 *                                       context Structure.
681 *   \param[in]  pHwRef                  pHwRef is the Information of
682 *                                       the Device Interface Link
683 *   \param[in]  sak_value               Specifies initiator or target
684 *
685 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
686 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
687 *                                       could not be interpreted properly.
688 *
689 */
690 extern
691 NFCSTATUS
692 phHciNfc_NfcIP_SetMergeSak(
693                             phHciNfc_sContext_t     *psHciContext,
694                             void                    *pHwRef,
695                             uint8_t                 sak_value
696                            );
697 #endif /* #ifndef PHHCINFC_NFCIPMGMT_H */
698 
699 
700