nfa_hci_int.h revision f8a4ca325ef137a94869b34d36095ba7d08816a3
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/* Internal event structures.
88**
89** Note, every internal structure starts with a BT_HDR and an app handle
90*/
91
92/* data type for NFA_HCI_API_REGISTER_APP_EVT */
93typedef struct
94{
95    BT_HDR              hdr;
96    tNFA_HANDLE         hci_handle;
97    char                app_name[NFA_MAX_HCI_APP_NAME_LEN + 1];
98    tNFA_HCI_CBACK      *p_cback;
99    BOOLEAN             b_send_conn_evts;
100    UINT16              buf_size;
101    UINT8               *p_evt_buf;
102} tNFA_HCI_API_REGISTER_APP;
103
104/* data type for NFA_HCI_API_DEREGISTER_APP_EVT */
105typedef struct
106{
107    BT_HDR              hdr;
108    tNFA_HANDLE         hci_handle;
109    char                app_name[NFA_MAX_HCI_APP_NAME_LEN + 1];
110} tNFA_HCI_API_DEREGISTER_APP;
111
112/* data type for NFA_HCI_API_GET_APP_GATE_PIPE_EVT */
113typedef struct
114{
115    BT_HDR              hdr;
116    tNFA_HANDLE         hci_handle;
117} tNFA_HCI_API_GET_APP_GATE_PIPE;
118
119/* data type for NFA_HCI_API_ALLOC_GATE_EVT */
120typedef struct
121{
122    BT_HDR              hdr;
123    tNFA_HANDLE         hci_handle;
124} tNFA_HCI_API_ALLOC_GATE;
125
126
127/* data type for NFA_HCI_API_DEALLOC_GATE_EVT */
128typedef struct
129{
130    BT_HDR              hdr;
131    tNFA_HANDLE         hci_handle;
132    UINT8               gate;
133} tNFA_HCI_API_DEALLOC_GATE;
134
135/* data type for NFA_HCI_API_GET_HOST_LIST_EVT */
136typedef struct
137{
138    BT_HDR              hdr;
139    tNFA_HANDLE         hci_handle;
140    tNFA_STATUS         status;
141} tNFA_HCI_API_GET_HOST_LIST;
142
143/* data type for NFA_HCI_API_GET_REGISTRY_EVT */
144typedef struct
145{
146    BT_HDR              hdr;
147    tNFA_HANDLE         hci_handle;
148    UINT8               pipe;
149    UINT8               reg_inx;
150} tNFA_HCI_API_GET_REGISTRY;
151
152/* data type for NFA_HCI_API_SET_REGISTRY_EVT */
153typedef struct
154{
155    BT_HDR              hdr;
156    tNFA_HANDLE         hci_handle;
157    UINT8               pipe;
158    UINT8               reg_inx;
159    UINT8               size;
160    UINT8               data[255];
161} tNFA_HCI_API_SET_REGISTRY;
162
163/* data type for NFA_HCI_API_CREATE_PIPE_EVT */
164typedef struct
165{
166    BT_HDR              hdr;
167    tNFA_HANDLE         hci_handle;
168    tNFA_STATUS         status;
169    UINT8               source_gate;
170    UINT8               dest_host;
171    UINT8               dest_gate;
172} tNFA_HCI_API_CREATE_PIPE_EVT;
173
174/* data type for NFA_HCI_API_OPEN_PIPE_EVT */
175typedef struct
176{
177    BT_HDR              hdr;
178    tNFA_HANDLE         hci_handle;
179    tNFA_STATUS         status;
180    UINT8               pipe;
181} tNFA_HCI_API_OPEN_PIPE_EVT;
182
183/* data type for NFA_HCI_API_CLOSE_PIPE_EVT */
184typedef struct
185{
186    BT_HDR              hdr;
187    tNFA_HANDLE         hci_handle;
188    tNFA_STATUS         status;
189    UINT8               pipe;
190} tNFA_HCI_API_CLOSE_PIPE_EVT;
191
192/* data type for NFA_HCI_API_DELETE_PIPE_EVT */
193typedef struct
194{
195    BT_HDR              hdr;
196    tNFA_HANDLE         hci_handle;
197    tNFA_STATUS         status;
198    UINT8               pipe;
199} tNFA_HCI_API_DELETE_PIPE_EVT;
200
201/* data type for NFA_HCI_API_SEND_EVENT_EVT */
202typedef struct
203{
204    BT_HDR              hdr;
205    tNFA_HANDLE         hci_handle;
206    UINT8               pipe;
207    UINT8               evt_code;
208    UINT16              evt_len;
209    UINT8               data[NFA_MAX_HCI_EVENT_LEN];
210} tNFA_HCI_API_SEND_EVENT_EVT;
211
212/* data type for NFA_HCI_API_SEND_CMD_EVT */
213typedef struct
214{
215    BT_HDR              hdr;
216    tNFA_HANDLE         hci_handle;
217    UINT8               pipe;
218    UINT8               cmd_code;
219    UINT16              cmd_len;
220    UINT8               data[NFA_MAX_HCI_CMD_LEN];
221} tNFA_HCI_API_SEND_CMD_EVT;
222
223/* data type for NFA_HCI_RSP_NV_READ_EVT */
224typedef struct
225{
226    BT_HDR              hdr;
227    UINT8               block;
228    UINT16              size;
229    tNFA_STATUS         status;
230} tNFA_HCI_RSP_NV_READ_EVT;
231
232/* data type for NFA_HCI_RSP_NV_WRITE_EVT */
233typedef struct
234{
235    BT_HDR              hdr;
236    tNFA_STATUS         status;
237} tNFA_HCI_RSP_NV_WRITE_EVT;
238
239/* data type for NFA_HCI_VSC_INIT_EVT */
240typedef struct
241{
242    BT_HDR              hdr;
243    tNFA_STATUS         status;
244} tNFA_HCI_VSC_INIT_EVT;
245
246/* data type for NFA_HCI_EE_DISC_CMPLT_EVT */
247typedef struct
248{
249    BT_HDR              hdr;
250    BOOLEAN             b_disc_cmplt;
251    tNFA_STATUS         status;
252} tNFA_HCI_EE_DISC_CMPLT_EVT;
253
254/* data type for NFA_HCI_HCP_CONN_CREATE_EVT */
255typedef struct
256{
257    BT_HDR              hdr;
258    tNFA_STATUS         status;
259} tNFA_HCI_HCP_CONN_CREATE_EVT;
260
261/* data type for NFA_HCI_API_SEND_RSP_EVT */
262typedef struct
263{
264    BT_HDR              hdr;
265    tNFA_HANDLE         hci_handle;
266    UINT8               pipe;
267    UINT8               response;
268    UINT8               size;
269    UINT8               data[255];
270} tNFA_HCI_API_SEND_RSP_EVT;
271
272/* common data type for internal events */
273typedef struct
274{
275    BT_HDR              hdr;
276    tNFA_HANDLE         hci_handle;
277} tNFA_HCI_COMM_DATA;
278
279/* union of all event data types */
280typedef union
281{
282    BT_HDR                              hdr;
283    tNFA_HCI_COMM_DATA                  comm;
284
285    /* API events */
286    tNFA_HCI_API_REGISTER_APP           app_info;                       /* Register/Deregister an application */
287    tNFA_HCI_API_GET_APP_GATE_PIPE      get_gate_pipe_list;             /* Get the list of gates and pipes created for the application */
288    tNFA_HCI_API_ALLOC_GATE             gate_info;                      /* Allocate a dynamic gate to the application */
289    tNFA_HCI_API_DEALLOC_GATE           gate_dealloc;                   /* Deallocate the gate allocated to the application */
290    tNFA_HCI_API_CREATE_PIPE_EVT        create_pipe;                    /* Create a pipe */
291    tNFA_HCI_API_OPEN_PIPE_EVT          open_pipe;                      /* Open a pipe */
292    tNFA_HCI_API_CLOSE_PIPE_EVT         close_pipe;                     /* Close a pipe */
293    tNFA_HCI_API_DELETE_PIPE_EVT        delete_pipe;                    /* Delete a pipe */
294    tNFA_HCI_API_GET_HOST_LIST          get_host_list;                  /* Get the list of Host in the network */
295    tNFA_HCI_API_GET_REGISTRY           get_registry;                   /* Get a registry entry on a host */
296    tNFA_HCI_API_SET_REGISTRY           set_registry;                   /* Set a registry entry on a host */
297    tNFA_HCI_API_SEND_CMD_EVT           send_cmd;                       /* Send a event on a pipe to a host */
298    tNFA_HCI_API_SEND_RSP_EVT           send_rsp;                       /* Response to a command sent on a pipe to a host */
299    tNFA_HCI_API_SEND_EVENT_EVT         send_evt;                       /* Send a command on a pipe to a host */
300
301    /* Internal events */
302    tNFA_HCI_RSP_NV_READ_EVT            nv_read;
303    tNFA_HCI_RSP_NV_WRITE_EVT           nv_write;
304    tNFA_HCI_VSC_INIT_EVT               vsc_init;
305    tNFA_HCI_EE_DISC_CMPLT_EVT          ee_disc_cmplt;
306    tNFA_HCI_HCP_CONN_CREATE_EVT        conn_create;
307} tNFA_HCI_EVENT_DATA;
308
309/* type for State Machine (SM) action functions */
310typedef void (*tNFA_HCI_SM_ACT) (tNFA_HCI_EVENT_DATA *p_data);
311/*****************************************************************************
312**  control block
313*****************************************************************************/
314
315/* Dynamic pipe control block */
316typedef struct
317{
318    UINT8                   pipe_id;                /* Pipe ID */
319    tNFA_HCI_PIPE_STATE     pipe_state;             /* State of the Pipe */
320    UINT8                   local_gate;             /* local gate id */
321    UINT8                   dest_host;              /* Peer host to which this pipe is connected */
322    UINT8                   dest_gate;              /* Peer gate to which this pipe is connected */
323} tNFA_HCI_DYN_PIPE;
324
325/* Dynamic gate control block */
326typedef struct
327{
328    UINT8                   gate_id;                /* local gate id */
329    tNFA_HANDLE             gate_owner;             /* NFA-HCI handle assigned to the application which owns the gate */
330    UINT32                  pipe_inx_mask;          /* Bit 0 == pipe inx 0, etc */
331} tNFA_HCI_DYN_GATE;
332
333/* Admin gate control block */
334typedef struct
335{
336    tNFA_HCI_PIPE_STATE pipe01_state;               /* State of Pipe '01' */
337    UINT64              session_id;                 /* Session ID of the host network */
338} tNFA_ADMIN_GATE_INFO;
339
340/* Link management gate control block */
341typedef struct
342{
343    tNFA_HCI_PIPE_STATE pipe00_state;               /* State of Pipe '00' */
344    UINT16              rec_errors;                 /* Receive errors */
345} tNFA_LINK_MGMT_GATE_INFO;
346
347/* Identity management gate control block */
348typedef struct
349{
350    UINT32              pipe_inx_mask;                  /* Bit 0 == pipe inx 0, etc */
351    UINT16              version_sw;                     /* Software version number */
352    UINT16              version_hw;                     /* Hardware version number */
353    UINT8               vendor_name[20];                /* Vendor name */
354    UINT8               model_id;                       /* Model ID */
355    UINT8               hci_version;                    /* HCI Version */
356} tNFA_ID_MGMT_GATE_INFO;
357
358/* Register application control block */
359typedef struct
360{
361    tNFA_HCI_CBACK      *p_app_cback;                   /* Callback function registered by the application */
362    UINT16              buf_size;                       /* Maximum size of APDU buffer */
363    UINT8               *p_evt_buf;                     /* Buffer to hold reassembled event */
364} tNFA_HCI_APP_INFO;
365
366/* Internal flags */
367#define NFA_HCI_FL_DISABLING        0x01                /* sub system is being disabled */
368#define NFA_HCI_FL_NV_CHANGED       0x02                /* NV Ram changed */
369
370
371/* NFA HCI control block */
372typedef struct
373{
374    tNFA_HCI_STATE                  hci_state;                          /* state of the HCI */
375    UINT8                           num_nfcee;
376    UINT8                           inactive_host[NFA_HCI_MAX_HOST_IN_NETWORK]; /* Inactive host in the host network */
377    BOOLEAN                         b_low_power_mode;                   /* Host controller in low power mode */
378    BOOLEAN                         b_hci_netwk_reset;                  /* Command sent to reset HCI Network */
379    BOOLEAN                         w4_hci_netwk_init;                  /* Wait for other host in network to initialize */
380    TIMER_LIST_ENT                  timer;                              /* Timer to avoid indefinitely waiting for response */
381    UINT8                           conn_id;                            /* Connection ID */
382    UINT8                           buff_size;                          /* Connection buffer size */
383    BOOLEAN                         nv_read_cmplt;                      /* NV Read completed */
384    BOOLEAN                         w4_vsc_init;                        /* Wait for VSC initialization */
385    BOOLEAN                         nv_write_needed;                    /* Something changed - NV write is needed */
386    BOOLEAN                         assembling;                         /* Set true if in process of assembling a message  */
387    tNFA_HANDLE                     app_in_use;                         /* ??? Index of the application that is waiting for response */
388    UINT8                           local_gate_in_use;                  /* Local gate currently working with */
389    UINT8                           remote_gate_in_use;                 /* Remote gate currently working with */
390    UINT8                           remote_host_in_use;                 /* The remote host to which a command is sent */
391    UINT8                           pipe_in_use;                        /* The pipe currently working with */
392    UINT8                           param_in_use;                       /* The registry parameter currently working with */
393    tNFA_HCI_COMMAND                cmd_sent;                           /* The last command sent */
394    BOOLEAN                         ee_disc_cmplt;                      /* EE Discovery operation completed */
395    UINT16                          msg_len;                            /* For segmentation - length of the combined message */
396    UINT16                          max_msg_len;                        /* Maximum reassembled message size */
397    UINT8                           msg_data[NFA_MAX_HCI_EVENT_LEN];    /* For segmentation - the combined message data */
398    UINT8                           *p_msg_data;                        /* For segmentation - reassembled message */
399    UINT8                           type;                               /* Instruction type of incoming message */
400    UINT8                           inst;                               /* Instruction of incoming message */
401
402    BUFFER_Q                        hci_api_q;                          /* Buffer Q to hold incoming API commands */
403    tNFA_HCI_SM_ACT                 p_vs_evt_hdlr;                      /* vendor specific event handler    */
404    tNFA_HCI_APP_INFO               app_info[NFA_HCI_MAX_APP_CB];       /* Application specific information */
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, UINT8 data_len);
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, UINT8 data_len);
454extern void nfa_hci_handle_link_mgm_gate_cmd (UINT8 *p_data, UINT8 data_len);
455extern void nfa_hci_handle_dyn_pipe_pkt (UINT8 pipe, UINT8  *p_data, UINT8 type, UINT16 data_len);
456extern void nfa_hci_handle_pipe_open_close_cmd (UINT8 instruction, 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