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