Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 1999-2012 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 #ifndef NFC_TARGET_H
     20 #define NFC_TARGET_H
     21 
     22 #include "data_types.h"
     23 
     24 #ifdef BUILDCFG
     25 #include "buildcfg.h"
     26 #endif
     27 
     28 /* Include common GKI definitions used by this platform */
     29 #include "gki_target.h"
     30 
     31 #include "bt_types.h" /* This must be defined AFTER buildcfg.h */
     32 
     33 #ifndef USERIAL_DEBUG
     34 #define USERIAL_DEBUG FALSE
     35 #endif
     36 
     37 /******************************************************************************
     38 **
     39 ** GKI Mail Box and Timer
     40 **
     41 ******************************************************************************/
     42 
     43 /* Mailbox event mask for NFC stack */
     44 #ifndef NFC_MBOX_EVT_MASK
     45 #define NFC_MBOX_EVT_MASK (TASK_MBOX_0_EVT_MASK)
     46 #endif
     47 
     48 /* Mailbox ID for NFC stack */
     49 #ifndef NFC_MBOX_ID
     50 #define NFC_MBOX_ID (TASK_MBOX_0)
     51 #endif
     52 
     53 /* Mailbox event mask for NFA */
     54 #ifndef NFA_MBOX_EVT_MASK
     55 #define NFA_MBOX_EVT_MASK (TASK_MBOX_2_EVT_MASK)
     56 #endif
     57 
     58 /* Mailbox ID for NFA */
     59 #ifndef NFA_MBOX_ID
     60 #define NFA_MBOX_ID (TASK_MBOX_2)
     61 #endif
     62 
     63 /* GKI timer id used for protocol timer in NFC stack */
     64 #ifndef NFC_TIMER_ID
     65 #define NFC_TIMER_ID (TIMER_0)
     66 #endif
     67 
     68 /* GKI timer event mask used for protocol timer in NFC stack */
     69 #ifndef NFC_TIMER_EVT_MASK
     70 #define NFC_TIMER_EVT_MASK (TIMER_0_EVT_MASK)
     71 #endif
     72 
     73 /* GKI timer id used for quick timer in NFC stack */
     74 #ifndef NFC_QUICK_TIMER_ID
     75 #define NFC_QUICK_TIMER_ID (TIMER_1)
     76 #endif
     77 
     78 /* GKI timer event mask used for quick timer in NFC stack */
     79 #ifndef NFC_QUICK_TIMER_EVT_MASK
     80 #define NFC_QUICK_TIMER_EVT_MASK (TIMER_1_EVT_MASK)
     81 #endif
     82 
     83 /* GKI timer id used for protocol timer in NFA */
     84 #ifndef NFA_TIMER_ID
     85 #define NFA_TIMER_ID (TIMER_2)
     86 #endif
     87 
     88 /* GKI timer event mask used for protocol timer in NFA */
     89 #ifndef NFA_TIMER_EVT_MASK
     90 #define NFA_TIMER_EVT_MASK (TIMER_2_EVT_MASK)
     91 #endif
     92 
     93 /******************************************************************************
     94 **
     95 ** GKI Buffer Pools
     96 **
     97 ******************************************************************************/
     98 
     99 /* NCI command/notification/data */
    100 #ifndef NFC_NCI_POOL_ID
    101 #define NFC_NCI_POOL_ID GKI_POOL_ID_2
    102 #endif
    103 
    104 #ifndef NFC_NCI_POOL_BUF_SIZE
    105 #define NFC_NCI_POOL_BUF_SIZE GKI_BUF2_SIZE
    106 #endif
    107 
    108 /* Reader/Write commands (NCI data payload) */
    109 #ifndef NFC_RW_POOL_ID
    110 #define NFC_RW_POOL_ID GKI_POOL_ID_2
    111 #endif
    112 
    113 #ifndef NFC_RW_POOL_BUF_SIZE
    114 #define NFC_RW_POOL_BUF_SIZE GKI_BUF2_SIZE
    115 #endif
    116 
    117 /* Card Emulation responses (NCI data payload) */
    118 #ifndef NFC_CE_POOL_ID
    119 #define NFC_CE_POOL_ID GKI_POOL_ID_2
    120 #endif
    121 
    122 #ifndef NFC_CE_POOL_BUF_SIZE
    123 #define NFC_CE_POOL_BUF_SIZE GKI_BUF2_SIZE
    124 #endif
    125 
    126 /* NCI msg pool for HAL (for shared NFC/HAL GKI)*/
    127 #ifndef NFC_HAL_NCI_POOL_ID
    128 #define NFC_HAL_NCI_POOL_ID NFC_NCI_POOL_ID
    129 #endif
    130 
    131 #ifndef NFC_HAL_NCI_POOL_BUF_SIZE
    132 #define NFC_HAL_NCI_POOL_BUF_SIZE NFC_NCI_POOL_BUF_SIZE
    133 #endif
    134 
    135 /******************************************************************************
    136 **
    137 ** NCI Transport definitions
    138 **
    139 ******************************************************************************/
    140 /* offset of the first NCI packet in buffer for outgoing */
    141 #ifndef NCI_MSG_OFFSET_SIZE
    142 #define NCI_MSG_OFFSET_SIZE 1
    143 #endif
    144 
    145 /* Restore NFCC baud rate to default on shutdown if NFC_UpdateBaudRate was
    146  * called */
    147 #ifndef NFC_RESTORE_BAUD_ON_SHUTDOWN
    148 #define NFC_RESTORE_BAUD_ON_SHUTDOWN TRUE
    149 #endif
    150 
    151 /******************************************************************************
    152 **
    153 ** NCI
    154 **
    155 ******************************************************************************/
    156 #define NCI_VERSION_UNKNOWN 0x00
    157 #define NCI_VERSION_1_0 0x10
    158 #define NCI_VERSION_2_0 0x20
    159 #ifndef NCI_VERSION
    160 #define NCI_VERSION NCI_VERSION_2_0
    161 #endif
    162 #define NCI_CORE_RESET_RSP_LEN(X) (((X) == NCI_VERSION_2_0) ? (0x01) : (0x03))
    163 
    164 /* TRUE I2C patch is needed */
    165 #ifndef NFC_I2C_PATCH_INCLUDED
    166 #define NFC_I2C_PATCH_INCLUDED TRUE /* NFC-Android uses this!!! */
    167 #endif
    168 
    169 /******************************************************************************
    170 **
    171 ** NFC
    172 **
    173 ******************************************************************************/
    174 
    175 /* Define to TRUE to include Broadcom Vendor Specific implementation */
    176 #ifndef NFC_BRCM_VS_INCLUDED
    177 #define NFC_BRCM_VS_INCLUDED TRUE
    178 #endif
    179 
    180 /* Define to TRUE if compling for NFC Reader/Writer Only mode */
    181 #ifndef NFC_RW_ONLY
    182 #define NFC_RW_ONLY FALSE
    183 #endif
    184 
    185 /* Timeout for receiving response to NCI command */
    186 #ifndef NFC_CMD_CMPL_TIMEOUT
    187 #define NFC_CMD_CMPL_TIMEOUT 2
    188 #endif
    189 
    190 /* Timeout for waiting on data credit/NFC-DEP */
    191 #ifndef NFC_DEACTIVATE_TIMEOUT
    192 #define NFC_DEACTIVATE_TIMEOUT 2
    193 #endif
    194 
    195 /* the maximum number of Vendor Specific callback functions allowed to be
    196  * registered. 1-14 */
    197 #ifndef NFC_NUM_VS_CBACKS
    198 #define NFC_NUM_VS_CBACKS 3
    199 #endif
    200 
    201 /* the maximum number of NCI connections allowed. 1-14 */
    202 #ifndef NCI_MAX_CONN_CBS
    203 #define NCI_MAX_CONN_CBS 4
    204 #endif
    205 
    206 /* Maximum number of NCI commands that the NFCC accepts without needing to wait
    207  * for response */
    208 #ifndef NCI_MAX_CMD_WINDOW
    209 #define NCI_MAX_CMD_WINDOW 1
    210 #endif
    211 
    212 /* Define to TRUE to include the NFCEE related functionalities */
    213 #ifndef NFC_NFCEE_INCLUDED
    214 #define NFC_NFCEE_INCLUDED TRUE
    215 #endif
    216 
    217 /* the maximum number of NFCEE interface supported */
    218 #ifndef NFC_MAX_EE_INTERFACE
    219 #define NFC_MAX_EE_INTERFACE 3
    220 #endif
    221 
    222 /* the maximum number of NFCEE information supported. */
    223 #ifndef NFC_MAX_EE_INFO
    224 #define NFC_MAX_EE_INFO 8
    225 #endif
    226 
    227 /* the maximum number of NFCEE TLVs supported */
    228 #ifndef NFC_MAX_EE_TLVS
    229 #define NFC_MAX_EE_TLVS 1
    230 #endif
    231 
    232 /* the maximum size of NFCEE TLV list supported */
    233 #ifndef NFC_MAX_EE_TLV_SIZE
    234 #define NFC_MAX_EE_TLV_SIZE 150
    235 #endif
    236 
    237 /* Maximum time to discover NFCEE */
    238 #ifndef NFA_EE_DISCV_TIMEOUT_VAL
    239 #define NFA_EE_DISCV_TIMEOUT_VAL 2000
    240 #endif
    241 
    242 /* Number of times reader/writer should attempt to resend a command on failure
    243  */
    244 #ifndef RW_MAX_RETRIES
    245 #define RW_MAX_RETRIES 5
    246 #endif
    247 
    248 /* RW NDEF Support */
    249 #ifndef RW_NDEF_INCLUDED
    250 #define RW_NDEF_INCLUDED TRUE
    251 #endif
    252 
    253 /* RW Type 1 Tag timeout for each API call, in ms */
    254 #ifndef RW_T1T_TOUT_RESP
    255 #define RW_T1T_TOUT_RESP 100
    256 #endif
    257 
    258 /* CE Type 2 Tag timeout for controller command, in ms */
    259 #ifndef CE_T2T_TOUT_RESP
    260 #define CE_T2T_TOUT_RESP 1000
    261 #endif
    262 
    263 /* RW Type 2 Tag timeout for each API call, in ms */
    264 #ifndef RW_T2T_TOUT_RESP
    265 /* Android requires 150 instead of 100 for presence-check*/
    266 #define RW_T2T_TOUT_RESP 150
    267 #endif
    268 
    269 /* RW Type 2 Tag timeout for each API call, in ms */
    270 #ifndef RW_T2T_SEC_SEL_TOUT_RESP
    271 #define RW_T2T_SEC_SEL_TOUT_RESP 10
    272 #endif
    273 
    274 /* RW Type 3 Tag timeout for each API call, in ms */
    275 #ifndef RW_T3T_TOUT_RESP
    276 /* NFC-Android will use 100 instead of 75 for T3t presence-check */
    277 #define RW_T3T_TOUT_RESP 100
    278 #endif
    279 
    280 /* CE Type 3 Tag maximum response timeout index (for check and update, used in
    281  * SENSF_RES) */
    282 #ifndef CE_T3T_MRTI_C
    283 #define CE_T3T_MRTI_C 0xFF
    284 #endif
    285 #ifndef CE_T3T_MRTI_U
    286 #define CE_T3T_MRTI_U 0xFF
    287 #endif
    288 
    289 /* Default maxblocks for CE_T3T UPDATE/CHECK operations */
    290 #ifndef CE_T3T_DEFAULT_UPDATE_MAXBLOCKS
    291 #define CE_T3T_DEFAULT_UPDATE_MAXBLOCKS 3
    292 #endif
    293 
    294 #ifndef CE_T3T_DEFAULT_CHECK_MAXBLOCKS
    295 #define CE_T3T_DEFAULT_CHECK_MAXBLOCKS 3
    296 #endif
    297 
    298 /* CE Type 4 Tag, Frame Waiting time Integer */
    299 #ifndef CE_T4T_ISO_DEP_FWI
    300 #define CE_T4T_ISO_DEP_FWI 7
    301 #endif
    302 
    303 /* RW Type 4 Tag timeout for each API call, in ms */
    304 #ifndef RW_T4T_TOUT_RESP
    305 #define RW_T4T_TOUT_RESP 1000
    306 #endif
    307 
    308 /* CE Type 4 Tag timeout for update file, in ms */
    309 #ifndef CE_T4T_TOUT_UPDATE
    310 #define CE_T4T_TOUT_UPDATE 1000
    311 #endif
    312 
    313 /* CE Type 4 Tag, mandatory NDEF File ID */
    314 #ifndef CE_T4T_MANDATORY_NDEF_FILE_ID
    315 #define CE_T4T_MANDATORY_NDEF_FILE_ID 0x1000
    316 #endif
    317 
    318 /* CE Type 4 Tag, max number of AID supported */
    319 #ifndef CE_T4T_MAX_REG_AID
    320 #define CE_T4T_MAX_REG_AID 4
    321 #endif
    322 
    323 /* Sub carrier */
    324 #ifndef RW_I93_FLAG_SUB_CARRIER
    325 #define RW_I93_FLAG_SUB_CARRIER I93_FLAG_SUB_CARRIER_SINGLE
    326 #endif
    327 
    328 /* Data rate for 15693 command/response */
    329 #ifndef RW_I93_FLAG_DATA_RATE
    330 #define RW_I93_FLAG_DATA_RATE I93_FLAG_DATA_RATE_HIGH
    331 #endif
    332 
    333 /* TRUE, to include Card Emulation related test commands */
    334 #ifndef CE_TEST_INCLUDED
    335 #define CE_TEST_INCLUDED FALSE
    336 #endif
    337 
    338 /* Quick Timer */
    339 #ifndef QUICK_TIMER_TICKS_PER_SEC
    340 #define QUICK_TIMER_TICKS_PER_SEC 100 /* 10ms timer */
    341 #endif
    342 
    343 /******************************************************************************
    344 **
    345 ** LLCP
    346 **
    347 ******************************************************************************/
    348 
    349 #ifndef LLCP_TEST_INCLUDED
    350 #define LLCP_TEST_INCLUDED FALSE
    351 #endif
    352 
    353 #ifndef LLCP_POOL_ID
    354 #define LLCP_POOL_ID GKI_POOL_ID_3
    355 #endif
    356 
    357 #ifndef LLCP_POOL_BUF_SIZE
    358 #define LLCP_POOL_BUF_SIZE GKI_BUF3_SIZE
    359 #endif
    360 
    361 /* LLCP Maximum Information Unit (between LLCP_DEFAULT_MIU(128) and LLCP_MAX_MIU
    362  * (2175)*/
    363 #ifndef LLCP_MIU
    364 #define LLCP_MIU                                             \
    365   (LLCP_POOL_BUF_SIZE - NFC_HDR_SIZE - NCI_MSG_OFFSET_SIZE - \
    366    NCI_DATA_HDR_SIZE - LLCP_PDU_HEADER_SIZE)
    367 #endif
    368 
    369 /* Link Timeout, LTO */
    370 #ifndef LLCP_LTO_VALUE
    371 /* Default is 100ms. It should be sufficiently larger than RWT */
    372 #define LLCP_LTO_VALUE 1000
    373 #endif
    374 
    375 /*
    376 ** LTO is max time interval between the last bit received and the first bit sent
    377 ** over the air. Link timeout must be delayed as much as time between the packet
    378 ** sent from LLCP and the last bit transmitted at NFCC.
    379 **  - 200ms, max OTA transmitting time between the first bit and the last bit at
    380 **    NFCC. Largest MIU(2175bytes) of LLCP must be fragmented and sent on
    381 **    NFC-DEP over the air. 8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at
    382 **    106kbps bit rate.
    383 **  - 10ms, processing time
    384 */
    385 #ifndef LLCP_INTERNAL_TX_DELAY
    386 #define LLCP_INTERNAL_TX_DELAY 210
    387 #endif
    388 
    389 /*
    390 ** LTO is max time interval between the last bit received and the first bit sent
    391 ** over the air. Link timeout must be delayed as much as time between the first
    392 ** bit received at NFCC and the packet received at LLCP.
    393 **  - 200ms, max OTA transmitting time between the first bit and the last bit at
    394 **    NFCC. LLCP cannot receive data packet until all bit are received and
    395 **    reassembled in NCI. 8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at
    396 **    106kbps bit rate.
    397 **  - 10ms, processing time
    398 */
    399 #ifndef LLCP_INTERNAL_RX_DELAY
    400 #define LLCP_INTERNAL_RX_DELAY 210
    401 #endif
    402 
    403 /* Wait for application layer sending data before sending SYMM */
    404 #ifndef LLCP_DELAY_RESP_TIME
    405 #define LLCP_DELAY_RESP_TIME 20 /* in ms */
    406 #endif
    407 
    408 /* LLCP inactivity timeout for initiator */
    409 #ifndef LLCP_INIT_INACTIVITY_TIMEOUT
    410 #define LLCP_INIT_INACTIVITY_TIMEOUT 0 /* in ms */
    411 #endif
    412 
    413 /* LLCP inactivity timeout for target */
    414 #ifndef LLCP_TARGET_INACTIVITY_TIMEOUT
    415 #define LLCP_TARGET_INACTIVITY_TIMEOUT 0 /* in ms */
    416 #endif
    417 
    418 /* LLCP delay timeout to send the first PDU as initiator */
    419 #ifndef LLCP_DELAY_TIME_TO_SEND_FIRST_PDU
    420 #define LLCP_DELAY_TIME_TO_SEND_FIRST_PDU 50 /* in ms */
    421 #endif
    422 
    423 /* Response Waiting Time */
    424 #ifndef LLCP_WAITING_TIME
    425 /* its scaled value should be less than LTO */
    426 #define LLCP_WAITING_TIME 7
    427 #endif
    428 
    429 /* Options Parameters */
    430 #ifndef LLCP_OPT_VALUE
    431 #define LLCP_OPT_VALUE LLCP_LSC_3 /* Link Service Class 3 */
    432 #endif
    433 
    434 /* Data link connection timeout */
    435 #ifndef LLCP_DATA_LINK_CONNECTION_TOUT
    436 #define LLCP_DATA_LINK_CONNECTION_TOUT 1000
    437 #endif
    438 
    439 /* Max length of service name */
    440 #ifndef LLCP_MAX_SN_LEN
    441 #define LLCP_MAX_SN_LEN 255 /* max length of service name */
    442 #endif
    443 
    444 /* Max number of well-known services, at least 2 for LM and SDP and up to 16 */
    445 #ifndef LLCP_MAX_WKS
    446 #define LLCP_MAX_WKS 5
    447 #endif
    448 
    449 /* Max number of services advertised by local SDP, up to 16 */
    450 #ifndef LLCP_MAX_SERVER
    451 #define LLCP_MAX_SERVER 10
    452 #endif
    453 
    454 /* Max number of services not advertised by local SDP, up to 32 */
    455 #ifndef LLCP_MAX_CLIENT
    456 #define LLCP_MAX_CLIENT 20
    457 #endif
    458 
    459 /* Max number of data link connections */
    460 #ifndef LLCP_MAX_DATA_LINK
    461 #define LLCP_MAX_DATA_LINK 16
    462 #endif
    463 
    464 /* Max number of outstanding service discovery requests */
    465 #ifndef LLCP_MAX_SDP_TRANSAC
    466 #define LLCP_MAX_SDP_TRANSAC 16
    467 #endif
    468 
    469 /* Percentage of LLCP buffer pool for receiving data */
    470 #ifndef LLCP_RX_BUFF_RATIO
    471 #define LLCP_RX_BUFF_RATIO 30
    472 #endif
    473 
    474 /* Rx congestion end threshold as percentage of receiving buffers */
    475 #ifndef LLCP_RX_CONGEST_END
    476 #define LLCP_RX_CONGEST_END 50
    477 #endif
    478 
    479 /* Rx congestion start threshold as percentage of receiving buffers */
    480 #ifndef LLCP_RX_CONGEST_START
    481 #define LLCP_RX_CONGEST_START 70
    482 #endif
    483 
    484 /* limitation of rx UI PDU as percentage of receiving buffers */
    485 #ifndef LLCP_LL_RX_BUFF_LIMIT
    486 #define LLCP_LL_RX_BUFF_LIMIT 30
    487 #endif
    488 
    489 /* minimum rx congestion threshold (number of rx I PDU in queue) for data link
    490  * connection */
    491 #ifndef LLCP_DL_MIN_RX_CONGEST
    492 #define LLCP_DL_MIN_RX_CONGEST 4
    493 #endif
    494 
    495 /* limitation of tx UI PDU as percentage of transmitting buffers */
    496 #ifndef LLCP_LL_TX_BUFF_LIMIT
    497 #define LLCP_LL_TX_BUFF_LIMIT 30
    498 #endif
    499 
    500 /******************************************************************************
    501 **
    502 ** NFA
    503 **
    504 ******************************************************************************/
    505 
    506 #ifndef NFA_P2P_INCLUDED
    507 #define NFA_P2P_INCLUDED TRUE
    508 #endif
    509 
    510 /* Maximum Idle time (no hcp) to wait for EE DISC REQ Ntf(s) */
    511 #ifndef NFA_HCI_NETWK_INIT_IDLE_TIMEOUT
    512 #define NFA_HCI_NETWK_INIT_IDLE_TIMEOUT 1000
    513 #endif
    514 
    515 #ifndef NFA_HCI_MAX_HOST_IN_NETWORK
    516 #define NFA_HCI_MAX_HOST_IN_NETWORK 0x06
    517 #endif
    518 
    519 /* Max number of Application that can be registered to NFA-HCI */
    520 #ifndef NFA_HCI_MAX_APP_CB
    521 #define NFA_HCI_MAX_APP_CB 0x05
    522 #endif
    523 
    524 /* Max number of HCI gates that can be created */
    525 #ifndef NFA_HCI_MAX_GATE_CB
    526 #define NFA_HCI_MAX_GATE_CB 0x06
    527 #endif
    528 
    529 /* Max number of HCI pipes that can be created for the whole system */
    530 #ifndef NFA_HCI_MAX_PIPE_CB
    531 #define NFA_HCI_MAX_PIPE_CB 0x08
    532 #endif
    533 
    534 /* Timeout for waiting for the response to HCP Command packet */
    535 #ifndef NFA_HCI_RESPONSE_TIMEOUT
    536 #define NFA_HCI_RESPONSE_TIMEOUT 1000
    537 #endif
    538 
    539 /* Default poll duration (may be over-ridden using NFA_SetRfDiscoveryDuration)
    540  */
    541 #ifndef NFA_DM_DISC_DURATION_POLL
    542 #define NFA_DM_DISC_DURATION_POLL 500 /* Android requires 500 */
    543 #endif
    544 
    545 /* Automatic NDEF detection (when not in exclusive RF mode) */
    546 #ifndef NFA_DM_AUTO_DETECT_NDEF
    547 #define NFA_DM_AUTO_DETECT_NDEF FALSE /* !!!!! NFC-Android needs FALSE */
    548 #endif
    549 
    550 /* Automatic NDEF read (when not in exclusive RF mode) */
    551 #ifndef NFA_DM_AUTO_READ_NDEF
    552 #define NFA_DM_AUTO_READ_NDEF FALSE /* !!!!! NFC-Android needs FALSE */
    553 #endif
    554 
    555 /* Automatic NDEF presence check (when not in exclusive RF mode) */
    556 #ifndef NFA_DM_AUTO_PRESENCE_CHECK
    557 #define NFA_DM_AUTO_PRESENCE_CHECK FALSE /* Android requires FALSE */
    558 #endif
    559 
    560 /* Presence check option: 0x01: use sleep/wake for none-NDEF ISO-DEP tags */
    561 #ifndef NFA_DM_PRESENCE_CHECK_OPTION
    562 /* !!!!! Android needs value 3 */
    563 #define NFA_DM_PRESENCE_CHECK_OPTION 0x03
    564 #endif
    565 
    566 /* Maximum time to wait for presence check response */
    567 #ifndef NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT
    568 #define NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT 500
    569 #endif
    570 
    571 /* Default delay to auto presence check after sending raw frame */
    572 #ifndef NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY
    573 #define NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY 750
    574 #endif
    575 
    576 /* Timeout for reactivation of Kovio bar code tag (presence check) */
    577 #ifndef NFA_DM_DISC_TIMEOUT_KOVIO_PRESENCE_CHECK
    578 #define NFA_DM_DISC_TIMEOUT_KOVIO_PRESENCE_CHECK (1000)
    579 #endif
    580 
    581 /* Max number of NDEF type handlers that can be registered (including the
    582  * default handler) */
    583 #ifndef NFA_NDEF_MAX_HANDLERS
    584 #define NFA_NDEF_MAX_HANDLERS 8
    585 #endif
    586 
    587 /* Maximum number of listen entries configured/registered with
    588  * NFA_CeConfigureUiccListenTech, */
    589 /* NFA_CeRegisterFelicaSystemCodeOnDH, or NFA_CeRegisterT4tAidOnDH */
    590 #ifndef NFA_CE_LISTEN_INFO_MAX
    591 #define NFA_CE_LISTEN_INFO_MAX 5
    592 #endif
    593 
    594 #ifndef NFA_SNEP_INCLUDED
    595 /* Android must use FALSE to exclude SNEP */
    596 #define NFA_SNEP_INCLUDED FALSE
    597 #endif
    598 
    599 /* Max acceptable length */
    600 #ifndef NFA_SNEP_DEFAULT_SERVER_MAX_NDEF_SIZE
    601 #define NFA_SNEP_DEFAULT_SERVER_MAX_NDEF_SIZE 500000
    602 #endif
    603 
    604 /* Max number of SNEP server/client and data link connection */
    605 #ifndef NFA_SNEP_MAX_CONN
    606 #define NFA_SNEP_MAX_CONN 6
    607 #endif
    608 
    609 /* Max number data link connection of SNEP default server*/
    610 #ifndef NFA_SNEP_DEFAULT_MAX_CONN
    611 #define NFA_SNEP_DEFAULT_MAX_CONN 3
    612 #endif
    613 
    614 /* MIU for SNEP              */
    615 #ifndef NFA_SNEP_MIU
    616 #define NFA_SNEP_MIU 1980 /* Modified for NFC-A */
    617 #endif
    618 
    619 /* Receiving Window for SNEP */
    620 #ifndef NFA_SNEP_RW
    621 #define NFA_SNEP_RW 2 /* Modified for NFC-A */
    622 #endif
    623 
    624 /* Max number of NFCEE supported */
    625 #ifndef NFA_EE_MAX_EE_SUPPORTED
    626 /* Modified for NFC-A until we add dynamic support */
    627 #define NFA_EE_MAX_EE_SUPPORTED 4
    628 #endif
    629 
    630 /* Maximum number of AID entries per target_handle  */
    631 #ifndef NFA_EE_MAX_AID_ENTRIES
    632 #define NFA_EE_MAX_AID_ENTRIES (32)
    633 #endif
    634 
    635 /* Maximum number of callback functions can be registered through
    636  * NFA_EeRegister() */
    637 #ifndef NFA_EE_MAX_CBACKS
    638 #define NFA_EE_MAX_CBACKS (3)
    639 #endif
    640 
    641 #ifndef NFA_DTA_INCLUDED
    642 #define NFA_DTA_INCLUDED TRUE
    643 #endif
    644 
    645 /*****************************************************************************
    646 **  Define HAL_WRITE depending on whether HAL is using shared GKI resources
    647 **  as the NFC stack.
    648 *****************************************************************************/
    649 #ifndef HAL_WRITE
    650 #define HAL_WRITE(p)                                                  \
    651   {                                                                   \
    652     nfc_cb.p_hal->write((p)->len, (uint8_t*)((p) + 1) + (p)->offset); \
    653     GKI_freebuf(p);                                                   \
    654   }
    655 
    656 #ifdef NFC_HAL_SHARED_GKI
    657 
    658 /* NFC HAL Included if NFC_NFCEE_INCLUDED */
    659 #if (NFC_NFCEE_INCLUDED == TRUE)
    660 
    661 #ifndef NFC_HAL_HCI_INCLUDED
    662 #define NFC_HAL_HCI_INCLUDED TRUE
    663 #endif
    664 #else /* NFC_NFCEE_INCLUDED == TRUE */
    665 #ifndef NFC_HAL_HCI_INCLUDED
    666 #define NFC_HAL_HCI_INCLUDED FALSE
    667 #endif
    668 
    669 #endif /* NFC_NFCEE_INCLUDED == FALSE */
    670 
    671 #endif /* NFC_HAL_SHARED_GKI */
    672 
    673 #endif /* HAL_WRITE */
    674 
    675 #endif /* NFC_TARGET_H */
    676