From 707eb78287557ee2ba46445919873b4b1ff15860 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 18 Jan 2018 12:04:19 -0800 Subject: [PATCH] qcacld-3.0: Add support to enable/disable WMM using nl cmd Add support to enable/disable WMM feature using nl command Change-Id: I71f5afd0f922854f8756a0428cbb290e641d5021 CRs-Fixed: 2187621 --- core/hdd/inc/wlan_hdd_cfg.h | 9 +++++++++ core/hdd/src/wlan_hdd_cfg.c | 11 ++--------- core/hdd/src/wlan_hdd_cfg80211.c | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index a75ff5e7281d..0e81571eab99 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -15352,6 +15352,15 @@ struct reg_table_entry { unsigned long notifyId; /* Dynamic modification identifier */ }; +/** + * hdd_to_csr_wmm_mode() - Utility function to convert HDD to CSR WMM mode + * + * @enum hdd_wmm_user_mode - hdd WMM user mode + * + * Return: CSR WMM mode + */ +eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(enum hdd_wmm_user_mode 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 7297ad0e92ef..c4eee3f90d82 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -8661,15 +8661,8 @@ QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx) return status; } -/** - * hdd_to_csr_wmm_mode() - Utility function to convert HDD to CSR WMM mode - * - * @enum hdd_wmm_user_mode - hdd WMM user mode - * - * Return: CSR WMM mode - */ -static eCsrRoamWmmUserModeType -hdd_to_csr_wmm_mode(enum hdd_wmm_user_mode mode) + +eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(enum hdd_wmm_user_mode mode) { switch (mode) { case HDD_WMM_USER_MODE_QBSS_ONLY: diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1ddb3e320af3..4e0b739bdb67 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -7232,6 +7232,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1]; int ret_val = 0; uint8_t cfg_val = 0; + tSmeConfigParams *sme_config; ENTER_DEV(dev); @@ -7277,6 +7278,29 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, return ret_val; } + if (tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE]) { + cfg_val = nla_get_u8(tb[ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE]); + sme_config = qdf_mem_malloc(sizeof(*sme_config)); + if (!sme_config) { + hdd_err("mem alloc failed for sme_config"); + return -ENOMEM; + } + qdf_mem_zero(sme_config, sizeof(*sme_config)); + sme_get_config_param(hdd_ctx->hHal, sme_config); + if (!cfg_val) { + sme_config->csrConfig.WMMSupportMode = + hdd_to_csr_wmm_mode(HDD_WMM_USER_MODE_NO_QOS); + hdd_debug("wmm is disabled"); + } else { + sme_config->csrConfig.WMMSupportMode = + hdd_to_csr_wmm_mode(hdd_ctx->config->WmmMode); + hdd_debug("using wmm default value"); + } + sme_update_config(hdd_ctx->hHal, sme_config); + qdf_mem_free(sme_config); + } + return ret_val; }