qcacmn: Replace printk with qdf_nofl_info

Replace printk with qdf_nofl_info in qdf folder.
So if we wish to change from printing on console
to other location, based on a logging daemon, we
can do that by only changing at the implementation
of QDF print API's

Change-Id: I6db67cee416ebbe0f2c51b2d4dbf2b3a335e972a
CRs-Fixed: 2442689
这个提交包含在:
Vivek
2019-10-24 14:35:49 +05:30
提交者 nshrivas
父节点 cb37d704f8
当前提交 0c4e20ff82
修改 8 个文件,包含 41 行新增51 行删除

查看文件

@@ -60,6 +60,10 @@
#define EPPING_MAX_ADAPTERS 1
#define EPPING_LOG(level, args ...) QDF_TRACE(QDF_MODULE_ID_HDD, level, ## args)
#define EPPING_HEX_DUMP(level, data, len) qdf_trace_hex_dump( \
QDF_MODULE_ID_HDD, \
level, \
data, buf_len)
struct epping_cookie {
HTC_PACKET HtcPkt; /* HTC packet wrapper */

查看文件

@@ -127,24 +127,11 @@ void epping_get_dummy_mac_addr(tSirMacAddr macAddr)
void epping_hex_dump(void *data, int buf_len, const char *str)
{
char *buf = (char *)data;
int i;
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, "%s: E, %s", __func__, str);
printk("%s: E, %s\n", __func__, str);
for (i = 0; (i + 7) < buf_len; i += 8) {
printk("%02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[i],
buf[i + 1],
buf[i + 2],
buf[i + 3],
buf[i + 4], buf[i + 5], buf[i + 6], buf[i + 7]);
}
EPPING_HEX_DUMP(QDF_TRACE_LEVEL_INFO, data, buf_len);
/* Dump the bytes in the last line */
for (; i < buf_len; i++) {
printk("%02x ", buf[i]);
}
printk("\n%s: X %s\n", __func__, str);
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, "%s: X %s", __func__, str);
}
void *epping_get_qdf_ctx(void)

查看文件

