From 371e5af0bd7c5043f79fa12cc1d97acf91009b05 Mon Sep 17 00:00:00 2001 From: Manishekar Chandrasekaran Date: Thu, 30 Jun 2016 23:17:29 +0530 Subject: [PATCH] qcacld-3.0: Use interval field provided by DRIVER command P2P_SET_NOA Ensure that the interval field provided by the DRIVER command P2P_SET_NOA is used while populating the NoA parameters. Make sure that the interval and duration fields are in TU units. Change-Id: I9e1e60a0019e90deab36df5d8ba7822dfa4dcae0 CRs-Fixed: 1036494 --- core/hdd/src/wlan_hdd_p2p.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 9d41dc3e8c68..e8348be677c3 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -53,8 +53,8 @@ #include "cds_sched.h" #include "cds_concurrency.h" -/* Ms to Micro Sec */ -#define MS_TO_MUS(x) ((x) * 1000) +/* Ms to Time Unit Micro Sec */ +#define MS_TO_TU_MUS(x) ((x) * 1024) static uint8_t *hdd_get_action_string(uint16_t MsgType) { @@ -1734,7 +1734,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); tP2pPsConfig NoA; - int count, duration, start_time; + int count, duration, interval; char *param; int ret; @@ -1745,7 +1745,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) return -EINVAL; } param++; - ret = sscanf(param, "%d %d %d", &count, &start_time, &duration); + ret = sscanf(param, "%d %d %d", &count, &interval, &duration); if (ret != 3) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "%s: P2P_SET GO NoA: fail to read params, ret=%d", @@ -1753,9 +1753,9 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) return -EINVAL; } QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: P2P_SET GO NoA: count=%d start_time=%d duration=%d", - __func__, count, start_time, duration); - duration = MS_TO_MUS(duration); + "%s: P2P_SET GO NoA: count=%d interval=%d duration=%d", + __func__, count, interval, duration); + duration = MS_TO_TU_MUS(duration); /* PS Selection * Periodic NoA (2) * Single NOA (4) @@ -1771,7 +1771,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) NoA.single_noa_duration = 0; NoA.psSelection = P2P_POWER_SAVE_TYPE_PERIODIC_NOA; } - NoA.interval = MS_TO_MUS(100); + NoA.interval = MS_TO_TU_MUS(interval); NoA.count = count; NoA.sessionid = pAdapter->sessionId;