nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 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 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 19 | /****************************************************************************** |
| 20 | * |
| 21 | * This file contains compile-time configurable constants for NFA modules |
| 22 | * |
| 23 | ******************************************************************************/ |
| 24 | #include "nfa_api.h" |
| 25 | |
| 26 | /* the SetConfig for CE T3T/T4T */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 27 | const uint8_t nfa_dm_ce_cfg[] = { |
| 28 | 13, /* total length */ |
| 29 | NFC_PMID_LF_T3T_PMM, /* Type-3 tag default PMM */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 30 | NCI_PARAM_LEN_LF_T3T_PMM, |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 31 | 0x01, /* This PAD0 is used to identify HCE-F on Android */ |
| 32 | 0xFE, /* This PAD0 is used to identify HCE-F on Android */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 33 | 0xFF, |
| 34 | 0xFF, |
| 35 | 0xFF, |
| 36 | 0xFF, |
| 37 | 0xFF, |
| 38 | 0xFF, |
| 39 | NFC_PMID_FWI, /* FWI for ISO-DEP */ |
| 40 | 1, |
| 41 | CE_T4T_ISO_DEP_FWI}; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 42 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 43 | uint8_t* p_nfa_dm_ce_cfg = (uint8_t*)nfa_dm_ce_cfg; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 44 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 45 | uint8_t* p_nfa_dm_gen_cfg = NULL; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 46 | |
| 47 | /* the RF Discovery Frequency for each technology */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 48 | const tNFA_DM_DISC_FREQ_CFG nfa_dm_rf_disc_freq_cfg = { |
| 49 | 1, /* Frequency for NFC Technology A */ |
| 50 | 1, /* Frequency for NFC Technology B */ |
| 51 | 1, /* Frequency for NFC Technology F */ |
| 52 | 1, /* Frequency for Proprietary Technology/15693 */ |
| 53 | 1, /* Frequency for Proprietary Technology/B-Prime */ |
| 54 | 1, /* Frequency for Proprietary Technology/Kovio */ |
| 55 | 1, /* Frequency for NFC Technology A active mode */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 56 | 1, /* Frequency for NFC Technology F active mode */ |
| 57 | 1 /* Frequency for NFC Technology active mode */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 58 | }; |
| 59 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 60 | tNFA_DM_DISC_FREQ_CFG* p_nfa_dm_rf_disc_freq_cfg = |
| 61 | (tNFA_DM_DISC_FREQ_CFG*)&nfa_dm_rf_disc_freq_cfg; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 62 | |
suraj | f99f00a | 2017-09-20 17:53:29 +0530 | [diff] [blame] | 63 | uint8_t nfa_ee_max_ee_cfg = NFA_EE_MAX_EE_SUPPORTED; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 64 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 65 | /* set to NULL to use the default mapping set by stack */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 66 | tNCI_DISCOVER_MAPS* p_nfa_dm_interface_mapping = NULL; |
| 67 | uint8_t nfa_dm_num_dm_interface_mapping = 0; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 68 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 69 | tNFA_DM_CFG nfa_dm_cfg = { |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 70 | /* Automatic NDEF detection (when not in exclusive RF mode) */ |
| 71 | NFA_DM_AUTO_DETECT_NDEF, |
| 72 | /* Automatic NDEF read (when not in exclusive RF mode) */ |
| 73 | NFA_DM_AUTO_READ_NDEF, |
| 74 | /* Automatic presence check */ |
| 75 | NFA_DM_AUTO_PRESENCE_CHECK, |
| 76 | /* Use sleep/wake(last interface) for ISODEP presence check */ |
| 77 | NFA_DM_PRESENCE_CHECK_OPTION, |
| 78 | /* Maximum time to wait for presence check response */ |
| 79 | NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT}; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 80 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 81 | tNFA_DM_CFG* p_nfa_dm_cfg = (tNFA_DM_CFG*)&nfa_dm_cfg; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 82 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 83 | const uint8_t nfa_hci_whitelist[] = {0x02, 0x03, 0x04}; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 84 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 85 | tNFA_HCI_CFG nfa_hci_cfg = { |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 86 | /* Max HCI Network IDLE time to wait for EE DISC REQ Ntf(s) */ |
| 87 | NFA_HCI_NETWK_INIT_IDLE_TIMEOUT, |
| 88 | /* Maximum HCP Response time to any HCP Command */ |
| 89 | NFA_HCI_RESPONSE_TIMEOUT, |
nxf24591 | 193ee78 | 2018-06-06 14:26:10 +0530 | [diff] [blame] | 90 | #if (NXP_EXTNS == TRUE) |
| 91 | /* infinite wait for HCI reponse as lon as wtx is received */ |
| 92 | 0x00, |
| 93 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 94 | /* Number of host in the whitelist of Terminal host */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 95 | 0x03, |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 96 | /* Pointer to the Whitelist of Terminal Host */ |
| 97 | (uint8_t*)nfa_hci_whitelist}; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 98 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 99 | tNFA_HCI_CFG* p_nfa_hci_cfg = (tNFA_HCI_CFG*)&nfa_hci_cfg; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 100 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 101 | bool nfa_poll_bail_out_mode = false; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 102 | tNFA_PROPRIETARY_CFG nfa_proprietary_cfg = { |
| 103 | 0x80, /* NCI_PROTOCOL_18092_ACTIVE */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 104 | 0x81, /* NCI_PROTOCOL_B_PRIME */ |
| 105 | 0x82, /* NCI_PROTOCOL_DUAL */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 106 | 0x83, /* NCI_PROTOCOL_15693 */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 107 | 0x8A, /* NCI_PROTOCOL_KOVIO */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 108 | 0xFF, /* NCI_PROTOCOL_MIFARE */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 109 | 0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */ |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 110 | 0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */ |
| 111 | 0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */ |
| 112 | }; |
| 113 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 114 | tNFA_PROPRIETARY_CFG* p_nfa_proprietary_cfg = |
nxpandroid | 5e58978 | 2017-08-14 11:54:50 +0530 | [diff] [blame] | 115 | (tNFA_PROPRIETARY_CFG*)&nfa_proprietary_cfg; |