@@ -114,7 +114,8 @@ void epping_rx(void *ctx, HTC_PACKET *pPacket)
if (status != QDF_STATUS_SUCCESS) {
if (status != QDF_STATUS_E_CANCELED) {
printk("%s: RX ERR (%d)\n", __func__, status);
EPPING_LOG(QDF_TRACE_LEVEL_ERROR, "%s: RX ERR (%d)",
__func__, status);
}
qdf_nbuf_free(pktSkb);
return;

查看文件

@@ -366,8 +366,9 @@ void epping_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
flushing = true;
}
if (status != QDF_STATUS_E_RESOURCES) {
printk("%s() -TX ERROR, status: 0x%x\n",
__func__, status);
EPPING_LOG(QDF_TRACE_LEVEL_ERROR,
"%s() -TX ERROR, status: 0x%x",
__func__, status);
}
} else {
EPPING_LOG(QDF_TRACE_LEVEL_INFO, "%s: OK\n", __func__);

查看文件

@@ -3592,8 +3592,9 @@ A_BOOL dbglog_coex_print_handler(uint32_t mod_id,
dbglog_printf_no_line_break(timestamp, vap_id, "%s: %u",
dbg_id_str, args[0]);
for (i = 1; i < numargs; i++)
printk("%u", args[i]);
printk("\n");
dbglog_printf_no_line_break(timestamp, vap_id,
"%u", args[i]);
dbglog_printf_no_line_break(timestamp, vap_id, "\n");
} else {
return false;
}

查看文件

@@ -25,6 +25,7 @@
#include <pktlog_ac.h>
#define PKTLOG_TAG "ATH_PKTLOG"
#define PKTLOG_DEFAULT_BUFSIZE (10 * 1024 * 1024) /* 10MB */
#define PKTLOG_DEFAULT_SACK_THR 3
#define PKTLOG_DEFAULT_TAIL_LENGTH 100

查看文件

@@ -37,7 +37,6 @@
#include "host_diag_core_log.h"
#include "ani_global.h"
#define PKTLOG_TAG "ATH_PKTLOG"
#define PKTLOG_DEVNAME_SIZE 32
#define MAX_WLANDEV 1
@@ -55,7 +54,7 @@
#ifndef __MOD_INC_USE_COUNT
#define PKTLOG_MOD_INC_USE_COUNT do { \
if (!try_module_get(THIS_MODULE)) { \
printk(KERN_WARNING "try_module_get failed\n"); \
qdf_nofl_info("try_module_get failed"); \
} } while (0)
#define PKTLOG_MOD_DEC_USE_COUNT module_put(THIS_MODULE)
@@ -102,9 +101,8 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
pl_dev = get_pktlog_handle();
if (!pl_dev) {
printk(PKTLOG_TAG
"%s: Unable to allocate buffer pdev_txrx_handle or pdev_txrx_handle->pl_dev is null\n",
__func__);
qdf_nofl_info(PKTLOG_TAG
"%s: pdev_txrx_handle->pl_dev is null", __func__);
return -EINVAL;
}
@@ -115,16 +113,13 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
qdf_spin_lock_bh(&pl_info->log_lock);
if (pl_info->buf) {
qdf_spin_unlock_bh(&pl_info->log_lock);
printk(PKTLOG_TAG "Buffer is already in use\n");
qdf_nofl_info(PKTLOG_TAG "Buffer is already in use");
return -EINVAL;
}
qdf_spin_unlock_bh(&pl_info->log_lock);
buffer = vmalloc((page_cnt + 2) * PAGE_SIZE);
if (!buffer) {
printk(PKTLOG_TAG
"%s: Unable to allocate buffer "
"(%d pages)\n", __func__, page_cnt);
return -ENOMEM;
}
@@ -204,7 +199,7 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos)
if (!scn) {
mutex_unlock(&proc_mutex);
printk("%s: Invalid scn context\n", __func__);
qdf_nofl_info("%s: Invalid scn context", __func__);
ASSERT(0);
return -EINVAL;
}
@@ -213,7 +208,7 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos)
if (!pl_dev) {
mutex_unlock(&proc_mutex);
printk("%s: Invalid pktlog context\n", __func__);
qdf_nofl_info("%s: Invalid pktlog context", __func__);
ASSERT(0);
return -ENODEV;
}
@@ -267,7 +262,7 @@ qdf_sysctl_decl(ath_sysctl_pktlog_size, ctl, write, filp, buffer, lenp, ppos)
if (!scn) {
mutex_unlock(&proc_mutex);
printk("%s: Invalid scn context\n", __func__);
qdf_nofl_info("%s: Invalid scn context", __func__);
ASSERT(0);
return -EINVAL;
}
@@ -276,7 +271,7 @@ qdf_sysctl_decl(ath_sysctl_pktlog_size, ctl, write, filp, buffer, lenp, ppos)
if (!pl_dev) {
mutex_unlock(&proc_mutex);
printk("%s: Invalid pktlog handle\n", __func__);
qdf_nofl_info("%s: Invalid pktlog handle", __func__);
ASSERT(0);
return -ENODEV;
}
@@ -397,7 +392,7 @@ static int pktlog_sysctl_register(struct hif_opaque_softc *scn)
register_sysctl_table(pl_info_lnx->sysctls);
if (!pl_info_lnx->sysctl_header) {
printk("%s: failed to register sysctls!\n", proc_name);
qdf_nofl_info("%s: failed to register sysctls!", proc_name);
return -EINVAL;
}
@@ -455,16 +450,16 @@ static int pktlog_attach(struct hif_opaque_softc *scn)
&pl_info_lnx->info);
if (!proc_entry) {
printk(PKTLOG_TAG "%s: create_proc_entry failed for %s\n",
__func__, proc_name);
qdf_nofl_info(PKTLOG_TAG "%s: create_proc_entry failed for %s",
__func__, proc_name);
goto attach_fail1;
}
pl_info_lnx->proc_entry = proc_entry;
if (pktlog_sysctl_register(scn)) {
printk(PKTLOG_TAG "%s: sysctl register failed for %s\n",
__func__, proc_name);
qdf_nofl_info(PKTLOG_TAG "%s: sysctl register failed for %s",
__func__, proc_name);
goto attach_fail2;
}
@@ -485,7 +480,7 @@ static void pktlog_sysctl_unregister(struct pktlog_dev_t *pl_dev)
struct ath_pktlog_info_lnx *pl_info_lnx;
if (!pl_dev) {
printk("%s: Invalid pktlog context\n", __func__);
qdf_nofl_info("%s: Invalid pktlog context", __func__);
ASSERT(0);
return;
}
@@ -505,7 +500,7 @@ static void pktlog_detach(struct hif_opaque_softc *scn)
struct pktlog_dev_t *pl_dev = get_pktlog_handle();
if (!pl_dev) {
printk("%s: Invalid pktlog context\n", __func__);
qdf_nofl_info("%s: Invalid pktlog context", __func__);
ASSERT(0);
return;
}
@@ -1006,7 +1001,7 @@ int pktlogmod_init(void *context)
g_pktlog_pde = proc_mkdir(PKTLOG_PROC_DIR, NULL);
if (!g_pktlog_pde) {
printk(PKTLOG_TAG "%s: proc_mkdir failed\n", __func__);
qdf_nofl_info(PKTLOG_TAG "%s: proc_mkdir failed", __func__);
return -EPERM;
}

