|
@@ -464,42 +464,6 @@ 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) {
|
|
|
|
- struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
|
|
|
|
-
|
|
|
|
- switch (__le16_to_cpu(msg->hdr.message_id)) {
|
|
|
|
- case ATH10K_HTC_MSG_READY_ID:
|
|
|
|
- case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
|
|
|
|
- /* handle HTC control message */
|
|
|
|
- if (completion_done(&htc->ctl_resp)) {
|
|
|
|
- /*
|
|
|
|
- * this is a fatal error, target should not be
|
|
|
|
- * sending unsolicited messages on the ep 0
|
|
|
|
- */
|
|
|
|
- ath10k_warn(ar, "HTC rx ctrl still processing\n");
|
|
|
|
- complete(&htc->ctl_resp);
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- htc->control_resp_len =
|
|
|
|
- min_t(int, skb->len,
|
|
|
|
- ATH10K_HTC_MAX_CTRL_MSG_LEN);
|
|
|
|
-
|
|
|
|
- memcpy(htc->control_resp_buffer, skb->data,
|
|
|
|
- htc->control_resp_len);
|
|
|
|
-
|
|
|
|
- complete(&htc->ctl_resp);
|
|
|
|
- break;
|
|
|
|
- case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
|
|
|
|
- htc->htc_ops.target_send_suspend_complete(ar);
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
|
|
ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
|
|
eid, skb);
|
|
eid, skb);
|
|
ep->ep_ops.ep_rx_complete(ar, skb);
|
|
ep->ep_ops.ep_rx_complete(ar, skb);
|
|
@@ -514,10 +478,40 @@ EXPORT_SYMBOL(ath10k_htc_rx_completion_handler);
|
|
static void ath10k_htc_control_rx_complete(struct ath10k *ar,
|
|
static void ath10k_htc_control_rx_complete(struct ath10k *ar,
|
|
struct sk_buff *skb)
|
|
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");
|
|
|
|
|
|
+ struct ath10k_htc *htc = &ar->htc;
|
|
|
|
+ struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
|
|
|
|
+
|
|
|
|
+ switch (__le16_to_cpu(msg->hdr.message_id)) {
|
|
|
|
+ case ATH10K_HTC_MSG_READY_ID:
|
|
|
|
+ case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
|
|
|
|
+ /* handle HTC control message */
|
|
|
|
+ if (completion_done(&htc->ctl_resp)) {
|
|
|
|
+ /* this is a fatal error, target should not be
|
|
|
|
+ * sending unsolicited messages on the ep 0
|
|
|
|
+ */
|
|
|
|
+ ath10k_warn(ar, "HTC rx ctrl still processing\n");
|
|
|
|
+ complete(&htc->ctl_resp);
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ htc->control_resp_len =
|
|
|
|
+ min_t(int, skb->len,
|
|
|
|
+ ATH10K_HTC_MAX_CTRL_MSG_LEN);
|
|
|
|
+
|
|
|
|
+ memcpy(htc->control_resp_buffer, skb->data,
|
|
|
|
+ htc->control_resp_len);
|
|
|
|
+
|
|
|
|
+ complete(&htc->ctl_resp);
|
|
|
|
+ break;
|
|
|
|
+ case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
|
|
|
|
+ htc->htc_ops.target_send_suspend_complete(ar);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+out:
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
}
|
|
}
|
|
|
|
|