qcacmn: Replace linux print APIs with qdf print APIs

Replace linux print APIs with equivalent level qdf print APIs.

Change-Id: If0a4a5326de87c9f023e8f4de996a4734ed6cda2
CRs-Fixed: 2530137
This commit is contained in:
Himanshu Batra
2019-09-18 15:50:19 +05:30
committed by nshrivas
parent 659379aeff
commit 7ee0677954
7 changed files with 60 additions and 56 deletions

View File

@@ -1527,7 +1527,7 @@ static void hal_reo_status_get_header_generic(uint32_t *d, int b, void *h1)
UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)]; UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
break; break;
default: default:
pr_err("ERROR: Unknown tlv\n"); qdf_nofl_err("ERROR: Unknown tlv");
break; break;
} }
h->cmd_num = h->cmd_num =
@@ -1570,7 +1570,7 @@ static void hal_reo_status_get_header_generic(uint32_t *d, int b, void *h1)
UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)]; UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
break; break;
default: default:
pr_err("ERROR: Unknown tlv\n"); qdf_nofl_err("ERROR: Unknown tlv");
break; break;
} }
h->tstamp = h->tstamp =

View File

@@ -1636,13 +1636,13 @@ ssize_t hif_input_desc_trace_buf_index(struct hif_softc *scn,
ce_hist = &scn->hif_ce_desc_hist; ce_hist = &scn->hif_ce_desc_hist;
if (!size) { if (!size) {
pr_err("%s: Invalid input buffer.\n", __func__); qdf_nofl_err("%s: Invalid input buffer.", __func__);
return -EINVAL; return -EINVAL;
} }
if (sscanf(buf, "%u %u", (unsigned int *)&ce_hist->hist_id, if (sscanf(buf, "%u %u", (unsigned int *)&ce_hist->hist_id,
(unsigned int *)&ce_hist->hist_index) != 2) { (unsigned int *)&ce_hist->hist_index) != 2) {
pr_err("%s: Invalid input value.\n", __func__); qdf_nofl_err("%s: Invalid input value.", __func__);
return -EINVAL; return -EINVAL;
} }
if ((ce_hist->hist_id >= CE_COUNT_MAX) || if ((ce_hist->hist_id >= CE_COUNT_MAX) ||
@@ -1681,13 +1681,14 @@ ssize_t hif_ce_en_desc_hist(struct hif_softc *scn, const char *buf, size_t size)
ce_hist = &scn->hif_ce_desc_hist; ce_hist = &scn->hif_ce_desc_hist;
if (!size) { if (!size) {
pr_err("%s: Invalid input buffer.\n", __func__); qdf_nofl_err("%s: Invalid input buffer.", __func__);
return -EINVAL; return -EINVAL;
} }
if (sscanf(buf, "%u %u", (unsigned int *)&ce_id, if (sscanf(buf, "%u %u", (unsigned int *)&ce_id,
(unsigned int *)&cfg) != 2) { (unsigned int *)&cfg) != 2) {
pr_err("%s: Invalid input: Enter CE Id<sp><1/0>.\n", __func__); qdf_nofl_err("%s: Invalid input: Enter CE Id<sp><1/0>.",
__func__);
return -EINVAL; return -EINVAL;
} }
if (ce_id >= CE_COUNT_MAX) { if (ce_id >= CE_COUNT_MAX) {

View File

@@ -720,7 +720,7 @@ void hif_usb_ramdump_handler(struct hif_opaque_softc *scn)
reg = (uint32_t *) (data + 4); reg = (uint32_t *) (data + 4);
start_addr = *reg++; start_addr = *reg++;
if (sc->fw_ram_dumping == 0) { if (sc->fw_ram_dumping == 0) {
pr_err("Firmware stack dump:"); qdf_nofl_err("Firmware stack dump:");
sc->fw_ram_dumping = 1; sc->fw_ram_dumping = 1;
fw_stack_addr = start_addr; fw_stack_addr = start_addr;
} }
@@ -729,13 +729,13 @@ void hif_usb_ramdump_handler(struct hif_opaque_softc *scn)
for (i = 0; i < (len - 8); i += 16) { for (i = 0; i < (len - 8); i += 16) {
if ((*reg == FW_REG_END_PATTERN) && (i == len - 12)) { if ((*reg == FW_REG_END_PATTERN) && (i == len - 12)) {
sc->fw_ram_dumping = 0; sc->fw_ram_dumping = 0;
pr_err("Stack start address = %#08x\n", qdf_nofl_err("Stack start address = %#08x",
fw_stack_addr); fw_stack_addr);
break; break;
} }
hex_dump_to_buffer(reg, remaining, 16, 4, str_buf, hex_dump_to_buffer(reg, remaining, 16, 4, str_buf,
sizeof(str_buf), false); sizeof(str_buf), false);
pr_err("%#08x: %s\n", start_addr + i, str_buf); qdf_nofl_err("%#08x: %s", start_addr + i, str_buf);
remaining -= 16; remaining -= 16;
reg += 4; reg += 4;
} }

View File

@@ -482,8 +482,9 @@ static int pkt_stats_fill_headers(struct sk_buff *skb)
cds_pkt_size); cds_pkt_size);
if (unlikely(skb_headroom(skb) < cds_pkt_size)) { if (unlikely(skb_headroom(skb) < cds_pkt_size)) {
pr_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]", qdf_nofl_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]",
__LINE__, skb->head, skb->data, sizeof(msg_header)); __LINE__, skb->head, skb->data,
sizeof(msg_header));
return -EIO; return -EIO;
} }
@@ -491,8 +492,9 @@ static int pkt_stats_fill_headers(struct sk_buff *skb)
&cds_pktlog, cds_pkt_size); &cds_pktlog, cds_pkt_size);
if (unlikely(skb_headroom(skb) < sizeof(int))) { if (unlikely(skb_headroom(skb) < sizeof(int))) {
pr_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]", qdf_nofl_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]",
__LINE__, skb->head, skb->data, sizeof(int)); __LINE__, skb->head, skb->data,
sizeof(int));
return -EIO; return -EIO;
} }
@@ -513,8 +515,9 @@ static int pkt_stats_fill_headers(struct sk_buff *skb)
msg_header.wmsg.length = cpu_to_be16(skb->len); msg_header.wmsg.length = cpu_to_be16(skb->len);
if (unlikely(skb_headroom(skb) < sizeof(msg_header))) { if (unlikely(skb_headroom(skb) < sizeof(msg_header))) {
pr_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]", qdf_nofl_err("VPKT [%d]: Insufficient headroom, head[%pK], data[%pK], req[%zu]",
__LINE__, skb->head, skb->data, sizeof(msg_header)); __LINE__, skb->head, skb->data,
sizeof(msg_header));
return -EIO; return -EIO;
} }
@@ -564,8 +567,8 @@ static int pktlog_send_per_pkt_stats_to_user(void)
skb_new = dev_alloc_skb(MAX_SKBMSG_LENGTH); skb_new = dev_alloc_skb(MAX_SKBMSG_LENGTH);
if (!skb_new) { if (!skb_new) {
if (!rate_limit) { if (!rate_limit) {
pr_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n", qdf_nofl_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u",
__func__, MAX_SKBMSG_LENGTH, __func__, MAX_SKBMSG_LENGTH,
gwlan_logging.drop_count); gwlan_logging.drop_count);
} }
rate_limit = 1; rate_limit = 1;
@@ -582,14 +585,15 @@ static int pktlog_send_per_pkt_stats_to_user(void)
ret = pkt_stats_fill_headers(pstats_msg->skb); ret = pkt_stats_fill_headers(pstats_msg->skb);
if (ret < 0) { if (ret < 0) {
pr_err("%s failed to fill headers %d\n", __func__, ret); qdf_nofl_err("%s failed to fill headers %d",
__func__, ret);
free_old_skb = true; free_old_skb = true;
goto err; goto err;
} }
ret = nl_srv_bcast_diag(pstats_msg->skb); ret = nl_srv_bcast_diag(pstats_msg->skb);
if (ret < 0) { if (ret < 0) {
pr_info("%s: Send Failed %d drop_count = %u\n", qdf_nofl_info("%s: Send Failed %d drop_count = %u",
__func__, ret, __func__, ret,
++gwlan_logging.pkt_stat_drop_cnt); ++gwlan_logging.pkt_stat_drop_cnt);
} else { } else {
ret = 0; ret = 0;
@@ -640,10 +644,9 @@ static int send_filled_buffers_to_user(void)
skb = dev_alloc_skb(MAX_LOGMSG_LENGTH); skb = dev_alloc_skb(MAX_LOGMSG_LENGTH);
if (!skb) { if (!skb) {
if (!rate_limit) { if (!rate_limit) {
pr_err qdf_nofl_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u",
("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n", __func__, MAX_LOGMSG_LENGTH,
__func__, MAX_LOGMSG_LENGTH, gwlan_logging.drop_count);
gwlan_logging.drop_count);
} }
rate_limit = 1; rate_limit = 1;
ret = -ENOMEM; ret = -ENOMEM;
@@ -669,10 +672,10 @@ static int send_filled_buffers_to_user(void)
list_add_tail(&plog_msg->node, list_add_tail(&plog_msg->node,
&gwlan_logging.free_list); &gwlan_logging.free_list);
spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags);
pr_err("%s: drop_count = %u\n", __func__, qdf_nofl_err("%s: drop_count = %u", __func__,
++gwlan_logging.drop_count); ++gwlan_logging.drop_count);
pr_err("%s: nlmsg_put() failed for msg size[%d]\n", qdf_nofl_err("%s: nlmsg_put() failed for msg size[%d]",
__func__, tot_msg_len); __func__, tot_msg_len);
dev_kfree_skb(skb); dev_kfree_skb(skb);
skb = NULL; skb = NULL;
ret = -EINVAL; ret = -EINVAL;
@@ -691,8 +694,8 @@ static int send_filled_buffers_to_user(void)
ret = nl_srv_bcast_host_logs(skb); ret = nl_srv_bcast_host_logs(skb);
/* print every 64th drop count */ /* print every 64th drop count */
if (ret < 0 && (!(gwlan_logging.drop_count % 0x40))) { if (ret < 0 && (!(gwlan_logging.drop_count % 0x40))) {
pr_err("%s: Send Failed %d drop_count = %u\n", qdf_nofl_err("%s: Send Failed %d drop_count = %u",
__func__, ret, ++gwlan_logging.drop_count); __func__, ret, ++gwlan_logging.drop_count);
} }
} }
@@ -800,9 +803,8 @@ static int wlan_logging_thread(void *Arg)
|| gwlan_logging.exit)); || gwlan_logging.exit));
if (ret_wait_status == -ERESTARTSYS) { if (ret_wait_status == -ERESTARTSYS) {
pr_err qdf_nofl_err("%s: wait_event_interruptible returned -ERESTARTSYS",
("%s: wait_event_interruptible returned -ERESTARTSYS", __func__);
__func__);
break; break;
} }
@@ -935,8 +937,8 @@ int wlan_logging_sock_init_svc(void)
gwlan_logging.buffer_length = MAX_LOGMSG_LENGTH; gwlan_logging.buffer_length = MAX_LOGMSG_LENGTH;
if (allocate_log_msg_buffer() != QDF_STATUS_SUCCESS) { if (allocate_log_msg_buffer() != QDF_STATUS_SUCCESS) {
pr_err("%s: Could not allocate memory for log_msg\n", qdf_nofl_err("%s: Could not allocate memory for log_msg",
__func__); __func__);
return -ENOMEM; return -ENOMEM;
} }
@@ -957,8 +959,8 @@ int wlan_logging_sock_init_svc(void)
pkt_stats_size = sizeof(struct pkt_stats_msg); pkt_stats_size = sizeof(struct pkt_stats_msg);
gpkt_stats_buffers = vmalloc(MAX_PKTSTATS_BUFF * pkt_stats_size); gpkt_stats_buffers = vmalloc(MAX_PKTSTATS_BUFF * pkt_stats_size);
if (!gpkt_stats_buffers) { if (!gpkt_stats_buffers) {
pr_err("%s: Could not allocate memory for Pkt stats\n", qdf_nofl_err("%s: Could not allocate memory for Pkt stats",
__func__); __func__);
goto err1; goto err1;
} }
qdf_mem_zero(gpkt_stats_buffers, qdf_mem_zero(gpkt_stats_buffers,
@@ -974,7 +976,8 @@ int wlan_logging_sock_init_svc(void)
for (i = 0; i < MAX_PKTSTATS_BUFF; i++) { for (i = 0; i < MAX_PKTSTATS_BUFF; i++) {
gpkt_stats_buffers[i].skb = dev_alloc_skb(MAX_PKTSTATS_LENGTH); gpkt_stats_buffers[i].skb = dev_alloc_skb(MAX_PKTSTATS_LENGTH);
if (!gpkt_stats_buffers[i].skb) { if (!gpkt_stats_buffers[i].skb) {
pr_err("%s: Memory alloc failed for skb", __func__); qdf_nofl_err("%s: Memory alloc failed for skb",
__func__);
/* free previously allocated skb and return */ /* free previously allocated skb and return */
for (j = 0; j < i ; j++) for (j = 0; j < i ; j++)
dev_kfree_skb(gpkt_stats_buffers[j].skb); dev_kfree_skb(gpkt_stats_buffers[j].skb);
@@ -1001,8 +1004,8 @@ int wlan_logging_sock_init_svc(void)
gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL, gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL,
"wlan_logging_thread"); "wlan_logging_thread");
if (IS_ERR(gwlan_logging.thread)) { if (IS_ERR(gwlan_logging.thread)) {
pr_err("%s: Could not Create LogMsg Thread Controller", qdf_nofl_err("%s: Could not Create LogMsg Thread Controller",
__func__); __func__);
goto err3; goto err3;
} }
wake_up_process(gwlan_logging.thread); wake_up_process(gwlan_logging.thread);
@@ -1133,8 +1136,8 @@ void wlan_flush_host_logs_for_fatal(void)
unsigned long flags; unsigned long flags;
if (gwlan_logging.flush_timer_period == 0) if (gwlan_logging.flush_timer_period == 0)
pr_info("%s:flush all host logs Setting HOST_LOG_POST_MASK\n", qdf_nofl_info("%s:flush all host logs Setting HOST_LOG_POST_MAS",
__func__); __func__);
spin_lock_irqsave(&gwlan_logging.spin_lock, flags); spin_lock_irqsave(&gwlan_logging.spin_lock, flags);
wlan_queue_logmsg_for_app(); wlan_queue_logmsg_for_app();
spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags);
@@ -1181,8 +1184,8 @@ static int wlan_get_pkt_stats_free_node(void)
if ( if (
cds_is_multicast_logging() && cds_is_multicast_logging() &&
(!(gwlan_logging.pkt_stat_drop_cnt % 0x40))) { (!(gwlan_logging.pkt_stat_drop_cnt % 0x40))) {
pr_err("%s: drop_count = %u\n", qdf_nofl_err("%s: drop_count = %u",
__func__, gwlan_logging.pkt_stat_drop_cnt); __func__, gwlan_logging.pkt_stat_drop_cnt);
} }
list_del_init(gwlan_logging.pkt_stat_filled_list.next); list_del_init(gwlan_logging.pkt_stat_filled_list.next);
ret = 1; ret = 1;
@@ -1217,7 +1220,7 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
pktlog_hdr = (struct ath_pktlog_hdr *)pl_hdr; pktlog_hdr = (struct ath_pktlog_hdr *)pl_hdr;
if (!pktlog_hdr) { if (!pktlog_hdr) {
pr_err("%s : Invalid pkt_stats_header\n", __func__); qdf_nofl_err("%s : Invalid pkt_stats_header", __func__);
return; return;
} }
@@ -1327,7 +1330,7 @@ static void send_packetdump(ol_txrx_soc_handle soc,
struct packet_dump pd_hdr = {0}; struct packet_dump pd_hdr = {0};
if (!netbuf) { if (!netbuf) {
pr_err("%s: Invalid netbuf.\n", __func__); qdf_nofl_err("%s: Invalid netbuf.", __func__);
return; return;
} }

View File

@@ -539,13 +539,13 @@ static int __pktlog_open(struct inode *i, struct file *f)
PKTLOG_MOD_INC_USE_COUNT; PKTLOG_MOD_INC_USE_COUNT;
pl_info = PDE_DATA(f->f_path.dentry->d_inode); pl_info = PDE_DATA(f->f_path.dentry->d_inode);
if (!pl_info) { if (!pl_info) {
pr_err("%s: pl_info NULL", __func__); qdf_nofl_err("%s: pl_info NULL", __func__);
return -EINVAL; return -EINVAL;
} }
if (pl_info->curr_pkt_state != PKTLOG_OPR_NOT_IN_PROGRESS) { if (pl_info->curr_pkt_state != PKTLOG_OPR_NOT_IN_PROGRESS) {
pr_info("%s: plinfo state (%d) != PKTLOG_OPR_NOT_IN_PROGRESS", qdf_nofl_info("%s: plinfo state (%d) != PKTLOG_OPR_NOT_IN_PROGRESS",
__func__, pl_info->curr_pkt_state); __func__, pl_info->curr_pkt_state);
return -EBUSY; return -EBUSY;
} }
@@ -642,8 +642,8 @@ static int __pktlog_release(struct inode *i, struct file *f)
cds_is_packet_log_enabled(), 0, 1); cds_is_packet_log_enabled(), 0, 1);
if (ret != 0) if (ret != 0)
pr_warn("%s: pktlog cannot be enabled. ret value %d\n", qdf_nofl_warn("%s: pktlog cannot be enabled. ret value %d",
__func__, ret); __func__, ret);
pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS; pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS;
return ret; return ret;

View File

@@ -414,7 +414,7 @@ A_STATUS process_tx_info(struct cdp_pdev *txrx_pdev, void *data)
} }
if (!pl_dev) { if (!pl_dev) {
pr_err("Invalid pktlog handle in %s\n", __func__); qdf_nofl_err("Invalid pktlog handle in %s", __func__);
qdf_assert(pl_dev); qdf_assert(pl_dev);
return A_ERROR; return A_ERROR;
} }
@@ -525,7 +525,7 @@ A_STATUS process_tx_info(struct cdp_pdev *txrx_pdev, void *data)
} }
if (!pl_dev) { if (!pl_dev) {
pr_err("Invalid pktlog handle in %s\n", __func__); qdf_nofl_err("Invalid pktlog handle in %s", __func__);
qdf_assert(pl_dev); qdf_assert(pl_dev);
return A_ERROR; return A_ERROR;
} }

View File

@@ -10228,8 +10228,8 @@ static uint16_t wmi_tag_fw_hang_cmd(wmi_unified_t wmi_handle)
uint16_t tag = 0; uint16_t tag = 0;
if (qdf_atomic_read(&wmi_handle->is_target_suspended)) { if (qdf_atomic_read(&wmi_handle->is_target_suspended)) {
pr_err("%s: Target is already suspended, Ignore FW Hang Command", qdf_nofl_err("%s: Target is already suspended, Ignore FW Hang Command",
__func__); __func__);
return tag; return tag;
} }