Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a04a3a2d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "data-kernel: EMAC:IPC logging support"

parents 289a45d0 7d67de2f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
#include "DWC_ETH_QOS_yheader.h"
#include "DWC_ETH_QOS_ipa.h"

void *ipc_emac_log_ctxt;

static UCHAR dev_addr[6] = {0, 0x55, 0x7b, 0xb5, 0x7d, 0xf7};
struct DWC_ETH_QOS_res_data dwc_eth_qos_res_data = {0, };
static struct msm_bus_scale_pdata *emac_bus_scale_vec = NULL;
@@ -2190,6 +2192,12 @@ static int DWC_ETH_QOS_init_module(void)
		return ret;
	}

	ipc_emac_log_ctxt = ipc_log_context_create(IPCLOG_STATE_PAGES,"emac", 0);
	if (!ipc_emac_log_ctxt)
		pr_err("Error creating logging context for emac\n");
	else
		pr_info("IPC logging has been enabled for emac\n");

#ifdef DWC_ETH_QOS_CONFIG_DEBUGFS
	create_debug_files();
#endif
@@ -2218,6 +2226,9 @@ static void __exit DWC_ETH_QOS_exit_module(void)

	platform_driver_unregister(&DWC_ETH_QOS_plat_drv);

	if (ipc_emac_log_ctxt != NULL)
		ipc_log_context_destroy(ipc_emac_log_ctxt);

	DBGPR("<--DWC_ETH_QOS_exit_module\n");
}

+16 −1
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@
#include <linux/mailbox_client.h>
#include <linux/mailbox/qmp.h>
#include <linux/mailbox_controller.h>
#include <linux/ipc_logging.h>

/* QOS Version Control Macros */
/* #define DWC_ETH_QOS_VER_4_0 */
@@ -133,6 +134,13 @@

#include <asm-generic/errno.h>

extern void *ipc_emac_log_ctxt;

#define IPCLOG_STATE_PAGES 50
#define __FILENAME__ (strrchr(__FILE__, '/') ? \
	strrchr(__FILE__, '/') + 1 : __FILE__)


#ifdef CONFIG_PGTEST_OBJ
#define DWC_ETH_QOS_CONFIG_PGTEST
#endif
@@ -2054,7 +2062,14 @@ do {\
#define EMACINFO(fmt, args...) \
	pr_info(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args)
#define EMACERR(fmt, args...) \
	pr_err(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args)
do {\
	pr_err(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args);\
	if (ipc_emac_log_ctxt) { \
		ipc_log_string(ipc_emac_log_ctxt, \
		"%s: %s[%u]:[emac] ERROR:" fmt, __FILENAME__ , \
		__func__, __LINE__, ## args); \
	} \
}while(0)

#ifdef YDEBUG
#define DBGPR(x...) printk(KERN_ALERT x)