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 to include not openned Broadcom Vendor Specific implementation */
    190 
    191 /* Define to TRUE if compling for NFC Reader/Writer Only mode */
    192 #ifndef NFC_RW_ONLY
    193 #define NFC_RW_ONLY         FALSE
    194 #endif
    195 
    196 /* Define to TRUE to use dynamic memory allocation.
    197  * The default is FALSE - to use static memory allocations.
    198 */
    199 #ifndef NFC_DYNAMIC_MEMORY
    200 #define NFC_DYNAMIC_MEMORY              FALSE
    201 #endif
    202 
    203 /* Timeout for receiving response to NCI command */
    204 #ifndef NFC_CMD_CMPL_TIMEOUT
    205 #define NFC_CMD_CMPL_TIMEOUT        2
    206 #endif
    207 
    208 /* Timeout for waiting on data credit/NFC-DEP */
    209 #ifndef NFC_DEACTIVATE_TIMEOUT
    210 #define NFC_DEACTIVATE_TIMEOUT      2
    211 #endif
    212 
    213 /* the maximum number of Vendor Specific callback functions allowed to be registered. 1-14 */
    214 #ifndef NFC_NUM_VS_CBACKS
    215 #define NFC_NUM_VS_CBACKS       3
    216 #endif
    217 
    218 /* the maximum number of NCI connections allowed. 1-14 */
    219 #ifndef NCI_MAX_CONN_CBS
    220 #define NCI_MAX_CONN_CBS        4
    221 #endif
    222 
    223 /* Maximum number of NCI commands that the NFCC accepts without needing to wait for response */
    224 #ifndef NCI_MAX_CMD_WINDOW
    225 #define NCI_MAX_CMD_WINDOW      1
    226 #endif
    227 
    228 /* Define to TRUE to include the NFCEE related functionalities */
    229 #ifndef NFC_NFCEE_INCLUDED
    230 #define NFC_NFCEE_INCLUDED          TRUE
    231 #endif
    232 
    233 /* the maximum number of NFCEE interface supported */
    234 #ifndef NFC_MAX_EE_INTERFACE
    235 #define NFC_MAX_EE_INTERFACE        3
    236 #endif
    237 
    238 /* the maximum number of NFCEE information supported. */
    239 #ifndef NFC_MAX_EE_INFO
    240 #define NFC_MAX_EE_INFO        8
    241 #endif
    242 
    243 /* the maximum number of NFCEE TLVs supported */
    244 #ifndef NFC_MAX_EE_TLVS
    245 #define NFC_MAX_EE_TLVS        1
    246 #endif
    247 
    248 /* the maximum size of NFCEE TLV list supported */
    249 #ifndef NFC_MAX_EE_TLV_SIZE
    250 #define NFC_MAX_EE_TLV_SIZE        150
    251 #endif
    252 
    253 /* Number of times reader/writer should attempt to resend a command on failure */
    254 #ifndef RW_MAX_RETRIES
    255 #define RW_MAX_RETRIES              5
    256 #endif
    257 
    258 /* RW NDEF Support */
    259 #ifndef RW_NDEF_INCLUDED
    260 #define RW_NDEF_INCLUDED            TRUE
    261 #endif
    262 
    263 /* RW Type 1 Tag timeout for each API call, in ms */
    264 #ifndef RW_T1T_TOUT_RESP
    265 #define RW_T1T_TOUT_RESP            100
    266 #endif
    267 
    268 /* CE Type 2 Tag timeout for controller command, in ms */
    269 #ifndef CE_T2T_TOUT_RESP
    270 #define CE_T2T_TOUT_RESP            1000
    271 #endif
    272 
    273 /* RW Type 2 Tag timeout for each API call, in ms */
    274 #ifndef RW_T2T_TOUT_RESP
    275 #define RW_T2T_TOUT_RESP            100
    276 #endif
    277 
    278 /* RW Type 2 Tag timeout for each API call, in ms */
    279 #ifndef RW_T2T_SEC_SEL_TOUT_RESP
    280 #define RW_T2T_SEC_SEL_TOUT_RESP    10
    281 #endif
    282 
    283 /* RW Type 3 Tag timeout for each API call, in ms */
    284 #ifndef RW_T3T_TOUT_RESP
    285 #define RW_T3T_TOUT_RESP            100         /* NFC-Android will use 100 instead of 75 for T3t presence-check */
    286 #endif
    287 
    288 /* CE Type 3 Tag maximum response timeout index (for check and update, used in SENSF_RES) */
    289 #ifndef CE_T3T_MRTI_C
    290 #define CE_T3T_MRTI_C               0xFF
    291 #endif
    292 #ifndef CE_T3T_MRTI_U
    293 #define CE_T3T_MRTI_U               0xFF
    294 #endif
    295 
    296 /* Default maxblocks for CE_T3T UPDATE/CHECK operations */
    297 #ifndef CE_T3T_DEFAULT_UPDATE_MAXBLOCKS
    298 #define CE_T3T_DEFAULT_UPDATE_MAXBLOCKS 3
    299 #endif
    300 
    301 #ifndef CE_T3T_DEFAULT_CHECK_MAXBLOCKS
    302 #define CE_T3T_DEFAULT_CHECK_MAXBLOCKS  3
    303 #endif
    304 
    305 /* CE Type 4 Tag, Frame Waiting time Integer */
    306 #ifndef CE_T4T_ISO_DEP_FWI
    307 #define CE_T4T_ISO_DEP_FWI          7
    308 #endif
    309 
    310 /* RW Type 4 Tag timeout for each API call, in ms */
    311 #ifndef RW_T4T_TOUT_RESP
    312 #define RW_T4T_TOUT_RESP            1000
    313 #endif
    314 
    315 /* CE Type 4 Tag timeout for update file, in ms */
    316 #ifndef CE_T4T_TOUT_UPDATE
    317 #define CE_T4T_TOUT_UPDATE          1000
    318 #endif
    319 
    320 /* CE Type 4 Tag, mandatory NDEF File ID */
    321 #ifndef CE_T4T_MANDATORY_NDEF_FILE_ID
    322 #define CE_T4T_MANDATORY_NDEF_FILE_ID    0x1000
    323 #endif
    324 
    325 /* CE Type 4 Tag, max number of AID supported */
    326 #ifndef CE_T4T_MAX_REG_AID
    327 #define CE_T4T_MAX_REG_AID         4
    328 #endif
    329 
    330 /* Sub carrier */
    331 #ifndef RW_I93_FLAG_SUB_CARRIER
    332 #define RW_I93_FLAG_SUB_CARRIER     I93_FLAG_SUB_CARRIER_SINGLE
    333 #endif
    334 
    335 /* Data rate for 15693 command/response */
    336 #ifndef RW_I93_FLAG_DATA_RATE
    337 #define RW_I93_FLAG_DATA_RATE       I93_FLAG_DATA_RATE_HIGH
    338 #endif
    339 
    340 /* TRUE, to include Card Emulation related test commands */
    341 #ifndef CE_TEST_INCLUDED
    342 #define CE_TEST_INCLUDED            FALSE
    343 #endif
    344 
    345 
    346 /* Quick Timer */
    347 #ifndef QUICK_TIMER_TICKS_PER_SEC
    348 #define QUICK_TIMER_TICKS_PER_SEC   100       /* 10ms timer */
    349 #endif
    350 
    351 
    352 /******************************************************************************
    353 **
    354 ** LLCP
    355 **
    356 ******************************************************************************/
    357 
    358 #ifndef LLCP_TEST_INCLUDED
    359 #define LLCP_TEST_INCLUDED          FALSE
    360 #endif
    361 
    362 #ifndef LLCP_POOL_ID
    363 #define LLCP_POOL_ID                GKI_POOL_ID_3
    364 #endif
    365 
    366 #ifndef LLCP_POOL_BUF_SIZE
    367 #define LLCP_POOL_BUF_SIZE          GKI_BUF3_SIZE
    368 #endif
    369 
    370 /* LLCP Maximum Information Unit (between LLCP_DEFAULT_MIU(128) and LLCP_MAX_MIU (2175)*/
    371 #ifndef LLCP_MIU
    372 #define LLCP_MIU                    (LLCP_POOL_BUF_SIZE - BT_HDR_SIZE - NCI_MSG_OFFSET_SIZE - NCI_DATA_HDR_SIZE - LLCP_PDU_HEADER_SIZE)
    373 #endif
    374 
    375 /* Link Timeout, LTO */
    376 #ifndef LLCP_LTO_VALUE
    377 #define LLCP_LTO_VALUE              1000    /* Default is 100ms. It should be sufficiently larger than RWT */
    378 #endif
    379 
    380 /*
    381 ** LTO is max time interval between the last bit received and the first bit sent over the air.
    382 ** Link timeout must be delayed as much as time between the packet sent from LLCP and the last bit transmitted at NFCC.
    383 **  - 200ms, max OTA transmitting time between the first bit and the last bit at NFCC
    384 **    Largest MIU(2175bytes) of LLCP must be fragmented and sent on NFC-DEP over the air.
    385 **    8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at 106kbps bit rate.
    386 **  - 10ms, processing time
    387 */
    388 #ifndef LLCP_INTERNAL_TX_DELAY
    389 #define LLCP_INTERNAL_TX_DELAY      210
    390 #endif
    391 
    392 /*
    393 ** LTO is max time interval between the last bit received and the first bit sent over the air.
    394 ** Link timeout must be delayed as much as time between the first bit received at NFCC and the packet received at LLCP.
    395 **  - 200ms, max OTA transmitting time between the first bit and the last bit at NFCC
    396 **    LLCP cannot receive data packet until all bit are received and reassembled in NCI.
    397 **    8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at 106kbps bit rate.
    398 **  - 10ms, processing time
    399 */
    400 #ifndef LLCP_INTERNAL_RX_DELAY
    401 #define LLCP_INTERNAL_RX_DELAY      210
    402 #endif
    403 
    404 /* Wait for application layer sending data before sending SYMM */
    405 #ifndef LLCP_DELAY_RESP_TIME
    406 #define LLCP_DELAY_RESP_TIME        20      /* in ms */
    407 #endif
    408 
    409 /* LLCP inactivity timeout for initiator */
    410 #ifndef LLCP_INIT_INACTIVITY_TIMEOUT
    411 #define LLCP_INIT_INACTIVITY_TIMEOUT            0    /* in ms */
    412 #endif
    413 
    414 /* LLCP inactivity timeout for target */
    415 #ifndef LLCP_TARGET_INACTIVITY_TIMEOUT
    416 #define LLCP_TARGET_INACTIVITY_TIMEOUT          0    /* in ms */
    417 #endif
    418 
    419 /* LLCP delay timeout to send the first PDU as initiator */
    420 #ifndef LLCP_DELAY_TIME_TO_SEND_FIRST_PDU
    421 #define LLCP_DELAY_TIME_TO_SEND_FIRST_PDU      50    /* in ms */
    422 #endif
    423 
    424 /* Response Waiting Time */
    425 #ifndef LLCP_WAITING_TIME
    426 #define LLCP_WAITING_TIME           7       /* its scaled value should be less than LTO */
    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 connection */
    490 #ifndef LLCP_DL_MIN_RX_CONGEST
    491 #define LLCP_DL_MIN_RX_CONGEST              4
    492 #endif
    493 
    494 /* limitation of tx UI PDU as percentage of transmitting buffers */
    495 #ifndef LLCP_LL_TX_BUFF_LIMIT
    496 #define LLCP_LL_TX_BUFF_LIMIT               30
    497 #endif
    498 
    499 /******************************************************************************
    500 **
    501 ** NFA
    502 **
    503 ******************************************************************************/
    504 #ifndef NFA_DYNAMIC_MEMORY
    505 #define NFA_DYNAMIC_MEMORY          FALSE
    506 #endif
    507 
    508 #ifndef NFA_INCLUDED
    509 #define NFA_INCLUDED                TRUE
    510 #endif
    511 
    512 #ifndef NFA_P2P_INCLUDED
    513 #define NFA_P2P_INCLUDED            TRUE
    514 #endif
    515 
    516 /* Maximum Idle time (no hcp) to wait for EE DISC REQ Ntf(s) */
    517 #ifndef NFA_HCI_NETWK_INIT_IDLE_TIMEOUT
    518 #define NFA_HCI_NETWK_INIT_IDLE_TIMEOUT  1000
    519 #endif
    520 
    521 #ifndef NFA_HCI_MAX_HOST_IN_NETWORK
    522 #define NFA_HCI_MAX_HOST_IN_NETWORK 0x06
    523 #endif
    524 
    525 /* Max number of Application that can be registered to NFA-HCI */
    526 #ifndef NFA_HCI_MAX_APP_CB
    527 #define NFA_HCI_MAX_APP_CB          0x05
    528 #endif
    529 
    530 /* Max number of HCI gates that can be created */
    531 #ifndef NFA_HCI_MAX_GATE_CB
    532 #define NFA_HCI_MAX_GATE_CB         0x06
    533 #endif
    534 
    535 /* Max number of HCI pipes that can be created for the whole system */
    536 #ifndef NFA_HCI_MAX_PIPE_CB
    537 #define NFA_HCI_MAX_PIPE_CB         0x08
    538 #endif
    539 
    540 /* Timeout for waiting for the response to HCP Command packet */
    541 #ifndef NFA_HCI_RESPONSE_TIMEOUT
    542 #define NFA_HCI_RESPONSE_TIMEOUT    1000
    543 #endif
    544 
    545 /* Default poll duration (may be over-ridden using NFA_SetRfDiscoveryDuration) */
    546 #ifndef NFA_DM_DISC_DURATION_POLL
    547 #define NFA_DM_DISC_DURATION_POLL               500  /* Android requires 500 */
    548 #endif
    549 
    550 /* Automatic NDEF detection (when not in exclusive RF mode) */
    551 #ifndef NFA_DM_AUTO_DETECT_NDEF
    552 #define NFA_DM_AUTO_DETECT_NDEF      FALSE  /* !!!!! NFC-Android needs FALSE */
    553 #endif
    554 
    555 /* Automatic NDEF read (when not in exclusive RF mode) */
    556 #ifndef NFA_DM_AUTO_READ_NDEF
    557 #define NFA_DM_AUTO_READ_NDEF        FALSE  /* !!!!! NFC-Android needs FALSE */
    558 #endif
    559 
    560 /* Automatic NDEF read (when not in exclusive RF mode) */
    561 #ifndef NFA_DM_AUTO_PRESENCE_CHECK
    562 #define NFA_DM_AUTO_PRESENCE_CHECK   FALSE  /* Android requires FALSE */
    563 #endif
    564 
    565 /* Default delay to auto presence check after sending raw frame */
    566 #ifndef NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY
    567 #define NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY   750
    568 #endif
    569 
    570 /* Time to restart discovery after deactivated */
    571 #ifndef NFA_DM_DISC_DELAY_DISCOVERY
    572 #define NFA_DM_DISC_DELAY_DISCOVERY     1000
    573 #endif
    574 
    575 /* Max number of NDEF type handlers that can be registered (including the default handler) */
    576 #ifndef NFA_NDEF_MAX_HANDLERS
    577 #define NFA_NDEF_MAX_HANDLERS       8
    578 #endif
    579 
    580 /* Maximum number of listen entries configured/registered with NFA_CeConfigureUiccListenTech, */
    581 /* NFA_CeRegisterFelicaSystemCodeOnDH, or NFA_CeRegisterT4tAidOnDH                            */
    582 #ifndef NFA_CE_LISTEN_INFO_MAX
    583 #define NFA_CE_LISTEN_INFO_MAX        5
    584 #endif
    585 
    586 #ifndef NFA_CHO_INCLUDED
    587 #define NFA_CHO_INCLUDED            FALSE /* Anddroid must use FALSE to exclude CHO */
    588 #endif
    589 
    590 /* MIU for CHO              */
    591 #ifndef NFA_CHO_MIU
    592 #define NFA_CHO_MIU                    499
    593 #endif
    594 
    595 /* Receiving Window for CHO */
    596 #ifndef NFA_CHO_RW
    597 #define NFA_CHO_RW                     4
    598 #endif
    599 
    600 /* Max number of alternative carrier information */
    601 #ifndef NFA_CHO_MAX_AC_INFO
    602 #define NFA_CHO_MAX_AC_INFO                 2
    603 #endif
    604 
    605 /* Max reference character length, it is up to 255 but it's RECOMMENDED short */
    606 #ifndef NFA_CHO_MAX_REF_NAME_LEN
    607 #define NFA_CHO_MAX_REF_NAME_LEN            8
    608 #endif
    609 
    610 /* Max auxiliary data count */
    611 #ifndef NFA_CHO_MAX_AUX_DATA_COUNT
    612 #define NFA_CHO_MAX_AUX_DATA_COUNT          2
    613 #endif
    614 
    615 #ifndef NFA_CHO_TEST_INCLUDED
    616 #define NFA_CHO_TEST_INCLUDED           FALSE
    617 #endif
    618 
    619 #ifndef NFA_SNEP_INCLUDED
    620 #define NFA_SNEP_INCLUDED               FALSE /* Android must use FALSE to exclude SNEP */
    621 #endif
    622 
    623 /* Max acceptable length */
    624 #ifndef NFA_SNEP_DEFAULT_SERVER_MAX_NDEF_SIZE
    625 #define NFA_SNEP_DEFAULT_SERVER_MAX_NDEF_SIZE          500000
    626 #endif
    627 
    628 /* Max number of SNEP server/client and data link connection */
    629 #ifndef NFA_SNEP_MAX_CONN
    630 #define NFA_SNEP_MAX_CONN               6
    631 #endif
    632 
    633 /* Max number data link connection of SNEP default server*/
    634 #ifndef NFA_SNEP_DEFAULT_MAX_CONN
    635 #define NFA_SNEP_DEFAULT_MAX_CONN       3
    636 #endif
    637 
    638 /* MIU for SNEP              */
    639 #ifndef NFA_SNEP_MIU
    640 #define NFA_SNEP_MIU                    1980        /* Modified for NFC-A */
    641 #endif
    642 
    643 /* Receiving Window for SNEP */
    644 #ifndef NFA_SNEP_RW
    645 #define NFA_SNEP_RW                     2           /* Modified for NFC-A */
    646 #endif
    647 
    648 /* Max number of NFCEE supported */
    649 #ifndef NFA_EE_MAX_EE_SUPPORTED
    650 #define NFA_EE_MAX_EE_SUPPORTED         3
    651 #endif
    652 
    653 /* Maximum number of AID entries per target_handle  */
    654 #ifndef NFA_EE_MAX_AID_ENTRIES
    655 #define NFA_EE_MAX_AID_ENTRIES      (10)
    656 #endif
    657 
    658 /* Maximum number of callback functions can be registered through NFA_EeRegister() */
    659 #ifndef NFA_EE_MAX_CBACKS
    660 #define NFA_EE_MAX_CBACKS           (3)
    661 #endif
    662 
    663 #ifndef NFA_DTA_INCLUDED
    664 #define NFA_DTA_INCLUDED            TRUE
    665 #endif
    666 
    667 
    668 /*****************************************************************************
    669 **  Define HAL_WRITE depending on whether HAL is using shared GKI resources
    670 **  as the NFC stack.
    671 *****************************************************************************/
    672 #ifndef HAL_WRITE
    673 #define HAL_WRITE(p)    {nfc_cb.p_hal->write(p->len, (UINT8 *)(p+1) + p->offset); GKI_freebuf(p);}
    674 
    675 
    676 
    677 #endif /* HAL_WRITE */
    678 
    679 
    680 #endif /* NFC_TARGET_H */
    681 
    682 
    683 
    684