From: Erik Stromdahl <erik.stromdahl@gmail.com>
To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org
Cc: Erik Stromdahl <erik.stromdahl@gmail.com>
Subject: [RFC 3/5] ath6kl: Added disable credit flow ctrl for mbox
Date: Thu, 13 Oct 2016 18:39:27 +0200 [thread overview]
Message-ID: <1476376769-4708-4-git-send-email-erik.stromdahl@gmail.com> (raw)
In-Reply-To: <1476376769-4708-1-git-send-email-erik.stromdahl@gmail.com>
Added support for disabling credit flow control for htc_mbox
in a similar way as htc_pipe.
The tx_credit_flow_enabled member was moved out from the pipe
struct in struct htc_endpoint since it is now used by htc_mbox
as well.
Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
drivers/net/wireless/ath/ath6kl/htc.h | 2 +-
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 18 ++++++++++++++++--
drivers/net/wireless/ath/ath6kl/htc_pipe.c | 14 +++++++-------
3 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/htc.h b/drivers/net/wireless/ath/ath6kl/htc.h
index 112d8a9..532b13b 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.h
+++ b/drivers/net/wireless/ath/ath6kl/htc.h
@@ -521,12 +521,12 @@ struct htc_endpoint {
u32 conn_flags;
struct htc_endpoint_stats ep_st;
u16 tx_drop_packet_threshold;
+ bool tx_credit_flow_enabled;
struct {
u8 pipeid_ul;
u8 pipeid_dl;
struct list_head tx_lookup_queue;
- bool tx_credit_flow_enabled;
} pipe;
};
diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
index 6e8c493..2c4477d 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
@@ -603,7 +603,7 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
struct htc_endpoint *endpoint,
struct list_head *queue)
{
- int req_cred;
+ int req_cred = 0;
u8 flags;
struct htc_packet *packet;
unsigned int len;
@@ -623,7 +623,8 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
len = CALC_TXRX_PADDED_LEN(target,
packet->act_len + HTC_HDR_LENGTH);
- if (htc_check_credits(target, endpoint, &flags,
+ if (endpoint->tx_credit_flow_enabled &&
+ htc_check_credits(target, endpoint, &flags,
packet->endpoint, len, &req_cred))
break;
@@ -2434,6 +2435,7 @@ static int ath6kl_htc_mbox_conn_service(struct htc_target *target,
struct htc_conn_service_msg *conn_msg;
struct htc_endpoint *endpoint;
enum htc_endpoint_id assigned_ep = ENDPOINT_MAX;
+ bool disable_credit_flowctrl = false;
unsigned int max_msg_sz = 0;
int status = 0;
u16 msg_id;
@@ -2459,6 +2461,10 @@ static int ath6kl_htc_mbox_conn_service(struct htc_target *target,
conn_msg->svc_id = cpu_to_le16(conn_req->svc_id);
conn_msg->conn_flags = cpu_to_le16(conn_req->conn_flags);
+ if (conn_req->conn_flags &
+ HTC_CONN_FLGS_DISABLE_CRED_FLOW_CTRL)
+ disable_credit_flowctrl = true;
+
set_htc_pkt_info(tx_pkt, NULL, (u8 *) conn_msg,
sizeof(*conn_msg) + conn_msg->svc_meta_len,
ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
@@ -2562,6 +2568,13 @@ static int ath6kl_htc_mbox_conn_service(struct htc_target *target,
/* save local connection flags */
endpoint->conn_flags = conn_req->flags;
+ if (disable_credit_flowctrl && endpoint->tx_credit_flow_enabled) {
+ endpoint->tx_credit_flow_enabled = false;
+ ath6kl_dbg(ATH6KL_DBG_HTC,
+ "SVC: 0x%4.4X ep:%d TX flow control off\n",
+ endpoint->svc_id, assigned_ep);
+ }
+
fail_tx:
if (tx_pkt)
htc_reclaim_txctrl_buf(target, tx_pkt);
@@ -2590,6 +2603,7 @@ static void reset_ep_state(struct htc_target *target)
INIT_LIST_HEAD(&endpoint->rx_bufq);
INIT_LIST_HEAD(&endpoint->txq);
endpoint->target = target;
+ endpoint->tx_credit_flow_enabled = true;
}
/* reset distribution list */
diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index ca1a18c..93aac63 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -408,7 +408,7 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
}
}
- if (!ep->pipe.tx_credit_flow_enabled) {
+ if (!ep->tx_credit_flow_enabled) {
tx_resources =
ath6kl_hif_pipe_get_free_queue_number(ar,
ep->pipe.pipeid_ul);
@@ -452,7 +452,7 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
if (get_queue_depth(&ep->txq) == 0)
break;
- if (ep->pipe.tx_credit_flow_enabled) {
+ if (ep->tx_credit_flow_enabled) {
/*
* Credit based mechanism provides flow control
* based on target transmit resource availability,
@@ -482,7 +482,7 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
/* send what we can */
htc_issue_packets(target, ep, &send_queue);
- if (!ep->pipe.tx_credit_flow_enabled) {
+ if (!ep->tx_credit_flow_enabled) {
pipeid = ep->pipe.pipeid_ul;
tx_resources =
ath6kl_hif_pipe_get_free_queue_number(ar, pipeid);
@@ -768,7 +768,7 @@ static int ath6kl_htc_pipe_tx_complete(struct ath6kl *ar, struct sk_buff *skb)
}
skb = NULL;
- if (!ep->pipe.tx_credit_flow_enabled) {
+ if (!ep->tx_credit_flow_enabled) {
/*
* note: when using TX credit flow, the re-checking of queues
* happens when credits flow back from the target. in the
@@ -1194,7 +1194,7 @@ static void reset_endpoint_states(struct htc_target *target)
INIT_LIST_HEAD(&ep->pipe.tx_lookup_queue);
INIT_LIST_HEAD(&ep->rx_bufq);
ep->target = target;
- ep->pipe.tx_credit_flow_enabled = true;
+ ep->tx_credit_flow_enabled = true;
}
}
@@ -1399,8 +1399,8 @@ static int ath6kl_htc_pipe_conn_service(struct htc_target *target,
ep->svc_id, ep->pipe.pipeid_ul,
ep->pipe.pipeid_dl, ep->eid);
- if (disable_credit_flowctrl && ep->pipe.tx_credit_flow_enabled) {
- ep->pipe.tx_credit_flow_enabled = false;
+ if (disable_credit_flowctrl && ep->tx_credit_flow_enabled) {
+ ep->tx_credit_flow_enabled = false;
ath6kl_dbg(ATH6KL_DBG_HTC,
"SVC: 0x%4.4X ep:%d TX flow control off\n",
ep->svc_id, assigned_epid);
--
2.1.4
next prev parent reply other threads:[~2016-10-13 16:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 16:39 [RFC 0/5] ath6kl: non WMI data service support Erik Stromdahl
2016-10-13 16:39 ` [RFC 1/5] ath6kl: HTC mbox tx complete cb support Erik Stromdahl
2016-10-13 16:39 ` [RFC 2/5] ath6kl: Updated TARG_VTOP macro with default value Erik Stromdahl
2016-10-13 16:39 ` Erik Stromdahl [this message]
2016-10-13 16:39 ` [RFC 4/5] ath6kl: Updated credit setup Erik Stromdahl
2016-10-13 16:39 ` [RFC 5/5] ath6kl: service connect rewrite Erik Stromdahl
2016-10-13 23:57 ` [RFC 0/5] ath6kl: non WMI data service support Steve deRosier
2016-10-14 4:32 ` Valo, Kalle
2016-10-14 15:38 ` Erik Stromdahl
2016-10-15 5:24 ` Valo, Kalle
2016-10-14 7:34 ` Valo, Kalle
2016-10-14 15:54 ` Erik Stromdahl
2016-10-15 5:29 ` Valo, Kalle
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=1476376769-4708-4-git-send-email-erik.stromdahl@gmail.com \
--to=erik.stromdahl@gmail.com \
--cc=kvalo@qca.qualcomm.com \
--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).