nfa_hci_api.h revision a24be4f06674b2707b57904deaa0dff5a95823bd
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/******************************************************************************
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  Copyright (C) 2010-2014 Broadcom Corporation
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  Licensed under the Apache License, Version 2.0 (the "License");
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  you may not use this file except in compliance with the License.
7868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *  You may obtain a copy of the License at:
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) *
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  http://www.apache.org/licenses/LICENSE-2.0
104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) *
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) *  Unless required by applicable law or agreed to in writing, software
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  distributed under the License is distributed on an "AS IS" BASIS,
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu *  See the License for the specific language governing permissions and
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *  limitations under the License.
167d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) *
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ******************************************************************************/
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/******************************************************************************
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *  This is the public interface file for NFA HCI, Broadcom's NFC
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *  application layer for mobile phones.
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ******************************************************************************/
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef NFA_HCI_API_H
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_API_H
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "nfa_api.h"
30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
315c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu/*****************************************************************************
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)**  Constants and data types
33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)*****************************************************************************/
34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* NFA HCI Debug constants */
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEBUG_DISPLAY_CB                0
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEBUG_SIM_HCI_EVENT             1
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEBUG_ENABLE_LOOPBACK           101
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEBUG_DISABLE_LOOPBACK          102
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* NFA HCI callback events */
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_REGISTER_EVT	                0x00    /* Application registered                       */
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEREGISTER_EVT                  0x01    /* Application deregistered                     */
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_GET_GATE_PIPE_LIST_EVT          0x02    /* Retrieved gates,pipes assoc. to application  */
45c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#define NFA_HCI_ALLOCATE_GATE_EVT	            0x03    /* A generic gate allocated to the application  */
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DEALLOCATE_GATE_EVT	            0x04    /* A generic gate is released                   */
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_CREATE_PIPE_EVT         	    0x05    /* Pipe is created                              */
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_OPEN_PIPE_EVT         	        0x06    /* Pipe is opened / could not open              */
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_CLOSE_PIPE_EVT         	        0x07    /* Pipe is closed / could not close             */
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_DELETE_PIPE_EVT         	    0x08    /* Pipe is deleted                              */
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_HOST_LIST_EVT       	        0x09    /* Received list of Host from Host controller   */
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_INIT_EVT                        0x0A    /* HCI subsytem initialized                     */
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_EXIT_EVT                        0x0B    /* HCI subsytem exited                          */
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_RSP_RCVD_EVT                    0x0C    /* Response recvd to cmd sent on app owned pipe */
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_RSP_SENT_EVT                    0x0D    /* Response sent on app owned pipe              */
564e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define NFA_HCI_CMD_SENT_EVT                    0x0E    /* Command sent on app owned pipe               */
574e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define NFA_HCI_EVENT_SENT_EVT                  0x0F    /* Event sent on app owned pipe                 */
584e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define NFA_HCI_CMD_RCVD_EVT                    0x10    /* Command received on app owned pipe           */
594e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define NFA_HCI_EVENT_RCVD_EVT                  0x11    /* Event received on app owned pipe             */
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_GET_REG_CMD_EVT                 0x12    /* Registry read command sent                   */
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_SET_REG_CMD_EVT                 0x13    /* Registry write command sent                  */
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_GET_REG_RSP_EVT                 0x14    /* Received response to read registry command   */
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_SET_REG_RSP_EVT                 0x15    /* Received response to write registry command  */
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_ADD_STATIC_PIPE_EVT             0x16    /* A static pipe is added                       */
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef UINT8 tNFA_HCI_EVT;
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_MAX_HCI_APP_NAME_LEN                0x10    /* Max application name length */
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_MAX_HCI_CMD_LEN                     255     /* Max HCI command length */
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_MAX_HCI_RSP_LEN                     255     /* Max HCI event length */
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_MAX_HCI_EVENT_LEN                   260     /* Max HCI event length */
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_MAX_HCI_DATA_LEN                    260     /* Max HCI data length */
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* NFA HCI PIPE states */
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_PIPE_CLOSED                     0x00    /* Pipe is closed */
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NFA_HCI_PIPE_OPENED                     0x01    /* Pipe is opened */
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef UINT8 tNFA_HCI_PIPE_STATE;
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Dynamic pipe control block */
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8                   pipe_id;                    /* Pipe ID */
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_PIPE_STATE     pipe_state;                 /* State of the Pipe */
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8                   local_gate;                 /* local gate id */
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8                   dest_host;                  /* Peer host to which this pipe is connected */
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8                   dest_gate;                  /* Peer gate to which this pipe is connected */
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_PIPE_INFO;
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_REGISTER_EVT */
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS         status;                         /* Status of registration */
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HANDLE         hci_handle;                     /* Handle assigned to the application */
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               num_pipes;                      /* Number of dynamic pipes exist for the application */
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               num_gates;                      /* Number of generic gates exist for the application */
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_REGISTER;
975c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_DEREGISTER_EVT */
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS         status;                         /* Status of deregistration */
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_DEREGISTER;
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1045c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu/* Data for NFA_HCI_GET_GATE_PIPE_LIST_EVT */
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS         status;
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               num_pipes;                      /* Number of dynamic pipes exist for the application */
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_PIPE_INFO  pipe[NFA_HCI_MAX_PIPE_CB];      /* List of pipe created for the application */
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               num_gates;                      /* Number of generic gates exist for the application */
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               gate[NFA_HCI_MAX_GATE_CB];      /* List of generic gates allocated to the application */
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               num_uicc_created_pipes;         /* Number of pipes created by UICC host */
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_PIPE_INFO  uicc_created_pipe[NFA_HCI_MAX_PIPE_CB]; /* Pipe information of the UICC created pipe */
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_GET_GATE_PIPE_LIST;
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_ALLOCATE_GATE_EVT */
1174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)typedef struct
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of response to allocate gate request */
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           gate;                               /* The gate allocated to the application */
1214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} tNFA_HCI_ALLOCATE_GATE;
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_DEALLOCATE_GATE_EVT */
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of response to deallocate gate request */
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           gate;                               /* The gate deallocated from the application */
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_DEALLOCATE_GATE;
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_CREATE_PIPE_EVT */
1315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)typedef struct
132a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles){
133a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of creating dynamic pipe for the application */
134a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    UINT8           pipe;                               /* The pipe created for the application */
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           source_gate;                        /* DH host gate to which the one end of pipe is attached */
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           dest_host;                          /* Destination host whose gate is the other end of the pipe is attached to */
1372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    UINT8           dest_gate;                          /* Destination host gate to which the other end of pipe is attached */
1382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} tNFA_HCI_CREATE_PIPE;
1392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/* Data for NFA_HCI_OPEN_PIPE_EVT */
14123730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)typedef struct
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    tNFA_STATUS     status;                             /* Status of open pipe operation */
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           pipe;                               /* The dynamic pipe for open operation */
1452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}tNFA_HCI_OPEN_PIPE;
1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_CLOSE_PIPE_EVT */
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
150f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    tNFA_STATUS     status;                             /* Status of close pipe operation */
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           pipe;                               /* The dynamic pipe for close operation */
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}tNFA_HCI_CLOSE_PIPE;
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_DELETE_PIPE_EVT */
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of delete pipe operation */
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           pipe;                               /* The dynamic pipe for delete operation */
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_DELETE_PIPE;
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_HOST_LIST_EVT */
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status og get host list operation */
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           num_hosts;                          /* Number of hosts in the host network */
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           host[NFA_HCI_MAX_HOST_IN_NETWORK];  /* List of host in the host network */
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_HOST_LIST;
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_RSP_RCVD_EVT */
1707d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)typedef struct
1717d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles){
1727d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of RSP to HCP CMD sent */
1737d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    UINT8           pipe;                               /* The pipe on which HCP packet is exchanged */
1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    UINT8           rsp_code;                           /* Response id */
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    UINT16          rsp_len;                            /* Response parameter length */
1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    UINT8           rsp_data[NFA_MAX_HCI_RSP_LEN];      /* Response received */
1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} tNFA_HCI_RSP_RCVD;
178a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
179a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)/* Data for NFA_HCI_EVENT_RCVD_EVT */
180a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)typedef struct
181a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles){
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of Event received */
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           pipe;                               /* The pipe on which HCP EVT packet is received */
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           evt_code;                           /* HCP EVT id */
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT16          evt_len;                            /* HCP EVT parameter length */
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           *p_evt_buf;                         /* HCP EVT Parameter */
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_EVENT_RCVD;
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_CMD_RCVD_EVT */
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
191116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch{
192116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    tNFA_STATUS     status;                             /* Status of Command received */
193116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    UINT8           pipe;                               /* The pipe on which HCP CMD packet is received */
194116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    UINT8           cmd_code;                           /* HCP CMD id */
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT16          cmd_len;                            /* HCP CMD parameter length */
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8           cmd_data[NFA_MAX_HCI_CMD_LEN];      /* HCP CMD Parameter */
1975d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} tNFA_HCI_CMD_RCVD;
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_INIT_EVT */
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
2012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles){
202f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    tNFA_STATUS     status;                             /* Status of Enabling HCI Network */
2032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} tNFA_HCI_INIT;
2042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_EXIT_EVT */
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of Disabling HCI Network */
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_EXIT;
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/* Data for NFA_HCI_RSP_SENT_EVT */
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
214868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of HCP response send operation */
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_RSP_SENT;
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Data for NFA_HCI_CMD_SENT_EVT */
218868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)typedef struct
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles){
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of Command send operation */
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_CMD_SENT;
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)/* Data for NFA_HCI_EVENT_SENT_EVT */
2245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)typedef struct
2255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles){
2265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    tNFA_STATUS     status;                             /* Status of Event send operation */
227cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)} tNFA_HCI_EVENT_SENT;
2285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
2295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)/* Data for NFA_HCI_ADD_STATIC_PIPE_EVT */
2304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)typedef struct
2314e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles){
2324e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    tNFA_STATUS     status;                             /* Status of adding proprietary pipe */
2334e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} tNFA_HCI_ADD_STATIC_PIPE_EVT;
2344e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
2354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)/* data type for all registry-related events */
2364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)typedef struct
2374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles){
2384e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    tNFA_STATUS         status;                         /* Status of Registry operation */
2394e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    UINT8               pipe;                           /* Pipe on whose registry is of interest */
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               index;                          /* Index of the registry operated */
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               data_len;                       /* length of the registry parameter */
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    UINT8               reg_data[NFA_MAX_HCI_DATA_LEN]; /* Registry parameter */
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} tNFA_HCI_REGISTRY;
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
2462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/* Union of all hci callback structures */
2472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)typedef union
2485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles){
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_REGISTER               hci_register;   /* NFA_HCI_REGISTER_EVT           */
250cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    tNFA_HCI_DEREGISTER             hci_deregister; /* NFA_HCI_DEREGISTER_EVT         */
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_GET_GATE_PIPE_LIST     gates_pipes;    /* NFA_HCI_GET_GATE_PIPE_LIST_EVT */
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_ALLOCATE_GATE          allocated;      /* NFA_HCI_ALLOCATE_GATE_EVT      */
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_DEALLOCATE_GATE        deallocated;    /* NFA_HCI_DEALLOCATE_GATE_EVT    */
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_CREATE_PIPE            created;        /* NFA_HCI_CREATE_PIPE_EVT        */
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_OPEN_PIPE              opened;         /* NFA_HCI_OPEN_PIPE_EVT          */
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_CLOSE_PIPE             closed;         /* NFA_HCI_CLOSE_PIPE_EVT         */
2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_DELETE_PIPE            deleted;        /* NFA_HCI_DELETE_PIPE_EVT        */
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_HOST_LIST              hosts;          /* NFA_HCI_HOST_LIST_EVT          */
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_RSP_RCVD               rsp_rcvd;       /* NFA_HCI_RSP_RCVD_EVT           */
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_RSP_SENT               rsp_sent;       /* NFA_HCI_RSP_SENT_EVT           */
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_CMD_SENT               cmd_sent;       /* NFA_HCI_CMD_SENT_EVT           */
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_EVENT_SENT             evt_sent;       /* NFA_HCI_EVENT_SENT_EVT         */
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_CMD_RCVD               cmd_rcvd;       /* NFA_HCI_CMD_RCVD_EVT           */
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    tNFA_HCI_EVENT_RCVD             rcvd_evt;       /* NFA_HCI_EVENT_RCVD_EVT         */
265    tNFA_STATUS                     status;         /* status of api command request  */
266    tNFA_HCI_REGISTRY               registry;       /* all registry-related events - NFA_HCI_GET_REG_CMD_EVT, NFA_HCI_SET_REG_CMD_EVT, NFA_HCI_GET_REG_RSP_EVT, NFA_HCI_SET_REG_RSP_EVT */
267    tNFA_HCI_INIT                   hci_init;       /* NFA_HCI_INIT_EVT               */
268    tNFA_HCI_EXIT                   hci_exit;       /* NFA_HCI_EXIT_EVT               */
269    tNFA_HCI_ADD_STATIC_PIPE_EVT    pipe_added;     /* NFA_HCI_ADD_STATIC_PIPE_EVT    */
270} tNFA_HCI_EVT_DATA;
271
272/* NFA HCI callback */
273typedef void (tNFA_HCI_CBACK) (tNFA_HCI_EVT event, tNFA_HCI_EVT_DATA *p_data);
274
275/*****************************************************************************
276**  External Function Declarations
277*****************************************************************************/
278#ifdef __cplusplus
279extern "C"
280{
281#endif
282
283
284/*******************************************************************************
285**
286** Function         NFA_HciRegister
287**
288** Description      This function will register an application with hci and
289**                  returns an application handle and provides a mechanism to
290**                  register a callback with HCI to receive NFA HCI event notification.
291**                  When the application is registered (or if an error occurs),
292**                  the app will be notified with NFA_HCI_REGISTER_EVT. Previous
293**                  session information including allocated gates, created pipes
294**                  and pipes states will be returned as part of tNFA_HCI_REGISTER data.
295**
296** Returns          NFA_STATUS_OK if successfully initiated
297**                  NFA_STATUS_FAILED otherwise
298**
299*******************************************************************************/
300NFC_API extern tNFA_STATUS NFA_HciRegister (char *p_app_name, tNFA_HCI_CBACK *p_cback, BOOLEAN b_send_conn_evts);
301
302/*******************************************************************************
303**
304** Function         NFA_HciGetGateAndPipeList
305**
306** Description      This function will retrieve the list of gates allocated to
307**                  the application and list of dynamic pipes created for the
308**                  application. The app will be notified with
309**                  NFA_HCI_GET_GATE_PIPE_LIST_EVT. List of allocated dynamic
310**                  gates to the application and list of pipes created by the
311**                  application will be returned as part of
312**                  tNFA_HCI_GET_GATE_PIPE_LIST data.
313**
314** Returns          NFA_STATUS_OK if successfully initiated
315**                  NFA_STATUS_FAILED otherwise
316**
317*******************************************************************************/
318NFC_API extern tNFA_STATUS NFA_HciGetGateAndPipeList (tNFA_HANDLE hci_handle);
319
320/*******************************************************************************
321**
322** Function         NFA_HciDeregister
323**
324** Description      This function is called to deregister an application
325**                  from HCI. The app will be notified by NFA_HCI_DEREGISTER_EVT
326**                  after deleting all the pipes owned by the app and deallocating
327**                  all the gates allocated to the app or if an error occurs.
328**                  The app can release the buffer provided for collecting long
329**                  APDUs after receiving NFA_HCI_DEREGISTER_EVT.
330**                  Even if deregistration fails, the app has to register again
331**                  to provide a new cback function and event buffer for receiving
332**                  long APDUs.
333**
334** Returns          NFA_STATUS_OK if the application is deregistered successfully
335**                  NFA_STATUS_FAILED otherwise
336**
337*******************************************************************************/
338NFC_API extern tNFA_STATUS NFA_HciDeregister (char *p_app_name);
339
340/*******************************************************************************
341**
342** Function         NFA_HciAllocGate
343**
344** Description      This function will allocate the gate if any specified or an
345**                  available generic gate for the app to provide an entry point
346**                  for a particular service to other host or to establish
347**                  communication with other host. When the gate is
348**                  allocated (or if an error occurs), the app will be notified
349**                  with NFA_HCI_ALLOCATE_GATE_EVT with the gate id. The allocated
350**                  Gate information will be stored in non volatile memory.
351**
352** Returns          NFA_STATUS_OK if this API started
353**                  NFA_STATUS_FAILED if no generic gate is available
354**
355*******************************************************************************/
356NFC_API extern tNFA_STATUS NFA_HciAllocGate (tNFA_HANDLE hci_handle, UINT8 gate);
357
358/*******************************************************************************
359**
360** Function         NFA_HciDeallocGate
361**
362** Description      This function will release the specified gate that was
363**                  previously allocated to the application. When the generic
364**                  gate is released (or if an error occurs), the app will be
365**                  notified with NFA_HCI_DEALLOCATE_GATE_EVT with the gate id.
366**                  The allocated Gate information will be deleted from non
367**                  volatile memory and all the associated pipes are deleted
368**                  by informing host controller.
369**
370** Returns          NFA_STATUS_OK if successfully initiated
371**                  NFA_STATUS_BAD_HANDLE if handle is not valid
372**                  NFA_STATUS_FAILED otherwise
373**
374*******************************************************************************/
375NFC_API extern tNFA_STATUS NFA_HciDeallocGate (tNFA_HANDLE conn_handle, UINT8 gate);
376
377/*******************************************************************************
378**
379** Function         NFA_HciGetHostList
380**
381** Description      This function will request the host controller to return the
382**                  list of hosts that are present in the host network. When
383**                  host controller responds with the host list (or if an error
384**                  occurs), the app will be notified with NFA_HCI_HOST_LIST_EVT
385**
386** Returns          NFA_STATUS_OK if successfully initiated
387**                  NFA_STATUS_BAD_HANDLE if handle is not valid
388**                  NFA_STATUS_FAILED otherwise
389**
390*******************************************************************************/
391NFC_API extern tNFA_STATUS NFA_HciGetHostList (tNFA_HANDLE hci_handle);
392
393/*******************************************************************************
394**
395** Function         NFA_HciCreatePipe
396**
397** Description      This function is called to create a dynamic pipe with the
398**                  specified host. When the dynamic pipe is created (or
399**                  if an error occurs), the app will be notified with
400**                  NFA_HCI_CREATE_PIPE_EVT with the pipe id. If a pipe exists
401**                  between the two gates passed as argument and if it was
402**                  created earlier by the calling application then the pipe
403**                  id of the existing pipe will be returned and a new pipe
404**                  will not be created. After successful creation of pipe,
405**                  registry entry will be created for the dynamic pipe and
406**                  all information related to the pipe will be stored in non
407**                  volatile memory.
408**
409** Returns          NFA_STATUS_OK if successfully initiated
410**                  NFA_STATUS_FAILED otherwise
411**
412*******************************************************************************/
413NFC_API extern tNFA_STATUS NFA_HciCreatePipe (tNFA_HANDLE  hci_handle,
414                                              UINT8        source_gate_id,
415                                              UINT8        dest_host,
416                                              UINT8        dest_gate);
417
418/*******************************************************************************
419**
420** Function         NFA_HciOpenPipe
421**
422** Description      This function is called to open a dynamic pipe.
423**                  When the dynamic pipe is opened (or
424**                  if an error occurs), the app will be notified with
425**                  NFA_HCI_OPEN_PIPE_EVT with the pipe id.
426**
427** Returns          NFA_STATUS_OK if successfully initiated
428**                  NFA_STATUS_FAILED otherwise
429**
430*******************************************************************************/
431NFC_API extern tNFA_STATUS NFA_HciOpenPipe (tNFA_HANDLE  hci_handle, UINT8 pipe);
432
433/*******************************************************************************
434**
435** Function         NFA_HciGetRegistry
436**
437** Description      This function requests a peer host to return the desired
438**                  registry field value for the gate that the pipe is on.
439**
440**                  When the peer host responds,the app is notified with
441**                  NFA_HCI_GET_REG_RSP_EVT or
442**                  if an error occurs in sending the command the app will be
443**                  notified by NFA_HCI_CMD_SENT_EVT
444**
445** Returns          NFA_STATUS_OK if successfully initiated
446**                  NFA_STATUS_FAILED otherwise
447**
448*******************************************************************************/
449NFC_API extern tNFA_STATUS NFA_HciGetRegistry (tNFA_HANDLE hci_handle, UINT8 pipe, UINT8 reg_inx);
450
451/*******************************************************************************
452**
453** Function         NFA_HciSetRegistry
454**
455** Description      This function requests a peer host to set the desired
456**                  registry field value for the gate that the pipe is on.
457**
458**                  When the peer host responds,the app is notified with
459**                  NFA_HCI_SET_REG_RSP_EVT or
460**                  if an error occurs in sending the command the app will be
461**                  notified by NFA_HCI_CMD_SENT_EVT
462**
463** Returns          NFA_STATUS_OK if successfully initiated
464**                  NFA_STATUS_FAILED otherwise
465**
466*******************************************************************************/
467NFC_API extern tNFA_STATUS NFA_HciSetRegistry (tNFA_HANDLE   hci_handle,
468                                               UINT8         pipe,
469                                               UINT8         reg_inx,
470                                               UINT8         data_size,
471                                               UINT8         *p_data);
472
473/*******************************************************************************
474**
475** Function         NFA_HciSendCommand
476**
477** Description      This function is called to send a command on a pipe created
478**                  by the application.
479**                  The app will be notified by NFA_HCI_CMD_SENT_EVT if an error
480**                  occurs.
481**                  When the peer host responds,the app is notified with
482**                  NFA_HCI_RSP_RCVD_EVT
483**
484** Returns          NFA_STATUS_OK if successfully initiated
485**                  NFA_STATUS_FAILED otherwise
486**
487*******************************************************************************/
488NFC_API extern tNFA_STATUS NFA_HciSendCommand (tNFA_HANDLE hci_handle,
489                                               UINT8       pipe,
490                                               UINT8       cmd_code,
491                                               UINT16      cmd_size,
492                                               UINT8       *p_data);
493
494/*******************************************************************************
495**
496** Function         NFA_HciSendResponse
497**
498** Description      This function is called to send a response on a pipe created
499**                  by the application.
500**                  The app will be notified by NFA_HCI_RSP_SENT_EVT if an error
501**                  occurs.
502**
503** Returns          NFA_STATUS_OK if successfully initiated
504**                  NFA_STATUS_FAILED otherwise
505**
506*******************************************************************************/
507NFC_API extern tNFA_STATUS NFA_HciSendResponse (tNFA_HANDLE   hci_handle,
508                                                UINT8         pipe,
509                                                UINT8         response,
510                                                UINT8         data_size,
511                                                UINT8         *p_data);
512
513/*******************************************************************************
514**
515** Function         NFA_HciSendEvent
516**
517** Description      This function is called to send any event on a pipe created
518**                  by the application.
519**                  The app will be notified by NFA_HCI_EVENT_SENT_EVT
520**                  after successfully sending the event on the specified pipe
521**                  or if an error occurs. The application should wait for this
522**                  event before releasing event buffer passed as argument.
523**                  If the app is expecting a response to the event then it can
524**                  provide response buffer for collecting the response. If it
525**                  provides a response buffer it should also provide response
526**                  timeout indicating duration validity of the response buffer.
527**                  Maximum of NFA_MAX_HCI_EVENT_LEN bytes APDU can be received
528**                  using internal buffer if no response buffer is provided by
529**                  the application. The app will be notified by
530**                  NFA_HCI_EVENT_RCVD_EVT after receiving the response event
531**                  or on timeout if app provided response buffer.
532**                  If response buffer is provided by the application, it should
533**                  wait for this event before releasing the response buffer.
534**
535** Returns          NFA_STATUS_OK if successfully initiated
536**                  NFA_STATUS_FAILED otherwise
537**
538*******************************************************************************/
539NFC_API extern tNFA_STATUS NFA_HciSendEvent (tNFA_HANDLE hci_handle,
540                                            UINT8        pipe,
541                                            UINT8        evt_code,
542                                            UINT16       evt_size,
543                                            UINT8        *p_data,
544                                            UINT16       rsp_size,
545                                            UINT8        *p_rsp_buf,
546                                            UINT16       rsp_timeout);
547
548/*******************************************************************************
549**
550** Function         NFA_HciClosePipe
551**
552** Description      This function is called to close a dynamic pipe.
553**                  When the dynamic pipe is closed (or
554**                  if an error occurs), the app will be notified with
555**                  NFA_HCI_CLOSE_PIPE_EVT with the pipe id.
556**
557** Returns          NFA_STATUS_OK if successfully initiated
558**                  NFA_STATUS_FAILED otherwise
559**
560*******************************************************************************/
561NFC_API extern tNFA_STATUS NFA_HciClosePipe (tNFA_HANDLE  hci_handle, UINT8 pipe);
562
563/*******************************************************************************
564**
565** Function         NFA_HciDeletePipe
566**
567** Description      This function is called to delete a particular dynamic pipe.
568**                  When the dynamic pipe is deleted (or if an error occurs),
569**                  the app will be notified with NFA_HCI_DELETE_PIPE_EVT with
570**                  the pipe id. After successful deletion of pipe, registry
571**                  entry will be deleted for the dynamic pipe and all
572**                  information related to the pipe will be deleted from non
573**                  volatile memory.
574**
575** Returns          NFA_STATUS_OK if successfully initiated
576**                  NFA_STATUS_BAD_HANDLE if handle is not valid
577**                  NFA_STATUS_FAILED otherwise
578**
579*******************************************************************************/
580NFC_API extern tNFA_STATUS NFA_HciDeletePipe (tNFA_HANDLE  hci_handle, UINT8 pipe);
581
582/*******************************************************************************
583**
584** Function         NFA_HciAddStaticPipe
585**
586** Description      This function is called to add a static pipe for sending
587**                  7816 APDUs. When the static pipe is added (or if an error occurs),
588**                  the app will be notified with NFA_HCI_ADD_STATIC_PIPE_EVT with
589**                  status.
590**
591** Returns          NFA_STATUS_OK if successfully initiated
592**                  NFA_STATUS_FAILED otherwise
593**
594*******************************************************************************/
595NFC_API extern tNFA_STATUS NFA_HciAddStaticPipe (tNFA_HANDLE hci_handle, UINT8 host, UINT8 gate, UINT8 pipe);
596
597/*******************************************************************************
598**
599** Function         NFA_HciDebug
600**
601** Description      Debug function.
602**
603*******************************************************************************/
604NFC_API extern void NFA_HciDebug (UINT8 action, UINT8 size, UINT8 *p_data);
605
606#ifdef __cplusplus
607}
608#endif
609
610#endif /* NFA_P2P_API_H */
611
612