From: Kalle Valo <kvalo@codeaurora.org>
To: linux-wireless@vger.kernel.org
Cc: ath11k@lists.infradead.org
Subject: [PATCH 03/10] ath11k: qmi clean up in ath11k_qmi_wlanfw_wlan_cfg_send()
Date: Wed, 27 Nov 2019 14:08:50 +0000 [thread overview]
Message-ID: <0101016ead31767d-ef497a3d-49b6-4206-aba4-5a340b55c9bc-000000@us-west-2.amazonses.com> (raw)
In-Reply-To: <1574863720-25728-1-git-send-email-kvalo@codeaurora.org>
From: Anilkumar Kolli <akolli@codeaurora.org>
Use pipe_id id instead of ret in for loop.
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/ath/ath11k/ce.h | 9 +++++++--
drivers/net/wireless/ath/ath11k/qmi.c | 28 +++++++++++++---------------
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ce.h b/drivers/net/wireless/ath/ath11k/ce.h
index 6174eac84410..e355dfda48bf 100644
--- a/drivers/net/wireless/ath/ath11k/ce.h
+++ b/drivers/net/wireless/ath/ath11k/ce.h
@@ -57,7 +57,12 @@ void ath11k_ce_byte_swap(void *mem, u32 len);
struct ath11k_base;
-/* Establish a mapping between a service/direction and a pipe. */
+/*
+ * Establish a mapping between a service/direction and a pipe.
+ * Configuration information for a Copy Engine pipe and services.
+ * Passed from Host to Target through QMI message and must be in
+ * little endian format.
+ */
struct service_to_pipe {
__le32 service_id;
__le32 pipedir;
@@ -66,7 +71,7 @@ struct service_to_pipe {
/*
* Configuration information for a Copy Engine pipe.
- * Passed from Host to Target during startup (one per CE).
+ * Passed from Host to Target through QMI message during startup (one per CE).
*
* NOTE: Structure is shared between Host software and Target firmware!
*/
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index adf41f28a231..2377895a58ec 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2016,7 +2016,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab)
struct ce_pipe_config *ce_cfg;
struct service_to_pipe *svc_cfg;
struct qmi_txn txn = {};
- int ret = 0;
+ int ret = 0, pipe_num;
ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce;
svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map;
@@ -2033,24 +2033,22 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab)
req->tgt_cfg_valid = 1;
/* This is number of CE configs */
- req->tgt_cfg_len = ((ab->qmi.ce_cfg.tgt_ce_len) /
- (sizeof(struct ce_pipe_config))) - 1;
- for (ret = 0; ret <= req->tgt_cfg_len ; ret++) {
- req->tgt_cfg[ret].pipe_num = ce_cfg[ret].pipenum;
- req->tgt_cfg[ret].pipe_dir = ce_cfg[ret].pipedir;
- req->tgt_cfg[ret].nentries = ce_cfg[ret].nentries;
- req->tgt_cfg[ret].nbytes_max = ce_cfg[ret].nbytes_max;
- req->tgt_cfg[ret].flags = ce_cfg[ret].flags;
+ req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len;
+ for (pipe_num = 0; pipe_num <= req->tgt_cfg_len ; pipe_num++) {
+ req->tgt_cfg[pipe_num].pipe_num = ce_cfg[pipe_num].pipenum;
+ req->tgt_cfg[pipe_num].pipe_dir = ce_cfg[pipe_num].pipedir;
+ req->tgt_cfg[pipe_num].nentries = ce_cfg[pipe_num].nentries;
+ req->tgt_cfg[pipe_num].nbytes_max = ce_cfg[pipe_num].nbytes_max;
+ req->tgt_cfg[pipe_num].flags = ce_cfg[pipe_num].flags;
}
req->svc_cfg_valid = 1;
/* This is number of Service/CE configs */
- req->svc_cfg_len = (ab->qmi.ce_cfg.svc_to_ce_map_len) /
- (sizeof(struct service_to_pipe));
- for (ret = 0; ret < req->svc_cfg_len; ret++) {
- req->svc_cfg[ret].service_id = svc_cfg[ret].service_id;
- req->svc_cfg[ret].pipe_dir = svc_cfg[ret].pipedir;
- req->svc_cfg[ret].pipe_num = svc_cfg[ret].pipenum;
+ req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len;
+ for (pipe_num = 0; pipe_num < req->svc_cfg_len; pipe_num++) {
+ req->svc_cfg[pipe_num].service_id = svc_cfg[pipe_num].service_id;
+ req->svc_cfg[pipe_num].pipe_dir = svc_cfg[pipe_num].pipedir;
+ req->svc_cfg[pipe_num].pipe_num = svc_cfg[pipe_num].pipenum;
}
req->shadow_reg_valid = 0;
req->shadow_reg_v2_valid = 0;
--
2.7.4
next prev parent reply other threads:[~2019-11-27 14:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1574863720-25728-1-git-send-email-kvalo@codeaurora.org>
2019-11-27 14:08 ` [PATCH 01/10] ath11k: tracing: fix ath11k tracing Kalle Valo
2019-11-29 7:48 ` Kalle Valo
2019-11-27 14:08 ` [PATCH 02/10] ath11k: qmi clean up ce and HTC service config update Kalle Valo
2019-11-27 14:08 ` [PATCH 04/10] ath11k: pktlog: fix sending/using the pdev id Kalle Valo
2019-11-27 14:08 ` Kalle Valo [this message]
2019-11-27 14:08 ` [PATCH 05/10] ath11k: avoid burst time conversion logic Kalle Valo
2019-11-27 14:08 ` [PATCH 06/10] ath11k: avoid use_after_free in ath11k_dp_rx_msdu_coalesce API Kalle Valo
2019-11-27 14:08 ` [PATCH 07/10] ath11k: update bawindow size in delba process Kalle Valo
2019-11-27 14:08 ` [PATCH 08/10] ath11k: add support for controlling tx power to a station Kalle Valo
2019-11-27 14:08 ` [PATCH 09/10] ath11k: unlock mutex during failure in qmi fw ready Kalle Valo
2019-11-27 14:09 ` [PATCH 10/10] ath11k: add necessary peer assoc params in wmi dbg Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0101016ead31767d-ef497a3d-49b6-4206-aba4-5a340b55c9bc-000000@us-west-2.amazonses.com \
--to=kvalo@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).