Browse Source

qcacmn: ETSI 302-502 Radar Pattern for ETSI11

According to the updates of Regdomain_23 submitted on 2017-5-18,
added two pulses (ETSI 302-502) in the static ETSI radar table for
ETSI11 regdomain.These two pulses are applicable only for 5.8GHz
(greater than 5.725 GHz)  channels.

Change-Id: I2f1e5535040ced9847eedff65dbe892e4d0fb056
CRs-Fixed: 2145124
Shashikala Prabhu 7 years ago
parent
commit
d9bf209f70

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

@@ -280,6 +280,16 @@
 #define NUM_BINS 128
 #define THOUSAND 1000
 
+/* Check if the dfs current channel is 5.8GHz */
+#define DFS_CURCHAN_IS_58GHz(freq) \
+	((((freq) >= 5745) && ((freq) <= 5865)) ? true : false)
+
+/* ETSI11_WORLD regdmn pair id */
+#define ETSI11_WORLD_REGDMN_PAIR_ID 0x26
+
+/* Array offset to ETSI legacy pulse */
+#define ETSI_LEGACY_PULSE_ARR_OFFSET 2
+
 /**
  * struct dfs_pulseparams - DFS pulse param structure.
  * @p_time:        Time for start of pulse in usecs.

+ 23 - 2
umac/dfs/core/src/filtering/ar5212_radar.c

@@ -39,6 +39,12 @@
  *                                       AR5212 chipset.
  */
 struct dfs_pulse ar5212_etsi_radars[] = {
+	/* EN 302 502 frequency hopping pulse */
+	/* PRF 3000, 1us duration, 9 pulses per burst */
+	{9,   1, 3000, 3000, 1,  4,  5,  0,  1, 18,  0, 0, 1,  1000, 0, 40},
+	/* PRF 4500, 20us duration, 9 pulses per burst */
+	{9,  20, 4500, 4500, 1,  4,  5, 19, 21, 18,  0, 0, 1,  1000, 0, 41},
+
 	/* TYPE 1 */
 	{10, 2,   750,  0, 24, 50,  0,  2, 22,  0, 3, 0, 0},
 
@@ -165,6 +171,8 @@ void dfs_get_radars_for_ar5212(struct wlan_dfs *dfs)
 {
 	struct wlan_dfs_radar_tab_info rinfo;
 	int dfsdomain = DFS_FCC_DOMAIN;
+	uint16_t ch_freq;
+	uint16_t regdmn;
 
 	qdf_mem_zero(&rinfo, sizeof(rinfo));
 	dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
@@ -181,8 +189,21 @@ void dfs_get_radars_for_ar5212(struct wlan_dfs *dfs)
 	case DFS_ETSI_DOMAIN:
 		dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_5412");
 		rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-		rinfo.dfs_radars = &ar5212_etsi_radars[0];
-		rinfo.numradars = QDF_ARRAY_SIZE(ar5212_etsi_radars);
+
+		ch_freq = dfs->dfs_curchan->dfs_ch_freq;
+		regdmn = utils_dfs_get_cur_rd(dfs->dfs_pdev_obj);
+
+		if ((regdmn == ETSI11_WORLD_REGDMN_PAIR_ID) &&
+				DFS_CURCHAN_IS_58GHz(ch_freq)) {
+			rinfo.dfs_radars = ar5212_etsi_radars;
+			rinfo.numradars = QDF_ARRAY_SIZE(ar5212_etsi_radars);
+		} else {
+			uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
+
+			rinfo.dfs_radars = &ar5212_etsi_radars[offset];
+			rinfo.numradars =
+				QDF_ARRAY_SIZE(ar5212_etsi_radars) - offset;
+		}
 		rinfo.b5pulses = &ar5212_bin5pulses[0];
 		rinfo.numb5radars = QDF_ARRAY_SIZE(ar5212_bin5pulses);
 		break;

+ 25 - 2
umac/dfs/core/src/filtering/ar5416_radar.c

@@ -43,6 +43,13 @@
  *                                       AR5416 chipset.
  */
 struct dfs_pulse ar5416_etsi_radars[] = {
+
+	/* EN 302 502 frequency hopping pulse */
+	/* PRF 3000, 1us duration, 9 pulses per burst */
+	{9,   1, 3000, 3000, 1,  4,  5,  0,  1, 18,  0, 0, 1,  1000, 0, 40},
+	/* PRF 4500, 20us duration, 9 pulses per burst */
+	{9,  20, 4500, 4500, 1,  4,  5, 19, 21, 18,  0, 0, 1,  1000, 0, 41},
+
 	/* TYPE staggered pulse */
 	/* 0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each */
 	{20,  2,  300,  400, 2, 30,  4,  0,  2, 15, 0,   0, 0, 0, 0, 31},
@@ -108,6 +115,8 @@ void dfs_get_radars_for_ar5416(struct wlan_dfs *dfs)
 {
 	struct wlan_dfs_radar_tab_info rinfo;
 	int dfsdomain = DFS_FCC_DOMAIN;
+	uint16_t ch_freq;
+	uint16_t regdmn;
 
 	qdf_mem_zero(&rinfo, sizeof(rinfo));
 	dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
@@ -124,8 +133,22 @@ void dfs_get_radars_for_ar5416(struct wlan_dfs *dfs)
 	case DFS_ETSI_DOMAIN:
 		dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_5416");
 		rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-		rinfo.dfs_radars = &ar5416_etsi_radars[0];
-		rinfo.numradars = QDF_ARRAY_SIZE(ar5416_etsi_radars);
+
+		ch_freq = dfs->dfs_curchan->dfs_ch_freq;
+		regdmn = utils_dfs_get_cur_rd(dfs->dfs_pdev_obj);
+
+		if ((regdmn == ETSI11_WORLD_REGDMN_PAIR_ID) &&
+				DFS_CURCHAN_IS_58GHz(ch_freq)) {
+			rinfo.dfs_radars = ar5416_etsi_radars;
+			rinfo.numradars = QDF_ARRAY_SIZE(ar5416_etsi_radars);
+		} else {
+			uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
+
+			rinfo.dfs_radars = &ar5416_etsi_radars[offset];
+			rinfo.numradars =
+				QDF_ARRAY_SIZE(ar5416_etsi_radars) - offset;
+		}
+
 		rinfo.b5pulses = &ar5416_bin5pulses[0];
 		rinfo.numb5radars = QDF_ARRAY_SIZE(ar5416_bin5pulses);
 		break;

+ 25 - 2
umac/dfs/core/src/filtering/ar9300_radar.c

@@ -57,6 +57,13 @@
  * as the estimated RSSI.
  */
 struct dfs_pulse ar9300_etsi_radars[] = {
+
+	/* EN 302 502 frequency hopping pulse */
+	/* PRF 3000, 1us duration, 9 pulses per burst */
+	{9,   1, 3000, 3000, 1,  4,  5,  0,  1, 18,  0, 0, 1,  1000, 0, 40},
+	/* PRF 4500, 20us duration, 9 pulses per burst */
+	{9,  20, 4500, 4500, 1,  4,  5, 19, 21, 18,  0, 0, 1,  1000, 0, 41},
+
 	/* TYPE staggered pulse */
 	/* Type 5*/
 	/* 0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each */
@@ -163,6 +170,8 @@ void dfs_get_radars_for_ar9300(struct wlan_dfs *dfs)
 {
 	struct wlan_dfs_radar_tab_info rinfo;
 	int dfsdomain = DFS_FCC_DOMAIN;
+	uint16_t ch_freq;
+	uint16_t regdmn;
 
 	qdf_mem_zero(&rinfo, sizeof(rinfo));
 	dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
@@ -182,8 +191,22 @@ void dfs_get_radars_for_ar9300(struct wlan_dfs *dfs)
 	case DFS_ETSI_DOMAIN:
 		dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_9300");
 		rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-		rinfo.dfs_radars = &ar9300_etsi_radars[0];
-		rinfo.numradars = QDF_ARRAY_SIZE(ar9300_etsi_radars);
+
+		ch_freq = dfs->dfs_curchan->dfs_ch_freq;
+		regdmn = utils_dfs_get_cur_rd(dfs->dfs_pdev_obj);
+
+		if ((regdmn == ETSI11_WORLD_REGDMN_PAIR_ID) &&
+				DFS_CURCHAN_IS_58GHz(ch_freq)) {
+			rinfo.dfs_radars = ar9300_etsi_radars;
+			rinfo.numradars = QDF_ARRAY_SIZE(ar9300_etsi_radars);
+		} else {
+			uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
+
+			rinfo.dfs_radars = &ar9300_etsi_radars[offset];
+			rinfo.numradars =
+				QDF_ARRAY_SIZE(ar9300_etsi_radars) - offset;
+		}
+
 		rinfo.b5pulses = &ar9300_bin5pulses[0];
 		rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
 		break;

+ 23 - 2
umac/dfs/core/src/filtering/dfs_radar.c

@@ -157,6 +157,12 @@ struct dfs_bin5pulse dfs_jpn_bin5pulses_qca9984[] = {
  */
 struct dfs_pulse dfs_etsi_radars[] = {
 
+	/* EN 302 502 frequency hopping pulse */
+	/* PRF 3000, 1us duration, 9 pulses per burst */
+	{9,   1, 3000, 3000, 1,  4,  5,  0,  1, 18,  0, 0, 1,  1000, 0, 40},
+	/* PRF 4500, 20us duration, 9 pulses per burst */
+	{9,  20, 4500, 4500, 1,  4,  5, 19, 21, 18,  0, 0, 1,  1000, 0, 41},
+
 	/* TYPE staggered pulse */
 	/* Type 5*/
 	/* 0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each */
@@ -280,6 +286,8 @@ void ol_if_dfs_configure(struct wlan_dfs *dfs)
 	int i;
 	uint32_t target_type;
 	int dfsdomain = DFS_FCC_DOMAIN;
+	uint16_t ch_freq;
+	uint16_t regdmn;
 
 	/* Fetch current radar patterns from the lmac */
 	qdf_mem_zero(&rinfo, sizeof(rinfo));
@@ -322,8 +330,21 @@ void ol_if_dfs_configure(struct wlan_dfs *dfs)
 	case DFS_ETSI_DOMAIN:
 		dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "ETSI domain");
 		rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-		rinfo.dfs_radars = dfs_etsi_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_etsi_radars);
+
+		ch_freq = dfs->dfs_curchan->dfs_ch_freq;
+		regdmn = utils_dfs_get_cur_rd(dfs->dfs_pdev_obj);
+
+		if ((regdmn == ETSI11_WORLD_REGDMN_PAIR_ID) &&
+				DFS_CURCHAN_IS_58GHz(ch_freq)) {
+			rinfo.dfs_radars = dfs_etsi_radars;
+			rinfo.numradars = QDF_ARRAY_SIZE(dfs_etsi_radars);
+		} else {
+			uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
+
+			rinfo.dfs_radars = &dfs_etsi_radars[offset];
+			rinfo.numradars =
+				QDF_ARRAY_SIZE(dfs_etsi_radars) - offset;
+		}
 		rinfo.b5pulses = NULL;
 		rinfo.numb5radars = 0;
 		break;

+ 8 - 0
umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h

@@ -430,4 +430,12 @@ QDF_STATUS utils_dfs_update_cur_chan_flags(struct wlan_objmgr_pdev *pdev,
  */
 int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev);
 
+/**
+ * utils_dfs_get_cur_rd() - Get current regdomain.
+ * @pdev: pdev ptr
+ *
+ * Return: Regdomain pair id.
+ */
+uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev);
+
 #endif /* _WLAN_DFS_UTILS_API_H_ */

+ 9 - 0
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -853,3 +853,12 @@ int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev)
 
 	return dfsdomain;
 }
+
+uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev)
+{
+	struct cur_regdmn_info cur_regdmn;
+
+	wlan_reg_get_curr_regdomain(pdev, &cur_regdmn);
+
+	return cur_regdmn.regdmn_pair_id;
+}

+ 1 - 1
umac/regulatory/core/src/reg_db.c

@@ -755,7 +755,7 @@ const struct regulatory_rule reg_rules_5g[] = {
 	[CHAN_5735_5835_5] = {5735, 5835, 80, 20, REGULATORY_CHAN_NO_IR},
 	[CHAN_5735_5835_6] = {5735, 5835, 80, 24, 0},
 	[CHAN_5735_5835_7] = {5735, 5835, 80, 36, 0},
-	[CHAN_5735_5875_1] = {5735, 5875, 20, 27, 0},
+	[CHAN_5735_5875_1] = {5735, 5875, 20, 27, REGULATORY_CHAN_RADAR},
 	[CHAN_5735_5875_2] = {5735, 5875, 20, 30, 0},
 	[CHAN_5735_5875_3] = {5735, 5875, 80, 30, 0},
 	[CHAN_5735_5815_1] = {5735, 5815, 80, 30, 0},