nfa_hci_int.h revision 106eae004dff2ddeb4f715424178a876bab19717
1/*****************************************************************************
2**
3**  Name:           nfa_hci_int.h
4**
5**  Description:    This is the private interface file for the NFA HCI.
6**
7**  Copyright (c) 2010-2011, Broadcom Corp., All Rights Reserved.
8**  Broadcom Bluetooth Core. Proprietary and confidential.
9**
10*****************************************************************************/
11#ifndef NFA_HCI_INT_H
12#define NFA_HCI_INT_H
13
14#include "nfa_hci_api.h"
15
16extern BOOLEAN HCI_LOOPBACK_DEBUG;
17
18/*****************************************************************************
19**  Constants and data types
20*****************************************************************************/
21#define NFA_HCI_SESSION_ID_LEN          8           /* HCI Session ID length */
22#define NFA_MAX_PIPES_IN_GENERIC_GATE   0x0F        /* Maximum pipes that can be created on a generic pipe  */
23
24#define NFA_HCI_VERSION_SW              0x090000    /* HCI SW Version number                       */
25#define NFA_HCI_VERSION_HW              0x000000    /* HCI HW Version number                       */
26#define NFA_HCI_VENDOR_NAME             "HCI"       /* Vendor Name                                 */
27#define NFA_HCI_MODEL_ID                00          /* Model ID                                    */
28#define NFA_HCI_VERSION                 90          /* HCI Version                                 */
29
30/* NFA HCI states */
31#define NFA_HCI_STATE_DISABLED          0x00     /* HCI is disabled  */
32#define NFA_HCI_STATE_STARTUP           0x01     /* HCI performing Initialization sequence */
33#define NFA_HCI_STATE_WAIT_NETWK_ENABLE 0x02     /* HCI is waiting for initialization of other host in the network */
34#define NFA_HCI_STATE_IDLE              0x03     /* HCI is waiting to handle api commands  */
35#define NFA_HCI_STATE_WAIT_RSP          0x04     /* HCI is performing api command request  */
36#define NFA_HCI_STATE_REMOVE_GATE       0x05     /* Removing all pipes prior to removing the gate */
37#define NFA_HCI_STATE_APP_DEREGISTER    0x06     /* Removing all pipes and gates prior to deregistering the app */
38#define NFA_HCI_STATE_RESTORE           0x07     /* HCI restore */
39
40typedef UINT8 tNFA_HCI_STATE;
41
42/* NFA HCI PIPE states */
43#define NFA_HCI_PIPE_CLOSED             0x00     /* Pipe is closed */
44#define NFA_HCI_PIPE_OPENED             0x01     /* Pipe is opened */
45
46#define NFA_HCI_INVALID_INX             0xFF
47
48
49typedef UINT8 tNFA_HCI_COMMAND;
50typedef UINT8 tNFA_HCI_RESPONSE;
51
52
53/* NFA HCI Internal events */
54enum
55{
56    NFA_HCI_API_REGISTER_APP_EVT = NFA_SYS_EVT_START (NFA_ID_HCI),/* Register APP with HCI */
57    NFA_HCI_API_DEREGISTER_APP_EVT,                               /* Deregister an app from HCI */
58    NFA_HCI_API_GET_APP_GATE_PIPE_EVT,                            /* Get the list of gate and pipe associated to the application */
59    NFA_HCI_API_ALLOC_GATE_EVT,                                   /* Allocate a dyanmic gate for the application */
60    NFA_HCI_API_DEALLOC_GATE_EVT,                                 /* Deallocate a previously allocated gate to the application */
61    NFA_HCI_API_GET_HOST_LIST_EVT,                                /* Get the list of Host in the network */
62    NFA_HCI_API_GET_REGISTRY_EVT,                                 /* Get a registry entry from a host */
63    NFA_HCI_API_SET_REGISTRY_EVT,                                 /* Set a registry entry on a host */
64    NFA_HCI_API_CREATE_PIPE_EVT,                                  /* Create a pipe between two gates */
65    NFA_HCI_API_OPEN_PIPE_EVT,                                    /* Open a pipe */
66    NFA_HCI_API_CLOSE_PIPE_EVT,                                   /* Close a pipe */
67    NFA_HCI_API_DELETE_PIPE_EVT,                                  /* Delete a pipe */
68    NFA_HCI_API_SEND_CMD_EVT,                                     /* Send command via pipe */
69    NFA_HCI_API_SEND_RSP_EVT,                                     /* Application Response to a command */
70    NFA_HCI_API_SEND_EVENT_EVT,                                   /* Send event via pipe */
71
72    NFA_HCI_RSP_NV_READ_EVT,                                      /* Non volatile read complete event */
73    NFA_HCI_RSP_NV_WRITE_EVT,                                     /* Non volatile write complete event */
74    NFA_HCI_VSC_INIT_EVT,                                         /* Vendor specific initialization is completed */
75    NFA_HCI_EE_DISC_CMPLT_EVT,
76    NFA_HCI_RSP_TIMEOUT_EVT,
77    NFA_HCI_HCP_CONN_CREATE_EVT,
78    NFA_HCI_VSC_TIMEOUT_EVT,                                      /* Timeout to Vendor specific operation */
79    NFA_HCI_CHECK_QUEUE_EVT
80};
81
82#define NFA_HCI_FIRST_API_EVENT     NFA_HCI_API_REGISTER_APP_EVT
83#define NFA_HCI_LAST_API_EVENT      NFA_HCI_API_SEND_EVENT_EVT
84
85typedef UINT16 tNFA_HCI_INT_EVT;
86
87#ifndef NFA_HCI_EVT_RSP_TIMEOUT_VAL
88#define NFA_HCI_EVT_RSP_TIMEOUT_VAL    10000
89#endif
90
91/* Internal event structures.
92**
93** Note, every internal structure starts with a BT_HDR and an app handle
94*/
95
96/* data type for NFA_HCI_API_REGISTER_APP_EVT */
97typedef struct
98{
99    BT_HDR              hdr;
100    tNFA_HANDLE         hci_handle;
101    char                app_name[NFA_MAX_HCI_APP_NAME_LEN + 1];
102    tNFA_HCI_CBACK      *p_cback;
103    BOOLEAN             b_send_conn_evts;
104} tNFA_HCI_API_REGISTER_APP;
105
106/* data type for NFA_HCI_API_DEREGISTER_APP_EVT */
107typedef struct
108{
109    BT_HDR              hdr;
110    tNFA_HANDLE         hci_handle;
111    char                app_name[NFA_MAX_HCI_APP_NAME_LEN + 1];
112} tNFA_HCI_API_DEREGISTER_APP;
113
114/* data type for NFA_HCI_API_GET_APP_GATE_PIPE_EVT */
115typedef struct
116{
117    BT_HDR              hdr;
118    tNFA_HANDLE         hci_handle;
119} tNFA_HCI_API_GET_APP_GATE_PIPE;
120
121/* data type for NFA_HCI_API_ALLOC_GATE_EVT */
122typedef struct
123{
124    BT_HDR              hdr;
125    tNFA_HANDLE         hci_handle;
126} tNFA_HCI_API_ALLOC_GATE;
127
128
129/* data type for NFA_HCI_API_DEALLOC_GATE_EVT */
130typedef struct
131{
132    BT_HDR              hdr;
133    tNFA_HANDLE         hci_handle;
134    UINT8               gate;
135} tNFA_HCI_API_DEALLOC_GATE;
136
137/* data type for NFA_HCI_API_GET_HOST_LIST_EVT */
138typedef struct
139{
140    BT_HDR              hdr;
141    tNFA_HANDLE         hci_handle;
142    tNFA_STATUS         status;
143} tNFA_HCI_API_GET_HOST_LIST;
144
145/* data type for NFA_HCI_API_GET_REGISTRY_EVT */
146typedef struct
147{
148    BT_HDR              hdr;
149    tNFA_HANDLE         hci_handle;
150    UINT8               pipe;
151    UINT8               reg_inx;
152} tNFA_HCI_API_GET_REGISTRY;
153
154/* data type for NFA_HCI_API_SET_REGISTRY_EVT */
155typedef struct
156{
157    BT_HDR              hdr;
158    tNFA_HANDLE         hci_handle;
159    UINT8               pipe;
160    UINT8               reg_inx;
161    UINT8               size;
162    UINT8               data[NFA_MAX_HCI_CMD_LEN];
163} tNFA_HCI_API_SET_REGISTRY;
164
165/* data type for NFA_HCI_API_CREATE_PIPE_EVT */
166typedef struct
167{
168    BT_HDR              hdr;
169    tNFA_HANDLE         hci_handle;
170    tNFA_STATUS         status;
171    UINT8               source_gate;
172    UINT8               dest_host;
173    UINT8               dest_gate;
174} tNFA_HCI_API_CREATE_PIPE_EVT;
175
176/* data type for NFA_HCI_API_OPEN_PIPE_EVT */
177typedef struct
178{
179    BT_HDR              hdr;
180    tNFA_HANDLE         hci_handle;
181    tNFA_STATUS         status;
182    UINT8               pipe;
183} tNFA_HCI_API_OPEN_PIPE_EVT;
184
185/* data type for NFA_HCI_API_CLOSE_PIPE_EVT */
186typedef struct
187{
188    BT_HDR              hdr;
189    tNFA_HANDLE         hci_handle;
190    tNFA_STATUS         status;
191    UINT8               pipe;
192} tNFA_HCI_API_CLOSE_PIPE_EVT;
193
194/* data type for NFA_HCI_API_DELETE_PIPE_EVT */
195typedef struct
196{
197    BT_HDR              hdr;
198    tNFA_HANDLE         hci_handle;
199    tNFA_STATUS         status;
200    UINT8               pipe;
201} tNFA_HCI_API_DELETE_PIPE_EVT;
202
203/* data type for NFA_HCI_API_SEND_EVENT_EVT */
204typedef struct
205{
206    BT_HDR              hdr;
207    tNFA_HANDLE         hci_handle;
208    UINT8               pipe;
209    UINT8               evt_code;
210    UINT16              evt_len;
211    UINT8               *p_evt_buf;
212    UINT16              rsp_len;
213    UINT8               *p_rsp_buf;
214} tNFA_HCI_API_SEND_EVENT_EVT;
215
216/* data type for NFA_HCI_API_SEND_CMD_EVT */
217typedef struct
218{
219    BT_HDR              hdr;
220    tNFA_HANDLE         hci_handle;
221    UINT8               pipe;
222    UINT8               cmd_code;
223    UINT16              cmd_len;
224    UINT8               data[NFA_MAX_HCI_CMD_LEN];
225} tNFA_HCI_API_SEND_CMD_EVT;
226
227/* data type for NFA_HCI_RSP_NV_READ_EVT */
228typedef struct
229{
230    BT_HDR              hdr;
231    UINT8               block;
232    UINT16              size;
233    tNFA_STATUS         status;
234} tNFA_HCI_RSP_NV_READ_EVT;
235
236/* data type for NFA_HCI_RSP_NV_WRITE_EVT */
237typedef struct
238{
239    BT_HDR              hdr;
240    tNFA_STATUS         status;
241} tNFA_HCI_RSP_NV_WRITE_EVT;
242
243/* data type for NFA_HCI_VSC_INIT_EVT */
244typedef struct
245{
246    BT_HDR              hdr;
247    tNFA_STATUS         status;
248} tNFA_HCI_VSC_INIT_EVT;
249
250/* data type for NFA_HCI_EE_DISC_CMPLT_EVT */
251typedef struct
252{
253    BT_HDR              hdr;
254    BOOLEAN             b_disc_cmplt;
255    tNFA_STATUS         status;
256} tNFA_HCI_EE_DISC_CMPLT_EVT;
257
258/* data type for NFA_HCI_HCP_CONN_CREATE_EVT */
259typedef struct
260{
261    BT_HDR              hdr;
262    tNFA_STATUS         status;
263} tNFA_HCI_HCP_CONN_CREATE_EVT;
264
265/* data type for NFA_HCI_API_SEND_RSP_EVT */
266typedef struct
267{
268    BT_HDR              hdr;
269    tNFA_HANDLE         hci_handle;
270    UINT8               pipe;
271    UINT8               response;
272    UINT8               size;
273    UINT8               data[NFA_MAX_HCI_RSP_LEN];
274} tNFA_HCI_API_SEND_RSP_EVT;
275
276/* common data type for internal events */
277typedef struct
278{
279    BT_HDR              hdr;
280    tNFA_HANDLE         hci_handle;
281} tNFA_HCI_COMM_DATA;
282
283/* union of all event data types */
284typedef union
285{
286    BT_HDR                              hdr;
287    tNFA_HCI_COMM_DATA                  comm;
288
289    /* API events */
290    tNFA_HCI_API_REGISTER_APP           app_info;                       /* Register/Deregister an application */
291    tNFA_HCI_API_GET_APP_GATE_PIPE      get_gate_pipe_list;             /* Get the list of gates and pipes created for the application */
292    tNFA_HCI_API_ALLOC_GATE             gate_info;                      /* Allocate a dynamic gate to the application */
293    tNFA_HCI_API_DEALLOC_GATE           gate_dealloc;                   /* Deallocate the gate allocated to the application */
294    tNFA_HCI_API_CREATE_PIPE_EVT        create_pipe;                    /* Create a pipe */
295    tNFA_HCI_API_OPEN_PIPE_EVT          open_pipe;                      /* Open a pipe */
296    tNFA_HCI_API_CLOSE_PIPE_EVT         close_pipe;                     /* Close a pipe */
297    tNFA_HCI_API_DELETE_PIPE_EVT        delete_pipe;                    /* Delete a pipe */
298    tNFA_HCI_API_GET_HOST_LIST          get_host_list;                  /* Get the list of Host in the network */
299    tNFA_HCI_API_GET_REGISTRY           get_registry;                   /* Get a registry entry on a host */
300    tNFA_HCI_API_SET_REGISTRY           set_registry;                   /* Set a registry entry on a host */
301    tNFA_HCI_API_SEND_CMD_EVT           send_cmd;                       /* Send a event on a pipe to a host */
302    tNFA_HCI_API_SEND_RSP_EVT           send_rsp;                       /* Response to a command sent on a pipe to a host */
303    tNFA_HCI_API_SEND_EVENT_EVT         send_evt;                       /* Send a command on a pipe to a host */
304
305    /* Internal events */
306    tNFA_HCI_RSP_NV_READ_EVT            nv_read;
307    tNFA_HCI_RSP_NV_WRITE_EVT           nv_write;
308    tNFA_HCI_VSC_INIT_EVT               vsc_init;
309    tNFA_HCI_EE_DISC_CMPLT_EVT          ee_disc_cmplt;
310    tNFA_HCI_HCP_CONN_CREATE_EVT        conn_create;
311} tNFA_HCI_EVENT_DATA;
312
313/* type for State Machine (SM) action functions */
314typedef void (*tNFA_HCI_SM_ACT) (tNFA_HCI_EVENT_DATA *p_data);
315/*****************************************************************************
316**  control block
317*****************************************************************************/
318
319/* Dynamic pipe control block */
320typedef struct
321{
322    UINT8                   pipe_id;                /* Pipe ID */
323    tNFA_HCI_PIPE_STATE     pipe_state;             /* State of the Pipe */
324    UINT8                   local_gate;             /* local gate id */
325    UINT8                   dest_host;              /* Peer host to which this pipe is connected */
326    UINT8                   dest_gate;              /* Peer gate to which this pipe is connected */
327} tNFA_HCI_DYN_PIPE;
328
329/* Dynamic gate control block */
330typedef struct
331{
332    UINT8                   gate_id;                /* local gate id */
333    tNFA_HANDLE             gate_owner;             /* NFA-HCI handle assigned to the application which owns the gate */
334    UINT32                  pipe_inx_mask;          /* Bit 0 == pipe inx 0, etc */
335} tNFA_HCI_DYN_GATE;
336
337/* Admin gate control block */
338typedef struct
339{
340    tNFA_HCI_PIPE_STATE pipe01_state;               /* State of Pipe '01' */
341    UINT64              session_id;                 /* Session ID of the host network */
342} tNFA_ADMIN_GATE_INFO;
343
344/* Link management gate control block */
345typedef struct
346{
347    tNFA_HCI_PIPE_STATE pipe00_state;               /* State of Pipe '00' */
348    UINT16              rec_errors;                 /* Receive errors */
349} tNFA_LINK_MGMT_GATE_INFO;
350
351/* Identity management gate control block */
352typedef struct
353{
354    UINT32              pipe_inx_mask;                  /* Bit 0 == pipe inx 0, etc */
355    UINT16              version_sw;                     /* Software version number */
356    UINT16              version_hw;                     /* Hardware version number */
357    UINT8               vendor_name[20];                /* Vendor name */
358    UINT8               model_id;                       /* Model ID */
359    UINT8               hci_version;                    /* HCI Version */
360} tNFA_ID_MGMT_GATE_INFO;
361
362/* Internal flags */
363#define NFA_HCI_FL_DISABLING        0x01                /* sub system is being disabled */
364#define NFA_HCI_FL_NV_CHANGED       0x02                /* NV Ram changed */
365
366
367/* NFA HCI control block */
368typedef struct
369{
370    tNFA_HCI_STATE                  hci_state;                          /* state of the HCI */
371    UINT8                           num_nfcee;
372    UINT8                           inactive_host[NFA_HCI_MAX_HOST_IN_NETWORK]; /* Inactive host in the host network */
373    BOOLEAN                         b_low_power_mode;                   /* Host controller in low power mode */
374    BOOLEAN                         b_hci_netwk_reset;                  /* Command sent to reset HCI Network */
375    BOOLEAN                         w4_hci_netwk_init;                  /* Wait for other host in network to initialize */
376    TIMER_LIST_ENT                  timer;                              /* Timer to avoid indefinitely waiting for response */
377    UINT8                           conn_id;                            /* Connection ID */
378    UINT8                           buff_size;                          /* Connection buffer size */
379    BOOLEAN                         nv_read_cmplt;                      /* NV Read completed */
380    BOOLEAN                         w4_vsc_init;                        /* Wait for VSC initialization */
381    BOOLEAN                         nv_write_needed;                    /* Something changed - NV write is needed */
382    BOOLEAN                         assembling;                         /* Set true if in process of assembling a message  */
383    BOOLEAN                         assembly_failed;                    /* Set true if Insufficient buffer to Reassemble incoming message */
384    BOOLEAN                         w4_rsp_evt;                         /* Application command sent on HCP Event */
385    tNFA_HANDLE                     app_in_use;                         /* Index of the application that is waiting for response */
386    UINT8                           local_gate_in_use;                  /* Local gate currently working with */
387    UINT8                           remote_gate_in_use;                 /* Remote gate currently working with */
388    UINT8                           remote_host_in_use;                 /* The remote host to which a command is sent */
389    UINT8                           pipe_in_use;                        /* The pipe currently working with */
390    UINT8                           param_in_use;                       /* The registry parameter currently working with */
391    tNFA_HCI_COMMAND                cmd_sent;                           /* The last command sent */
392    BOOLEAN                         ee_disc_cmplt;                      /* EE Discovery operation completed */
393    UINT16                          msg_len;                            /* For segmentation - length of the combined message */
394    UINT16                          max_msg_len;                        /* Maximum reassembled message size */
395    UINT8                           msg_data[NFA_MAX_HCI_EVENT_LEN];    /* For segmentation - the combined message data */
396    UINT8                           *p_msg_data;                        /* For segmentation - reassembled message */
397    UINT8                           type;                               /* Instruction type of incoming message */
398    UINT8                           inst;                               /* Instruction of incoming message */
399
400    BUFFER_Q                        hci_api_q;                          /* Buffer Q to hold incoming API commands */
401    tNFA_HCI_SM_ACT                 p_vs_evt_hdlr;                      /* vendor specific event handler    */
402    tNFA_HCI_CBACK                  *p_app_cback[NFA_HCI_MAX_APP_CB];   /* Callback functions registered by the applications */
403    UINT16                          rsp_buf_size;                       /* Maximum size of APDU buffer */
404    UINT8                           *p_rsp_buf;                         /* Buffer to hold response to sent event */
405    struct
406    {
407        char                        reg_app_names[NFA_HCI_MAX_APP_CB][NFA_MAX_HCI_APP_NAME_LEN + 1];
408
409        tNFA_HCI_DYN_GATE           dyn_gates[NFA_HCI_MAX_GATE_CB];
410        tNFA_HCI_DYN_PIPE           dyn_pipes[NFA_HCI_MAX_PIPE_CB];
411
412        BOOLEAN                     b_send_conn_evts[NFA_HCI_MAX_APP_CB];
413        tNFA_ADMIN_GATE_INFO        admin_gate;
414        tNFA_LINK_MGMT_GATE_INFO    link_mgmt_gate;
415        tNFA_ID_MGMT_GATE_INFO      id_mgmt_gate;
416    } cfg;
417
418} tNFA_HCI_CB;
419
420
421/*****************************************************************************
422**  External variables
423*****************************************************************************/
424
425/* NFA HCI control block */
426#if NFA_DYNAMIC_MEMORY == FALSE
427extern tNFA_HCI_CB nfa_hci_cb;
428#else
429extern tNFA_HCI_CB *nfa_hci_cb_ptr;
430#define nfa_hci_cb (*nfa_hci_cb_ptr)
431#endif
432
433
434/*****************************************************************************
435**  External functions
436*****************************************************************************/
437
438/* Functions in nfa_hci_main.c
439*/
440extern void nfa_hci_init (void);
441extern void nfa_hci_proc_nfcc_power_mode (UINT8 nfcc_power_mode);
442extern void nfa_hci_dh_startup_complete (void);
443extern void nfa_hci_startup_complete (tNFA_STATUS status);
444extern void nfa_hci_startup (void);
445extern void nfa_hci_restore_default_config (UINT64 session_id);
446extern void nfa_hci_vsc_cback (tNFC_VS_EVT event, UINT16 data_len, UINT8 *p_data);
447
448/* Action functions in nfa_hci_act.c
449*/
450extern void nfa_hci_check_api_requests (void);
451extern void nfa_hci_handle_admin_gate_cmd (UINT8 *p_data);
452extern void nfa_hci_handle_admin_gate_rsp (UINT8 *p_data, UINT8 data_len);
453extern void nfa_hci_handle_admin_gate_evt (UINT8 *p_data);
454extern void nfa_hci_handle_link_mgm_gate_cmd (UINT8 *p_data);
455extern void nfa_hci_handle_dyn_pipe_pkt (UINT8 pipe, UINT8  *p_data, UINT16 data_len);
456extern void nfa_hci_handle_pipe_open_close_cmd (tNFA_HCI_DYN_PIPE *p_pipe);
457extern void nfa_hci_api_dealloc_gate (tNFA_HCI_EVENT_DATA *p_evt_data);
458extern void nfa_hci_api_deregister (tNFA_HCI_EVENT_DATA *p_evt_data);
459
460/* Utility functions in nfa_hci_utils.c
461*/
462extern tNFA_HCI_DYN_GATE  *nfa_hciu_alloc_gate (UINT8 gate_id, tNFA_HANDLE app_handle);
463extern tNFA_HCI_DYN_GATE  *nfa_hciu_find_gate_by_gid (UINT8 gate_id);
464extern tNFA_HCI_DYN_GATE  *nfa_hciu_find_gate_by_owner (tNFA_HANDLE app_handle);
465extern tNFA_HCI_DYN_GATE  *nfa_hciu_find_gate_with_nopipes_by_owner (tNFA_HANDLE app_handle);
466extern tNFA_HCI_DYN_PIPE  *nfa_hciu_find_pipe_by_pid (UINT8 pipe_id);
467extern tNFA_HCI_DYN_PIPE  *nfa_hciu_find_pipe_by_owner (tNFA_HANDLE app_handle);
468extern tNFA_HCI_DYN_PIPE  *nfa_hciu_find_active_pipe_by_owner (tNFA_HANDLE app_handle);
469extern tNFA_HCI_DYN_PIPE  *nfa_hciu_find_pipe_on_gate (UINT8 gate_id);
470extern tNFA_HANDLE         nfa_hciu_get_gate_owner (UINT8 gate_id);
471extern BOOLEAN             nfa_hciu_is_active_host (UINT8 host_id);
472extern tNFA_HCI_DYN_PIPE  *nfa_hciu_find_active_pipe_on_gate (UINT8 gate_id);
473extern tNFA_HANDLE         nfa_hciu_get_pipe_owner (UINT8 pipe_id);
474extern UINT8               nfa_hciu_count_open_pipes_on_gate (tNFA_HCI_DYN_GATE *p_gate);
475extern UINT8               nfa_hciu_count_pipes_on_gate (tNFA_HCI_DYN_GATE *p_gate);
476extern tNFA_STATUS         nfa_hciu_asmbl_dyn_pipe_pkt (UINT8 *p_data, UINT8 data_len);
477
478extern tNFA_HCI_RESPONSE   nfa_hciu_add_pipe_to_gate (UINT8 pipe, UINT8 local_gate, UINT8 dest_host, UINT8 dest_gate);
479extern tNFA_HCI_RESPONSE   nfa_hciu_add_pipe_to_static_gate (UINT8 local_gate, UINT8 pipe_id, UINT8 dest_host, UINT8 dest_gate);
480
481extern tNFA_HCI_RESPONSE   nfa_hciu_release_pipe (UINT8 pipe_id);
482extern void                nfa_hciu_release_gate (UINT8 gate);
483extern void                nfa_hciu_remove_all_pipes_from_host (UINT8 host);
484extern UINT8               nfa_hciu_get_allocated_gate_list (UINT8 *p_gate_list);
485
486extern void                nfa_hciu_send_to_app (tNFA_HCI_EVT event, tNFA_HCI_EVT_DATA *p_evt, tNFA_HANDLE app_handle);
487extern void                nfa_hciu_send_to_all_apps (tNFA_HCI_EVT event, tNFA_HCI_EVT_DATA *p_evt);
488extern void                nfa_hciu_send_to_apps_handling_connectivity_evts (tNFA_HCI_EVT event, tNFA_HCI_EVT_DATA *p_evt);
489
490extern tNFA_STATUS nfa_hciu_send_close_pipe_cmd (UINT8 pipe);
491extern tNFA_STATUS nfa_hciu_send_delete_pipe_cmd (UINT8 pipe);
492extern tNFA_STATUS nfa_hciu_send_clear_all_pipe_cmd (void);
493extern tNFA_STATUS nfa_hciu_send_open_pipe_cmd (UINT8 pipe);
494extern tNFA_STATUS nfa_hciu_send_get_param_cmd (UINT8 pipe, UINT8 index);
495extern tNFA_STATUS nfa_hciu_send_create_pipe_cmd (UINT8 source_gate, UINT8 dest_host, UINT8 dest_gate);
496extern tNFA_STATUS nfa_hciu_send_set_param_cmd (UINT8 pipe, UINT8 index, UINT8 length, UINT8 *p_data);
497extern tNFA_STATUS nfa_hciu_send_msg (UINT8 pipe_id, UINT8 type, UINT8 instruction, UINT16 pkt_len, UINT8 *p_pkt);
498
499
500
501#if (BT_TRACE_VERBOSE == TRUE)
502extern char *nfa_hciu_type_2_str (UINT8 type);
503extern char *nfa_hciu_instr_2_str (UINT8 type);
504extern char *nfa_hciu_get_event_name (UINT16 event);
505extern char *nfa_hciu_get_response_name (UINT8 rsp_code);
506extern char *nfa_hciu_get_state_name (UINT8 state);
507extern char *nfa_hciu_get_type_inst_names (UINT8 pipe, UINT8 type, UINT8 inst);
508extern char *nfa_hciu_evt_2_str (UINT8 pipe_id, UINT8 evt);
509#endif
510
511
512#endif /* NFA_HCI_INT_H */
513