diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 6a2f32da89..4bf374ecd2 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1308,6 +1308,15 @@ static void mlme_init_wmm_in_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_QOS_WMM_UAPSD_BK_SRV_INTV); wmm_params->ac_bk.uapsd_bk_sus_intv = cfg_get(psoc, CFG_QOS_WMM_UAPSD_BK_SUS_INTV); + + wmm_params->wmm_config.wmm_mode = + cfg_get(psoc, CFG_QOS_WMM_MODE); + wmm_params->wmm_config.b80211e_is_enabled = + cfg_get(psoc, CFG_QOS_WMM_80211E_ENABLED); + wmm_params->wmm_config.uapsd_mask = + cfg_get(psoc, CFG_QOS_WMM_UAPSD_MASK); + wmm_params->wmm_config.bimplicit_qos_enabled = + cfg_get(psoc, CFG_QOS_WMM_IMPLICIT_SETUP_ENABLED); } static void mlme_init_wps_params_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_fe_wmm.h b/components/mlme/dispatcher/inc/cfg_mlme_fe_wmm.h index 872ac5ed5e..3ac32832af 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_fe_wmm.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_fe_wmm.h @@ -756,6 +756,101 @@ CFG_VALUE_OR_DEFAULT, \ "Infra uapsd bk sus intv") +/* WMM configuration */ +/* + * + * WmmIsEnabled - Enable WMM feature + * @Min: 0 + * @Max: 2 + * @Default: 0 + * + * This ini is used to enable/disable WMM. + * + * Related: None. + * + * Supported Feature: WMM + * + * Usage: Internal/External + * + * + */ +#define CFG_QOS_WMM_MODE CFG_INI_UINT( \ + "WmmIsEnabled", \ + 0, \ + 2, \ + 2, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable WMM feature") + +/* + * + * 80211eIsEnabled - Enable 802.11e feature + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable 802.11e. + * + * Related: None. + * + * Supported Feature: 802.11e + * + * Usage: Internal/External + * + * + */ +#define CFG_QOS_WMM_80211E_ENABLED CFG_INI_BOOL( \ + "80211eIsEnabled", \ + 0, \ + "Enable 802.11e feature") + +/* + * + * UapsdMask - To setup U-APSD mask for ACs + * @Min: 0x00 + * @Max: 0xFF + * @Default: 0x00 + * + * This ini is used to setup U-APSD mask for ACs. + * + * Related: None. + * + * Supported Feature: WMM + * + * Usage: Internal/External + * + * + */ +#define CFG_QOS_WMM_UAPSD_MASK CFG_INI_UINT( \ + "UapsdMask", \ + 0x00, \ + 0xFF, \ + 0x00, \ + CFG_VALUE_OR_DEFAULT, \ + "setup U-APSD mask for ACs") + +/* + * + * ImplicitQosIsEnabled - Enableimplicit QOS + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable implicit QOS. + * + * Related: None. + * + * Supported Feature: WMM + * + * Usage: Internal/External + * + * + */ +#define CFG_QOS_WMM_IMPLICIT_SETUP_ENABLED CFG_INI_BOOL( \ + "ImplicitQosIsEnabled", \ + 0, \ + "Enable implicit QOS") + #define CFG_WMM_PARAMS_ALL \ CFG(CFG_QOS_ENABLED) \ CFG(CFG_WME_ENABLED) \ @@ -789,6 +884,10 @@ CFG(CFG_QOS_WMM_MIN_PHY_RATE_AC_BK) \ CFG(CFG_QOS_WMM_SBA_AC_BK) \ CFG(CFG_QOS_WMM_UAPSD_BK_SRV_INTV) \ - CFG(CFG_QOS_WMM_UAPSD_BK_SUS_INTV) + CFG(CFG_QOS_WMM_UAPSD_BK_SUS_INTV) \ + CFG(CFG_QOS_WMM_MODE) \ + CFG(CFG_QOS_WMM_80211E_ENABLED) \ + CFG(CFG_QOS_WMM_UAPSD_MASK) \ + CFG(CFG_QOS_WMM_IMPLICIT_SETUP_ENABLED) #endif /* __CFG_MLME_FE_WMM_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 0010f1a166..39a3c9ae97 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -883,6 +883,47 @@ QDF_STATUS wlan_mlme_get_wmm_uapsd_bk_sus_intv(struct wlan_objmgr_psoc *psoc, uint32_t *value); +/** + * wlan_mlme_get_wmm_mode() - Enable WMM feature + * @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_wmm_mode(struct wlan_objmgr_psoc *psoc, uint8_t *value); + +/** + * wlan_mlme_get_80211e_is_enabled() - Enable 802.11e feature + * @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_80211e_is_enabled(struct wlan_objmgr_psoc *psoc, bool *value); + +/** + * wlan_mlme_get_wmm_uapsd_mask() - setup U-APSD mask for ACs + * @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_wmm_uapsd_mask(struct wlan_objmgr_psoc *psoc, uint8_t *value); + +/** + * wlan_mlme_get_implicit_qos_is_enabled() - Enable implicit QOS + * @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_implicit_qos_is_enabled(struct wlan_objmgr_psoc *psoc, + bool *value); + /** * wlan_mlme_get_wmm_dir_ac_vo() - Get TSPEC direction * for VO diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index f734d1fbe9..e3b4bd0cc6 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -997,6 +997,20 @@ struct wlan_mlme_lfr_cfg { uint32_t roam_preauth_no_ack_timeout; }; +/** + * struct wlan_mlme_wmm_config - WMM configuration + * @wmm_mode: Enable WMM feature + * @b80211e_is_enabled: Enable 802.11e feature + * @uapsd_mask: what ACs to setup U-APSD for at assoc + * @bimplicit_qos_enabled: Enable implicit QOS + */ +struct wlan_mlme_wmm_config { + uint8_t wmm_mode; + bool b80211e_is_enabled; + uint8_t uapsd_mask; + bool bimplicit_qos_enabled; +}; + /** * struct wlan_mlme_wmm_ac_vo - Default TSPEC parameters * for AC_VO @@ -1100,6 +1114,7 @@ struct wlan_mlme_wmm_params { uint8_t max_sp_length; bool wsm_enabled; uint32_t edca_profile; + struct wlan_mlme_wmm_config wmm_config; struct wlan_mlme_wmm_ac_vo ac_vo; struct wlan_mlme_wmm_ac_vi ac_vi; struct wlan_mlme_wmm_ac_be ac_be; diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index abee54832c..1ad51b486d 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -2049,4 +2049,65 @@ ucfg_mlme_get_wmm_uapsd_bk_sus_intv(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_wmm_uapsd_bk_sus_intv(psoc, value); } +/** + * ucfg_mlme_get_wmm_mode() - Enable WMM feature + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_wmm_mode(struct wlan_objmgr_psoc *psoc, uint8_t *value) +{ + return wlan_mlme_get_wmm_mode(psoc, value); +} + +/** + * ucfg_mlme_get_80211e_is_enabled() - Enable 802.11e feature + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_80211e_is_enabled(struct wlan_objmgr_psoc *psoc, bool *value) +{ + return wlan_mlme_get_80211e_is_enabled(psoc, value); +} + +/** + * ucfg_mlme_get_wmm_uapsd_mask() - setup U-APSD mask for ACs + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_wmm_uapsd_mask(struct wlan_objmgr_psoc *psoc, uint8_t *value) +{ + return wlan_mlme_get_wmm_uapsd_mask(psoc, value); +} + +/** + * ucfg_mlme_get_implicit_qos_is_enabled() - Enable implicit QOS + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_implicit_qos_is_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_implicit_qos_is_enabled(psoc, value); +} + #endif /* _WLAN_MLME_UCFG_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 76841212a9..bbd4375ab3 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -1024,6 +1024,71 @@ wlan_mlme_get_wmm_uapsd_bk_sus_intv(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +wlan_mlme_get_wmm_mode(struct wlan_objmgr_psoc *psoc, uint8_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.wmm_params.wmm_config.wmm_mode; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_80211e_is_enabled(struct wlan_objmgr_psoc *psoc, bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.wmm_params.wmm_config.b80211e_is_enabled; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_wmm_uapsd_mask(struct wlan_objmgr_psoc *psoc, uint8_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.wmm_params.wmm_config.uapsd_mask; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_implicit_qos_is_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.wmm_params.wmm_config.bimplicit_qos_enabled; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_set_sap_listen_interval(struct wlan_objmgr_psoc *psoc, int value) { diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index a02464827b..c26424e3c0 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2653,72 +2653,6 @@ enum station_keepalive_method { #define CFG_STA_KEEPALIVE_METHOD_DEFAULT (HDD_STA_KEEPALIVE_GRAT_ARP) /* WMM configuration */ -/* - * - * WmmIsEnabled - Enable WMM feature - * @Min: 0 - * @Max: 2 - * @Default: 0 - * - * This ini is used to enable/disable WMM. - * - * Related: None. - * - * Supported Feature: WMM - * - * Usage: Internal/External - * - * - */ -#define CFG_QOS_WMM_MODE_NAME "WmmIsEnabled" -#define CFG_QOS_WMM_MODE_MIN (0) -#define CFG_QOS_WMM_MODE_MAX (2) /* HDD_WMM_NO_QOS */ -#define CFG_QOS_WMM_MODE_DEFAULT (0) /* HDD_WMM_AUTO */ - -/* - * - * 80211eIsEnabled - Enable 802.11e feature - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to enable/disable 802.11e. - * - * Related: None. - * - * Supported Feature: 802.11e - * - * Usage: Internal/External - * - * - */ -#define CFG_QOS_WMM_80211E_ENABLED_NAME "80211eIsEnabled" -#define CFG_QOS_WMM_80211E_ENABLED_MIN (0) -#define CFG_QOS_WMM_80211E_ENABLED_MAX (1) -#define CFG_QOS_WMM_80211E_ENABLED_DEFAULT (0) - -/* - * - * UapsdMask - To setup U-APSD mask for ACs - * @Min: 0x00 - * @Max: 0xFF - * @Default: 0x00 - * - * This ini is used to setup U-APSD mask for ACs. - * - * Related: None. - * - * Supported Feature: WMM - * - * Usage: Internal/External - * - * - */ -#define CFG_QOS_WMM_UAPSD_MASK_NAME "UapsdMask" -#define CFG_QOS_WMM_UAPSD_MASK_MIN (0x00) -#define CFG_QOS_WMM_UAPSD_MASK_MAX (0xFF) -#define CFG_QOS_WMM_UAPSD_MASK_DEFAULT (0x00) - /* * * ImplicitQosIsEnabled - Enableimplicit QOS @@ -6640,9 +6574,6 @@ struct hdd_config { uint8_t wow_data_inactivity_timeout; /* WMM QoS Configuration */ - enum hdd_wmm_user_mode WmmMode; - bool b80211eIsEnabled; - uint8_t UapsdMask; /* what ACs to setup U-APSD for at assoc */ bool isFastRoamIniFeatureEnabled; bool MAWCEnabled; #ifdef FEATURE_WLAN_ESE @@ -6653,7 +6584,6 @@ struct hdd_config { uint8_t RoamRssiDiff; bool isWESModeEnabled; bool isRoamOffloadScanEnabled; - bool bImplicitQosEnabled; uint32_t DelayedTriggerFrmInt; @@ -7131,11 +7061,11 @@ struct reg_table_entry { /** * hdd_to_csr_wmm_mode() - Utility function to convert HDD to CSR WMM mode * - * @enum hdd_wmm_user_mode - hdd WMM user mode + * @uint8_t mode - hdd WMM user mode * * Return: CSR WMM mode */ -eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(enum hdd_wmm_user_mode mode); +eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(uint8_t mode); /* Function declarations and documenation */ QDF_STATUS hdd_parse_config_ini(struct hdd_context *hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 952919e6d6..ea3323224a 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -749,27 +749,6 @@ struct reg_table_entry g_registry_table[] = { CFG_WOW_DATA_INACTIVITY_TIMEOUT_MIN, CFG_WOW_DATA_INACTIVITY_TIMEOUT_MAX), - REG_VARIABLE(CFG_QOS_WMM_MODE_NAME, WLAN_PARAM_Integer, - struct hdd_config, WmmMode, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_QOS_WMM_MODE_DEFAULT, - CFG_QOS_WMM_MODE_MIN, - CFG_QOS_WMM_MODE_MAX), - - REG_VARIABLE(CFG_QOS_WMM_80211E_ENABLED_NAME, WLAN_PARAM_Integer, - struct hdd_config, b80211eIsEnabled, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_QOS_WMM_80211E_ENABLED_DEFAULT, - CFG_QOS_WMM_80211E_ENABLED_MIN, - CFG_QOS_WMM_80211E_ENABLED_MAX), - - REG_VARIABLE(CFG_QOS_WMM_UAPSD_MASK_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, UapsdMask, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_QOS_WMM_UAPSD_MASK_DEFAULT, - CFG_QOS_WMM_UAPSD_MASK_MIN, - CFG_QOS_WMM_UAPSD_MASK_MAX), - #ifdef FEATURE_WLAN_ESE REG_VARIABLE(CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_NAME, WLAN_PARAM_Integer, @@ -858,13 +837,6 @@ struct reg_table_entry g_registry_table[] = { CFG_TL_DELAYED_TRGR_FRM_INT_MIN, CFG_TL_DELAYED_TRGR_FRM_INT_MAX), - REG_VARIABLE(CFG_QOS_IMPLICIT_SETUP_ENABLED_NAME, WLAN_PARAM_Integer, - struct hdd_config, bImplicitQosEnabled, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_QOS_IMPLICIT_SETUP_ENABLED_DEFAULT, - CFG_QOS_IMPLICIT_SETUP_ENABLED_MIN, - CFG_QOS_IMPLICIT_SETUP_ENABLED_MAX), - REG_VARIABLE(CFG_RRM_ENABLE_NAME, WLAN_PARAM_Integer, struct hdd_config, fRrmEnable, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3968,7 +3940,7 @@ QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx) return status; } -eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(enum hdd_wmm_user_mode mode) +eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(uint8_t mode) { switch (mode) { case HDD_WMM_USER_MODE_QBSS_ONLY: @@ -4067,6 +4039,8 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) tSmeConfigParams *smeConfig; uint8_t rrm_capab_len; mac_handle_t mac_handle = hdd_ctx->mac_handle; + uint8_t wmm_mode = 0; + bool b80211e_is_enabled; struct hdd_config *pConfig = hdd_ctx->config; @@ -4076,10 +4050,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) return QDF_STATUS_E_NOMEM; } - hdd_debug("%s bWmmIsEnabled=%d 802_11e_enabled=%d dot11Mode=%d", - __func__, pConfig->WmmMode, pConfig->b80211eIsEnabled, - pConfig->dot11Mode); - /* Config params obtained from the registry * To Do: set regulatory information here */ @@ -4127,9 +4097,24 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) smeConfig->csrConfig.min_rest_time_conc = pConfig->min_rest_time_conc; smeConfig->csrConfig.idle_time_conc = pConfig->idle_time_conc; - smeConfig->csrConfig.Is11eSupportEnabled = pConfig->b80211eIsEnabled; - smeConfig->csrConfig.WMMSupportMode = - hdd_to_csr_wmm_mode(pConfig->WmmMode); + status = ucfg_mlme_get_80211e_is_enabled(hdd_ctx->psoc, + &b80211e_is_enabled); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get b80211e_is_enabled failed"); + return QDF_STATUS_E_FAILURE; + } + smeConfig->csrConfig.Is11eSupportEnabled = b80211e_is_enabled; + + status = ucfg_mlme_get_wmm_mode(hdd_ctx->psoc, &wmm_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get wmm_mode failed"); + return QDF_STATUS_E_FAILURE; + } + smeConfig->csrConfig.WMMSupportMode = hdd_to_csr_wmm_mode(wmm_mode); + + hdd_debug("%s bWmmIsEnabled=%d 802_11e_enabled=%d dot11Mode=%d", + __func__, wmm_mode, b80211e_is_enabled, + pConfig->dot11Mode); smeConfig->rrmConfig.rrm_enabled = pConfig->fRrmEnable; smeConfig->rrmConfig.max_randn_interval = pConfig->nRrmRandnIntvl; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b735944200..cedaec2eca 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6189,6 +6189,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, QDF_STATUS status; bool bval = false; uint8_t value = 0; + uint8_t wmm_mode = 0; hdd_enter_dev(dev); @@ -6252,8 +6253,14 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, hdd_to_csr_wmm_mode(HDD_WMM_USER_MODE_NO_QOS); hdd_debug("wmm is disabled"); } else { + status = ucfg_mlme_get_wmm_mode(hdd_ctx->psoc, + &wmm_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get wmm_mode failed"); + return QDF_STATUS_E_FAILURE; + } sme_config->csrConfig.WMMSupportMode = - hdd_to_csr_wmm_mode(hdd_ctx->config->WmmMode); + hdd_to_csr_wmm_mode(wmm_mode); hdd_debug("using wmm default value"); } update_sme_cfg = true; @@ -14809,6 +14816,8 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, tSmeConfigParams *sme_config; uint8_t channel = 0; mac_handle_t mac_handle; + uint8_t wmm_mode = 0; + uint8_t value = 0; hdd_enter(); @@ -14866,14 +14875,25 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, } hdd_set_connection_in_progress(true); - if (HDD_WMM_USER_MODE_NO_QOS == - (WLAN_HDD_GET_CTX(adapter))->config->WmmMode) { + status = ucfg_mlme_get_wmm_mode(hdd_ctx->psoc, &wmm_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get wmm_mode failed"); + status = -EINVAL; + goto ret_status; + } + if (HDD_WMM_USER_MODE_NO_QOS == wmm_mode) { /*QoS not enabled in cfg file */ roam_profile->uapsd_mask = 0; } else { /*QoS enabled, update uapsd mask from cfg file */ - roam_profile->uapsd_mask = - (WLAN_HDD_GET_CTX(adapter))->config->UapsdMask; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &value); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + status = -EINVAL; + goto ret_status; + } + roam_profile->uapsd_mask = value; } roam_profile->SSIDs.numOfSSIDs = 1; diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index 93b232cce1..306b3b3496 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -156,19 +156,32 @@ static int hdd_ndi_start_bss(struct hdd_adapter *adapter, uint32_t roam_id; struct csr_roam_profile *roam_profile; mac_handle_t mac_handle; + uint8_t wmm_mode = 0; + struct hdd_context *hdd_ctx; + uint8_t value = 0; hdd_enter(); roam_profile = hdd_roam_profile(adapter); + hdd_ctx = WLAN_HDD_GET_CTX(adapter); - if (HDD_WMM_USER_MODE_NO_QOS == - (WLAN_HDD_GET_CTX(adapter))->config->WmmMode) { + status = ucfg_mlme_get_wmm_mode(hdd_ctx->psoc, &wmm_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get wmm_mode failed"); + return -EINVAL; + } + + if (HDD_WMM_USER_MODE_NO_QOS == wmm_mode) { /* QoS not enabled in cfg file*/ roam_profile->uapsd_mask = 0; } else { /* QoS enabled, update uapsd mask from cfg file*/ - roam_profile->uapsd_mask = - (WLAN_HDD_GET_CTX(adapter))->config->UapsdMask; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, &value); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return -EINVAL; + } + roam_profile->uapsd_mask = value; } roam_profile->csrPersona = adapter->device_mode; diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index 13a427700d..5b0bf527f2 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -1017,7 +1017,7 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) struct hdd_context *hdd_ctx; mac_handle_t mac_handle; QDF_STATUS status = QDF_STATUS_SUCCESS; - uint8_t dir_ac = 0; + uint8_t dir_ac, mask = 0; uint16_t nom_msdu_size_ac = 0; uint32_t rate_ac = 0; uint16_t sba_ac = 0; @@ -1062,9 +1062,13 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.ts_info.up = SME_QOS_WMM_UP_VO; /* Check if there is any valid configuration from framework */ if (HDD_PSB_CFG_INVALID == adapter->configured_psb) { - qosInfo.ts_info.psb = - ((WLAN_HDD_GET_CTX(adapter))->config-> - UapsdMask & SME_QOS_UAPSD_VO) ? 1 : 0; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &mask); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return; + } + qosInfo.ts_info.psb = (mask & SME_QOS_UAPSD_VO) ? 1 : 0; } status = ucfg_mlme_get_wmm_dir_ac_vo(hdd_ctx->psoc, &dir_ac); @@ -1129,9 +1133,13 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.ts_info.up = SME_QOS_WMM_UP_VI; /* Check if there is any valid configuration from framework */ if (HDD_PSB_CFG_INVALID == adapter->configured_psb) { - qosInfo.ts_info.psb = - ((WLAN_HDD_GET_CTX(adapter))->config-> - UapsdMask & SME_QOS_UAPSD_VI) ? 1 : 0; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &mask); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return; + } + qosInfo.ts_info.psb = (mask & SME_QOS_UAPSD_VI) ? 1 : 0; } status = ucfg_mlme_get_wmm_dir_ac_vi( hdd_ctx->psoc, &dir_ac); @@ -1196,9 +1204,13 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.ts_info.up = SME_QOS_WMM_UP_BE; /* Check if there is any valid configuration from framework */ if (HDD_PSB_CFG_INVALID == adapter->configured_psb) { - qosInfo.ts_info.psb = - ((WLAN_HDD_GET_CTX(adapter))->config-> - UapsdMask & SME_QOS_UAPSD_BE) ? 1 : 0; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &mask); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return; + } + qosInfo.ts_info.psb = (mask & SME_QOS_UAPSD_BE) ? 1 : 0; } status = ucfg_mlme_get_wmm_dir_ac_be(hdd_ctx->psoc, &dir_ac); if (!QDF_IS_STATUS_SUCCESS(status)) { @@ -1260,9 +1272,13 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.ts_info.up = SME_QOS_WMM_UP_BK; /* Check if there is any valid configuration from framework */ if (HDD_PSB_CFG_INVALID == adapter->configured_psb) { - qosInfo.ts_info.psb = - ((WLAN_HDD_GET_CTX(adapter))->config-> - UapsdMask & SME_QOS_UAPSD_BK) ? 1 : 0; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &mask); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return; + } + qosInfo.ts_info.psb = (mask & SME_QOS_UAPSD_BK) ? 1 : 0; } status = ucfg_mlme_get_wmm_dir_ac_bk(hdd_ctx->psoc, &dir_ac); @@ -1873,12 +1889,20 @@ QDF_STATUS hdd_wmm_acquire_access(struct hdd_adapter *adapter, sme_ac_enum_type acType, bool *pGranted) { struct hdd_wmm_qos_context *pQosContext; + struct hdd_context *hdd_ctx; + bool enable; + QDF_STATUS status = QDF_STATUS_SUCCESS; + + hdd_ctx = WLAN_HDD_GET_CTX(adapter); QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_DEBUG, "%s: Entered for AC %d", __func__, acType); - if (!hdd_wmm_is_active(adapter) || - !(WLAN_HDD_GET_CTX(adapter))->config->bImplicitQosEnabled || + status = ucfg_mlme_get_implicit_qos_is_enabled(hdd_ctx->psoc, &enable); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get implicit_qos_is_enabled failed"); + } + if (!hdd_wmm_is_active(adapter) || !(enable) || !adapter->hdd_wmm_status.wmmAcStatus[acType].wmmAcAccessRequired) { /* either we don't want QoS or the AP doesn't support * QoS or we don't want to do implicit QoS @@ -2239,14 +2263,25 @@ QDF_STATUS hdd_wmm_get_uapsd_mask(struct hdd_adapter *adapter, QDF_STATUS status; struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); uint32_t uapsd_value = 0; + uint8_t wmm_mode = 0; - if (HDD_WMM_USER_MODE_NO_QOS == - (WLAN_HDD_GET_CTX(adapter))->config->WmmMode) { + status = ucfg_mlme_get_wmm_mode(hdd_ctx->psoc, &wmm_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get wmm_mode failed"); + return QDF_STATUS_E_FAILURE; + } + + if (HDD_WMM_USER_MODE_NO_QOS == wmm_mode) { /* no QOS then no UAPSD */ uapsdMask = 0; } else { /* start with the default mask */ - uapsdMask = (WLAN_HDD_GET_CTX(adapter))->config->UapsdMask; + status = ucfg_mlme_get_wmm_uapsd_mask(hdd_ctx->psoc, + &uapsdMask); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get uapsd_mask failed"); + return QDF_STATUS_E_FAILURE; + } /* disable UAPSD for any ACs with a 0 Service Interval */ status = ucfg_mlme_get_wmm_uapsd_vo_srv_intv(hdd_ctx->psoc,