ath10k: register ath10k_htt_htc_t2h_msg_handler
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Tue, 22 Mar 2016 11:52:16 +0000 (17:22 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 4 Apr 2016 14:03:20 +0000 (17:03 +0300)
Except qca61x4 family chips (qca6164, qca6174), copy engine 5 is used
for receiving target to host htt messages. In follow up patch, CE5
descriptors will be reused. In such case, same API can not be used as
htc layer callback where the response messages will be freed at the end.
Hence register new API for HTC layer that free up received message and
keep the message handler common for both HTC and HIF layers.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt.c
drivers/net/wireless/ath/ath10k/htt.h
drivers/net/wireless/ath/ath10k/htt_rx.c

index 7561f22f10f9c92266e4e73d6826f465acd0f361..17a3008d9ab16d6aa38f3cc03fda6ad840b92488 100644 (file)
@@ -149,7 +149,7 @@ int ath10k_htt_connect(struct ath10k_htt *htt)
        memset(&conn_resp, 0, sizeof(conn_resp));
 
        conn_req.ep_ops.ep_tx_complete = ath10k_htt_htc_tx_complete;
-       conn_req.ep_ops.ep_rx_complete = ath10k_htt_t2h_msg_handler;
+       conn_req.ep_ops.ep_rx_complete = ath10k_htt_htc_t2h_msg_handler;
 
        /* connect to control service */
        conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG;
index 27a65ecba7b056e0cd2f8e35086e0e3fe4ff69e9..1adcae4faccf878ddaded76d729569f2a665a402 100644 (file)
@@ -1765,7 +1765,8 @@ int ath10k_htt_rx_ring_refill(struct ath10k *ar);
 void ath10k_htt_rx_free(struct ath10k_htt *htt);
 
 void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
-void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
+void ath10k_htt_htc_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
+bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
 int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
 int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
 int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
index 6c616a36c4c4f6b5522203c0636d4937129d0d0e..ac16ce746afb6aacd6196659ac3252ba2ecc43b0 100644 (file)
@@ -2219,7 +2219,18 @@ static inline enum ieee80211_band phy_mode_to_band(u32 phy_mode)
        return band;
 }
 
-void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
+void ath10k_htt_htc_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
+{
+       bool release;
+
+       release = ath10k_htt_t2h_msg_handler(ar, skb);
+
+       /* Free the indication buffer */
+       if (release)
+               dev_kfree_skb_any(skb);
+}
+
+bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 {
        struct ath10k_htt *htt = &ar->htt;
        struct htt_resp *resp = (struct htt_resp *)skb->data;
@@ -2235,8 +2246,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
        if (resp->hdr.msg_type >= ar->htt.t2h_msg_types_max) {
                ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx, unsupported msg_type: 0x%0X\n max: 0x%0X",
                           resp->hdr.msg_type, ar->htt.t2h_msg_types_max);
-               dev_kfree_skb_any(skb);
-               return;
+               return true;
        }
        type = ar->htt.t2h_msg_types[resp->hdr.msg_type];
 
@@ -2352,7 +2362,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
        case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: {
                skb_queue_tail(&htt->rx_in_ord_compl_q, skb);
                tasklet_schedule(&htt->txrx_compl_task);
-               return;
+               return false;
        }
        case HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND:
                break;
@@ -2394,9 +2404,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
                                skb->data, skb->len);
                break;
        };
-
-       /* Free the indication buffer */
-       dev_kfree_skb_any(skb);
+       return true;
 }
 EXPORT_SYMBOL(ath10k_htt_t2h_msg_handler);