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