mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
mhi: dev: netdev: inherit IPC log level from controller
Make network interface devices inherit log levels from the controller to allow level switches to reflect across MHI clients. Change-Id: I2412a738ba297031740d10570478c42f83b45c25 Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
parent
db949d93e3
commit
0ddedbe5f1
1 changed files with 19 additions and 21 deletions
|
|
@ -24,42 +24,33 @@
|
|||
|
||||
#ifdef CONFIG_MHI_DEBUG
|
||||
|
||||
#define IPC_LOG_LVL (MHI_MSG_LVL_VERBOSE)
|
||||
|
||||
#define MHI_ASSERT(cond, msg) do { \
|
||||
if (cond) \
|
||||
panic(msg); \
|
||||
} while (0)
|
||||
|
||||
#define MSG_VERB(fmt, ...) do { \
|
||||
if (mhi_netdev->msg_lvl <= MHI_MSG_LVL_VERBOSE) \
|
||||
printk("%s[D][%s] " fmt, KERN_ERR, __func__, \
|
||||
##__VA_ARGS__); \
|
||||
if (mhi_netdev->ipc_log_lvl <= MHI_MSG_LVL_VERBOSE) \
|
||||
if (mhi_netdev->ipc_log && (*mhi_netdev->ipc_log_lvl <= \
|
||||
MHI_MSG_LVL_VERBOSE)) \
|
||||
ipc_log_string(mhi_netdev->ipc_log, "%s[D][%s] " fmt, \
|
||||
"", __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define IPC_LOG_LVL (MHI_MSG_LVL_ERROR)
|
||||
|
||||
#define MHI_ASSERT(cond, msg) do { \
|
||||
if (cond) { \
|
||||
MSG_ERR(msg); \
|
||||
WARN_ON(cond); \
|
||||
} \
|
||||
#define MSG_VERB(fmt, ...) do { \
|
||||
if (mhi_netdev->ipc_log && (*mhi_netdev->ipc_log_lvl <= \
|
||||
MHI_MSG_LVL_VERBOSE)) \
|
||||
ipc_log_string(mhi_netdev->ipc_log, "%s[D][%s] " fmt, \
|
||||
"", __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define MSG_VERB(fmt, ...)
|
||||
|
||||
#endif
|
||||
|
||||
#define MSG_LOG(fmt, ...) do { \
|
||||
if (mhi_netdev->msg_lvl <= MHI_MSG_LVL_INFO) \
|
||||
printk("%s[I][%s] " fmt, KERN_ERR, __func__, \
|
||||
##__VA_ARGS__); \
|
||||
if (mhi_netdev->ipc_log_lvl <= MHI_MSG_LVL_INFO) \
|
||||
if (mhi_netdev->ipc_log && (*mhi_netdev->ipc_log_lvl <= \
|
||||
MHI_MSG_LVL_INFO)) \
|
||||
ipc_log_string(mhi_netdev->ipc_log, "%s[D][%s] " fmt, \
|
||||
"", __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
|
@ -68,11 +59,17 @@
|
|||
if (mhi_netdev->msg_lvl <= MHI_MSG_LVL_ERROR) \
|
||||
printk("%s[E][%s] " fmt, KERN_ERR, __func__, \
|
||||
##__VA_ARGS__); \
|
||||
if (mhi_netdev->ipc_log_lvl <= MHI_MSG_LVL_ERROR) \
|
||||
if (mhi_netdev->ipc_log && (*mhi_netdev->ipc_log_lvl <= \
|
||||
MHI_MSG_LVL_ERROR)) \
|
||||
ipc_log_string(mhi_netdev->ipc_log, "%s[E][%s] " fmt, \
|
||||
"", __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define MHI_ASSERT(cond, msg) do { \
|
||||
if (cond) \
|
||||
panic(msg); \
|
||||
} while (0)
|
||||
|
||||
struct mhi_net_chain {
|
||||
struct sk_buff *head, *tail; /* chained skb */
|
||||
};
|
||||
|
|
@ -106,7 +103,7 @@ struct mhi_netdev {
|
|||
|
||||
struct dentry *dentry;
|
||||
enum MHI_DEBUG_LEVEL msg_lvl;
|
||||
enum MHI_DEBUG_LEVEL ipc_log_lvl;
|
||||
enum MHI_DEBUG_LEVEL *ipc_log_lvl;
|
||||
void *ipc_log;
|
||||
|
||||
/* debug stats */
|
||||
|
|
@ -978,6 +975,7 @@ static int mhi_netdev_probe(struct mhi_device *mhi_dev,
|
|||
int ret;
|
||||
struct mhi_netdev *mhi_netdev, *p_netdev = NULL;
|
||||
struct device_node *of_node = mhi_dev->dev.of_node;
|
||||
struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
|
||||
int nr_tre;
|
||||
char node_name[32];
|
||||
struct device_node *phandle;
|
||||
|
|
@ -1088,7 +1086,7 @@ static int mhi_netdev_probe(struct mhi_device *mhi_dev,
|
|||
mhi_netdev->alias);
|
||||
mhi_netdev->ipc_log = ipc_log_context_create(IPC_LOG_PAGES,
|
||||
node_name, 0);
|
||||
mhi_netdev->ipc_log_lvl = IPC_LOG_LVL;
|
||||
mhi_netdev->ipc_log_lvl = &mhi_cntrl->log_lvl;
|
||||
|
||||
mhi_netdev_create_debugfs(mhi_netdev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue