From a92f8cc9a187df086161b5086f48100255d21e55 Mon Sep 17 00:00:00 2001 From: SaidiReddy Yenuga Date: Fri, 24 Mar 2017 15:15:03 +0530 Subject: [PATCH] qcacld-3.0: Add support for configuring modulated DTIM dynamically qcacld-2.0 to qcacld-3.0 Propagation. Wifi OFF/ON is needed to update the gEnableModuleDTIM ini param. Add private ioctl to configure modulated DTIM at runtime. CRs-Fixed: 2002662 Change-Id: I28be432da775a9aa026cd702c63dee5666260d33 --- core/hdd/src/wlan_hdd_wext.c | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index c19e100eabc1..bf4cdbc0c796 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -1143,6 +1143,28 @@ static const struct ccp_freq_chan_map freq_chan_map[] = { */ #define WE_SET_PDEV_RESET 95 +/* + * setModDTIM - Change Modulated DTIM + * + * @INPUT: set_value. + * + * @OUTPUT: None + * + * This IOCTL is used to change modulated DTIM + * value without WIFI OFF/ON. + * + * @E.g: iwpriv wlan0 setModDTIM + * iwpriv wlan0 setModDTIM 2 + * + * Supported Feature: N/A + * + * Usage: Internal/External + * + * + */ +#define WE_SET_MODULATED_DTIM 96 + + /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) #define WE_GET_11D_STATE 1 @@ -9225,6 +9247,18 @@ static int __iw_setint_getnone(struct net_device *dev, case WE_SET_PDEV_RESET: ret = hdd_handle_pdev_reset(adapter, set_value); break; + case WE_SET_MODULATED_DTIM: + { + if ((set_value < CFG_ENABLE_MODULATED_DTIM_MIN) || + (set_value > CFG_ENABLE_MODULATED_DTIM_MAX)) { + hdd_err("Invalid gEnableModuleDTIM value %d", + set_value); + return -EINVAL; + } else { + hdd_ctx->config->enableModulatedDTIM = set_value; + } + break; + } default: hdd_err("Invalid sub command %d", sub_cmd); ret = -EINVAL; @@ -13744,6 +13778,10 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "pdev_reset" }, + {WE_SET_MODULATED_DTIM, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, "setModDTIM" }, + {WLAN_PRIV_SET_NONE_GET_INT, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,