qcacld-3.0: Replace regulatory apis with reg component apis
Replace the legacy regulatory apis with regulatory component
public service apis
Change-Id: Ifd8c93fc8f57116cfc432b853248b35fd7ed1b94
CRs-Fixed: 2008013
diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h
index 50f3138..e6bd2c8 100644
--- a/core/cds/inc/cds_reg_service.h
+++ b/core/cds/inc/cds_reg_service.h
@@ -48,126 +48,19 @@
#define HT40MINUS_2G_CH_START 5
#define HT40MINUS_2G_CH_END 13
-
-#define CDS_CHANNEL_STATE(chan_enum) reg_channels[chan_enum].state
-#define CDS_CHANNEL_NUM(chan_enum) channel_map[chan_enum].chan_num
-#define CDS_CHANNEL_FREQ(chan_enum) channel_map[chan_enum].center_freq
-#define CDS_IS_DFS_CH(chan_num) (cds_get_channel_state((chan_num)) == \
- CHANNEL_STATE_DFS)
-
-#define CDS_IS_PASSIVE_OR_DISABLE_CH(chan_num) \
- (cds_get_channel_state(chan_num) != CHANNEL_STATE_ENABLE)
-
-#define CDS_MIN_24GHZ_CHANNEL_NUMBER channel_map[MIN_24GHZ_CHANNEL].chan_num
-#define CDS_MAX_24GHZ_CHANNEL_NUMBER channel_map[MAX_24GHZ_CHANNEL].chan_num
-#define CDS_MIN_5GHZ_CHANNEL_NUMBER channel_map[MIN_5GHZ_CHANNEL].chan_num
-#define CDS_MAX_5GHZ_CHANNEL_NUMBER channel_map[MAX_5GHZ_CHANNEL].chan_num
-
-#define CDS_IS_CHANNEL_5GHZ(chan_num) \
- ((chan_num >= CDS_MIN_5GHZ_CHANNEL_NUMBER) && \
- (chan_num <= CDS_MAX_5GHZ_CHANNEL_NUMBER))
-
-#define CDS_IS_CHANNEL_24GHZ(chan_num) \
- ((chan_num >= CDS_MIN_24GHZ_CHANNEL_NUMBER) && \
- (chan_num <= CDS_MAX_24GHZ_CHANNEL_NUMBER))
-
-#define CDS_IS_SAME_BAND_CHANNELS(chan_num1, chan_num2) \
- (chan_num1 && chan_num2 && \
- (CDS_IS_CHANNEL_5GHZ(chan_num1) == CDS_IS_CHANNEL_5GHZ(chan_num2)))
-
-#define CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \
- (curchan > newchan ? \
- CDS_CHANNEL_FREQ(cds_get_channel_enum(curchan)) \
- - CDS_CHANNEL_FREQ(cds_get_channel_enum(newchan)) \
- > CDS_SBS_SEPARATION_THRESHOLD : \
- CDS_CHANNEL_FREQ(cds_get_channel_enum(newchan)) \
- - CDS_CHANNEL_FREQ(cds_get_channel_enum(curchan)) \
- > CDS_SBS_SEPARATION_THRESHOLD)
-
-extern const struct chan_map channel_map[NUM_CHANNELS];
-
-extern struct regulatory_channel reg_channels[NUM_CHANNELS];
-
-QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *pRegDomain,
- const uint8_t *country_alpha2,
- enum country_src source);
-
-/**
- * cds_is_fcc_regdomian() - is the regdomain FCC
- *
- * Return: true on FCC regdomain, false otherwise
- */
-bool cds_is_fcc_regdomain(void);
-
-QDF_STATUS cds_read_default_country(uint8_t *default_country);
-
-QDF_STATUS cds_get_channel_list_with_power(struct channel_power
- *base_channels,
- uint8_t *num_base_channels);
-
-enum channel_enum cds_get_channel_enum(uint32_t chan_num);
-
-enum channel_state cds_get_channel_state(uint32_t chan_num);
-
-/**
- * cds_get_channel_reg_power() - get max power based on regulatory
- * @chan_num: channel number
- *
- * Return: tx power
- */
-int8_t cds_get_channel_reg_power(uint32_t chan_num);
-
-/**
- * cds_get_channel_flags() - This API returns regulatory channel flags
- * @chan_num: channel number
- *
- * Return: channel flags
- */
-uint32_t cds_get_channel_flags(uint32_t chan_num);
-
/**
* cds_get_vendor_reg_flags() - This API returns vendor specific regulatory
* channel flags
- * @chan_num: channel number
- *
+ * @pdev: pdev pointer
+ * @chan: channel number
+ * @bandwidth: channel BW
+ * @is_ht_enabled: HT enabled/disabled flag
+ * @is_vht_enabled: VHT enabled/disabled flag
+ * @sub_20_channel_width: Sub 20 channel bandwidth
* Return: channel flags
*/
-uint32_t cds_get_vendor_reg_flags(uint32_t chan, uint16_t bandwidth,
- bool is_ht_enabled, bool is_vht_enabled,
- uint8_t is_sub_20_channel_width);
-
-/**
- * cds_get_channel_freq() - This API returns frequency for channel
- * @chan_num: channel number
- *
- * Return: frequency
- */
-uint32_t cds_get_channel_freq(uint32_t chan_num);
-
-bool cds_is_dsrc_channel(uint16_t center_freq);
-enum channel_state cds_get_5g_bonded_channel_state(uint16_t chan_num,
- enum phy_ch_width chan_width);
-
-enum channel_state cds_get_2g_bonded_channel_state(uint16_t chan_num,
- enum phy_ch_width chan_width,
- uint16_t sec_ch);
-/**
- * cds_get_2g_bonded_channel_state() - get the channel bonded channel state
- * @oper_ch: operating channel
- * @ch_width: channel width
- * @sec_ch: secondary channel
- *
- * Return: channel state
- */
-enum channel_state cds_get_bonded_channel_state(uint16_t oper_ch,
- enum phy_ch_width ch_width,
- uint16_t sec_ch);
-void cds_set_channel_params(uint16_t oper_ch, uint16_t ht_offset_2g,
- struct ch_params *ch_params);
-
-QDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain);
-QDF_STATUS cds_put_default_country(uint8_t *def_country);
-uint16_t cds_bw_value(enum phy_ch_width bw);
-uint8_t cds_skip_dfs_and_2g(uint32_t rf_channel);
-
+uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev, uint32_t chan,
+ uint16_t bandwidth,
+ bool is_ht_enabled, bool is_vht_enabled,
+ uint8_t sub_20_channel_width);
#endif /* __CDS_REG_SERVICE_H */
diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h
index 532ba8a..d526555 100644
--- a/core/cds/inc/cds_regdomain.h
+++ b/core/cds/inc/cds_regdomain.h
@@ -71,8 +71,8 @@
#ifndef __CDS_REGDOMAIN_H
#define __CDS_REGDOMAIN_H
-#define MAX_CHANNELS_PER_OPERATING_CLASS 25
-#define CDS_MAX_SUPP_OPER_CLASSES 32
+#include <reg_services_public_struct.h>
+
#define MIN_TX_PWR_CAP 8
#define MAX_TX_PWR_CAP 22
@@ -539,13 +539,5 @@
int32_t cds_get_country_from_alpha2(uint8_t *alpha2);
void cds_fill_and_send_ctl_to_fw(struct regulatory *reg);
void cds_set_wma_dfs_region(uint8_t dfs_region);
-uint16_t cds_reg_dmn_get_opclass_from_channel(uint8_t *country,
- uint8_t channel,
- uint8_t offset);
-uint16_t cds_reg_dmn_get_chanwidth_from_opclass(uint8_t *country,
- uint8_t channel,
- uint8_t opclass);
-uint16_t cds_reg_dmn_set_curr_opclasses(uint8_t num_classes, uint8_t *class);
-uint16_t cds_reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class);
#endif /* __CDS_REGDOMAIN_H */
diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c
index fa3b072..3b1dde0 100644
--- a/core/cds/src/cds_reg_service.c
+++ b/core/cds/src/cds_reg_service.c
@@ -31,187 +31,23 @@
DEPENDENCIES: None
============================================================================*/
-#include <net/cfg80211.h>
#include "qdf_types.h"
#include "qdf_trace.h"
-#include "cds_api.h"
+#include "wlan_reg_services_api.h"
#include "cds_reg_service.h"
-#include "cds_regdomain.h"
#include "cds_ieee80211_common_i.h"
-#include "sme_api.h"
-#include "wlan_hdd_main.h"
+#include "cds_config.h"
-/**
- * struct bonded_chan
- * @start_ch: start channel
- * @end_ch: end channel
- */
-struct bonded_chan {
- uint16_t start_ch;
- uint16_t end_ch;
-};
-
-static const struct bonded_chan bonded_chan_40mhz_array[] = {
- {36, 40},
- {44, 48},
- {52, 56},
- {60, 64},
- {100, 104},
- {108, 112},
- {116, 120},
- {124, 128},
- {132, 136},
- {140, 144},
- {149, 153},
- {157, 161}
-};
-
-static const struct bonded_chan bonded_chan_80mhz_array[] = {
- {36, 48},
- {52, 64},
- {100, 112},
- {116, 128},
- {132, 144},
- {149, 161}
-};
-
-static const struct bonded_chan bonded_chan_160mhz_array[] = {
- {36, 64},
- {100, 128}
-};
-
-static const enum phy_ch_width next_lower_bw[] = {
- [CH_WIDTH_80P80MHZ] = CH_WIDTH_160MHZ,
- [CH_WIDTH_160MHZ] = CH_WIDTH_80MHZ,
- [CH_WIDTH_80MHZ] = CH_WIDTH_40MHZ,
- [CH_WIDTH_40MHZ] = CH_WIDTH_20MHZ,
- [CH_WIDTH_20MHZ] = CH_WIDTH_10MHZ,
- [CH_WIDTH_10MHZ] = CH_WIDTH_5MHZ,
- [CH_WIDTH_5MHZ] = CH_WIDTH_INVALID
-};
-
-struct regulatory_channel reg_channels[NUM_CHANNELS];
-static uint8_t default_country[CDS_COUNTRY_CODE_LEN + 1];
-
-/**
- * cds_get_channel_list_with_power() - retrieve channel list with power
- * @base_channels: base channels
- * @num_base_channels: number of base channels
- *
- * Return: QDF_STATUS_SUCCESS
- */
-QDF_STATUS cds_get_channel_list_with_power(struct channel_power
- *base_channels,
- uint8_t *num_base_channels)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- int i, count;
-
- if (base_channels && num_base_channels) {
- count = 0;
- for (i = 0; i < NUM_CHANNELS; i++) {
- if (reg_channels[i].state) {
- base_channels[count].chan_num =
- channel_map[i].chan_num;
- base_channels[count++].tx_power =
- reg_channels[i].tx_power;
- }
- }
- *num_base_channels = count;
- }
-
- return status;
-}
-
-/**
- * cds_read_default_country() - set the default country
- * @def_ctry: default country
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS cds_read_default_country(uint8_t *def_ctry)
-{
- memcpy(def_ctry,
- default_country,
- CDS_COUNTRY_CODE_LEN + 1);
-
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
- "default country is %c%c\n",
- def_ctry[0],
- def_ctry[1]);
-
- return QDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_channel_enum() - get the channel enumeration
- * @chan_num: channel number
- *
- * Return: enum for the channel
- */
-enum channel_enum cds_get_channel_enum(uint32_t chan_num)
-{
- uint32_t loop;
-
- for (loop = 0; loop < NUM_CHANNELS; loop++)
- if (channel_map[loop].chan_num == chan_num)
- return loop;
-
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "invalid channel number %d", chan_num);
-
- return INVALID_CHANNEL;
-}
-
-
-/**
- * cds_get_channel_state() - get the channel state
- * @chan_num: channel number
- *
- * Return: channel state
- */
-enum channel_state cds_get_channel_state(uint32_t chan_num)
-{
- enum channel_enum chan_enum;
-
- chan_enum = cds_get_channel_enum(chan_num);
- if (INVALID_CHANNEL == chan_enum)
- return CHANNEL_STATE_INVALID;
- else
- return reg_channels[chan_enum].state;
-}
-
-int8_t cds_get_channel_reg_power(uint32_t chan_num)
-{
- enum channel_enum chan_enum;
-
- chan_enum = cds_get_channel_enum(chan_num);
- if (chan_enum == INVALID_CHANNEL)
- return CHANNEL_STATE_INVALID;
- else
- return reg_channels[chan_enum].tx_power;
-}
-
-uint32_t cds_get_channel_flags(uint32_t chan_num)
-{
- enum channel_enum chan_enum;
-
- chan_enum = cds_get_channel_enum(chan_num);
- if (chan_enum == INVALID_CHANNEL)
- return CHANNEL_STATE_INVALID;
- else
- return reg_channels[chan_enum].chan_flags;
-}
-
-uint32_t cds_get_vendor_reg_flags(uint32_t chan, uint16_t bandwidth,
- bool is_ht_enabled, bool is_vht_enabled,
- uint8_t sub_20_channel_width)
+uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
+ uint32_t chan, uint16_t bandwidth,
+ bool is_ht_enabled, bool is_vht_enabled,
+ uint8_t sub_20_channel_width)
{
uint32_t flags = 0;
enum channel_state state;
struct ch_params ch_params;
- state = cds_get_channel_state(chan);
+ state = wlan_reg_get_channel_state(pdev, chan);
if (state == CHANNEL_STATE_INVALID)
return flags;
if (state == CHANNEL_STATE_DFS) {
@@ -221,616 +57,86 @@
if (state == CHANNEL_STATE_DISABLE)
flags |= IEEE80211_CHAN_BLOCKED;
- if (CDS_IS_CHANNEL_24GHZ(chan)) {
+ if (WLAN_REG_IS_24GHZ_CH(chan)) {
if ((bandwidth == CH_WIDTH_80P80MHZ) ||
- (bandwidth == CH_WIDTH_160MHZ) ||
- (bandwidth == CH_WIDTH_80MHZ)) {
+ (bandwidth == CH_WIDTH_160MHZ) ||
+ (bandwidth == CH_WIDTH_80MHZ)) {
bandwidth = CH_WIDTH_40MHZ;
}
}
switch (bandwidth) {
-
case CH_WIDTH_80P80MHZ:
- if (cds_get_5g_bonded_channel_state(chan,
- bandwidth) != CHANNEL_STATE_INVALID) {
+ if (wlan_reg_get_5g_bonded_channel_state(pdev, chan,
+ bandwidth) != CHANNEL_STATE_INVALID) {
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT80_80;
}
bandwidth = CH_WIDTH_160MHZ;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_160MHZ:
- if (cds_get_5g_bonded_channel_state(chan,
- bandwidth) != CHANNEL_STATE_INVALID) {
+ if (wlan_reg_get_5g_bonded_channel_state(pdev, chan,
+ bandwidth) != CHANNEL_STATE_INVALID) {
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT160;
}
bandwidth = CH_WIDTH_80MHZ;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_80MHZ:
- if (cds_get_5g_bonded_channel_state(chan,
- bandwidth) != CHANNEL_STATE_INVALID) {
+ if (wlan_reg_get_5g_bonded_channel_state(pdev, chan,
+ bandwidth) != CHANNEL_STATE_INVALID) {
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT80;
}
bandwidth = CH_WIDTH_40MHZ;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_40MHZ:
qdf_mem_zero(&ch_params, sizeof(ch_params));
ch_params.ch_width = bandwidth;
- cds_set_channel_params(chan, 0, &ch_params);
+ wlan_reg_set_channel_params(pdev, chan, 0, &ch_params);
- if (cds_get_bonded_channel_state(chan, bandwidth,
- ch_params.sec_ch_offset) != CHANNEL_STATE_INVALID) {
- if (ch_params.sec_ch_offset ==
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY) {
+ if (wlan_reg_get_bonded_channel_state(pdev, chan, bandwidth,
+ ch_params.sec_ch_offset) !=
+ CHANNEL_STATE_INVALID) {
+ if (ch_params.sec_ch_offset == LOW_PRIMARY_CH) {
flags |= IEEE80211_CHAN_HT40PLUS;
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT40PLUS;
} else if (ch_params.sec_ch_offset ==
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) {
+ HIGH_PRIMARY_CH) {
flags |= IEEE80211_CHAN_HT40MINUS;
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT40MINUS;
}
}
-
bandwidth = CH_WIDTH_20MHZ;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_20MHZ:
if (is_vht_enabled)
flags |= IEEE80211_CHAN_VHT20;
if (is_ht_enabled)
flags |= IEEE80211_CHAN_HT20;
bandwidth = CH_WIDTH_10MHZ;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_10MHZ:
- if ((cds_get_bonded_channel_state(chan,
- bandwidth, 0) != CHANNEL_STATE_INVALID) &&
- (sub_20_channel_width ==
- WLAN_SUB_20_CH_WIDTH_10))
+ if ((wlan_reg_get_bonded_channel_state(pdev, chan, bandwidth,
+ 0) != CHANNEL_STATE_INVALID) &&
+ (sub_20_channel_width ==
+ WLAN_SUB_20_CH_WIDTH_10))
flags |= IEEE80211_CHAN_HALF;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case CH_WIDTH_5MHZ:
- if ((cds_get_bonded_channel_state(chan,
- bandwidth, 0) != CHANNEL_STATE_INVALID) &&
- (sub_20_channel_width ==
- WLAN_SUB_20_CH_WIDTH_5))
+ if ((wlan_reg_get_bonded_channel_state(pdev, chan, bandwidth,
+ 0) != CHANNEL_STATE_INVALID) &&
+ (sub_20_channel_width ==
+ WLAN_SUB_20_CH_WIDTH_5))
flags |= IEEE80211_CHAN_QUARTER;
break;
default:
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
- "invalid channel width value %d", bandwidth);
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
+ "invalid channel width value %d", bandwidth);
}
return flags;
}
-uint32_t cds_get_channel_freq(uint32_t chan_num)
-{
- enum channel_enum chan_enum;
-
- chan_enum = cds_get_channel_enum(chan_num);
- if (chan_enum == INVALID_CHANNEL)
- return CHANNEL_STATE_INVALID;
- else
- return channel_map[chan_enum].center_freq;
-}
-
-/**
- * cds_search_5g_bonded_chan_array() - get ptr to bonded channel
- * @oper_ch: operating channel number
- * @bonded_chan_ar: bonded channel array
- * @bonded_chan_ptr_ptr: bonded channel ptr ptr
- *
- * Return: bonded channel state
- */
-static enum channel_state cds_search_5g_bonded_chan_array(uint32_t oper_chan,
- const struct bonded_chan
- bonded_chan_ar[],
- uint16_t array_size,
- const struct bonded_chan
- **bonded_chan_ptr_ptr)
-{
- int i;
- uint8_t chan_num;
- const struct bonded_chan *bonded_chan_ptr = NULL;
- enum channel_state chan_state = CHANNEL_STATE_INVALID;
- enum channel_state temp_chan_state;
-
- for (i = 0; i < array_size; i++) {
- if ((oper_chan >= bonded_chan_ar[i].start_ch) &&
- (oper_chan <= bonded_chan_ar[i].end_ch)) {
- bonded_chan_ptr = &(bonded_chan_ar[i]);
- break;
- }
- }
-
- if (NULL == bonded_chan_ptr)
- return chan_state;
-
- *bonded_chan_ptr_ptr = bonded_chan_ptr;
- chan_num = bonded_chan_ptr->start_ch;
- while (chan_num <= bonded_chan_ptr->end_ch) {
- temp_chan_state = cds_get_channel_state(chan_num);
- if (temp_chan_state < chan_state)
- chan_state = temp_chan_state;
- chan_num = chan_num + 4;
- }
-
- return chan_state;
-}
-
-/**
- * cds_search_5g_bonded_channel() - get the 5G bonded channel state
- * @chan_num: channel number
- * @ch_width: channel width
- * @bonded_chan_ptr_ptr: bonded channel ptr ptr
- *
- * Return: channel state
- */
-static enum channel_state cds_search_5g_bonded_channel(uint32_t chan_num,
- enum phy_ch_width ch_width,
- const struct bonded_chan
- **bonded_chan_ptr_ptr)
-{
-
- if (CH_WIDTH_80P80MHZ == ch_width)
- return cds_search_5g_bonded_chan_array(chan_num,
- bonded_chan_80mhz_array,
- QDF_ARRAY_SIZE(bonded_chan_80mhz_array),
- bonded_chan_ptr_ptr);
- else if (CH_WIDTH_160MHZ == ch_width)
- return cds_search_5g_bonded_chan_array(chan_num,
- bonded_chan_160mhz_array,
- QDF_ARRAY_SIZE(bonded_chan_160mhz_array),
- bonded_chan_ptr_ptr);
- else if (CH_WIDTH_80MHZ == ch_width)
- return cds_search_5g_bonded_chan_array(chan_num,
- bonded_chan_80mhz_array,
- QDF_ARRAY_SIZE(bonded_chan_80mhz_array),
- bonded_chan_ptr_ptr);
- else if (CH_WIDTH_40MHZ == ch_width)
- return cds_search_5g_bonded_chan_array(chan_num,
- bonded_chan_40mhz_array,
- QDF_ARRAY_SIZE(bonded_chan_40mhz_array),
- bonded_chan_ptr_ptr);
- else
- return cds_get_channel_state(chan_num);
-}
-
-enum channel_state cds_get_bonded_channel_state(uint16_t oper_ch,
- enum phy_ch_width ch_width,
- uint16_t sec_ch)
-{
- if (CDS_IS_CHANNEL_5GHZ(oper_ch))
- return cds_get_5g_bonded_channel_state(oper_ch,
- ch_width);
- else
- return cds_get_2g_bonded_channel_state(oper_ch,
- ch_width, sec_ch);
-}
-
-/**
- * cds_get_2g_bonded_channel_state() - get the 2G bonded channel state
- * @oper_ch: operating channel
- * @ch_width: channel width
- * @sec_ch: secondary channel
- *
- * Return: channel state
- */
-enum channel_state cds_get_2g_bonded_channel_state(uint16_t oper_ch,
- enum phy_ch_width ch_width,
- uint16_t sec_ch)
-{
- enum channel_enum chan_enum;
- enum channel_state chan_state;
- bool bw_enabled = false;
- enum channel_state chan_state2 = CHANNEL_STATE_INVALID;
-
- if (CH_WIDTH_40MHZ < ch_width)
- return CHANNEL_STATE_INVALID;
-
- if (CH_WIDTH_40MHZ == ch_width) {
- if ((sec_ch + 4 != oper_ch) &&
- (oper_ch + 4 != sec_ch))
- return CHANNEL_STATE_INVALID;
- chan_state2 = cds_get_channel_state(sec_ch);
- if (CHANNEL_STATE_INVALID == chan_state2)
- return chan_state2;
- }
-
- chan_state = cds_get_channel_state(oper_ch);
- if (chan_state2 < chan_state)
- chan_state = chan_state2;
-
- if ((CHANNEL_STATE_INVALID == chan_state) ||
- (CHANNEL_STATE_DISABLE == chan_state))
- return chan_state;
-
- chan_enum = cds_get_channel_enum(oper_ch);
- if (CH_WIDTH_5MHZ == ch_width)
- bw_enabled = true;
- else if (CH_WIDTH_10MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_10MHZ);
- else if (CH_WIDTH_20MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_20MHZ);
- else if (CH_WIDTH_40MHZ == ch_width)
- bw_enabled = !((reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_HT40) == IEEE80211_CHAN_NO_HT40);
-
- if (bw_enabled)
- return chan_state;
- else
- return CHANNEL_STATE_DISABLE;
-}
-
-/**
- * cds_get_5g_bonded_channel_state() - get the 5G bonded channel state
- * @chan_num: channel number
- * @ch_width: channel width
- *
- * Return: channel state
- */
-enum channel_state cds_get_5g_bonded_channel_state(
- uint16_t chan_num,
- enum phy_ch_width ch_width)
-{
- enum channel_enum chan_enum;
- enum channel_state chan_state;
- bool bw_enabled = false;
- const struct bonded_chan *bonded_chan_ptr = NULL;
-
- if (CH_WIDTH_80P80MHZ < ch_width)
- return CHANNEL_STATE_INVALID;
-
- chan_state = cds_search_5g_bonded_channel(chan_num, ch_width,
- &bonded_chan_ptr);
-
- if ((CHANNEL_STATE_INVALID == chan_state) ||
- (CHANNEL_STATE_DISABLE == chan_state))
- return chan_state;
-
- chan_enum = cds_get_channel_enum(chan_num);
- if (CH_WIDTH_5MHZ == ch_width)
- bw_enabled = true;
- else if (CH_WIDTH_10MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_10MHZ);
- else if (CH_WIDTH_20MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_20MHZ);
- else if (CH_WIDTH_40MHZ == ch_width)
- bw_enabled = !((reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_HT40) == IEEE80211_CHAN_NO_HT40);
- else if (CH_WIDTH_80MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_80MHZ);
- else if (CH_WIDTH_160MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_160MHZ);
- else if (CH_WIDTH_80P80MHZ == ch_width)
- bw_enabled = !(reg_channels[chan_enum].chan_flags &
- IEEE80211_CHAN_NO_80MHZ);
-
- if (bw_enabled)
- return chan_state;
- else
- return CHANNEL_STATE_DISABLE;
-}
-
-/**
- * cds_combine_channel_states() - combine channel states
- * @chan_state1: channel state1
- * @chan_state2: channel state2
- *
- * Return: enum channel_state
- */
- static enum channel_state cds_combine_channel_states(
- enum channel_state chan_state1,
- enum channel_state chan_state2)
-{
- if ((CHANNEL_STATE_INVALID == chan_state1) ||
- (CHANNEL_STATE_INVALID == chan_state2))
- return CHANNEL_STATE_INVALID;
- else
- return min(chan_state1, chan_state2);
-}
-
-/**
- * cds_set_5g_channel_params() - set the 5G bonded channel parameters
- * @oper_ch: opetrating channel
- * @ch_params: channel parameters
- *
- * Return: void
- */
-static void cds_set_5g_channel_params(uint16_t oper_ch,
- struct ch_params *ch_params)
-{
- enum channel_state chan_state = CHANNEL_STATE_ENABLE;
- enum channel_state chan_state2 = CHANNEL_STATE_ENABLE;
- const struct bonded_chan *bonded_chan_ptr = NULL;
- const struct bonded_chan *bonded_chan_ptr2 = NULL;
-
- if (CH_WIDTH_MAX <= ch_params->ch_width) {
- if (0 != ch_params->center_freq_seg1)
- ch_params->ch_width = CH_WIDTH_80P80MHZ;
- else
- ch_params->ch_width = CH_WIDTH_160MHZ;
- }
-
- while (ch_params->ch_width != CH_WIDTH_INVALID) {
- bonded_chan_ptr = NULL;
- bonded_chan_ptr2 = NULL;
- chan_state = cds_search_5g_bonded_channel(oper_ch,
- ch_params->ch_width,
- &bonded_chan_ptr);
-
- chan_state = cds_get_5g_bonded_channel_state(oper_ch,
- ch_params->ch_width);
-
- if (CH_WIDTH_80P80MHZ == ch_params->ch_width) {
- chan_state2 = cds_get_5g_bonded_channel_state(
- ch_params->center_freq_seg1 - 2,
- CH_WIDTH_80MHZ);
-
- chan_state = cds_combine_channel_states(chan_state,
- chan_state2);
- }
-
- if ((CHANNEL_STATE_ENABLE == chan_state) ||
- (CHANNEL_STATE_DFS == chan_state)) {
- if (CH_WIDTH_20MHZ >= ch_params->ch_width) {
- ch_params->sec_ch_offset
- = PHY_SINGLE_CHANNEL_CENTERED;
- ch_params->center_freq_seg0 = oper_ch;
- break;
- } else if (CH_WIDTH_40MHZ <= ch_params->ch_width) {
- cds_search_5g_bonded_chan_array(oper_ch,
- bonded_chan_40mhz_array,
- QDF_ARRAY_SIZE(bonded_chan_40mhz_array),
- &bonded_chan_ptr2);
- if (bonded_chan_ptr && bonded_chan_ptr2) {
- if (oper_ch ==
- bonded_chan_ptr2->start_ch)
- ch_params->sec_ch_offset =
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
- else
- ch_params->sec_ch_offset =
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
-
- ch_params->center_freq_seg0 =
- (bonded_chan_ptr->start_ch +
- bonded_chan_ptr->end_ch)/2;
- break;
- }
- }
- }
- ch_params->ch_width = next_lower_bw[ch_params->ch_width];
- }
- if (CH_WIDTH_160MHZ == ch_params->ch_width) {
- ch_params->center_freq_seg1 = ch_params->center_freq_seg0;
- chan_state = cds_search_5g_bonded_channel(oper_ch,
- CH_WIDTH_80MHZ,
- &bonded_chan_ptr);
- if (bonded_chan_ptr)
- ch_params->center_freq_seg0 =
- (bonded_chan_ptr->start_ch +
- bonded_chan_ptr->end_ch)/2;
- }
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
- "ch: %d ch_wd: %d freq0: %d freq1: %d", oper_ch,
- ch_params->ch_width, ch_params->center_freq_seg0,
- ch_params->center_freq_seg1);
-}
-
-/**
- * cds_set_2g_channel_params() - set the 2.4G bonded channel parameters
- * @oper_ch: operating channel
- * @ch_params: channel parameters
- * @sec_ch_2g: 2.4G secondary channel
- *
- * Return: void
- */
-static void cds_set_2g_channel_params(uint16_t oper_ch,
- struct ch_params *ch_params,
- uint16_t sec_ch_2g)
-{
- enum channel_state chan_state = CHANNEL_STATE_ENABLE;
-
- if (CH_WIDTH_MAX <= ch_params->ch_width)
- ch_params->ch_width = CH_WIDTH_40MHZ;
-
- if ((cds_bw_value(ch_params->ch_width) > 20) && !sec_ch_2g) {
- if (oper_ch >= 1 && oper_ch <= 5)
- sec_ch_2g = oper_ch + 4;
- else if (oper_ch >= 6 && oper_ch <= 13)
- sec_ch_2g = oper_ch - 4;
- }
-
- while (ch_params->ch_width != CH_WIDTH_INVALID) {
- chan_state = cds_get_2g_bonded_channel_state(oper_ch,
- ch_params->ch_width,
- sec_ch_2g);
- if (CHANNEL_STATE_ENABLE == chan_state) {
- if (CH_WIDTH_40MHZ == ch_params->ch_width) {
- if (oper_ch < sec_ch_2g)
- ch_params->sec_ch_offset =
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
- else
- ch_params->sec_ch_offset =
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
- ch_params->center_freq_seg0 =
- (oper_ch + sec_ch_2g)/2;
- } else
- ch_params->sec_ch_offset =
- PHY_SINGLE_CHANNEL_CENTERED;
- break;
- }
-
- ch_params->ch_width = next_lower_bw[ch_params->ch_width];
- }
-}
-
-/**
- * cds_set_channel_params() - set the bonded channel parameters
- * @oper_ch: operating channel
- * @sec_ch_2g: 2.4G secondary channel
- * @ch_params: chanel parameters
- *
- * Return: void
- */
-void cds_set_channel_params(uint16_t oper_ch, uint16_t sec_ch_2g,
- struct ch_params *ch_params)
-{
- if (CDS_IS_CHANNEL_5GHZ(oper_ch))
- cds_set_5g_channel_params(oper_ch, ch_params);
- else if (CDS_IS_CHANNEL_24GHZ(oper_ch))
- cds_set_2g_channel_params(oper_ch, ch_params, sec_ch_2g);
-}
-
-/**
- * cds_get_reg_domain_from_country_code() - get the regulatory domain
- * @reg_domain_ptr: ptr to store regulatory domain
- *
- * Return: QDF_STATUS_SUCCESS on success
- * QDF_STATUS_E_FAULT on error
- * QDF_STATUS_E_EMPTY country table empty
- */
-QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
- const uint8_t *country_alpha2,
- enum country_src source)
-{
- if (NULL == reg_domain_ptr) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "Invalid reg domain pointer");
- return QDF_STATUS_E_FAULT;
- }
-
- *reg_domain_ptr = 0;
-
- if (SOURCE_QUERY == source)
- return QDF_STATUS_SUCCESS;
-
- if (NULL == country_alpha2) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "Country code array is NULL");
- return QDF_STATUS_E_FAULT;
- }
-
- if (cds_is_driver_recovering()) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "SSR in progress, return");
- return QDF_STATUS_SUCCESS;
- }
-
- if (SOURCE_11D == source || SOURCE_USERSPACE == source)
- regulatory_hint_user(country_alpha2,
- NL80211_USER_REG_HINT_USER);
-
- return QDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_is_fcc_regdomian() - is the regdomain FCC
- *
- * Return: true on FCC regdomain, false otherwise
- */
-bool cds_is_fcc_regdomain(void)
-{
- v_REGDOMAIN_t domainId;
- hdd_context_t *hdd_ctx;
-
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (wlan_hdd_validate_context(hdd_ctx))
- return false;
- cds_get_reg_domain_from_country_code(&domainId,
- hdd_ctx->reg.alpha2, SOURCE_QUERY);
- if (REGDOMAIN_FCC == domainId)
- return true;
- return false;
-}
-
-/*
- * cds_is_dsrc_channel() - is the channel DSRC
- * @center_freq: center freq of the channel
- *
- * Return: true if dsrc channel
- * false otherwise
- */
-bool cds_is_dsrc_channel(uint16_t center_freq)
-{
- if (center_freq >= 5852 &&
- center_freq <= 5920)
- return true;
-
- return false;
-}
-
-/**
- * cds_set_reg_domain() - set regulatory domain
- * @client_ctxt: client context
- * @reg_domain: regulatory domain
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain)
-{
- if (reg_domain >= REGDOMAIN_COUNT) {
- QDF_TRACE(QDF_MODULE_ID_QDF_DEVICE, QDF_TRACE_LEVEL_ERROR,
- "CDS set reg domain, invalid REG domain ID %d",
- reg_domain);
- return QDF_STATUS_E_INVAL;
- }
-
- return QDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_put_default_country() - save the default country
- * @dfs_country: default country
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS cds_put_default_country(uint8_t *def_country)
-{
- default_country[0] = def_country[0];
- default_country[1] = def_country[1];
-
- return QDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_bw_value() - give bandwidth value
- * bw: bandwidth enum
- *
- * Return: uint16_t
- */
-uint16_t cds_bw_value(enum phy_ch_width bw)
-{
- switch (bw) {
- case CH_WIDTH_20MHZ:
- return 20;
- case CH_WIDTH_40MHZ:
- return 40;
- case CH_WIDTH_80MHZ:
- return 80;
- case CH_WIDTH_160MHZ:
- return 160;
- case CH_WIDTH_80P80MHZ:
- return 160;
- case CH_WIDTH_INVALID:
- return 0;
- case CH_WIDTH_5MHZ:
- return 10;
- case CH_WIDTH_10MHZ:
- return 5;
- case CH_WIDTH_MAX:
- return 160;
- default:
- return 0;
- }
-}
-
diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c
index 5540176..c4e182f 100644
--- a/core/cds/src/cds_regdomain.c
+++ b/core/cds/src/cds_regdomain.c
@@ -69,91 +69,6 @@
#include "wma.h"
#include "cds_regdomain.h"
-static struct reg_dmn_supp_op_classes reg_dmn_curr_supp_opp_classes = { 0 };
-
-static const struct reg_dmn_op_class_map_t global_op_class[] = {
- {81, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} },
- {82, 25, BW20, {14} },
- {83, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9} },
- {84, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13} },
- {115, 20, BW20, {36, 40, 44, 48} },
- {116, 40, BW40_LOW_PRIMARY, {36, 44} },
- {117, 40, BW40_HIGH_PRIMARY, {40, 48} },
- {118, 20, BW20, {52, 56, 60, 64} },
- {119, 40, BW40_LOW_PRIMARY, {52, 60} },
- {120, 40, BW40_HIGH_PRIMARY, {56, 64} },
- {121, 20, BW20,
- {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140} },
- {122, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132} },
- {123, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136} },
- {125, 20, BW20, {149, 153, 157, 161, 165, 169} },
- {126, 40, BW40_LOW_PRIMARY, {149, 157} },
- {127, 40, BW40_HIGH_PRIMARY, {153, 161} },
- {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108,
- 112, 116, 120, 124, 128, 132, 136, 140, 144,
- 149, 153, 157, 161} },
- {0, 0, 0, {0} },
-};
-
-static const struct reg_dmn_op_class_map_t us_op_class[] = {
- {1, 20, BW20, {36, 40, 44, 48} },
- {2, 20, BW20, {52, 56, 60, 64} },
- {4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
- 144} },
- {5, 20, BW20, {149, 153, 157, 161, 165} },
- {12, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} },
- {22, 40, BW40_LOW_PRIMARY, {36, 44} },
- {23, 40, BW40_LOW_PRIMARY, {52, 60} },
- {24, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132} },
- {26, 40, BW40_LOW_PRIMARY, {149, 157} },
- {27, 40, BW40_HIGH_PRIMARY, {40, 48} },
- {28, 40, BW40_HIGH_PRIMARY, {56, 64} },
- {29, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136} },
- {31, 40, BW40_HIGH_PRIMARY, {153, 161} },
- {32, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7} },
- {33, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11} },
- {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108,
- 112, 116, 120, 124, 128, 132, 136, 140, 144,
- 149, 153, 157, 161} },
- {0, 0, 0, {0} },
-};
-
-static const struct reg_dmn_op_class_map_t euro_op_class[] = {
- {1, 20, BW20, {36, 40, 44, 48} },
- {2, 20, BW20, {52, 56, 60, 64} },
- {3, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140} },
- {4, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} },
- {5, 40, BW40_LOW_PRIMARY, {36, 44} },
- {6, 40, BW40_LOW_PRIMARY, {52, 60} },
- {7, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132} },
- {8, 40, BW40_HIGH_PRIMARY, {40, 48} },
- {9, 40, BW40_HIGH_PRIMARY, {56, 64} },
- {10, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136} },
- {11, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9} },
- {12, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13} },
- {17, 20, BW20, {149, 153, 157, 161, 165, 169} },
- {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112,
- 116, 120, 124, 128} },
- {0, 0, 0, {0} },
-};
-
-static const struct reg_dmn_op_class_map_t japan_op_class[] = {
- {1, 20, BW20, {36, 40, 44, 48} },
- {30, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} },
- {31, 25, BW20, {14} },
- {32, 20, BW20, {52, 56, 60, 64} },
- {34, 20, BW20,
- {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140} },
- {36, 40, BW40_LOW_PRIMARY, {36, 44} },
- {37, 40, BW40_LOW_PRIMARY, {52, 60} },
- {39, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132} },
- {41, 40, BW40_HIGH_PRIMARY, {40, 48} },
- {42, 40, BW40_HIGH_PRIMARY, {56, 64} },
- {44, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136} },
- {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112,
- 116, 120, 124, 128} },
- {0, 0, 0, {0} },
-};
static const struct reg_dmn_pair g_reg_dmn_pairs[] = {
{NO_ENUMRD, FCC8, FCCA, CTRY_DEFAULT},
@@ -764,137 +679,3 @@
wma_set_dfs_region(wma, dfs_region);
}
-/**
- * cds_reg_dmn_get_chanwidth_from_opclass() - return chan width based on opclass
- * @country: country name
- * @channel: operating channel
- * @opclass: operating class
- *
- * Given a value of country, channel and opclass this API will return value of
- * channel width.
- *
- * Return: channel width
- *
- */
-uint16_t cds_reg_dmn_get_chanwidth_from_opclass(uint8_t *country,
- uint8_t channel,
- uint8_t opclass)
-{
- const struct reg_dmn_op_class_map_t *class;
- uint16_t i;
-
- if (!qdf_mem_cmp(country, "US", 2))
- class = us_op_class;
- else if (!qdf_mem_cmp(country, "EU", 2))
- class = euro_op_class;
- else if (!qdf_mem_cmp(country, "JP", 2))
- class = japan_op_class;
- else
- class = global_op_class;
-
- while (class->op_class) {
- if (opclass == class->op_class) {
- for (i = 0;
- (i < MAX_CHANNELS_PER_OPERATING_CLASS &&
- class->channels[i]);
- i++) {
- if (channel == class->channels[i])
- return class->ch_spacing;
- }
- }
- class++;
- }
-
- return 0;
-}
-
-
-/**
- * cds_reg_dmn_get_opclass_from_channel() - get operating class from channel
- * @country: the complete reg domain
- * @channel: channel number
- * @offset: the value of offset
- *
- * Return: operating class
- */
-uint16_t cds_reg_dmn_get_opclass_from_channel(uint8_t *country, uint8_t channel,
- uint8_t offset)
-{
- const struct reg_dmn_op_class_map_t *class = NULL;
- uint16_t i = 0;
-
- if (!qdf_mem_cmp(country, "US", 2)) {
- class = us_op_class;
- } else if (!qdf_mem_cmp(country, "EU", 2)) {
- class = euro_op_class;
- } else if (!qdf_mem_cmp(country, "JP", 2)) {
- class = japan_op_class;
- } else {
- class = global_op_class;
- }
-
- while (class->op_class) {
- if ((offset == class->offset) || (offset == BWALL)) {
- for (i = 0;
- (i < MAX_CHANNELS_PER_OPERATING_CLASS &&
- class->channels[i]); i++) {
- if (channel == class->channels[i])
- return class->op_class;
- }
- }
- class++;
- }
-
- return 0;
-}
-
-/**
- * cds_reg_dmn_set_curr_opclasses() - set the current operating class
- * @num_classes: number of classes
- * @class: operating class
- *
- * Return: error code
- */
-uint16_t cds_reg_dmn_set_curr_opclasses(uint8_t num_classes, uint8_t *class)
-{
- uint8_t i;
-
- if (CDS_MAX_SUPP_OPER_CLASSES < num_classes) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "invalid num classes %d", num_classes);
- return -1;
- }
-
- for (i = 0; i < num_classes; i++) {
- reg_dmn_curr_supp_opp_classes.classes[i] = class[i];
- }
-
- reg_dmn_curr_supp_opp_classes.num_classes = num_classes;
-
- return 0;
-}
-
-/**
- * cds_reg_dmn_get_curr_opclasses() - get the current operating class
- * @num_classes: number of classes
- * @class: operating class
- *
- * Return: error code
- */
-uint16_t cds_reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class)
-{
- uint8_t i;
-
- if (!num_classes || !class) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
- "either num_classes or class is null");
- return -1;
- }
-
- for (i = 0; i < reg_dmn_curr_supp_opp_classes.num_classes; i++)
- class[i] = reg_dmn_curr_supp_opp_classes.classes[i];
-
- *num_classes = reg_dmn_curr_supp_opp_classes.num_classes;
-
- return 0;
-}
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 1bbc75f..ebff3e3 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -9848,7 +9848,7 @@
#define CFG_ENABLE_REG_OFFLOAD_NAME "enable_reg_offload"
#define CFG_ENABLE_REG_OFFLOAD_MIN (0)
#define CFG_ENABLE_REG_OFFLOAD_MAX (1)
-#define CFG_ENABLE_REG_OFFLOAD_DEFAULT (0)
+#define CFG_ENABLE_REG_OFFLOAD_DEFAULT (1)
/*
* <ini>
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index f8b934c..fb77b49 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -454,7 +454,7 @@
uint8_t supported_channels_len;
uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
uint8_t supported_oper_classes_len;
- uint8_t supported_oper_classes[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t supported_oper_classes[REG_MAX_SUPP_OPER_CLASSES];
bool isForcedPeer;
uint8_t op_class_for_pref_off_chan;
uint8_t pref_off_chan_num;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 99e45dc..2f42c2b 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -74,6 +74,7 @@
#include "sap_api.h"
#include "csr_api.h"
#include "pld_common.h"
+
#ifdef WLAN_UMAC_CONVERGENCE
#include "wlan_cfg80211.h"
#endif
@@ -1200,6 +1201,11 @@
int con_ch;
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ if (!hdd_ctx) {
+ hdd_err("hdd context is NULL");
+ return 0;
+ }
+
/*
* Check if AP+AP case, once primary AP chooses a DFS
* channel secondary AP should always follow primary APs channel
@@ -1216,7 +1222,7 @@
con_sap_config = &con_sap_adapter->sessionCtx.ap.sapConfig;
con_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
- if (!CDS_IS_DFS_CH(con_ch))
+ if (!wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, con_ch))
return 0;
hdd_debug("Only SCC AP-AP DFS Permitted (ch=%d, con_ch=%d)",
@@ -1280,20 +1286,20 @@
int i;
if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211B) {
sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11b;
- sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1);
- sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_14);
+ sap_cfg->acs_cfg.start_ch = WLAN_REG_CH_NUM(CHAN_ENUM_1);
+ sap_cfg->acs_cfg.end_ch = WLAN_REG_CH_NUM(CHAN_ENUM_14);
} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211G) {
sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11g;
- sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1);
- sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_13);
+ sap_cfg->acs_cfg.start_ch = WLAN_REG_CH_NUM(CHAN_ENUM_1);
+ sap_cfg->acs_cfg.end_ch = WLAN_REG_CH_NUM(CHAN_ENUM_13);
} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211A) {
sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11a;
- sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_36);
- sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_165);
+ sap_cfg->acs_cfg.start_ch = WLAN_REG_CH_NUM(CHAN_ENUM_36);
+ sap_cfg->acs_cfg.end_ch = WLAN_REG_CH_NUM(CHAN_ENUM_165);
} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211ANY) {
sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_abg;
- sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1);
- sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_165);
+ sap_cfg->acs_cfg.start_ch = WLAN_REG_CH_NUM(CHAN_ENUM_1);
+ sap_cfg->acs_cfg.end_ch = WLAN_REG_CH_NUM(CHAN_ENUM_165);
}
if (ht_enabled)
@@ -1495,9 +1501,10 @@
bw_offset = 1 << BW_40_OFFSET_BIT;
else if (sap_config->acs_cfg.ch_width == CH_WIDTH_20MHZ)
bw_offset = 1 << BW_20_OFFSET_BIT;
- icv->freq = cds_get_channel_freq(chan);
+ icv->freq = wlan_reg_get_channel_freq(hdd_ctx->hdd_pdev, chan);
icv->ieee_chan_number = chan;
- icv->max_reg_power = cds_get_channel_reg_power(chan);
+ icv->max_reg_power = wlan_reg_get_channel_reg_power(
+ hdd_ctx->hdd_pdev, chan);
/* filling demo values */
icv->max_radio_power = HDD_MAX_TX_POWER;
@@ -1509,14 +1516,16 @@
WLAN_HDD_GET_HAL_CTX(adapter),
chan, bw_offset);
- if (CDS_IS_CHANNEL_5GHZ(chan)) {
+ if (WLAN_REG_IS_5GHZ_CH(chan)) {
ch_params.ch_width = sap_config->acs_cfg.ch_width;
- cds_set_channel_params(chan, 0, &ch_params);
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, chan,
+ 0, &ch_params);
icv->vht_center_freq_seg0 = ch_params.center_freq_seg0;
icv->vht_center_freq_seg1 = ch_params.center_freq_seg1;
}
+
icv->flags = 0;
- icv->flags = cds_get_vendor_reg_flags(chan,
+ icv->flags = cds_get_vendor_reg_flags(hdd_ctx->hdd_pdev, chan,
sap_config->acs_cfg.ch_width,
sap_config->acs_cfg.is_ht_enabled,
sap_config->acs_cfg.is_vht_enabled,
@@ -3148,7 +3157,6 @@
qdf_status = hdd_get_front_adapter(hdd_ctx,
&adapter_node);
-
while ((NULL != adapter_node) &&
(QDF_STATUS_SUCCESS == qdf_status)) {
adapter = adapter_node->pAdapter;
@@ -3165,9 +3173,9 @@
* single radio. But then we can have multiple
* radios !!
*/
- if (CHANNEL_STATE_DFS ==
- cds_get_channel_state(
- ap_ctx->operatingChannel)) {
+ if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
+ hdd_ctx->hdd_pdev,
+ ap_ctx->operatingChannel)) {
hdd_err("SAP running on DFS channel");
return true;
}
@@ -3183,9 +3191,9 @@
* do not disable scan on dfs channels
*/
if (hdd_conn_is_connected(sta_ctx) &&
- (CHANNEL_STATE_DFS ==
- cds_get_channel_state(
- sta_ctx->conn_info.operationChannel))) {
+ (CHANNEL_STATE_DFS ==
+ wlan_reg_get_channel_state(hdd_ctx->hdd_pdev,
+ sta_ctx->conn_info.operationChannel))) {
hdd_err("client connected on DFS channel");
return true;
}
@@ -7381,7 +7389,8 @@
}
if (found)
continue;
- if (CDS_IS_DFS_CH(channel_list[i])) {
+ if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
+ channel_list[i])) {
*pre_cac_chan = channel_list[i];
break;
}
@@ -7396,7 +7405,7 @@
* the user is expected to take care of this.
*/
if (!sme_is_channel_valid(hdd_ctx->hHal, channel) ||
- !CDS_IS_DFS_CH(channel)) {
+ !wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, channel)) {
hdd_err("Invalid channel for pre cac:%d", channel);
return -EINVAL;
}
@@ -7466,13 +7475,14 @@
return -EINVAL;
}
- if (CDS_IS_DFS_CH(hdd_ap_ctx->operatingChannel)) {
+ if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
+ hdd_ap_ctx->operatingChannel)) {
hdd_err("SAP is already on DFS channel:%d",
hdd_ap_ctx->operatingChannel);
return -EINVAL;
}
- if (!CDS_IS_CHANNEL_24GHZ(hdd_ap_ctx->operatingChannel)) {
+ if (!WLAN_REG_IS_24GHZ_CH(hdd_ap_ctx->operatingChannel)) {
hdd_err("pre CAC alllowed only when SAP is in 2.4GHz:%d",
hdd_ap_ctx->operatingChannel);
return -EINVAL;
@@ -8096,7 +8106,8 @@
ap_ctx->sapConfig.ch_params.ch_width =
ap_ctx->sapConfig.ch_width_orig;
- cds_set_channel_params(ap_ctx->sapConfig.channel,
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev,
+ ap_ctx->sapConfig.channel,
ap_ctx->sapConfig.sec_ch,
&ap_ctx->sapConfig.ch_params);
@@ -10153,13 +10164,13 @@
* This function is called from the supplicant through a
* private ioctl to change the band value
*/
-int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand)
+int wlan_hdd_cfg80211_update_band(hdd_context_t *hdd_ctx, struct wiphy *wiphy,
+ eCsrBand eBand)
{
int i, j;
enum channel_state channelEnabledState;
ENTER();
-
for (i = 0; i < NUM_NL80211_BANDS; i++) {
if (NULL == wiphy->bands[i])
@@ -10168,9 +10179,9 @@
for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
struct ieee80211_supported_band *band = wiphy->bands[i];
- channelEnabledState =
- cds_get_channel_state(band->channels[j].
- hw_value);
+ channelEnabledState = wlan_reg_get_channel_state(
+ hdd_ctx->hdd_pdev,
+ band->channels[j].hw_value);
if (NL80211_BAND_2GHZ == i && eCSR_BAND_5G == eBand) {
/* 5G only */
@@ -10840,7 +10851,7 @@
if (hdd_pConfig_ini->sapAllowAllChannel) {
/* Validate the channel */
for (count = CHAN_ENUM_1; count <= CHAN_ENUM_165; count++) {
- if (channel == CDS_CHANNEL_NUM(count)) {
+ if (channel == WLAN_REG_CH_NUM(count)) {
fValidChannel = true;
break;
}
@@ -12766,13 +12777,14 @@
hdd_station_ctx_t *station_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
struct hdd_mon_set_ch_info *ch_info = &station_ctx->ch_info;
uint8_t sec_ch = 0;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
/*
* CDS api expects secondary channel for calculating
* the channel params
*/
if ((ch_params->ch_width == CH_WIDTH_40MHZ) &&
- (CDS_IS_CHANNEL_24GHZ(operationChannel))) {
+ (WLAN_REG_IS_24GHZ_CH(operationChannel))) {
if (operationChannel >= 1 && operationChannel <= 5)
sec_ch = operationChannel + 4;
else if (operationChannel >= 6 && operationChannel <= 13)
@@ -12780,7 +12792,8 @@
}
/* This call decides required channel bonding mode */
- cds_set_channel_params(operationChannel, sec_ch, ch_params);
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, operationChannel,
+ sec_ch, ch_params);
if (QDF_GLOBAL_MONITOR_MODE == cds_get_conparam()) {
enum hdd_dot11_mode hdd_dot11_mode;
@@ -12879,8 +12892,9 @@
}
/* sap is on non-dfs channel, nothing to handle */
- if (!CDS_IS_DFS_CH(hdd_ap_ctx->operatingChannel)) {
- hdd_debug("sap is on non-dfs channel, sta is allowed");
+ if (!wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
+ hdd_ap_ctx->operatingChannel)) {
+ hdd_info("sap is on non-dfs channel, sta is allowed");
return true;
}
/*
@@ -12894,8 +12908,8 @@
* If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz
* channels for roaming case.
*/
- if (CDS_IS_CHANNEL_24GHZ(channel)) {
- hdd_debug("sap is on dfs, new sta conn on 2.4 is allowed");
+ if (WLAN_REG_IS_24GHZ_CH(channel)) {
+ hdd_info("sap is on dfs, new sta conn on 2.4 is allowed");
return true;
}
@@ -12905,7 +12919,7 @@
* to STA's channel to make scc, so we have room for 3port MCC
* scenario.
*/
- if ((0 == channel) || CDS_IS_DFS_CH(channel))
+ if ((0 == channel) || wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, channel))
channel = policy_mgr_get_nondfs_preferred_channel(
hdd_ctx->hdd_psoc, PM_SAP_MODE, true);
@@ -13186,7 +13200,7 @@
* In IBSS mode while operating in 2.4 GHz,
* the device supports only 20 MHz.
*/
- if (CDS_IS_CHANNEL_24GHZ(operatingChannel))
+ if (WLAN_REG_IS_24GHZ_CH(operatingChannel))
pRoamProfile->ch_params.ch_width =
CH_WIDTH_20MHZ;
hdd_select_cbmode(pAdapter, operatingChannel,
@@ -16650,13 +16664,14 @@
* the channel params
*/
if ((ch_params.ch_width == CH_WIDTH_40MHZ) &&
- (CDS_IS_CHANNEL_24GHZ(chan_num))) {
+ (WLAN_REG_IS_24GHZ_CH(chan_num))) {
if (chan_num >= 1 && chan_num <= 5)
sec_ch = chan_num + 4;
else if (chan_num >= 6 && chan_num <= 13)
sec_ch = chan_num - 4;
}
- cds_set_channel_params(chan_num, sec_ch, &ch_params);
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, chan_num,
+ sec_ch, &ch_params);
status = sme_roam_channel_change_req(hal_hdl, bssid, &ch_params,
&roam_profile);
if (status) {
@@ -16855,8 +16870,8 @@
num_5g = QDF_ARRAY_SIZE(hdd_channels_5_ghz);
for (; (index - num_2g) < num_5g; index++) {
- if (cds_is_dsrc_channel(
- hdd_channels_5_ghz[index - num_2g].center_freq))
+ if (WLAN_REG_IS_11P_CH(
+ hdd_channels_5_ghz[index - num_2g].hw_value))
continue;
hdd_ctx->chan_info[index].freq =
hdd_channels_5_ghz[index - num_2g].center_freq;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 61888c0..e6edcc2 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -351,7 +351,7 @@
hdd_adapter_t *adapter,
uint32_t no_dfs_flag);
-int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy,
+int wlan_hdd_cfg80211_update_band(hdd_context_t *hdd_ctx, struct wiphy *wiphy,
eCsrBand eBand);
/**
diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c
index 6f819ca..42e5ea3 100644
--- a/core/hdd/src/wlan_hdd_conc_ut.c
+++ b/core/hdd/src/wlan_hdd_conc_ut.c
@@ -38,7 +38,6 @@
#include "qdf_types.h"
#include "qdf_trace.h"
#include "cds_utils.h"
-#include "cds_reg_service.h"
#include "wma_types.h"
#include "wma.h"
#include "wma_api.h"
@@ -269,7 +268,7 @@
break;
case PM_5G:
for (first_idx = 0; first_idx < pcl_len; first_idx++) {
- if (!CDS_IS_CHANNEL_5GHZ(pcl[first_idx])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[first_idx])) {
snprintf(reason, reason_length,
"2G channel found");
return false;
@@ -278,7 +277,7 @@
break;
case PM_24G:
for (first_idx = 0; first_idx < pcl_len; first_idx++) {
- if (!CDS_IS_CHANNEL_24GHZ(pcl[first_idx])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[first_idx])) {
snprintf(reason, reason_length,
"5G channel found");
return false;
@@ -326,7 +325,7 @@
"No SCC found");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 2.4Ghz chnl");
return false;
@@ -344,14 +343,14 @@
"No SCC found");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 5Ghz chnl");
return false;
}
break;
case PM_24G_SCC_CH:
- if (!CDS_IS_CHANNEL_24GHZ(pcl[0])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[0])) {
snprintf(reason, reason_length,
"No 2.4Ghz chnl");
return false;
@@ -369,7 +368,7 @@
}
break;
case PM_5G_SCC_CH:
- if (!CDS_IS_CHANNEL_5GHZ(pcl[0])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[0])) {
snprintf(reason, reason_length,
"No 5Ghz chnl");
return false;
@@ -401,7 +400,7 @@
"MCC invalid");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 24Ghz chnl");
return false;
@@ -422,14 +421,14 @@
"MCC invalid");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 5Ghz chnl");
return false;
}
break;
case PM_24G_MCC_CH:
- if (!CDS_IS_CHANNEL_24GHZ(pcl[0])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[0])) {
snprintf(reason, reason_length,
"No 24Ghz chnl");
return false;
@@ -450,7 +449,7 @@
}
break;
case PM_5G_MCC_CH:
- if (!CDS_IS_CHANNEL_5GHZ(pcl[0])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[0])) {
snprintf(reason, reason_length,
"No 5Ghz chnl");
return false;
@@ -471,98 +470,98 @@
}
break;
case PM_SCC_ON_5_SCC_ON_24_24G:
- if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 5Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 24Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 24Ghz chnls");
return false;
}
break;
case PM_SCC_ON_5_SCC_ON_24_5G:
- if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 5Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 24Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 5Ghz chnls");
return false;
}
break;
case PM_SCC_ON_24_SCC_ON_5_24G:
- if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 24Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 5Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 24Ghz chnls");
return false;
}
break;
case PM_SCC_ON_24_SCC_ON_5_5G:
- if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 24Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 5Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[pcl_len - 1])) {
snprintf(reason, reason_length,
"No 5Ghz chnls");
return false;
}
break;
case PM_SCC_ON_5_SCC_ON_24:
- if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 5Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
@@ -576,14 +575,14 @@
}
break;
case PM_SCC_ON_24_SCC_ON_5:
- if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
+ if (!WLAN_REG_IS_24GHZ_CH(pcl[0]) ||
(pcl[0] != first_connection_chnl &&
pcl[0] != second_connection_chnl)) {
snprintf(reason, reason_length,
"No 24Ghz chnl/scc");
return false;
}
- if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
+ if (!WLAN_REG_IS_5GHZ_CH(pcl[1]) ||
(pcl[1] != first_connection_chnl &&
pcl[1] != second_connection_chnl)) {
snprintf(reason, reason_length,
diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c
index 22078d1..b283d5f 100644
--- a/core/hdd/src/wlan_hdd_ext_scan.c
+++ b/core/hdd/src/wlan_hdd_ext_scan.c
@@ -2309,25 +2309,27 @@
/**
* hdd_remove_dsrc_channels () - remove dsrc chanels
+ * @hdd_ctx: hdd context
* @wiphy: Pointer to wireless phy
* @chan_list: channel list
* @num_channels: number of channels
*
* Return: none
*/
-static void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list,
+static void hdd_remove_dsrc_channels(hdd_context_t *hdd_ctx,
+ struct wiphy *wiphy, uint32_t *chan_list,
uint8_t *num_channels)
{
uint8_t num_chan_temp = 0;
int i;
for (i = 0; i < *num_channels; i++) {
- if (!cds_is_dsrc_channel(chan_list[i])) {
+ if (!WLAN_REG_IS_11P_CH(wlan_reg_freq_to_chan(hdd_ctx->hdd_pdev,
+ chan_list[i]))) {
chan_list[num_chan_temp] = chan_list[i];
num_chan_temp++;
}
}
-
*num_channels = num_chan_temp;
}
@@ -2461,8 +2463,7 @@
num_channels = QDF_MIN(num_channels, maxChannels);
- hdd_remove_dsrc_channels(wiphy, chan_list, &num_channels);
-
+ hdd_remove_dsrc_channels(pHddCtx, wiphy, chan_list, &num_channels);
if ((QDF_SAP_MODE == pAdapter->device_mode) ||
!strncmp(hdd_get_fwpath(), "ap", 2))
hdd_remove_passive_channels(wiphy, chan_list,
@@ -2776,8 +2777,10 @@
chan_list[j];
req_msg->buckets[bkt_index].channels[j].
chnlClass = 0;
- if (CDS_IS_PASSIVE_OR_DISABLE_CH(
- cds_freq_to_chan(chan_list[j]))) {
+ if ((wlan_reg_get_channel_state(
+ hdd_ctx->hdd_pdev,
+ cds_freq_to_chan(chan_list[j]))) !=
+ CHANNEL_STATE_ENABLE) {
req_msg->buckets[bkt_index].channels[j].
passive = 1;
req_msg->buckets[bkt_index].channels[j].
@@ -2914,9 +2917,12 @@
hdd_debug("WiFi band is unspecified, dwellTime:%d",
req_msg->buckets[bkt_index].channels[j].dwellTimeMs);
- if (CDS_IS_PASSIVE_OR_DISABLE_CH(
+ if ((wlan_reg_get_channel_state(
+ hdd_ctx->hdd_pdev,
cds_freq_to_chan(
- req_msg->buckets[bkt_index].channels[j].channel))) {
+ req_msg->buckets[bkt_index].
+ channels[j].channel)))
+ != CHANNEL_STATE_ENABLE) {
req_msg->buckets[bkt_index].channels[j].dwellTimeMs =
hdd_ctx->config->extscan_passive_max_chn_time;
} else {
@@ -2928,9 +2934,11 @@
hdd_debug("New Dwell time %u ms",
req_msg->buckets[bkt_index].channels[j].dwellTimeMs);
- if (CDS_IS_PASSIVE_OR_DISABLE_CH(
- cds_freq_to_chan(
- req_msg->buckets[bkt_index].channels[j].channel))) {
+ if ((wlan_reg_get_channel_state(hdd_ctx->hdd_pdev,
+ cds_freq_to_chan(
+ req_msg->buckets[bkt_index].
+ channels[j].channel)))
+ != CHANNEL_STATE_ENABLE) {
if (min_dwell_time_passive_bucket >
req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
min_dwell_time_passive_bucket =
@@ -2966,9 +2974,11 @@
hdd_debug("Chnl spec passive %u",
req_msg->buckets[bkt_index].channels[j].passive);
/* Override scan type if required */
- if (CDS_IS_PASSIVE_OR_DISABLE_CH(
- cds_freq_to_chan(
- req_msg->buckets[bkt_index].channels[j].channel))) {
+ if ((wlan_reg_get_channel_state(hdd_ctx->hdd_pdev,
+ cds_freq_to_chan(
+ req_msg->buckets[bkt_index].
+ channels[j].channel)))
+ != CHANNEL_STATE_ENABLE) {
req_msg->buckets[bkt_index].channels[j].passive = true;
} else {
req_msg->buckets[bkt_index].channels[j].passive = false;
@@ -3000,7 +3010,6 @@
req_msg->max_dwell_time_active,
req_msg->min_dwell_time_passive,
req_msg->max_dwell_time_passive);
-
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 208b23e..645095f 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -82,7 +82,6 @@
#include <qca_vendor.h>
#include <cds_api.h>
#include <cdp_txrx_stats.h>
-
#include "wlan_hdd_he.h"
#define IS_UP(_dev) \
@@ -154,7 +153,8 @@
if (pHostapdState->bssState == BSS_STOP)
return;
- if (CHANNEL_STATE_DFS != cds_get_channel_state(channel))
+ if (CHANNEL_STATE_DFS != wlan_reg_get_channel_state(pHddCtx->hdd_pdev,
+ channel))
return;
/* Release wakelock when no more DFS channels are used */
@@ -192,7 +192,8 @@
(atomic_read(&pHddCtx->sap_dfs_ref_cnt) >= 1))
return;
- if (CHANNEL_STATE_DFS != cds_get_channel_state(channel))
+ if (CHANNEL_STATE_DFS != wlan_reg_get_channel_state(pHddCtx->hdd_pdev,
+ channel))
return;
/* Acquire wakelock if we have at least one DFS channel in use */
@@ -1246,7 +1247,8 @@
/* DFS requirement: DO NOT transmit during CAC. */
if ((CHANNEL_STATE_DFS !=
- cds_get_channel_state(pHddApCtx->operatingChannel))
+ wlan_reg_get_channel_state(pHddCtx->hdd_pdev,
+ pHddApCtx->operatingChannel))
|| ignoreCAC
|| pHddCtx->dev_dfs_cac_status == DFS_CAC_ALREADY_DONE)
pHddApCtx->dfs_cac_block_tx = false;
@@ -1257,8 +1259,9 @@
pHddApCtx->dfs_cac_block_tx, pHddApCtx,
pHostapdAdapter->sessionId);
- if ((CHANNEL_STATE_DFS ==
- cds_get_channel_state(pHddApCtx->operatingChannel))
+ if ((CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
+ pHddCtx->hdd_pdev,
+ pHddApCtx->operatingChannel))
&& (pHddCtx->config->IsSapDfsChSifsBurstEnabled == 0)) {
hdd_debug("Set SIFS Burst disable for DFS channel %d",
@@ -2382,6 +2385,7 @@
tHalHandle *hal_handle;
hdd_ap_ctx_t *hdd_ap_ctx;
uint16_t intf_ch = 0;
+ hdd_context_t *hdd_ctx;
hdd_adapter_t *ap_adapter = wlan_hdd_get_adapter_from_vdev(
psoc, vdev_id);
@@ -2411,6 +2415,7 @@
return QDF_STATUS_E_FAILURE;
}
+ hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
hdd_info("SAP restart orig chan: %d, new chan: %d",
hdd_ap_ctx->sapConfig.channel, intf_ch);
hdd_ap_ctx->sapConfig.channel = intf_ch;
@@ -2418,9 +2423,10 @@
hdd_ap_ctx->sapConfig.ch_width_orig;
hdd_ap_ctx->bss_stop_reason = BSS_STOP_DUE_TO_MCC_SCC_SWITCH;
- cds_set_channel_params(hdd_ap_ctx->sapConfig.channel,
- hdd_ap_ctx->sapConfig.sec_ch,
- &hdd_ap_ctx->sapConfig.ch_params);
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev,
+ hdd_ap_ctx->sapConfig.channel,
+ hdd_ap_ctx->sapConfig.sec_ch,
+ &hdd_ap_ctx->sapConfig.ch_params);
*channel = hdd_ap_ctx->sapConfig.channel;
*sec_ch = hdd_ap_ctx->sapConfig.sec_ch;
@@ -3223,7 +3229,7 @@
int32_t dfs_radar_found;
isDfsch = (CHANNEL_STATE_DFS ==
- cds_get_channel_state(ch));
+ wlan_reg_get_channel_state(pHddCtx->hdd_pdev, ch));
hdd_debug("Set QCASAP_SET_RADAR_CMD val %d", set_value);
@@ -4295,6 +4301,7 @@
band_start_channel = CHAN_ENUM_36;
band_end_channel = CHAN_ENUM_184;
}
+
if (cur_band != eCSR_BAND_24) {
if (hdd_ctx->config->dot11p_mode)
band_end_channel = CHAN_ENUM_184;
@@ -4315,11 +4322,13 @@
is_dfs_mode_enabled);
for (i = band_start_channel; i <= band_end_channel; i++) {
- if ((CHANNEL_STATE_ENABLE == CDS_CHANNEL_STATE(i)) ||
+ if ((CHANNEL_STATE_ENABLE ==
+ wlan_reg_get_channel_state(hdd_ctx->hdd_pdev, i)) ||
(is_dfs_mode_enabled &&
- CHANNEL_STATE_DFS == CDS_CHANNEL_STATE(i))) {
+ CHANNEL_STATE_DFS ==
+ wlan_reg_get_channel_state(hdd_ctx->hdd_pdev, i))) {
channel_list->channels[num_channels] =
- CDS_CHANNEL_NUM(i);
+ WLAN_REG_CH_NUM(i);
num_channels++;
}
}
@@ -7135,11 +7144,11 @@
cur_sap_st_ch = sap_config->acs_cfg.start_ch;
cur_sap_end_ch = sap_config->acs_cfg.end_ch;
- wlansap_extend_to_acs_range(
- &cur_sap_st_ch, &cur_sap_end_ch,
- &bandStartChannel, &bandEndChannel);
+ wlansap_extend_to_acs_range(hal, &cur_sap_st_ch,
+ &cur_sap_end_ch, &bandStartChannel,
+ &bandEndChannel);
- wlansap_extend_to_acs_range(
+ wlansap_extend_to_acs_range(hal,
&con_sap_st_ch, &con_sap_end_ch,
&bandStartChannel, &bandEndChannel);
@@ -7269,7 +7278,7 @@
eHT_CHANNEL_WIDTH_20MHZ;
}
sap_cfg->ch_params.ch_width = sap_cfg->ch_width_orig;
- cds_set_channel_params(sap_cfg->channel,
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, sap_cfg->channel,
sap_cfg->sec_ch, &sap_cfg->ch_params);
return 0;
@@ -7479,7 +7488,8 @@
goto error;
} else {
if (ret == 0) {
- if (CDS_IS_DFS_CH(pConfig->channel))
+ if (wlan_reg_is_dfs_ch(pHddCtx->hdd_pdev,
+ pConfig->channel))
pHddCtx->dev_dfs_cac_status =
DFS_CAC_NEVER_DONE;
}
@@ -7500,8 +7510,9 @@
/* reject SAP if DFS channel scan is not allowed */
if (!(pHddCtx->config->enableDFSChnlScan) &&
- (CHANNEL_STATE_DFS == cds_get_channel_state(
- pConfig->channel))) {
+ (CHANNEL_STATE_DFS ==
+ wlan_reg_get_channel_state(pHddCtx->hdd_pdev,
+ pConfig->channel))) {
hdd_err("No SAP start on DFS channel");
ret = -EOPNOTSUPP;
goto error;
@@ -8315,7 +8326,8 @@
hdd_err("Can't start SAP-ACS (channel=0) with sub 20 MHz ch width");
return -EINVAL;
}
- if (CHANNEL_STATE_DFS == cds_get_channel_state(channel)) {
+ if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
+ pHddCtx->hdd_pdev, channel)) {
hdd_err("Can't start SAP-DFS (channel=%d)with sub 20 MHz ch wd",
channel);
return -EINVAL;
@@ -8328,12 +8340,14 @@
sub_20_ch_width = CH_WIDTH_5MHZ;
if (cds_is_10_mhz_enabled())
sub_20_ch_width = CH_WIDTH_10MHZ;
- if (CDS_IS_CHANNEL_5GHZ(channel))
- ch_state = cds_get_5g_bonded_channel_state(channel,
- sub_20_ch_width);
+ if (WLAN_REG_IS_5GHZ_CH(channel))
+ ch_state = wlan_reg_get_5g_bonded_channel_state(
+ pHddCtx->hdd_pdev, channel,
+ sub_20_ch_width);
else
- ch_state = cds_get_2g_bonded_channel_state(channel,
- sub_20_ch_width, 0);
+ ch_state = wlan_reg_get_2g_bonded_channel_state(
+ pHddCtx->hdd_pdev, channel,
+ sub_20_ch_width, 0);
if (CHANNEL_STATE_DISABLE == ch_state) {
hdd_err("Given ch width not supported by reg domain");
return -EINVAL;
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index cb6b23a..4d56e5d 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -5959,7 +5959,7 @@
if (ret != 1)
return -EINVAL;
- if (CDS_IS_DFS_CH(set_value)) {
+ if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, set_value)) {
hdd_err("DFS channel %d is passed for hdd_set_tdls_offchannel",
set_value);
return -EINVAL;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 7109372..ba18c90 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -347,13 +347,13 @@
return -EOPNOTSUPP;
}
- if ((!CDS_IS_CHANNEL_24GHZ(chan_number)) &&
- (!CDS_IS_CHANNEL_5GHZ(chan_number))) {
+ if ((!WLAN_REG_IS_24GHZ_CH(chan_number)) &&
+ (!WLAN_REG_IS_5GHZ_CH(chan_number))) {
hdd_err("CH %d is not in 2.4GHz or 5GHz", chan_number);
return -EINVAL;
}
- if (CDS_IS_CHANNEL_24GHZ(chan_number)) {
+ if (WLAN_REG_IS_24GHZ_CH(chan_number)) {
if (chan_bw == CH_WIDTH_80MHZ) {
hdd_err("BW80 not possible in 2.4GHz band");
return -EINVAL;
@@ -365,7 +365,7 @@
}
}
- if (CDS_IS_CHANNEL_5GHZ(chan_number)) {
+ if (WLAN_REG_IS_5GHZ_CH(chan_number)) {
if ((chan_bw != CH_WIDTH_20MHZ) && (chan_number == 165) &&
(chan_bw != CH_WIDTH_MAX)) {
hdd_err("Only BW20 possible on channel 165");
@@ -1403,6 +1403,7 @@
QDF_BUG(0);
}
}
+
if (cds_cfg) {
if (hdd_ctx->config->enable_sub_20_channel_width !=
WLAN_SUB_20_CH_WIDTH_NONE && !cfg->sub_20_support) {
@@ -1562,7 +1563,8 @@
if ((QDF_SAP_MODE == adapter->device_mode ||
QDF_P2P_GO_MODE == adapter->device_mode) &&
(CHANNEL_STATE_DFS ==
- cds_get_channel_state(ap_ctx->operatingChannel))) {
+ wlan_reg_get_channel_state(hdd_ctx->hdd_pdev,
+ ap_ctx->operatingChannel))) {
WLAN_HDD_GET_AP_CTX_PTR(adapter)->
dfs_cac_block_tx = true;
hdd_debug("tx blocked for session:%d",
@@ -6662,7 +6664,8 @@
hdd_debug("chan:%d width:%d",
channel, hdd_ap_ctx->sapConfig.ch_width_orig);
- cds_set_channel_params(hdd_ap_ctx->sapConfig.channel,
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev,
+ hdd_ap_ctx->sapConfig.channel,
hdd_ap_ctx->sapConfig.sec_ch,
&hdd_ap_ctx->sapConfig.ch_params);
@@ -6859,23 +6862,23 @@
continue;
for (channel_loop = CHAN_ENUM_1; channel_loop <=
- CHAN_ENUM_184; channel_loop++) {
- if (CDS_CHANNEL_FREQ(channel_loop) >=
- ch_avoid_indi->avoid_freq_range[
- range_loop].start_freq) {
+ CHAN_ENUM_184; channel_loop++) {
+ if (WLAN_REG_CH_TO_FREQ(channel_loop) >=
+ ch_avoid_indi->avoid_freq_range[
+ range_loop].start_freq) {
start_channel_idx = channel_loop;
break;
}
}
for (channel_loop = CHAN_ENUM_1; channel_loop <=
- CHAN_ENUM_184; channel_loop++) {
- if (CDS_CHANNEL_FREQ(channel_loop) >=
- ch_avoid_indi->avoid_freq_range[
- range_loop].end_freq) {
+ CHAN_ENUM_184; channel_loop++) {
+ if (WLAN_REG_CH_TO_FREQ(channel_loop) >=
+ ch_avoid_indi->avoid_freq_range[
+ range_loop].end_freq) {
end_channel_idx = channel_loop;
- if (CDS_CHANNEL_FREQ(channel_loop) >
- ch_avoid_indi->avoid_freq_range[
- range_loop].end_freq)
+ if (WLAN_REG_CH_TO_FREQ(channel_loop) >
+ ch_avoid_indi->avoid_freq_range[
+ range_loop].end_freq)
end_channel_idx--;
break;
}
@@ -6889,7 +6892,7 @@
end_channel_idx; channel_loop++) {
hdd_ctxt->unsafe_channel_list[
hdd_ctxt->unsafe_channel_count++] =
- CDS_CHANNEL_NUM(channel_loop);
+ WLAN_REG_CH_NUM(channel_loop);
if (hdd_ctxt->unsafe_channel_count >=
NUM_CHANNELS) {
hdd_warn("LTECoex unsafe ch list full");
@@ -11648,11 +11651,10 @@
}
ap_adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
- if (ap_adapter != NULL &&
- test_bit(SOFTAP_BSS_STARTED,
- &ap_adapter->event_flags)
- && CDS_IS_DFS_CH(ap_adapter->sessionCtx.ap.
- operatingChannel)) {
+ if (ap_adapter != NULL && test_bit(SOFTAP_BSS_STARTED,
+ &ap_adapter->event_flags) &&
+ wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
+ ap_adapter->sessionCtx.ap.operatingChannel)) {
cds_warn("STA-AP Mode DFS not supported. Restart SAP with Non DFS ACS");
ap_adapter->sessionCtx.ap.sapConfig.channel =
diff --git a/core/hdd/src/wlan_hdd_object_manager.c b/core/hdd/src/wlan_hdd_object_manager.c
index bc7e57d..9344cbb 100644
--- a/core/hdd/src/wlan_hdd_object_manager.c
+++ b/core/hdd/src/wlan_hdd_object_manager.c
@@ -119,6 +119,7 @@
return -ENOMEM;
}
hdd_ctx->hdd_pdev = pdev;
+ sme_store_pdev(hdd_ctx->hHal, hdd_ctx->hdd_pdev);
hdd_init_pdev_os_priv(hdd_ctx, priv);
wlan_pdev_obj_lock(pdev);
wlan_pdev_set_tgt_if_handle(pdev, psoc->tgt_if_handle);
@@ -133,6 +134,7 @@
hdd_deinit_pdev_os_priv(hdd_ctx);
hdd_ctx->hdd_pdev = NULL;
+ sme_clear_pdev(hdd_ctx->hHal);
if (!pdev)
return -EINVAL;
diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c
index 29ac1d9..4ee6e2e 100644
--- a/core/hdd/src/wlan_hdd_oemdata.c
+++ b/core/hdd/src/wlan_hdd_oemdata.c
@@ -414,8 +414,8 @@
/* Passing CH_WIDTH_MAX will give the max bandwidth supported */
ch_params.ch_width = CH_WIDTH_MAX;
- cds_set_channel_params(chan, sec_ch_2g, &ch_params);
-
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, chan,
+ sec_ch_2g, &ch_params);
if (ch_params.center_freq_seg0)
hdd_chan_info->band_center_freq1 =
cds_chan_to_freq(ch_params.center_freq_seg0);
@@ -512,7 +512,8 @@
hddChanInfo.info = 0;
if (CHANNEL_STATE_DFS ==
- cds_get_channel_state(chanId))
+ wlan_reg_get_channel_state(p_hdd_ctx->hdd_pdev,
+ chanId))
WMI_SET_CHANNEL_FLAG(&hddChanInfo,
WMI_CHAN_FLAG_DFS);
diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c
index 75066e8..0ec4f6f 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -36,8 +36,7 @@
#include "wlan_hdd_main.h"
#include "wlan_hdd_regulatory.h"
#include <wlan_reg_ucfg_api.h>
-#include <wlan_reg_services_api.h>
-#include "cds_reg_service.h"
+#include "cds_regdomain.h"
#define REG_RULE_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
@@ -60,6 +59,8 @@
static bool init_by_driver;
static bool init_by_reg_core;
+struct regulatory_channel reg_channels[NUM_CHANNELS];
+
static const struct ieee80211_regdomain
hdd_world_regrules_60_61_62 = {
.n_reg_rules = 6,
@@ -129,7 +130,7 @@
* Return: regulatory rules ptr
*/
static const struct ieee80211_regdomain *hdd_get_world_regrules(
-struct regulatory *reg)
+ struct regulatory *reg)
{
struct reg_dmn_pair *regpair =
(struct reg_dmn_pair *)reg->regpair;
@@ -462,7 +463,7 @@
wiphy_chan_144->flags |= IEEE80211_CHAN_DISABLED;
}
- wlan_hdd_cfg80211_update_band(wiphy, band_capability);
+ wlan_hdd_cfg80211_update_band(hdd_ctx, wiphy, band_capability);
}
/**
@@ -531,7 +532,7 @@
reg_info->cc_src = SOURCE_DRIVER;
- cds_put_default_country(reg_info->alpha2);
+ wlan_reg_set_default_country(hdd_ctx->hdd_psoc, reg_info->alpha2);
cds_fill_and_send_ctl_to_fw(reg_info);
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index b54afbd..f207dfe 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -767,7 +767,7 @@
if (con_sap_adapter) {
con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
- if (CDS_IS_DFS_CH(con_dfs_ch)) {
+ if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, con_dfs_ch)) {
hdd_warn("##In DFS Master mode. Scan aborted");
return -EOPNOTSUPP;
}
@@ -1563,8 +1563,8 @@
con_dfs_ch =
con_sap_adapter->sessionCtx.ap.operatingChannel;
- if (!policy_mgr_is_hw_dbs_capable(pHddCtx->hdd_psoc)
- && CDS_IS_DFS_CH(con_dfs_ch)) {
+ if (!policy_mgr_is_hw_dbs_capable(pHddCtx->hdd_psoc) &&
+ wlan_reg_is_dfs_ch(pHddCtx->hdd_pdev, con_dfs_ch)) {
/* Provide empty scan result during DFS operation since
* scanning not supported during DFS. Reason is
* following case:
@@ -1770,9 +1770,10 @@
goto free_mem;
}
for (i = 0, len = 0; i < request->n_channels; i++) {
- if (cds_is_dsrc_channel(cds_chan_to_freq(
- request->channels[i]->hw_value)))
+ if (WLAN_REG_IS_11P_CH(
+ pHddCrequest->channels[i]->hw_value))
continue;
+
channelList[num_chan] = request->channels[i]->hw_value;
len += snprintf(chList + len, 5, "%d ", channelList[i]);
num_chan++;
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index a98a319..72d2b92 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -4585,7 +4585,7 @@
pHddCtx->tdls_external_peer_count++;
/* validate if off channel is DFS channel */
- if (CDS_IS_DFS_CH(chan)) {
+ if (wlan_reg_is_dfs_ch(pHddCtx->hdd_pdev, chan)) {
hdd_err("Resetting TDLS off-channel from %d to %d",
chan, CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT);
chan = CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT;
@@ -5006,8 +5006,9 @@
pTdlsPeer->
op_class_for_pref_off_chan;
- if (CDS_IS_DFS_CH(smeTdlsPeerStateParams.
- peerCap.prefOffChanNum)) {
+ if (wlan_reg_is_dfs_ch(pHddCtx->hdd_pdev,
+ smeTdlsPeerStateParams.
+ peerCap.prefOffChanNum)) {
hdd_err("Resetting TDLS off-channel from %d to %d",
smeTdlsPeerStateParams.peerCap.
prefOffChanNum,
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 7de5253..86c325e 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -12403,7 +12403,8 @@
band);
return -EINVAL;
}
- wlan_hdd_cfg80211_update_band(pHddCtx->wiphy, (eCsrBand) band);
+ wlan_hdd_cfg80211_update_band(pHddCtx, pHddCtx->wiphy,
+ (eCsrBand)band);
}
return 0;
}
@@ -12498,11 +12499,12 @@
QDF_MAC_ADDR_SIZE);
ch_params.ch_width = bandwidth;
- cds_set_channel_params(chan, 0, &ch_params);
+ wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, chan, 0, &ch_params);
if (ch_params.ch_width == CH_WIDTH_INVALID) {
hdd_err("Invalid capture channel or bandwidth for a country");
return -EINVAL;
}
+
status = sme_roam_channel_change_req(hal_hdl, bssid, &ch_params,
&roam_profile);
if (status) {
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index 421c699..79198e6 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -968,6 +968,7 @@
uint8_t user_configured_nss;
bool sta_prefer_80MHz_over_160MHz;
struct wlan_objmgr_psoc *psoc;
+ struct wlan_objmgr_pdev *pdev;
enum country_src reg_hint_src;
bool snr_monitor_enabled;
void (*chan_info_cb)(struct scan_chan_info *chan_info);
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 6468f06..d92ad7e 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -46,7 +46,6 @@
#endif
#include "qdf_types.h"
-#include "cds_reg_service.h"
#include "cds_regdomain.h"
#include "sir_types.h"
#include "sir_mac_prot_def.h"
@@ -56,6 +55,7 @@
#include "wmi_unified.h"
#include "wmi_unified_param.h"
#include "ol_txrx_htt_api.h"
+#include "wlan_reg_services_api.h"
#include <dot11f.h>
#include "wlan_policy_mgr_api.h"
@@ -3395,7 +3395,7 @@
uint8_t supportedChannelsLen;
uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
uint8_t supportedOperClassesLen;
- uint8_t supportedOperClasses[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
/* TDLS Request struct SME-->PE */
diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
index 25cfee0..3f7a97e 100644
--- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c
+++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
@@ -472,7 +472,7 @@
* down the link
*/
curr_chan = session->currentOperChannel;
- if (!lim_isconnected_on_dfs_channel(curr_chan)) {
+ if (!lim_isconnected_on_dfs_channel(mac_ctx, curr_chan)) {
/* Detected continuous Beacon Misses */
session->LimHBFailureStatus = true;
diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c
index 112d474..a3a44be 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -404,10 +404,12 @@
* and no concurrent session is running.
*/
if (!((session_entry->currentOperChannel != target_channel) &&
- ((cds_get_channel_state(target_channel)
- == CHANNEL_STATE_ENABLE) ||
- (cds_get_channel_state(target_channel) == CHANNEL_STATE_DFS &&
- !policy_mgr_concurrent_open_sessions_running(mac_ctx->psoc))))) {
+ ((wlan_reg_get_channel_state(mac_ctx->pdev, target_channel) ==
+ CHANNEL_STATE_ENABLE) ||
+ (wlan_reg_get_channel_state(mac_ctx->pdev, target_channel) ==
+ CHANNEL_STATE_DFS &&
+ !policy_mgr_concurrent_open_sessions_running(
+ mac_ctx->psoc))))) {
lim_log(mac_ctx, LOGE, FL("Channel %d is not valid"),
target_channel);
return;
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 148fdc7..27ff138 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -64,6 +64,7 @@
#include "qdf_mem.h"
#include "wlan_policy_mgr_api.h"
#include "nan_datapath.h"
+#include "wlan_reg_services_api.h"
void lim_log_session_states(tpAniSirGlobal pMac);
static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
@@ -1837,7 +1838,7 @@
* restart, in such a case, beacon params will be
* reset and thus will not contain Q2Q IE, by default
*/
- if (cds_get_channel_state(
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
session_entry->currentOperChannel)
!= CHANNEL_STATE_DFS) {
beacon_params.bssIdx = session_entry->bssIdx;
diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
index 83e84ed..f2576b8 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
@@ -46,6 +46,7 @@
#include "host_diag_core_log.h"
#endif
#include "wma_if.h"
+#include "wlan_reg_services_api.h"
static void lim_process_mlm_start_req(tpAniSirGlobal, uint32_t *);
static void lim_process_mlm_join_req(tpAniSirGlobal, uint32_t *);
@@ -288,7 +289,7 @@
return;
}
- if (true == lim_isconnected_on_dfs_channel(chan_num)) {
+ if (lim_isconnected_on_dfs_channel(mac_ctx, chan_num)) {
if (dfs_ch_list->timeStamp[chan_num] == 0) {
/*
* Received first beacon;
@@ -576,15 +577,18 @@
if (session->ch_width == CH_WIDTH_160MHZ) {
is_ch_dfs = true;
} else if (session->ch_width == CH_WIDTH_80P80MHZ) {
- if (cds_get_channel_state(mlm_start_req->channelNumber) ==
- CHANNEL_STATE_DFS ||
- cds_get_channel_state(session->ch_center_freq_seg1 -
- SIR_80MHZ_START_CENTER_CH_DIFF) ==
- CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ mlm_start_req->channelNumber) ==
+ CHANNEL_STATE_DFS ||
+ wlan_reg_get_channel_state(mac_ctx->pdev,
+ session->ch_center_freq_seg1 -
+ SIR_80MHZ_START_CENTER_CH_DIFF) ==
+ CHANNEL_STATE_DFS)
is_ch_dfs = true;
} else {
- if (cds_get_channel_state(mlm_start_req->channelNumber) ==
- CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ mlm_start_req->channelNumber) ==
+ CHANNEL_STATE_DFS)
is_ch_dfs = true;
}
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index ca96a87..fad1422 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -50,6 +50,7 @@
#include "lim_types.h"
#include "wlan_policy_mgr_api.h"
#include "nan_datapath.h"
+#include "wlan_reg_services_api.h"
#define MAX_SUPPORTED_PEERS_WEP 16
@@ -235,16 +236,16 @@
if (psessionEntry->ch_width == CH_WIDTH_160MHZ) {
send_bcon_ind = false;
} else if (psessionEntry->ch_width == CH_WIDTH_80P80MHZ) {
- if ((cds_get_channel_state(channelId) !=
- CHANNEL_STATE_DFS) &&
- (cds_get_channel_state(psessionEntry->
- ch_center_freq_seg1 -
+ if ((wlan_reg_get_channel_state(pMac->pdev, channelId)
+ != CHANNEL_STATE_DFS) &&
+ (wlan_reg_get_channel_state(pMac->pdev,
+ psessionEntry->ch_center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) !=
CHANNEL_STATE_DFS))
send_bcon_ind = true;
} else {
- if (cds_get_channel_state(channelId) !=
- CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(pMac->pdev, channelId)
+ != CHANNEL_STATE_DFS)
send_bcon_ind = true;
}
if (send_bcon_ind) {
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 08cd54d..bba41a9 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -1966,7 +1966,7 @@
/* Enable the spectrum management if this is a DFS channel */
if (session->country_info_present &&
- lim_isconnected_on_dfs_channel(
+ lim_isconnected_on_dfs_channel(mac_ctx,
session->currentOperChannel))
session->spectrumMgtEnabled = true;
@@ -2315,7 +2315,7 @@
/* Enable the spectrum management if this is a DFS channel */
if (session_entry->country_info_present &&
- lim_isconnected_on_dfs_channel(
+ lim_isconnected_on_dfs_channel(mac_ctx,
session_entry->currentOperChannel))
session_entry->spectrumMgtEnabled = true;
@@ -5984,7 +5984,7 @@
tpDphHashNode psta;
- op_class = cds_reg_dmn_get_opclass_from_channel(
+ op_class = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
new_channel,
ch_bandwidth);
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index 288d4b4..27aeee2 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -78,6 +78,7 @@
#include "wma_types.h"
#include "cds_regdomain.h"
#include "cds_utils.h"
+#include "wlan_reg_services_api.h"
#ifdef CONVERGED_TDLS_ENABLE
#include "wlan_tdls_tgt_api.h"
@@ -227,7 +228,7 @@
uint8_t chanOffset;
uint8_t op_class;
uint8_t numClasses;
- uint8_t classes[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t classes[REG_MAX_SUPP_OPER_CLASSES];
uint32_t band;
uint8_t nss_2g;
uint8_t nss_5g;
@@ -258,14 +259,13 @@
if ((band == eCSR_BAND_5G) &&
(NSS_2x2_MODE == nss_5g) &&
(NSS_1x1_MODE == nss_2g) &&
- (true == CDS_IS_DFS_CH(validChan[i]))) {
+ (wlan_reg_is_dfs_ch(pMac->pdev, validChan[i]))) {
lim_log(pMac, LOGD,
FL("skipping channel %d, nss_5g: %d, nss_2g: %d"),
validChan[i], nss_5g, nss_2g);
continue;
} else {
- if (true == cds_is_dsrc_channel(
- cds_chan_to_freq(validChan[i]))) {
+ if (WLAN_REG_IS_11P_CH(validChan[i])) {
lim_log(pMac, LOGD,
FL("skipping channel %d from the valid channel list"),
validChan[i]);
@@ -300,10 +300,9 @@
default:
chanOffset = BWALL;
break;
-
}
- op_class = cds_reg_dmn_get_opclass_from_channel(
+ op_class = wlan_reg_dmn_get_opclass_from_channel(
pMac->scan.countryCodeCurrent,
psessionEntry->currentOperChannel,
chanOffset);
@@ -328,11 +327,11 @@
suppOperClasses->present = 1;
suppOperClasses->classes[0] = op_class;
- cds_reg_dmn_get_curr_opclasses(&numClasses, &classes[0]);
+ wlan_reg_dmn_get_curr_opclasses(&numClasses, &classes[0]);
- for (i = 0; i < numClasses; i++) {
+ for (i = 0; i < numClasses; i++)
suppOperClasses->classes[i + 1] = classes[i];
- }
+
/* add one for present operating class, added in the beginning */
suppOperClasses->num_classes = numClasses + 1;
diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c
index e61d882..1d5d8b6 100644
--- a/core/mac/src/pe/lim/lim_send_messages.c
+++ b/core/mac/src/pe/lim/lim_send_messages.c
@@ -39,6 +39,7 @@
#include "lim_send_messages.h"
#include "cfg_api.h"
#include "lim_trace.h"
+#include "wlan_reg_services_api.h"
#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */
#include "host_diag_core_log.h"
#endif /* FEATURE_WLAN_DIAG_SUPPORT */
@@ -246,13 +247,16 @@
pChnlParams->isDfsChannel = true;
} else if (ch_width == CH_WIDTH_80P80MHZ) {
pChnlParams->isDfsChannel = false;
- if (cds_get_channel_state(chnlNumber) == CHANNEL_STATE_DFS ||
- cds_get_channel_state(pChnlParams->ch_center_freq_seg1 -
+ if (wlan_reg_get_channel_state(pMac->pdev, chnlNumber) ==
+ CHANNEL_STATE_DFS ||
+ wlan_reg_get_channel_state(pMac->pdev,
+ pChnlParams->ch_center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) ==
CHANNEL_STATE_DFS)
pChnlParams->isDfsChannel = true;
} else {
- if (cds_get_channel_state(chnlNumber) == CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(pMac->pdev, chnlNumber) ==
+ CHANNEL_STATE_DFS)
pChnlParams->isDfsChannel = true;
else
pChnlParams->isDfsChannel = false;
@@ -853,7 +857,7 @@
ht40_obss_scanind->obss_activity_threshold =
session->obss_ht40_scanparam.obss_activity_threshold;
ht40_obss_scanind->current_operatingclass =
- cds_reg_dmn_get_opclass_from_channel(
+ wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
session->currentOperChannel,
session->ch_width);
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 78ccb89..8f6684f 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -59,6 +59,7 @@
#include "lim_send_messages.h"
#include "nan_datapath.h"
#include "lim_assoc_utils.h"
+#include "wlan_reg_services_api.h"
#ifdef CONVERGED_TDLS_ENABLE
#include "wlan_tdls_tgt_api.h"
@@ -2097,8 +2098,8 @@
if ((ap_new_ch_width == CH_WIDTH_160MHZ) &&
!new_ch_width_dfn) {
ch_params.ch_width = CH_WIDTH_160MHZ;
- cds_set_channel_params(csa_params->channel, 0,
- &ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ csa_params->channel, 0, &ch_params);
ap_new_ch_width = ch_params.ch_width;
csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0;
csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1;
@@ -2227,7 +2228,7 @@
} else if (csa_params->ies_present_flag
& lim_xcsa_ie_present) {
chan_space =
- cds_reg_dmn_get_chanwidth_from_opclass(
+ wlan_reg_dmn_get_chanwidth_from_opclass(
mac_ctx->scan.countryCodeCurrent,
csa_params->channel,
csa_params->new_op_class);
@@ -2249,8 +2250,8 @@
ch_params.ch_width =
chnl_switch_info->newChanWidth;
- cds_set_channel_params(csa_params->channel,
- 0, &ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ csa_params->channel, 0, &ch_params);
chnl_switch_info->newCenterChanFreq0 =
ch_params.center_freq_seg0;
/*
@@ -2277,7 +2278,7 @@
if (csa_params->ies_present_flag
& lim_xcsa_ie_present) {
chan_space =
- cds_reg_dmn_get_chanwidth_from_opclass(
+ wlan_reg_dmn_get_chanwidth_from_opclass(
mac_ctx->scan.countryCodeCurrent,
csa_params->channel,
csa_params->new_op_class);
@@ -2290,7 +2291,7 @@
CH_WIDTH_40MHZ;
ch_params.ch_width =
chnl_switch_info->newChanWidth;
- cds_set_channel_params(
+ wlan_reg_set_channel_params(mac_ctx->pdev,
csa_params->channel,
0, &ch_params);
lim_ch_switch->ch_center_freq_seg0 =
@@ -2313,8 +2314,8 @@
lim_ch_switch->state =
eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
ch_params.ch_width = CH_WIDTH_40MHZ;
- cds_set_channel_params(csa_params->channel,
- 0, &ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ csa_params->channel, 0, &ch_params);
lim_ch_switch->ch_center_freq_seg0 =
ch_params.center_freq_seg0;
lim_ch_switch->sec_ch_offset =
@@ -2563,13 +2564,16 @@
if (ch_width == CH_WIDTH_160MHZ) {
is_ch_dfs = true;
} else if (ch_width == CH_WIDTH_80P80MHZ) {
- if (cds_get_channel_state(channelId) == CHANNEL_STATE_DFS ||
- cds_get_channel_state(ch_center_freq_seg1 -
- SIR_80MHZ_START_CENTER_CH_DIFF) ==
+ if (wlan_reg_get_channel_state(pMac->pdev, channelId) ==
+ CHANNEL_STATE_DFS ||
+ wlan_reg_get_channel_state(pMac->pdev,
+ ch_center_freq_seg1 -
+ SIR_80MHZ_START_CENTER_CH_DIFF) ==
CHANNEL_STATE_DFS)
is_ch_dfs = true;
} else {
- if (cds_get_channel_state(channelId) == CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(pMac->pdev, channelId) ==
+ CHANNEL_STATE_DFS)
is_ch_dfs = true;
}
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index b8b296b..b4beb08 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -58,6 +58,7 @@
#include "cds_reg_service.h"
#include "nan_datapath.h"
#include "wma.h"
+#include "wlan_reg_services_api.h"
#ifdef WLAN_FEATURE_11W
#include "wni_cfg.h"
@@ -5944,10 +5945,11 @@
return false;
}
-bool lim_isconnected_on_dfs_channel(uint8_t currentChannel)
+bool lim_isconnected_on_dfs_channel(tpAniSirGlobal mac_ctx,
+ uint8_t currentChannel)
{
if (CHANNEL_STATE_DFS ==
- cds_get_channel_state(currentChannel)) {
+ wlan_reg_get_channel_state(mac_ctx->pdev, currentChannel)) {
return true;
} else {
return false;
@@ -6454,7 +6456,7 @@
static inline bool lim_get_rx_ldpc(tpAniSirGlobal mac_ctx, uint8_t ch)
{
if (mac_ctx->roam.configParam.rxLdpcEnable &&
- wma_is_rx_ldpc_supported_for_channel(CDS_CHANNEL_NUM(ch)))
+ wma_is_rx_ldpc_supported_for_channel(WLAN_REG_CH_NUM(ch)))
return true;
else
return false;
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 93d3d2f..d7021a8 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -456,7 +456,8 @@
uint8_t lim_build_p2p_ie(tpAniSirGlobal pMac, uint8_t *ie, uint8_t *data,
uint8_t ie_len);
bool lim_is_noa_insert_reqd(tpAniSirGlobal pMac);
-bool lim_isconnected_on_dfs_channel(uint8_t currentChannel);
+bool lim_isconnected_on_dfs_channel(tpAniSirGlobal mac_ctx,
+ uint8_t currentChannel);
uint8_t lim_get_current_operating_channel(tpAniSirGlobal pMac);
uint32_t lim_get_max_rate_flags(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds);
diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
index 085b06f..ee1fbaf 100644
--- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c
+++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
@@ -189,7 +189,7 @@
ch_offset = session_entry->gLimChannelSwitch.sec_ch_offset;
dot_11_ptr->switch_mode = session_entry->gLimChannelSwitch.switchMode;
- dot_11_ptr->new_reg_class = cds_reg_dmn_get_opclass_from_channel(
+ dot_11_ptr->new_reg_class = wlan_reg_dmn_get_opclass_from_channel(
mac_ptr->scan.countryCodeCurrent,
session_entry->gLimChannelSwitch.primaryChannel,
ch_offset);
@@ -252,9 +252,9 @@
}
}
- cds_reg_dmn_get_curr_opclasses(&dot_11_ptr->num_classes,
+ wlan_reg_dmn_get_curr_opclasses(&dot_11_ptr->num_classes,
&dot_11_ptr->classes[1]);
- dot_11_ptr->classes[0] = cds_reg_dmn_get_opclass_from_channel(
+ dot_11_ptr->classes[0] = wlan_reg_dmn_get_opclass_from_channel(
mac_ptr->scan.countryCodeCurrent,
session_entry->currentOperChannel,
ch_bandwidth);
diff --git a/core/sap/dfs/inc/dfs.h b/core/sap/dfs/inc/dfs.h
index 0cb01d7..a074f70 100644
--- a/core/sap/dfs/inc/dfs.h
+++ b/core/sap/dfs/inc/dfs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2005-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -62,7 +62,8 @@
/* From wlan_modules/include/ */
#include "ath_dfs_structs.h"
/*DFS - Newly added File to interface cld UMAC and dfs data structures*/
-#include <wma_dfs_interface.h>
+#include "wlan_reg_services_api.h"
+#include "wma_dfs_interface.h"
/*
*TO DO DFS- Need to include this file later on
#include "ah.h"
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index 05b08b8..22192a8 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -1001,9 +1001,8 @@
eUpdateIEsType updateType);
QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_Config_t *pConfig,
eUpdateIEsType updateType);
-void wlansap_extend_to_acs_range(uint8_t *startChannelNum,
- uint8_t *endChannelNum,
- uint8_t *bandStartChannel,
+void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
+ uint8_t *endChannelNum, uint8_t *bandStartChannel,
uint8_t *bandEndChannel);
QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len);
QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf);
diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c
index 1e3982b..dc61669 100644
--- a/core/sap/src/sap_api_link_cntl.c
+++ b/core/sap/src/sap_api_link_cntl.c
@@ -57,6 +57,8 @@
#include "wma.h"
#include <wlan_objmgr_vdev_obj.h>
#include <wlan_objmgr_pdev_obj.h>
+#include "wlan_reg_services_api.h"
+
/*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants
* -------------------------------------------------------------------------*/
@@ -108,6 +110,7 @@
uint8_t operChannel = 0;
QDF_STATUS sap_sm_status;
uint32_t event;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
if (NULL == hal_handle) {
@@ -197,7 +200,7 @@
}
sap_ctx->ch_params.ch_width = sap_ctx->acs_cfg->ch_width;
- cds_set_channel_params(sap_ctx->channel,
+ wlan_reg_set_channel_params(mac_ctx->pdev, sap_ctx->channel,
sap_ctx->secondary_ch,
&sap_ctx->ch_params);
#ifdef SOFTAP_CHANNEL_RANGE
@@ -246,9 +249,11 @@
{
uint32_t channel = sap_ctx->acs_cfg->pri_ch;
struct ch_params ch_params = {0};
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
ch_params.ch_width = sap_ctx->acs_cfg->ch_width;
- cds_set_channel_params(channel, sec_ch, &ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev, channel, sec_ch,
+ &ch_params);
sap_ctx->acs_cfg->ch_width = ch_params.ch_width;
if (sap_ctx->acs_cfg->ch_width > CH_WIDTH_40MHZ)
sap_ctx->acs_cfg->vht_seg0_center_ch =
@@ -459,14 +464,17 @@
if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) {
is_ch_dfs = true;
} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
- if (cds_get_channel_state(sap_ctx->channel) ==
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->channel) ==
CHANNEL_STATE_DFS ||
- cds_get_channel_state(sap_ctx->ch_params.center_freq_seg1 -
+ wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->ch_params.center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) ==
CHANNEL_STATE_DFS)
is_ch_dfs = true;
} else {
- if (cds_get_channel_state(sap_ctx->channel) ==
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->channel) ==
CHANNEL_STATE_DFS)
is_ch_dfs = true;
}
@@ -596,8 +604,9 @@
* currently. For e.g. 20/40/80 MHz operation
*/
if (mac_ctx->sap.SapDfsInfo.target_channel)
- cds_set_channel_params(mac_ctx->sap.SapDfsInfo.target_channel,
- 0, &sap_ctx->ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ mac_ctx->sap.SapDfsInfo.target_channel,
+ 0, &sap_ctx->ch_params);
/*
* Fetch the number of SAP interfaces. If the number of sap Interface
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index 53497ef..eb8022f 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -55,6 +55,7 @@
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
#include "cds_utils.h"
#include "pld_common.h"
+#include "wlan_reg_services_api.h"
/*--------------------------------------------------------------------------
Function definitions
@@ -371,11 +372,13 @@
RETURN VALUE
NULL
============================================================================*/
-void sap_update_unsafe_channel_list(ptSapContext pSapCtx)
+void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx)
{
uint16_t i, j;
uint16_t unsafe_channel_list[NUM_CHANNELS];
uint16_t unsafe_channel_count = 0;
+ tpAniSirGlobal mac_ctx = NULL;
+
qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
if (!qdf_ctx) {
@@ -383,6 +386,12 @@
"qdf_ctx is NULL");
return;
}
+ mac_ctx = PMAC_STRUCT(hal);
+ if (!mac_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL,
+ "mac_ctx is NULL");
+ return;
+ }
/* Flush, default set all channel safe */
for (i = 0; i < NUM_CHANNELS; i++) {
@@ -393,7 +402,8 @@
#if defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
for (i = 0; i < NUM_CHANNELS; i++) {
if (pSapCtx->dfs_ch_disable == true) {
- if (CDS_IS_DFS_CH(safe_channels[i].channelNumber)) {
+ if (wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ safe_channels[i].channelNumber)) {
safe_channels[i].isSafe = false;
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_HIGH,
@@ -612,7 +622,7 @@
}
if (include_dfs_ch == false) {
- if (CDS_IS_DFS_CH(*pChans)) {
+ if (wlan_reg_is_dfs_ch(pMac->pdev, *pChans)) {
chSafe = false;
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_HIGH,
@@ -643,7 +653,7 @@
}
/* Skip DSRC channels */
- if (cds_is_dsrc_channel(cds_chan_to_freq(*pChans)))
+ if (WLAN_REG_IS_11P_CH(*pChans))
continue;
if (true == chSafe) {
@@ -1740,7 +1750,8 @@
*
* Return: none
*/
-static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams)
+static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams,
+ v_REGDOMAIN_t domain)
{
uint8_t i, j;
tSapSpectChInfo *pSpectInfo;
@@ -1834,7 +1845,7 @@
* channel. Mark the channel whose combination can't satisfy 40MHZ
* as max value, so that it will be sorted to the bottom.
*/
- if (cds_is_fcc_regdomain())
+ if (REGDOMAIN_FCC == domain)
ht40plus2gendch = HT40PLUS_2G_FCC_CH_END;
else
ht40plus2gendch = HT40PLUS_2G_EURJAP_CH_END;
@@ -1979,7 +1990,8 @@
============================================================================*/
static void sap_sort_chl_weight_all(ptSapContext pSapCtx,
tSapChSelSpectInfo *pSpectInfoParams,
- uint32_t operatingBand)
+ uint32_t operatingBand,
+ v_REGDOMAIN_t domain)
{
tSapSpectChInfo *pSpectCh = NULL;
uint32_t j = 0;
@@ -1993,11 +2005,11 @@
switch (pSapCtx->acs_cfg->ch_width) {
case CH_WIDTH_40MHZ:
if (eCSR_DOT11_MODE_11g == operatingBand)
- sap_sort_chl_weight_ht40_24_g(pSpectInfoParams);
+ sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
else if (eCSR_DOT11_MODE_11a == operatingBand)
sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
else {
- sap_sort_chl_weight_ht40_24_g(pSpectInfoParams);
+ sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
}
break;
@@ -2096,6 +2108,9 @@
uint32_t dfs_master_cap_enabled;
uint32_t start_ch_num = sap_ctx->acs_cfg->start_ch;
uint32_t end_ch_num = sap_ctx->acs_cfg->end_ch;
+ tpAniSirGlobal mac_ctx = NULL;
+
+ mac_ctx = PMAC_STRUCT(hal);
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("start - end: %d - %d"), start_ch_num, end_ch_num);
@@ -2124,7 +2139,8 @@
(safe_channels[i].channelNumber > end_ch_num))
continue;
- ch_type = cds_get_channel_state(safe_channels[i].channelNumber);
+ ch_type = wlan_reg_get_channel_state(mac_ctx->pdev,
+ safe_channels[i].channelNumber);
if ((ch_type == CHANNEL_STATE_DISABLE) ||
(ch_type == CHANNEL_STATE_INVALID))
@@ -2194,15 +2210,20 @@
tSapChSelSpectInfo *spect_info = &spect_info_obj;
uint8_t best_ch_num = SAP_CHANNEL_NOT_SELECTED;
uint32_t ht40plus2gendch = 0;
+ v_REGDOMAIN_t domain;
+ uint8_t country[CDS_COUNTRY_CODE_LEN];
#ifdef SOFTAP_CHANNEL_RANGE
uint8_t count;
uint32_t start_ch_num, end_ch_num, tmp_ch_num, operating_band = 0;
#endif
+ tpAniSirGlobal mac_ctx;
+
+ mac_ctx = PMAC_STRUCT(hal);
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
"In %s, Running SAP Ch Select", __func__);
#ifdef FEATURE_WLAN_CH_AVOID
- sap_update_unsafe_channel_list(sap_ctx);
+ sap_update_unsafe_channel_list(hal, sap_ctx);
#endif
if (NULL == scan_result) {
@@ -2230,6 +2251,8 @@
sap_process_avoid_ie(hal, sap_ctx, scan_result, spect_info);
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
+ wlan_reg_read_default_country(mac_ctx->psoc, country);
+ wlan_reg_get_domain_from_country_code(&domain, country, SOURCE_DRIVER);
#ifdef SOFTAP_CHANNEL_RANGE
start_ch_num = sap_ctx->acs_cfg->start_ch;
end_ch_num = sap_ctx->acs_cfg->end_ch;
@@ -2239,7 +2262,7 @@
sap_ctx->acsBestChannelInfo.weight = SAP_ACS_WEIGHT_MAX;
/* Sort the ch lst as per the computed weights, lesser weight first. */
- sap_sort_chl_weight_all(sap_ctx, spect_info, operating_band);
+ sap_sort_chl_weight_all(sap_ctx, spect_info, operating_band, domain);
/*Loop till get the best channel in the given range */
for (count = 0; count < spect_info->numSpectChans; count++) {
@@ -2335,8 +2358,7 @@
if ((operating_band != eCSR_DOT11_MODE_11g) ||
(sap_ctx->acs_cfg->ch_width != CH_WIDTH_40MHZ))
goto sap_ch_sel_end;
-
- if (cds_is_fcc_regdomain())
+ if (REGDOMAIN_FCC == domain)
ht40plus2gendch = HT40PLUS_2G_FCC_CH_END;
else
ht40plus2gendch = HT40PLUS_2G_EURJAP_CH_END;
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index 33788a9..8924590 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -58,6 +58,7 @@
#include <net/cfg80211.h>
#include <qca_vendor.h>
#include <wlan_scan_ucfg_api.h>
+#include "wlan_reg_services_api.h"
/*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants
@@ -804,7 +805,8 @@
SIDE EFFECTS
============================================================================*/
-static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext);
+static QDF_STATUS sap_get_5ghz_channel_list(tpAniSirGlobal mac_ctx,
+ ptSapContext sapContext);
/*==========================================================================
FUNCTION sapStopDfsCacTimer
@@ -1479,7 +1481,8 @@
}
}
- if (cds_get_channel_state(ch_id) == CHANNEL_STATE_DFS) {
+ if (wlan_reg_get_channel_state(mac_ctx->pdev, ch_id) ==
+ CHANNEL_STATE_DFS) {
is_ch_nol = sap_dfs_is_channel_in_nol_list(sap_ctx,
ch_id, PHY_SINGLE_CHANNEL_CENTERED);
if (true == is_ch_nol) {
@@ -1547,7 +1550,7 @@
uint8_t non_dfs_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
if (num_ch) {
for (i = 0; i < num_ch; i++) {
- if (CDS_IS_DFS_CH(ch_lst[i]))
+ if (wlan_reg_is_dfs_ch(mac_ctx->pdev, ch_lst[i]))
dfs_ch[dfs_num_ch++] = ch_lst[i];
else
non_dfs_ch[non_dfs_num_ch++] = ch_lst[i];
@@ -1784,7 +1787,7 @@
ch_wd = mac_ctx->sap.SapDfsInfo.orig_chanWidth;
}
- if (sap_get_5ghz_channel_list(sap_ctx)) {
+ if (sap_get_5ghz_channel_list(mac_ctx, sap_ctx)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_LOW,
FL("Getting 5Ghz channel list failed"));
return 0;
@@ -2316,7 +2319,8 @@
if (con_ch && sap_context->channel == AUTO_CHANNEL_SELECT) {
sap_context->dfs_ch_disable = true;
} else if (con_ch && sap_context->channel != con_ch &&
- CDS_IS_DFS_CH(sap_context->channel)) {
+ wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ sap_context->channel)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_WARN,
FL("MCC DFS not supported in AP_AP Mode"));
return QDF_STATUS_E_ABORTED;
@@ -2346,7 +2350,8 @@
"%s: Override ch %d to %d due to CC Intf",
__func__, sap_context->channel, con_ch);
sap_context->channel = con_ch;
- cds_set_channel_params(sap_context->channel, 0,
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ sap_context->channel, 0,
&sap_context->ch_params);
}
}
@@ -2358,7 +2363,8 @@
#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
if (sap_context->channel == AUTO_CHANNEL_SELECT)
sap_context->dfs_ch_disable = true;
- else if (CDS_IS_DFS_CH(sap_context->channel)) {
+ else if (wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ sap_context->channel)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_WARN,
FL("DFS not supported in STA_AP Mode"));
return QDF_STATUS_E_ABORTED;
@@ -2376,13 +2382,15 @@
sap_context->channel,
sap_context->csr_roamProfile.phyMode,
sap_context->cc_switch_mode);
- if (con_ch && !CDS_IS_DFS_CH(con_ch)) {
+ if (con_ch && !wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ con_ch)) {
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_ERROR,
"%s: Override ch %d to %d due to CC Intf",
__func__, sap_context->channel, con_ch);
sap_context->channel = con_ch;
- cds_set_channel_params(sap_context->channel, 0,
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ sap_context->channel, 0,
&sap_context->ch_params);
}
}
@@ -3758,8 +3766,10 @@
sap_ctx->channel, ch);
sap_ctx->channel = ch;
- cds_set_channel_params(sap_ctx->channel,
- sap_ctx->secondary_ch, &sap_ctx->ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev,
+ sap_ctx->channel,
+ sap_ctx->secondary_ch,
+ &sap_ctx->ch_params);
}
if (sap_ctx->channel > 14 &&
(sap_ctx->csr_roamProfile.phyMode == eCSR_DOT11_MODE_11g ||
@@ -3778,7 +3788,7 @@
uint16_t con_ch;
con_ch = sme_get_concurrent_operation_channel(hal);
- if (con_ch && CDS_IS_DFS_CH(con_ch))
+ if (con_ch && wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch))
sap_ctx->channel = con_ch;
}
@@ -3873,7 +3883,7 @@
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
"ENTERTRED CAC WAIT STATE-->eSAP_DISCONNECTING\n");
if (mac_ctx->sap.SapDfsInfo.target_channel) {
- cds_set_channel_params(
+ wlan_reg_set_channel_params(mac_ctx->pdev,
mac_ctx->sap.SapDfsInfo.target_channel, 0,
&sap_ctx->ch_params);
}
@@ -3983,15 +3993,17 @@
if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) {
is_dfs = true;
} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
- if (cds_get_channel_state(sap_ctx->channel) ==
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->channel) ==
CHANNEL_STATE_DFS ||
- cds_get_channel_state(sap_ctx->
- ch_params.center_freq_seg1 -
+ wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->ch_params.center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) ==
CHANNEL_STATE_DFS)
is_dfs = true;
} else {
- if (cds_get_channel_state(sap_ctx->channel) ==
+ if (wlan_reg_get_channel_state(mac_ctx->pdev,
+ sap_ctx->channel) ==
CHANNEL_STATE_DFS)
is_dfs = true;
}
@@ -4704,7 +4716,7 @@
start_ch_num, end_ch_num,
sap_ctx->acs_cfg->hw_mode);
- wlansap_extend_to_acs_range(&start_ch_num, &end_ch_num,
+ wlansap_extend_to_acs_range(hal, &start_ch_num, &end_ch_num,
&band_start_ch, &band_end_ch);
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
@@ -4740,8 +4752,8 @@
for (loop_count = band_start_ch; loop_count <= band_end_ch;
loop_count++) {
/* go to next channel if rf_channel is out of range */
- if ((start_ch_num > CDS_CHANNEL_NUM(loop_count)) ||
- (end_ch_num < CDS_CHANNEL_NUM(loop_count)))
+ if ((start_ch_num > WLAN_REG_CH_NUM(loop_count)) ||
+ (end_ch_num < WLAN_REG_CH_NUM(loop_count)))
continue;
/*
* go to next channel if none of these condition pass
@@ -4749,22 +4761,22 @@
* - DFS scan disable but chan in CHANNEL_STATE_ENABLE
*/
if (!(((eSAP_TRUE == mac_ctx->scan.fEnableDFSChnlScan) &&
- CDS_CHANNEL_STATE(loop_count)) ||
+ wlan_reg_get_channel_state(mac_ctx->pdev, loop_count)) ||
((eSAP_FALSE == mac_ctx->scan.fEnableDFSChnlScan) &&
(CHANNEL_STATE_ENABLE ==
- CDS_CHANNEL_STATE(loop_count)))))
+ wlan_reg_get_channel_state(mac_ctx->pdev, loop_count)))))
continue;
#ifdef FEATURE_WLAN_CH_AVOID
for (i = 0; i < NUM_CHANNELS; i++) {
if ((safe_channels[i].channelNumber ==
- CDS_CHANNEL_NUM(loop_count))) {
+ WLAN_REG_CH_NUM(loop_count))) {
/* Check if channel is safe */
if (true == safe_channels[i].isSafe) {
#endif
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
uint8_t ch;
- ch = CDS_CHANNEL_NUM(loop_count);
+ ch = WLAN_REG_CH_NUM(loop_count);
if ((sap_ctx->acs_cfg->skip_scan_status ==
eSAP_DO_PAR_ACS_SCAN)) {
if ((ch >= sap_ctx->acs_cfg->skip_scan_range1_stch &&
@@ -4772,7 +4784,7 @@
(ch >= sap_ctx->acs_cfg->skip_scan_range2_stch &&
ch <= sap_ctx->acs_cfg->skip_scan_range2_endch)) {
list[ch_count] =
- CDS_CHANNEL_NUM(loop_count);
+ WLAN_REG_CH_NUM(loop_count);
ch_count++;
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO,
@@ -4786,7 +4798,7 @@
}
} else {
list[ch_count] =
- CDS_CHANNEL_NUM(loop_count);
+ WLAN_REG_CH_NUM(loop_count);
ch_count++;
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO,
@@ -4794,7 +4806,7 @@
ch_count, ch);
}
#else
- list[ch_count] = CDS_CHANNEL_NUM(loop_count);
+ list[ch_count] = WLAN_REG_CH_NUM(loop_count);
ch_count++;
#endif
#ifdef FEATURE_WLAN_CH_AVOID
@@ -4837,14 +4849,14 @@
* Function for initializing list of 2.4/5 Ghz [NON-DFS/DFS]
* available channels in the current regulatory domain.
*/
-static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
+static QDF_STATUS sap_get_5ghz_channel_list(tpAniSirGlobal mac_ctx,
+ ptSapContext sapContext)
{
uint8_t count = 0;
int i;
struct sir_pcl_list pcl;
QDF_STATUS status;
enum channel_state ch_state;
- tpAniSirGlobal mac_ctx;
tHalHandle h_hal;
pcl.pcl_len = 0;
@@ -4856,7 +4868,6 @@
return QDF_STATUS_E_FAULT;
}
- mac_ctx = PMAC_STRUCT(h_hal);
if (NULL == mac_ctx) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
FL("Invalid MAC context"));
@@ -4899,8 +4910,9 @@
return status;
}
for (i = 0; i <= pcl.pcl_len; i++) {
- if (CDS_IS_CHANNEL_5GHZ(pcl.pcl_list[i])) {
- ch_state = cds_get_channel_state(pcl.pcl_list[i]);
+ if (WLAN_REG_IS_5GHZ_CH(pcl.pcl_list[i])) {
+ ch_state = wlan_reg_get_channel_state(mac_ctx->pdev,
+ pcl.pcl_list[i]);
if (!(ch_state == CHANNEL_STATE_ENABLE ||
ch_state == CHANNEL_STATE_DFS))
continue;
@@ -5206,12 +5218,13 @@
}
for (i = CHAN_ENUM_36; i <= CHAN_ENUM_165; i++) {
- if (CDS_CHANNEL_STATE(i) == CHANNEL_STATE_DFS) {
+ if (wlan_reg_get_channel_state(pMac->pdev, i) ==
+ CHANNEL_STATE_DFS) {
/* if dfs nol is not found, initialize it */
if (!bFound) {
pMac->sap.SapDfsInfo.sapDfsChannelNolList[count]
.dfs_channel_number =
- CDS_CHANNEL_NUM(i);
+ WLAN_REG_CH_NUM(i);
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_LOW,
diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h
index 9f0793c..aba167d 100644
--- a/core/sap/src/sap_internal.h
+++ b/core/sap/src/sap_internal.h
@@ -377,7 +377,7 @@
QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
#ifdef FEATURE_WLAN_CH_AVOID
-void sap_update_unsafe_channel_list(ptSapContext pSapCtx);
+void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx);
#endif /* FEATURE_WLAN_CH_AVOID */
uint8_t
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index f531d13..1f915d8 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -56,6 +56,7 @@
#include "cds_regdomain.h"
#include "wlan_policy_mgr_api.h"
#include <wlan_scan_ucfg_api.h>
+#include "wlan_reg_services_api.h"
/*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants
@@ -1653,7 +1654,7 @@
for (; bw >= BW20; bw--) {
uint16_t op_class;
- op_class = cds_reg_dmn_get_opclass_from_channel(
+ op_class = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel, bw);
if (!op_class)
@@ -1730,9 +1731,9 @@
* current regulatory domain.
*/
if (sapContext->channel != targetChannel &&
- ((cds_get_channel_state(targetChannel) ==
+ ((wlan_reg_get_channel_state(pMac->pdev, targetChannel) ==
CHANNEL_STATE_ENABLE) ||
- (cds_get_channel_state(targetChannel) ==
+ (wlan_reg_get_channel_state(pMac->pdev, targetChannel) ==
CHANNEL_STATE_DFS &&
!policy_mgr_is_any_mode_active_on_band_along_with_session(
pMac->psoc, sapContext->sessionId,
@@ -1796,7 +1797,7 @@
new_ch_params.ch_width,
target_bw);
}
- cds_set_channel_params(targetChannel,
+ wlan_reg_set_channel_params(pMac->pdev, targetChannel,
0, &pMac->sap.SapDfsInfo.new_ch_params);
/*
* Set the CSA IE required flag.
@@ -2693,7 +2694,8 @@
* which will result in channel width changing dynamically.
*/
ch_params = &mac_ctx->sap.SapDfsInfo.new_ch_params;
- cds_set_channel_params(target_channel, 0, ch_params);
+ wlan_reg_set_channel_params(mac_ctx->pdev, target_channel,
+ 0, ch_params);
sapContext->ch_params.ch_width = ch_params->ch_width;
/* Update the channel as this will be used to
* send event to supplicant
@@ -2838,8 +2840,9 @@
pMac->sap.SapDfsInfo.new_ch_params.ch_width =
pMac->sap.SapDfsInfo.new_chanWidth;
- cds_set_channel_params(pMac->sap.SapDfsInfo.target_channel,
- 0, &pMac->sap.SapDfsInfo.new_ch_params);
+ wlan_reg_set_channel_params(pMac->pdev,
+ pMac->sap.SapDfsInfo.target_channel,
+ 0, &pMac->sap.SapDfsInfo.new_ch_params);
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
"%s: chan:%d req:%d width:%d off:%d",
@@ -3270,17 +3273,23 @@
SIDE EFFECTS
============================================================================*/
-void wlansap_extend_to_acs_range(uint8_t *startChannelNum,
- uint8_t *endChannelNum,
- uint8_t *bandStartChannel,
- uint8_t *bandEndChannel)
+void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
+ uint8_t *endChannelNum, uint8_t *bandStartChannel,
+ uint8_t *bandEndChannel)
{
#define ACS_WLAN_20M_CH_INC 4
#define ACS_2G_EXTEND ACS_WLAN_20M_CH_INC
#define ACS_5G_EXTEND (ACS_WLAN_20M_CH_INC * 3)
uint8_t tmp_startChannelNum = 0, tmp_endChannelNum = 0;
+ tpAniSirGlobal mac_ctx;
+ mac_ctx = PMAC_STRUCT(hal);
+ if (!mac_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+ "%s: Invalid mac_ctx", __func__);
+ return;
+ }
if (*startChannelNum <= 14 && *endChannelNum <= 14) {
*bandStartChannel = CHAN_ENUM_1;
*bandEndChannel = CHAN_ENUM_14;
@@ -3309,15 +3318,17 @@
* spikes in DFS specturm channels which is due to emission spill.
* Remove the active channels from extend ACS range for DFS only range
*/
- if (CDS_IS_DFS_CH(*startChannelNum)) {
- while (!CDS_IS_DFS_CH(tmp_startChannelNum) &&
+ if (wlan_reg_is_dfs_ch(mac_ctx->pdev, *startChannelNum)) {
+ while (!wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ tmp_startChannelNum) &&
tmp_startChannelNum < *startChannelNum)
tmp_startChannelNum += ACS_WLAN_20M_CH_INC;
*startChannelNum = tmp_startChannelNum;
}
- if (CDS_IS_DFS_CH(*endChannelNum)) {
- while (!CDS_IS_DFS_CH(tmp_endChannelNum) &&
+ if (wlan_reg_is_dfs_ch(mac_ctx->pdev, *endChannelNum)) {
+ while (!wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ tmp_endChannelNum) &&
tmp_endChannelNum > *endChannelNum)
tmp_endChannelNum -= ACS_WLAN_20M_CH_INC;
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index a86cb45..64f0145 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -267,7 +267,7 @@
uint8_t supported_channels_len;
uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
uint8_t supported_oper_classes_len;
- uint8_t supported_oper_classes[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t supported_oper_classes[REG_MAX_SUPP_OPER_CLASSES];
} tCsrStaParams;
typedef struct tagCsrScanRequest {
@@ -1558,7 +1558,7 @@
uint8_t supportedChannelsLen;
uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
uint8_t supportedOperClassesLen;
- uint8_t supportedOperClasses[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
uint8_t qos;
} tCsrTdlsLinkEstablishParams;
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index 530d907..23043e5 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -1146,7 +1146,7 @@
(CSR_IS_OPEARTING_DUAL_BAND((pMac)) || \
CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
#define CSR_GET_BAND(ch_num) \
- ((CDS_IS_CHANNEL_24GHZ(ch_num)) ? eCSR_BAND_24 : eCSR_BAND_5G)
+ ((WLAN_REG_IS_24GHZ_CH(ch_num)) ? eCSR_BAND_24 : eCSR_BAND_5G)
#define CSR_IS_11D_INFO_FOUND(pMac) \
(0 != (pMac)->scan.channelOf11dInfo)
#define CSR_IS_ROAMING(pSession) \
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 8b68fc5..6b3e739 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -41,7 +41,6 @@
#include "qdf_lock.h"
#include "qdf_types.h"
#include "sir_api.h"
-#include "cds_reg_service.h"
#include "p2p_api.h"
#include "cds_regdomain.h"
#include "sme_internal.h"
@@ -159,7 +158,7 @@
#define BW_40_OFFSET_BIT 1
#define BW_80_OFFSET_BIT 2
#define BW_160_OFFSET_BIT 3
-typedef struct sme_tdls_chan_switch_params_struct {
+typedef struct sme_tdls_chan_switch_param_struct {
uint32_t vdev_id;
tSirMacAddr peer_mac_addr;
uint16_t tdls_off_ch_bw_offset;/* Target Off Channel Bandwidth offset */
@@ -1470,4 +1469,20 @@
bool (*get_connection_info_cb)(uint8_t *session_id,
enum scan_reject_states *reason));
+/**
+ * sme_store_pdev() - store pdev
+ * @hal - MAC global handle
+ * @pdev - pdev ptr
+ *
+ * Return: QDF_STATUS
+ */
+void sme_store_pdev(tHalHandle hal, struct wlan_objmgr_pdev *pdev);
+
+/**
+ * sme_clear_pdev() - clear pdev
+ * @hal - MAC global handle
+ *
+ * Return: QDF_STATUS
+ */
+void sme_clear_pdev(tHalHandle hal);
#endif /* #if !defined( __SME_API_H ) */
diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h
index d38ec77..50448e8 100644
--- a/core/sme/inc/sme_inside.h
+++ b/core/sme/inc/sme_inside.h
@@ -115,7 +115,7 @@
uint8_t supportedChannelsLen;
uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
uint8_t supportedOperClassesLen;
- uint8_t supportedOperClasses[CDS_MAX_SUPP_OPER_CLASSES];
+ uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
} tTdlsLinkEstablishCmdInfo;
typedef struct TdlsAddStaInfo {
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index c6c67c5..3a9f8cb 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -61,6 +61,7 @@
#include "sch_api.h"
#include "sme_nan_datapath.h"
#include "csr_api.h"
+#include "wlan_reg_services_api.h"
#define LOG_SIZE 256
@@ -1707,7 +1708,8 @@
for (count = 0; count < pPlmReq->plmNumCh; count++) {
ret = csr_is_supported_channel(pMac, pPlmReq->plmChList[count]);
if (ret && pPlmReq->plmChList[count] > 14) {
- if (CHANNEL_STATE_DFS == cds_get_channel_state(
+ if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
+ pMac->pdev,
pPlmReq->plmChList[count])) {
/* DFS channel is provided, no PLM bursts can be
* transmitted. Ignoring these channels.
@@ -6789,7 +6791,8 @@
pMac->roam.configParam.Is11dSupportEnabled =
pMac->roam.configParam.Is11dSupportEnabledOriginal;
- qdf_status = cds_read_default_country(default_country);
+ qdf_status = wlan_reg_read_default_country(pMac->psoc,
+ default_country);
/* read the country code and use it */
if (QDF_IS_STATUS_SUCCESS(qdf_status)) {
@@ -6853,11 +6856,9 @@
sme_warn("Country Code unrecognized by driver");
}
- status = wma_set_reg_domain(pMac, domainIdIoctl);
-
- if (status != QDF_STATUS_SUCCESS) {
- sme_err("fail to set regId %d", domainIdIoctl);
- return status;
+ if (domainIdIoctl >= REGDOMAIN_COUNT) {
+ sme_err("Invalid regId %d", domainIdIoctl);
+ return QDF_STATUS_E_FAILURE;
} else {
/* if 11d has priority, clear currentCountryBssid & countryCode11d to get */
/* set again if we find AP with 11d info during scan */
@@ -7780,7 +7781,7 @@
sme_err("Set Channel: %d", channel);
channel_state =
- cds_get_channel_state(channel);
+ wlan_reg_get_channel_state(mac_ctx->pdev, channel);
if (CHANNEL_STATE_DISABLE == channel_state) {
sme_err("Invalid channel: %d", channel);
@@ -9629,14 +9630,14 @@
for (i = 0; i < peerStateParams->peerCap.peerChanLen; i++) {
chanId = peerStateParams->peerCap.peerChan[i];
if (csr_roam_is_channel_valid(pMac, chanId) &&
- !(cds_get_channel_state(chanId) ==
+ !(wlan_reg_get_channel_state(pMac->pdev, chanId) ==
CHANNEL_STATE_DFS) &&
- !cds_is_dsrc_channel(cds_chan_to_freq(chanId))) {
+ !WLAN_REG_IS_11P_CH(chanId)) {
peer_cap->peerChan[num].chanId = chanId;
peer_cap->peerChan[num].pwr =
csr_get_cfg_max_tx_power(pMac, chanId);
peer_cap->peerChan[num].dfsSet = false;
- num++;
+ num++;
}
}
} else {
@@ -12377,6 +12378,7 @@
uint8_t numChannels = 0;
uint8_t i = 0;
uint32_t totValidChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal);
if (!aValidChannels || !pNumChannels) {
sme_err("Output channel list/NumChannels is NULL");
@@ -12408,7 +12410,7 @@
case WIFI_BAND_BG:
sme_debug("WIFI_BAND_BG (2.4 GHz)");
for (i = 0; i < totValidChannels; i++) {
- if (CDS_IS_CHANNEL_24GHZ(chanList[i])) {
+ if (WLAN_REG_IS_24GHZ_CH(chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -12418,8 +12420,8 @@
case WIFI_BAND_A:
sme_debug("WIFI_BAND_A (5 GHz without DFS)");
for (i = 0; i < totValidChannels; i++) {
- if (CDS_IS_CHANNEL_5GHZ(chanList[i]) &&
- !CDS_IS_DFS_CH(chanList[i])) {
+ if (WLAN_REG_IS_5GHZ_CH(chanList[i]) &&
+ !wlan_reg_is_dfs_ch(mac_ctx->pdev, chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -12429,9 +12431,9 @@
case WIFI_BAND_ABG:
sme_debug("WIFI_BAND_ABG (2.4 GHz + 5 GHz; no DFS)");
for (i = 0; i < totValidChannels; i++) {
- if ((CDS_IS_CHANNEL_24GHZ(chanList[i]) ||
- CDS_IS_CHANNEL_5GHZ(chanList[i])) &&
- !CDS_IS_DFS_CH(chanList[i])) {
+ if ((WLAN_REG_IS_24GHZ_CH(chanList[i]) ||
+ WLAN_REG_IS_5GHZ_CH(chanList[i])) &&
+ !wlan_reg_is_dfs_ch(mac_ctx->pdev, chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -12441,8 +12443,8 @@
case WIFI_BAND_A_DFS_ONLY:
sme_debug("WIFI_BAND_A_DFS (5 GHz DFS only)");
for (i = 0; i < totValidChannels; i++) {
- if (CDS_IS_CHANNEL_5GHZ(chanList[i]) &&
- CDS_IS_DFS_CH(chanList[i])) {
+ if (WLAN_REG_IS_5GHZ_CH(chanList[i]) &&
+ wlan_reg_is_dfs_ch(mac_ctx->pdev, chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -12452,7 +12454,7 @@
case WIFI_BAND_A_WITH_DFS:
sme_debug("WIFI_BAND_A_WITH_DFS (5 GHz with DFS)");
for (i = 0; i < totValidChannels; i++) {
- if (CDS_IS_CHANNEL_5GHZ(chanList[i])) {
+ if (WLAN_REG_IS_5GHZ_CH(chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -12462,8 +12464,8 @@
case WIFI_BAND_ABG_WITH_DFS:
sme_debug("WIFI_BAND_ABG_WITH_DFS (2.4 GHz+5 GHz with DFS)");
for (i = 0; i < totValidChannels; i++) {
- if (CDS_IS_CHANNEL_24GHZ(chanList[i]) ||
- CDS_IS_CHANNEL_5GHZ(chanList[i])) {
+ if (WLAN_REG_IS_24GHZ_CH(chanList[i]) ||
+ WLAN_REG_IS_5GHZ_CH(chanList[i])) {
aValidChannels[numChannels++] =
cds_chan_to_freq(chanList[i]);
}
@@ -14863,20 +14865,20 @@
* matching 20MHz, else for any BW.
*/
if (bw_offset & (1 << BW_40_OFFSET_BIT)) {
- *opclass = cds_reg_dmn_get_opclass_from_channel(
+ *opclass = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel, BW40_LOW_PRIMARY);
if (!(*opclass)) {
- *opclass = cds_reg_dmn_get_opclass_from_channel(
+ *opclass = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel, BW40_HIGH_PRIMARY);
}
} else if (bw_offset & (1 << BW_20_OFFSET_BIT)) {
- *opclass = cds_reg_dmn_get_opclass_from_channel(
+ *opclass = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel, BW20);
} else {
- *opclass = cds_reg_dmn_get_opclass_from_channel(
+ *opclass = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel, BWALL);
}
@@ -16141,3 +16143,42 @@
sms_log(mac, LOG1, FL("Registered RSO command status callback"));
return status;
}
+
+void sme_store_pdev(tHalHandle hal, struct wlan_objmgr_pdev *pdev)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+ void *wma_handle;
+ QDF_STATUS status;
+
+ status = wlan_objmgr_pdev_try_get_ref(pdev, WLAN_LEGACY_SME_ID);
+ if (QDF_STATUS_SUCCESS != status) {
+ mac_ctx->pdev = NULL;
+ return;
+ }
+ mac_ctx->pdev = pdev;
+ wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma_handle) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "wma handle is NULL");
+ return;
+ }
+ wma_store_pdev(wma_handle, pdev);
+}
+
+void sme_clear_pdev(tHalHandle hal)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+ void *wma_handle;
+
+ if (mac_ctx->pdev) {
+ wlan_objmgr_pdev_release_ref(mac_ctx->pdev, WLAN_LEGACY_SME_ID);
+ mac_ctx->pdev = NULL;
+ }
+ wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma_handle) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "wma handle is NULL");
+ return;
+ }
+ wma_clear_pdev(wma_handle);
+}
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 3f52c80..b51540e 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -56,6 +56,7 @@
#include "wlan_policy_mgr_api.h"
#include "sme_nan_datapath.h"
#include "pld_common.h"
+#include "wlan_reg_services_api.h"
#include <wlan_logging_sock_svc.h>
#include "wlan_objmgr_psoc_obj.h"
#include <wlan_scan_ucfg_api.h>
@@ -392,11 +393,9 @@
apCntryCode);
return status;
}
- status = wma_set_reg_domain(hHal, regId);
- if (status != QDF_STATUS_SUCCESS) {
- sme_err("fail to get regId for country Code %.2s",
- apCntryCode);
- return status;
+ if (regId >= REGDOMAIN_COUNT) {
+ sme_err("Invalid regId for country Code %.2s", apCntryCode);
+ return QDF_STATUS_E_FAILURE;
}
pMac->scan.domainIdDefault = regId;
pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
@@ -508,8 +507,9 @@
/* Fist copy Non-DFS 5g channels */
for (i = 0; i < num_channel; i++) {
- if (CDS_IS_CHANNEL_5GHZ(chan_list[i].chanId) &&
- !CDS_IS_DFS_CH(chan_list[i].chanId)) {
+ if (WLAN_REG_IS_5GHZ_CH(chan_list[i].chanId) &&
+ !wlan_reg_is_dfs_ch(mac_ctx->pdev,
+ chan_list[i].chanId)) {
qdf_mem_copy(&tmp_list[j++],
&chan_list[i], sizeof(tSirUpdateChanParam));
chan_list[i].chanId = INVALID_CHANNEL_ID;
@@ -518,7 +518,7 @@
if (prefer_dfs) {
/* next copy DFS channels (remaining channels in 5G) */
for (i = 0; i < num_channel; i++) {
- if (CDS_IS_CHANNEL_5GHZ(chan_list[i].chanId)) {
+ if (WLAN_REG_IS_5GHZ_CH(chan_list[i].chanId)) {
qdf_mem_copy(&tmp_list[j++], &chan_list[i],
sizeof(tSirUpdateChanParam));
chan_list[i].chanId = INVALID_CHANNEL_ID;
@@ -527,7 +527,7 @@
} else {
/* next copy 2G channels */
for (i = 0; i < num_channel; i++) {
- if (CDS_IS_CHANNEL_24GHZ(chan_list[i].chanId)) {
+ if (WLAN_REG_IS_24GHZ_CH(chan_list[i].chanId)) {
qdf_mem_copy(&tmp_list[j++], &chan_list[i],
sizeof(tSirUpdateChanParam));
chan_list[i].chanId = INVALID_CHANNEL_ID;
@@ -679,12 +679,12 @@
static QDF_STATUS csr_emu_chan_req(uint32_t channel)
{
int i;
- if (CDS_IS_CHANNEL_24GHZ(channel)) {
+ if (WLAN_REG_IS_24GHZ_CH(channel)) {
for (i = 0; i < QDF_ARRAY_SIZE(csr_start_ibss_channels24); i++) {
if (csr_start_ibss_channels24[i] == channel)
return QDF_STATUS_SUCCESS;
}
- } else if (CDS_IS_CHANNEL_5GHZ(channel)) {
+ } else if (WLAN_REG_IS_5GHZ_CH(channel)) {
for (i = 0; i < QDF_ARRAY_SIZE(csr_start_ibss_channels50); i++) {
if (csr_start_ibss_channels50[i] == channel)
return QDF_STATUS_SUCCESS;
@@ -727,7 +727,8 @@
if (CSR_IS_5G_BAND_ONLY(pMac)) {
for (i = 0; i < MAX_SOCIAL_CHANNELS; i++) {
- if (cds_get_channel_state(social_channel[i])
+ if (wlan_reg_get_channel_state(pMac->pdev,
+ social_channel[i])
== CHANNEL_STATE_ENABLE)
numChan++;
}
@@ -758,8 +759,7 @@
channel = pScan->base_channels.channelList[i];
- channel_state =
- cds_get_channel_state(
+ channel_state = wlan_reg_get_channel_state(pMac->pdev,
pScan->base_channels.channelList[i]);
if ((CHANNEL_STATE_ENABLE == channel_state) ||
pMac->scan.fEnableDFSChnlScan) {
@@ -783,10 +783,10 @@
}
}
if ((is_unsafe_chan) &&
- ((CDS_IS_CHANNEL_24GHZ(channel) &&
+ ((WLAN_REG_IS_24GHZ_CH(channel) &&
roam_policy->sap_operating_band ==
eCSR_BAND_24) ||
- (CDS_IS_CHANNEL_5GHZ(channel) &&
+ (WLAN_REG_IS_5GHZ_CH(channel) &&
roam_policy->sap_operating_band ==
eCSR_BAND_5G))) {
QDF_TRACE(QDF_MODULE_ID_SME,
@@ -846,7 +846,8 @@
if (CSR_IS_5G_BAND_ONLY(pMac)) {
for (j = 0; j < MAX_SOCIAL_CHANNELS; j++) {
- if (cds_get_channel_state(social_channel[j])
+ if (wlan_reg_get_channel_state(pMac->pdev,
+ social_channel[j])
!= CHANNEL_STATE_ENABLE)
continue;
pChanList->chanParam[num_channel].chanId =
@@ -1635,7 +1636,7 @@
}
if (eCSR_BAND_24 == eBand) {
for (i = 0; i < inNumChannels; i++) {
- if (CDS_IS_CHANNEL_24GHZ(inPtr[i])
+ if (WLAN_REG_IS_24GHZ_CH(inPtr[i])
&& csr_roam_is_channel_valid(pMac, inPtr[i])) {
ChannelList[outNumChannels++] = inPtr[i];
}
@@ -1643,16 +1644,16 @@
} else if (eCSR_BAND_5G == eBand) {
for (i = 0; i < inNumChannels; i++) {
/* Add 5G Non-DFS channel */
- if (CDS_IS_CHANNEL_5GHZ(inPtr[i]) &&
+ if (WLAN_REG_IS_5GHZ_CH(inPtr[i]) &&
csr_roam_is_channel_valid(pMac, inPtr[i]) &&
- !CDS_IS_DFS_CH(inPtr[i])) {
+ !wlan_reg_is_dfs_ch(pMac->pdev, inPtr[i])) {
ChannelList[outNumChannels++] = inPtr[i];
}
}
} else if (eCSR_BAND_ALL == eBand) {
for (i = 0; i < inNumChannels; i++) {
if (csr_roam_is_channel_valid(pMac, inPtr[i]) &&
- !CDS_IS_DFS_CH(inPtr[i])) {
+ !wlan_reg_is_dfs_ch(pMac->pdev, inPtr[i])) {
ChannelList[outNumChannels++] = inPtr[i];
}
}
@@ -1898,7 +1899,7 @@
if ((!mac_ctx->roam.configParam.allowDFSChannelRoam ||
(mac_ctx->roam.configParam.sta_roam_policy.dfs_mode ==
CSR_STA_ROAM_POLICY_DFS_DISABLED)) &&
- (CDS_IS_DFS_CH(*ch_lst))) {
+ (wlan_reg_is_dfs_ch(mac_ctx->pdev, *ch_lst))) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
("ignoring dfs channel %d"), *ch_lst);
ch_lst++;
@@ -3181,13 +3182,13 @@
uint8_t idx = 0, num_channels = 0;
for ( ; idx < ch_lst->numChannels; idx++) {
if (is_24_GHz) {
- if (CDS_IS_CHANNEL_24GHZ(ch_lst->channelList[idx])) {
+ if (WLAN_REG_IS_24GHZ_CH(ch_lst->channelList[idx])) {
ch_lst->channelList[num_channels] =
ch_lst->channelList[idx];
num_channels++;
}
} else {
- if (CDS_IS_CHANNEL_5GHZ(ch_lst->channelList[idx])) {
+ if (WLAN_REG_IS_5GHZ_CH(ch_lst->channelList[idx])) {
ch_lst->channelList[num_channels] =
ch_lst->channelList[idx];
num_channels++;
@@ -3287,9 +3288,9 @@
QDF_STATUS qdf_status;
uint8_t Index = 0;
- qdf_status =
- cds_get_channel_list_with_power(pMac->scan.defaultPowerTable,
- &num20MHzChannelsFound);
+ qdf_status = wlan_reg_get_channel_list_with_power(pMac->pdev,
+ pMac->scan.defaultPowerTable,
+ &num20MHzChannelsFound);
if ((QDF_STATUS_SUCCESS != qdf_status) ||
(num20MHzChannelsFound == 0)) {
@@ -4188,7 +4189,7 @@
return QDF_STATUS_E_FAILURE;
}
}
- if (CDS_IS_CHANNEL_5GHZ(pBssDesc->channelId))
+ if (WLAN_REG_IS_5GHZ_CH(pBssDesc->channelId))
pBssConfig->eBand = eCSR_BAND_5G;
else
pBssConfig->eBand = eCSR_BAND_24;
@@ -5032,11 +5033,11 @@
}
}
if (0 != channel) {
- if (CDS_IS_CHANNEL_24GHZ(channel)) { /* for now if we are on 2.4 Ghz, CB will be always disabled */
+ /* for now if we are on 2.4 Ghz, CB will be always disabled */
+ if (WLAN_REG_IS_24GHZ_CH(channel))
cfgCb = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
- } else {
+ else
cfgCb = pBssConfig->cbMode;
- }
}
/* Rate */
/* Fixed Rate */
@@ -12183,7 +12184,7 @@
* If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band
*/
- if (CDS_IS_CHANNEL_24GHZ(opr_ch) && !vht_24_ghz)
+ if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz)
/* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else
@@ -12199,7 +12200,7 @@
* If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band
*/
- if (CDS_IS_CHANNEL_24GHZ(opr_ch) && !vht_24_ghz)
+ if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz)
/* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else
@@ -12218,7 +12219,7 @@
* If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band
*/
- if (CDS_IS_CHANNEL_24GHZ(opr_ch) && !vht_24_ghz)
+ if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz)
/* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else
@@ -12237,7 +12238,7 @@
* check for INI item to disable VHT operation
* in 2.4 GHz band
*/
- if (CDS_IS_CHANNEL_24GHZ(opr_ch)
+ if (WLAN_REG_IS_24GHZ_CH(opr_ch)
&& !vht_24_ghz)
/* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
@@ -12257,7 +12258,7 @@
*band = mac_ctx->roam.configParam.eBand;
if (eCSR_BAND_24 == *band) {
/*
- * See reason in else if ( CDS_IS_CHANNEL_24GHZ
+ * See reason in else if ( WLAN_REG_IS_24GHZ_CH
* (opr_ch) ) to pick 11B
*/
*dot11_mode = eCSR_CFG_DOT11_MODE_11B;
@@ -12266,7 +12267,7 @@
*band = eCSR_BAND_5G;
*dot11_mode = eCSR_CFG_DOT11_MODE_11A;
}
- } else if (CDS_IS_CHANNEL_24GHZ(opr_ch)) {
+ } else if (WLAN_REG_IS_24GHZ_CH(opr_ch)) {
/*
* WiFi tests require IBSS networks to start in 11b mode
* without any change to the default parameter settings
@@ -12372,7 +12373,7 @@
&& ((eCSR_CFG_DOT11_MODE_11N == cfg_dot11_mode) ||
(eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode))) {
/* We cannot do 11n here */
- if (CDS_IS_CHANNEL_24GHZ(opr_chn))
+ if (WLAN_REG_IS_24GHZ_CH(opr_chn))
cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G;
else
cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11A;
@@ -12428,7 +12429,7 @@
return QDF_STATUS_E_FAILURE;
for (i = 0; i < *pNumChan; i++) {
- if (!cds_is_dsrc_channel(cds_chan_to_freq(pChannels[i]))) {
+ if (!WLAN_REG_IS_11P_CH(pChannels[i])) {
pChannels[num_chan_temp] = pChannels[i];
num_chan_temp++;
}
@@ -12449,10 +12450,10 @@
uint8_t firstChannel;
uint8_t maxChannels;
- if (CDS_IS_CHANNEL_5GHZ(channel)) {
+ if (WLAN_REG_IS_5GHZ_CH(channel)) {
cfgId = WNI_CFG_MAX_TX_POWER_5;
cfgLength = WNI_CFG_MAX_TX_POWER_5_LEN;
- } else if (CDS_IS_CHANNEL_24GHZ(channel)) {
+ } else if (WLAN_REG_IS_24GHZ_CH(channel)) {
cfgId = WNI_CFG_MAX_TX_POWER_2_4;
cfgLength = WNI_CFG_MAX_TX_POWER_2_4_LEN;
} else
@@ -12521,7 +12522,7 @@
ePhyChanBondState eRet = PHY_SINGLE_CHANNEL_CENTERED;
uint8_t centerChn;
uint32_t ChannelBondingMode;
- if (CDS_IS_CHANNEL_24GHZ(primaryChn)) {
+ if (WLAN_REG_IS_24GHZ_CH(primaryChn)) {
ChannelBondingMode =
pMac->roam.configParam.channelBondingMode24GHz;
} else {
@@ -12765,7 +12766,7 @@
if (!fFound) {
for (idxValidChannels = 0; idxValidChannels < len;
idxValidChannels++) {
- if (CDS_IS_CHANNEL_5GHZ(pMac->roam.
+ if (WLAN_REG_IS_5GHZ_CH(pMac->roam.
validChannelList[idxValidChannels])) {
/* the max channel# in 11g is 14 */
if (idxValidChannels <
@@ -13308,7 +13309,7 @@
&pSession->bssParams.
operationalRateSet);
if (CSR_IS_INFRA_AP(pProfile) || CSR_IS_START_IBSS(pProfile)) {
- if (CDS_IS_CHANNEL_24GHZ(Channel)) {
+ if (WLAN_REG_IS_24GHZ_CH(Channel)) {
cbMode =
pMac->roam.configParam.
channelBondingMode24GHz;
@@ -13871,7 +13872,7 @@
&size))) {
for (i = 0, j = 0; i < size; i++) {
/* Only add 5ghz channels.*/
- if (CDS_IS_CHANNEL_5GHZ
+ if (WLAN_REG_IS_5GHZ_CH
(mac_ctx->roam.validChannelList[i])) {
chan_list[j]
= mac_ctx->roam.validChannelList[i];
@@ -14008,7 +14009,7 @@
}
neigh_roam_info = &pMac->roam.neighborRoamInfo[sessionId];
if ((eWNI_SME_REASSOC_REQ == messageType) ||
- CDS_IS_CHANNEL_5GHZ(pBssDescription->channelId) ||
+ WLAN_REG_IS_5GHZ_CH(pBssDescription->channelId) ||
(abs(pBssDescription->rssi) <
(neigh_roam_info->cfgParams.neighborLookupThreshold -
neigh_roam_info->cfgParams.hi_rssi_scan_rssi_delta))) {
@@ -14443,11 +14444,11 @@
csr_join_req->txLdpcIniFeatureEnabled =
(uint8_t) pMac->roam.configParam.txLdpcEnable;
- if ((csr_is11h_supported(pMac))
- && (CDS_IS_CHANNEL_5GHZ(pBssDescription->channelId))
- && (pIes->Country.present)
- && (!pMac->roam.configParam.
- fSupplicantCountryCodeHasPriority)) {
+ if ((csr_is11h_supported(pMac)) &&
+ (WLAN_REG_IS_5GHZ_CH(pBssDescription->channelId)) &&
+ (pIes->Country.present) &&
+ (!pMac->roam.configParam.
+ fSupplicantCountryCodeHasPriority)) {
csr_save_to_channel_power2_g_5_g(pMac,
pIes->Country.num_triplets *
sizeof(tSirMacChanInfo),
@@ -14643,18 +14644,17 @@
* same as STA's channel.
*/
if (pMac->roam.configParam.conc_custom_rule1) {
- if ((0 ==
- pMac->
- roam.configParam.is_sta_connection_in_5gz_enabled)
- && CDS_IS_CHANNEL_5GHZ(pBssDescription->
- channelId)) {
+ if ((0 == pMac->roam.configParam.
+ is_sta_connection_in_5gz_enabled) &&
+ WLAN_REG_IS_5GHZ_CH(pBssDescription->
+ channelId)) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_ERROR,
"STA-conn on 5G isn't allowed");
status = QDF_STATUS_E_FAILURE;
break;
}
- if (!CDS_IS_CHANNEL_5GHZ(pBssDescription->channelId) &&
+ if (!WLAN_REG_IS_5GHZ_CH(pBssDescription->channelId) &&
(false == csr_is_conn_allow_2g_band(pMac,
pBssDescription->channelId))) {
status = QDF_STATUS_E_FAILURE;
@@ -14669,13 +14669,12 @@
* condition we are just adding sanity check to make sure that
* by this time P2PGO's channel is same as STA's channel.
*/
- if (pMac->roam.configParam.conc_custom_rule2) {
- if (!CDS_IS_CHANNEL_24GHZ(pBssDescription->channelId) &&
- (false == csr_is_conn_allow_5g_band(pMac,
- pBssDescription->channelId))) {
- status = QDF_STATUS_E_FAILURE;
- break;
- }
+ if (pMac->roam.configParam.conc_custom_rule2 &&
+ !WLAN_REG_IS_24GHZ_CH(pBssDescription->channelId) &&
+ (!csr_is_conn_allow_5g_band(pMac,
+ pBssDescription->channelId))) {
+ status = QDF_STATUS_E_FAILURE;
+ break;
}
status = umac_send_mb_message_to_mac(csr_join_req);
if (!QDF_IS_STATUS_SUCCESS(status)) {
@@ -16941,10 +16940,10 @@
if (eCSR_BAND_ALL == band)
return true;
- if (eCSR_BAND_24 == band && CDS_IS_CHANNEL_24GHZ(channel))
+ if (eCSR_BAND_24 == band && WLAN_REG_IS_24GHZ_CH(channel))
return true;
- if (eCSR_BAND_5G == band && CDS_IS_CHANNEL_5GHZ(channel))
+ if (eCSR_BAND_5G == band && WLAN_REG_IS_5GHZ_CH(channel))
return true;
return false;
@@ -17003,7 +17002,7 @@
if ((!mac_ctx->roam.configParam.allowDFSChannelRoam ||
(mac_ctx->roam.configParam.sta_roam_policy.dfs_mode ==
CSR_STA_ROAM_POLICY_DFS_DISABLED)) &&
- (CDS_IS_DFS_CH(*ch_lst))) {
+ (wlan_reg_is_dfs_ch(mac_ctx->pdev, *ch_lst))) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
("ignoring dfs channel %d"), *ch_lst);
ch_lst++;
@@ -17084,7 +17083,7 @@
if ((!mac_ctx->roam.configParam.allowDFSChannelRoam ||
(mac_ctx->roam.configParam.sta_roam_policy.dfs_mode ==
CSR_STA_ROAM_POLICY_DFS_DISABLED)) &&
- (CDS_IS_DFS_CH(*ch_lst))) {
+ (wlan_reg_is_dfs_ch(mac_ctx->pdev, *ch_lst))) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
("ignoring dfs channel %d"), *ch_lst);
ch_lst++;
@@ -17116,7 +17115,9 @@
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
"DFSRoam=%d, ChnlState=%d, Chnl=%d, num_ch=%d",
mac_ctx->roam.configParam.allowDFSChannelRoam,
- cds_get_channel_state(*ch_lst), *ch_lst,
+ wlan_reg_get_channel_state(mac_ctx->pdev,
+ *ch_lst),
+ *ch_lst,
num_channels);
ch_lst++;
}
@@ -17186,7 +17187,7 @@
if ((!mac_ctx->roam.configParam.allowDFSChannelRoam ||
(mac_ctx->roam.configParam.sta_roam_policy.dfs_mode ==
CSR_STA_ROAM_POLICY_DFS_DISABLED)) &&
- (CDS_IS_DFS_CH(*ch_lst))) {
+ (wlan_reg_is_dfs_ch(mac_ctx->pdev, *ch_lst))) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
("ignoring dfs channel %d"), *ch_lst);
ch_lst++;
@@ -19396,11 +19397,11 @@
sme_debug("Num of %s channels, %d",
ch_name, num_channels);
- for (idx = 0; idx < num_channels
- && *i < (CDS_MAX_SUPP_OPER_CLASSES - 1); idx++) {
+ for (idx = 0; idx < num_channels &&
+ *i < (REG_MAX_SUPP_OPER_CLASSES - 1); idx++) {
for (ch_bandwidth = BW20; ch_bandwidth < BWALL;
ch_bandwidth++) {
- class = cds_reg_dmn_get_opclass_from_channel(
+ class = wlan_reg_dmn_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
channel_info->channelList[idx],
ch_bandwidth);
@@ -19408,7 +19409,7 @@
channel_info->channelList[idx], class);
found = false;
- for (j = 0; j < CDS_MAX_SUPP_OPER_CLASSES - 1;
+ for (j = 0; j < REG_MAX_SUPP_OPER_CLASSES - 1;
j++) {
if (op_classes[j] == class) {
found = true;
@@ -19436,7 +19437,7 @@
uint8_t j = 0;
uint8_t swap = 0;
uint8_t numClasses = 0;
- uint8_t opClasses[CDS_MAX_SUPP_OPER_CLASSES] = {0,};
+ uint8_t opClasses[REG_MAX_SUPP_OPER_CLASSES] = {0,};
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
sme_debug("Current Country = %c%c",
@@ -19470,7 +19471,7 @@
/* Set the ordered list of op classes in regdomain
* for use by other modules
*/
- cds_reg_dmn_set_curr_opclasses(numClasses, &opClasses[0]);
+ wlan_reg_dmn_set_curr_opclasses(numClasses, &opClasses[0]);
}
/**
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index db7e3a9..ffb6ebe 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -62,6 +62,7 @@
#include <wlan_objmgr_pdev_obj.h>
#include <wlan_utility.h>
#endif
+#include "wlan_reg_services_api.h"
#define MIN_CHN_TIME_TO_FIND_GO 100
#define MAX_CHN_TIME_TO_FIND_GO 100
@@ -1935,16 +1936,16 @@
* Now set the inter-channel offset based on the frequency band
* the channel set lies in
*/
- if ((CDS_IS_CHANNEL_24GHZ(pChannelSet->firstChannel)) &&
+ if ((WLAN_REG_IS_24GHZ_CH(pChannelSet->firstChannel)) &&
((pChannelSet->firstChannel +
(pChannelSet->numChannels - 1)) <=
- CDS_MAX_24GHZ_CHANNEL_NUMBER)) {
+ WLAN_REG_MAX_24GHZ_CH_NUM)) {
pChannelSet->interChannelOffset = 1;
f2GHzInfoFound = true;
- } else if ((CDS_IS_CHANNEL_5GHZ(pChannelSet->firstChannel))
+ } else if ((WLAN_REG_IS_5GHZ_CH(pChannelSet->firstChannel))
&& ((pChannelSet->firstChannel +
((pChannelSet->numChannels - 1) * 4)) <=
- CDS_MAX_5GHZ_CHANNEL_NUMBER)) {
+ WLAN_REG_MAX_5GHZ_CH_NUM)) {
pChannelSet->interChannelOffset = 4;
f2GHzInfoFound = false;
} else {
@@ -2265,10 +2266,9 @@
if (pMac->scan.domainIdCurrent != domainId) {
sme_debug("Domain Changed Old %d, new %d",
pMac->scan.domainIdCurrent, domainId);
- status = wma_set_reg_domain(pMac, domainId);
+ if (domainId >= REGDOMAIN_COUNT)
+ sme_err("fail to set regId %d", domainId);
}
- if (status != QDF_STATUS_SUCCESS)
- sme_err("fail to set regId %d", domainId);
pMac->scan.domainIdCurrent = domainId;
/* switch to active scans using this new channel list */
pMac->scan.curScanType = eSIR_ACTIVE_SCAN;
@@ -2297,8 +2297,8 @@
ch_info_start = chan_info;
for (idx = 0; idx < max_ch_idx; idx++) {
ch = pMac->scan.defaultPowerTable[idx].chan_num;
- tmp_bool = (fill_5f && CDS_IS_CHANNEL_5GHZ(ch))
- || (!fill_5f && CDS_IS_CHANNEL_24GHZ(ch));
+ tmp_bool = (fill_5f && WLAN_REG_IS_5GHZ_CH(ch)) ||
+ (!fill_5f && WLAN_REG_IS_24GHZ_CH(ch));
if (!tmp_bool)
continue;
@@ -3608,7 +3608,7 @@
j = 0;
for (i = 0; i < len; i++) {
new_ch_info.ChannelList[j++] = ch_lst[i];
- if (CDS_MAX_24GHZ_CHANNEL_NUMBER >= ch_lst[i])
+ if (WLAN_REG_MAX_24GHZ_CH_NUM >= ch_lst[i])
new_ch_info.ChannelList[j++] = ch_lst[i];
}
if (NULL !=
@@ -3702,13 +3702,10 @@
((eCSR_SCAN_P2P_DISCOVERY == src_req->requestType) &&
CSR_IS_SOCIAL_CHANNEL(
src_req->ChannelInfo.ChannelList[index])))) {
- if (((src_req->skipDfsChnlInP2pSearch || skip_dfs_chnl)
- && (CHANNEL_STATE_DFS ==
- cds_get_channel_state(src_req->
- ChannelInfo.
- ChannelList
- [index])))
- ) {
+ if (((src_req->skipDfsChnlInP2pSearch ||
+ skip_dfs_chnl) && (CHANNEL_STATE_DFS ==
+ wlan_reg_get_channel_state(mac_ctx->pdev,
+ src_req->ChannelInfo.ChannelList[index])))) {
sme_debug(
"reqType= %s (%d), numOfChannels=%d, ignoring DFS channel %d",
sme_request_type_to_string(
@@ -3738,7 +3735,7 @@
mac_ctx->roam.configParam.
sta_roam_policy.sap_operating_band ==
eCSR_BAND_24) ||
- (CDS_IS_CHANNEL_5GHZ(
+ (WLAN_REG_IS_5GHZ_CH(
src_req->ChannelInfo.
ChannelList[index]) &&
mac_ctx->roam.configParam.
@@ -3809,14 +3806,13 @@
for (i = 0; i < valid_chnl_len; i++) {
if (valid_chnl_list[i] >= WLAN_REG_MIN_11P_CH_NUM)
continue;
-
- if (CDS_IS_CHANNEL_5GHZ(channel) &&
- CDS_IS_CHANNEL_24GHZ(valid_chnl_list[i])) {
+ if (WLAN_REG_IS_5GHZ_CH(channel) &&
+ WLAN_REG_IS_24GHZ_CH(valid_chnl_list[i])) {
valid_chnl_list[filter_chnl_len] =
valid_chnl_list[i];
filter_chnl_len++;
- } else if (CDS_IS_CHANNEL_24GHZ(channel) &&
- CDS_IS_CHANNEL_5GHZ(valid_chnl_list[i])) {
+ } else if (WLAN_REG_IS_24GHZ_CH(channel) &&
+ WLAN_REG_IS_5GHZ_CH(valid_chnl_list[i])) {
valid_chnl_list[filter_chnl_len] =
valid_chnl_list[i];
filter_chnl_len++;
@@ -3914,22 +3910,22 @@
(src_req->requestType == eCSR_SCAN_REQUEST_11D_SCAN)) {
for (index = 0; index < src_req->ChannelInfo.
numOfChannels; index++) {
- channel_state =
- cds_get_channel_state(src_req->
- ChannelInfo.
- ChannelList[index]);
+ channel_state = wlan_reg_get_channel_state(
+ mac_ctx->pdev,
+ src_req->ChannelInfo.
+ ChannelList[index]);
if (src_req->ChannelInfo.ChannelList[index] <
WLAN_REG_MIN_11P_CH_NUM &&
((CHANNEL_STATE_ENABLE ==
- channel_state) ||
- ((CHANNEL_STATE_DFS == channel_state) &&
- !skip_dfs_chnl))) {
+ channel_state) ||
+ ((CHANNEL_STATE_DFS == channel_state) &&
+ !skip_dfs_chnl))) {
dst_req->ChannelInfo.ChannelList
- [new_index] =
- src_req->
- ChannelInfo.
- ChannelList
- [index];
+ [new_index] =
+ src_req->
+ ChannelInfo.
+ ChannelList
+ [index];
new_index++;
}
}
@@ -3948,7 +3944,7 @@
"Couldn't get the valid Channel List, keeping requester's list");
new_index = 0;
for (index = 0; index < src_req->ChannelInfo.
- numOfChannels; index++) {
+ numOfChannels; index++) {
if (src_req->ChannelInfo.ChannelList[index] <
WLAN_REG_MIN_11P_CH_NUM) {
dst_req->ChannelInfo.
@@ -5969,7 +5965,7 @@
bss_desc->beaconInterval = scan_entry->bcn_int;
bss_desc->capabilityInfo = scan_entry->cap_info.value;
- if (CDS_IS_CHANNEL_5GHZ(scan_entry->channel.chan_idx))
+ if (WLAN_REG_IS_5GHZ_CH(scan_entry->channel.chan_idx))
bss_desc->nwType = eSIR_11A_NW_TYPE;
else if (scan_entry->phy_mode == WLAN_PHYMODE_11B)
bss_desc->nwType = eSIR_11B_NW_TYPE;
diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c
index 9a9afde..00f27cc 100644
--- a/core/sme/src/csr/csr_util.c
+++ b/core/sme/src/csr/csr_util.c
@@ -32,7 +32,6 @@
Implementation supporting routines for CSR.
========================================================================== */
-
#include "ani_global.h"
#include "csr_support.h"
@@ -43,6 +42,7 @@
#include "cds_utils.h"
#include "wlan_policy_mgr_api.h"
#include "wlan_serialization_legacy_api.h"
+#include "wlan_reg_services_api.h"
uint8_t csr_wpa_oui[][CSR_WPA_OUI_SIZE] = {
@@ -2203,7 +2203,7 @@
phyMode2 = phyMode;
}
fMatch = csr_get_phy_mode_in_use(phyMode2, phyModeInBssDesc,
- CDS_IS_CHANNEL_5GHZ(pSirBssDesc->channelId),
+ WLAN_REG_IS_5GHZ_CH(pSirBssDesc->channelId),
&cfgDot11ModeToUse);
} else {
bitMask = 1;
@@ -2212,7 +2212,7 @@
phyMode2 = (phyMode & (bitMask << loopCount++));
if (0 != phyMode2 && csr_get_phy_mode_in_use(phyMode2,
phyModeInBssDesc,
- CDS_IS_CHANNEL_5GHZ
+ WLAN_REG_IS_5GHZ_CH
(pSirBssDesc->channelId),
&cfgDot11ModeToUse)) {
fMatch = true;
@@ -2238,7 +2238,7 @@
(eCSR_CFG_DOT11_MODE_11AX ==
cfgDot11ModeToUse))) {
/* We cannot do 11n here */
- if (!CDS_IS_CHANNEL_5GHZ
+ if (!WLAN_REG_IS_5GHZ_CH
(pSirBssDesc->channelId)) {
cfgDot11ModeToUse =
eCSR_CFG_DOT11_MODE_11G;
@@ -5716,7 +5716,7 @@
tSirScanType scanType = eSIR_PASSIVE_SCAN;
enum channel_state channelEnabledType;
- channelEnabledType = cds_get_channel_state(chnId);
+ channelEnabledType = wlan_reg_get_channel_state(pMac->pdev, chnId);
if (CHANNEL_STATE_ENABLE == channelEnabledType) {
scanType = eSIR_ACTIVE_SCAN;
}
@@ -5855,14 +5855,13 @@
if (pCountry) {
countryCode[0] = pCountry[0];
countryCode[1] = pCountry[1];
- qdf_status = cds_get_reg_domain_from_country_code(&domainId,
+ qdf_status = wlan_reg_get_domain_from_country_code(&domainId,
countryCode,
source);
if (QDF_IS_STATUS_SUCCESS(qdf_status)) {
- if (pDomainId) {
+ if (pDomainId)
*pDomainId = domainId;
- }
status = QDF_STATUS_SUCCESS;
} else {
sme_warn("Couldn't find domain for country code %c%c",
@@ -5979,8 +5978,8 @@
int i;
for (i = 0; i < NUM_CHANNELS; i++) {
- if (CDS_CHANNEL_NUM(i) == chanNum)
- return CDS_CHANNEL_FREQ(i);
+ if (WLAN_REG_CH_NUM(i) == chanNum)
+ return WLAN_REG_CH_TO_FREQ(i);
}
return 0;
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index ccc2fdb..1477d3c 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1341,6 +1341,7 @@
void *cds_context;
void *mac_context;
struct wlan_objmgr_psoc *psoc;
+ struct wlan_objmgr_pdev *pdev;
qdf_event_t wma_ready_event;
qdf_event_t wma_resume_event;
qdf_event_t target_suspend;
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index 72e03f5..a2e34e5 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -130,7 +130,6 @@
int sval2, int vpdev);
QDF_STATUS wma_set_htconfig(uint8_t vdev_id, uint16_t ht_capab, int value);
-QDF_STATUS wma_set_reg_domain(void *clientCtxt, v_REGDOMAIN_t regId);
QDF_STATUS wma_get_wcnss_software_version(void *p_cds_gctx,
uint8_t *pVersion,
@@ -287,4 +286,22 @@
{
}
#endif
+
+/**
+ * wma_store_pdev() - store pdev
+ * @wma_ctx: wma context
+ * @pdev: pdev context
+ *
+ * Return: void
+ */
+void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wma_clear_pdev() - clear pdev
+ * @wma_ctx: wma context
+ *
+ * Return: void
+ */
+void wma_clear_pdev(void *wma_ctx);
+
#endif
diff --git a/core/wma/inc/wma_dfs_interface.h b/core/wma/inc/wma_dfs_interface.h
index 6ea1640..736e125 100644
--- a/core/wma/inc/wma_dfs_interface.h
+++ b/core/wma/inc/wma_dfs_interface.h
@@ -27,9 +27,9 @@
#include "ath_dfs_structs.h"
#include <qdf_lock.h>
-#include "cds_reg_service.h"
#include "cds_regdomain.h"
#include "cds_ieee80211_common.h"
+#include "wlan_reg_services_api.h"
#define IEEE80211_CHAN_MAX 255
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 9bdfe79..a013089 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -76,6 +76,7 @@
#include "wlan_tgt_def_config.h"
#include <cdp_txrx_handle.h>
#include "wlan_pmo_ucfg_api.h"
+#include "wlan_reg_services_api.h"
#include "wma_he.h"
@@ -1967,7 +1968,7 @@
params.band_center_freq1 = params.chan_freq;
- bw_val = cds_bw_value(req->chan_width);
+ bw_val = wlan_reg_get_bw_value(req->chan_width);
if (20 < bw_val)
params.band_center_freq1 =
cds_chan_to_freq(req->ch_center_freq_seg0);
@@ -4705,3 +4706,27 @@
txrx_vdev,
pdis_intra_fwd->disableintrabssfwd);
}
+
+void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev)
+{
+ tp_wma_handle wma = (tp_wma_handle)wma_ctx;
+ QDF_STATUS status;
+
+ status = wlan_objmgr_pdev_try_get_ref(pdev, WLAN_LEGACY_WMA_ID);
+ if (QDF_STATUS_SUCCESS != status) {
+ wma->pdev = NULL;
+ return;
+ }
+
+ wma->pdev = pdev;
+}
+
+void wma_clear_pdev(void *wma_ctx)
+{
+ tp_wma_handle wma = (tp_wma_handle)wma_ctx;
+
+ if (wma->pdev) {
+ wlan_objmgr_pdev_release_ref(wma->pdev, WLAN_LEGACY_WMA_ID);
+ wma->pdev = NULL;
+ }
+}
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index fed7fb3..b8d043f 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -72,6 +72,7 @@
#include <cdp_txrx_handle.h>
#include "wlan_pmo_ucfg_api.h"
#include <target_if_scan.h>
+#include "wlan_reg_services_api.h"
#ifndef ARRAY_LENGTH
#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0]))
@@ -551,9 +552,9 @@
u8 dot11_mode)
{
WLAN_PHY_MODE phymode = MODE_UNKNOWN;
- uint16_t bw_val = cds_bw_value(chan_width);
+ uint16_t bw_val = wlan_reg_get_bw_value(chan_width);
- if (CDS_IS_CHANNEL_24GHZ(chan)) {
+ if (WLAN_REG_IS_24GHZ_CH(chan)) {
if (((CH_WIDTH_5MHZ == chan_width) ||
(CH_WIDTH_10MHZ == chan_width)) &&
((WNI_CFG_DOT11_MODE_11B == dot11_mode) ||
@@ -1385,13 +1386,15 @@
if (IEEE80211_IS_CHAN_11AC_VHT160(chan)) {
is_ch_dfs = true;
} else if (IEEE80211_IS_CHAN_11AC_VHT80P80(chan)) {
- if (cds_get_channel_state(chan->ic_ieee) == CHANNEL_STATE_DFS ||
- cds_get_channel_state(chan->ic_ieee_ext -
+ if (wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee) ==
+ CHANNEL_STATE_DFS ||
+ wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee_ext -
WMA_80MHZ_START_CENTER_CH_DIFF) ==
CHANNEL_STATE_DFS)
is_ch_dfs = true;
} else {
- if (cds_get_channel_state(chan->ic_ieee) == CHANNEL_STATE_DFS)
+ if (wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee) ==
+ CHANNEL_STATE_DFS)
is_ch_dfs = true;
}
if (!is_ch_dfs) {
@@ -4371,23 +4374,6 @@
return status;
}
#endif /* FEATURE_WLAN_CH_AVOID */
-
-/**
- * wma_set_reg_domain() - set reg domain
- * @clientCtxt: client context
- * @regId: reg id
- *
- * Return: QDF status
- */
-QDF_STATUS wma_set_reg_domain(void *clientCtxt, v_REGDOMAIN_t regId)
-{
- if (QDF_STATUS_SUCCESS !=
- cds_set_reg_domain(clientCtxt, regId))
- return QDF_STATUS_E_INVAL;
-
- return QDF_STATUS_SUCCESS;
-}
-
/**
* wma_send_regdomain_info_to_fw() - send regdomain info to fw
* @reg_dmn: reg domain
@@ -5091,6 +5077,13 @@
*req)
{
uint8_t ext_channel;
+ tp_wma_handle wma;
+
+ wma = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma) {
+ WMA_LOGE("%s: DFS- Invalid wma", __func__);
+ return NULL;
+ }
if (dfs_ic == NULL) {
WMA_LOGE("%s: DFS ic is Invalid", __func__);
@@ -5156,10 +5149,10 @@
/* verify both the 80MHz are DFS bands or not */
if ((CHANNEL_STATE_DFS ==
- cds_get_5g_bonded_channel_state(req->chan ,
- CH_WIDTH_80MHZ)) &&
- (CHANNEL_STATE_DFS == cds_get_5g_bonded_channel_state(
- ext_channel - WMA_80MHZ_START_CENTER_CH_DIFF,
+ wlan_reg_get_5g_bonded_channel_state(wma->pdev,
+ req->chan, CH_WIDTH_80MHZ)) &&
+ (CHANNEL_STATE_DFS == wlan_reg_get_5g_bonded_channel_state(
+ wma->pdev, ext_channel - WMA_80MHZ_START_CENTER_CH_DIFF,
CH_WIDTH_80MHZ)))
dfs_ic->ic_curchan->ic_80p80_both_dfs = true;
break;
@@ -5221,8 +5214,9 @@
*
* Return: return number of channels
*/
-static int wma_get_channels(struct dfs_ieee80211_channel *ichan,
- struct wma_dfs_radar_channel_list *chan_list)
+static int wma_get_channels(tp_wma_handle wma,
+ struct dfs_ieee80211_channel *ichan,
+ struct wma_dfs_radar_channel_list *chan_list)
{
uint8_t center_chan = cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg1);
int count = 0;
@@ -5250,7 +5244,8 @@
*/
start_channel = center_chan - WMA_160MHZ_START_CENTER_CH_DIFF;
for (loop = 0; loop < WMA_DFS_MAX_20M_SUB_CH; loop++) {
- if (cds_get_channel_state(start_channel +
+ if (wlan_reg_get_channel_state(wma->pdev,
+ start_channel +
(loop * WMA_NEXT_20MHZ_START_CH_DIFF)) ==
CHANNEL_STATE_DFS) {
chan_list->channels[count] = start_channel +
@@ -5375,7 +5370,7 @@
* select a new channel and set CSA IE
*/
radar_event->vdev_id = ic->vdev_id;
- wma_get_channels(ichan, &radar_event->chan_list);
+ wma_get_channels(wma, ichan, &radar_event->chan_list);
radar_event->dfs_radar_status = WMA_DFS_RADAR_FOUND;
radar_event->use_nol = ic->ic_dfs_usenol(ic);
wma_send_msg(wma, WMA_DFS_RADAR_IND, (void *)radar_event, 0);
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index eebdc89..28a7f23 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -88,11 +88,12 @@
#include "wma_he.h"
#include "wlan_pmo_obj_mgmt_api.h"
+#include "wlan_reg_tgt_api.h"
+#include "wlan_reg_services_api.h"
#include <cdp_txrx_handle.h>
#include <wlan_pmo_ucfg_api.h>
#define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */
-
#define WMI_TLV_HEADROOM 128
static uint32_t g_fw_wlan_feat_caps;
@@ -4979,7 +4980,7 @@
enum cds_band_type band;
bool status;
- if (!CDS_IS_CHANNEL_24GHZ(channel))
+ if (!WLAN_REG_IS_24GHZ_CH(channel))
band = CDS_BAND_5GHZ;
else
band = CDS_BAND_2GHZ;
@@ -4989,7 +4990,7 @@
HW_MODE_DBS, band)) {
return false;
}
- if (CDS_IS_CHANNEL_24GHZ(channel))
+ if (WLAN_REG_IS_24GHZ_CH(channel))
status = (!!(caps_per_phy.ht_2g & WMI_HT_CAP_RX_LDPC));
else
status = (!!(caps_per_phy.ht_5g & WMI_HT_CAP_RX_LDPC));
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 9fc55f8..8f494a2 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -69,6 +69,8 @@
#include "dfs.h"
#include "wma_internal.h"
#include "wlan_tgt_def_config.h"
+#include "wlan_reg_services_api.h"
+
/* This is temporary, should be removed */
#include "ol_htt_api.h"
#include <cdp_txrx_handle.h>
@@ -429,14 +431,15 @@
WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME));
if (!policy_mgr_is_hw_dbs_capable(wma_handle->psoc) ||
(policy_mgr_is_hw_dbs_capable(wma_handle->psoc) &&
- CDS_IS_CHANNEL_5GHZ(
+ WLAN_REG_IS_5GHZ_CH(
policy_mgr_get_channel(wma_handle->psoc,
PM_SAP_MODE, NULL)))) {
cmd->dwell_time_passive = cmd->dwell_time_active;
}
cmd->burst_duration = 0;
- if (CDS_IS_DFS_CH(policy_mgr_get_channel(wma_handle->psoc,
- PM_SAP_MODE, NULL)))
+ if (wlan_reg_is_dfs_ch(wma_handle->pdev,
+ policy_mgr_get_channel(wma_handle->psoc,
+ PM_SAP_MODE, NULL)))
cmd->burst_duration =
WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS *
scan_req->maxChannelTime;