wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/750-03-ath12k-Add-support-to-send-service-class-params.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

121 lines
3.3 KiB
Diff

From ba2da215e8896375b83a16e6e05bff8fbadc83fe Mon Sep 17 00:00:00 2001
From: Nagarajan Maran <quic_nmaran@quicinc.com>
Date: Mon, 7 Nov 2022 18:40:12 +0530
Subject: [PATCH] ath12k: Adding support to send service class params for all
SOC
Each service class will be sent to all the socs since they
need to be identical across all the chips and so are stored
globally too.
Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.c | 66 ++++++++++++++++++++
drivers/net/wireless/ath/ath12k/core.h | 4 ++
drivers/net/wireless/ath/ath12k/mac.c | 85 ++++++++++++++++++++++++++
drivers/net/wireless/ath/ath12k/mac.h | 3 +
4 files changed, 158 insertions(+)
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1872,6 +1872,8 @@ static void ath12k_core_restart(struct w
}
}
+ if (ath12k_sawf_reconfigure_on_crash(ab))
+ ath12k_warn(ab, "SAWF SLA reconfiguring failed\n");
}
static void ath12k_core_reset(struct work_struct *work)
@@ -2303,6 +2305,72 @@ err_sc_free:
return NULL;
}
+int ath12k_send_sawf_configs_soc(struct ath12k_sawf_svc_params *new_param)
+{
+ struct ath12k_hw_group *ag;
+ struct ath12k_base *ab;
+ struct ath12k *ar;
+ int soc, ret = 0;
+
+ mutex_lock(&ath12k_hw_lock);
+ list_for_each_entry(ag, &ath12k_hw_groups, list) {
+ if (!ag) {
+ ath12k_warn(NULL, "unable to fetch hw group\n");
+ mutex_unlock(&ath12k_hw_lock);
+ return -ENODEV;
+ }
+ for (soc = ag->num_probed; soc > 0; soc--) {
+ ab = ag->ab[soc - 1];
+ ar = ab->pdevs[0].ar;
+ if (!ar) {
+ /* Control should not reach here */
+ ath12k_info(ab, "Radio not initialized in the SOC\n");
+ continue;
+ }
+ ret = ath12k_wmi_svc_config_send(ar, new_param);
+ if (ret) {
+ mutex_unlock(&ath12k_hw_lock);
+ return ret;
+ }
+ }
+ }
+ mutex_unlock(&ath12k_hw_lock);
+ return ret;
+}
+
+int ath12k_sawf_send_disable_soc(u8 svc_id)
+{
+ struct ath12k_hw_group *ag;
+ struct ath12k_base *ab;
+ struct ath12k *ar;
+ int soc, ret = 0;
+
+ mutex_lock(&ath12k_hw_lock);
+ list_for_each_entry(ag, &ath12k_hw_groups, list) {
+ if (!ag) {
+ ath12k_warn(NULL, "unable to fetch hw group\n");
+ mutex_unlock(&ath12k_hw_lock);
+ return -ENODEV;
+ }
+ for (soc = ag->num_probed; soc > 0; soc--) {
+ ab = ag->ab[soc - 1];
+ ar = ab->pdevs[0].ar;
+ if (!ar) {
+ /* Control should not reach here */
+ ath12k_info(ab, "Radio not initialized in the SOC\n");
+ continue;
+ }
+ ret = ath12k_wmi_svc_send_disable(ar, svc_id);
+ if (ret) {
+ mutex_unlock(&ath12k_hw_lock);
+ return ret;
+ }
+ }
+ }
+ mutex_unlock(&ath12k_hw_lock);
+ return ret;
+}
+
static int ath12k_init(void)
{
int ret;
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -15390,4 +15390,3 @@ void ath12k_mac_background_dfs_event(str
ret);
}
}
-
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -1474,6 +1474,8 @@ void ath12k_fw_stats_pdevs_free(struct l
void ath12k_fw_stats_bcn_free(struct list_head *head);
void ath12k_fw_stats_reset(struct ath12k *ar);
void ath12k_fw_stats_free(struct ath12k_fw_stats *stats);
+int ath12k_send_sawf_configs_soc(struct ath12k_sawf_svc_params *new_param);
+int ath12k_sawf_send_disable_soc(u8 svc_id);
static inline const char *ath12k_scan_state_str(enum ath12k_scan_state state)
{