|
@@ -6430,7 +6430,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
enum hw_mode_bandwidth channel_width;
|
|
|
int status;
|
|
|
struct sme_sta_inactivity_timeout *sta_inactivity_timer;
|
|
|
- uint8_t channel, mandt_chnl_list = 0;
|
|
|
+ uint8_t mandt_chnl_list = 0;
|
|
|
+ qdf_freq_t freq;
|
|
|
uint16_t sta_cnt, sap_cnt;
|
|
|
bool val;
|
|
|
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
|
@@ -6439,7 +6440,6 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
bool srd_channel_allowed, disable_nan = true;
|
|
|
enum QDF_OPMODE vdev_opmode;
|
|
|
uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;
|
|
|
- qdf_freq_t chan_freq;
|
|
|
|
|
|
hdd_enter();
|
|
|
|
|
@@ -6480,13 +6480,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
}
|
|
|
|
|
|
channel_width = wlan_hdd_get_channel_bw(params->chandef.width);
|
|
|
- channel = ieee80211_frequency_to_channel(
|
|
|
- params->chandef.chan->center_freq);
|
|
|
- if (!channel) {
|
|
|
- hdd_err("Invalid channel");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
- chan_freq = (qdf_freq_t)params->chandef.chan->center_freq;
|
|
|
+ freq = (qdf_freq_t)params->chandef.chan->center_freq;
|
|
|
|
|
|
chandef = ¶ms->chandef;
|
|
|
if ((adapter->device_mode == QDF_SAP_MODE ||
|
|
@@ -6495,8 +6489,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
chandef->chan->center_freq,
|
|
|
&new_chandef)) {
|
|
|
chandef = &new_chandef;
|
|
|
- channel = ieee80211_frequency_to_channel(
|
|
|
- chandef->chan->center_freq);
|
|
|
+ freq = (qdf_freq_t)chandef->chan->center_freq;
|
|
|
channel_width = wlan_hdd_get_channel_bw(chandef->width);
|
|
|
}
|
|
|
|
|
@@ -6528,7 +6521,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
&srd_channel_allowed);
|
|
|
|
|
|
if (!srd_channel_allowed &&
|
|
|
- wlan_reg_is_etsi13_srd_chan(hdd_ctx->pdev, channel)) {
|
|
|
+ wlan_reg_is_etsi13_srd_chan_for_freq(hdd_ctx->pdev, freq)) {
|
|
|
hdd_err("vdev opmode %d not allowed on SRD channel.",
|
|
|
vdev_opmode);
|
|
|
return -EINVAL;
|
|
@@ -6539,9 +6532,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
|
|
|
|
|
|
if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state_for_freq(
|
|
|
- hdd_ctx->pdev, chan_freq)) {
|
|
|
+ hdd_ctx->pdev, freq)) {
|
|
|
hdd_err("Can't start SAP-DFS (channel=%d)with sub 20 MHz ch wd",
|
|
|
- channel);
|
|
|
+ freq);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (channel_width != HW_MODE_20_MHZ) {
|
|
@@ -6552,14 +6545,12 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
sub_20_ch_width = CH_WIDTH_5MHZ;
|
|
|
if (cds_is_10_mhz_enabled())
|
|
|
sub_20_ch_width = CH_WIDTH_10MHZ;
|
|
|
- if (WLAN_REG_IS_5GHZ_CH(channel))
|
|
|
- ch_state = wlan_reg_get_5g_bonded_channel_state(
|
|
|
- hdd_ctx->pdev, channel,
|
|
|
- sub_20_ch_width);
|
|
|
+ if (WLAN_REG_IS_5GHZ_CH_FREQ(freq))
|
|
|
+ ch_state = wlan_reg_get_5g_bonded_channel_state_for_freq(hdd_ctx->pdev, freq,
|
|
|
+ sub_20_ch_width);
|
|
|
else
|
|
|
- ch_state = wlan_reg_get_2g_bonded_channel_state(
|
|
|
- hdd_ctx->pdev, channel,
|
|
|
- sub_20_ch_width, 0);
|
|
|
+ ch_state = wlan_reg_get_2g_bonded_channel_state_for_freq(hdd_ctx->pdev, freq,
|
|
|
+ sub_20_ch_width, 0);
|
|
|
if (CHANNEL_STATE_DISABLE == ch_state) {
|
|
|
hdd_err("Given ch width not supported by reg domain");
|
|
|
return -EINVAL;
|
|
@@ -6592,14 +6583,14 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
if (policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
|
|
|
PM_NAN_DISC_MODE, NULL) &&
|
|
|
!policy_mgr_nan_sap_pre_enable_conc_check(hdd_ctx->psoc,
|
|
|
- PM_SAP_MODE, wlan_chan_to_freq(channel)))
|
|
|
+ PM_SAP_MODE, freq))
|
|
|
hdd_debug("NAN disabled due to concurrency constraints");
|
|
|
|
|
|
/* check if concurrency is allowed */
|
|
|
if (!policy_mgr_allow_concurrency(hdd_ctx->psoc,
|
|
|
policy_mgr_convert_device_mode_to_qdf_type(
|
|
|
adapter->device_mode),
|
|
|
- wlan_chan_to_freq(channel),
|
|
|
+ freq,
|
|
|
channel_width)) {
|
|
|
hdd_err("Connection failed due to concurrency check failure");
|
|
|
return -EINVAL;
|
|
@@ -6623,7 +6614,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
*/
|
|
|
|
|
|
policy_mgr_checkn_update_hw_mode_single_mac_mode(
|
|
|
- hdd_ctx->psoc, wlan_chan_to_freq(channel));
|
|
|
+ hdd_ctx->psoc, freq);
|
|
|
if (status != QDF_STATUS_SUCCESS) {
|
|
|
hdd_err("Failed to stop DBS opportunistic timer");
|
|
|
return -EINVAL;
|
|
@@ -6631,7 +6622,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|
|
|
|
|
status = policy_mgr_current_connections_update(
|
|
|
hdd_ctx->psoc, adapter->vdev_id,
|
|
|
- wlan_chan_to_freq(channel),
|
|
|
+ freq,
|
|
|
POLICY_MGR_UPDATE_REASON_START_AP,
|
|
|
POLICY_MGR_DEF_REQ_ID);
|
|
|
if (status == QDF_STATUS_E_FAILURE) {
|