Преглед на файлове

qcacmn: Replace reg_is_chan_supported to use pwrmode API

The current channel list alone is not enough to represent the
capability of the chip or device. Given a channel, in many
cases it may be required to know all the power modes that are
supported by this channel.

Update callers of reg_is_chan_supported with super channel list.
reg_is_chan_supported to use the super channel list API
reg_is_chan_supported_for_pwrmode.

Change-Id: I5d33f7bb0bee6012c28d35e6138f5a03525c33ca
CRs-Fixed: 3357157
Vinod Kumar Myadam преди 2 години
родител
ревизия
c50244f2b8

+ 40 - 22
umac/regulatory/core/src/reg_opclass.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1556,25 +1556,24 @@ static inline qdf_freq_t reg_get_nearest_primary_freq(uint16_t bw,
  * @pri_freq: Primary frequency of the input channel
  * @cfi_freq: cfi frequency of the input channel
  * @ch_width: Input channel width
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: True if the channel is supported, else false
  */
 static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
 				  qdf_freq_t pri_freq,
 				  qdf_freq_t cfi_freq,
-				  enum phy_ch_width ch_width)
+				  enum phy_ch_width ch_width,
+				  enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	struct reg_channel_list chan_list;
 	qdf_freq_t center_320;
 	struct ch_params ch_params = {0};
 
 	center_320 = (ch_width == CH_WIDTH_320MHZ) ? cfi_freq : 0;
-	reg_fill_channel_list(pdev,
-			      pri_freq,
-			      0,
-			      ch_width,
-			      center_320,
-			      &chan_list, true);
+	reg_fill_channel_list_for_pwrmode(pdev, pri_freq, 0,
+					  ch_width, center_320, &chan_list,
+					  in_6g_pwr_mode, true);
 	ch_params = chan_list.chan_param[0];
 
 	if (ch_params.ch_width == ch_width)
@@ -1586,7 +1585,8 @@ static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
 static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
 				  qdf_freq_t pri_freq,
 				  qdf_freq_t cfi_freq,
-				  enum phy_ch_width ch_width)
+				  enum phy_ch_width ch_width,
+				  enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	struct ch_params ch_params = {0};
 
@@ -1604,13 +1604,16 @@ static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
  * @pdev: Pointer to pdev
  * @cfi_freq: cfi frequency
  * @bw: bandwidth
+ * @op_class: op_class
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: True if the cfi is supported, else false
  */
 static bool reg_is_cfi_supported(struct wlan_objmgr_pdev *pdev,
 				 qdf_freq_t cfi_freq,
 				 uint16_t bw,
-				 uint8_t op_class)
+				 uint8_t op_class,
+				 enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	enum phy_ch_width ch_width;
 	qdf_freq_t pri_freq;
@@ -1621,7 +1624,8 @@ static bool reg_is_cfi_supported(struct wlan_objmgr_pdev *pdev,
 	is_cfi_supported = reg_is_chan_supported(pdev,
 						 pri_freq,
 						 cfi_freq,
-						 ch_width);
+						 ch_width,
+						 in_6g_pwr_mode);
 
 	return is_cfi_supported;
 }
