From 97e077d091d34825ebf4d3e9c169c8311edd453f Mon Sep 17 00:00:00 2001 From: Manishekar Chandrasekaran Date: Wed, 23 Mar 2016 17:10:31 +0530 Subject: [PATCH] qcacld-3.0: Add ioctl to change concurrency system preference Add support to change the concurrency system preference at run time. The concurrency system preferences of throughput, latency and power can be changed at run time using the IOCTL "setConcSysPref". The policy manager provides the preferred channel list based on this preference value. Usage: iwpriv setConcSysPref Preference - 0 for throughput, 1 for powersave, 2 for latency e.g., iwpriv wlan0 setConcSysPref 1 Change-Id: Ib2b8653688400a0bbad9c9c1b1d630025ae4edcb CRs-Fixed: 993122 --- core/hdd/inc/qc_sap_ioctl.h | 1 + core/hdd/src/wlan_hdd_hostapd.c | 15 ++++++++++++++- core/hdd/src/wlan_hdd_wext.c | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index cede160e85e8..232a1d1c6f6e 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -245,6 +245,7 @@ enum { QCSAP_START_FW_PROFILING, QCSAP_CAP_TSF, QCSAP_GET_TSF, + QCSAP_PARAM_CONC_SYSTEM_PREF }; int iw_softap_get_channel_list(struct net_device *dev, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 597d51278731..ab894f63ab1b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2454,7 +2454,16 @@ static __iw_softap_setparam(struct net_device *dev, else ret = -EINVAL; break; - + case QCSAP_PARAM_CONC_SYSTEM_PREF: + hdd_info("New preference: %d", set_value); + if (!((set_value >= CFG_CONC_SYSTEM_PREF_MIN) && + (set_value <= CFG_CONC_SYSTEM_PREF_MAX))) { + hdd_err("Invalid system preference %d", set_value); + return -EINVAL; + } + /* hdd_ctx, hdd_ctx->config are already checked for null */ + hdd_ctx->config->conc_system_pref = set_value; + break; case QCSAP_PARAM_MAX_ASSOC: if (WNI_CFG_ASSOC_STA_LIMIT_STAMIN > set_value) { hddLog(LOGE, FL("Invalid setMaxAssoc value %d"), @@ -5672,6 +5681,10 @@ static const struct iw_priv_args hostapd_private_args[] = { QCSAP_PARAM_AUTO_CHANNEL, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setAutoChannel" + }, { + QCSAP_PARAM_CONC_SYSTEM_PREF, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, + "setConcSysPref" }, /* Sub-cmds DBGLOG specific commands */ { diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 9e3571890bf9..e741530bce03 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -216,6 +216,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { /* Private sub ioctl for starting/stopping the profiling */ #define WE_START_FW_PROFILE 87 #define WE_SET_CHANNEL 88 +#define WE_SET_CONC_SYSTEM_PREF 89 /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) @@ -6274,7 +6275,19 @@ static int __iw_setint_getnone(struct net_device *dev, } break; } + case WE_SET_CONC_SYSTEM_PREF: + { + hdd_info("New preference: %d", set_value); + if (!((set_value >= CFG_CONC_SYSTEM_PREF_MIN) && + (set_value <= CFG_CONC_SYSTEM_PREF_MAX))) { + hdd_err("Invalid system preference %d", set_value); + return -EINVAL; + } + /* hdd_ctx, hdd_ctx->config are already checked for null */ + hdd_ctx->config->conc_system_pref = set_value; + break; + } default: { hddLog(LOGE, "%s: Invalid sub command %d", __func__, @@ -10322,6 +10335,10 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setChanChange" }, + {WE_SET_CONC_SYSTEM_PREF, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, "setConcSysPref" }, + {WLAN_PRIV_SET_NONE_GET_INT, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,