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