• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2011-2014 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 
20 /******************************************************************************
21  *
22  *  This file contains compile-time configurable constants for NFA modules
23  *
24  ******************************************************************************/
25 #include "nfa_api.h"
26 
27 /* the SetConfig for CE T3T/T4T */
28 const UINT8 nfa_dm_ce_cfg[] =
29 {
30     13,                         /* total length */
31     NFC_PMID_LF_T3T_PMM,        /* Type-3 tag default PMM */
32     NCI_PARAM_LEN_LF_T3T_PMM,
33     0x01,                       /* This PAD0 is used to identify HCE-F on Android */
34     0xFE,                       /* This PAD0 is used to identify HCE-F on Android */
35     0xFF,
36     0xFF,
37     0xFF,
38     0xFF,
39     0xFF,
40     0xFF,
41     NFC_PMID_FWI,               /* FWI for ISO-DEP */
42     1,
43     CE_T4T_ISO_DEP_FWI
44 };
45 
46 UINT8 *p_nfa_dm_ce_cfg = (UINT8 *) nfa_dm_ce_cfg;
47 
48 /* the SetConfig for optional general NFC stack functions */
49 const UINT8 nfa_dm_gen_cfg[] =
50 {
51     3,                         /* total length */
52     NFC_PMID_RF_FIELD_INFO,     /* Instruct NFCC to report RF field generated by remote device (or not) */
53     1,
54     0x01
55 };
56 
57 UINT8 *p_nfa_dm_gen_cfg = NULL;
58 
59 
60 /* the RF Discovery Frequency for each technology */
61 const tNFA_DM_DISC_FREQ_CFG nfa_dm_rf_disc_freq_cfg =
62 {
63     1,      /* Frequency for NFC Technology A               */
64     1,      /* Frequency for NFC Technology B               */
65     1,      /* Frequency for NFC Technology F               */
66     1,      /* Frequency for Proprietary Technology/15693   */
67     1,      /* Frequency for Proprietary Technology/B-Prime */
68     1,      /* Frequency for Proprietary Technology/Kovio   */
69     1,      /* Frequency for NFC Technology A active mode   */
70     1       /* Frequency for NFC Technology F active mode   */
71 };
72 
73 tNFA_DM_DISC_FREQ_CFG *p_nfa_dm_rf_disc_freq_cfg = (tNFA_DM_DISC_FREQ_CFG *)&nfa_dm_rf_disc_freq_cfg;
74 
75 UINT8 nfa_ee_max_ee_cfg = NFA_EE_MAX_EE_SUPPORTED;
76 
77 
78 const tNCI_DISCOVER_MAPS nfa_dm_interface_mapping[NFA_DM_NUM_INTERFACE_MAP] =
79 {
80     /* Protocols that use Frame Interface do not need to be included in the interface mapping */
81     {
82         NCI_PROTOCOL_ISO_DEP,
83         NCI_INTERFACE_MODE_POLL_N_LISTEN,
84         NCI_INTERFACE_ISO_DEP
85     },
86     {
87         NCI_PROTOCOL_NFC_DEP,
88         NCI_INTERFACE_MODE_POLL_N_LISTEN,
89         NCI_INTERFACE_NFC_DEP
90     }
91 };
92 /* set to NULL to use the default mapping set by stack */
93 tNCI_DISCOVER_MAPS *p_nfa_dm_interface_mapping = NULL;
94 UINT8 nfa_dm_num_dm_interface_mapping = 0;
95 
96 
97 const tNFA_DM_CFG nfa_dm_cfg =
98 {
99     NFA_DM_AUTO_DETECT_NDEF,                /* Automatic NDEF detection (when not in exclusive RF mode) */
100     NFA_DM_AUTO_READ_NDEF,                  /* Automatic NDEF read (when not in exclusive RF mode)      */
101     NFA_DM_AUTO_PRESENCE_CHECK,             /* Automatic presence check                                 */
102     NFA_DM_PRESENCE_CHECK_OPTION,           /* Use sleep/wake(last interface) for ISODEP presence check */
103     NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT       /* Maximum time to wait for presence check response         */
104 };
105 
106 tNFA_DM_CFG *p_nfa_dm_cfg = (tNFA_DM_CFG *) &nfa_dm_cfg;
107 
108 const UINT8 nfa_hci_whitelist[] =
109 {
110     0x02,
111     0x03,
112     0x04
113 };
114 
115 const tNFA_HCI_CFG nfa_hci_cfg =
116 {
117     NFA_HCI_NETWK_INIT_IDLE_TIMEOUT, /* Max HCI Network IDLE time to wait for EE DISC REQ Ntf(s) */
118     NFA_HCI_RESPONSE_TIMEOUT,        /* Maximum HCP Response time to any HCP Command */
119     0x03,                            /* Number of host in the whitelist of Terminal host */
120     (UINT8 *) nfa_hci_whitelist      /* Pointer to the Whitelist of Terminal Host */
121 };
122 
123 tNFA_HCI_CFG *p_nfa_hci_cfg = (tNFA_HCI_CFG *) &nfa_hci_cfg;
124 
125 BOOLEAN nfa_poll_bail_out_mode = FALSE;
126 const tNFA_PROPRIETARY_CFG nfa_proprietary_cfg =
127 {
128     0x80, /* NCI_PROTOCOL_18092_ACTIVE */
129     0x81, /* NCI_PROTOCOL_B_PRIME */
130     0x82, /* NCI_PROTOCOL_DUAL */
131     0x83, /* NCI_PROTOCOL_15693 */
132     0x8A, /* NCI_PROTOCOL_KOVIO */
133     0xFF, /* NCI_PROTOCOL_MIFARE */
134     0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */
135     0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */
136     0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */
137 };
138 
139 tNFA_PROPRIETARY_CFG *p_nfa_proprietary_cfg = (tNFA_PROPRIETARY_CFG *) &nfa_proprietary_cfg;
140