瀏覽代碼

qcacmn: Use global opclass for 6GHz channel lookup

For 6G band, only valid opclass_table is the global_op_class
as per the current specification. Therefore, if the band is 6G
set the opclass to global_op_class instead of the default class.

Change-Id: I43d1be8266aa80b11c446d84bc3d027cde8bebea
Abhiram Jogadenu 5 年之前
父節點
當前提交
928035a1a4

+ 11 - 0
umac/regulatory/core/src/reg_opclass.c

@@ -688,6 +688,17 @@ uint16_t reg_chan_opclass_to_freq(uint8_t chan,
 	return 0;
 }
 
+qdf_freq_t reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
+					 bool global_tbl_lookup)
+{
+	if ((op_class >= MIN_6GHZ_OPER_CLASS) &&
+	    (op_class <= MAX_6GHZ_OPER_CLASS)) {
+		global_tbl_lookup = true;
+	}
+
+	return reg_chan_opclass_to_freq(chan, op_class, global_tbl_lookup);
+}
+
 #ifdef HOST_OPCLASS_EXT
 qdf_freq_t reg_country_chan_opclass_to_freq(struct wlan_objmgr_pdev *pdev,
 					    const uint8_t country[3],

+ 20 - 0
umac/regulatory/core/src/reg_opclass.h

@@ -245,6 +245,19 @@ qdf_freq_t reg_country_chan_opclass_to_freq(struct wlan_objmgr_pdev *pdev,
 uint16_t reg_chan_opclass_to_freq(uint8_t chan,
 				  uint8_t op_class,
 				  bool global_tbl_lookup);
+
+/**
+ * reg_chan_opclass_to_freq_auto() - Convert channel number and opclass to
+ * frequency after fixing global_tbl_lookup
+ * @chan: IEEE Channel Number.
+ * @op_class: Opclass.
+ * @global_tbl_lookup: Global table lookup.
+ *
+ * Return: Channel center frequency else return 0.
+ */
+qdf_freq_t reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
+					 bool global_tbl_lookup);
+
 #else
 
 static inline uint16_t reg_dmn_get_chanwidth_from_opclass(
@@ -374,5 +387,12 @@ reg_chan_opclass_to_freq(uint8_t chan,
 	return 0;
 }
 
+static inline qdf_freq_t
+reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
+			      bool global_tbl_lookup)
+{
+	return 0;
+}
+
 #endif
 #endif

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

@@ -1309,4 +1309,17 @@ wlan_reg_country_chan_opclass_to_freq(struct wlan_objmgr_pdev *pdev,
 uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan,
 				       uint8_t op_class,
 				       bool global_tbl_lookup);
+
+/**
+ * wlan_reg_chan_opclass_to_freq_auto() - Convert channel number and opclass to
+ * frequency
+ * @chan: IEEE channel number
+ * @op_class: Operating class of channel
+ * @global_tbl_lookup: Flag to determine if global table has to be looked up
+ *
+ * Return: Channel center frequency if valid, else zero
+ */
+
+qdf_freq_t wlan_reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
+					      bool global_tbl_lookup);
 #endif

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

@@ -1102,3 +1102,12 @@ uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan,
 
 	return reg_chan_opclass_to_freq(chan, op_class, global_tbl_lookup);
 }
+
+qdf_freq_t wlan_reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
+					      bool global_tbl_lookup)
+{
+	if (!chan || !op_class)
+		return 0;
+
+	return reg_chan_opclass_to_freq_auto(chan, op_class, global_tbl_lookup);
+}