mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
74 lines
2.5 KiB
Diff
74 lines
2.5 KiB
Diff
From 69356d5f6947c8a6182e1c6283478ad40c6df37b Mon Sep 17 00:00:00 2001
|
|
From: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
|
|
Date: Wed, 21 Jun 2023 20:26:02 +0530
|
|
Subject: [PATCH] ath11k: Add nss event handler support for link desc
|
|
|
|
Add NSS event handler support for NSS_WIFILI_LINK_DESC_INFO_MSG.
|
|
This event will be given to host from NSS for releasing
|
|
link descriptor which used for fragmentation. This needs to be
|
|
handled to release the link descriptor back to hardware for
|
|
other usage.
|
|
|
|
Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/nss.c | 43 +++++++++++++++++++++++++++
|
|
1 file changed, 43 insertions(+)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/nss.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/nss.c
|
|
@@ -100,6 +100,43 @@ static void ath11k_nss_wifili_stats_sync
|
|
spin_unlock_bh(&ab->base_lock);
|
|
}
|
|
|
|
+static void ath11k_nss_wifili_link_desc_set(struct ath11k_base *ab, void *desc,
|
|
+ struct ath11k_buffer_addr *buf_addr_info,
|
|
+ enum hal_wbm_rel_bm_act action)
|
|
+{
|
|
+ struct hal_wbm_release_ring *dst_desc = desc;
|
|
+
|
|
+ dst_desc->buf_addr_info = *buf_addr_info;
|
|
+ dst_desc->info0 |= FIELD_PREP(HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE,
|
|
+ HAL_WBM_REL_SRC_MODULE_SW) |
|
|
+ FIELD_PREP(HAL_WBM_RELEASE_INFO0_BM_ACTION, action) |
|
|
+ FIELD_PREP(HAL_WBM_RELEASE_INFO0_DESC_TYPE,
|
|
+ HAL_WBM_REL_DESC_TYPE_MSDU_LINK);
|
|
+}
|
|
+
|
|
+static void ath11k_nss_wifili_link_desc_return(struct ath11k_base *ab,
|
|
+ struct ath11k_buffer_addr *buf_addr_info)
|
|
+{
|
|
+ struct ath11k_dp *dp = &ab->dp;
|
|
+ struct hal_srng *srng;
|
|
+ u32 *desc;
|
|
+
|
|
+ srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id];
|
|
+ spin_lock_bh(&srng->lock);
|
|
+
|
|
+ ath11k_hal_srng_access_begin(ab, srng);
|
|
+ desc = ath11k_hal_srng_src_get_next_entry(ab, srng);
|
|
+
|
|
+ if (!desc)
|
|
+ goto exit;
|
|
+
|
|
+ ath11k_nss_wifili_link_desc_set(ab, desc, buf_addr_info, HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
|
|
+
|
|
+exit:
|
|
+ ath11k_hal_srng_access_end(ab, srng);
|
|
+ spin_unlock(&srng->lock);
|
|
+}
|
|
+
|
|
static void ath11k_nss_get_peer_stats(struct ath11k_base *ab, struct nss_wifili_peer_stats *stats)
|
|
{
|
|
struct ath11k_peer *peer;
|
|
@@ -370,6 +407,10 @@ void ath11k_nss_wifili_event_receive(str
|
|
ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "nss wifili mesh capability response %d\n",
|
|
ab->nss.mesh_nss_offload_enabled);
|
|
break;
|
|
+ case NSS_WIFILI_LINK_DESC_INFO_MSG:
|
|
+ ath11k_nss_wifili_link_desc_return(ab,
|
|
+ (void *)&msg->msg.linkdescinfomsg);
|
|
+ break;
|
|
default:
|
|
ath11k_dbg(ab, ATH11K_DBG_NSS, "unhandled event %d\n", msg_type);
|
|
break;
|