@@ -1634,6 +1638,7 @@ static bool reg_is_cfi_supported(struct wlan_objmgr_pdev *pdev,
  * @op_class_tbl: Pointer to op_class_tbl
  * @in_opclass_conf: input opclass configuration
  * Supported or not-supported by current HW mode
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Populate channels from opclass map to regdmn_ap_cap_opclass_t as supported
  * and non-supported channels for 6Ghz.
@@ -1644,7 +1649,8 @@ static void reg_get_cfis_from_opclassmap_for_6g(
 			struct wlan_objmgr_pdev *pdev,
 			struct regdmn_ap_cap_opclass_t *cap,
 			const struct reg_dmn_op_class_map_t *op_class_tbl,
-			enum opclass_config in_opclass_conf)
+			enum opclass_config in_opclass_conf,
+			enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	uint8_t n_sup_chans = 0, n_unsup_chans = 0, j;
 	const struct c_freq_lst *p_cfi_lst = op_class_tbl->p_cfi_lst_obj;
@@ -1660,7 +1666,8 @@ static void reg_get_cfis_from_opclassmap_for_6g(
 		is_cfi_supported = reg_is_cfi_supported(pdev,
 							cfi_freq,
 							bw,
-							op_class_tbl->op_class);
+							op_class_tbl->op_class,
+							in_6g_pwr_mode);
 		if (is_cfi_supported &&
 		    (in_opclass_conf == OPCLASSES_SUPPORTED_BY_CUR_HWMODE ||
 		     in_opclass_conf == OPCLASSES_SUPPORTED_BY_DOMAIN)) {
@@ -1687,6 +1694,7 @@ static uint16_t reg_find_nearest_ieee_bw(uint16_t spacing)
  * @op_class_tbl: Pointer to op_class_tbl
  * @in_opclass_conf: input opclass configuration
  * Supported or not-supported by current HW mode
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Populate channels from opclass map to regdmn_ap_cap_opclass_t as supported
  * and non-supported channels for non-6Ghz.
@@ -1697,7 +1705,8 @@ static void reg_get_cfis_from_opclassmap_for_non6g(
 			struct wlan_objmgr_pdev *pdev,
 			struct regdmn_ap_cap_opclass_t *cap,
 			const struct reg_dmn_op_class_map_t *op_class_tbl,
-			enum opclass_config in_opclass_conf)
+			enum opclass_config in_opclass_conf,
+			enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	qdf_freq_t start_freq = op_class_tbl->start_freq;
 	uint8_t chan_idx = 0, n_sup_chans = 0, n_unsup_chans = 0;
@@ -1720,7 +1729,8 @@ static void reg_get_cfis_from_opclassmap_for_non6g(
 		is_supported = reg_is_chan_supported(pdev,
 						     pri_freq,
 						     0,
-						     ch_width);
+						     ch_width,
+						     in_6g_pwr_mode);
 
 		if (is_supported &&
 		    (in_opclass_conf == OPCLASSES_SUPPORTED_BY_CUR_HWMODE ||
@@ -1743,6 +1753,7 @@ static void reg_get_cfis_from_opclassmap_for_non6g(
  * @is_opclass_operable: Set true if opclass is operable, else set false
  * @in_opclass_conf: input opclass configuration
  * Supported or not-supported by current HW mode
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Populate channels from opclass map to reg_ap_cap as supported and
  * non-supported channels.
@@ -1756,7 +1767,8 @@ reg_get_channels_from_opclassmap(
 		uint8_t index,
 		const struct reg_dmn_op_class_map_t *op_class_tbl,
 		bool *is_opclass_operable,
-		enum opclass_config in_opclass_conf)
+		enum opclass_config in_opclass_conf,
+		enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	struct regdmn_ap_cap_opclass_t *cap = &reg_ap_cap[index];
 
@@ -1764,12 +1776,14 @@ reg_get_channels_from_opclassmap(
 		reg_get_cfis_from_opclassmap_for_6g(pdev,
 						    cap,
 						    op_class_tbl,
-						    in_opclass_conf);
+						    in_opclass_conf,
+						    in_6g_pwr_mode);
 	} else {
 		reg_get_cfis_from_opclassmap_for_non6g(pdev,
 						       cap,
 						       op_class_tbl,
-						       in_opclass_conf);
+						       in_opclass_conf,
+						       in_6g_pwr_mode);
 	}
 
 	if (cap->num_supported_chan >= 1)
@@ -1780,7 +1794,8 @@ QDF_STATUS reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 				   struct regdmn_ap_cap_opclass_t *reg_ap_cap,
 				   uint8_t *n_opclasses,
 				   uint8_t max_supp_op_class,
-				   bool global_tbl_lookup)
+				   bool global_tbl_lookup,
+				   enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	uint8_t max_reg_power = 0;
 	const struct reg_dmn_op_class_map_t *op_class_tbl;
@@ -1808,7 +1823,8 @@ QDF_STATUS reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 						 index,
 						 op_class_tbl,
 						 &is_opclass_operable,
-						 opclass_conf);
+						 opclass_conf,
+						 in_6g_pwr_mode);
 		if (is_opclass_operable) {
 			reg_ap_cap[index].op_class = op_class_tbl->op_class;
 			reg_ap_cap[index].ch_width =
@@ -1950,7 +1966,8 @@ reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 			       uint8_t max_supp_op_class,
 			       bool global_tbl_lookup,
 			       enum phy_ch_width max_chwidth,
-			       bool is_80p80_supp)
+			       bool is_80p80_supp,
+			       enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	uint8_t max_reg_power = 0;
 	const struct reg_dmn_op_class_map_t *op_class_tbl;
@@ -1993,7 +2010,8 @@ reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 						 index,
 						 op_class_tbl,
 						 &is_opclass_operable,
-						 opclass_in_config);
+						 opclass_in_config,
+						 in_6g_pwr_mode);
 
 		if (is_opclass_operable && opclass_in_config ==
 		    OPCLASSES_SUPPORTED_BY_CUR_HWMODE) {

+ 11 - 5
umac/regulatory/core/src/reg_opclass.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -117,6 +117,7 @@ uint16_t reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class);
  * @n_opclasses: Pointer to number of opclasses.
  * @max_supp_op_class: Maximum number of operating classes supported.
  * @global_tbl_lookup: Whether to lookup global op class table.
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: QDF_STATUS_SUCCESS if success, else return QDF_STATUS_FAILURE.
  */
@@ -124,7 +125,8 @@ QDF_STATUS reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 				   struct regdmn_ap_cap_opclass_t *reg_ap_cap,
 				   uint8_t *n_opclasses,
 				   uint8_t max_supp_op_class,
