1e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/******************************************************************************
2e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
3e9629bad30a9f478b336ab46b8e6e02f7f87af46Evan Chu *  Copyright (C) 2003-2014 Broadcom Corporation
4e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
5e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  Licensed under the Apache License, Version 2.0 (the "License");
6e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  you may not use this file except in compliance with the License.
7e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  You may obtain a copy of the License at:
8e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
9e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  http://www.apache.org/licenses/LICENSE-2.0
10e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
11e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  Unless required by applicable law or agreed to in writing, software
12e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  distributed under the License is distributed on an "AS IS" BASIS,
13e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  See the License for the specific language governing permissions and
15e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  limitations under the License.
16e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
17e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project ******************************************************************************/
18e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
195c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen
20e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/******************************************************************************
21e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
22e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  This is the private interface file for the NFA device manager.
23e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
24e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project ******************************************************************************/
25e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#ifndef NFA_DM_INT_H
26e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_INT_H
27e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
28e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#include "nfc_api.h"
29e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#include "nfa_api.h"
30e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
31e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
32e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*****************************************************************************
33e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**  Constants and data types
34e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*****************************************************************************/
35e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
36e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM events */
37e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectenum
38e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
39e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* device manager local device API events */
40e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_ENABLE_EVT           = NFA_SYS_EVT_START (NFA_ID_DM),
41e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_DISABLE_EVT,
42e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_SET_CONFIG_EVT,
43e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_GET_CONFIG_EVT,
44e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_REQUEST_EXCL_RF_CTRL_EVT,
45e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_RELEASE_EXCL_RF_CTRL_EVT,
46e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_ENABLE_POLLING_EVT,
47e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_DISABLE_POLLING_EVT,
4867aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu    NFA_DM_API_ENABLE_LISTENING_EVT,
4967aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu    NFA_DM_API_DISABLE_LISTENING_EVT,
5067aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu    NFA_DM_API_PAUSE_P2P_EVT,
5167aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu    NFA_DM_API_RESUME_P2P_EVT,
52e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_RAW_FRAME_EVT,
53e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_SET_P2P_LISTEN_TECH_EVT,
54e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_START_RF_DISCOVERY_EVT,
55e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_STOP_RF_DISCOVERY_EVT,
56e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_SET_RF_DISC_DURATION_EVT,
57e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_SELECT_EVT,
58e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_UPDATE_RF_PARAMS_EVT,
59e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_DEACTIVATE_EVT,
60e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_POWER_OFF_SLEEP_EVT,
61e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_REG_NDEF_HDLR_EVT,
62e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_DEREG_NDEF_HDLR_EVT,
63e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_REG_VSC_EVT,
64e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_API_SEND_VSC_EVT,
65e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_TIMEOUT_DISABLE_EVT,
66e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_MAX_EVT
67e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project};
68e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
69e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
70e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_ENABLE_EVT */
71e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
72e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
73e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR                  hdr;
74e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_CBACK           *p_dm_cback;
75e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_CONN_CBACK         *p_conn_cback;
76e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_ENABLE;
77e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
78e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_DISABLE_EVT */
79e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
80e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
81e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
82e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BOOLEAN             graceful;
83e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_DISABLE;
84e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
85e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_SET_CONFIG_EVT */
86e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
87e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
88e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
89e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_PMID           param_id;
90e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               length;
91e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8              *p_data;
92e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_SET_CONFIG;
93e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
94e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_GET_CONFIG_EVT */
95e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
96e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
97e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
98e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               num_ids;
99e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_PMID          *p_pmids;
100e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_GET_CONFIG;
101e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
102e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_REQ_EXCL_RF_CTRL_EVT */
103e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
104e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
105e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR               hdr;
106e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_TECHNOLOGY_MASK poll_mask;
107e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_LISTEN_CFG      listen_cfg;
108e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_CONN_CBACK     *p_conn_cback;
109e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NDEF_CBACK     *p_ndef_cback;
110e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_REQ_EXCL_RF_CTRL;
111e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
112e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_ENABLE_POLLING_EVT */
113e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
114e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
115e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR               hdr;
116e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_TECHNOLOGY_MASK poll_mask;
117e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_ENABLE_POLL;
118e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
119e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_SET_P2P_LISTEN_TECH_EVT */
120e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
121e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
122e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR                  hdr;
123e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_TECHNOLOGY_MASK    tech_mask;
124e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_SET_P2P_LISTEN_TECH;
125e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
126e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_SELECT_EVT */
127e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
128e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
129e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
130e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               rf_disc_id;
131e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NFC_PROTOCOL   protocol;
132e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_INTF_TYPE      rf_interface;
133e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_SELECT;
134e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
135e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_UPDATE_RF_PARAMS_EVT */
136e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
137e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
138e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
139e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_RF_COMM_PARAMS params;
140e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_UPDATE_RF_PARAMS;
141e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
142e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_DEACTIVATE_EVT */
143e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
144e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
145e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
146e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BOOLEAN             sleep_mode;
147e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_DEACTIVATE;
148e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
149e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_SET_RF_DISC_DURATION_EVT */
150e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
151e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
152e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
153e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT16              rf_disc_dur_ms;
154e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_SET_RF_DISC_DUR;
155e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_RF_DISC_DURATION_MAX                0xFFFF
156e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
157e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_REG_NDEF_HDLR_EVT */
158e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_NDEF_FLAGS_HANDLE_WHOLE_MESSAGE     0x01
159e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_NDEF_FLAGS_WKT_URI                  0x02
160e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_NDEF_FLAGS_WHOLE_MESSAGE_NOTIFIED   0x04
161e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
162e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
163e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
164e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR              hdr;
165e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         ndef_type_handle;
166e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               flags;
167e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NDEF_CBACK    *p_ndef_cback;
168e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_TNF            tnf;                /* Type-name field of record-type that was registered.                  */
169e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NDEF_URI_ID    uri_id;             /* URI prefix abrieviation (for NFA_RegisterNDefUriHandler)             */
170e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               name_len;           /* Length of type name or absolute URI                                  */
171e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               name[1];            /* Type name or absolute URI of record-type that got was registered.    */
172e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_REG_NDEF_HDLR;
173e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
174e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_DEREG_NDEF_HDLR_EVT */
175e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
176e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
177e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR      hdr;
178e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE ndef_type_handle;
179e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_DEREG_NDEF_HDLR;
180e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
181e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_REG_VSC_EVT */
182e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
183e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
184e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR          hdr;
185e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_VSC_CBACK  *p_cback;
186e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BOOLEAN         is_register;
187e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_REG_VSC;
188e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
189e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* data type for NFA_DM_API_SEND_VSC_EVT */
190e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
191e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
192e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR          hdr;
193e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_VSC_CBACK  *p_cback;
194e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8           oid;
195e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8           cmd_params_len;
196e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT16          pad;    /* add padding to ensure the size is big enough for offset=NCI_VSC_MSG_HDR_SIZE */
197e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8           *p_cmd_params;
198e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_API_SEND_VSC;
199e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
200e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
201e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* union of all data types */
202e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef union
203e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
204e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* GKI event buffer header */
205e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BT_HDR                          hdr;                /* NFA_DM_API_RAW_FRAME_EVT             */
206e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                        /* NFA_DM_API_MULTI_TECH_RSP_EVT        */
207e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                        /* NFA_DM_API_RELEASE_EXCL_RF_CTRL      */
208e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                        /* NFA_DM_API_DISABLE_POLLING_EVT       */
209e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                        /* NFA_DM_API_START_RF_DISCOVERY_EVT    */
210e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                        /* NFA_DM_API_STOP_RF_DISCOVERY_EVT     */
211e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_ENABLE              enable;             /* NFA_DM_API_ENABLE_EVT                */
212e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_DISABLE             disable;            /* NFA_DM_API_DISABLE_EVT               */
213e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_SET_CONFIG          setconfig;          /* NFA_DM_API_SET_CONFIG_EVT            */
214e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_GET_CONFIG          getconfig;          /* NFA_DM_API_GET_CONFIG_EVT            */
215e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_SET_RF_DISC_DUR     disc_duration;      /* NFA_DM_API_SET_RF_DISC_DURATION_EVT  */
216e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_REG_NDEF_HDLR       reg_ndef_hdlr;      /* NFA_DM_API_REG_NDEF_HDLR_EVT         */
217e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_DEREG_NDEF_HDLR     dereg_ndef_hdlr;    /* NFA_DM_API_DEREG_NDEF_HDLR_EVT       */
218e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_REQ_EXCL_RF_CTRL    req_excl_rf_ctrl;   /* NFA_DM_API_REQUEST_EXCL_RF_CTRL      */
219e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_ENABLE_POLL         enable_poll;        /* NFA_DM_API_ENABLE_POLLING_EVT        */
220e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_SET_P2P_LISTEN_TECH set_p2p_listen_tech;/* NFA_DM_API_SET_P2P_LISTEN_TECH_EVT   */
221e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_SELECT              select;             /* NFA_DM_API_SELECT_EVT                */
222e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_UPDATE_RF_PARAMS    update_rf_params;   /* NFA_DM_API_UPDATE_RF_PARAMS_EVT      */
223e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_DEACTIVATE          deactivate;         /* NFA_DM_API_DEACTIVATE_EVT            */
224e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_SEND_VSC            send_vsc;           /* NFA_DM_API_SEND_VSC_EVT              */
225e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_REG_VSC             reg_vsc;            /* NFA_DM_API_REG_VSC_EVT               */
226e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_MSG;
227e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
228e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM RF discovery state */
229e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectenum
230e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
231e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_IDLE,               /* idle state                     */
232e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_DISCOVERY,          /* discovery state                */
233e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_W4_ALL_DISCOVERIES, /* wait for all discoveries state */
234e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_W4_HOST_SELECT,     /* wait for host selection state  */
235e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_POLL_ACTIVE,        /* poll mode activated state      */
236e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_LISTEN_ACTIVE,      /* listen mode activated state    */
237e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_LISTEN_SLEEP,       /* listen mode sleep state        */
238e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_LP_LISTEN,          /* Listening in Low Power mode    */
239e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RFST_LP_ACTIVE           /* Activated in Low Power mode    */
240e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project};
241e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT8 tNFA_DM_RF_DISC_STATE;
242e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
243e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM RF discovery state machine event */
244e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectenum
245e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
246e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISCOVER_CMD,         /* start RF discovery                    */
247e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISCOVER_RSP,         /* discover response from NFCC           */
248e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISCOVER_NTF,         /* RF discovery NTF from NFCC            */
249e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISCOVER_SELECT_CMD,  /* select discovered target              */
250e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISCOVER_SELECT_RSP,  /* select response from NFCC             */
251e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_INTF_ACTIVATED_NTF,   /* RF interface activation NTF from NFCC */
252e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DEACTIVATE_CMD,       /* deactivate RF interface               */
253e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DEACTIVATE_RSP,       /* deactivate response from NFCC         */
254e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DEACTIVATE_NTF,       /* deactivate RF interface NTF from NFCC */
255e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_LP_LISTEN_CMD,           /* NFCC is listening in low power mode   */
256e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_CORE_INTF_ERROR_NTF,     /* RF interface error NTF from NFCC      */
257e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_DISC_SM_MAX_EVENT
258e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project};
259e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT8 tNFA_DM_RF_DISC_SM_EVENT;
260e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
261e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM RF discovery state machine data */
262e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
263e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
264e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               rf_disc_id;
265e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NFC_PROTOCOL   protocol;
266e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_INTF_TYPE      rf_interface;
267e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_DISC_SELECT_PARAMS;
268e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
269e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef union
270e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
271e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFC_DISCOVER               nfc_discover;       /* discovery data from NFCC    */
272e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFC_DEACT_TYPE             deactivate_type;    /* deactivation type           */
273e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_SELECT_PARAMS  select;             /* selected target information */
274e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_RF_DISC_DATA;
275e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
276e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Callback event from NFA DM RF Discovery to other NFA sub-modules */
277e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectenum
278e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
279e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISC_START_EVT,           /* discovery started with protocol, technology and mode       */
280e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_RF_DISC_ACTIVATED_EVT,       /* activated with configured protocol, technology and mode    */
2815c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen    NFA_DM_RF_DISC_DEACTIVATED_EVT      /* deactivated sleep or idle                                  */
282e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project};
283e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT8 tNFA_DM_RF_DISC_EVT;
284e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
285e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Combined NFC Technology and protocol bit mask */
286e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PA_T1T                 0x00000001
287e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PA_T2T                 0x00000002
288e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PA_ISO_DEP             0x00000004
289e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PA_NFC_DEP             0x00000008
290e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PB_ISO_DEP             0x00000010
291e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PF_T3T                 0x00000020
292e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PF_NFC_DEP             0x00000040
293e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_P_ISO15693             0x00000100
294e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_P_B_PRIME              0x00000200
295e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_P_KOVIO                0x00000400
296e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PAA_NFC_DEP            0x00000800
297e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_PFA_NFC_DEP            0x00001000
298e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_P_LEGACY               0x00002000  /* Legacy/proprietary/non-NFC Forum protocol (e.g Shanghai transit card) */
299e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_POLL                   0x0000FFFF
300e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
301e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LA_T1T                 0x00010000
302e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LA_T2T                 0x00020000
303e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LA_ISO_DEP             0x00040000
304e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LA_NFC_DEP             0x00080000
305e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LB_ISO_DEP             0x00100000
306e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LF_T3T                 0x00200000
307e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LF_NFC_DEP             0x00400000
308e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_L_ISO15693             0x01000000
309e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_L_B_PRIME              0x02000000
310e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LAA_NFC_DEP            0x04000000
311e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LFA_NFC_DEP            0x08000000
312e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_L_LEGACY               0x10000000
313e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_MASK_LISTEN                 0xFFFF0000
314e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
315a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu#define NFA_DM_DISC_MASK_NFC_DEP                0x0C481848
316a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu
317a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu
318e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT32  tNFA_DM_DISC_TECH_PROTO_MASK;
319e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
320e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
321e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM RF discovery host ID */
322e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_HOST_ID_DH          NFC_DH_ID
323e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT8 tNFA_DM_DISC_HOST_ID;
324e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
325e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM deactivation callback type */
326e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef void (tNFA_DISCOVER_CBACK) (tNFA_DM_RF_DISC_EVT event, tNFC_DISCOVER *p_data);
327e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
328e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM RF discovery action flags */
329e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_ENABLED        0x0001    /* RF discovery process has been started        */
330e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_STOPPING       0x0002    /* Stop RF discovery is pending                 */
331e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_DISABLING      0x0004    /* Disable NFA is pending                       */
332c95c79ccb65d82a65b960919077d5c359cf28cedEvan Chu#define NFA_DM_DISC_FLAGS_CHECKING       0x0008    /* Sleep wakeup in progress                     */
333e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_NOTIFY         0x0010    /* Notify sub-module that discovery is starting */
334e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_W4_RSP         0x0020    /* command has been sent to NFCC in the state   */
335e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_FLAGS_W4_NTF         0x0040    /* wait for NTF before changing discovery state */
336e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
337e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT16 tNFA_DM_DISC_FLAGS;
338e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
339e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM Discovery control block */
340e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
341e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
342e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    BOOLEAN                         in_use;             /* TRUE if used          */
343e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DISCOVER_CBACK            *p_disc_cback;       /* discovery callback    */
344e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
345e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_FLAGS              disc_flags;         /* specific action flags */
346e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_HOST_ID            host_id;            /* DH or UICC1/UICC2     */
347e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_TECH_PROTO_MASK    requested_disc_mask;/* technology and protocol requested              */
348e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_TECH_PROTO_MASK    selected_disc_mask; /* technology and protocol waiting for activation */
349e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_DISC_ENTRY;
350e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
351e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_DISC_NUM_ENTRIES  8              /* polling, raw listen, P2P listen, NDEF CE, 2xVSE, 2xUICC */
352e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
353e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_MAX_DISC_PARAMS   16             /* max discovery technology parameters */
354e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
355e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* index of listen mode routing table for technologies */
356e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectenum {
357e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_DISC_LRT_NFC_A,
358e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_DISC_LRT_NFC_B,
359e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_DISC_LRT_NFC_F,
360e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    NFA_DM_DISC_LRT_NFC_BP
361e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project};
362e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
363e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* SLP_REQ (HLTA) command */
364e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define SLP_REQ_CMD     0x5000
365e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_MAX_TECH_ROUTE   4 /* NFA_EE_MAX_TECH_ROUTE. only A, B, F, Bprime are supported by UICC now */
366e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
3675c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen/* timeout for waiting deactivation NTF,
3685c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen** possible delay to send deactivate CMD if all credit wasn't returned
3695c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen** transport delay (1sec) and max RWT (5sec)
3705c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen*/
3715c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#define NFA_DM_DISC_TIMEOUT_W4_DEACT_NTF            (NFC_DEACTIVATE_TIMEOUT*1000 + 6000)
3725c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen
373e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
374e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
375e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT16                  disc_duration;          /* Disc duration                                    */
376e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_FLAGS      disc_flags;             /* specific action flags                            */
377e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_RF_DISC_STATE   disc_state;             /* RF discovery state                               */
378e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
379e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFC_RF_TECH_N_MODE     activated_tech_mode;    /* activated technology and mode                    */
380e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                   activated_rf_disc_id;   /* activated RF discovery ID                        */
381e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_INTF_TYPE          activated_rf_interface; /* activated RF interface                           */
382e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NFC_PROTOCOL       activated_protocol;     /* activated protocol                               */
383e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE             activated_handle;       /* handle of activated sub-module                   */
384e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                   activated_sel_res;      /* activated tag's SEL_RES response                 */
385e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
386e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_ENTRY      entry[NFA_DM_DISC_NUM_ENTRIES];
387e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
388e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_ENTRY      excl_disc_entry;        /* exclusive RF discovery                           */
389e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_LISTEN_CFG         excl_listen_config;     /* listen cfg for exclusive-rf mode                 */
390e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
391e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                   listen_RT[NFA_DM_MAX_TECH_ROUTE];/* Host ID for A, B, F, B' technology routing*/
392e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_TECH_PROTO_MASK    dm_disc_mask;   /* technology and protocol waiting for activation   */
393e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
3945c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen    TIMER_LIST_ENT          tle;                    /* timer for waiting deactivation NTF               */
3957c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    TIMER_LIST_ENT          kovio_tle;              /* timer for Kovio bar code tag presence check      */
3967c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu
3977c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    BOOLEAN                 deact_pending;          /* TRUE if deactivate while checking presence       */
398df5080d7feca9827fd0306471c54f52ecf185c22Evan Chu    BOOLEAN                 deact_notify_pending;   /* TRUE if notify DEACTIVATED EVT while Stop rf discovery*/
3997c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    tNFA_DEACTIVATE_TYPE    pending_deact_type;     /* pending deactivate type                          */
4005c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen
401e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_DISC_CB;
402e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
403e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* NDEF Type Handler Definitions */
404e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_NDEF_DEFAULT_HANDLER_IDX    0           /* Default handler entry in ndef_handler table      */
405e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
406e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_PARAM_ID_INVALID            0xFF
407e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
408e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Maximum number of pending SetConfigs */
409e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_SETCONFIG_PENDING_MAX            32
410e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
411e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* NFA_DM flags */
412e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_DM_IS_ACTIVE               0x00000001  /* DM is enabled                                                        */
413e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_EXCL_RF_ACTIVE             0x00000002  /* Exclusive RF mode is active                                          */
414e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_POLLING_ENABLED            0x00000004  /* Polling is enabled (while not in exclusive RF mode                   */
415e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_SEND_POLL_STOP_EVT         0x00000008  /* send poll stop event                                                 */
416e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_AUTO_READING_NDEF          0x00000010  /* auto reading of NDEF in progress                                     */
417e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_ENABLE_EVT_PEND            0x00000020  /* NFA_DM_ENABLE_EVT is not reported yet                                */
418e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_SEND_DEACTIVATED_EVT       0x00000040  /* Send NFA_DEACTIVATED_EVT when deactivated                            */
419e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_NFCC_IS_RESTORING          0x00000100  /* NFCC is restoring after back to full power mode                      */
420e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_SETTING_PWR_MODE           0x00000200  /* NFCC power mode is updating                                          */
421e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_DM_FLAGS_DM_DISABLING_NFC           0x00000400  /* NFA DM is disabling NFC                                              */
422a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu#define NFA_DM_FLAGS_RAW_FRAME                  0x00000800  /* NFA_SendRawFrame() is called since RF activation                     */
42367aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu#define NFA_DM_FLAGS_LISTEN_DISABLED            0x00001000  /* NFA_DisableListening() is called and engaged                         */
42467aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan Chu#define NFA_DM_FLAGS_P2P_PAUSED                 0x00002000  /* NFA_PauseP2p() is called and engaged                         */
425fab6ab84257e6abee4686e699cb6f632fa9d0997Sherry Smith#define NFA_DM_FLAGS_POWER_OFF_SLEEP            0x00008000  /* Power Off Sleep                                                      */
426e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* stored parameters */
427e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
428e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
429e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 total_duration[NCI_PARAM_LEN_TOTAL_DURATION];
430e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
431e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_bit_frame_sdd[NCI_PARAM_LEN_LA_BIT_FRAME_SDD];
432e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_bit_frame_sdd_len;
433e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_platform_config[NCI_PARAM_LEN_LA_PLATFORM_CONFIG];
434e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_platform_config_len;
435e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_sel_info[NCI_PARAM_LEN_LA_SEL_INFO];
436e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_sel_info_len;
437e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_nfcid1[NCI_NFCID1_MAX_LEN];
438e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_nfcid1_len;
439e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_hist_by[NCI_MAX_HIS_BYTES_LEN];
440e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 la_hist_by_len;
441e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
442e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_sensb_info[NCI_PARAM_LEN_LB_SENSB_INFO];
443e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_sensb_info_len;
444e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_nfcid0[NCI_PARAM_LEN_LB_NFCID0];
445e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_nfcid0_len;
446e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_appdata[NCI_PARAM_LEN_LB_APPDATA];
447e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_appdata_len;
448e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_adc_fo[NCI_PARAM_LEN_LB_ADC_FO];
449e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_adc_fo_len;
450e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_h_info[NCI_MAX_ATTRIB_LEN];
451e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lb_h_info_len;
452e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
453e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_protocol[NCI_PARAM_LEN_LF_PROTOCOL];
454e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_protocol_len;
455e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_t3t_flags2[NCI_PARAM_LEN_LF_T3T_FLAGS2];
456e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_t3t_flags2_len;
457e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_t3t_pmm[NCI_PARAM_LEN_LF_T3T_PMM];
458e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 lf_t3t_id[NFA_CE_LISTEN_INFO_MAX][NCI_PARAM_LEN_LF_T3T_ID];
459e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
460e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 fwi[NCI_PARAM_LEN_FWI];
461e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 wt[NCI_PARAM_LEN_WT];
462e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 atr_req_gen_bytes[NCI_MAX_GEN_BYTES_LEN];
463e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 atr_req_gen_bytes_len;
464e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 atr_res_gen_bytes[NCI_MAX_GEN_BYTES_LEN];
465e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8 atr_res_gen_bytes_len;
466e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_PARAMS;
467e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
468a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu/*
469a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu**  NFA_NDEF CHO callback
470a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu**  It returns TRUE if NDEF is handled by connection handover module.
471a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu*/
472a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chutypedef BOOLEAN (tNFA_NDEF_CHO_CBACK) (UINT32 ndef_len, UINT8 *p_ndef_data);
473a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu
474e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* DM control block */
475e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
476e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
477e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32                      flags;              /* NFA_DM flags (see definitions for NFA_DM_FLAGS_*)    */
478e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_CBACK              *p_dm_cback;         /* NFA DM callback                                      */
479e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    TIMER_LIST_ENT              tle;
480e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
481e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* NFC link connection management */
482e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_CONN_CBACK            *p_conn_cback;       /* callback for connection events       */
483e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_TECHNOLOGY_MASK        poll_mask;          /* technologies being polled            */
484e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
485e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_CONN_CBACK            *p_excl_conn_cback;  /* exclusive RF mode callback           */
486e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_NDEF_CBACK            *p_excl_ndef_cback;  /* ndef callback for exclusive RF mdoe  */
487e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
488a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu    tNFA_NDEF_CHO_CBACK        *p_ndef_cho_cback;   /* NDEF callback for static connection handover */
489a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chu
490e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE                 poll_disc_handle;   /* discovery handle for polling         */
491e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
492e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                      *p_activate_ntf;     /* temp holding activation notfication  */
493d23e0531b6835ab75b543dd51cfe5edec8edefe4Evan Chu    tHAL_API_GET_MAX_NFCEE     *get_max_ee;
494e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
4957c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    tNFC_RF_TECH_N_MODE         activated_tech_mode;/* previous activated technology and mode */
4967c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    UINT8                       activated_nfcid[NFC_KOVIO_MAX_LEN]; /* NFCID 0/1/2 or UID of ISO15694/Kovio  */
4977c69b2723b60a59df4aaa58b13985b3483b291bfEvan Chu    UINT8                       activated_nfcid_len;/* length of NFCID or UID               */
498e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
499e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* NFC link discovery management */
500e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_DISC_CB             disc_cb;
501e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
502e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* NDEF Type handler */
503e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_API_REG_NDEF_HDLR   *p_ndef_handler[NFA_NDEF_MAX_HANDLERS];    /* ndef handler table */
504e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
505e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* stored parameters */
506e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_DM_PARAMS              params;
507e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
508e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* SetConfig management */
509e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32                      setcfg_pending_mask;    /* Mask of to indicate whether pending SET_CONFIGs require NFA_DM_SET_CONFIG_EVT. LSB=oldest pending */
510e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                       setcfg_pending_num;     /* Number of setconfigs pending */
511e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
512e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    /* NFCC power mode */
513e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8                       nfcc_pwr_mode;          /* NFA_DM_PWR_MODE_FULL or NFA_DM_PWR_MODE_OFF_SLEEP */
514e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_DM_CB;
515e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
516e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Internal function prototypes */
517a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chuvoid nfa_dm_ndef_register_cho (tNFA_NDEF_CHO_CBACK *p_cback);
518a24be4f06674b2707b57904deaa0dff5a95823bdEvan Chuvoid nfa_dm_ndef_deregister_cho (void);
519e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_ndef_handle_message (tNFA_STATUS status, UINT8 *p_msg_buf, UINT32 len);
520e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_ndef_dereg_all (void);
521e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_act_conn_cback_notify (UINT8 event, tNFA_CONN_EVT_DATA *p_data);
522e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_notify_activation_status (tNFA_STATUS status, tNFA_TAG_PARAMS *p_params);
523e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_disable_complete (void);
524e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
525e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Internal functions from nfa_rw */
526e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_rw_init (void);
527e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_rw_proc_disc_evt (tNFA_DM_RF_DISC_EVT event, tNFC_DISCOVER *p_data, BOOLEAN excl_rf_not_active);
528e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjecttNFA_STATUS nfa_rw_send_raw_frame (BT_HDR *p_data);
529e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
530e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Internal functions from nfa_ce */
531e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_ce_init (void);
532e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
533e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Pointer to compile-time configuration structure */
53491ada91fa991b4df5372a19a2cf81f074b298712Evan Chuextern tNFA_DM_DISC_FREQ_CFG *p_nfa_dm_rf_disc_freq_cfg;
5355c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenenextern tNFA_HCI_CFG *p_nfa_hci_cfg;
536e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern tNFA_DM_CFG *p_nfa_dm_cfg;
537e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern UINT8 *p_nfa_dm_ce_cfg;
538e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern UINT8 *p_nfa_dm_gen_cfg;
539e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern UINT8 nfa_ee_max_ee_cfg;
540e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern tNCI_DISCOVER_MAPS *p_nfa_dm_interface_mapping;
541e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern UINT8 nfa_dm_num_dm_interface_mapping;
542e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
543e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* NFA device manager control block */
544e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#if NFA_DYNAMIC_MEMORY == FALSE
545e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern tNFA_DM_CB nfa_dm_cb;
546e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#else
547e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern tNFA_DM_CB *nfa_dm_cb_ptr;
548e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define nfa_dm_cb (*nfa_dm_cb_ptr)
549e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
550e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
551e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_init (void);
552e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_p2p_init (void);
5535c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#if (defined (NFA_CHO_INCLUDED) && (NFA_CHO_INCLUDED==TRUE))
554e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_cho_init (void);
5555c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#else
5565c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#define nfa_cho_init()
5575c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#endif /* (defined (NFA_CHO_INCLUDED) && (NFA_CHO_INCLUDED==TRUE)) */
5585c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#if (defined (NFA_SNEP_INCLUDED) && (NFA_SNEP_INCLUDED==TRUE))
559e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_snep_init (BOOLEAN is_dta_mode);
5605c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#else
5615c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#define nfa_snep_init(is_dta_mode)
5625c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen#endif
5635c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen
564e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dta_init (void);
565e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#if (NFC_NFCEE_INCLUDED == TRUE)
566e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_ee_init (void);
567e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_hci_init (void);
568e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#else
569e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define nfa_ee_init()
570e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define nfa_hci_init()
571e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
572e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
573e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Action function prototypes */
574e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_enable (tNFA_DM_MSG *p_data);
575e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_disable (tNFA_DM_MSG *p_data);
576e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_set_config (tNFA_DM_MSG *p_data);
577e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_get_config (tNFA_DM_MSG *p_data);
578e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_request_excl_rf_ctrl (tNFA_DM_MSG *p_data);
579e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_release_excl_rf_ctrl (tNFA_DM_MSG *p_data);
580e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_enable_polling (tNFA_DM_MSG *p_data);
581e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_disable_polling (tNFA_DM_MSG *p_data);
58267aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan ChuBOOLEAN nfa_dm_act_enable_listening (tNFA_DM_MSG *p_data);
58367aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan ChuBOOLEAN nfa_dm_act_disable_listening (tNFA_DM_MSG *p_data);
58467aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan ChuBOOLEAN nfa_dm_act_pause_p2p (tNFA_DM_MSG *p_data);
58567aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan ChuBOOLEAN nfa_dm_act_resume_p2p (tNFA_DM_MSG *p_data);
586e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_send_raw_frame (tNFA_DM_MSG *p_data);
587e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_set_p2p_listen_tech (tNFA_DM_MSG *p_data);
588e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_start_rf_discovery (tNFA_DM_MSG *p_data);
589e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_stop_rf_discovery (tNFA_DM_MSG *p_data);
590e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_set_rf_disc_duration (tNFA_DM_MSG *p_data);
591e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_select (tNFA_DM_MSG *p_data);
592e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_update_rf_params (tNFA_DM_MSG *p_data);
593e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_deactivate (tNFA_DM_MSG *p_data);
594e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_power_off_sleep (tNFA_DM_MSG *p_data);
595e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_ndef_reg_hdlr (tNFA_DM_MSG *p_data);
596e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_ndef_dereg_hdlr (tNFA_DM_MSG *p_data);
597e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_tout (tNFA_DM_MSG *p_data);
598e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_reg_vsc (tNFA_DM_MSG *p_data);
599e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_send_vsc (tNFA_DM_MSG *p_data);
600e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_disable_timeout (tNFA_DM_MSG *p_data);
601e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_act_nfc_cback_data (tNFA_DM_MSG *p_data);
602e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
603e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_proc_nfcc_power_mode (UINT8 nfcc_power_mode);
604e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
605e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Main function prototypes */
606e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_evt_hdlr (BT_HDR *p_msg);
607e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_sys_enable (void);
608e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_sys_disable (void);
609e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjecttNFA_STATUS nfa_dm_check_set_config (UINT8 tlv_list_len, UINT8 *p_tlv_list, BOOLEAN app_init);
610e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
611e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_conn_cback_event_notify (UINT8 event, tNFA_CONN_EVT_DATA *p_data);
612e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
613e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Discovery function prototypes */
614e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_disc_sm_execute (tNFA_DM_RF_DISC_SM_EVENT event, tNFA_DM_RF_DISC_DATA *p_data);
615e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjecttNFA_HANDLE nfa_dm_add_rf_discover (tNFA_DM_DISC_TECH_PROTO_MASK disc_mask, tNFA_DM_DISC_HOST_ID host_id, tNFA_DISCOVER_CBACK *p_disc_cback);
616e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_delete_rf_discover (tNFA_HANDLE handle);
617e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_start_excl_discovery (tNFA_TECHNOLOGY_MASK poll_tech_mask,
618e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                  tNFA_LISTEN_CFG *p_listen_cfg,
619e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                  tNFA_DISCOVER_CBACK  *p_disc_cback);
620e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_rel_excl_rf_control_and_notify (void);
621e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_stop_excl_discovery (void);
622e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_disc_new_state (tNFA_DM_RF_DISC_STATE new_state);
623e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
624e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_start_rf_discover (void);
625e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectvoid nfa_dm_rf_discover_select (UINT8 rf_disc_id, tNFA_NFC_PROTOCOL protocol, tNFA_INTF_TYPE rf_interface);
626e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjecttNFA_STATUS nfa_dm_rf_deactivate (tNFA_DEACTIVATE_TYPE deactivate_type);
627e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_is_protocol_supported (tNFA_NFC_PROTOCOL protocol, UINT8 sel_res);
628e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectBOOLEAN nfa_dm_is_active (void);
629c95c79ccb65d82a65b960919077d5c359cf28cedEvan ChutNFC_STATUS nfa_dm_disc_sleep_wakeup (void);
6307c69b2723b60a59df4aaa58b13985b3483b291bfEvan ChutNFC_STATUS nfa_dm_disc_start_kovio_presence_check (void);
631a24be4f06674b2707b57904deaa0dff5a95823bdEvan ChuBOOLEAN nfa_dm_is_raw_frame_session (void);
63267aef6c6c6f6bc7b8364b97949e874b9dc7175bcEvan ChuBOOLEAN nfa_dm_is_p2p_paused (void);
633e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
634e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
635e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#if (NFC_NFCEE_INCLUDED == FALSE)
636e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define nfa_ee_get_tech_route(ps, ha) memset(ha, NFC_DH_ID, NFA_DM_MAX_TECH_ROUTE);
637e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
638e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
639e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#if (BT_TRACE_VERBOSE == TRUE)
640e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectchar *nfa_dm_nfc_revt_2_str (tNFC_RESPONSE_EVT event);
641e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
642e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
643e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
644e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif /* NFA_DM_INT_H */
645e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
646