查看文件

@@ -116,7 +116,7 @@ void pktlog_getbuf_intsafe(struct ath_pktlog_arg *plarg)
#endif
if (!plarg) {
printk("Invalid parg in %s\n", __func__);
qdf_nofl_info("Invalid parg in %s", __func__);
return;
}
@@ -132,7 +132,7 @@ void pktlog_getbuf_intsafe(struct ath_pktlog_arg *plarg)
flags = plarg->flags;
if (!log_buf) {
printk("Invalid log_buf in %s\n", __func__);
qdf_nofl_info("Invalid log_buf in %s", __func__);
return;
}
@@ -409,7 +409,7 @@ A_STATUS process_tx_info(struct cdp_pdev *txrx_pdev, void *data)
uint32_t len;
if (!txrx_pdev) {
printk("Invalid pdev in %s\n", __func__);
qdf_nofl_info("Invalid pdev in %s", __func__);
return A_ERROR;
}
@@ -619,8 +619,8 @@ A_STATUS process_tx_info(struct cdp_pdev *txrx_pdev, void *data)
&pl_hdr);
if (!txctl_log.txdesc_hdr_ctl) {
printk
("failed to get buf for txctl_log.txdesc_hdr_ctl\n");
qdf_nofl_info
("failed to get txctl_log.txdesc_hdr_ctl buf");
return A_ERROR;
}
@@ -848,13 +848,13 @@ A_STATUS process_rx_info(void *pdev, void *data)
uint32_t len;
if (!pdev) {
printk("Invalid pdev in %s", __func__);
qdf_nofl_info("Invalid pdev in %s", __func__);
return A_ERROR;
}
pl_dev = ((struct ol_txrx_pdev_t *)pdev)->pl_dev;
if (!pl_dev) {
printk("Invalid pl_dev in %s", __func__);
qdf_nofl_info("Invalid pl_dev in %s", __func__);
return A_ERROR;
}
@@ -926,13 +926,13 @@ A_STATUS process_rx_info(void *pdev, void *data)
uint32_t len;
if (!pdev) {
printk("Invalid pdev in %s", __func__);
qdf_nofl_info("Invalid pdev in %s", __func__);
return A_ERROR;
}
pl_dev = ((struct ol_txrx_pdev_t *)pdev)->pl_dev;
if (!pl_dev) {
printk("Invalid pl_dev in %s", __func__);
qdf_nofl_info("Invalid pl_dev in %s", __func__);
return A_ERROR;
}