mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-24 21:02:35 +00:00
120 lines
4.3 KiB
Diff
120 lines
4.3 KiB
Diff
From f0b4f1d44ad3b46f4b2757aedcbf6bdb35264196 Mon Sep 17 00:00:00 2001
|
|
From: Aishwarya R <quic_aisr@quicinc.com>
|
|
Date: Fri, 8 Apr 2022 17:48:31 +0530
|
|
Subject: [PATCH] ath12k porting 6g regulatory changes
|
|
|
|
Added missed declaration and definition for 6 GHZ regulatory
|
|
with new client and power type
|
|
|
|
Signed-off-by: Aishwarya R <quic_aisr@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath12k/core.h | 9 +++++++++
|
|
drivers/net/wireless/ath/ath12k/reg.c | 13 ++++++++++++-
|
|
drivers/net/wireless/ath/ath12k/wmi.c | 8 ++------
|
|
drivers/net/wireless/ath/ath12k/wmi.h | 5 +++++
|
|
4 files changed, 28 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
|
|
index c36ee45..ac3ad74 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/core.h
|
|
+++ b/drivers/net/wireless/ath/ath12k/core.h
|
|
@@ -781,6 +781,12 @@ struct ath12k_soc_dp_stats {
|
|
struct ath12k_dp_ring_bp_stats bp_stats;
|
|
};
|
|
|
|
+struct ath12k_reg_rule {
|
|
+ u32 start_freq;
|
|
+ u32 end_freq;
|
|
+};
|
|
+
|
|
+
|
|
/* Master structure to hold the hw data which may be used in core module */
|
|
struct ath12k_base {
|
|
enum ath12k_hw_rev hw_rev;
|
|
@@ -851,6 +857,9 @@ struct ath12k_base {
|
|
|
|
/* Current DFS Regulatory */
|
|
enum ath12k_dfs_region dfs_region;
|
|
+ struct ath12k_reg_rule reg_rule_2g;
|
|
+ struct ath12k_reg_rule reg_rule_5g;
|
|
+ struct ath12k_reg_rule reg_rule_6g;
|
|
#ifdef CPTCFG_ATH12K_DEBUGFS
|
|
struct dentry *debugfs_soc;
|
|
#endif
|
|
diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c
|
|
index ffd14eb..99a4d82 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/reg.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/reg.c
|
|
@@ -43,6 +43,17 @@ ath12k_ieee80211_ap_pwr_type_convert(enum ieee80211_ap_reg_power power_type)
|
|
}
|
|
}
|
|
|
|
+static void ath12k_copy_reg_rule(struct ath12k_reg_rule *ath12k_reg_rule,
|
|
+ struct cur_reg_rule *reg_rule)
|
|
+{
|
|
+ if (!ath12k_reg_rule->start_freq)
|
|
+ ath12k_reg_rule->start_freq = reg_rule->start_freq;
|
|
+
|
|
+ if ((!ath12k_reg_rule->end_freq) ||
|
|
+ (ath12k_reg_rule->end_freq < reg_rule->end_freq))
|
|
+ ath12k_reg_rule->end_freq = reg_rule->end_freq;
|
|
+}
|
|
+
|
|
static struct cur_reg_rule
|
|
*ath12k_get_active_6g_reg_rule(struct cur_regulatory_info *reg_info,
|
|
u32 *max_bw_6g, int *max_elements,
|
|
@@ -781,7 +792,7 @@ ath12k_reg_build_regd(struct ath12k_base *ab,
|
|
reg_rule->start_freq,
|
|
reg_rule->end_freq, max_bw,
|
|
reg_rule->ant_gain, reg_rule->reg_power,
|
|
- flags);
|
|
+ reg_rule->psd_eirp, flags, pwr_mode);
|
|
|
|
/* Update dfs cac timeout if the dfs domain is ETSI and the
|
|
* new rule covers weather radar band.
|
|
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
|
|
index 6389c6c..360d44d 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
|
@@ -6238,8 +6238,7 @@ retfail:
|
|
}
|
|
|
|
|
|
-static int ath12k_reg_chan_list_event(struct ath12k_base *ab, struct sk_buff *skb,
|
|
- enum wmi_reg_chan_list_cmd_type id)
|
|
+static int ath12k_reg_chan_list_event(struct ath12k_base *ab, struct sk_buff *skb)
|
|
{
|
|
struct cur_regulatory_info *reg_info;
|
|
int ret, i, j;
|
|
@@ -6248,10 +6247,7 @@ static int ath12k_reg_chan_list_event(struct ath12k_base *ab, struct sk_buff *sk
|
|
if (!reg_info)
|
|
return -ENOMEM;
|
|
|
|
- if (id == WMI_REG_CHAN_LIST_CC_ID)
|
|
- ret = ath12k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
|
|
- else
|
|
- ret = ath12k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
|
|
+ ret = ath12k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
|
|
|
|
if (ret) {
|
|
ath12k_warn(ab, "failed to extract regulatory info from received event\n");
|
|
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
|
|
index c840228..b7497e8 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
|
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
|
@@ -4208,6 +4208,11 @@ struct wmi_regulatory_rule_struct {
|
|
|
|
#define WMI_REG_CLIENT_MAX 4
|
|
|
|
+enum wmi_reg_chan_list_cmd_type {
|
|
+ WMI_REG_CHAN_LIST_CC_ID = 0,
|
|
+ WMI_REG_CHAN_LIST_CC_EXT_ID = 1,
|
|
+};
|
|
+
|
|
struct wmi_reg_chan_list_cc_ext_event {
|
|
u32 status_code;
|
|
u32 phy_id;
|
|
--
|
|
2.17.1
|
|
|