diff --git a/include/linux/mhi.h b/include/linux/mhi.h index dbcb34c91716..f6b8ffe30fc0 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -411,6 +411,7 @@ struct mhi_controller { bool initiate_mhi_reset; void *priv_data; void *log_buf; + void *cntrl_log_buf; struct dentry *dentry; struct dentry *parent; @@ -905,7 +906,7 @@ char *mhi_get_restart_reason(const char *name); #ifdef CONFIG_MHI_DEBUG #define MHI_VERB(fmt, ...) do { \ - if (mhi_cntrl->klog_lvl <= MHI_MSG_VERBOSE) \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_VERBOSE) \ pr_dbg("[D][%s] " fmt, __func__, ##__VA_ARGS__);\ } while (0) @@ -915,8 +916,20 @@ char *mhi_get_restart_reason(const char *name); #endif +#define MHI_CNTRL_LOG(fmt, ...) do { \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \ + printk("%s[I][%s] " fmt, KERN_INFO, __func__, \ + ##__VA_ARGS__); \ +} while (0) + +#define MHI_CNTRL_ERR(fmt, ...) do { \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_ERROR) \ + printk("%s[E][%s] " fmt, KERN_ERR, __func__, \ + ##__VA_ARGS__); \ +} while (0) + #define MHI_LOG(fmt, ...) do { \ - if (mhi_cntrl->klog_lvl <= MHI_MSG_INFO) \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \ printk("%s[I][%s] " fmt, KERN_INFO, __func__, \ ##__VA_ARGS__); \ } while (0) @@ -958,6 +971,22 @@ char *mhi_get_restart_reason(const char *name); #endif +#define MHI_CNTRL_LOG(fmt, ...) do { \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \ + printk("%s[I][%s] " fmt, KERN_ERR, __func__, \ + ##__VA_ARGS__); \ + ipc_log_string(mhi_cntrl->cntrl_log_buf, "[I][%s] " fmt, \ + __func__, ##__VA_ARGS__); \ +} while (0) + +#define MHI_CNTRL_ERR(fmt, ...) do { \ + if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_ERROR) \ + printk("%s[E][%s] " fmt, KERN_ERR, __func__, \ + ##__VA_ARGS__); \ + ipc_log_string(mhi_cntrl->cntrl_log_buf, "[E][%s] " fmt, \ + __func__, ##__VA_ARGS__); \ +} while (0) + #define MHI_LOG(fmt, ...) do { \ if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \ printk("%s[I][%s] " fmt, KERN_ERR, __func__, \