wlan:FTM fix for iwpriv
When use iwpriv command do FTM test, wlan driver should get FTM
response and check the result. But current code only signal a
complete when process FTM response, then discard the response,
Some customer want to add some new command to:
-control Power control mode
-enable DPD
-set channel bonding mode
-support 5G channel when use set_channel command
CRs-fixed: 477522
Change-Id: Ic774b20f94c194a66cfb4f5a38032a87b591d5fa
diff --git a/CORE/HDD/inc/wlan_hdd_ftm.h b/CORE/HDD/inc/wlan_hdd_ftm.h
index 71a3d3c..2aff39c 100644
--- a/CORE/HDD/inc/wlan_hdd_ftm.h
+++ b/CORE/HDD/inc/wlan_hdd_ftm.h
@@ -74,6 +74,9 @@
#define WE_CLEAR_RX_PKT_CNT 8
#define WE_RX 9
#define WE_ENABLE_CHAIN 10
+#define WE_SET_PWR_CNTL_MODE 11
+#define WE_ENABLE_DPD 12
+#define WE_SET_CB 13
/* Private ioctls and their sub-ioctls */
#define WLAN_FTM_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1)
diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c
index 278696d..44b5936 100644
--- a/CORE/HDD/src/wlan_hdd_ftm.c
+++ b/CORE/HDD/src/wlan_hdd_ftm.c
@@ -153,6 +153,8 @@
#define QWLAN_MAX_MAC_LAST_BYTE_VALUE 0xFC
#define NV_EMBEDDED_VERSION 0x80
+#define QWLAN_TXFIR_CFG_DPD_BYPASS_MASK 0x8
+
typedef struct {
tANI_U32 tableSize; /* Whole NV Table Size */
tANI_U32 chunkSize; /* Current Chunk Size < 2K */
@@ -210,7 +212,27 @@
{ HAL_PHY_RATE_MCS_1NSS_52_MBPS, "MCS_52_MBPS"},
{ HAL_PHY_RATE_MCS_1NSS_58_5_MBPS, "MCS_58_5_MBPS"},
{ HAL_PHY_RATE_MCS_1NSS_65_MBPS, "MCS_65_MBPS"},
- { HAL_PHY_RATE_MCS_1NSS_MM_SG_72_2_MBPS, "MCS_72_2_MBPS"}
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_72_2_MBPS, "MCS_72_2_MBPS"},
+
+//MCS Index #8-15 (40MHz)
+
+ { HAL_PHY_RATE_MCS_1NSS_CB_13_5_MBPS, "MCS_CB_13_B_MBPS" },
+ { HAL_PHY_RATE_MCS_1NSS_CB_27_MBPS, "MCS_CB_27_MBPS" },
+ { HAL_PHY_RATE_MCS_1NSS_CB_40_5_MBPS, "MCS_CB_40_5_MBPS" },
+ { HAL_PHY_RATE_MCS_1NSS_CB_54_MBPS, "MCS_CB_54_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_CB_81_MBPS, "MCS_CB_81_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_CB_108_MBPS, "MCS_CB_108_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_CB_121_5_MBPS, "MCS_CB_121_5_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_CB_135_MBPS, "MCS_CB_135_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_15_MBPS, "MCS_CB_15_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_30_MBPS, "MCS_CB_30_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_45_MBPS, "MCS_CB_45_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_60_MBPS, "MCS_CB_60_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_90_MBPS, "MCS_CB_90_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_120_MBPS, "MCS_CB_120_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_135_MBPS, "MCS_CB_135_MBPS"},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_150_MBPS, "MCS_CB_150_MBPS"}
+
};
static rateIndex2Preamble_t rate_index_2_preamble_table[] =
@@ -235,6 +257,16 @@
{ HAL_PHY_RATE_11A_48_MBPS, PHYDBG_PREAMBLE_OFDM},
{ HAL_PHY_RATE_11A_54_MBPS, PHYDBG_PREAMBLE_OFDM},
+ // 11A 20MHz Rates
+ { HAL_PHY_RATE_11A_DUP_6_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_9_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_12_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_18_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_24_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_36_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_48_MBPS, PHYDBG_PREAMBLE_OFDM},
+ { HAL_PHY_RATE_11A_DUP_54_MBPS, PHYDBG_PREAMBLE_OFDM},
+
//MCS Index #0-15 (20MHz)
{ HAL_PHY_RATE_MCS_1NSS_6_5_MBPS, PHYDBG_PREAMBLE_MIXED},
{ HAL_PHY_RATE_MCS_1NSS_13_MBPS, PHYDBG_PREAMBLE_MIXED},
@@ -252,8 +284,43 @@
{ HAL_PHY_RATE_MCS_1NSS_MM_SG_57_8_MBPS,PHYDBG_PREAMBLE_NOT_SUPPORTED},
{ HAL_PHY_RATE_MCS_1NSS_MM_SG_65_MBPS, PHYDBG_PREAMBLE_NOT_SUPPORTED},
{ HAL_PHY_RATE_MCS_1NSS_MM_SG_72_2_MBPS, PHYDBG_PREAMBLE_MIXED},
+
+ //MCS index (40MHz)
+ { HAL_PHY_RATE_MCS_1NSS_CB_13_5_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_27_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_40_5_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_54_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_81_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_108_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_121_5_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_CB_135_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_15_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_30_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_45_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_60_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_90_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_120_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_135_MBPS, PHYDBG_PREAMBLE_MIXED},
+ { HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_150_MBPS, PHYDBG_PREAMBLE_MIXED}
+
};
+static unsigned int valid_channel[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 36, 40, 44, 48,
+ 52, 56, 60, 64, 100, 104, 108,
+ 112, 116, 120, 124, 128, 132,
+ 136, 140, 149, 153, 157, 161,
+ 165, 208, 212, 216, 240, 244,
+ 248, 252, 0 };
+static unsigned int valid_channel_cb40[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 38,
+ 42, 46, 50, 54, 58, 62, 102, 106,
+ 110, 114, 118, 122, 126, 130, 134,
+ 138, 151, 155, 159, 163, 210, 214,
+ 242, 246, 250, 0 };
+static unsigned int valid_channel_cb80[] = { 7, 42, 46, 50, 54, 58, 106, 110,
+ 114, 118, 122, 126, 130, 134, 155,
+ 159, 246, 0 };
+
typedef struct
{
tANI_BOOLEAN frameGenEnabled;
@@ -262,11 +329,13 @@
v_U16_t txpower;
v_U16_t rxmode;
v_U16_t chainSelect;
+ ePhyChanBondState cbmode;
} FTM_STATUS ;
static FTM_STATUS ftm_status;
//tpAniSirGlobal pMac;
+static tPttMsgbuffer *pMsgBuf;
static void _ftm_status_init(void)
{
@@ -292,6 +361,7 @@
ftm_status.txpower = 2 ;
ftm_status.rxmode = RXMODE_ENABLE_ALL; /* macStart() enables all receive pkt types */
ftm_status.chainSelect = FTM_CHAIN_SEL_R0_T0_ON;
+ ftm_status.cbmode = 0 ; //none channel bonding
return;
}
@@ -735,12 +805,9 @@
return VOS_STATUS_SUCCESS;
}
-/**---------------------------------------------------------------------------
- --------------------------------------------------------------------------*/
static VOS_STATUS wlan_ftm_priv_enable_chain(hdd_adapter_t *pAdapter,v_U16_t chainSelect)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
v_U16_t chainSelect_save = chainSelect;
@@ -780,12 +847,7 @@
break;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_ENABLE_CHAINS;
pMsgBuf->msgBodyLength = sizeof(tMsgPttEnableChains) + PTT_HEADER_LENGTH;
@@ -795,23 +857,25 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
ftm_status.chainSelect = chainSelect_save;
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -900,11 +964,21 @@
void HEXDUMP(char *s0, char *s1, int len)
{
- int tmp;
+ int i = 0, j = 0;
printk(KERN_EMERG "%s\n :", s0);
- for (tmp = 0; tmp< len; tmp++) {
- printk(KERN_EMERG "%02x ", *s1++);
+ if (len > 8)
+ {
+ for (j = 0; j < len/8; j++)
+ {
+ printk(KERN_EMERG "%02x %02x %02x %02x %02x %02x %02x %02x",
+ s1[j*8], s1[j*8+1], s1[j*8+2], s1[j*8+3], s1[j*8+4],
+ s1[j*8+5],s1[j*8+6],s1[j*8+7] );
+ }
+ len = len - j*8;
+ }
+ for (i = 0; i< len; i++) {
+ printk(KERN_EMERG "%02x ", s1[j*8+i]);
}
printk("\n");
}
@@ -2906,6 +2980,16 @@
"FTM Start Failed");
return VOS_STATUS_E_FAILURE;
}
+ if (NULL == pMsgBuf)
+ {
+ pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
+ if (NULL == pMsgBuf)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:pMsgBuf is NULL", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+ }
}
else
{
@@ -2917,10 +3001,46 @@
"FTM Stop Failed");
return VOS_STATUS_E_FAILURE;
}
+ pHddCtx->ftm.ftm_state = WLAN_FTM_STOPPED;
+ if (pMsgBuf)
+ {
+ vos_mem_free((v_VOID_t * )pMsgBuf);
+ pMsgBuf = NULL;
+ }
}
return VOS_STATUS_SUCCESS;
}
+
+static VOS_STATUS validate_channel(unsigned int channel,unsigned int cb)
+{
+ unsigned int *table = NULL;
+ int index = 0;
+
+ if (PHY_SINGLE_CHANNEL_CENTERED == cb)
+ table = valid_channel;
+ else if (cb >= PHY_DOUBLE_CHANNEL_LOW_PRIMARY &&
+ cb <= PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)
+ table = valid_channel_cb40;
+ else if (cb >= PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED &&
+ cb <= PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH)
+ table = valid_channel_cb80;
+
+ if (NULL == table)
+ return VOS_STATUS_E_FAILURE;
+
+ while (table[index] != 0)
+ {
+ if (table[index] == channel)
+ return VOS_STATUS_SUCCESS;
+
+ index++;
+ }
+
+ return VOS_STATUS_E_FAILURE;
+}
+
+
/**---------------------------------------------------------------------------
\brief wlan_ftm_priv_set_channel() -
@@ -2936,29 +3056,25 @@
static VOS_STATUS wlan_ftm_priv_set_channel(hdd_adapter_t *pAdapter,v_U16_t channel)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- if(!(channel >= 1 && channel <= 14))
+ if (VOS_STATUS_SUCCESS != validate_channel(channel, ftm_status.cbmode))
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Invalid Channel Number. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Invalid Channel Number. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(*pMsgBuf), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_SET_CHANNEL;
pMsgBuf->msgBodyLength = sizeof(tMsgPttSetChannel) + PTT_HEADER_LENGTH;
@@ -2968,32 +3084,101 @@
pMsgBody->SetChannel.chId = channel;
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Channel =%d\n",pMsgBody->SetChannel.chId);
- pMsgBody->SetChannel.cbState = PHY_SINGLE_CHANNEL_CENTERED;
+ pMsgBody->SetChannel.cbState = ftm_status.cbmode ;
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
+
+/**---------------------------------------------------------------------------
+
+ \brief wlan_ftm_priv_set_pwr_cntl_mode() -
+
+ This function is used for setting the power control mode for tx.
+
+ \param - pAdapter - Pointer HDD Context.
+ - pwr_mode - power control mode 0-2.
+
+ \return - 0 for success, non zero for failure
+
+ --------------------------------------------------------------------------*/
+
+static VOS_STATUS wlan_ftm_priv_set_pwr_cntl_mode(hdd_adapter_t *pAdapter,
+ v_U16_t pwr_mode)
+{
+ uPttMsgs *pMsgBody;
+ VOS_STATUS status;
+ hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
+
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+
+ if (pwr_mode > 2)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:invalid control mode.valid mode is 0 , 1, 2.", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
+ init_completion(&pHddCtx->ftm.ftm_comp_var);
+ pMsgBody = &pMsgBuf->msgBody;
+ pMsgBuf->msgId = PTT_MSG_CLOSE_TPC_LOOP_PRIMA_V1;
+ pMsgBuf->msgBodyLength = sizeof(tMsgPttCloseTpcLoop) + PTT_HEADER_LENGTH;
+
+ pMsgBody->CloseTpcLoop.tpcClose = pwr_mode;
+ status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf, pMsgBuf->msgBodyLength);
+
+ if (status != VOS_STATUS_SUCCESS)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
+ status = VOS_STATUS_E_FAILURE;
+ goto done;
+ }
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
+ status = VOS_STATUS_E_FAILURE;
+ goto done;
+ }
+
+ done:
+ return status;
+
+}
+
/**---------------------------------------------------------------------------
\brief wlan_ftm_priv_set_txpower() -
@@ -3007,16 +3192,17 @@
--------------------------------------------------------------------------*/
-static VOS_STATUS wlan_ftm_priv_set_txpower(hdd_adapter_t *pAdapter,v_U16_t txpower)
+static VOS_STATUS wlan_ftm_priv_set_txpower(hdd_adapter_t *pAdapter,
+ v_U16_t txpower)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
@@ -3025,46 +3211,21 @@
*/
if (ftm_status.frameGenEnabled)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:cannot set txpower when pktgen is enabled.",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:cannot set txpower when pktgen is enabled.", __func__);
return VOS_STATUS_E_FAILURE;
}
if(!(txpower >= 9 && txpower <= 24))
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Invalid tx power. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Invalid tx power. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
- init_completion(&pHddCtx->ftm.ftm_comp_var);
- pMsgBuf->msgId = PTT_MSG_CLOSE_TPC_LOOP;
- pMsgBuf->msgBodyLength = sizeof(tMsgPttCloseTpcLoop) + PTT_HEADER_LENGTH;
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
+ init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBody = &pMsgBuf->msgBody;
- pMsgBody->CloseTpcLoop.tpcClose = TRUE;
-
- status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
-
- if(status != VOS_STATUS_SUCCESS)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
- status = VOS_STATUS_E_FAILURE;
- goto done;
- }
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
-
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
- status = VOS_STATUS_E_FAILURE;
- goto done;
- }
-
- init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_SET_TX_POWER;
pMsgBuf->msgBodyLength = sizeof(tMsgPttSetTxPower) + PTT_HEADER_LENGTH;
@@ -3072,28 +3233,66 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
ftm_status.txpower = txpower ;
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
+
+
+static VOS_STATUS wlan_ftm_priv_enable_dpd(hdd_adapter_t *pAdapter,
+ v_U16_t enable)
+{
+ tANI_U32 value = 0;
+ tANI_U32 reg_addr;
+ hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+
+#ifdef WCN_PRONTO
+ reg_addr = 0xfb018000;
+#else
+ reg_addr = 0x03018000;
+#endif
+ wpalReadRegister(reg_addr, &value);
+ if (enable)
+ {
+ value &= (~QWLAN_TXFIR_CFG_DPD_BYPASS_MASK);
+ }
+ else
+ {
+ value |= QWLAN_TXFIR_CFG_DPD_BYPASS_MASK;
+ }
+
+ wpalWriteRegister(reg_addr, value);
+
+ return VOS_STATUS_SUCCESS;
+}
+
+
/**---------------------------------------------------------------------------
\brief wlan_ftm_priv_set_txrate() -
@@ -3157,20 +3356,21 @@
static VOS_STATUS wlan_ftm_priv_start_stop_tx_pktgen(hdd_adapter_t *pAdapter,v_U16_t startStop)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- if(startStop != 1 && startStop != 0)
+ if (startStop != 1 && startStop != 0)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Tx value is invalid ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Tx value is invalid ", __func__);
return VOS_STATUS_E_FAILURE;
}
@@ -3179,13 +3379,8 @@
{
return VOS_STATUS_SUCCESS ;
}
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
if (startStop == 1)
{
init_completion(&pHddCtx->ftm.ftm_comp_var);
@@ -3195,17 +3390,20 @@
pMsgBody->ConfigTxPacketGen.frameParams = ftm_status.frameParams ;
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:posting PTT_MSG_CONFIG_TX_PACKET_GEN failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:posting PTT_MSG_CONFIG_TX_PACKET_GEN failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: PTT_MSG_CONFIG_TX_PACKET_GEN failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s: PTT_MSG_CONFIG_TX_PACKET_GEN failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -3234,17 +3432,16 @@
}
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
if (status == VOS_STATUS_SUCCESS)
{
if (startStop == 1)
{
- ftm_status.frameGenEnabled = eANI_BOOLEAN_TRUE ;
+ ftm_status.frameGenEnabled = eANI_BOOLEAN_TRUE;
}
else
{
- ftm_status.frameGenEnabled = eANI_BOOLEAN_FALSE ;
+ ftm_status.frameGenEnabled = eANI_BOOLEAN_FALSE;
}
}
@@ -3252,6 +3449,31 @@
}
+
+static VOS_STATUS wlan_ftm_priv_set_cb(hdd_adapter_t *pAdapter, v_U16_t cbmode)
+{
+
+ hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+
+ if (cbmode > PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:cb mode value is invalid ", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
+
+ ftm_status.cbmode = cbmode;
+
+ return VOS_STATUS_SUCCESS;
+
+}
+
/**---------------------------------------------------------------------------
\brief wlan_ftm_rx_mode() -
@@ -3270,29 +3492,25 @@
static VOS_STATUS wlan_ftm_priv_rx_mode(hdd_adapter_t *pAdapter,v_U16_t rxmode)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- if(rxmode > 3)
+ if (rxmode > 3)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Rx mode value is invalid ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Rx mode value is invalid ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_SET_RX_DISABLE_MODE;
@@ -3330,23 +3548,25 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
ftm_status.rxmode = rxmode ;
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3366,54 +3586,48 @@
static VOS_STATUS wlan_ftm_priv_rx_pkt_clear(hdd_adapter_t *pAdapter,v_U16_t rx_pkt_clear)
{
- tPttMsgbuffer *pMsgBuf;
- uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- if(rx_pkt_clear != 1)
+ if (rx_pkt_clear != 1)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Invalid rx_pkt_clear value ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Invalid rx_pkt_clear value ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_RESET_RX_PACKET_STATISTICS;
pMsgBuf->msgBodyLength = sizeof(tMsgPttResetRxPacketStatistics) + PTT_HEADER_LENGTH;
- pMsgBody = &pMsgBuf->msgBody;
- pMsgBody->ResetRxPacketStatistics.notUsed= rx_pkt_clear;
-
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3434,7 +3648,6 @@
static VOS_STATUS wlan_ftm_priv_get_channel(hdd_adapter_t *pAdapter,v_U16_t *pChannel)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
v_U16_t freq;
@@ -3442,17 +3655,13 @@
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_DBG_READ_REGISTER;
pMsgBuf->msgBodyLength = sizeof(tMsgPttDbgReadRegister) + PTT_HEADER_LENGTH;
@@ -3462,18 +3671,21 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -3493,7 +3705,6 @@
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Channel = %d freq = %d\n",*pChannel, freq);
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3514,22 +3725,17 @@
static VOS_STATUS wlan_ftm_priv_get_txpower(hdd_adapter_t *pAdapter,v_U16_t *pTxPwr)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_GET_TX_POWER_REPORT;
pMsgBuf->msgBodyLength = sizeof(tMsgPttGetTxPowerReport) + PTT_HEADER_LENGTH;
@@ -3538,24 +3744,26 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: PTT_MSG_GET_TX_POWER_REPORT failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s: PTT_MSG_GET_TX_POWER_REPORT failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
*pTxPwr = ((((pMsgBody->GetTxPowerReport.pwrTemplateIndex & 0x1F) + 4)*50)/100);
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3575,7 +3783,6 @@
VOS_STATUS wlan_ftm_priv_get_ftm_version(hdd_adapter_t *pAdapter,char *pftmVer)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
v_U32_t reg_val;
@@ -3584,18 +3791,14 @@
int lenRes = 0;
int lenBuf = WE_FTM_MAX_STR_LEN;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_DBG_READ_REGISTER;
pMsgBuf->msgBodyLength = sizeof(tMsgPttDbgReadRegister) + PTT_HEADER_LENGTH;
@@ -3605,18 +3808,21 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -3632,13 +3838,15 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
lenRes = snprintf(buf, lenBuf, "%s_",WLAN_CHIP_VERSION);
@@ -3674,7 +3882,6 @@
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
@@ -3696,24 +3903,19 @@
static VOS_STATUS wlan_ftm_priv_get_txrate(hdd_adapter_t *pAdapter,char *pTxRate)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
v_U16_t rate_index,ii;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_GET_TX_POWER_REPORT;
pMsgBuf->msgBodyLength = sizeof(tMsgPttGetTxPowerReport) + PTT_HEADER_LENGTH;
@@ -3722,22 +3924,25 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse == PTT_STATUS_SUCCESS) {
+ if (pMsgBuf->msgResponse == PTT_STATUS_SUCCESS) {
rate_index = pMsgBody->GetTxPowerReport.rate;
}
else {
/*Return the default rate*/
//rate_index = HAL_PHY_RATE_11A_6_MBPS;
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: PTT_MSG_GET_TX_POWER_REPORT failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s: PTT_MSG_GET_TX_POWER_REPORT failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -3754,7 +3959,6 @@
}
strlcpy(pTxRate,rateName_rateIndex_tbl[ii].rate_str, WE_FTM_MAX_STR_LEN);
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
@@ -3776,22 +3980,17 @@
static VOS_STATUS wlan_ftm_priv_get_rx_pkt_count(hdd_adapter_t *pAdapter,v_U16_t *pRxPktCnt)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_GET_RX_PKT_COUNTS;
pMsgBuf->msgBodyLength = sizeof(tMsgPttGetRxPktCounts) + PTT_HEADER_LENGTH;
@@ -3800,23 +3999,25 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
*pRxPktCnt = pMsgBody->GetRxPktCounts.counters.totalRxPackets;
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3837,23 +4038,18 @@
static VOS_STATUS wlan_ftm_priv_get_rx_rssi(hdd_adapter_t *pAdapter,char *buf)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
int ret;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_GET_RX_RSSI;
pMsgBuf->msgBodyLength = sizeof(tMsgPttGetRxRssi) + PTT_HEADER_LENGTH;
@@ -3862,17 +4058,20 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -3887,7 +4086,6 @@
}
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return status;
}
@@ -3967,7 +4165,6 @@
static VOS_STATUS wlan_ftm_priv_set_mac_address(hdd_adapter_t *pAdapter,char *buf)
{
- tPttMsgbuffer *pMsgBuf;
uPttMsgs *pMsgBody;
VOS_STATUS status;
int macAddr[VOS_MAC_ADDRESS_LEN];
@@ -3975,17 +4172,13 @@
v_U8_t ii;
hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx;
- if(pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
+ if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ftm has not started. Please start the ftm. ",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ftm has not started. Please start the ftm. ", __func__);
return VOS_STATUS_E_FAILURE;
}
- pMsgBuf = (tPttMsgbuffer *)vos_mem_malloc(sizeof(tPttMsgbuffer));
- if(pMsgBuf == NULL)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pMsgBuf is NULL",__func__);
- return VOS_STATUS_E_NOMEM;
- }
+ vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0);
init_completion(&pHddCtx->ftm.ftm_comp_var);
pMsgBuf->msgId = PTT_MSG_SET_NV_FIELD;
pMsgBuf->msgBodyLength = sizeof(tMsgPttSetNvField) + PTT_HEADER_LENGTH;
@@ -4008,17 +4201,20 @@
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "pMacAddress = %02x:%02x:%02x:%02x:%02x:%02x",MAC_ADDR_ARRAY(pMacAddress));
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed!!",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed!!", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
- if(pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
+ if (pMsgBuf->msgResponse != PTT_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Ptt response status failed",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:Ptt response status failed", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
@@ -4037,16 +4233,17 @@
status = wlan_ftm_postmsg((v_U8_t*)pMsgBuf,pMsgBuf->msgBodyLength);
- if(status != VOS_STATUS_SUCCESS)
+ if (status != VOS_STATUS_SUCCESS)
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:wlan_ftm_postmsg failed!!!!",__func__);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "%s:wlan_ftm_postmsg failed!!!!", __func__);
status = VOS_STATUS_E_FAILURE;
goto done;
}
- wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
+ wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var,
+ msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT));
done:
- vos_mem_free((v_VOID_t * )pMsgBuf);
return VOS_STATUS_SUCCESS;
}
@@ -4223,6 +4420,40 @@
break;
}
+ case WE_SET_PWR_CNTL_MODE:
+ {
+ status = wlan_ftm_priv_set_pwr_cntl_mode(pAdapter, set_value);
+ if (status != VOS_STATUS_SUCCESS)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "set_pwr_cntl_mode failed = %d",
+ status);
+ ret = -EINVAL;
+ }
+ break;
+ }
+
+ case WE_ENABLE_DPD:
+ {
+ status = wlan_ftm_priv_enable_dpd(pAdapter, set_value);
+ if (status != VOS_STATUS_SUCCESS)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "enable_dpd failed = %d", status);
+ ret = -EINVAL;
+ }
+ break;
+ }
+
+ case WE_SET_CB:
+ {
+ status = wlan_ftm_priv_set_cb(pAdapter, set_value);
+ if (status != VOS_STATUS_SUCCESS)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "set_cb failed = %d", status);
+ ret = -EINVAL;
+ }
+ break;
+ }
+
default:
{
hddLog(LOGE, "Invalid IOCTL setvalue command %d value %d \n",
@@ -4536,6 +4767,21 @@
0,
"ena_chain" },
+ { WE_SET_PWR_CNTL_MODE,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+ 0,
+ "pwr_cntl_mode" },
+
+ { WE_ENABLE_DPD,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+ 0,
+ "ena_dpd" },
+
+ { WE_SET_CB,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+ 0,
+ "set_cb" },
+
/* handlers for main ioctl */
{ WLAN_FTM_PRIV_SET_NONE_GET_INT,
0,
@@ -4669,6 +4915,7 @@
if (pHddCtx->ftm.cmd_iwpriv == TRUE) {
+ memcpy((char*)pMsgBuf, (char*)message, pFtmMsgRsp->msgBodyLength);
complete(&pHddCtx->ftm.ftm_comp_var);
}
else {