From e54687479420f69a55db40b08192703fd6b45647 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Thu, 18 Feb 2021 16:50:50 +0530 Subject: [PATCH] qcacld-3.0: Set OCV flag in wiphy ext feature Host checks if firmware advertises Operating channel validation(OCV) support bit in service ready then updates OCV flag in wiphy ext feature. Change-Id: I92f872a07e6f7142e602e6a9e5f5edcecc0aab0b CRs-Fixed: 2880821 --- .../mlme/dispatcher/inc/wlan_mlme_api.h | 10 ++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 4 ++++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 17 +++++++++++++++++ .../mlme/dispatcher/src/wlan_mlme_api.c | 15 ++++++++++++++- core/hdd/src/wlan_hdd_cfg80211.c | 19 +++++++++++++++++++ core/wma/src/wma_main.c | 7 ++++++- 6 files changed, 70 insertions(+), 2 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index c46f0b2489..2cdfe674e0 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -836,6 +836,16 @@ QDF_STATUS wlan_mlme_get_oce_sta_enabled_info(struct wlan_objmgr_psoc *psoc, QDF_STATUS wlan_mlme_get_bigtk_support(struct wlan_objmgr_psoc *psoc, bool *value); +/** + * wlan_mlme_get_ocv_support() - Get the OCV support + * @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_ocv_support(struct wlan_objmgr_psoc *psoc, + bool *value); + /** * wlan_mlme_get_host_scan_abort_support() - Get support for stop all host * scans service capability. diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 894ba2f4fe..deca7888d3 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1079,6 +1079,7 @@ struct wlan_mlme_chain_cfg { * supports stop all host scan request type. * @peer_create_conf_support: Peer create confirmation command support * @dual_sta_roam_fw_support: Firmware support for dual sta roaming feature + * @ocv_support: FW supports OCV * * Add all the mlme-tgt related capablities here, and the public API would fill * the related capability in the required mlme cfg structure. @@ -1089,6 +1090,7 @@ struct mlme_tgt_caps { bool stop_all_host_scan_support; bool peer_create_conf_support; bool dual_sta_roam_fw_support; + bool ocv_support; }; /** @@ -1305,6 +1307,7 @@ struct wlan_mlme_ratemask { * @sae_connect_retries: sae connect retry bitmask * @wls_6ghz_capable: wifi location service(WLS) is 6ghz capable * @monitor_mode_concurrency: Monitor mode concurrency supported + * @ocv_support: FW supports OCV or not */ struct wlan_mlme_generic { uint32_t band_capability; @@ -1347,6 +1350,7 @@ struct wlan_mlme_generic { uint32_t sae_connect_retries; bool wls_6ghz_capable; enum monitor_mode_concurrency monitor_mode_concurrency; + bool ocv_support; }; /* diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 113e03fe70..1899ef7fd7 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1766,6 +1766,23 @@ QDF_STATUS ucfg_mlme_get_bigtk_support(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_bigtk_support(psoc, value); } +/** + * ucfg_mlme_get_ocv_support() - Get whether ocv is supported or not. + * + * @psoc: pointer to psoc object + * @value: pointer to the value which will be filled for the caller + * + * Inline UCFG API to be used by HDD/OSIF callers to get the OCV support + * + * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE + */ +static inline +QDF_STATUS ucfg_mlme_get_ocv_support(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_ocv_support(psoc, value); +} + /** * ucfg_mlme_get_oce_sap_enabled_info() - Get OCE feature enable/disable * info for SAP diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index a382f1da55..28cc8ae460 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -502,7 +502,7 @@ wlan_mlme_update_cfg_with_tgt_caps(struct wlan_objmgr_psoc *psoc, tgt_caps->stop_all_host_scan_support; mlme_obj->cfg.gen.dual_sta_roam_fw_support = tgt_caps->dual_sta_roam_fw_support; - + mlme_obj->cfg.gen.ocv_support = tgt_caps->ocv_support; } #ifdef WLAN_FEATURE_11AX @@ -2127,6 +2127,19 @@ QDF_STATUS wlan_mlme_get_bigtk_support(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS wlan_mlme_get_ocv_support(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj = mlme_get_psoc_ext_obj(psoc); + + if (!mlme_obj) + return QDF_STATUS_E_FAILURE; + + *value = mlme_obj->cfg.gen.ocv_support; + + return QDF_STATUS_SUCCESS; +} + bool wlan_mlme_get_host_scan_abort_support(struct wlan_objmgr_psoc *psoc) { struct wlan_mlme_psoc_ext_obj *mlme_obj = mlme_get_psoc_ext_obj(psoc); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d5636cca70..3afae3fdd2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -15960,6 +15960,19 @@ static void wlan_hdd_cfg80211_set_bigtk_flags(struct wiphy *wiphy) } #endif +#if defined(CFG80211_OCV_CONFIGURATION_SUPPORT) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)) +static void wlan_hdd_cfg80211_set_ocv_flags(struct wiphy *wiphy) +{ + wiphy_ext_feature_set(wiphy, + NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION); +} +#else +static void wlan_hdd_cfg80211_set_ocv_flags(struct wiphy *wiphy) +{ +} +#endif + #if defined(CFG80211_SCAN_OCE_CAPABILITY_SUPPORT) || \ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) static void wlan_hdd_cfg80211_set_wiphy_oce_scan_flags(struct wiphy *wiphy) @@ -16611,6 +16624,7 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx) struct wiphy *wiphy = hdd_ctx->wiphy; uint8_t allow_mcc_go_diff_bi = 0, enable_mcc = 0; bool is_bigtk_supported; + bool is_ocv_supported; if (!wiphy) { hdd_err("Invalid wiphy"); @@ -16642,6 +16656,11 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx) if (QDF_IS_STATUS_SUCCESS(status) && is_bigtk_supported) wlan_hdd_cfg80211_set_bigtk_flags(wiphy); + status = ucfg_mlme_get_ocv_support(hdd_ctx->psoc, + &is_ocv_supported); + if (QDF_IS_STATUS_SUCCESS(status) && is_ocv_supported) + wlan_hdd_cfg80211_set_ocv_flags(wiphy); + status = ucfg_mlme_get_oce_sta_enabled_info(hdd_ctx->psoc, &is_oce_sta_enabled); if (QDF_IS_STATUS_ERROR(status)) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index bf1999ca48..0fa01698d4 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5356,7 +5356,12 @@ static void wma_update_mlme_related_tgt_caps(struct wlan_objmgr_psoc *psoc, wmi_service_enabled(wmi_handle, wmi_service_dual_sta_roam_support); - wma_debug("beacon protection support %d", mlme_tgt_cfg.bigtk_support); + mlme_tgt_cfg.ocv_support = + wmi_service_enabled(wmi_handle, + wmi_service_ocv_support); + + wma_debug("beacon protection support %d, ocv support %d", + mlme_tgt_cfg.bigtk_support, mlme_tgt_cfg.ocv_support); /* Call this at last only after filling all the tgt caps */ wlan_mlme_update_cfg_with_tgt_caps(psoc, &mlme_tgt_cfg);