blob: 7b34bf2600115b2eda2bf81c682d76b67d340155 [file] [log] [blame]
nxpandroidc7611652015-09-23 16:42:05 +05301/******************************************************************************
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 *
nxf24591c1cbeab2018-02-21 17:32:26 +053020 * The original Work has been changed by NXP.
nxpandroidc7611652015-09-23 16:42:05 +053021 *
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 *
nxf24591c1cbeab2018-02-21 17:32:26 +053034 * Copyright 2018 NXP
35 *
nxpandroidc7611652015-09-23 16:42:05 +053036 ******************************************************************************/
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 */
nxpandroid8f6d0532017-07-12 18:25:30 +053048#define NFA_HCI_LOOP_BACK_GATE 0x04
49#define NFA_HCI_IDENTITY_MANAGEMENT_GATE 0x05
nxpandroidc7611652015-09-23 16:42:05 +053050
nxpandroid8f6d0532017-07-12 18:25:30 +053051#define NFA_HCI_FIRST_HOST_SPECIFIC_GENERIC_GATE 0x10
nxf24591c1cbeab2018-02-21 17:32:26 +053052#if(NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +053053#define NFA_HCI_LAST_HOST_SPECIFIC_GENERIC_GATE 0xEF
nxf24591c1cbeab2018-02-21 17:32:26 +053054#endif
nxpandroid8f6d0532017-07-12 18:25:30 +053055#define NFA_HCI_FIRST_PROP_GATE 0xF0
56#define NFA_HCI_LAST_PROP_GATE 0xFF
nxf24591c1cbeab2018-02-21 17:32:26 +053057#if(NXP_EXTNS == TRUE)
58#define NFA_HCI_CARD_RF_A_GATE 0x23
59#endif
nxpandroidc7611652015-09-23 16:42:05 +053060/* Generic Gates */
nxpandroid8f6d0532017-07-12 18:25:30 +053061#define NFA_HCI_CONNECTIVITY_GATE 0x41
nxpandroidc7611652015-09-23 16:42:05 +053062
nxf24591c1cbeab2018-02-21 17:32:26 +053063/* 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
nxpandroidc7611652015-09-23 16:42:05 +053078/* Static pipes */
nxpandroid8f6d0532017-07-12 18:25:30 +053079#define NFA_HCI_LINK_MANAGEMENT_PIPE 0x00
80#define NFA_HCI_ADMIN_PIPE 0x01
nxpandroidc7611652015-09-23 16:42:05 +053081
82/* Dynamic pipe range */
nxpandroid8f6d0532017-07-12 18:25:30 +053083#define NFA_HCI_FIRST_DYNAMIC_PIPE 0x02
84#define NFA_HCI_LAST_DYNAMIC_PIPE 0x6F
nxpandroidc7611652015-09-23 16:42:05 +053085
86/* host_table */
nxpandroid8f6d0532017-07-12 18:25:30 +053087#define NFA_HCI_HOST_CONTROLLER 0x00
nxf24591c1cbeab2018-02-21 17:32:26 +053088#if(NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +053089#define NFA_HCI_DH_HOST 0x01
90#define NFA_HCI_UICC_HOST 0x02
nxf24591c1cbeab2018-02-21 17:32:26 +053091#endif
nxpandroidc7611652015-09-23 16:42:05 +053092
93/* Type of instruction */
nxpandroid8f6d0532017-07-12 18:25:30 +053094#define NFA_HCI_COMMAND_TYPE 0x00
95#define NFA_HCI_EVENT_TYPE 0x01
96#define NFA_HCI_RESPONSE_TYPE 0x02
nxpandroidc7611652015-09-23 16:42:05 +053097
98/* Chaining bit value */
nxpandroid8f6d0532017-07-12 18:25:30 +053099#define NFA_HCI_MESSAGE_FRAGMENTATION 0x00
100#define NFA_HCI_NO_MESSAGE_FRAGMENTATION 0x01
nxpandroidc7611652015-09-23 16:42:05 +0530101
102/* NFA HCI commands */
103
104/* Commands for all gates */
nxpandroid8f6d0532017-07-12 18:25:30 +0530105#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
nxpandroidc7611652015-09-23 16:42:05 +0530109
110/* Admin gate commands */
nxpandroid8f6d0532017-07-12 18:25:30 +0530111#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
nxpandroidc7611652015-09-23 16:42:05 +0530116#define NFA_HCI_ADM_NOTIFY_ALL_PIPE_CLEARED 0x15
117
118/* Connectivity gate command */
nxpandroid8f6d0532017-07-12 18:25:30 +0530119#define NFA_HCI_CON_PRO_HOST_REQUEST 0x10
nxpandroidc7611652015-09-23 16:42:05 +0530120
121/* NFA HCI responses */
nxpandroid8f6d0532017-07-12 18:25:30 +0530122#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
nxpandroidc7611652015-09-23 16:42:05 +0530134
135/* NFA HCI Events */
nxpandroid8f6d0532017-07-12 18:25:30 +0530136#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 Kotharkarb43fdb62018-06-08 20:51:09 +0530139#if(NXP_EXTNS == TRUE)
140#define NFA_HCI_EVT_INIT_COMPLETED 0x04
141#endif
nxpandroidc7611652015-09-23 16:42:05 +0530142/* NFA HCI Connectivity gate Events */
nxpandroid8f6d0532017-07-12 18:25:30 +0530143#define NFA_HCI_EVT_CONNECTIVITY 0x10
144#define NFA_HCI_EVT_TRANSACTION 0x12
145#define NFA_HCI_EVT_OPERATION_ENDED 0x13
nxf24591c1cbeab2018-02-21 17:32:26 +0530146#if(NXP_EXTNS == TRUE)
147/* Connectivity App gate registry identifier*/
148#define NFA_HCI_UI_STATE_INDEX 0x01
149#endif
nxpandroidc7611652015-09-23 16:42:05 +0530150/* Host controller Admin gate registry identifiers */
nxpandroid8f6d0532017-07-12 18:25:30 +0530151#define NFA_HCI_SESSION_IDENTITY_INDEX 0x01
nxf24591c1cbeab2018-02-21 17:32:26 +0530152#if(NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +0530153#define NFA_HCI_MAX_PIPE_INDEX 0x02
nxf24591c1cbeab2018-02-21 17:32:26 +0530154#endif
nxpandroid8f6d0532017-07-12 18:25:30 +0530155#define NFA_HCI_WHITELIST_INDEX 0x03
156#define NFA_HCI_HOST_LIST_INDEX 0x04
nxf24591c1cbeab2018-02-21 17:32:26 +0530157#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
nxpandroid8f6d0532017-07-12 18:25:30 +0530176#define NFA_HCI_HOST_TYPE_INDEX 0x06
177#define NFA_HCI_HOST_TYPE_LIST_INDEX 0x07
nxpandroidc7611652015-09-23 16:42:05 +0530178
nxf24591c1cbeab2018-02-21 17:32:26 +0530179/*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
nxpandroidc7611652015-09-23 16:42:05 +0530184/* Host controller and DH Link management gate registry identifier */
nxpandroid8f6d0532017-07-12 18:25:30 +0530185#define NFA_HCI_REC_ERROR_INDEX 0x02
nxf24591c1cbeab2018-02-21 17:32:26 +0530186#endif
187
nxpandroidc7611652015-09-23 16:42:05 +0530188
189/* DH Identity management gate registry identifier */
nxpandroid8f6d0532017-07-12 18:25:30 +0530190#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
nxf24591c1cbeab2018-02-21 17:32:26 +0530196#if(NXP_EXTNS == TRUE)
197#define NFA_HCI_MAX_CURRENT_INDEX 0x08
nxpandroid3e4012e2016-08-01 19:09:55 +0530198#endif
nxpandroidc7611652015-09-23 16:42:05 +0530199#endif /* NFA_HCI_DEFS_H */