summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMushtaq A Mujale <mmujale@qca.qualcomm.com>2013-12-13 18:13:13 -0800
committerPrakash Dhavali <pdhavali@codeaurora.org>2014-01-17 21:45:10 -0800
commitcb8f1892aa678a188d5c324798b835cf5dc047dd (patch)
treef24238c71e761b8eb8c5038050ff731ad1733d61
parent9f1052364d0377975139704f52514700f1fe0478 (diff)
qcacld: Add iwpriv command to config smps
1. Helps in dynamically configuring "htsmps" to different mode (static(0)/dynamic(1)/disabled(3)). 2. Use set_smps_param to configure different RSSI threshold. Change-Id: I615bfa7d8b68b0c80b6ea61bd328ec1003ffb867 CRs-Fixed:587713
-rw-r--r--CORE/HDD/src/wlan_hdd_wext.c66
-rw-r--r--CORE/SERVICES/WMA/wma.c45
-rw-r--r--CORE/SERVICES/WMA/wma.h5
3 files changed, 116 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 1dd7945883bb..87bd248e5ebd 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -204,6 +204,8 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
#define WE_PPS_RSSI_CHECK 53
#define WE_ENABLE_STRICT_FCC_REG 54
+#define WE_SET_HTSMPS 55
+
/* Private ioctls and their sub-ioctls */
#define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1)
#define WE_GET_11D_STATE 1
@@ -396,6 +398,10 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
#endif
#define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31)
+/* Private ioctls and their sub-ioctls */
+#define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28)
+#define WE_SET_SMPS_PARAM 1
+
#define WLAN_STATS_INVALID 0
#define WLAN_STATS_RETRY_CNT 1
#define WLAN_STATS_MUL_RETRY_CNT 2
@@ -5057,6 +5063,16 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf
break;
}
+ case WE_SET_HTSMPS:
+ {
+ hddLog(LOG1, "WE_SET_HTSMPS val %d", set_value);
+ ret = process_wma_set_command((int)pAdapter->sessionId,
+ (int)WMI_STA_SMPS_FORCE_MODE_CMDID,
+ set_value, VDEV_CMD);
+ break;
+ }
+
+
#endif
default:
{
@@ -8537,6 +8553,41 @@ VOS_STATUS iw_set_power_params(struct net_device *dev, struct iw_request_info *i
return VOS_STATUS_SUCCESS;
}/*iw_set_power_params*/
+int iw_set_two_ints_getnone(struct net_device *dev, struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ int *value = (int *)extra;
+ int sub_cmd = value[0];
+ int ret = 0;
+
+ if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:LOGP in Progress. Ignore!!!", __func__);
+ return -EBUSY;
+ }
+
+ switch(sub_cmd)
+ {
+ case WE_SET_SMPS_PARAM:
+ {
+ hddLog(LOG1, "WE_SET_SMPS_PARAM val %d %d", value[1], value[2]);
+ ret = process_wma_set_command((int)pAdapter->sessionId,
+ (int)WMI_STA_SMPS_PARAM_CMDID,
+ value[1] << WMA_SMPS_PARAM_VALUE_S | value[2], VDEV_CMD);
+ break;
+ }
+
+ default:
+ {
+ hddLog(LOGE, "Invalid IOCTL command %d", sub_cmd);
+ break;
+ }
+ }
+ return ret;
+}
+
// Define the Wireless Extensions to the Linux Network Device structure
// A number of these routines are NULL (meaning they are not implemented.)
@@ -8650,6 +8701,7 @@ static const iw_handler we_private[] = {
#endif
#endif
[WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed,
+ [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_two_ints_getnone,
};
/*Maximum command length can be only 15 */
@@ -8942,6 +8994,10 @@ static const struct iw_priv_args we_private_args[] = {
{ WE_PPS_RSSI_CHECK,
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
0, "rssi_chk" },
+
+ { WE_SET_HTSMPS,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+ 0, "htsmps" },
#endif
{ WLAN_PRIV_SET_NONE_GET_INT,
@@ -9524,6 +9580,16 @@ static const struct iw_priv_args we_private_args[] = {
WLAN_GET_LINK_SPEED,
IW_PRIV_TYPE_CHAR | 18,
IW_PRIV_TYPE_CHAR | 5, "getLinkSpeed" },
+
+ /* handlers for main ioctl */
+ { WLAN_PRIV_SET_TWO_INT_GET_NONE,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
+ 0,
+ "" },
+ { WE_SET_SMPS_PARAM,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
+ 0, "set_smps_param" },
+
};
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index ab9d08478892..2d76dce76b22 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -162,6 +162,9 @@ static int wma_update_tdls_peer_state(WMA_HANDLE handle,
tTdlsPeerStateParams *peerStateParams);
#endif
+static eHalStatus wma_set_smps_params(tp_wma_handle wma_handle,
+ tANI_U8 vdev_id, int value);
+
#if defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC)
void wma_utf_attach(tp_wma_handle wma_handle);
void wma_utf_detach(tp_wma_handle wma_handle);
@@ -5269,6 +5272,14 @@ static int32_t wma_set_priv_cfg(tp_wma_handle wma_handle,
privcmd->param_vdev_id,
privcmd->param_value);
break;
+ case WMI_STA_SMPS_FORCE_MODE_CMDID:
+ wma_set_mimops(wma_handle, privcmd->param_vdev_id,
+ privcmd->param_value);
+ break;
+ case WMI_STA_SMPS_PARAM_CMDID:
+ wma_set_smps_params(wma_handle, privcmd->param_vdev_id,
+ privcmd->param_value);
+ break;
default:
WMA_LOGE("Invalid wma config command id:%d",
privcmd->param_id);
@@ -15265,3 +15276,37 @@ wma_dfs_indicate_radar(struct ieee80211com *ic,
}
return 1;
}
+
+static eHalStatus wma_set_smps_params(tp_wma_handle wma, tANI_U8 vdev_id, int value)
+{
+ int ret = eHAL_STATUS_SUCCESS;
+ wmi_sta_smps_param_cmd_fixed_param *cmd;
+ wmi_buf_t buf;
+ u_int16_t len = sizeof(*cmd);
+
+ buf = wmi_buf_alloc(wma->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGE("%s:wmi_buf_alloc failed", __func__);
+ return -ENOMEM;
+ }
+ cmd = (wmi_sta_smps_param_cmd_fixed_param *) wmi_buf_data(buf);
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_sta_smps_param_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(
+ wmi_sta_smps_param_cmd_fixed_param));
+
+ cmd->vdev_id = vdev_id;
+ cmd->value = value & WMA_SMPS_MASK_LOWER_16BITS;
+ cmd->param = (value >> WMA_SMPS_PARAM_VALUE_S) & WMA_SMPS_MASK_UPPER_3BITS;
+
+ WMA_LOGD("Setting vdev %d value = %x param %x \n", vdev_id, cmd->value, cmd->param);
+
+ ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+ WMI_STA_SMPS_PARAM_CMDID);
+ if (ret < 0) {
+ WMA_LOGE("Failed to send set Mimo PS ret = %d", ret);
+ wmi_buf_free(buf);
+ }
+
+ return ret;
+}
diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h
index ef0438a01a20..f871789825f8 100644
--- a/CORE/SERVICES/WMA/wma.h
+++ b/CORE/SERVICES/WMA/wma.h
@@ -1343,4 +1343,9 @@ void ieee80211_mark_dfs(struct ieee80211com *ic,
int wma_dfs_indicate_radar(struct ieee80211com *ic,
struct ieee80211_channel *ichan);
u_int16_t dfs_usenol(struct ieee80211com *ic);
+
+#define WMA_SMPS_MASK_LOWER_16BITS 0xFF
+#define WMA_SMPS_MASK_UPPER_3BITS 0x7
+#define WMA_SMPS_PARAM_VALUE_S 29
+
#endif