Kaynağa Gözat

qcacmn: Replace reg_get_5g_bonded_channel_for_freq to 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.

Replace the references of "reg_get_5g_bonded_channel_for_freq"
with "reg_get_5g_bonded_channel_for_pwrmode".

Change-Id: I4c978c7f938b14d79d0eadf4251a86a9165f496e
CRs-Fixed: 3147900
Vinod Kumar Myadam 2 yıl önce
ebeveyn
işleme
f1664a7c8a

+ 9 - 37
umac/regulatory/core/src/reg_services_common.c

@@ -4422,7 +4422,9 @@ reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 					 qdf_freq_t freq, enum phy_ch_width bw,
 					 bool *is_psd, uint16_t *min_tx_power,
 					 int16_t *min_psd_eirp,
-					 enum reg_6g_ap_type *power_type)
+					 enum reg_6g_ap_type *power_type,
+					 enum supported_6g_pwr_types pwr_mode,
+					 uint16_t input_punc_bitmap)
 {
 	const struct bonded_channel_freq *bonded_chan_ptr = NULL;
 	enum channel_state state;
@@ -4451,10 +4453,12 @@ reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	state = reg_get_5g_bonded_channel_for_freq(pdev,
-						   freq,
-						   bw,
-						   &bonded_chan_ptr);
+	state = reg_get_5g_bonded_channel_for_pwrmode(pdev,
+						      freq,
+						      bw,
+						      &bonded_chan_ptr,
+						      pwr_mode,
+						      input_punc_bitmap);
 	if (state != CHANNEL_STATE_ENABLE &&
 	    state != CHANNEL_STATE_DFS) {
 		reg_err("invalid channel state %d", state);
@@ -5688,37 +5692,6 @@ reg_fill_channel_list_for_pwrmode(struct wlan_objmgr_pdev *pdev,
 #endif
 #endif
 
-enum channel_state
-reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
-				   uint16_t freq,
-				   enum phy_ch_width ch_width,
-				   const struct bonded_channel_freq
-				   **bonded_chan_ptr_ptr)
-{
-	if (ch_width == CH_WIDTH_20MHZ)
-		return reg_get_channel_state_for_pwrmode(pdev, freq,
-							 REG_CURRENT_PWR_MODE);
-
-	if (reg_is_ch_width_320(ch_width)) {
-		return reg_get_chan_state_for_320(pdev, freq, 0,
-						  ch_width,
-						  bonded_chan_ptr_ptr,
-						  REG_CURRENT_PWR_MODE,
-						  true,
-						  NO_SCHANS_PUNC);
-	} else {
-		*bonded_chan_ptr_ptr = reg_get_bonded_chan_entry(freq,
-								 ch_width, 0);
-		if (!(*bonded_chan_ptr_ptr))
-			return CHANNEL_STATE_INVALID;
-
-		return reg_get_5g_bonded_chan_array_for_freq(
-							pdev, freq,
-							*bonded_chan_ptr_ptr);
-	}
-}
-
-#ifdef CONFIG_REG_6G_PWRMODE
 enum channel_state
 reg_get_5g_bonded_channel_for_pwrmode(struct wlan_objmgr_pdev *pdev,
 				      uint16_t freq,
@@ -5752,7 +5725,6 @@ reg_get_5g_bonded_channel_for_pwrmode(struct wlan_objmgr_pdev *pdev,
 						     in_6g_pwr_mode,
 						     input_punc_bitmap);
 }
-#endif
 
 #ifdef CONFIG_REG_6G_PWRMODE
 /**

+ 8 - 22
umac/regulatory/core/src/reg_services_common.h

@@ -1345,6 +1345,8 @@ reg_get_channel_power_attr_from_secondary_list_for_freq(
  * @min_tx_power: pointer to retrieve value of minimum eirp tx power in bw
  * @min_psd_eirp: pointer to retrieve value of minimum psd eirp power in bw
  * @power_type: pointer to retrieve value of 6 GHz power type
+ * pwr_mode: 6g power type which decides 6G channel list lookup.
+ * input_punc_bitmap: Input  puncture bitmap
  *
  * Return: QDF STATUS
  */
@@ -1353,14 +1355,18 @@ reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 					 qdf_freq_t freq, enum phy_ch_width bw,
 					 bool *is_psd, uint16_t *min_tx_power,
 					 int16_t *min_psd_eirp,
-					 enum reg_6g_ap_type *power_type);
+					 enum reg_6g_ap_type *power_type,
+					 enum supported_6g_pwr_types pwr_mode,
+					 uint16_t input_punc_bitmap);
 #else
 static inline QDF_STATUS
 reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 					 qdf_freq_t freq, enum phy_ch_width bw,
 					 bool *is_psd, uint16_t *min_tx_power,
 					 int16_t *min_psd_eirp,
