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