config.h revision df5080d7feca9827fd0306471c54f52ecf185c22
1/******************************************************************************
2 *
3 *  Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18#ifndef __CONFIG_H
19#define __CONFIG_H
20
21#ifdef __cplusplus
22extern "C"
23{
24#endif
25
26int GetStrValue(const char* name, char* p_value, unsigned long len);
27int GetNumValue(const char* name, void* p_value, unsigned long len);
28
29#ifdef __cplusplus
30};
31#endif
32
33#define NAME_NFA_DM_ENABLE_SLEEP        "NFA_DM_ENABLE_SLEEP"
34#define NAME_ENABLE_BRCM_EXTRAS_API     "ENABLE_BRCM_EXTRAS_API"
35#define NAME_POLLING_TECH_MASK          "POLLING_TECH_MASK"
36#define NAME_REGISTER_VIRTUAL_SE        "REGISTER_VIRTUAL_SE"
37#define NAME_APPL_TRACE_LEVEL           "APPL_TRACE_LEVEL"
38#define NAME_USE_RAW_NCI_TRACE          "USE_RAW_NCI_TRACE"
39#define NAME_LOG_TO_FILE                "LOG_TO_FILE"
40#define NAME_LOGCAT_FILTER              "LOGCAT_FILTER"
41#define NAME_LPTD_CFG                   "LPTD_CFG"
42#define NAME_SCREEN_OFF_POWER_STATE     "SCREEN_OFF_POWER_STATE"
43#define NAME_PREINIT_DSP_CFG            "PREINIT_DSP_CFG"
44#define NAME_DTA_START_CFG              "DTA_START_CFG"
45#define NAME_TRANSPORT_DRIVER           "TRANSPORT_DRIVER"
46#define NAME_POWER_CONTROL_DRIVER       "POWER_CONTROL_DRIVER"
47#define NAME_PROTOCOL_TRACE_LEVEL       "PROTOCOL_TRACE_LEVEL"
48#define NAME_UART_PORT                  "UART_PORT"
49#define NAME_UART_BAUD                  "UART_BAUD"
50#define NAME_UART_PARITY                "UART_PARITY"
51#define NAME_UART_STOPBITS              "UART_STOPBITS"
52#define NAME_UART_DATABITS              "UART_DATABITS"
53#define NAME_CLIENT_ADDRESS             "BCMI2CNFC_ADDRESS"
54#define NAME_NFA_DM_START_UP_CFG        "NFA_DM_START_UP_CFG"
55#define NAME_NFA_DM_CFG                 "NFA_DM_CFG"
56#define NAME_NFA_DM_LP_CFG              "NFA_DM_LP_CFG"
57#define NAME_LOW_SPEED_TRANSPORT        "LOW_SPEED_TRANSPORT"
58#define NAME_NFC_WAKE_DELAY             "NFC_WAKE_DELAY"
59#define NAME_NFC_WRITE_DELAY            "NFC_WRITE_DELAY"
60#define NAME_PERF_MEASURE_FREQ          "REPORT_PERFORMANCE_MEASURE"
61#define NAME_READ_MULTI_PACKETS         "READ_MULTIPLE_PACKETS"
62#define NAME_POWER_ON_DELAY             "POWER_ON_DELAY"
63#define NAME_PRE_POWER_OFF_DELAY        "PRE_POWER_OFF_DELAY"
64#define NAME_POST_POWER_OFF_DELAY       "POST_POWER_OFF_DELAY"
65#define NAME_CE3_PRE_POWER_OFF_DELAY    "CE3_PRE_POWER_OFF_DELAY"
66#define NAME_NFA_STORAGE                "NFA_STORAGE"
67#define NAME_NFA_DM_START_UP_VSC_CFG    "NFA_DM_START_UP_VSC_CFG"
68#define NAME_NFA_DTA_START_UP_VSC_CFG   "NFA_DTA_START_UP_VSC_CFG"
69#define NAME_UICC_LISTEN_TECH_MASK      "UICC_LISTEN_TECH_MASK"
70#define NAME_SNOOZE_MODE_CFG            "SNOOZE_MODE_CFG"
71#define NAME_XTAL_FREQUENCY             "XTAL_FREQUENCY"
72#define NAME_NFA_DM_DISC_DURATION_POLL  "NFA_DM_DISC_DURATION_POLL"
73#define NAME_SPD_DEBUG                  "SPD_DEBUG"
74#define NAME_SPD_MAXRETRYCOUNT          "SPD_MAX_RETRY_COUNT"
75#define NAME_SPI_NEGOTIATION            "SPI_NEGOTIATION"
76#define NAME_AID_FOR_EMPTY_SELECT       "AID_FOR_EMPTY_SELECT"
77#define NAME_PRESERVE_STORAGE           "PRESERVE_STORAGE"
78#define NAME_NFA_MAX_EE_SUPPORTED       "NFA_MAX_EE_SUPPORTED"
79#define NAME_NFCC_ENABLE_TIMEOUT        "NFCC_ENABLE_TIMEOUT"
80#define NAME_NFA_DM_PRE_DISCOVERY_CFG   "NFA_DM_PRE_DISCOVERY_CFG"
81
82#define                     LPTD_PARAM_LEN (40)
83
84// default configuration
85#define default_transport       "/dev/bcm2079x"
86#define default_storage_location "/data/nfc"
87
88struct tUART_CONFIG {
89    int     m_iBaudrate;            // 115200
90    int     m_iDatabits;            // 8
91    int     m_iParity;              // 0 - none, 1 = odd, 2 = even
92    int     m_iStopbits;
93};
94
95extern struct tUART_CONFIG  uartConfig;
96#define MAX_CHIPID_LEN  (16)
97void    readOptionalConfig(const char* option);
98
99/* Snooze mode configuration structure */
100typedef struct
101{
102    unsigned char   snooze_mode;            /* Snooze Mode */
103    unsigned char   idle_threshold_dh;      /* Idle Threshold Host */
104    unsigned char   idle_threshold_nfcc;    /* Idle Threshold NFCC   */
105    unsigned char   nfc_wake_active_mode;   /* NFC_LP_ACTIVE_LOW or NFC_LP_ACTIVE_HIGH */
106    unsigned char   dh_wake_active_mode;    /* NFC_LP_ACTIVE_LOW or NFC_LP_ACTIVE_HIGH */
107} tSNOOZE_MODE_CONFIG;
108#endif
109