nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 2009-2014 Broadcom Corporation |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
| 17 | ******************************************************************************/ |
| 18 | /****************************************************************************** |
| 19 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 20 | * The original Work has been changed by NXP. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 21 | * |
| 22 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 23 | * you may not use this file except in compliance with the License. |
| 24 | * You may obtain a copy of the License at |
| 25 | * |
| 26 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 27 | * |
| 28 | * Unless required by applicable law or agreed to in writing, software |
| 29 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 30 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 31 | * See the License for the specific language governing permissions and |
| 32 | * limitations under the License. |
| 33 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 34 | * Copyright 2018 NXP |
| 35 | * |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 36 | ******************************************************************************/ |
| 37 | /****************************************************************************** |
| 38 | * |
| 39 | * This file contains the NFA HCI related definitions from the |
| 40 | * specification. |
| 41 | * |
| 42 | ******************************************************************************/ |
| 43 | |
| 44 | #ifndef NFA_HCI_DEFS_H |
| 45 | #define NFA_HCI_DEFS_H |
| 46 | |
| 47 | /* Static gates */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 48 | #define NFA_HCI_LOOP_BACK_GATE 0x04 |
| 49 | #define NFA_HCI_IDENTITY_MANAGEMENT_GATE 0x05 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 50 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 51 | #define NFA_HCI_FIRST_HOST_SPECIFIC_GENERIC_GATE 0x10 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 52 | #if(NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 53 | #define NFA_HCI_LAST_HOST_SPECIFIC_GENERIC_GATE 0xEF |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 54 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 55 | #define NFA_HCI_FIRST_PROP_GATE 0xF0 |
| 56 | #define NFA_HCI_LAST_PROP_GATE 0xFF |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 57 | #if(NXP_EXTNS == TRUE) |
| 58 | #define NFA_HCI_CARD_RF_A_GATE 0x23 |
| 59 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 60 | /* Generic Gates */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 61 | #define NFA_HCI_CONNECTIVITY_GATE 0x41 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 62 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 63 | /* Proprietary Gates */ |
| 64 | #define NFA_HCI_PROP_GATE_FIRST 0xF0 |
| 65 | #define NFA_HCI_PROP_GATE_LAST 0xFF |
| 66 | #if(NXP_EXTNS == TRUE) |
| 67 | /* Host defined Dynamic gates */ |
| 68 | #define NFA_HCI_APDU_GATE 0x30 |
| 69 | |
| 70 | #define NFA_HCI_ID_MNGMNT_APP_GATE 0x10 |
| 71 | |
| 72 | #define NFA_HCI_GEN_PURPOSE_APDU_APP_GATE 0xF0 |
| 73 | |
| 74 | #define NFA_HCI_GEN_PURPOSE_APDU_GATE 0xF0 |
| 75 | |
| 76 | #define NFA_HCI_APDU_APP_GATE 0x11 |
| 77 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 78 | /* Static pipes */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 79 | #define NFA_HCI_LINK_MANAGEMENT_PIPE 0x00 |
| 80 | #define NFA_HCI_ADMIN_PIPE 0x01 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 81 | |
| 82 | /* Dynamic pipe range */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 83 | #define NFA_HCI_FIRST_DYNAMIC_PIPE 0x02 |
| 84 | #define NFA_HCI_LAST_DYNAMIC_PIPE 0x6F |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 85 | |
| 86 | /* host_table */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 87 | #define NFA_HCI_HOST_CONTROLLER 0x00 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 88 | #if(NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 89 | #define NFA_HCI_DH_HOST 0x01 |
| 90 | #define NFA_HCI_UICC_HOST 0x02 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 91 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 92 | |
| 93 | /* Type of instruction */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 94 | #define NFA_HCI_COMMAND_TYPE 0x00 |
| 95 | #define NFA_HCI_EVENT_TYPE 0x01 |
| 96 | #define NFA_HCI_RESPONSE_TYPE 0x02 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 97 | |
| 98 | /* Chaining bit value */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 99 | #define NFA_HCI_MESSAGE_FRAGMENTATION 0x00 |
| 100 | #define NFA_HCI_NO_MESSAGE_FRAGMENTATION 0x01 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 101 | |
| 102 | /* NFA HCI commands */ |
| 103 | |
| 104 | /* Commands for all gates */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 105 | #define NFA_HCI_ANY_SET_PARAMETER 0x01 |
| 106 | #define NFA_HCI_ANY_GET_PARAMETER 0x02 |
| 107 | #define NFA_HCI_ANY_OPEN_PIPE 0x03 |
| 108 | #define NFA_HCI_ANY_CLOSE_PIPE 0x04 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 109 | |
| 110 | /* Admin gate commands */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 111 | #define NFA_HCI_ADM_CREATE_PIPE 0x10 |
| 112 | #define NFA_HCI_ADM_DELETE_PIPE 0x11 |
| 113 | #define NFA_HCI_ADM_NOTIFY_PIPE_CREATED 0x12 |
| 114 | #define NFA_HCI_ADM_NOTIFY_PIPE_DELETED 0x13 |
| 115 | #define NFA_HCI_ADM_CLEAR_ALL_PIPE 0x14 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 116 | #define NFA_HCI_ADM_NOTIFY_ALL_PIPE_CLEARED 0x15 |
| 117 | |
| 118 | /* Connectivity gate command */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 119 | #define NFA_HCI_CON_PRO_HOST_REQUEST 0x10 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 120 | |
| 121 | /* NFA HCI responses */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 122 | #define NFA_HCI_ANY_OK 0x00 |
| 123 | #define NFA_HCI_ANY_E_NOT_CONNECTED 0x01 |
| 124 | #define NFA_HCI_ANY_E_CMD_PAR_UNKNOWN 0x02 |
| 125 | #define NFA_HCI_ANY_E_NOK 0x03 |
| 126 | #define NFA_HCI_ADM_E_NO_PIPES_AVAILABLE 0x04 |
| 127 | #define NFA_HCI_ANY_E_REG_PAR_UNKNOWN 0x05 |
| 128 | #define NFA_HCI_ANY_E_PIPE_NOT_OPENED 0x06 |
| 129 | #define NFA_HCI_ANY_E_CMD_NOT_SUPPORTED 0x07 |
| 130 | #define NFA_HCI_ANY_E_INHIBITED 0x08 |
| 131 | #define NFA_HCI_ANY_E_TIMEOUT 0x09 |
| 132 | #define NFA_HCI_ANY_E_REG_ACCESS_DENIED 0x0A |
| 133 | #define NFA_HCI_ANY_E_PIPE_ACCESS_DENIED 0x0B |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 134 | |
| 135 | /* NFA HCI Events */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 136 | #define NFA_HCI_EVT_HCI_END_OF_OPERATION 0x01 |
| 137 | #define NFA_HCI_EVT_POST_DATA 0x02 |
| 138 | #define NFA_HCI_EVT_HOT_PLUG 0x03 |
Suraj Uday Kotharkar | b43fdb6 | 2018-06-08 20:51:09 +0530 | [diff] [blame] | 139 | #if(NXP_EXTNS == TRUE) |
| 140 | #define NFA_HCI_EVT_INIT_COMPLETED 0x04 |
| 141 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 142 | /* NFA HCI Connectivity gate Events */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 143 | #define NFA_HCI_EVT_CONNECTIVITY 0x10 |
| 144 | #define NFA_HCI_EVT_TRANSACTION 0x12 |
| 145 | #define NFA_HCI_EVT_OPERATION_ENDED 0x13 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 146 | #if(NXP_EXTNS == TRUE) |
| 147 | /* Connectivity App gate registry identifier*/ |
| 148 | #define NFA_HCI_UI_STATE_INDEX 0x01 |
| 149 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 150 | /* Host controller Admin gate registry identifiers */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 151 | #define NFA_HCI_SESSION_IDENTITY_INDEX 0x01 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 152 | #if(NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 153 | #define NFA_HCI_MAX_PIPE_INDEX 0x02 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 154 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 155 | #define NFA_HCI_WHITELIST_INDEX 0x03 |
| 156 | #define NFA_HCI_HOST_LIST_INDEX 0x04 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 157 | #if(NXP_EXTNS == TRUE) |
| 158 | /* ETSI HCI APDU gate events */ |
| 159 | #define NFA_HCI_EVT_C_APDU 0x10 |
| 160 | #define NFA_HCI_EVT_ABORT 0x11 |
| 161 | #define NFA_HCI_EVT_END_OF_APDU_TRANSACTION 0x21 |
| 162 | |
| 163 | /* ETSI HCI APDU gate Registry identifiers */ |
| 164 | #define NFA_HCI_MAX_C_APDU_SIZE_INDEX 0x01 |
| 165 | #define NFA_HCI_MAX_WAIT_TIME_INDEX 0x02 |
| 166 | |
| 167 | /* ETSI HCI APDU app gate events */ |
| 168 | #define NFA_HCI_EVT_R_APDU 0x10 |
| 169 | #define NFA_HCI_EVT_WTX 0x11 |
| 170 | #define NFA_HCI_EVT_ATR 0x12 |
| 171 | |
| 172 | #define NFA_HCI_EVT_ATR_TIMEOUT 0x64 /* 100 msec Max EVT_ATR respond time */ |
| 173 | |
| 174 | /*Host controller Admin gate Rel 12 */ |
| 175 | #define NFA_HCI_HOST_ID_INDEX 0x05 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 176 | #define NFA_HCI_HOST_TYPE_INDEX 0x06 |
| 177 | #define NFA_HCI_HOST_TYPE_LIST_INDEX 0x07 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 178 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 179 | /*HOST_TYPE registry value coding types*/ |
| 180 | #define NFA_HCI_HOST_CONTROLLER_TYPE 0x0000 |
| 181 | #define NFA_HCI_DH_HOST_TYPE 0x0100 |
| 182 | #define NFA_HCI_UICC_HOST_TYPE 0x0200 |
| 183 | #define NFA_HCI_ESE_HOST_TYPE 0x0300 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 184 | /* Host controller and DH Link management gate registry identifier */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 185 | #define NFA_HCI_REC_ERROR_INDEX 0x02 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 186 | #endif |
| 187 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 188 | |
| 189 | /* DH Identity management gate registry identifier */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 190 | #define NFA_HCI_VERSION_SW_INDEX 0x01 |
| 191 | #define NFA_HCI_VERSION_HW_INDEX 0x03 |
| 192 | #define NFA_HCI_VENDOR_NAME_INDEX 0x04 |
| 193 | #define NFA_HCI_MODEL_ID_INDEX 0x05 |
| 194 | #define NFA_HCI_HCI_VERSION_INDEX 0x02 |
| 195 | #define NFA_HCI_GATES_LIST_INDEX 0x06 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 196 | #if(NXP_EXTNS == TRUE) |
| 197 | #define NFA_HCI_MAX_CURRENT_INDEX 0x08 |
nxpandroid | 3e4012e | 2016-08-01 19:09:55 +0530 | [diff] [blame] | 198 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 199 | #endif /* NFA_HCI_DEFS_H */ |