summaryrefslogtreecommitdiff
path: root/core/mac/src
diff options
context:
space:
mode:
authorPadma, Santhosh Kumar <skpadma@codeaurora.org>2016-08-11 16:30:25 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-07 12:54:36 -0700
commit9aba02f52c9b4a0bac618e5b3974a8d19bd2d7ac (patch)
tree9501cd7bfad42ff6829073feb54aaa78be8479bb /core/mac/src
parentc846f3a36a4a0acb20551964b54826c7c460e863 (diff)
qcacld-3.0: Dump driver information
qcacld-2.0 to qcacld-3.0 propagation Dump state information of HDD, SME, PE and WMA layers into a buffer. Contents of this buffer will be copied into user space using proc entry /proc/debugdriver/ driverdump. Change-Id: Ifbb102e440d7df20defa1a397964cb9b55082bf9 CRs-Fixed: 955357
Diffstat (limited to 'core/mac/src')
-rw-r--r--core/mac/src/pe/lim/lim_api.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index a1e05650a5c5..2700e9ad55b7 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -681,6 +681,63 @@ void lim_cleanup(tpAniSirGlobal pMac)
} /*** end lim_cleanup() ***/
+/**
+ * lim_state_info_dump() - print state information of lim layer
+ * @buf: buffer pointer
+ * @size: size of buffer to be filled
+ *
+ * This function is used to print state information of lim layer
+ *
+ * Return: None
+ */
+static void lim_state_info_dump(char **buf_ptr, uint16_t *size)
+{
+ tHalHandle hal;
+ tpAniSirGlobal mac;
+ uint16_t len = 0;
+ char *buf = *buf_ptr;
+
+ hal = cds_get_context(QDF_MODULE_ID_PE);
+ if (hal == NULL) {
+ QDF_ASSERT(0);
+ return;
+ }
+
+ mac = PMAC_STRUCT(hal);
+
+ lim_log(mac, LOG1, FL("size of buffer: %d"), *size);
+
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n SmeState: %d", mac->lim.gLimSmeState);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n PrevSmeState: %d", mac->lim.gLimPrevSmeState);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n MlmState: %d", mac->lim.gLimMlmState);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n PrevMlmState: %d", mac->lim.gLimPrevMlmState);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n SystemInScanLearnMode: %d",
+ mac->lim.gLimSystemInScanLearnMode);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n ProcessDefdMsgs: %d", mac->lim.gLimProcessDefdMsgs);
+ len += qdf_scnprintf(buf + len, *size - len,
+ "\n gLimHalScanState: %d", mac->lim.gLimHalScanState);
+
+ *size -= len;
+ *buf_ptr += len;
+}
+
+/**
+ * lim_register_debug_callback() - registration function for lim layer
+ * to print lim state information
+ *
+ * Return: None
+ */
+static void lim_register_debug_callback(void)
+{
+ qdf_register_debug_callback(QDF_MODULE_ID_PE, &lim_state_info_dump);
+}
+
/** -------------------------------------------------------------
\fn pe_open
\brief will be called in Open sequence from mac_open
@@ -746,6 +803,8 @@ tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg)
#ifdef LIM_TRACE_RECORD
MTRACE(lim_trace_init(pMac));
#endif
+ lim_register_debug_callback();
+
return status; /* status here will be eSIR_SUCCESS */
pe_open_lock_fail: