aboutsummaryrefslogtreecommitdiff
path: root/pn54x/log
diff options
context:
space:
mode:
authorArian <arian.kulmer@web.de>2019-09-30 11:10:42 +0200
committerArian <arian.kulmer@web.de>2019-10-25 22:17:12 +0200
commit9224c881cf3f8575194823a6c779c0d65c42258a (patch)
treeac8a018ff4fdea5a589ca7ee3d88cd88d0d460ba /pn54x/log
parentfbdbc276d9f25e67e49a7ca03002b838cc9c8548 (diff)
shinano-common: pn54x: Import from lineage-15.1
* https://github.com/LineageOS/android_system_nfc/tree/lineage-15.1/halimpl/pn54x/common * support for pn54x has been dropped in lineage-16.0 and above Change-Id: I19f2c3a6e3066bf9aaaaf4ddcd7d7ad867de0ed8
Diffstat (limited to 'pn54x/log')
-rw-r--r--pn54x/log/phNxpLog.c257
-rw-r--r--pn54x/log/phNxpLog.h352
2 files changed, 609 insertions, 0 deletions
diff --git a/pn54x/log/phNxpLog.c b/pn54x/log/phNxpLog.c
new file mode 100644
index 0000000..49d6911
--- /dev/null
+++ b/pn54x/log/phNxpLog.c
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2010-2014 NXP Semiconductors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#if !defined(NXPLOG__H_INCLUDED)
+#include "phNxpConfig.h"
+#include "phNxpLog.h"
+#endif
+#include <cutils/properties.h>
+
+const char* NXPLOG_ITEM_EXTNS = "NxpExtns";
+const char* NXPLOG_ITEM_NCIHAL = "NxpHal";
+const char* NXPLOG_ITEM_NCIX = "NxpNciX";
+const char* NXPLOG_ITEM_NCIR = "NxpNciR";
+const char* NXPLOG_ITEM_FWDNLD = "NxpFwDnld";
+const char* NXPLOG_ITEM_TML = "NxpTml";
+
+#ifdef NXP_HCI_REQ
+const char* NXPLOG_ITEM_HCPX = "NxpHcpX";
+const char* NXPLOG_ITEM_HCPR = "NxpHcpR";
+#endif /*NXP_HCI_REQ*/
+
+/* global log level structure */
+nci_log_level_t gLog_level;
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetGlobalLogLevel
+ *
+ * Description Sets the global log level for all modules.
+ * This value is set by Android property
+ *nfc.nxp_log_level_global.
+ * If value can be overridden by module log level.
+ *
+ * Returns The value of global log level
+ *
+ ******************************************************************************/
+static uint8_t phNxpLog_SetGlobalLogLevel(void) {
+ uint8_t level = NXPLOG_DEFAULT_LOGLEVEL;
+ unsigned long num = 0;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+
+ int len = property_get(PROP_NAME_NXPLOG_GLOBAL_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ level = (unsigned char)num;
+ }
+ memset(&gLog_level, level, sizeof(nci_log_level_t));
+ return level;
+}
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetHALLogLevel
+ *
+ * Description Sets the HAL layer log level.
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+static void phNxpLog_SetHALLogLevel(uint8_t level) {
+ unsigned long num = 0;
+ int len;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+
+ if (GetNxpNumValue(NAME_NXPLOG_HAL_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.hal_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ ;
+ }
+
+ len = property_get(PROP_NAME_NXPLOG_HAL_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ gLog_level.hal_log_level = (unsigned char)num;
+ }
+}
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetExtnsLogLevel
+ *
+ * Description Sets the Extensions layer log level.
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+static void phNxpLog_SetExtnsLogLevel(uint8_t level) {
+ unsigned long num = 0;
+ int len;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+ if (GetNxpNumValue(NAME_NXPLOG_EXTNS_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.extns_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ ;
+ }
+
+ len = property_get(PROP_NAME_NXPLOG_EXTNS_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ gLog_level.extns_log_level = (unsigned char)num;
+ }
+}
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetTmlLogLevel
+ *
+ * Description Sets the Tml layer log level.
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+static void phNxpLog_SetTmlLogLevel(uint8_t level) {
+ unsigned long num = 0;
+ int len;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+ if (GetNxpNumValue(NAME_NXPLOG_TML_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.tml_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ ;
+ }
+
+ len = property_get(PROP_NAME_NXPLOG_TML_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ gLog_level.tml_log_level = (unsigned char)num;
+ }
+}
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetDnldLogLevel
+ *
+ * Description Sets the FW download layer log level.
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+static void phNxpLog_SetDnldLogLevel(uint8_t level) {
+ unsigned long num = 0;
+ int len;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+ if (GetNxpNumValue(NAME_NXPLOG_FWDNLD_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.dnld_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ ;
+ }
+
+ len = property_get(PROP_NAME_NXPLOG_FWDNLD_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ gLog_level.dnld_log_level = (unsigned char)num;
+ }
+}
+
+/*******************************************************************************
+ *
+ * Function phNxpLog_SetNciTxLogLevel
+ *
+ * Description Sets the NCI transaction layer log level.
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+static void phNxpLog_SetNciTxLogLevel(uint8_t level) {
+ unsigned long num = 0;
+ int len;
+ char valueStr[PROPERTY_VALUE_MAX] = {0};
+ if (GetNxpNumValue(NAME_NXPLOG_NCIX_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.ncix_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ }
+ if (GetNxpNumValue(NAME_NXPLOG_NCIR_LOGLEVEL, &num, sizeof(num))) {
+ gLog_level.ncir_log_level =
+ (level > (unsigned char)num) ? level : (unsigned char)num;
+ ;
+ }
+
+ len = property_get(PROP_NAME_NXPLOG_NCI_LOGLEVEL, valueStr, "");
+ if (len > 0) {
+ /* let Android property override .conf variable */
+ sscanf(valueStr, "%lu", &num);
+ gLog_level.ncix_log_level = (unsigned char)num;
+ gLog_level.ncir_log_level = (unsigned char)num;
+ }
+}
+
+/******************************************************************************
+ * Function phNxpLog_InitializeLogLevel
+ *
+ * Description Initialize and get log level of module from libnfc-nxp.conf
+ *or
+ * Android runtime properties.
+ * The Android property nfc.nxp_global_log_level is to
+ * define log level for all modules. Modules log level will
+ *overwide global level.
+ * The Android property will overwide the level
+ * in libnfc-nxp.conf
+ *
+ * Android property names:
+ * nfc.nxp_log_level_global * defines log level for all
+ *modules
+ * nfc.nxp_log_level_extns * extensions module log
+ * nfc.nxp_log_level_hal * Hal module log
+ * nfc.nxp_log_level_dnld * firmware download module
+ *log
+ * nfc.nxp_log_level_tml * TML module log
+ * nfc.nxp_log_level_nci * NCI transaction log
+ *
+ * Log Level values:
+ * NXPLOG_LOG_SILENT_LOGLEVEL 0 * No trace to show
+ * NXPLOG_LOG_ERROR_LOGLEVEL 1 * Show Error trace
+ *only
+ * NXPLOG_LOG_WARN_LOGLEVEL 2 * Show Warning
+ *trace and Error trace
+ * NXPLOG_LOG_DEBUG_LOGLEVEL 3 * Show all traces
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+void phNxpLog_InitializeLogLevel(void) {
+ uint8_t level = phNxpLog_SetGlobalLogLevel();
+ phNxpLog_SetHALLogLevel(level);
+ phNxpLog_SetExtnsLogLevel(level);
+ phNxpLog_SetTmlLogLevel(level);
+ phNxpLog_SetDnldLogLevel(level);
+ phNxpLog_SetNciTxLogLevel(level);
+
+ ALOGD(
+ "%s: global =%u, Fwdnld =%u, extns =%u, \
+ hal =%u, tml =%u, ncir =%u, \
+ ncix =%u",
+ __func__, gLog_level.global_log_level, gLog_level.dnld_log_level,
+ gLog_level.extns_log_level, gLog_level.hal_log_level,
+ gLog_level.tml_log_level, gLog_level.ncir_log_level,
+ gLog_level.ncix_log_level);
+}
diff --git a/pn54x/log/phNxpLog.h b/pn54x/log/phNxpLog.h
new file mode 100644
index 0000000..5037a4c
--- /dev/null
+++ b/pn54x/log/phNxpLog.h
@@ -0,0 +1,352 @@
+/*
+ * Copyright (C) 2010-2014 NXP Semiconductors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(NXPLOG__H_INCLUDED)
+#define NXPLOG__H_INCLUDED
+
+#include <log/log.h>
+
+typedef struct nci_log_level {
+ uint8_t global_log_level;
+ uint8_t extns_log_level;
+ uint8_t hal_log_level;
+ uint8_t dnld_log_level;
+ uint8_t tml_log_level;
+ uint8_t ncix_log_level;
+ uint8_t ncir_log_level;
+} nci_log_level_t;
+
+/* global log level Ref */
+extern nci_log_level_t gLog_level;
+
+/* define log module included when compile */
+#define ENABLE_EXTNS_TRACES TRUE
+#define ENABLE_HAL_TRACES TRUE
+#define ENABLE_TML_TRACES TRUE
+#define ENABLE_FWDNLD_TRACES TRUE
+#define ENABLE_NCIX_TRACES TRUE
+#define ENABLE_NCIR_TRACES TRUE
+
+#define ENABLE_HCPX_TRACES FALSE
+#define ENABLE_HCPR_TRACES FALSE
+
+/* ####################### Set the log module name in .conf file
+ * ########################## */
+#define NAME_NXPLOG_EXTNS_LOGLEVEL "NXPLOG_EXTNS_LOGLEVEL"
+#define NAME_NXPLOG_HAL_LOGLEVEL "NXPLOG_NCIHAL_LOGLEVEL"
+#define NAME_NXPLOG_NCIX_LOGLEVEL "NXPLOG_NCIX_LOGLEVEL"
+#define NAME_NXPLOG_NCIR_LOGLEVEL "NXPLOG_NCIR_LOGLEVEL"
+#define NAME_NXPLOG_FWDNLD_LOGLEVEL "NXPLOG_FWDNLD_LOGLEVEL"
+#define NAME_NXPLOG_TML_LOGLEVEL "NXPLOG_TML_LOGLEVEL"
+
+/* ####################### Set the log module name by Android property
+ * ########################## */
+#define PROP_NAME_NXPLOG_GLOBAL_LOGLEVEL "nfc.nxp_log_level_global"
+#define PROP_NAME_NXPLOG_EXTNS_LOGLEVEL "nfc.nxp_log_level_extns"
+#define PROP_NAME_NXPLOG_HAL_LOGLEVEL "nfc.nxp_log_level_hal"
+#define PROP_NAME_NXPLOG_NCI_LOGLEVEL "nfc.nxp_log_level_nci"
+#define PROP_NAME_NXPLOG_FWDNLD_LOGLEVEL "nfc.nxp_log_level_dnld"
+#define PROP_NAME_NXPLOG_TML_LOGLEVEL "nfc.nxp_log_level_tml"
+
+/* ####################### Set the logging level for EVERY COMPONENT here
+ * ######################## :START: */
+#define NXPLOG_LOG_SILENT_LOGLEVEL 0x00
+#define NXPLOG_LOG_ERROR_LOGLEVEL 0x01
+#define NXPLOG_LOG_WARN_LOGLEVEL 0x02
+#define NXPLOG_LOG_DEBUG_LOGLEVEL 0x03
+/* ####################### Set the default logging level for EVERY COMPONENT
+ * here ########################## :END: */
+
+/* The Default log level for all the modules. */
+#define NXPLOG_DEFAULT_LOGLEVEL NXPLOG_LOG_ERROR_LOGLEVEL
+
+/* ################################################################################################################
+ */
+/* ############################################### Component Names
+ * ################################################ */
+/* ################################################################################################################
+ */
+
+extern const char* NXPLOG_ITEM_EXTNS; /* Android logging tag for NxpExtns */
+extern const char* NXPLOG_ITEM_NCIHAL; /* Android logging tag for NxpNciHal */
+extern const char* NXPLOG_ITEM_NCIX; /* Android logging tag for NxpNciX */
+extern const char* NXPLOG_ITEM_NCIR; /* Android logging tag for NxpNciR */
+extern const char* NXPLOG_ITEM_FWDNLD; /* Android logging tag for NxpFwDnld */
+extern const char* NXPLOG_ITEM_TML; /* Android logging tag for NxpTml */
+
+#ifdef NXP_HCI_REQ
+extern const char* NXPLOG_ITEM_HCPX; /* Android logging tag for NxpHcpX */
+extern const char* NXPLOG_ITEM_HCPR; /* Android logging tag for NxpHcpR */
+#endif /*NXP_HCI_REQ*/
+
+/* ######################################## Defines used for Logging data
+ * ######################################### */
+#ifdef NXP_VRBS_REQ
+#define NXPLOG_FUNC_ENTRY(COMP) \
+ LOG_PRI(ANDROID_LOG_VERBOSE, (COMP), "+:%s", (__func__))
+#define NXPLOG_FUNC_EXIT(COMP) \
+ LOG_PRI(ANDROID_LOG_VERBOSE, (COMP), "-:%s", (__func__))
+#endif /*NXP_VRBS_REQ*/
+
+/* ################################################################################################################
+ */
+/* ######################################## Logging APIs of actual modules
+ * ######################################## */
+/* ################################################################################################################
+ */
+/* Logging APIs used by NxpExtns module */
+#if (ENABLE_EXTNS_TRACES == TRUE)
+#define NXPLOG_EXTNS_D(...) \
+ { \
+ if (gLog_level.extns_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_EXTNS, __VA_ARGS__); \
+ }
+#define NXPLOG_EXTNS_W(...) \
+ { \
+ if (gLog_level.extns_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_EXTNS, __VA_ARGS__); \
+ }
+#define NXPLOG_EXTNS_E(...) \
+ { \
+ if (gLog_level.extns_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_EXTNS, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_EXTNS_D(...)
+#define NXPLOG_EXTNS_W(...)
+#define NXPLOG_EXTNS_E(...)
+#endif /* Logging APIs used by NxpExtns module */
+
+/* Logging APIs used by NxpNciHal module */
+#if (ENABLE_HAL_TRACES == TRUE)
+#define NXPLOG_NCIHAL_D(...) \
+ { \
+ if (gLog_level.hal_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_NCIHAL, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIHAL_W(...) \
+ { \
+ if (gLog_level.hal_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_NCIHAL, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIHAL_E(...) \
+ { \
+ if (gLog_level.hal_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_NCIHAL, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_NCIHAL_D(...)
+#define NXPLOG_NCIHAL_W(...)
+#define NXPLOG_NCIHAL_E(...)
+#endif /* Logging APIs used by HAL module */
+
+/* Logging APIs used by NxpNciX module */
+#if (ENABLE_NCIX_TRACES == TRUE)
+#define NXPLOG_NCIX_D(...) \
+ { \
+ if (gLog_level.ncix_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_NCIX, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIX_W(...) \
+ { \
+ if (gLog_level.ncix_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_NCIX, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIX_E(...) \
+ { \
+ if (gLog_level.ncix_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_NCIX, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_NCIX_D(...)
+#define NXPLOG_NCIX_W(...)
+#define NXPLOG_NCIX_E(...)
+#endif /* Logging APIs used by NCIx module */
+
+/* Logging APIs used by NxpNciR module */
+#if (ENABLE_NCIR_TRACES == TRUE)
+#define NXPLOG_NCIR_D(...) \
+ { \
+ if (gLog_level.ncir_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_NCIR, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIR_W(...) \
+ { \
+ if (gLog_level.ncir_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_NCIR, __VA_ARGS__); \
+ }
+#define NXPLOG_NCIR_E(...) \
+ { \
+ if (gLog_level.ncir_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_NCIR, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_NCIR_D(...)
+#define NXPLOG_NCIR_W(...)
+#define NXPLOG_NCIR_E(...)
+#endif /* Logging APIs used by NCIR module */
+
+/* Logging APIs used by NxpFwDnld module */
+#if (ENABLE_FWDNLD_TRACES == TRUE)
+#define NXPLOG_FWDNLD_D(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_FWDNLD_W(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_FWDNLD_E(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_FWDNLD_D(...)
+#define NXPLOG_FWDNLD_W(...)
+#define NXPLOG_FWDNLD_E(...)
+#endif /* Logging APIs used by NxpFwDnld module */
+
+/* Logging APIs used by NxpTml module */
+#if (ENABLE_TML_TRACES == TRUE)
+#define NXPLOG_TML_D(...) \
+ { \
+ if (gLog_level.tml_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_TML, __VA_ARGS__); \
+ }
+#define NXPLOG_TML_W(...) \
+ { \
+ if (gLog_level.tml_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_TML, __VA_ARGS__); \
+ }
+#define NXPLOG_TML_E(...) \
+ { \
+ if (gLog_level.tml_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_TML, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_TML_D(...)
+#define NXPLOG_TML_W(...)
+#define NXPLOG_TML_E(...)
+#endif /* Logging APIs used by NxpTml module */
+
+#ifdef NXP_HCI_REQ
+/* Logging APIs used by NxpHcpX module */
+#if (ENABLE_HCPX_TRACES == TRUE)
+#define NXPLOG_HCPX_D(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_HCPX_W(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_HCPX_E(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_HCPX_D(...)
+#define NXPLOG_HCPX_W(...)
+#define NXPLOG_HCPX_E(...)
+#endif /* Logging APIs used by NxpHcpX module */
+
+/* Logging APIs used by NxpHcpR module */
+#if (ENABLE_HCPR_TRACES == TRUE)
+#define NXPLOG_HCPR_D(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_DEBUG_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_DEBUG, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_HCPR_W(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_WARN_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_WARN, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#define NXPLOG_HCPR_E(...) \
+ { \
+ if (gLog_level.dnld_log_level >= NXPLOG_LOG_ERROR_LOGLEVEL) \
+ LOG_PRI(ANDROID_LOG_ERROR, NXPLOG_ITEM_FWDNLD, __VA_ARGS__); \
+ }
+#else
+#define NXPLOG_HCPR_D(...)
+#define NXPLOG_HCPR_W(...)
+#define NXPLOG_HCPR_E(...)
+#endif /* Logging APIs used by NxpHcpR module */
+#endif /* NXP_HCI_REQ */
+
+#ifdef NXP_VRBS_REQ
+#if (ENABLE_EXTNS_TRACES == TRUE)
+#define NXPLOG_EXTNS_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_EXTNS)
+#define NXPLOG_EXTNS_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_EXTNS)
+#else
+#define NXPLOG_EXTNS_ENTRY()
+#define NXPLOG_EXTNS_EXIT()
+#endif
+
+#if (ENABLE_HAL_TRACES == TRUE)
+#define NXPLOG_NCIHAL_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_NCIHAL)
+#define NXPLOG_NCIHAL_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_NCIHAL)
+#else
+#define NXPLOG_NCIHAL_ENTRY()
+#define NXPLOG_NCIHAL_EXIT()
+#endif
+
+#if (ENABLE_NCIX_TRACES == TRUE)
+#define NXPLOG_NCIX_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_NCIX)
+#define NXPLOG_NCIX_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_NCIX)
+#else
+#define NXPLOG_NCIX_ENTRY()
+#define NXPLOG_NCIX_EXIT()
+#endif
+
+#if (ENABLE_NCIR_TRACES == TRUE)
+#define NXPLOG_NCIR_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_NCIR)
+#define NXPLOG_NCIR_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_NCIR)
+#else
+#define NXPLOG_NCIR_ENTRY()
+#define NXPLOG_NCIR_EXIT()
+#endif
+
+#ifdef NXP_HCI_REQ
+
+#if (ENABLE_HCPX_TRACES == TRUE)
+#define NXPLOG_HCPX_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_HCPX)
+#define NXPLOG_HCPX_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_HCPX)
+#else
+#define NXPLOG_HCPX_ENTRY()
+#define NXPLOG_HCPX_EXIT()
+#endif
+
+#if (ENABLE_HCPR_TRACES == TRUE)
+#define NXPLOG_HCPR_ENTRY() NXPLOG_FUNC_ENTRY(NXPLOG_ITEM_HCPR)
+#define NXPLOG_HCPR_EXIT() NXPLOG_FUNC_EXIT(NXPLOG_ITEM_HCPR)
+#else
+#define NXPLOG_HCPR_ENTRY()
+#define NXPLOG_HCPR_EXIT()
+#endif
+#endif /* NXP_HCI_REQ */
+
+#endif /* NXP_VRBS_REQ */
+
+void phNxpLog_InitializeLogLevel(void);
+
+#endif /* NXPLOG__H_INCLUDED */