Sfoglia il codice sorgente

qcacmn: Find EN302_502 applicable domains from regulatory

The EN302_502 radar pattern is applicable in a predefined list of
regulatory domains (defined in DFS component). During radar table attach,
the current regulatory domain is checked if it is one of the
applicable regulatory domains.
The predefined EN302_502 applicable domains are:
ETSI11_WORLD
ETSI12_WORLD
ETSI13_WORLD
ETSI14_WORLD

Predefining these regulatory domain pair values in DFS component will
affect future regulatory updates that modify/add regulatory domains
to this list. Also, as per regulatory update #27, ETSI13_WORLD is not
EN302_502 applicable and ETSI15_WORLD is EN302_502 applicable.

Introduce a regulatory API(is_regdmn_en302502_applicable()) that finds if
the current regulatory domain pair is one of the EN302_502
applicable domains.
Modify the EN302_502 applicable regulatory domains as follows:
ETSI11_WORLD
ETSI12_WORLD
ETSI14_WORLD
ETSI15_WORLD

CRs-Fixed: 2390875
Change-Id: I78839a796eeb53a6b06b9fe66e8cae58de8838fa
Vignesh Mohan 5 anni fa
parent
commit
6cd3c0f9f9

+ 0 - 6
umac/dfs/core/src/dfs.h

@@ -321,12 +321,6 @@
 #define NUM_BINS 128
 #define THOUSAND 1000
 
-/* ETSI11_WORLD regdmn pair id */
-#define ETSI11_WORLD_REGDMN_PAIR_ID 0x26
-#define ETSI12_WORLD_REGDMN_PAIR_ID 0x28
-#define ETSI13_WORLD_REGDMN_PAIR_ID 0x27
-#define ETSI14_WORLD_REGDMN_PAIR_ID 0x29
-
 /* Array offset to ETSI legacy pulse */
 #define ETSI_LEGACY_PULSE_ARR_OFFSET 2
 

+ 1 - 7
umac/dfs/core/src/filtering/dfs_init.c

@@ -436,7 +436,6 @@ bool dfs_is_en302_502_applicable(struct wlan_dfs *dfs)
 	int chan_freq;
 	int chan_width;
 	int overlap = 0;
-	uint16_t regdmn;
 	struct wlan_objmgr_vdev *vdev = NULL;
 	struct wlan_channel *bss_chan = NULL;
 
@@ -478,11 +477,6 @@ bool dfs_is_en302_502_applicable(struct wlan_dfs *dfs)
 				ETSI_RADAR_EN302_502_FREQ_UPPER);
 	}
 
-	regdmn = utils_dfs_get_cur_rd(dfs->dfs_pdev_obj);
-
-	return(((regdmn == ETSI11_WORLD_REGDMN_PAIR_ID) ||
-		(regdmn == ETSI12_WORLD_REGDMN_PAIR_ID) ||
-		(regdmn == ETSI13_WORLD_REGDMN_PAIR_ID) ||
-		(regdmn == ETSI14_WORLD_REGDMN_PAIR_ID)) &&
+	return(wlan_reg_is_regdmn_en302502_applicable(dfs->dfs_pdev_obj) &&
 	       overlap);
 }

+ 8 - 0
umac/regulatory/core/src/reg_db.c

@@ -1386,3 +1386,11 @@ bool reg_etsi13_regdmn(uint8_t reg_dmn)
 {
 	return reg_dmn == ETSI13;
 }
+
+bool reg_en302_502_regdmn(uint16_t regdmn)
+{
+	return ((regdmn == ETSI11_WORLD) ||
+		(regdmn == ETSI12_WORLD) ||
+		(regdmn == ETSI14_WORLD) ||
+		(regdmn == ETSI15_WORLD));
+}

+ 8 - 0
umac/regulatory/core/src/reg_db.h

@@ -101,4 +101,12 @@ QDF_STATUS reg_get_default_country(uint16_t *default_country);
  * Return: true or false
  */
 bool reg_etsi13_regdmn(uint8_t reg_dmn);
+
+/**
+ * reg_en302_502_regdmn() - Check if the reg domain is en302_502 applicable.
+ * @reg_dmn: Regulatory domain pair ID.
+ *
+ * Return: True if EN302_502 applicable, else false.
+ */
+bool reg_en302_502_regdmn(uint16_t reg_dmn);
 #endif

+ 14 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -2009,3 +2009,17 @@ QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev,
 
 	return status;
 }
+
+bool reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev)
+{
+	struct cur_regdmn_info cur_reg_dmn;
+	QDF_STATUS status;
+
+	status = reg_get_curr_regdomain(pdev, &cur_reg_dmn);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_err("Failed to get reg domain");
+		return false;
+	}
+
+	return reg_en302_502_regdmn(cur_reg_dmn.regdmn_pair_id);
+}

+ 9 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -505,4 +505,13 @@ uint32_t reg_max_5ghz_ch_num(void);
  * Return: QDF_STATUS
  */
 QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, bool enable);
+
+/**
+ * reg_is_regdmn_en302502_applicable() - Find if ETSI EN302_502 radar pattern
+ * is applicable in current regulatory domain.
+ * @pdev: Pdev object pointer.
+ *
+ * Return: True if en302_502 is applicable, else false.
+ */
+bool reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev);
 #endif

+ 11 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -692,4 +692,15 @@ void wlan_reg_update_nol_history_ch(struct wlan_objmgr_pdev *pdev,
 				    uint8_t *ch_list,
 				    uint8_t num_ch,
 				    bool nol_history_ch);
+
+/**
+ * wlan_reg_is_regdmn_en302502_applicable() - Find if ETSI EN302_502 radar
+ * pattern is applicable in the current regulatory domain.
+ * @pdev:    Pdev ptr.
+ *
+ * Return: Boolean.
+ * True:  If EN302_502 is applicable.
+ * False: otherwise.
+ */
+bool wlan_reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev);
 #endif

+ 5 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -708,3 +708,8 @@ enum channel_enum wlan_reg_get_chan_enum(uint32_t chan_num)
 {
 	return reg_get_chan_enum(chan_num);
 }
+
+bool wlan_reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev)
+{
+	return reg_is_regdmn_en302502_applicable(pdev);
+}