-				   bool global_tbl_lookup);
+				   bool global_tbl_lookup,
+				   enum supported_6g_pwr_types in_6g_pwr_mode);
 
 /**
  * reg_get_opclass_for_cur_hwmode() - Get details about the opclasses for
@@ -136,6 +138,7 @@ QDF_STATUS reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
  * @global_tbl_lookup: Whether to lookup global op class table.
  * @max_chwidth: Max channel width supported by cur hwmode
  * @is_80p80_supp: Bool to indicate if 80p80 is supported
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: QDF_STATUS_SUCCESS if success, else return QDF_STATUS_FAILURE.
  */
@@ -146,7 +149,8 @@ reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 			       uint8_t max_supp_op_class,
 			       bool global_tbl_lookup,
 			       enum phy_ch_width max_chwidth,
-			       bool is_80p80_supp);
+			       bool is_80p80_supp,
+			       enum supported_6g_pwr_types in_6g_pwr_mode);
 /**
  * reg_is_5ghz_op_class() - Check if the input opclass is a 5GHz opclass.
  * @country: Country code.
@@ -359,7 +363,8 @@ QDF_STATUS reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 				   struct regdmn_ap_cap_opclass_t *reg_ap_cap,
 				   uint8_t *n_opclasses,
 				   uint8_t max_supp_op_class,
-				   bool global_tbl_lookup)
+				   bool global_tbl_lookup,
+				   enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	return QDF_STATUS_E_FAILURE;
 }
@@ -383,7 +388,8 @@ reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 			       uint8_t max_supp_op_class,
 			       bool global_tbl_lookup,
 			       enum phy_ch_width max_ch_width,
-			       bool is_80p80_supp)
+			       bool is_80p80_supp,
+			       enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	return QDF_STATUS_E_FAILURE;
 }

+ 6 - 2
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -1060,6 +1060,7 @@ uint16_t wlan_reg_dmn_get_curr_opclasses(uint8_t *num_classes,
  * @n_opclasses: Pointer to number of opclasses.
  * @max_supp_op_class: Maximum number of operating classes supported.
  * @global_tbl_lookup: Whether to lookup global op class tbl.
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: QDF_STATUS_SUCCESS if success, else return QDF_STATUS_FAILURE.
  */
@@ -1068,7 +1069,8 @@ wlan_reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 			     struct regdmn_ap_cap_opclass_t *reg_ap_cap,
 			     uint8_t *n_opclasses,
 			     uint8_t max_supp_op_class,
-			     bool global_tbl_lookup);
+			     bool global_tbl_lookup,
+			     enum supported_6g_pwr_types in_6g_pwr_mode);
 
 /**
  * wlan_reg_get_opclass_for_cur_hwmode() - Get details about the
@@ -1080,6 +1082,7 @@ wlan_reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
  * @global_tbl_lookup: Whether to lookup global op class tbl.
  * @max_chwidth: Maximum channel width supported by cur hwmode
  * @is_80p80_supp: Bool to indicate if 80p80 is supported.
+ * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
  *
  * Return: QDF_STATUS_SUCCESS if success, else return QDF_STATUS_FAILURE.
  */
@@ -1090,7 +1093,8 @@ wlan_reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 				    uint8_t max_supp_op_class,
 				    bool global_tbl_lookup,
 				    enum phy_ch_width max_chwidth,
-				    bool is_80p80_supp);
+				    bool is_80p80_supp,
+				    enum supported_6g_pwr_types in_6g_pwr_mode);
 /**
  * wlan_reg_get_cc_and_src () - get country code and src
  * @psoc: psoc ptr

+ 8 - 4
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -304,11 +304,13 @@ wlan_reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
 			     struct regdmn_ap_cap_opclass_t *reg_ap_cap,
 			     uint8_t *n_opclasses,
 			     uint8_t max_supp_op_class,
-			     bool global_tbl_lookup)
+			     bool global_tbl_lookup,
+			     enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	return reg_get_opclass_details(pdev, reg_ap_cap, n_opclasses,
 				       max_supp_op_class,
-				       global_tbl_lookup);
+				       global_tbl_lookup,
+				       in_6g_pwr_mode);
 }
 
 QDF_STATUS
@@ -318,13 +320,15 @@ wlan_reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
 				    uint8_t max_supp_op_class,
 				    bool global_tbl_lookup,
 				    enum phy_ch_width max_chwidth,
-				    bool is_80p80_supp)
+				    bool is_80p80_supp,
+				    enum supported_6g_pwr_types in_6g_pwr_mode)
 {
 	return reg_get_opclass_for_cur_hwmode(pdev, reg_ap_cap, n_opclasses,
 					      max_supp_op_class,
 					      global_tbl_lookup,
 					      max_chwidth,
-					      is_80p80_supp);
+					      is_80p80_supp,
+					      in_6g_pwr_mode);
 }
 
 enum country_src wlan_reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,