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