[qca-nss-drv] cleanup in NSS logging
Change-Id: I18ee67e5f0b1e5100107ea9f41a5a4a80a4de56d
Signed-off-by: Saurabh Misra <smisra@codeaurora.org>
diff --git a/nss_log.c b/nss_log.c
index b271763..1a2110e 100644
--- a/nss_log.c
+++ b/nss_log.c
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
@@ -178,6 +178,16 @@
}
/*
+ * nss_log_current_entry()
+ * Reads current entry index from NSS log descriptor.
+ */
+static uint32_t nss_log_current_entry(struct nss_log_descriptor *desc)
+{
+ rmb();
+ return desc->current_entry;
+}
+
+/*
* nss_log_read()
* Read operation lets command like cat and tail read our memory log buffer data.
*/
@@ -213,7 +223,7 @@
* Get the current index
*/
dma_sync_single_for_cpu(NULL, data->dma_addr, sizeof (struct nss_log_descriptor), DMA_FROM_DEVICE);
- entry = desc->current_entry;
+ entry = nss_log_current_entry(desc);
/*
* If the current and last sampled indexes are same then bail out.
@@ -520,7 +530,7 @@
dbg = &msg.msg.addr;
dbg->nentry = nentry;
dbg->version = NSS_DEBUG_LOG_VERSION;
- dbg->addr = dma_addr;
+ dbg->phy_addr = dma_addr;
msg_event = false;
status = nss_debug_interface_tx(nss_ctx, &msg);