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 <interface> setConcSysPref <preference>
Preference - 0 for throughput, 1 for powersave, 2 for latency
e.g., iwpriv wlan0 setConcSysPref 1

Change-Id: Ib2b8653688400a0bbad9c9c1b1d630025ae4edcb
CRs-Fixed: 993122
This commit is contained in:
Manishekar Chandrasekaran 2016-03-23 17:10:31 +05:30 • committed by Gerrit - the friendly Code Review server
commit 97e077d091
3 changed files with 32 additions and 1 deletions

View file

@ -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,

View file

@ -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 */
{

View file

@ -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,