Skip to content

Commit e3a91f8

Browse files
Rajkumar Manoharankvalo
authored andcommitted
ath10k: register ath10k_htt_htc_t2h_msg_handler
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 <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 3128b3d commit e3a91f8

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

drivers/net/wireless/ath/ath10k/htt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int ath10k_htt_connect(struct ath10k_htt *htt)
149149
memset(&conn_resp, 0, sizeof(conn_resp));
150150

151151
conn_req.ep_ops.ep_tx_complete = ath10k_htt_htc_tx_complete;
152-
conn_req.ep_ops.ep_rx_complete = ath10k_htt_t2h_msg_handler;
152+
conn_req.ep_ops.ep_rx_complete = ath10k_htt_htc_t2h_msg_handler;
153153

154154
/* connect to control service */
155155
conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG;

drivers/net/wireless/ath/ath10k/htt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,8 @@ int ath10k_htt_rx_ring_refill(struct ath10k *ar);
17651765
void ath10k_htt_rx_free(struct ath10k_htt *htt);
17661766

17671767
void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
1768-
void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
1768+
void ath10k_htt_htc_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
1769+
bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
17691770
int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
17701771
int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
17711772
int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);

drivers/net/wireless/ath/ath10k/htt_rx.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,18 @@ static inline enum ieee80211_band phy_mode_to_band(u32 phy_mode)
22192219
return band;
22202220
}
22212221

2222-
void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
2222+
void ath10k_htt_htc_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
2223+
{
2224+
bool release;
2225+
2226+
release = ath10k_htt_t2h_msg_handler(ar, skb);
2227+
2228+
/* Free the indication buffer */
2229+
if (release)
2230+
dev_kfree_skb_any(skb);
2231+
}
2232+
2233+
bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
22232234
{
22242235
struct ath10k_htt *htt = &ar->htt;
22252236
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)
22352246
if (resp->hdr.msg_type >= ar->htt.t2h_msg_types_max) {
22362247
ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx, unsupported msg_type: 0x%0X\n max: 0x%0X",
22372248
resp->hdr.msg_type, ar->htt.t2h_msg_types_max);
2238-
dev_kfree_skb_any(skb);
2239-
return;
2249+
return true;
22402250
}
22412251
type = ar->htt.t2h_msg_types[resp->hdr.msg_type];
22422252

@@ -2352,7 +2362,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
23522362
case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: {
23532363
skb_queue_tail(&htt->rx_in_ord_compl_q, skb);
23542364
tasklet_schedule(&htt->txrx_compl_task);
2355-
return;
2365+
return false;
23562366
}
23572367
case HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND:
23582368
break;
@@ -2394,9 +2404,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
23942404
skb->data, skb->len);
23952405
break;
23962406
};
2397-
2398-
/* Free the indication buffer */
2399-
dev_kfree_skb_any(skb);
2407+
return true;
24002408
}
24012409
EXPORT_SYMBOL(ath10k_htt_t2h_msg_handler);
24022410

0 commit comments

Comments
 (0)