From 197e33420aada5209992024e4d28afb74491cd51 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Tue, 30 Jun 2020 15:22:01 +0530 Subject: [PATCH] qcacld-3.0: Add vendor cmd attribute to upgrade UDP QoS Add the vendor command attribute to upgrade the QoS for all UDP packets having priority less than the current setting. Change-Id: I1269018396e163c1a2b02a7ab1cfb3fabfd0af94 CRs-Fixed: 2724041 --- core/hdd/inc/wlan_hdd_tx_rx.h | 11 +++++++++++ core/hdd/src/wlan_hdd_cfg80211.c | 21 +++++++++++++++++++++ core/hdd/src/wlan_hdd_tx_rx.c | 19 +++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h index 04721647a3fb..d1365bdeb5bb 100644 --- a/core/hdd/inc/wlan_hdd_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_tx_rx.h @@ -438,6 +438,17 @@ void hdd_event_eapol_log(struct sk_buff *skb, enum qdf_proto_dir dir) {} #endif +/** + * hdd_set_udp_qos_upgrade_config() - Set the threshold for UDP packet + * QoS upgrade. + * @adapter: adapter for which this configuration is to be applied + * @priority: the threshold priority + * + * Returns: 0 on success, -EINVAL on failure + */ +int hdd_set_udp_qos_upgrade_config(struct hdd_adapter *adapter, + uint8_t priority); + /* * As of the 4.7 kernel, net_device->trans_start is removed. Create shims to * support compiling against older versions of the kernel. diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 345a73180bc8..3e0c5933d513 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -49,6 +49,7 @@ #include "wlan_hdd_main.h" #include "wlan_hdd_power.h" #include "wlan_hdd_trace.h" +#include "wlan_hdd_tx_rx.h" #include "qdf_str.h" #include "qdf_trace.h" #include "qdf_types.h" @@ -6723,6 +6724,8 @@ const struct nla_policy wlan_hdd_wifi_config_policy[ [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_WIDTH] = {.type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_BW] = {.type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_NSS] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE] = { + .type = NLA_U8 }, }; @@ -7639,6 +7642,22 @@ static int hdd_config_scan_enable(struct hdd_adapter *adapter, return 0; } +/** + * hdd_config_udp_qos_upgrade_threshold() - NL attribute handler to parse + * priority upgrade threshold value. + * @adapter: adapter for which this configuration is to be applied + * @attr: NL attribute + * + * Returns: 0 on success, -EINVAL on failure + */ +static int hdd_config_udp_qos_upgrade_threshold(struct hdd_adapter *adapter, + const struct nlattr *attr) +{ + uint8_t priority = nla_get_u8(attr); + + return hdd_set_udp_qos_upgrade_config(adapter, priority); +} + static int hdd_config_power(struct hdd_adapter *adapter, const struct nlattr *attr) { @@ -8496,6 +8515,8 @@ static const struct independent_setters independent_setters[] = { hdd_set_nss}, {QCA_WLAN_VENDOR_ATTR_CONFIG_OPTIMIZED_POWER_MANAGEMENT, hdd_config_power}, + {QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE, + hdd_config_udp_qos_upgrade_threshold}, }; #ifdef WLAN_FEATURE_ELNA diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index f99014e5bd45..c42064c36978 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -469,6 +469,25 @@ void hdd_event_eapol_log(struct sk_buff *skb, enum qdf_proto_dir dir) } #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +int hdd_set_udp_qos_upgrade_config(struct hdd_adapter *adapter, + uint8_t priority) +{ + if (adapter->device_mode != QDF_STA_MODE) { + hdd_info_rl("Data priority upgrade only allowed in STA mode:%d", + adapter->device_mode); + return -EINVAL; + } + + if (priority >= QCA_WLAN_AC_ALL) { + hdd_err_rl("Invlid data priority: %d", priority); + return -EINVAL; + } + + adapter->upgrade_udp_qos_threshold = priority; + + return 0; +} + /** * wlan_hdd_classify_pkt() - classify packet * @skb - sk buff