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 EE. 22 * 23 ******************************************************************************/ 24 #ifndef NFA_EE_INT_H 25 #define NFA_EE_INT_H 26 #include "nfa_ee_api.h" 27 #include "nfa_sys.h" 28 #include "nfc_api.h" 29 30 /***************************************************************************** 31 ** Constants and data types 32 *****************************************************************************/ 33 /* the number of tNFA_EE_ECBs (for NFCEEs and DH) */ 34 #define NFA_EE_NUM_ECBS (NFA_EE_MAX_EE_SUPPORTED + 1) 35 /* The index for DH in nfa_ee_cb.ee_cb[] */ 36 #define NFA_EE_CB_4_DH NFA_EE_MAX_EE_SUPPORTED 37 #define NFA_EE_INVALID 0xFF 38 /* only A, B, F, Bprime are supported by UICC now */ 39 #define NFA_EE_MAX_TECH_ROUTE 4 40 41 #ifndef NFA_EE_AID_CFG_TAG_NAME 42 /* AID */ 43 #define NFA_EE_AID_CFG_TAG_NAME 0x4F 44 #endif 45 46 /* NFA EE events */ 47 enum { 48 NFA_EE_API_DISCOVER_EVT = NFA_SYS_EVT_START(NFA_ID_EE), 49 NFA_EE_API_REGISTER_EVT, 50 NFA_EE_API_DEREGISTER_EVT, 51 NFA_EE_API_MODE_SET_EVT, 52 NFA_EE_API_SET_TECH_CFG_EVT, 53 NFA_EE_API_SET_PROTO_CFG_EVT, 54 NFA_EE_API_ADD_AID_EVT, 55 NFA_EE_API_REMOVE_AID_EVT, 56 NFA_EE_API_ADD_SYSCODE_EVT, 57 NFA_EE_API_REMOVE_SYSCODE_EVT, 58 NFA_EE_API_LMRT_SIZE_EVT, 59 NFA_EE_API_UPDATE_NOW_EVT, 60 NFA_EE_API_CONNECT_EVT, 61 NFA_EE_API_SEND_DATA_EVT, 62 NFA_EE_API_DISCONNECT_EVT, 63 64 NFA_EE_NCI_DISC_RSP_EVT, 65 NFA_EE_NCI_DISC_NTF_EVT, 66 NFA_EE_NCI_MODE_SET_RSP_EVT, 67 NFA_EE_NCI_CONN_EVT, 68 NFA_EE_NCI_DATA_EVT, 69 NFA_EE_NCI_ACTION_NTF_EVT, 70 NFA_EE_NCI_DISC_REQ_NTF_EVT, 71 NFA_EE_NCI_WAIT_RSP_EVT, 72 73 NFA_EE_ROUT_TIMEOUT_EVT, 74 NFA_EE_DISCV_TIMEOUT_EVT, 75 NFA_EE_CFG_TO_NFCC_EVT, 76 NFA_EE_NCI_NFCEE_STATUS_NTF_EVT, 77 NFA_EE_MAX_EVT 78 79 }; 80 81 typedef uint16_t tNFA_EE_INT_EVT; 82 /* for listen mode routing table*/ 83 #define NFA_EE_AE_ROUTE 0x80 84 #define NFA_EE_AE_VS 0x40 85 86 /* NFA EE Management state */ 87 enum { 88 NFA_EE_EM_STATE_INIT = 0, 89 NFA_EE_EM_STATE_INIT_DONE, 90 NFA_EE_EM_STATE_RESTORING, 91 NFA_EE_EM_STATE_DISABLING, 92 NFA_EE_EM_STATE_DISABLED, 93 94 NFA_EE_EM_STATE_MAX 95 }; 96 typedef uint8_t tNFA_EE_EM_STATE; 97 98 /* NFA EE connection status */ 99 enum { 100 NFA_EE_CONN_ST_NONE, /* not connected */ 101 NFA_EE_CONN_ST_WAIT, /* connection is initiated; waiting for ack */ 102 NFA_EE_CONN_ST_CONN, /* connected; can send/receive data */ 103 NFA_EE_CONN_ST_DISC /* disconnecting; waiting for ack */ 104 }; 105 typedef uint8_t tNFA_EE_CONN_ST; 106 107 #define NFA_EE_MAX_AID_CFG_LEN (510) 108 109 #define NFA_EE_SYSTEM_CODE_LEN 02 110 #define NFA_EE_SYSTEM_CODE_TLV_SIZE 06 111 #define NFA_EE_MAX_SYSTEM_CODE_ENTRIES 10 112 #define NFA_EE_MAX_SYSTEM_CODE_CFG_LEN \ 113 (NFA_EE_MAX_SYSTEM_CODE_ENTRIES * NFA_EE_SYSTEM_CODE_TLV_SIZE) 114 115 /* NFA EE control block flags: 116 * use to indicate an API function has changed the configuration of the 117 * associated NFCEE 118 * The flags are cleared when the routing table/VS is updated */ 119 /* technology routing changed */ 120 #define NFA_EE_ECB_FLAGS_TECH 0x02 121 /* protocol routing changed */ 122 #define NFA_EE_ECB_FLAGS_PROTO 0x04 123 /* AID routing changed */ 124 #define NFA_EE_ECB_FLAGS_AID 0x08 125 /* System Code routing changed */ 126 #define NFA_EE_ECB_FLAGS_SYSCODE 0xE0 127 /* VS changed */ 128 #define NFA_EE_ECB_FLAGS_VS 0x10 129 /* Restore related */ 130 #define NFA_EE_ECB_FLAGS_RESTORE 0x20 131 /* routing flags changed */ 132 #define NFA_EE_ECB_FLAGS_ROUTING 0x0E 133 /* NFCEE Discover Request NTF is set */ 134 #define NFA_EE_ECB_FLAGS_DISC_REQ 0x40 135 /* DISC_REQ N reported before DISC N */ 136 #define NFA_EE_ECB_FLAGS_ORDER 0x80 137 typedef uint8_t tNFA_EE_ECB_FLAGS; 138 139 /* part of tNFA_EE_STATUS; for internal use only */ 140 /* waiting for restore to full power mode to complete */ 141 #define NFA_EE_STATUS_RESTORING 0x20 142 /* this bit is in ee_status for internal use only */ 143 #define NFA_EE_STATUS_INT_MASK 0x20 144 145 /* NFA-EE information for a particular NFCEE Entity (including DH) */ 146 typedef struct { 147 tNFA_TECHNOLOGY_MASK 148 tech_switch_on; /* default routing - technologies switch_on */ 149 tNFA_TECHNOLOGY_MASK 150 tech_switch_off; /* default routing - technologies switch_off */ 151 tNFA_TECHNOLOGY_MASK 152 tech_battery_off; /* default routing - technologies battery_off*/ 153 tNFA_TECHNOLOGY_MASK 154 tech_screen_lock; /* default routing - technologies screen_lock*/ 155 tNFA_TECHNOLOGY_MASK 156 tech_screen_off; /* default routing - technologies screen_off*/ 157 tNFA_TECHNOLOGY_MASK 158 tech_screen_off_lock; /* default routing - technologies screen_off_lock*/ 159 tNFA_PROTOCOL_MASK 160 proto_switch_on; /* default routing - protocols switch_on */ 161 tNFA_PROTOCOL_MASK 162 proto_switch_off; /* default routing - protocols switch_off */ 163 tNFA_PROTOCOL_MASK 164 proto_battery_off; /* default routing - protocols battery_off */ 165 tNFA_PROTOCOL_MASK 166 proto_screen_lock; /* default routing - protocols screen_lock */ 167 tNFA_PROTOCOL_MASK 168 proto_screen_off; /* default routing - protocols screen_off */ 169 tNFA_PROTOCOL_MASK 170 proto_screen_off_lock; /* default routing - protocols screen_off_lock */ 171 tNFA_EE_CONN_ST conn_st; /* connection status */ 172 uint8_t conn_id; /* connection id */ 173 tNFA_EE_CBACK* p_ee_cback; /* the callback function */ 174 175 /* Each AID entry has an ssociated aid_len, aid_pwr_cfg, aid_rt_info. 176 * aid_cfg[] contains AID and maybe some other VS information in TLV format 177 * The first T is always NFA_EE_AID_CFG_TAG_NAME, the L is the actual AID 178 * length 179 * the aid_len is the total length of all the TLVs associated with this AID 180 * entry 181 */ 182 uint8_t aid_len[NFA_EE_MAX_AID_ENTRIES]; /* the actual lengths in aid_cfg */ 183 uint8_t aid_pwr_cfg[NFA_EE_MAX_AID_ENTRIES]; /* power configuration of this 184 AID entry */ 185 uint8_t aid_rt_info[NFA_EE_MAX_AID_ENTRIES]; /* route/vs info for this AID 186 entry */ 187 uint8_t aid_cfg[NFA_EE_MAX_AID_CFG_LEN]; /* routing entries based on AID */ 188 uint8_t aid_entries; /* The number of AID entries in aid_cfg */ 189 uint8_t nfcee_id; /* ID for this NFCEE */ 190 uint8_t ee_status; /* The NFCEE status */ 191 uint8_t ee_old_status; /* The NFCEE status before going to low power mode */ 192 tNFA_EE_INTERFACE 193 ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE supported interface */ 194 tNFA_EE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* the TLV */ 195 uint8_t num_interface; /* number of Target interface */ 196 uint8_t num_tlvs; /* number of TLVs */ 197 uint8_t ee_power_supply_status; /* power supply of NFCEE*/ 198 tNFA_EE_ECB_FLAGS ecb_flags; /* the flags of this control block */ 199 tNFA_EE_INTERFACE use_interface; /* NFCEE interface used for the connection */ 200 tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */ 201 tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */ 202 tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */ 203 tNFA_NFC_PROTOCOL lbp_protocol; /* Listen B' protocol */ 204 uint8_t size_mask; /* the size for technology and protocol routing */ 205 uint16_t size_aid; /* the size for aid routing */ 206 uint8_t aid_info[NFA_EE_MAX_AID_ENTRIES]; /* Aid Info Prefix/Suffix/Exact */ 207 /*System Code Based Routing Variables*/ 208 uint8_t sys_code_cfg[NFA_EE_MAX_SYSTEM_CODE_ENTRIES * NFA_EE_SYSTEM_CODE_LEN]; 209 uint8_t sys_code_pwr_cfg[NFA_EE_MAX_SYSTEM_CODE_ENTRIES]; 210 uint8_t sys_code_rt_loc[NFA_EE_MAX_SYSTEM_CODE_ENTRIES]; 211 uint8_t sys_code_rt_loc_vs_info[NFA_EE_MAX_SYSTEM_CODE_ENTRIES]; 212 /* The number of SC entries in sys_code_cfg buffer*/ 213 uint8_t sys_code_cfg_entries; 214 uint16_t size_sys_code; /* The size for system code routing */ 215 } tNFA_EE_ECB; 216 217 /* data type for NFA_EE_API_DISCOVER_EVT */ 218 typedef struct { 219 NFC_HDR hdr; 220 tNFA_EE_CBACK* p_cback; 221 } tNFA_EE_API_DISCOVER; 222 223 /* data type for NFA_EE_API_REGISTER_EVT */ 224 typedef struct { 225 NFC_HDR hdr; 226 tNFA_EE_CBACK* p_cback; 227 } tNFA_EE_API_REGISTER; 228 229 /* data type for NFA_EE_API_DEREGISTER_EVT */ 230 typedef struct { 231 NFC_HDR hdr; 232 int index; 233 } tNFA_EE_API_DEREGISTER; 234 235 /* data type for NFA_EE_API_MODE_SET_EVT */ 236 typedef struct { 237 NFC_HDR hdr; 238 tNFA_EE_ECB* p_cb; 239 uint8_t nfcee_id; 240 uint8_t mode; 241 } tNFA_EE_API_MODE_SET; 242 243 /* data type for NFA_EE_API_SET_TECH_CFG_EVT */ 244 typedef struct { 245 NFC_HDR hdr; 246 tNFA_EE_ECB* p_cb; 247 uint8_t nfcee_id; 248 tNFA_TECHNOLOGY_MASK technologies_switch_on; 249 tNFA_TECHNOLOGY_MASK technologies_switch_off; 250 tNFA_TECHNOLOGY_MASK technologies_battery_off; 251 tNFA_TECHNOLOGY_MASK technologies_screen_lock; 252 tNFA_TECHNOLOGY_MASK technologies_screen_off; 253 tNFA_TECHNOLOGY_MASK technologies_screen_off_lock; 254 } tNFA_EE_API_SET_TECH_CFG; 255 256 /* data type for NFA_EE_API_SET_PROTO_CFG_EVT */ 257 typedef struct { 258 NFC_HDR hdr; 259 tNFA_EE_ECB* p_cb; 260 uint8_t nfcee_id; 261 tNFA_PROTOCOL_MASK protocols_switch_on; 262 tNFA_PROTOCOL_MASK protocols_switch_off; 263 tNFA_PROTOCOL_MASK protocols_battery_off; 264 tNFA_PROTOCOL_MASK protocols_screen_lock; 265 tNFA_PROTOCOL_MASK protocols_screen_off; 266 tNFA_PROTOCOL_MASK protocols_screen_off_lock; 267 } tNFA_EE_API_SET_PROTO_CFG; 268 269 /* data type for NFA_EE_API_ADD_AID_EVT */ 270 typedef struct { 271 NFC_HDR hdr; 272 tNFA_EE_ECB* p_cb; 273 uint8_t nfcee_id; 274 uint8_t aid_len; 275 uint8_t* p_aid; 276 tNFA_EE_PWR_STATE power_state; 277 uint8_t aidInfo; 278 } tNFA_EE_API_ADD_AID; 279 280 /* data type for NFA_EE_API_REMOVE_AID_EVT */ 281 typedef struct { 282 NFC_HDR hdr; 283 uint8_t aid_len; 284 uint8_t* p_aid; 285 } tNFA_EE_API_REMOVE_AID; 286 287 /* data type for NFA_EE_API_ADD_SYSCODE_EVT */ 288 typedef struct { 289 NFC_HDR hdr; 290 tNFA_EE_ECB* p_cb; 291 uint8_t nfcee_id; 292 uint16_t syscode; 293 tNFA_EE_PWR_STATE power_state; 294 } tNFA_EE_API_ADD_SYSCODE; 295 296 /* data type for NFA_EE_API_REMOVE_SYSCODE_EVT */ 297 typedef struct { 298 NFC_HDR hdr; 299 uint16_t syscode; 300 } tNFA_EE_API_REMOVE_SYSCODE; 301 302 /* data type for NFA_EE_API_LMRT_SIZE_EVT */ 303 typedef NFC_HDR tNFA_EE_API_LMRT_SIZE; 304 305 /* data type for NFA_EE_API_CONNECT_EVT */ 306 typedef struct { 307 NFC_HDR hdr; 308 tNFA_EE_ECB* p_cb; 309 uint8_t nfcee_id; 310 uint8_t ee_interface; 311 tNFA_EE_CBACK* p_cback; 312 } tNFA_EE_API_CONNECT; 313 314 /* data type for NFA_EE_API_SEND_DATA_EVT */ 315 typedef struct { 316 NFC_HDR hdr; 317 tNFA_EE_ECB* p_cb; 318 uint8_t nfcee_id; 319 uint16_t data_len; 320 uint8_t* p_data; 321 } tNFA_EE_API_SEND_DATA; 322 323 /* data type for NFA_EE_API_DISCONNECT_EVT */ 324 typedef struct { 325 NFC_HDR hdr; 326 tNFA_EE_ECB* p_cb; 327 uint8_t nfcee_id; 328 } tNFA_EE_API_DISCONNECT; 329 330 /* common data type for internal events with nfa_ee_use_cfg_cb[] as TRUE */ 331 typedef struct { 332 NFC_HDR hdr; 333 tNFA_EE_ECB* p_cb; 334 uint8_t nfcee_id; 335 } tNFA_EE_CFG_HDR; 336 337 /* data type for NFA_EE_NCI_DISC_RSP_EVT */ 338 typedef struct { 339 NFC_HDR hdr; 340 tNFC_NFCEE_DISCOVER_REVT* p_data; 341 } tNFA_EE_NCI_DISC_RSP; 342 343 /* data type for NFA_EE_NCI_DISC_NTF_EVT */ 344 typedef struct { 345 NFC_HDR hdr; 346 tNFC_NFCEE_INFO_REVT* p_data; 347 } tNFA_EE_NCI_DISC_NTF; 348 349 /* data type for NFA_EE_NCI_MODE_SET_RSP_EVT */ 350 typedef struct { 351 NFC_HDR hdr; 352 tNFC_NFCEE_MODE_SET_REVT* p_data; 353 } tNFA_EE_NCI_MODE_SET; 354 355 /* data type for NFA_EE_NCI_WAIT_RSP_EVT */ 356 typedef struct { 357 NFC_HDR hdr; 358 void* p_data; 359 uint8_t opcode; 360 } tNFA_EE_NCI_WAIT_RSP; 361 362 /* data type for NFA_EE_NCI_CONN_EVT and NFA_EE_NCI_DATA_EVT */ 363 typedef struct { 364 NFC_HDR hdr; 365 uint8_t conn_id; 366 tNFC_CONN_EVT event; 367 tNFC_CONN* p_data; 368 } tNFA_EE_NCI_CONN; 369 370 /* data type for NFA_EE_NCI_ACTION_NTF_EVT */ 371 typedef struct { 372 NFC_HDR hdr; 373 tNFC_EE_ACTION_REVT* p_data; 374 } tNFA_EE_NCI_ACTION; 375 376 /* data type for NFA_EE_NCI_DISC_REQ_NTF_EVT */ 377 typedef struct { 378 NFC_HDR hdr; 379 tNFC_EE_DISCOVER_REQ_REVT* p_data; 380 } tNFA_EE_NCI_DISC_REQ; 381 382 /* data type for NFA_EE_NCI_NFCEE_STATUS_EVT */ 383 typedef struct { 384 NFC_HDR hdr; 385 tNFC_NFCEE_STATUS_REVT* p_data; 386 } tNFA_EE_NCI_NFCEE_STATUS_NTF; 387 388 /* union of all event data types */ 389 typedef union { 390 NFC_HDR hdr; 391 tNFA_EE_CFG_HDR cfg_hdr; 392 tNFA_EE_API_DISCOVER ee_discover; 393 tNFA_EE_API_REGISTER ee_register; 394 tNFA_EE_API_DEREGISTER deregister; 395 tNFA_EE_API_MODE_SET mode_set; 396 tNFA_EE_API_SET_TECH_CFG set_tech; 397 tNFA_EE_API_SET_PROTO_CFG set_proto; 398 tNFA_EE_API_ADD_AID add_aid; 399 tNFA_EE_API_REMOVE_AID rm_aid; 400 tNFA_EE_API_ADD_SYSCODE add_syscode; 401 tNFA_EE_API_REMOVE_SYSCODE rm_syscode; 402 tNFA_EE_API_LMRT_SIZE lmrt_size; 403 tNFA_EE_API_CONNECT connect; 404 tNFA_EE_API_SEND_DATA send_data; 405 tNFA_EE_API_DISCONNECT disconnect; 406 tNFA_EE_NCI_DISC_RSP disc_rsp; 407 tNFA_EE_NCI_DISC_NTF disc_ntf; 408 tNFA_EE_NCI_MODE_SET mode_set_rsp; 409 tNFA_EE_NCI_WAIT_RSP wait_rsp; 410 tNFA_EE_NCI_CONN conn; 411 tNFA_EE_NCI_ACTION act; 412 tNFA_EE_NCI_DISC_REQ disc_req; 413 tNFA_EE_NCI_NFCEE_STATUS_NTF nfcee_status_ntf; 414 } tNFA_EE_MSG; 415 416 /* type for State Machine (SM) action functions */ 417 typedef void (*tNFA_EE_SM_ACT)(tNFA_EE_MSG* p_data); 418 419 /***************************************************************************** 420 ** control block 421 *****************************************************************************/ 422 #define NFA_EE_CFGED_UPDATE_NOW 0x80 423 /* either switch off or battery off is configured */ 424 #define NFA_EE_CFGED_OFF_ROUTING 0x40 425 426 /* the following status are the definition used in ee_cfg_sts */ 427 #define NFA_EE_STS_CHANGED_ROUTING 0x01 428 #define NFA_EE_STS_CHANGED 0x0f 429 #define NFA_EE_STS_PREV_ROUTING 0x10 430 #define NFA_EE_STS_PREV 0xf0 431 432 /* need to report NFA_EE_UPDATED_EVT */ 433 #define NFA_EE_WAIT_UPDATE 0x10 434 /* waiting for the rsp of set routing commands */ 435 #define NFA_EE_WAIT_UPDATE_RSP 0x20 436 #define NFA_EE_WAIT_UPDATE_ALL 0xF0 437 438 typedef uint8_t tNFA_EE_WAIT; 439 440 /* set this bit when waiting for HCI to finish the initialization process in 441 * NFA_EE_EM_STATE_RESTORING */ 442 #define NFA_EE_FLAG_WAIT_HCI 0x01 443 /* set this bit when EE needs to notify the p_enable_cback at the end of NFCEE 444 * discover process in NFA_EE_EM_STATE_RESTORING */ 445 #define NFA_EE_FLAG_NOTIFY_HCI 0x02 446 /* set this bit when gracefully disable with outstanding NCI connections */ 447 #define NFA_EE_FLAG_WAIT_DISCONN 0x04 448 typedef uint8_t tNFA_EE_FLAGS; 449 450 /* NFCEE DISCOVER in progress */ 451 #define NFA_EE_DISC_STS_ON 0x00 452 /* disable NFCEE DISCOVER */ 453 #define NFA_EE_DISC_STS_OFF 0x01 454 /* received NFCEE DISCOVER REQ NTF */ 455 #define NFA_EE_DISC_STS_REQ 0x02 456 /* received NFA_EE_MODE_SET_COMPLETE */ 457 #define NFA_EE_MODE_SET_COMPLETE 0x03 458 /* initialize EE_RECOVERY */ 459 #define NFA_EE_RECOVERY_INIT 0x04 460 /* update ee config during EE_RECOVERY */ 461 #define NFA_EE_RECOVERY_REDISCOVERED 0x05 462 typedef uint8_t tNFA_EE_DISC_STS; 463 464 typedef void(tNFA_EE_ENABLE_DONE_CBACK)(tNFA_EE_DISC_STS status); 465 466 /* NFA EE Management control block */ 467 typedef struct { 468 tNFA_EE_ECB ecb[NFA_EE_NUM_ECBS]; /* control block for DH and NFCEEs */ 469 TIMER_LIST_ENT timer; /* timer to send info to NFCC */ 470 TIMER_LIST_ENT discv_timer; /* timer to end NFCEE discovery */ 471 tNFA_EE_CBACK* p_ee_cback[NFA_EE_MAX_CBACKS]; /* to report EE events */ 472 tNFA_EE_CBACK* p_ee_disc_cback; /* to report EE discovery result */ 473 tNFA_EE_ENABLE_DONE_CBACK* 474 p_enable_cback; /* callback to notify on enable done*/ 475 tNFA_EE_EM_STATE em_state; /* NFA-EE state initialized or not */ 476 uint8_t wait_rsp; /* num of NCI rsp expected (update) */ 477 uint8_t num_ee_expecting; /* number of ee_info still expecting*/ 478 uint8_t cur_ee; /* the number of ee_info in cb */ 479 uint8_t ee_cfged; /* the bit mask of configured ECBs */ 480 uint8_t ee_cfg_sts; /* configuration status */ 481 tNFA_EE_WAIT ee_wait_evt; /* Pending event(s) to be reported */ 482 tNFA_EE_FLAGS ee_flags; /* flags */ 483 uint8_t route_block_control; /* controls route block feature */ 484 bool isDiscoveryStopped; /* discovery status */ 485 } tNFA_EE_CB; 486 487 /* Order of Routing entries in Routing Table */ 488 #define NCI_ROUTE_ORDER_AID 0x01 /* AID routing order */ 489 #define NCI_ROUTE_ORDER_SYS_CODE 0x03 /* System Code routing order*/ 490 #define NCI_ROUTE_ORDER_PROTOCOL 0x04 /* Protocol routing order*/ 491 #define NCI_ROUTE_ORDER_TECHNOLOGY 0x05 /* Technology routing order*/ 492 493 /***************************************************************************** 494 ** External variables 495 *****************************************************************************/ 496 497 /* NFA EE control block */ 498 extern tNFA_EE_CB nfa_ee_cb; 499 500 /***************************************************************************** 501 ** External functions 502 *****************************************************************************/ 503 /* function prototypes - exported from nfa_ee_main.c */ 504 void nfa_ee_sys_enable(void); 505 void nfa_ee_sys_disable(void); 506 507 /* event handler function type */ 508 bool nfa_ee_evt_hdlr(NFC_HDR* p_msg); 509 void nfa_ee_proc_nfcc_power_mode(uint8_t nfcc_power_mode); 510 #if (NFC_NFCEE_INCLUDED == TRUE) 511 void nfa_ee_get_tech_route(uint8_t power_state, uint8_t* p_handles); 512 #endif 513 void nfa_ee_proc_evt(tNFC_RESPONSE_EVT event, void* p_data); 514 tNFA_EE_ECB* nfa_ee_find_ecb(uint8_t nfcee_id); 515 tNFA_EE_ECB* nfa_ee_find_ecb_by_conn_id(uint8_t conn_id); 516 uint8_t nfa_ee_ecb_to_mask(tNFA_EE_ECB* p_cb); 517 void nfa_ee_restore_one_ecb(tNFA_EE_ECB* p_cb); 518 bool nfa_ee_is_active(tNFA_HANDLE nfcee_id); 519 520 /* Action function prototypes - nfa_ee_act.c */ 521 void nfa_ee_api_discover(tNFA_EE_MSG* p_data); 522 void nfa_ee_api_register(tNFA_EE_MSG* p_data); 523 void nfa_ee_api_deregister(tNFA_EE_MSG* p_data); 524 void nfa_ee_api_mode_set(tNFA_EE_MSG* p_data); 525 void nfa_ee_api_set_tech_cfg(tNFA_EE_MSG* p_data); 526 void nfa_ee_api_set_proto_cfg(tNFA_EE_MSG* p_data); 527 void nfa_ee_api_add_aid(tNFA_EE_MSG* p_data); 528 void nfa_ee_api_remove_aid(tNFA_EE_MSG* p_data); 529 void nfa_ee_api_add_sys_code(tNFA_EE_MSG* p_data); 530 void nfa_ee_api_remove_sys_code(tNFA_EE_MSG* p_data); 531 void nfa_ee_api_lmrt_size(tNFA_EE_MSG* p_data); 532 void nfa_ee_api_update_now(tNFA_EE_MSG* p_data); 533 void nfa_ee_api_connect(tNFA_EE_MSG* p_data); 534 void nfa_ee_api_send_data(tNFA_EE_MSG* p_data); 535 void nfa_ee_api_disconnect(tNFA_EE_MSG* p_data); 536 void nfa_ee_report_disc_done(bool notify_sys); 537 void nfa_ee_nci_disc_rsp(tNFA_EE_MSG* p_data); 538 void nfa_ee_nci_disc_ntf(tNFA_EE_MSG* p_data); 539 void nfa_ee_nci_mode_set_rsp(tNFA_EE_MSG* p_data); 540 void nfa_ee_nci_nfcee_status_ntf(tNFA_EE_MSG* p_data); 541 void nfa_ee_nci_wait_rsp(tNFA_EE_MSG* p_data); 542 void nfa_ee_nci_conn(tNFA_EE_MSG* p_data); 543 void nfa_ee_nci_action_ntf(tNFA_EE_MSG* p_data); 544 void nfa_ee_nci_disc_req_ntf(tNFA_EE_MSG* p_data); 545 void nfa_ee_rout_timeout(tNFA_EE_MSG* p_data); 546 void nfa_ee_discv_timeout(tNFA_EE_MSG* p_data); 547 void nfa_ee_lmrt_to_nfcc(tNFA_EE_MSG* p_data); 548 void nfa_ee_update_rout(void); 549 void nfa_ee_report_event(tNFA_EE_CBACK* p_cback, tNFA_EE_EVT event, 550 tNFA_EE_CBACK_DATA* p_data); 551 tNFA_EE_ECB* nfa_ee_find_aid_offset(uint8_t aid_len, uint8_t* p_aid, 552 int* p_offset, int* p_entry); 553 tNFA_EE_ECB* nfa_ee_find_sys_code_offset(uint16_t sys_code, int* p_offset, 554 int* p_entry); 555 int nfa_ee_find_total_aid_len(tNFA_EE_ECB* p_cb, int start_entry); 556 void nfa_ee_start_timer(void); 557 void nfa_ee_reg_cback_enable_done(tNFA_EE_ENABLE_DONE_CBACK* p_cback); 558 void nfa_ee_report_update_evt(void); 559 560 extern void nfa_ee_proc_hci_info_cback(void); 561 void nfa_ee_check_disable(void); 562 bool nfa_ee_restore_ntf_done(void); 563 void nfa_ee_check_restore_complete(void); 564 565 #endif /* NFA_P2P_INT_H */ 566