Эх сурвалжийг харах

qcacmn: Remove reg_get_channel_list_with_power

reg_get_channel_list_with_power function is a redundant function as its
counterpart reg_get_channel_list_with_power_for freq have the same
functionality. Also the two functions have almost the same implementation.
Therefore removing the function reg_get_channel_list_with_power.

Also added the assignment of the variable "chan_num" to the function
reg_get_channel_list_with_power_for_freq, as the assignment was missing.

CRs-Fixed: 2738838
Change-Id: Ifd2fd795cacd89989e1755f3b8fd56ccd7d5b84f
Vijay Krishnan 4 жил өмнө
parent
commit
dcb1efdcce

+ 1 - 40
umac/regulatory/core/src/reg_services_common.c

@@ -1092,46 +1092,6 @@ struct wlan_lmac_if_reg_tx_ops *reg_get_psoc_tx_ops(
 	return &tx_ops->reg_ops;
 	return &tx_ops->reg_ops;
 }
 }
 
 
-QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
-					   struct channel_power *ch_list,
-					   uint8_t *num_chan)
-{
-	int i, count;
-	struct regulatory_channel *reg_channels;
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
-
-	if (!num_chan || !ch_list) {
-		reg_err("chan_list or num_ch is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	pdev_priv_obj = reg_get_pdev_obj(pdev);
-
-	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
-		reg_err("reg pdev priv obj is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	/* set the current channel list */
-	reg_channels = pdev_priv_obj->cur_chan_list;
-
-	for (i = 0, count = 0; i < NUM_CHANNELS; i++) {
-		if (reg_channels[i].state &&
-		    reg_channels[i].chan_flags != REGULATORY_CHAN_DISABLED) {
-			ch_list[count].chan_num =
-				reg_channels[i].chan_num;
-			ch_list[count].center_freq =
-				reg_channels[i].center_freq;
-			ch_list[count++].tx_power =
-				reg_channels[i].tx_power;
-		}
-	}
-
-	*num_chan = count;
-
-	return QDF_STATUS_SUCCESS;
-}
-
 #ifdef CONFIG_CHAN_NUM_API
 #ifdef CONFIG_CHAN_NUM_API
 enum channel_enum reg_get_chan_enum(uint8_t chan_num)
 enum channel_enum reg_get_chan_enum(uint8_t chan_num)
 {
 {
@@ -3205,6 +3165,7 @@ QDF_STATUS reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev
 		    !(reg_channels[i].chan_flags & REGULATORY_CHAN_DISABLED)) {
 		    !(reg_channels[i].chan_flags & REGULATORY_CHAN_DISABLED)) {
 			ch_list[count].center_freq =
 			ch_list[count].center_freq =
 				reg_channels[i].center_freq;
 				reg_channels[i].center_freq;
+			ch_list[count].chan_num = reg_channels[i].chan_num;
 			ch_list[count++].tx_power =
 			ch_list[count++].tx_power =
 				reg_channels[i].tx_power;
 				reg_channels[i].tx_power;
 		}
 		}

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

@@ -131,18 +131,6 @@ extern const struct chan_map channel_map_jp[];
 extern const struct chan_map channel_map_china[];
 extern const struct chan_map channel_map_china[];
 extern const struct chan_map channel_map_global[];
 extern const struct chan_map channel_map_global[];
 
 
-/**
- * reg_get_channel_list_with_power() - Provides the channel list with power
- * @pdev: Pointer to pdev
- * @ch_list: Pointer to the channel list.
- * @num_chan: Pointer to save number of channels
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
-					   struct channel_power *ch_list,
-					   uint8_t *num_chan);
-
 #ifdef CONFIG_CHAN_NUM_API
 #ifdef CONFIG_CHAN_NUM_API
 /**
 /**
  * reg_get_chan_enum() - Get channel enum for given channel number
  * reg_get_chan_enum() - Get channel enum for given channel number

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

@@ -413,16 +413,6 @@ bool wlan_reg_is_channel_valid_5g_sbs(uint8_t curchan, uint8_t newchan);
 enum band_info wlan_reg_chan_to_band(uint8_t chan_num);
 enum band_info wlan_reg_chan_to_band(uint8_t chan_num);
 #endif /* CONFIG_CHAN_NUM_API */
 #endif /* CONFIG_CHAN_NUM_API */
 
 
-/**
- * wlan_reg_get_channel_list_with_power() - Provide the channel list with power
- * @ch_list: pointer to the channel list.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
-						struct channel_power *ch_list,
-						uint8_t *num_chan);
-
 /**
 /**
  * wlan_reg_read_default_country() - Read the default country for the regdomain
  * wlan_reg_read_default_country() - Read the default country for the regdomain
  * @country: pointer to the country code.
  * @country: pointer to the country code.

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

@@ -42,22 +42,6 @@
 #include <../../core/src/reg_offload_11d_scan.h>
 #include <../../core/src/reg_offload_11d_scan.h>
 #include <wlan_objmgr_global_obj.h>
 #include <wlan_objmgr_global_obj.h>
 
 
-/**
- * wlan_reg_get_channel_list_with_power() - Provide the channel list with power
- * @ch_list: pointer to the channel list.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
-						struct channel_power *ch_list,
-						uint8_t *num_chan)
-{
-	/*
-	 * Update the channel list with channel information with power.
-	 */
-	return reg_get_channel_list_with_power(pdev, ch_list, num_chan);
-}
-
 /**
 /**
  * wlan_reg_read_default_country() - Read the default country for the regdomain
  * wlan_reg_read_default_country() - Read the default country for the regdomain
  * @country: pointer to the country code.
  * @country: pointer to the country code.

+ 2 - 2
umac/wifi_pos/src/wifi_pos_main.c

@@ -501,8 +501,8 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc,
 		return;
 		return;
 	}
 	}
 	ch_info = (struct channel_power *)chan_list->chan_info;
 	ch_info = (struct channel_power *)chan_list->chan_info;
-	status = wlan_reg_get_channel_list_with_power(pdev, ch_info,
-						      &num_channels);
+	status = wlan_reg_get_channel_list_with_power_for_freq(pdev, ch_info,
+							       &num_channels);
 
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 	if (QDF_IS_STATUS_ERROR(status)) {
 		wifi_pos_err("Failed to get valid channel list");
 		wifi_pos_err("Failed to get valid channel list");