From 3a433cf0e8f0cee468616f150777a30f6a406cdc Mon Sep 17 00:00:00 2001 From: "Adam W. Willis" Date: Mon, 30 Aug 2021 20:30:26 -0400 Subject: [PATCH] qcacld-3.0: Partially rollback LA.UM.9.12.r1-12000-SMxx50.0 merge [1/2] This reverts the following commits: 00df58a ("qcacld-3.0: Enable/Disable SRD support for vdev") c286d5c ("qcacld-3.0: Send nan enabled/disabled flag of SRD channels to fw") cb6a0b3 ("qcacld-3.0: Add ini support to enable NAN on indoor channels") Signed-off-by: Adam W. Willis --- .../policy_mgr/src/wlan_policy_mgr_action.c | 20 +------ .../policy_mgr/src/wlan_policy_mgr_core.c | 9 ++++ .../policy_mgr/src/wlan_policy_mgr_pcl.c | 40 ++++++-------- .../components/mlme/core/src/wlan_mlme_main.c | 7 +-- .../mlme/dispatcher/inc/cfg_mlme_reg.h | 45 +++------------- .../mlme/dispatcher/inc/wlan_mlme_api.h | 24 --------- .../dispatcher/inc/wlan_mlme_public_struct.h | 18 +------ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 19 ++----- .../mlme/dispatcher/src/wlan_mlme_api.c | 53 ------------------- .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 16 ++---- .../components/nan/core/inc/wlan_nan_api.h | 18 ------- .../components/nan/core/src/nan_api.c | 24 +-------- .../nan/dispatcher/inc/nan_ucfg_api.h | 19 ------- .../nan/dispatcher/src/nan_ucfg_api.c | 6 --- .../core/hdd/src/wlan_hdd_hostapd.c | 12 +---- .../core/hdd/src/wlan_hdd_regulatory.c | 6 +-- .../staging/qcacld-3.0/core/mac/inc/sir_api.h | 2 - .../staging/qcacld-3.0/core/sap/src/sap_fsm.c | 22 +++----- .../core/sme/src/csr/csr_api_roam.c | 10 ++-- .../qcacld-3.0/core/wma/src/wma_scan_roam.c | 3 -- 20 files changed, 62 insertions(+), 311 deletions(-) diff --git a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index e4030175a1cc..766179c53fa3 100644 --- a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -35,7 +35,6 @@ #include "wlan_nan_api.h" #include "nan_ucfg_api.h" #include "sap_api.h" -#include "wlan_mlme_api.h" enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) (struct wlan_objmgr_psoc *psoc); @@ -1941,22 +1940,6 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( uint32_t temp_ch_freq = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; bool sta_sap_scc_on_dfs_chan; - struct wlan_objmgr_vdev *vdev; - enum QDF_OPMODE vdev_opmode; - bool enable_srd_channel; - - vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, sap_vdev_id, - WLAN_POLICY_MGR_ID); - if (!vdev) { - policy_mgr_err("vdev is NULL"); - return QDF_STATUS_E_INVAL; - } - - vdev_opmode = wlan_vdev_mlme_get_opmode(vdev); - wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); - - wlan_mlme_get_srd_master_mode_for_vdev(psoc, vdev_opmode, - &enable_srd_channel); pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1998,7 +1981,8 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( ch_freq) || !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || policy_mgr_is_safe_channel(psoc, ch_freq)) || - (!enable_srd_channel && + (!wlan_reg_is_etsi13_srd_chan_allowed_master_mode( + pm_ctx->pdev) && wlan_reg_is_etsi13_srd_chan_for_freq(pm_ctx->pdev, ch_freq))) { if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, ch_freq) && diff --git a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 8b17d4c23069..a94030dc9751 100644 --- a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2116,6 +2116,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, uint32_t sbs_num_channels = 0; uint32_t chan_index_24 = 0, chan_index_5 = 0, chan_index_6 = 0; bool skip_dfs_channel = false; + bool is_etsi13_srd_chan_allowed_in_mas_mode = true; uint32_t i = 0, j = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; bool sta_sap_scc_on_dfs_chan; @@ -2179,6 +2180,9 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("skip DFS ch from pcl for SAP/Go"); skip_dfs_channel = true; } + is_etsi13_srd_chan_allowed_in_mas_mode = + wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx-> + pdev); } /* Let's divide the list in 2.4 & 5 Ghz lists */ @@ -2191,6 +2195,11 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, channel_list[i])) continue; + if (!is_etsi13_srd_chan_allowed_in_mas_mode && + wlan_reg_is_etsi13_srd_chan_for_freq( + pm_ctx->pdev, channel_list[i])) + continue; + channel_list_5[chan_index_5++] = channel_list[i]; } else if (wlan_reg_is_6ghz_chan_freq(channel_list[i])) { /* Add to 5G list untill 6G conc support is enabled */ diff --git a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 707a3a84a6f5..2c3eecfd967e 100644 --- a/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/drivers/staging/qcacld-3.0/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -545,12 +545,18 @@ policy_mgr_modify_pcl_based_on_srd(struct wlan_objmgr_psoc *psoc, uint32_t pcl_list[NUM_CHANNELS]; uint8_t weight_list[NUM_CHANNELS]; struct policy_mgr_psoc_priv_obj *pm_ctx; + bool is_etsi13_srd_chan_allowed_in_mas_mode = true; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); return QDF_STATUS_E_FAILURE; } + is_etsi13_srd_chan_allowed_in_mas_mode = + wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx->pdev); + + if (is_etsi13_srd_chan_allowed_in_mas_mode) + return QDF_STATUS_SUCCESS; if (*pcl_len_org > NUM_CHANNELS) { policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org); @@ -583,7 +589,6 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap( bool nol_modified_pcl = false; bool dfs_modified_pcl = false; bool modified_final_pcl = false; - bool srd_chan_enabled; if (policy_mgr_is_sap_mandatory_channel_set(psoc)) { status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel( @@ -612,18 +617,12 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap( } dfs_modified_pcl = true; - wlan_mlme_get_srd_master_mode_for_vdev(psoc, QDF_SAP_MODE, - &srd_chan_enabled); - - if (!srd_chan_enabled) { - status = policy_mgr_modify_pcl_based_on_srd - (psoc, pcl_channels, pcl_weight, len); - if (QDF_IS_STATUS_ERROR(status)) { - policy_mgr_err("Failed to modify SRD in pcl for SAP"); - return status; - } + status = policy_mgr_modify_pcl_based_on_srd + (psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get srd modified pcl for SAP"); + return status; } - modified_final_pcl = true; policy_mgr_debug(" %d %d %d %d", mandatory_modified_pcl, @@ -641,7 +640,6 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go( { QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_psoc_priv_obj *pm_ctx; - bool srd_chan_enabled; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -656,18 +654,12 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go( return status; } - wlan_mlme_get_srd_master_mode_for_vdev(psoc, QDF_P2P_GO_MODE, - &srd_chan_enabled); - - if (!srd_chan_enabled) { - status = policy_mgr_modify_pcl_based_on_srd - (psoc, pcl_channels, pcl_weight, len); - if (QDF_IS_STATUS_ERROR(status)) { - policy_mgr_err("Failed to modify SRD in pcl for GO"); - return status; - } + status = policy_mgr_modify_pcl_based_on_srd + (psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get srd modified pcl for P2P-GO"); + return status; } - policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); return QDF_STATUS_SUCCESS; diff --git a/drivers/staging/qcacld-3.0/components/mlme/core/src/wlan_mlme_main.c b/drivers/staging/qcacld-3.0/components/mlme/core/src/wlan_mlme_main.c index cf3c709cc8bf..2400b97ae341 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/core/src/wlan_mlme_main.c +++ b/drivers/staging/qcacld-3.0/components/mlme/core/src/wlan_mlme_main.c @@ -2337,8 +2337,8 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_objmgr_pdev *pdev = NULL; reg->self_gen_frm_pwr = cfg_get(psoc, CFG_SELF_GEN_FRM_PWR); - reg->etsi_srd_chan_in_master_mode = - cfg_get(psoc, CFG_ETSI_SRD_CHAN_IN_MASTER_MODE); + reg->etsi13_srd_chan_in_master_mode = + cfg_get(psoc, CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE); reg->restart_beaconing_on_ch_avoid = cfg_get(psoc, CFG_RESTART_BEACONING_ON_CH_AVOID); reg->indoor_channel_support = cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT); @@ -2359,9 +2359,6 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, &valid_channel_list_num); reg->valid_channel_list_num = (uint8_t)valid_channel_list_num; - reg->enable_nan_on_indoor_channels = - cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT_FOR_NAN); - pdev = wlan_objmgr_get_pdev_by_id(psoc, 0, WLAN_MLME_NB_ID); if (!pdev) { mlme_legacy_err("null pdev"); diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_reg.h index 4da66ab7aa7f..4b0629b0b887 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_reg.h +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -73,20 +73,14 @@ /* * - * etsi_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in + * etsi13_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in * master mode PCL and ACS functionality * @Min: 0 - * @Max: 0xFF - * @Default: 6 + * @Max: 1 + * @Default: 0 * - * etsi_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in + * etsi13_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in * master mode PCL and ACS functionality - * Bit map for enabling the SRD mode in various modes are as follows:- - * BIT 0:- Enable/Disable SRD channels for SAP. - * BIT 1:- Enable/Disable SRD channels for P2P-GO. - * BIT 2:- Enable/Disable SRD channels for NAN. - * Rest of the bits are currently reserved for future SRD channel support for - * other vdevs. * * Related: None * @@ -96,37 +90,11 @@ * * */ -#define CFG_ETSI_SRD_CHAN_IN_MASTER_MODE CFG_INI_UINT( \ +#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE CFG_INI_BOOL( \ "etsi13_srd_chan_in_master_mode", \ 0, \ - 0xff, \ - 6, \ - CFG_VALUE_OR_DEFAULT, \ "enable/disable ETSI SRD channels in master mode") -/* - * - * enable_nan_indoor_channel - Enable Indoor channels for NAN - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to support to indoor channels for NAN interface - * Customer can config this item to enable/disable NAN in indoor channel - * - * Related: None - * - * Supported Feature: NAN - * - * Usage: External - * - * - */ -#define CFG_INDOOR_CHANNEL_SUPPORT_FOR_NAN CFG_INI_BOOL( \ - "enable_nan_indoor_channel", \ - 0, \ - "enable/disable indoor channels for NAN") - #ifdef SAP_AVOID_ACS_FREQ_LIST #define SAP_AVOID_ACS_FREQ_LIST_DEFAULT "" @@ -356,8 +324,7 @@ CFG(CFG_SELF_GEN_FRM_PWR) \ CFG(CFG_ENABLE_PENDING_CHAN_LIST_REQ) \ CFG(CFG_ENABLE_11D_IN_WORLD_MODE) \ - CFG(CFG_ETSI_SRD_CHAN_IN_MASTER_MODE) \ - CFG(CFG_INDOOR_CHANNEL_SUPPORT_FOR_NAN) \ + CFG(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE) \ CFG(CFG_RESTART_BEACONING_ON_CH_AVOID) \ CFG(CFG_INDOOR_CHANNEL_SUPPORT) \ CFG(CFG_SCAN_11D_INTERVAL) \ diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_api.h b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_api.h index 6139aface233..00dbd2c4de9e 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1913,30 +1913,6 @@ QDF_STATUS wlan_mlme_get_vht_tx_mcs_2x2(struct wlan_objmgr_psoc *psoc, QDF_STATUS wlan_mlme_get_vht20_mcs9(struct wlan_objmgr_psoc *psoc, bool *value); -/** - * wlan_mlme_get_srd_master_mode_for_vdev - Get SRD master mode for vdev - * @psoc: pointer to psoc object - * @vdev_opmode: vdev operating mode - * @value: pointer to the value which will be filled for the caller - * - * Return: QDF Status - */ -QDF_STATUS -wlan_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE vdev_opmode, - bool *value); - -/** - * wlan_mlme_get_indoor_support_for_nan - Get indoor channel support for NAN - * @psoc: pointer to psoc object - * @value: pointer to the value which will be filled for the caller - * - * Return: QDF Status - */ -QDF_STATUS -wlan_mlme_get_indoor_support_for_nan(struct wlan_objmgr_psoc *psoc, - bool *value); - /** * wlan_mlme_get_vht_enable2x2() - Enables/disables VHT Tx/Rx MCS values for 2x2 * @psoc: psoc context diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index d8f3376e8cb4..8c5a05c1e52d 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2223,23 +2223,11 @@ struct wlan_mlme_mwc { }; #endif -/** - * enum mlme_reg_srd_master_modes - Bitmap of SRD master modes supported - * @MLME_SRD_MASTER_MODE_SAP: SRD master mode for SAP - * @MLME_SRD_MASTER_MODE_P2P_GO: SRD master mode for P2P-GO - * @MLME_SRD_MASTER_MODE_NAN: SRD master mode for NAN - */ -enum mlme_reg_srd_master_modes { - MLME_SRD_MASTER_MODE_SAP = 1, - MLME_SRD_MASTER_MODE_P2P_GO = 2, - MLME_SRD_MASTER_MODE_NAN = 4, -}; - /** * struct wlan_mlme_reg - REG related configs * @self_gen_frm_pwr: self-generated frame power in tx chain mask * for CCK rates - * @etsi_srd_chan_in_master_mode: etsi srd chan in master mode + * @etsi13_srd_chan_in_master_mode: etsi13 srd chan in master mode * @restart_beaconing_on_ch_avoid: restart beaconing on ch avoid * @indoor_channel_support: indoor channel support * @scan_11d_interval: scan 11d interval @@ -2255,11 +2243,10 @@ enum mlme_reg_srd_master_modes { * @enable_pending_chan_list_req: enables/disables scan channel * list command to FW till the current scan is complete. * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain. - * @enable_nan_on_indoor_channels: Enable nan on Indoor channels */ struct wlan_mlme_reg { uint32_t self_gen_frm_pwr; - uint8_t etsi_srd_chan_in_master_mode; + bool etsi13_srd_chan_in_master_mode; enum restart_beaconing_on_ch_avoid_rule restart_beaconing_on_ch_avoid; bool indoor_channel_support; @@ -2276,7 +2263,6 @@ struct wlan_mlme_reg { bool ignore_fw_reg_offload_ind; bool enable_pending_chan_list_req; bool retain_nol_across_regdmn_update; - bool enable_nan_on_indoor_channels; }; /** diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 35830ed93e86..d19b2678d0d9 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -3766,7 +3766,7 @@ ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc, #endif /** - * ucfg_mlme_get_etsi_srd_chan_in_master_mode - get etsi srd chan + * ucfg_mlme_get_etsi13_srd_chan_in_master_mode - get etsi13 srd chan * in master mode * @psoc: pointer to psoc object * @value: pointer to the value which will be filled for the caller @@ -3774,21 +3774,8 @@ ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc, * Return: QDF Status */ QDF_STATUS -ucfg_mlme_get_etsi_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, - uint8_t *value); - -/** - * ucfg_mlme_get_srd_master_mode_for_vdev() - Get SRD master mode for vdev - * @psoc: pointer to psoc object - * @vdev_opmode: vdev opmode - * @value: pointer to the value which will be filled for the caller - * - * Return: QDF Status - */ -QDF_STATUS -ucfg_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE vdev_opmode, - bool *value); +ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, + bool *value); #ifdef SAP_AVOID_ACS_FREQ_LIST /** diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_api.c b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_api.c index ba7694e78860..32a43ec926b7 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -2985,59 +2985,6 @@ wlan_mlme_get_vht20_mcs9(struct wlan_objmgr_psoc *psoc, bool *value) return QDF_STATUS_SUCCESS; } -QDF_STATUS -wlan_mlme_get_indoor_support_for_nan(struct wlan_objmgr_psoc *psoc, - bool *value) -{ - struct wlan_mlme_psoc_ext_obj *mlme_obj; - - mlme_obj = mlme_get_psoc_ext_obj(psoc); - if (!mlme_obj) { - *value = false; - mlme_legacy_err("Failed to get MLME Obj"); - return QDF_STATUS_E_INVAL; - } - - *value = mlme_obj->cfg.reg.enable_nan_on_indoor_channels; - - return QDF_STATUS_SUCCESS; -} - -QDF_STATUS -wlan_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE vdev_opmode, - bool *value) -{ - struct wlan_mlme_psoc_ext_obj *mlme_obj; - - mlme_obj = mlme_get_psoc_ext_obj(psoc); - if (!mlme_obj) { - *value = false; - mlme_legacy_err("Failed to get MLME Obj"); - return QDF_STATUS_E_INVAL; - } - - switch (vdev_opmode) { - case QDF_SAP_MODE: - *value = mlme_obj->cfg.reg.etsi_srd_chan_in_master_mode & - MLME_SRD_MASTER_MODE_SAP; - break; - case QDF_P2P_GO_MODE: - *value = mlme_obj->cfg.reg.etsi_srd_chan_in_master_mode & - MLME_SRD_MASTER_MODE_P2P_GO; - break; - case QDF_NAN_DISC_MODE: - *value = mlme_obj->cfg.reg.etsi_srd_chan_in_master_mode & - MLME_SRD_MASTER_MODE_NAN; - break; - default: - mlme_legacy_err("Unexpected opmode %d", vdev_opmode); - *value = false; - } - - return QDF_STATUS_SUCCESS; -} - QDF_STATUS wlan_mlme_get_vht_enable2x2(struct wlan_objmgr_psoc *psoc, bool *value) { diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 114b98ed51df..19910b21e64f 100644 --- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1537,31 +1537,23 @@ ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc, #endif QDF_STATUS -ucfg_mlme_get_etsi_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, - uint8_t *value) +ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, + bool *value) { struct wlan_mlme_psoc_ext_obj *mlme_obj; mlme_obj = mlme_get_psoc_ext_obj(psoc); if (!mlme_obj) { - *value = cfg_default(CFG_ETSI_SRD_CHAN_IN_MASTER_MODE); + *value = cfg_default(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE); mlme_legacy_err("Failed to get MLME Obj"); return QDF_STATUS_E_INVAL; } - *value = mlme_obj->cfg.reg.etsi_srd_chan_in_master_mode; + *value = mlme_obj->cfg.reg.etsi13_srd_chan_in_master_mode; return QDF_STATUS_SUCCESS; } -QDF_STATUS -ucfg_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE vdev_opmode, - bool *value) -{ - return wlan_mlme_get_srd_master_mode_for_vdev(psoc, vdev_opmode, value); -} - #ifdef SAP_AVOID_ACS_FREQ_LIST QDF_STATUS ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, diff --git a/drivers/staging/qcacld-3.0/components/nan/core/inc/wlan_nan_api.h b/drivers/staging/qcacld-3.0/components/nan/core/inc/wlan_nan_api.h index 9cba0fffd401..d7d84eeb9294 100644 --- a/drivers/staging/qcacld-3.0/components/nan/core/inc/wlan_nan_api.h +++ b/drivers/staging/qcacld-3.0/components/nan/core/inc/wlan_nan_api.h @@ -207,18 +207,6 @@ bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc); * Return: Cleanup NAN state upon NAN disable */ QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc); - -/** - * wlan_is_nan_allowed_on_freq() - Check if NAN is allowed on given freq - * @pdev: pdev context - * @freq: Frequency to be checked - * - * Check if NAN/NDP can be enabled on given frequency. - * - * Return: True if NAN is allowed on the given frequency - */ -bool wlan_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq); - #else /* WLAN_FEATURE_NAN */ static inline QDF_STATUS nan_init(void) { @@ -264,11 +252,5 @@ QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_E_FAILURE; } - -static inline -bool wlan_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq) -{ - return false; -} #endif /* WLAN_FEATURE_NAN */ #endif /* _WLAN_NAN_API_H_ */ diff --git a/drivers/staging/qcacld-3.0/components/nan/core/src/nan_api.c b/drivers/staging/qcacld-3.0/components/nan/core/src/nan_api.c index 64c3bd3aaaf5..769c4722b02e 100644 --- a/drivers/staging/qcacld-3.0/components/nan/core/src/nan_api.c +++ b/drivers/staging/qcacld-3.0/components/nan/core/src/nan_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -30,7 +30,6 @@ #include "wlan_objmgr_pdev_obj.h" #include "wlan_objmgr_vdev_obj.h" #include "nan_ucfg_api.h" -#include static QDF_STATUS nan_psoc_obj_created_notification( struct wlan_objmgr_psoc *psoc, void *arg_list) @@ -415,24 +414,3 @@ QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } - -bool wlan_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq) -{ - bool nan_allowed = true; - - /* Check for SRD channels */ - if (wlan_reg_is_etsi13_srd_chan_for_freq(pdev, freq)) - wlan_mlme_get_srd_master_mode_for_vdev(wlan_pdev_get_psoc(pdev), - QDF_NAN_DISC_MODE, - &nan_allowed); - - /* Check for Indoor channels */ - if (wlan_reg_is_freq_indoor(pdev, freq)) - wlan_mlme_get_indoor_support_for_nan(wlan_pdev_get_psoc(pdev), - &nan_allowed); - /* Check for dfs only if channel is not indoor */ - else if (wlan_reg_is_dfs_for_freq(pdev, freq)) - nan_allowed = false; - - return nan_allowed; -} diff --git a/drivers/staging/qcacld-3.0/components/nan/dispatcher/inc/nan_ucfg_api.h b/drivers/staging/qcacld-3.0/components/nan/dispatcher/inc/nan_ucfg_api.h index 4504b592acce..23317241807b 100644 --- a/drivers/staging/qcacld-3.0/components/nan/dispatcher/inc/nan_ucfg_api.h +++ b/drivers/staging/qcacld-3.0/components/nan/dispatcher/inc/nan_ucfg_api.h @@ -455,19 +455,6 @@ bool ucfg_is_nan_vdev(struct wlan_objmgr_vdev *vdev); * Return: QDF_STATUS */ QDF_STATUS ucfg_nan_disable_ind_to_userspace(struct wlan_objmgr_psoc *psoc); - -/** - * ucfg_is_nan_allowed_on_freq() - Check if NAN is allowed on given freq - * @pdev: pdev context - * @freq: Frequency to be checked - * - * Check if NAN/NDP can be enabled on given frequency. - * Validate SRD channels based on the ini and reg domain. Assume rest of the - * channels support NAN/NDP for now. - * - * Return: True if NAN is allowed on the given frequency - */ -bool ucfg_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq); #else /* WLAN_FEATURE_NAN */ static inline @@ -575,11 +562,5 @@ QDF_STATUS ucfg_nan_disable_ind_to_userspace(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; } - -static inline -bool ucfg_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq) -{ - return false; -} #endif /* WLAN_FEATURE_NAN */ #endif /* _NAN_UCFG_API_H_ */ diff --git a/drivers/staging/qcacld-3.0/components/nan/dispatcher/src/nan_ucfg_api.c b/drivers/staging/qcacld-3.0/components/nan/dispatcher/src/nan_ucfg_api.c index 5c150af68f73..769784e702ef 100644 --- a/drivers/staging/qcacld-3.0/components/nan/dispatcher/src/nan_ucfg_api.c +++ b/drivers/staging/qcacld-3.0/components/nan/dispatcher/src/nan_ucfg_api.c @@ -32,7 +32,6 @@ #include "wlan_policy_mgr_api.h" #include "cfg_ucfg_api.h" #include "cfg_nan.h" -#include "wlan_mlme_api.h" struct wlan_objmgr_psoc; struct wlan_objmgr_vdev; @@ -1273,8 +1272,3 @@ QDF_STATUS ucfg_nan_disable_ind_to_userspace(struct wlan_objmgr_psoc *psoc) qdf_mem_free(disable_ind); return QDF_STATUS_SUCCESS; } - -bool ucfg_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq) -{ - return wlan_is_nan_allowed_on_freq(pdev, freq); -} diff --git a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_hostapd.c b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_hostapd.c index 4a8e9de3701b..16adcadbb214 100644 --- a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_hostapd.c +++ b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_hostapd.c @@ -6356,8 +6356,6 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, struct cfg80211_chan_def new_chandef; struct cfg80211_chan_def *chandef; uint16_t sap_ch; - bool srd_channel_allowed; - enum QDF_OPMODE vdev_opmode; hdd_enter(); @@ -6462,15 +6460,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, hdd_err("SAP not allowed on DFS channel if no dfs master capability!!"); return -EINVAL; } - - vdev_opmode = wlan_vdev_mlme_get_opmode(adapter->vdev); - ucfg_mlme_get_srd_master_mode_for_vdev(hdd_ctx->psoc, vdev_opmode, - &srd_channel_allowed); - - if (!srd_channel_allowed && + if (!wlan_reg_is_etsi13_srd_chan_allowed_master_mode(hdd_ctx->pdev) && wlan_reg_is_etsi13_srd_chan(hdd_ctx->pdev, channel)) { - hdd_err("vdev opmode %d not allowed on SRD channel.", - vdev_opmode); + hdd_err("SAP not allowed on SRD channel."); return -EINVAL; } if (cds_is_sub_20_mhz_enabled()) { diff --git a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_regulatory.c b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_regulatory.c index 3bc1b0a86e88..5257244051ff 100644 --- a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_regulatory.c +++ b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_regulatory.c @@ -212,7 +212,7 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx, uint32_t band_capability = 0, scan_11d_interval = 0; bool indoor_chan_enabled = false; uint32_t restart_beaconing = 0; - uint8_t enable_srd_chan; + bool enable_srd_chan = false; QDF_STATUS status; bool country_priority = 0; bool value = false; @@ -258,8 +258,8 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx, &restart_beaconing); config_vars->restart_beaconing = restart_beaconing; - ucfg_mlme_get_etsi_srd_chan_in_master_mode(hdd_ctx->psoc, - &enable_srd_chan); + ucfg_mlme_get_etsi13_srd_chan_in_master_mode(hdd_ctx->psoc, + &enable_srd_chan); config_vars->enable_srd_chan_in_master_mode = enable_srd_chan; ucfg_mlme_get_11d_in_world_mode(hdd_ctx->psoc, diff --git a/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h b/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h index e9c073c61ea3..8f2eae634b2e 100644 --- a/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h +++ b/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h @@ -2557,7 +2557,6 @@ typedef struct sSirScanOffloadEvent { * @dfsSet: is dfs supported or not * @half_rate: is the channel operating at 10MHz * @quarter_rate: is the channel operating at 5MHz - * @nan_disabled: is NAN disabled on @freq */ typedef struct sSirUpdateChanParam { uint32_t freq; @@ -2565,7 +2564,6 @@ typedef struct sSirUpdateChanParam { bool dfsSet; bool half_rate; bool quarter_rate; - bool nan_disabled; } tSirUpdateChanParam, *tpSirUpdateChanParam; typedef struct sSirUpdateChan { diff --git a/drivers/staging/qcacld-3.0/core/sap/src/sap_fsm.c b/drivers/staging/qcacld-3.0/core/sap/src/sap_fsm.c index ea42d05f7c14..40a77eaaef58 100644 --- a/drivers/staging/qcacld-3.0/core/sap/src/sap_fsm.c +++ b/drivers/staging/qcacld-3.0/core/sap/src/sap_fsm.c @@ -3390,8 +3390,6 @@ static QDF_STATUS sap_get_freq_list(struct sap_context *sap_ctx, struct acs_weight_range *range_list; bool freq_present_in_list = false; uint8_t i; - bool srd_chan_enabled; - enum QDF_OPMODE vdev_opmode; mac_ctx = sap_get_mac_context(); if (!mac_ctx) { @@ -3510,19 +3508,15 @@ static QDF_STATUS sap_get_freq_list(struct sap_context *sap_ctx, mac_ctx->mlme_cfg->acs.np_chan_weightage); freq_present_in_list = true; } - - vdev_opmode = wlan_vdev_mlme_get_opmode(sap_ctx->vdev); - wlan_mlme_get_srd_master_mode_for_vdev(mac_ctx->psoc, - vdev_opmode, - &srd_chan_enabled); - - if (!srd_chan_enabled && - wlan_reg_is_etsi13_srd_chan_for_freq(mac_ctx->pdev, - WLAN_REG_CH_TO_FREQ(loop_count))) { - sap_debug("vdev opmode %d not allowed on SRD freq %d", - vdev_opmode, WLAN_REG_CH_TO_FREQ(loop_count)); + /* Dont scan ETSI13 SRD channels if the ETSI13 SRD channels + * are not enabled in master mode + */ + if (!wlan_reg_is_etsi13_srd_chan_allowed_master_mode(mac_ctx-> + pdev) && + wlan_reg_is_etsi13_srd_chan_for_freq( + mac_ctx->pdev, + WLAN_REG_CH_TO_FREQ(loop_count))) continue; - } /* Check if the freq is present in range list */ for (i = 0; i < mac_ctx->mlme_cfg->acs.num_weight_range; i++) { diff --git a/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c b/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c index ee56af75a18d..5db129d2d307 100644 --- a/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c +++ b/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c @@ -67,7 +67,6 @@ #include "wlan_scan_utils_api.h" #include "wlan_p2p_cfg_api.h" #include "cfg_nan_api.h" -#include "nan_ucfg_api.h" #include @@ -1548,12 +1547,11 @@ QDF_STATUS csr_update_channel_list(struct mac_context *mac) } } - if (!ucfg_is_nan_allowed_on_freq(mac->pdev, - pChanList->chanParam[num_channel].freq)) - pChanList->chanParam[num_channel].nan_disabled = - true; - if (CHANNEL_STATE_ENABLE != channel_state) + if (CHANNEL_STATE_ENABLE == channel_state) + pChanList->chanParam[num_channel].dfsSet = + false; + else pChanList->chanParam[num_channel].dfsSet = true; diff --git a/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c b/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c index 6900530d1aa8..3efd72ebdefc 100644 --- a/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c +++ b/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c @@ -168,9 +168,6 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle, chan_p->dfs_set = 1; } - if (chan_list->chanParam[i].nan_disabled) - chan_p->nan_disabled = 1; - if (chan_p->mhz < WMA_2_4_GHZ_MAX_FREQ) { chan_p->phy_mode = MODE_11G; if (chan_list->vht_en && chan_list->vht_24_en)