Commit fcd21133 authored by Erik Stromdahl's avatar Erik Stromdahl Committed by Kalle Valo

ath10k: htc: refactorization

Code refactorization:

Moved the code for ep 0 in ath10k_htc_rx_completion_handler
to ath10k_htc_control_rx_complete.

This eases the implementation of SDIO/mbox significantly since
the ep_rx_complete cb is invoked directly from the SDIO/mbox
hif layer.

Since the ath10k_htc_control_rx_complete already is present
(only containing a warning message) there is no reason for not
using it (instead of having a special case for ep 0 in
ath10k_htc_rx_completion_handler).
Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent ea1a3ddf
...@@ -464,7 +464,21 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) ...@@ -464,7 +464,21 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
/* zero length packet with trailer data, just drop these */ /* zero length packet with trailer data, just drop these */
goto out; goto out;
if (eid == ATH10K_HTC_EP_0) { ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
eid, skb);
ep->ep_ops.ep_rx_complete(ar, skb);
/* skb is now owned by the rx completion handler */
skb = NULL;
out:
kfree_skb(skb);
}
EXPORT_SYMBOL(ath10k_htc_rx_completion_handler);
static void ath10k_htc_control_rx_complete(struct ath10k *ar,
struct sk_buff *skb)
{
struct ath10k_htc *htc = &ar->htc;
struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data; struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
switch (__le16_to_cpu(msg->hdr.message_id)) { switch (__le16_to_cpu(msg->hdr.message_id)) {
...@@ -472,8 +486,7 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) ...@@ -472,8 +486,7 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID: case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
/* handle HTC control message */ /* handle HTC control message */
if (completion_done(&htc->ctl_resp)) { if (completion_done(&htc->ctl_resp)) {
/* /* this is a fatal error, target should not be
* this is a fatal error, target should not be
* sending unsolicited messages on the ep 0 * sending unsolicited messages on the ep 0
*/ */
ath10k_warn(ar, "HTC rx ctrl still processing\n"); ath10k_warn(ar, "HTC rx ctrl still processing\n");
...@@ -497,29 +510,10 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) ...@@ -497,29 +510,10 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n"); ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
break; break;
} }
goto out;
}
ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
eid, skb);
ep->ep_ops.ep_rx_complete(ar, skb);
/* skb is now owned by the rx completion handler */
skb = NULL;
out: out:
kfree_skb(skb); kfree_skb(skb);
} }
EXPORT_SYMBOL(ath10k_htc_rx_completion_handler);
static void ath10k_htc_control_rx_complete(struct ath10k *ar,
struct sk_buff *skb)
{
/* This is unexpected. FW is not supposed to send regular rx on this
* endpoint.
*/
ath10k_warn(ar, "unexpected htc rx\n");
kfree_skb(skb);
}
/***************/ /***************/
/* Init/Deinit */ /* Init/Deinit */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment