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