From dcb1efdcce5570bedd27280ed991ab49dd53d342 Mon Sep 17 00:00:00 2001 From: Vijay Krishnan Date: Thu, 20 Aug 2020 15:30:57 +0530 Subject: [PATCH] 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 --- .../regulatory/core/src/reg_services_common.c | 41 +------------------ .../regulatory/core/src/reg_services_common.h | 12 ------ .../dispatcher/inc/wlan_reg_services_api.h | 10 ----- .../dispatcher/src/wlan_reg_services_api.c | 16 -------- umac/wifi_pos/src/wifi_pos_main.c | 4 +- 5 files changed, 3 insertions(+), 80 deletions(-) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 1e6f853c7e48..a0f922b9280f 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/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; } -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 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)) { ch_list[count].center_freq = reg_channels[i].center_freq; + ch_list[count].chan_num = reg_channels[i].chan_num; ch_list[count++].tx_power = reg_channels[i].tx_power; } diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 71e8fcf42254..6f4ac6d220e8 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/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_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 /** * reg_get_chan_enum() - Get channel enum for given channel number diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 70c5b307c077..1ef9220b029c 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/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); #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 * @country: pointer to the country code. diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index a38302a076c3..84bcb0a8f848 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -42,22 +42,6 @@ #include <../../core/src/reg_offload_11d_scan.h> #include -/** - * 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 * @country: pointer to the country code. diff --git a/umac/wifi_pos/src/wifi_pos_main.c b/umac/wifi_pos/src/wifi_pos_main.c index 36b229bb7404..ad6332b38cc3 100644 --- a/umac/wifi_pos/src/wifi_pos_main.c +++ b/umac/wifi_pos/src/wifi_pos_main.c @@ -501,8 +501,8 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc, return; } 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)) { wifi_pos_err("Failed to get valid channel list");