-					 enum reg_6g_ap_type *power_type)
+					 enum reg_6g_ap_type *power_type,
+					 enum supported_6g_pwr_types pwr_mode,
+					 uint16_t input_punc_bitmap)
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }
@@ -1424,25 +1430,6 @@ qdf_freq_t reg_min_chan_freq(void);
  */
 qdf_freq_t reg_max_chan_freq(void);
 
-/**
- * reg_get_5g_bonded_channel_for_freq()- Return the channel state for a
- * 5G or 6G channel frequency based on the channel width and bonded channel
- * @pdev: Pointer to pdev.
- * @freq: Channel center frequency.
- * @ch_width: Channel Width.
- * @bonded_chan_ptr_ptr: Pointer to bonded_channel_freq.
- * @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
- *
- * Return: Channel State
- */
-enum channel_state
-reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
-				   uint16_t freq,
-				   enum phy_ch_width ch_width,
-				   const struct bonded_channel_freq
-				   **bonded_chan_ptr_ptr);
-
-#ifdef CONFIG_REG_6G_PWRMODE
 /**
  * reg_get_5g_bonded_channel_for_pwrmode()- Return the channel state for a
  * 5G or 6G channel frequency based on the channel width and bonded channel
@@ -1464,7 +1451,6 @@ reg_get_5g_bonded_channel_for_pwrmode(struct wlan_objmgr_pdev *pdev,
 				      enum supported_6g_pwr_types
 				      in_6g_pwr_mode,
 				      uint16_t input_puncture_bitmap);
-#endif
 
 #ifdef CONFIG_REG_6G_PWRMODE
 /**

+ 5 - 1
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -1899,6 +1899,8 @@ wlan_reg_get_chan_pwr_attr_from_secondary_list_for_freq(
  * @min_tx_power: pointer to retrieve minimum tx power in bandwidth
  * @min_psd_eirp: pointer to retrieve minimum psd eirp in bandwidth
  * @power_type: pointer to retrieve 6 GHz power type
+ * @pwr_mode: 6g power type which decides 6G channel list lookup.
+ * @input_punc_bitmap: Input  puncture bitmap
  *
  * Return: QDF STATUS
  */
@@ -1909,7 +1911,9 @@ wlan_reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 					      bool *is_psd,
 					      uint16_t *min_tx_power,
 					      int16_t *min_psd_eirp,
-					      enum reg_6g_ap_type *power_type);
+					      enum reg_6g_ap_type *power_type,
+					      enum supported_6g_pwr_types pwr_mode,
+					      uint16_t input_punc_bitmap);
 #endif
 
 /**

+ 6 - 2
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -1174,7 +1174,9 @@ wlan_reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 					      bool *is_psd,
 					      uint16_t *min_tx_power,
 					      int16_t *min_psd_eirp,
-					      enum reg_6g_ap_type *power_type)
+					      enum reg_6g_ap_type *power_type,
+					      enum supported_6g_pwr_types pwr_mode,
+					      uint16_t input_punc_bitmap)
 {
 	return reg_decide_6ghz_power_within_bw_for_freq(pdev,
 							freq,
@@ -1182,7 +1184,9 @@ wlan_reg_decide_6ghz_power_within_bw_for_freq(struct wlan_objmgr_pdev *pdev,
 							is_psd,
 							min_tx_power,
 							min_psd_eirp,
-							power_type);
+							power_type,
+							pwr_mode,
+							input_punc_bitmap);
 }
 #endif