2 ****************************************************************************************
6 * @brief ecrnx driver debug structure declarations
8 * Copyright (C) ESWIN 2015-2020
10 ****************************************************************************************
13 #ifndef ECRNX_DEBUG_H_
14 #define ECRNX_DEBUG_H_
16 #ifdef CONFIG_ECRNX_SOFTMAC
18 #elif defined CONFIG_ECRNX_FULLMAC
22 #ifdef CONFIG_ECRNX_DBG
23 /* #define ECRNX_DBG(format, arg...) pr_warn(format, ## arg) */
24 #define ECRNX_DBG printk
26 #define ECRNX_DBG(a...) do {} while (0)
30 #ifdef CONFIG_ECRNX_DBG
32 #define ECRNX_FN_ENTRY_STR "%s() enter, line:%d\n", __func__, __LINE__
33 #define DBG_PREFIX "[ecrnx] "
34 #define DBG_PREFIX_IW_CFM "[ecrnx] iwpriv cfm:"
35 #define DBG_PREFIX_PAT "[ecrnx] pattern error:"
36 #define DBG_PREFIX_CRC_CHECK "[ecrnx] crc check:"
37 #define DBG_PREFIX_SDIO_RX "[ecrnx] sdio rx:"
38 #define DBG_PREFIX_SDIO_TX "[ecrnx] sdio tx:"
41 enum ECRNX_DRV_DBG_TYEP{
51 #define ECRNX_PRINT(fmt, arg...) \
53 if (DRV_DBG_TYPE_ALWAYS <= ecrnx_dbg_level) {\
54 printk(DBG_PREFIX fmt, ##arg);\
58 #define ECRNX_ERR(fmt, arg...) \
60 if (DRV_DBG_TYPE_ERR <= ecrnx_dbg_level) {\
61 printk(DBG_PREFIX " ERROR " fmt, ##arg);\
65 #define ECRNX_WARN(fmt, arg...) \
67 if (DRV_DBG_TYPE_WARNING <= ecrnx_dbg_level) {\
68 printk(DBG_PREFIX " WARN " fmt, ##arg);\
72 #define ECRNX_INFO(fmt, arg...) \
74 if (DRV_DBG_TYPE_INFO <= ecrnx_dbg_level) {\
75 printk(DBG_PREFIX fmt, ##arg);\
79 #define ECRNX_DBG(fmt, arg...) \
81 if (DRV_DBG_TYPE_DEBUG <= ecrnx_dbg_level) {\
82 printk(DBG_PREFIX fmt, ##arg);\
87 #define ECRNX_PRINT(...)
88 #define ECRNX_ERR(...)
89 #define ECRNX_WARN(...)
90 #define ECRNX_INFO(...)
91 #define ECRNX_DBG(...)
99 extern int ecrnx_dbg_level;
100 extern LOG_CTL_ST log_ctl;
102 #ifndef CONFIG_ECRNX_DEBUGFS_CUSTOM
103 int ecrnx_fw_log_level_set(u32 level, u32 dir);
106 #endif /* ECRNX_DEBUG_H_ */