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