From 3091bcc07d682bf4617291221301ee144e18042a Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 23 Jun 2016 12:28:21 -0700 Subject: [PATCH] qcacld-3.0: Remove deprecated gPolicyManagerEnable INI item gPolicyManagerEnable INI item is no longer needed. Remove this INI item and make policy manager code enabled by default. Change-Id: I57822f47325c03e940b2802fb02900c64d3587e1 CRs-Fixed: 1034888 --- core/cds/src/cds_concurrency.c | 105 +------------------------------ core/hdd/inc/wlan_hdd_cfg.h | 6 -- core/hdd/src/wlan_hdd_cfg.c | 12 ---- core/hdd/src/wlan_hdd_cfg80211.c | 86 ++++++++++++------------- core/hdd/src/wlan_hdd_hostapd.c | 33 +++++----- core/mac/inc/ani_global.h | 1 - core/sap/src/sap_fsm.c | 3 +- core/sme/inc/csr_api.h | 1 - core/sme/src/csr/csr_api_roam.c | 7 +-- core/sme/src/csr/csr_api_scan.c | 41 +++++------- 10 files changed, 78 insertions(+), 217 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 04e913a3357e..48dc86b4a9b2 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2915,95 +2915,6 @@ static bool cds_current_concurrency_is_scc(void) return is_scc; } -/** - * cds_dump_legacy_concurrency() - To dump the current - * concurrency combination - * @sta_channel: Channel STA connection has come up - * @ap_channel: Channel SAP connection has come up - * @p2p_channel: Channel P2P connection has come up - * @sta_bssid: BSSID to which STA is connected to - * @p2p_bssid: BSSID to which P2P is connected to - * @ap_bssid: BSSID of the AP - * @p2p_mode: P2P Client or GO - * - * This routine is called to dump the concurrency info - * - * Return: None - */ -static void cds_dump_legacy_concurrency( - uint8_t sta_channel, uint8_t ap_channel, uint8_t p2p_channel, - struct qdf_mac_addr sta_bssid, struct qdf_mac_addr p2p_bssid, - struct qdf_mac_addr ap_bssid, const char *p2p_mode) -{ - const char *cc_mode = "Standalone"; - hdd_context_t *hdd_ctx; - - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - if (!hdd_ctx) { - cds_err("HDD context is NULL"); - return; - } - - if ((sta_channel == 0) && (ap_channel == 0) && (p2p_channel == 0)) { - cds_err("IBSS standalone"); - hdd_ctx->mcc_mode = 0; - return; - } - if (sta_channel > 0) { - if (ap_channel > 0) { - if (p2p_channel > 0) { - /* STA + AP + P2P */ - if (p2p_channel == sta_channel - && ap_channel == sta_channel) { - cc_mode = "STA+AP+P2P SCC"; - } else { - if (p2p_channel == sta_channel) - cc_mode = - "STA+P2P SCC, SAP MCC"; - else if (ap_channel == sta_channel) - cc_mode = - "STA+SAP SCC, P2P MCC"; - else if (ap_channel == p2p_channel) - cc_mode = - "P2P+SAP SCC, STA MCC"; - } - } else { - /* STA + AP */ - cc_mode = (ap_channel == sta_channel) ? - "SCC" : "MCC"; - } - } else { - if (p2p_channel > 0) { - /* STA + P2P */ - cc_mode = (p2p_channel == sta_channel) ? - "SCC" : "MCC"; - } - } - } else { - if (ap_channel > 0) { - if (p2p_channel > 0) { - /* AP + P2P */ - cc_mode = (p2p_channel == ap_channel) ? - "SCC" : "MCC"; - } - } - } - if (sta_channel > 0) - cds_err("wlan(%d) " MAC_ADDRESS_STR " %s", - sta_channel, MAC_ADDR_ARRAY(sta_bssid.bytes), cc_mode); - - if (p2p_channel > 0) - cds_err("p2p-%s(%d) " MAC_ADDRESS_STR " %s", - p2p_mode, p2p_channel, MAC_ADDR_ARRAY(p2p_bssid.bytes), - cc_mode); - - if (ap_channel > 0) - cds_err("AP(%d) " MAC_ADDRESS_STR " %s", - ap_channel, MAC_ADDR_ARRAY(ap_bssid.bytes), cc_mode); - - hdd_ctx->mcc_mode = strcmp(cc_mode, "SCC"); -} - /** * cds_dump_concurrency_info() - To dump concurrency info * @@ -3286,17 +3197,8 @@ void cds_dump_concurrency_info(void) status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext); adapterNode = pNext; } - if (hdd_ctx->config->policy_manager_enabled) { - cds_dump_current_concurrency(); - hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc(); - } else { - /* hdd_ctx->mcc_mode gets updated inside below function, which - * gets used by IPA - */ - cds_dump_legacy_concurrency( - staChannel, apChannel, p2pChannel, - staBssid, p2pBssid, apBssid, p2pMode); - } + cds_dump_current_concurrency(); + hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc(); } /** @@ -8673,8 +8575,7 @@ QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id) return status; } - if (!(hdd_ctx->config->policy_manager_enabled && - wma_is_hw_dbs_capable())) { + if (!wma_is_hw_dbs_capable()) { cds_err("PM/DBS is disabled"); return status; } diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index ec692cccc098..ca9103477a65 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2775,11 +2775,6 @@ typedef enum { #define CFG_CONC_SYSTEM_PREF_MAX (2) #define CFG_CONC_SYSTEM_PREF_DEFAULT (0) -#define CFG_POLICY_MNGR_ENABLE "gPolicyManagerEnable" -#define CFG_POLICY_MNGR_ENABLE_MIN (0) -#define CFG_POLICY_MNGR_ENABLE_MAX (1) -#define CFG_POLICY_MNGR_ENABLE_DEFAULT (1) - #define CFG_TSO_ENABLED_NAME "TSOEnable" #define CFG_TSO_ENABLED_MIN (0) #define CFG_TSO_ENABLED_MAX (1) @@ -3974,7 +3969,6 @@ struct hdd_config { uint8_t multicast_host_fw_msgs; uint8_t conc_system_pref; bool sendDeauthBeforeCon; - bool policy_manager_enabled; bool tso_enable; bool lro_enable; bool active_mode_offload; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 0bed4bb1e0eb..0df166a95454 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3518,13 +3518,6 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_CONC_SYSTEM_PREF_MIN, CFG_CONC_SYSTEM_PREF_MAX), - REG_VARIABLE(CFG_POLICY_MNGR_ENABLE, WLAN_PARAM_Integer, - struct hdd_config, policy_manager_enabled, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_POLICY_MNGR_ENABLE_DEFAULT, - CFG_POLICY_MNGR_ENABLE_MIN, - CFG_POLICY_MNGR_ENABLE_MAX), - REG_VARIABLE(CFG_TSO_ENABLED_NAME, WLAN_PARAM_Integer, struct hdd_config, tso_enable, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5494,9 +5487,6 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "Name = [is_ps_enabled] value = [%d]", pHddCtx->config->is_ps_enabled); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [policy_manager_enabled] value = [%d]", - pHddCtx->config->policy_manager_enabled); QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "Name = [tso_enable] value = [%d]", pHddCtx->config->tso_enable); @@ -7105,8 +7095,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon; - smeConfig->csrConfig.policy_manager_enabled = - pHddCtx->config->policy_manager_enabled; smeConfig->csrConfig.max_scan_count = pHddCtx->config->max_scan_count; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ce1d4c3a31aa..741501ff4f0d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4458,34 +4458,32 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy, if (0 != wlan_hdd_check_remain_on_channel(adapter)) hdd_warn("Remain On Channel Pending"); - if (hdd_ctx->config->policy_manager_enabled) { - ret = qdf_reset_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(ret)) - hdd_err("clearing event failed"); + ret = qdf_reset_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(ret)) + hdd_err("clearing event failed"); - ret = cds_current_connections_update(adapter->sessionId, - channel_hint, - SIR_UPDATE_REASON_SET_OPER_CHAN); - if (QDF_STATUS_E_FAILURE == ret) { - /* return in the failure case */ - hdd_err("ERROR: connections update failed!!"); + ret = cds_current_connections_update(adapter->sessionId, + channel_hint, + SIR_UPDATE_REASON_SET_OPER_CHAN); + if (QDF_STATUS_E_FAILURE == ret) { + /* return in the failure case */ + hdd_err("ERROR: connections update failed!!"); + return -EINVAL; + } + + if (QDF_STATUS_SUCCESS == ret) { + /* + * Success is the only case for which we expect hw mode + * change to take place, hence we need to wait. + * For any other return value it should be a pass + * through + */ + ret = qdf_wait_for_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(ret)) { + hdd_err("ERROR: qdf wait for event failed!!"); return -EINVAL; } - if (QDF_STATUS_SUCCESS == ret) { - /* - * Success is the only case for which we expect hw mode - * change to take place, hence we need to wait. - * For any other return value it should be a pass - * through - */ - ret = qdf_wait_for_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(ret)) { - hdd_err("ERROR: qdf wait for event failed!!"); - return -EINVAL; - } - - } } return 0; @@ -8794,8 +8792,7 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, hdd_select_cbmode(pAdapter, operatingChannel); } - if (pHddCtx->config->policy_manager_enabled && - (true == cds_is_connection_in_progress())) { + if (true == cds_is_connection_in_progress()) { hdd_err("Connection refused: conn in progress"); return -EINVAL; } @@ -8819,14 +8816,14 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, * When policy manager is enabled from ini file, we shouldn't * check for other concurrency rules. */ - if (!pHddCtx->config->policy_manager_enabled) { + if (wma_is_hw_dbs_capable() == false) { cds_handle_conc_rule1(pAdapter, pRoamProfile); if (true != cds_handle_conc_rule2( pAdapter, pRoamProfile, &roamId)) return 0; } - if (pHddCtx->config->policy_manager_enabled && + if ((wma_is_hw_dbs_capable() == true) && (false == wlan_hdd_handle_sap_sta_dfs_conc(pAdapter, pRoamProfile))) { hdd_err("sap-sta conc will fail, can't allow sta"); @@ -10163,26 +10160,25 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, hdd_err("This concurrency combination is not allowed"); return -ECONNREFUSED; } - if (pHddCtx->config->policy_manager_enabled) { - status = qdf_reset_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(status)) - hdd_err("ERR: clear event failed"); - status = cds_current_connections_update(pAdapter->sessionId, - channelNum, - SIR_UPDATE_REASON_JOIN_IBSS); - if (QDF_STATUS_E_FAILURE == status) { - hdd_err("ERROR: connections update failed!!"); + status = qdf_reset_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("ERR: clear event failed"); + + status = cds_current_connections_update(pAdapter->sessionId, + channelNum, + SIR_UPDATE_REASON_JOIN_IBSS); + if (QDF_STATUS_E_FAILURE == status) { + hdd_err("ERROR: connections update failed!!"); + return -EINVAL; + } + + if (QDF_STATUS_SUCCESS == status) { + status = qdf_wait_for_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("ERROR: qdf wait for event failed!!"); return -EINVAL; } - - if (QDF_STATUS_SUCCESS == status) { - status = qdf_wait_for_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(status)) { - hdd_err("ERROR: qdf wait for event failed!!"); - return -EINVAL; - } - } } /*Try disconnecting if already in connected state */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 8ca19754d7c8..ae192aa2200e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -8268,26 +8268,25 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, hdd_err("Connection failed due to concurrency check failure"); return -EINVAL; } - if (pHddCtx->config->policy_manager_enabled) { - status = qdf_reset_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(status)) - hdd_err("ERR: clear event failed"); - status = cds_current_connections_update(pAdapter->sessionId, - channel, - SIR_UPDATE_REASON_START_AP); - if (QDF_STATUS_E_FAILURE == status) { - hdd_err("ERROR: connections update failed!!"); + status = qdf_reset_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("ERR: clear event failed"); + + status = cds_current_connections_update(pAdapter->sessionId, + channel, + SIR_UPDATE_REASON_START_AP); + if (QDF_STATUS_E_FAILURE == status) { + hdd_err("ERROR: connections update failed!!"); + return -EINVAL; + } + + if (QDF_STATUS_SUCCESS == status) { + status = qdf_wait_for_connection_update(); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("ERROR: qdf wait for event failed!!"); return -EINVAL; } - - if (QDF_STATUS_SUCCESS == status) { - status = qdf_wait_for_connection_update(); - if (!QDF_IS_STATUS_SUCCESS(status)) { - hdd_err("ERROR: qdf wait for event failed!!"); - return -EINVAL; - } - } } if ((pAdapter->device_mode == QDF_SAP_MODE) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 71d374198679..8807263bf80d 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -1069,7 +1069,6 @@ typedef struct sAniSirGlobal { uint32_t f_sta_miracast_mcc_rest_time_val; uint8_t f_prefer_non_dfs_on_radar; hdd_ftm_msg_processor ftm_msg_processor_callback; - bool policy_manager_enabled; uint32_t fine_time_meas_cap; /* per band chain mask support */ bool per_band_chainmask_supp; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 1c67501ea970..f36c35633551 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2341,8 +2341,7 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, FL("for configured channel, Ch= %d"), sap_context->channel); - if (mac_ctx->policy_manager_enabled && - check_for_connection_update) { + if (check_for_connection_update) { /* This wait happens in the hostapd context. The event * is set in the MC thread context. */ diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 0635bb9761ac..5bd8301e7d74 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1251,7 +1251,6 @@ typedef struct tagCsrConfigParam { #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ uint8_t f_prefer_non_dfs_on_radar; bool is_ps_enabled; - bool policy_manager_enabled; uint32_t fine_time_meas_cap; uint32_t dual_mac_feature_disable; uint32_t roam_dense_traffic_thresh; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 81ca42cf48a7..7470d6e95f3b 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2382,7 +2382,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->is_ps_enabled; pMac->roam.configParam.ignore_peer_ht_opmode = pParam->ignore_peer_ht_opmode; - pMac->policy_manager_enabled = pParam->policy_manager_enabled; pMac->fine_time_meas_cap = pParam->fine_time_meas_cap; pMac->dual_mac_feature_disable = pParam->dual_mac_feature_disable; @@ -2574,7 +2573,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->pnoOffload = pMac->pnoOffload; pParam->f_prefer_non_dfs_on_radar = pMac->f_prefer_non_dfs_on_radar; - pParam->policy_manager_enabled = pMac->policy_manager_enabled; pParam->fine_time_meas_cap = pMac->fine_time_meas_cap; pParam->dual_mac_feature_disable = pMac->dual_mac_feature_disable; @@ -7584,9 +7582,8 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, FL("******* csr_scan_get_result Status ****** %d"), status); if (QDF_IS_STATUS_SUCCESS(status)) { /* check if set hw mode needs to be done */ - if ((pMac->policy_manager_enabled) && - ((pScanFilter->csrPersona == QDF_STA_MODE) || - (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE))) { + if ((pScanFilter->csrPersona == QDF_STA_MODE) || + (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE)) { csr_get_bssdescr_from_scan_handle(hBSSList, &first_ap_profile); status = cds_handle_conc_multiport(sessionId, diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index a4cd74f89e7d..96862cae18c3 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1963,8 +1963,7 @@ static QDF_STATUS csr_calc_pref_val_by_pcl(tpAniSirGlobal mac_ctx, if (NULL == mac_ctx || NULL == bss_descr) return QDF_STATUS_E_FAILURE; - if (mac_ctx->policy_manager_enabled && - is_channel_found_in_pcl(mac_ctx, + if (is_channel_found_in_pcl(mac_ctx, bss_descr->Result.BssDescriptor.channelId, filter) && (bss_descr->Result.BssDescriptor.rssi > PCL_RSSI_THRESHOLD)) { orig_pref_val = csr_derive_prefer_value_from_rssi(mac_ctx, @@ -3718,34 +3717,24 @@ eCsrScanCompleteNextCommand csr_scan_get_next_command_state(tpAniSirGlobal pMac, eCsrNextLostLinkScan3Failed; break; case eCsrScanForSsid: - /* When policy manager is disabled: - * success: csr_scan_handle_search_for_ssid - * failure: csr_scan_handle_search_for_ssid_failure - * - * When policy manager is enabled: - * success: + /* success: * set hw_mode success -> csr_scan_handle_search_for_ssid * set hw_mode fail -> csr_scan_handle_search_for_ssid_failure * failure: csr_scan_handle_search_for_ssid_failure */ - if (pMac->policy_manager_enabled) { - sms_log(pMac, LOG1, FL("Resp for eCsrScanForSsid")); - channel = cds_search_and_check_for_session_conc( - pCommand->sessionId, - pCommand->u.scanCmd.pToRoamProfile); - if ((!channel) || !fSuccess) { - NextCommand = eCsrNexteScanForSsidFailure; - sms_log(pMac, LOG1, - FL("next ScanForSsidFailure %d %d"), - channel, fSuccess); - } else { - NextCommand = eCsrNextCheckAllowConc; - *chan = channel; - sms_log(pMac, LOG1, FL("next CheckAllowConc")); - } - } else { - NextCommand = (fSuccess) ? eCsrNexteScanForSsidSuccess : - eCsrNexteScanForSsidFailure; + sms_log(pMac, LOG1, FL("Resp for eCsrScanForSsid")); + channel = cds_search_and_check_for_session_conc( + pCommand->sessionId, + pCommand->u.scanCmd.pToRoamProfile); + if ((!channel) || !fSuccess) { + NextCommand = eCsrNexteScanForSsidFailure; + sms_log(pMac, LOG1, + FL("next ScanForSsidFailure %d %d"), + channel, fSuccess); + } else { + NextCommand = eCsrNextCheckAllowConc; + *chan = channel; + sms_log(pMac, LOG1, FL("next CheckAllowConc")); } break; default: