diff --git a/drivers/net/wireless/wcnss/wcnss_vreg.c b/drivers/net/wireless/wcnss/wcnss_vreg.c index 6cfd8cbf1636..92cda8e1fe13 100644 --- a/drivers/net/wireless/wcnss/wcnss_vreg.c +++ b/drivers/net/wireless/wcnss/wcnss_vreg.c @@ -45,6 +45,14 @@ static int auto_detect; #define PRONTO_IRIS_REG_READ_OFFSET 0x1134 #define PRONTO_IRIS_REG_CHIP_ID 0x04 +#define WCN3660 0x0200 +#define WCN3660A 0x0300 +#define WCN3660B 0x0400 +#define WCN3620 0x5111 +#define WCN3620A 0x5112 +#define WCN3610 0x9101 +#define WCN3610V1 0x9110 + #define WCNSS_PMU_CFG_IRIS_XO_CFG BIT(3) #define WCNSS_PMU_CFG_IRIS_XO_EN BIT(4) #define WCNSS_PMU_CFG_IRIS_XO_CFG_STS BIT(6) /* 1: in progress, 0: done */ @@ -141,6 +149,50 @@ int xo_auto_detect(u32 reg) } } +int wcnss_get_iris_name(char *iris_name) +{ + struct wcnss_wlan_config *cfg = NULL; + int iris_id; + + cfg = wcnss_get_wlan_config(); + + if (cfg) { + iris_id = cfg->iris_id; + iris_id = iris_id >> 16; + } else { + return 1; + } + + switch (iris_id) { + case WCN3660: + memcpy(iris_name, "WCN3660", sizeof("WCN3660")); + break; + case WCN3660A: + memcpy(iris_name, "WCN3660A", sizeof("WCN3660A")); + break; + case WCN3660B: + memcpy(iris_name, "WCN3660B", sizeof("WCN3660B")); + break; + case WCN3620: + memcpy(iris_name, "WCN3620", sizeof("WCN3620")); + break; + case WCN3620A: + memcpy(iris_name, "WCN3620A", sizeof("WCN3620A")); + break; + case WCN3610: + memcpy(iris_name, "WCN3610", sizeof("WCN3610")); + break; + case WCN3610V1: + memcpy(iris_name, "WCN3610V1", sizeof("WCN3610V1")); + break; + default: + return 1; + } + + return 0; +} +EXPORT_SYMBOL(wcnss_get_iris_name); + static int configure_iris_xo(struct device *dev, bool use_48mhz_xo, int on, int *iris_xo_set) { diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c index 8d198a69714e..fbef0d0c231b 100644 --- a/drivers/net/wireless/wcnss/wcnss_wlan.c +++ b/drivers/net/wireless/wcnss/wcnss_wlan.c @@ -955,6 +955,25 @@ void wcnss_reset_intr(void) } EXPORT_SYMBOL(wcnss_reset_intr); +void wcnss_reset_fiq(bool clk_chk_en) +{ + if (wcnss_hardware_type() == WCNSS_PRONTO_HW) { + if (clk_chk_en) { + wcnss_log_debug_regs_on_bite(); + } else { + wcnss_pronto_log_debug_regs(); + if (wcnss_get_mux_control()) + wcnss_log_iris_regs(); + } + /* Insert memory barrier before writing fiq register */ + wmb(); + __raw_writel(1 << 16, penv->fiq_reg); + } else { + wcnss_riva_log_debug_regs(); + } +} +EXPORT_SYMBOL(wcnss_reset_fiq); + static int wcnss_create_sysfs(struct device *dev) { int ret; @@ -2913,6 +2932,17 @@ static void __exit wcnss_wlan_exit(void) platform_driver_unregister(&wcnss_wlan_driver); } +/* wlan prop driver cannot invoke show_stack + * function directly, so to invoke this function it + * call wcnss_dump_stack function + */ +void wcnss_dump_stack(struct task_struct *task) +{ + show_stack(task, NULL); +} +EXPORT_SYMBOL(wcnss_dump_stack); + + module_init(wcnss_wlan_init); module_exit(wcnss_wlan_exit); diff --git a/drivers/staging/prima/Android.mk b/drivers/staging/prima/Android.mk index 6bb1ec639545..115780b3ceb4 100644 --- a/drivers/staging/prima/Android.mk +++ b/drivers/staging/prima/Android.mk @@ -9,8 +9,9 @@ WLAN_CHIPSET := prima WLAN_SELECT := CONFIG_PRIMA_WLAN=m endif -# Build/Package options for 8916, 8974, 8226, 8610, 8909 targets -ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909,$(TARGET_BOARD_PLATFORM))) +# Build/Package options for 8916, 8974, 8226, 8610, 8909, 8952 targets +ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909 msm8952,$(TARGET_BOARD_PLATFORM))) + WLAN_CHIPSET := pronto WLAN_SELECT := CONFIG_PRONTO_WLAN=m endif diff --git a/drivers/staging/prima/CORE/BAP/inc/bapApi.h b/drivers/staging/prima/CORE/BAP/inc/bapApi.h index 606048f0ac3b..ea0ca07cd9f2 100644 --- a/drivers/staging/prima/CORE/BAP/inc/bapApi.h +++ b/drivers/staging/prima/CORE/BAP/inc/bapApi.h @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiData.c b/drivers/staging/prima/CORE/BAP/src/bapApiData.c index 715d0c9a1ce5..e7ba26676e61 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiData.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiData.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -403,6 +400,7 @@ WLANBAP_XlateTxDataPkt // Now copy the AC values from the Logical Link context *pucAC = pLogLinkContext->btampAC; // Now copy the values from the Logical Link context to the MetaInfo + tlMetaInfo->ac = *pucAC; tlMetaInfo->ucTID = pLogLinkContext->ucTID; tlMetaInfo->ucUP = pLogLinkContext->ucUP; tlMetaInfo->ucIsEapol = VOS_FALSE; @@ -1015,7 +1013,7 @@ WLANBAP_TxCompCB #ifdef BAP_DEBUG /* Trace the bapContext referenced. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN BAP Context Monitor: bapContext value = %p in %s:%d. vosDataBuff=%p", bapContext, __func__, __LINE__, vosDataBuff ); + "WLAN BAP Context Monitor: bapContext value = %pK in %s:%d. vosDataBuff=%pK", bapContext, __func__, __LINE__, vosDataBuff ); #endif //BAP_DEBUG // Sanity check the log_link_handle value @@ -1166,7 +1164,7 @@ WLANBAP_STAPktPending #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN BAP Context Monitor: pBtampCtx value = %p in %s:%d", pBtampCtx, __func__, __LINE__ ); + "WLAN BAP Context Monitor: pBtampCtx value = %pK in %s:%d", pBtampCtx, __func__, __LINE__ ); #endif //BAP_DEBUG /*------------------------------------------------------------------------ diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiDebug.c b/drivers/staging/prima/CORE/BAP/src/bapApiDebug.c index 65599cbaec6b..f812f2c1b222 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiDebug.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiDebug.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiExt.c b/drivers/staging/prima/CORE/BAP/src/bapApiExt.c index 6ab6035eeb26..b0d2ea57d7d7 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiExt.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiExt.c @@ -44,9 +44,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiExt.h b/drivers/staging/prima/CORE/BAP/src/bapApiExt.h index 40b22cef0773..6293e6519f0f 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiExt.h +++ b/drivers/staging/prima/CORE/BAP/src/bapApiExt.h @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiHCBB.c b/drivers/staging/prima/CORE/BAP/src/bapApiHCBB.c index 595e14b5d7c6..58c14687f888 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiHCBB.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiHCBB.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -147,7 +144,7 @@ WLAN_BAPReset tHalHandle hHal = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if (btampHandle == NULL) @@ -294,7 +291,7 @@ WLAN_BAPFlush ptBtampContext btampContext = (ptBtampContext) btampHandle; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if (btampHandle == NULL) { @@ -367,7 +364,7 @@ WLAN_EnhancedBAPFlush ptBtampContext btampContext; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ /* Validate params */ @@ -447,7 +444,7 @@ WLAN_BAPReadConnectionAcceptTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -516,7 +513,7 @@ WLAN_BAPWriteConnectionAcceptTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteConnectionAcceptTimeout) @@ -607,7 +604,7 @@ WLAN_BAPReadLinkSupervisionTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadLinkSupervisionTimeout) || @@ -699,7 +696,7 @@ WLAN_BAPWriteLinkSupervisionTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLinkSupervisionTimeout) || @@ -791,7 +788,7 @@ WLAN_BAPReadLogicalLinkAcceptTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -860,7 +857,7 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLogicalLinkAcceptTimeout) @@ -948,7 +945,7 @@ WLAN_BAPSetEventMaskPage2 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCISetEventMaskPage2) @@ -1023,7 +1020,7 @@ WLAN_BAPReadLocationData /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -1105,7 +1102,7 @@ WLAN_BAPWriteLocationData /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLocationData) @@ -1186,7 +1183,7 @@ WLAN_BAPReadFlowControlMode /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -1391,7 +1388,7 @@ WLAN_BAPSetShortRangeMode /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -1532,7 +1529,7 @@ WLAN_BAPVendorSpecificCmd0 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) @@ -1632,7 +1629,7 @@ WLAN_BAPVendorSpecificCmd1 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiInfo.c b/drivers/staging/prima/CORE/BAP/src/bapApiInfo.c index 0e286416567b..d2bc3c042c42 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiInfo.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiInfo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -156,7 +153,7 @@ WLAN_BAPReadLocalVersionInfo } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Format the command complete event to return... */ @@ -232,7 +229,7 @@ WLAN_BAPReadLocalSupportedCmds } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Format the command complete event to return... */ @@ -298,7 +295,7 @@ WLAN_BAPReadBufferSize } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Format the command complete event to return... */ @@ -368,7 +365,7 @@ WLAN_BAPReadDataBlockSize } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Format the command complete event to return... */ @@ -529,7 +526,7 @@ WLAN_BAPDisconnect VOS_STATUS vosStatus; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if (btampHandle == NULL) @@ -595,7 +592,7 @@ v_BOOL_t WLAN_BAPSessionOn ptBtampContext btampContext = (ptBtampContext) btampHandle; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if (btampHandle == NULL) diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiLinkCntl.c b/drivers/staging/prima/CORE/BAP/src/bapApiLinkCntl.c index 792ecb9ef633..bbf53b25f9ec 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiLinkCntl.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiLinkCntl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -868,12 +865,12 @@ WLAN_BAPPhysicalLinkCreate /* Validate params */ if ((pBapHCIPhysLinkCreate == NULL) || (NULL == btampContext)) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %p, pBapHCIPhysLinkCreate is %p", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %pK, pBapHCIPhysLinkCreate is %pK", __func__, btampHandle, pBapHCIPhysLinkCreate); return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); if(DISCONNECTED != instanceVar->stateVar) { @@ -899,7 +896,7 @@ WLAN_BAPPhysicalLinkCreate &btampContext, /* Handle to return per assoc btampContext value in */ BT_INITIATOR); /* BT_INITIATOR */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %pK", __func__, btampContext); /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); @@ -971,12 +968,12 @@ WLAN_BAPPhysicalLinkAccept /* Validate params */ if ((pBapHCIPhysLinkAccept == NULL) || (NULL == btampContext)) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %p, pBapHCIPhysLinkAccept is %p", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %pK, pBapHCIPhysLinkAccept is %pK", __func__, btampHandle, pBapHCIPhysLinkAccept); return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); instanceVar = &(btampContext->bapPhysLinkMachine); if(DISCONNECTED != instanceVar->stateVar) @@ -1003,7 +1000,7 @@ WLAN_BAPPhysicalLinkAccept &btampContext, /* Handle to return per assoc btampContext value in */ BT_RESPONDER); /* BT_RESPONDER */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %pK", __func__, btampContext); /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); @@ -1073,7 +1070,7 @@ WLAN_BAPPhysicalLinkDisconnect return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate the Physical link handle */ if (pBapHCIPhysLinkDisconnect->phy_link_handle != btampContext->phy_link_handle) @@ -1092,7 +1089,7 @@ WLAN_BAPPhysicalLinkDisconnect bapEvent.event = eWLAN_BAP_HCI_PHYSICAL_LINK_DISCONNECT; bapEvent.params = pBapHCIPhysLinkDisconnect; - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %pK", __func__, btampContext); /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); @@ -1178,7 +1175,7 @@ WLAN_BAPLogicalLinkCreate } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate the BAP state to accept the logical link request Logical Link create/accept requests are allowed only in @@ -1368,7 +1365,7 @@ WLAN_BAPLogicalLinkAccept } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate the BAP state to accept the logical link request Logical Link create/accept requests are allowed only in @@ -1576,7 +1573,7 @@ WLAN_BAPLogicalLinkDisconnect #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN BAP Context Monitor: btampContext value = %p in %s:%d", btampContext, __func__, __LINE__ ); + "WLAN BAP Context Monitor: btampContext value = %pK in %s:%d", btampContext, __func__, __LINE__ ); #endif //BAP_DEBUG bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiLinkSupervision.c b/drivers/staging/prima/CORE/BAP/src/bapApiLinkSupervision.c index 6f9305b4b0b2..c2d08b69a846 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiLinkSupervision.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiLinkSupervision.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -523,7 +520,7 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB } } VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, - "%s:Returned Vos Packet:%p\n", __func__, pPacket ); + "%s:Returned Vos Packet:%pK\n", __func__, pPacket ); vos_pkt_return_packet( pPacket ); diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiStatus.c b/drivers/staging/prima/CORE/BAP/src/bapApiStatus.c index dc97618d4f2e..16b96fbd8ed0 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiStatus.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiStatus.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -249,7 +246,7 @@ WLAN_BAPReadLinkQuality /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadLinkQuality) || @@ -346,7 +343,7 @@ WLAN_BAPReadRSSI /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: btampHandle value: %p", __func__, btampHandle); + "%s: btampHandle value: %pK", __func__, btampHandle); /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadRSSI) || @@ -455,7 +452,7 @@ WLAN_BAPReadLocalAMPInfo return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Format the command complete event to return... */ @@ -567,7 +564,7 @@ WLAN_BAPReadLocalAMPAssoc return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, phy_link_handle = %d", __func__, @@ -804,13 +801,13 @@ WLAN_BAPWriteRemoteAMPAssoc return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_HCI_WRITE_REMOTE_AMP_ASSOC; bapEvent.params = pBapHCIWriteRemoteAMPAssoc; - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %pK", __func__, btampContext); /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiTimer.c b/drivers/staging/prima/CORE/BAP/src/bapApiTimer.c index 302c3d24c0b5..c27db4681e5a 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiTimer.c +++ b/drivers/staging/prima/CORE/BAP/src/bapApiTimer.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/BAP/src/bapApiTimer.h b/drivers/staging/prima/CORE/BAP/src/bapApiTimer.h index 5e3623ec3bf0..2c6a101b7641 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapApiTimer.h +++ b/drivers/staging/prima/CORE/BAP/src/bapApiTimer.h @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/BAP/src/bapInternal.h b/drivers/staging/prima/CORE/BAP/src/bapInternal.h index 689df0c30b1a..31b673464c76 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapInternal.h +++ b/drivers/staging/prima/CORE/BAP/src/bapInternal.h @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/BAP/src/bapModule.c b/drivers/staging/prima/CORE/BAP/src/bapModule.c index 5c4976cd4d8a..a293983d495b 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapModule.c +++ b/drivers/staging/prima/CORE/BAP/src/bapModule.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2016-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -580,7 +580,7 @@ WLANBAP_ReleaseHndl if( btampContext->isBapSessionOpen == TRUE ) { halStatus = sme_CloseSession(halHandle, - btampContext->sessionId, NULL, NULL); + btampContext->sessionId, VOS_TRUE, NULL, NULL); if(eHAL_STATUS_SUCCESS == halStatus) { btampContext->isBapSessionOpen = FALSE; @@ -963,7 +963,7 @@ WLANBAP_CreateNewPhyLinkCtx *hBtampContext = pBtampCtx; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Btamp Ctxt = %p", pBtampCtx); + "Btamp Ctxt = %pK", pBtampCtx); return VOS_STATUS_SUCCESS; #else // defined(BTAMP_MULTIPLE_PHY_LINKS) @@ -1098,7 +1098,7 @@ WLANBAP_CreateNewLogLinkCtx #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN BAP Context Monitor: pBtampContext value = %p in %s:%d", pBtampContext, __func__, __LINE__ ); + "WLAN BAP Context Monitor: pBtampContext value = %pK in %s:%d", pBtampContext, __func__, __LINE__ ); #endif //BAP_DEBUG /*------------------------------------------------------------------------ diff --git a/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.c b/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.c index ff07ea627db2..0aa72d7a95c7 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.c +++ b/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.c @@ -34,9 +34,6 @@ Description... - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ============================================================================== */ /* $HEADER$ */ diff --git a/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.h b/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.h index cdafc0a4d0b1..650dbcebde5f 100644 --- a/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.h +++ b/drivers/staging/prima/CORE/BAP/src/bapRsnTxRx.h @@ -37,9 +37,6 @@ Description... - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==============================================================================*/ diff --git a/drivers/staging/prima/CORE/BAP/src/btampFsm.c b/drivers/staging/prima/CORE/BAP/src/btampFsm.c index d311fab6dac7..0e1c6f022526 100644 --- a/drivers/staging/prima/CORE/BAP/src/btampFsm.c +++ b/drivers/staging/prima/CORE/BAP/src/btampFsm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -44,9 +44,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -194,7 +191,7 @@ bapSetKey( v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo ) return VOS_STATUS_E_FAULT; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %pK", __func__, btampContext); /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_RSN_SUCCESS; @@ -1401,7 +1398,7 @@ signalHCIPhysLinkDiscEvent #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN BAP Context Monitor: btampContext value = %p in %s:%d", btampContext, __func__, __LINE__ ); + "WLAN BAP Context Monitor: btampContext value = %pK in %s:%d", btampContext, __func__, __LINE__ ); #endif //BAP_DEBUG /* Loop disconnecting all Logical Links on this Physical Link */ diff --git a/drivers/staging/prima/CORE/BAP/src/btampFsm.h b/drivers/staging/prima/CORE/BAP/src/btampFsm.h index 0053d481cb0c..660f07e6f793 100644 --- a/drivers/staging/prima/CORE/BAP/src/btampFsm.h +++ b/drivers/staging/prima/CORE/BAP/src/btampFsm.h @@ -25,11 +25,6 @@ * to the Linux Foundation. */ -/* - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary - */ - /* This file is generated from btampFsm - do not edit manually*/ /* Generated on: Thu Oct 16 15:40:39 PDT 2008 / version 1.2 Beta 1 */ diff --git a/drivers/staging/prima/CORE/BAP/src/btampFsm_ext.h b/drivers/staging/prima/CORE/BAP/src/btampFsm_ext.h index 587070ff364c..cb089a3a508a 100644 --- a/drivers/staging/prima/CORE/BAP/src/btampFsm_ext.h +++ b/drivers/staging/prima/CORE/BAP/src/btampFsm_ext.h @@ -25,11 +25,6 @@ * to the Linux Foundation. */ -/* - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary - */ - /* This file is generated from btampFsm.cdd - do not edit manually*/ /* Generated on: Thu Oct 16 15:40:39 PDT 2008 */ diff --git a/drivers/staging/prima/CORE/DXE/inc/wlan_qct_dxe.h b/drivers/staging/prima/CORE/DXE/inc/wlan_qct_dxe.h index dc0aea3c4947..70c2eb650efb 100644 --- a/drivers/staging/prima/CORE/DXE/inc/wlan_qct_dxe.h +++ b/drivers/staging/prima/CORE/DXE/inc/wlan_qct_dxe.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,8 +35,6 @@ @brief This file contains the external API exposed by the wlan data transfer abstraction layer module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ========================================================================*/ /*=========================================================================== @@ -85,6 +83,13 @@ when who what, where, why * Size must be same with Vos Packet Size */ #define WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE (VPKT_SIZE_BUFFER) +/*reserve 30B of skb buff, to add NL header*/ +#define WLANDXE_NL_HEADER_SZ (30) + +/*MAX data transferred in one skb*/ +#define WLANDXE_FW_LOGGING_XFSIZE (WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE - \ + WLANDXE_NL_HEADER_SZ) + /*The maximum number of packets that can be chained in dxe for the Low priority channel Note: Increased it to 240 from 128 for Windows(EA) becase Windows is @@ -172,6 +177,23 @@ typedef WDTS_TxCompleteCbType WLANDXE_TxCompleteCbType; ===========================================================================*/ typedef WDTS_LowResourceCbType WLANDXE_LowResourceCbType; +/*========================================================================== + @ Type Name + WLANDXE_MbReceiveMsgCbType + + @ Description + DXE Mailbox mes receive indiacation + + @ Parameters + void + + @ Return + void +===========================================================================*/ +typedef WDTS_MbReceiveMsgType WLANDXE_MbReceiveMsgCbType; + +typedef WDTS_RxLogDoneType WLANDXE_RxLogDoneType; + /*========================================================================== @ Type Name WLANDXE_SetPowerStateCbType @@ -221,9 +243,7 @@ void *WLANDXE_Open @ Parameters pVoid pDXEContext : DXE module control block - WDTS_RxFrameReadyCbType rxFrameReadyCB : RX Frame ready CB function pointer - WDTS_TxCompleteCbType txCompleteCB : TX complete CB function pointer - WDTS_LowResourceCbType lowResourceCB : Low DXE resource notification CB function pointer + WDTS_ClientCallbacks WDTSCb : Callbacks to WDTS to indicate various events void *userContext : DXE Cliennt control block @ Return @@ -232,9 +252,7 @@ void *WLANDXE_Open wpt_status WLANDXE_ClientRegistration ( void *pDXEContext, - WDTS_RxFrameReadyCbType rxFrameReadyCB, - WDTS_TxCompleteCbType txCompleteCB, - WDTS_LowResourceCbType lowResourceCB, + WDTS_ClientCallbacks WDTSCb, void *userContext ); @@ -424,54 +442,33 @@ void WLANDXE_ChannelDebug wpt_uint8 debugFlags ); -#ifdef WLANDXE_TEST_CHANNEL_ENABLE /*========================================================================== - @ Function Name - WLANDXE_UnitTest + @ Function Name + WLANDXE_KickDxe - @ Description - Temporary for the DXE module test + @ Description + Kick Dxe when HDD TX timeout happen @ Parameters - NONE + NONE @ Return - NONE + NONE ===========================================================================*/ -void WLANDXE_UnitTestStartDXE +void WLANDXE_KickDxe ( void ); -/*========================================================================== - @ Function Name - - @ Description - - @ Parameters - - @ Return - -===========================================================================*/ -void WLANDXE_UnitTestDataTransfer +wpt_uint32 WLANDXE_SetupLogTransfer ( - void + wpt_uint64 bufferAddr, + wpt_uint32 bufferLen ); -/*========================================================================== - @ Function Name - - @ Description - - @ Parameters - - @ Return - -===========================================================================*/ -void WLANDXE_UnitTestEventHandle +wpt_status WLANDXE_StartLogTransfer ( - void *dxeCB +void ); -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ #endif /* WLAN_QCT_DXE_H */ diff --git a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe.c b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe.c index 8813e6a52bf0..91243dc55c1d 100644 --- a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe.c +++ b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -64,9 +64,6 @@ when who what, where, why #include "wlan_qct_dxe.h" #include "wlan_qct_dxe_i.h" #include "wlan_qct_pal_device.h" -#ifdef FEATURE_R33D -#include "wlan_qct_pal_bus.h" -#endif /* FEATURE_R33D */ /*---------------------------------------------------------------------------- * Local Definitions @@ -110,14 +107,12 @@ static char *channelType[WDTS_CHANNEL_MAX] = "TX_LOW_PRI", "TX_HIGH_PRI", "RX_LOW_PRI", -#ifndef WLANDXE_TEST_CHANNEL_ENABLE "RX_HIGH_PRI", -#else - "H2H_TEST_TX", - "H2H_TEST_RX" -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ + "RX_LOGS", + "RX_FW_LOGS", }; static wpt_packet *rx_reaped_buf[WLANDXE_MAX_REAPED_RX_FRAMES]; +static WLANDXE_EnvInformation dxeEnvBlk; /*------------------------------------------------------------------------- * External Function Proto Type @@ -144,6 +139,11 @@ static void dxeStartSSRTimer WLANDXE_CtrlBlkType *dxeCtxt ); +static wpt_status dxeTXCleanup +( + WLANDXE_CtrlBlkType *hostCtxt +); + /*------------------------------------------------------------------------- * Local Function *-------------------------------------------------------------------------*/ @@ -177,7 +177,7 @@ static wpt_status dxeChannelMonitor return eWLAN_PAL_STATUS_E_INVAL; } - if(channelEntry->channelType > WDTS_CHANNEL_RX_HIGH_PRI) + if(channelEntry->channelType >= WDTS_CHANNEL_MAX) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, "INVALID Channel type"); @@ -351,7 +351,7 @@ wpt_status dxeChannelRegisterDump dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); wpalSleep(10); - if(channelEntry->channelType > WDTS_CHANNEL_RX_HIGH_PRI) + if(channelEntry->channelType >= WDTS_CHANNEL_MAX) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, "INVALID Channel type"); @@ -416,7 +416,8 @@ void dxeChannelAllDescDump previousCtrlValue = targetCtrlBlk->linkedDesc->descCtrl.ctrl; if((WDTS_CHANNEL_RX_LOW_PRI == channel) || - (WDTS_CHANNEL_RX_HIGH_PRI == channel)) + (WDTS_CHANNEL_RX_HIGH_PRI == channel)|| + (WDTS_CHANNEL_RX_LOG == channel)) { for(channelLoop = 0; channelLoop < channelEntry->numDesc; channelLoop++) { @@ -476,19 +477,22 @@ void dxeChannelAllDescDump /*========================================================================== @ Function Name - dxeErrChannelDebug + dxeErrHandler @ Description - Dump channel information for which Error interrupt has occured + Dump channel information for which Error interrupt has occured and + try to recover from the Error @ Parameters WLANDXE_ChannelCBType *channelCb @ Return - NONE - + wpt_status: eWLAN_PAL_STATUS_SUCCESS if recovery is possible and + successful + eWLAN_PAL_STATUS_E_FAILURE if recovery is not possible + or recovery fails ===========================================================================*/ -void dxeErrChannelDebug +wpt_status dxeErrHandler ( WLANDXE_ChannelCBType *channelCb, wpt_uint32 chStatusReg @@ -560,8 +564,79 @@ void dxeErrChannelDebug } targetCtrlBlk = (WLANDXE_DescCtrlBlkType *)targetCtrlBlk->nextCtrlBlk; } + wpalFwDumpReq(17, 0, 0, 0, 0, 1); break; } + case WLANDXE_ERROR_ABORT: + { + wpt_uint32 regValue, regValueLocal; + wpt_uint32 count = 0; + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: DXE Abort Error from S/W", __func__); + + wpalReadRegister(WALNDEX_DMA_CSR_ADDRESS, ®Value); + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: DXE CSR Value: %08x", __func__,regValue); + + //Execute the BMU recovery only if firmware triggered the ABORT + if (regValue & WLANDXE_DMA_CSR_FW_BMU_RECOVERY) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Firmware BMU recovery On %08x", __func__,regValue); + + // Clean up the descriptors + if (eWLAN_PAL_STATUS_SUCCESS != + dxeTXCleanup(tempDxeCtrlBlk)) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Host DXE Cleanup Failed!!!!", __func__); + } + + // Debug DXE channel after cleanup + dxeChannelMonitor("INT_ERR", channelCb, &channelLog); + dxeDescriptorDump(channelCb, channelCb->headCtrlBlk->linkedDesc, 0); + dxeChannelRegisterDump(channelCb, "INT_ERR", &channelLog); + dxeChannelAllDescDump(channelCb, channelCb->channelType, &channelLog); + + // Unblock the firmware + regValue |= WLANDXE_DMA_CSR_HOST_RECOVERY_DONE; + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Host DXE Cleanup done %08x", __func__,regValue); + wpalWriteRegister(WALNDEX_DMA_CSR_ADDRESS, regValue); + + // Wait for firmware to complete the cleanup + do + { + wpalReadRegister(WALNDEX_DMA_CSR_ADDRESS, ®Value); + wpalBusyWait(5000); + count++; + //count is 60 because wait is for 5 ms and 60*5=300ms + //which is the time WD bark happens in firmware + } while(count < 60 && !(regValue & WLANDXE_DMA_CSR_RECOVERY_DONE)); + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: FW Cleanup done %08x", __func__,regValue); + + //clear all spare bits in CSR + wpalWriteRegister(WALNDEX_DMA_CSR_ADDRESS,regValue & + ~(WLANDXE_DMA_CSR_RECOVERY_DONE | + WLANDXE_DMA_CSR_FW_BMU_RECOVERY | + WLANDXE_DMA_CSR_HOST_RECOVERY_DONE)); + + //check if the h/w resources have recovered + wpalReadRegister(WLANDXE_BMU_AVAILABLE_BD_PDU, ®Value); + wpalReadRegister(WLANDXE_BMU_AVAILABLE_BD_PDU_LOCAL, ®ValueLocal); + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "===== count %d ABD %d, ABD LOCAL %d =====", count, + regValue, regValueLocal); + if(regValue == 0 || regValueLocal == 0) + { + return eWLAN_PAL_STATUS_E_FAILURE; + } + + return eWLAN_PAL_STATUS_SUCCESS; + } + break; + } default: { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, @@ -570,7 +645,7 @@ void dxeErrChannelDebug } } - wpalFwDumpReq(17, 0, 0, 0, 0); + return eWLAN_PAL_STATUS_E_FAILURE; } /*========================================================================== @ Function Name @@ -661,6 +736,9 @@ void dxeRxThreadChannelDebugHandler * Just incase TX not wanted stuck, Trigger TX again */ for(channelLoop = WDTS_CHANNEL_RX_LOW_PRI; channelLoop < WDTS_CHANNEL_MAX; channelLoop++) { + if (!WLANDXE_IS_VALID_CHANNEL(channelLoop)) + continue; + dxeChannelMonitor("******** Get Descriptor Snapshot ", &tempDxeCtrlBlk->dxeChannel[channelLoop], &channelLog); @@ -695,304 +773,6 @@ void dxeRxThreadChannelDebugHandler return; } -/*========================================================================== - @ Function Name - dxeRXHealthMonitor - - @ Description - Monitoring RX channel healthy stataus - If detect any problem, try to recover - - @ Parameters - healthMonitorMsg MSG pointer. - will have low resource TX channel context - - @ Return - NONE - -===========================================================================*/ -void dxeRXHealthMonitor -( - wpt_msg *healthMonitorMsg -) -{ - WLANDXE_ChannelCBType *channelCtrlBlk; - WLANDXE_ChannelCBType *testCHCtrlBlk; - wpt_uint32 regValue; - wpt_uint32 chStatusReg, chControlReg, chDescReg, chLDescReg; - wpt_uint32 hwWakeLoop, chLoop; - - if(NULL == healthMonitorMsg) - { - return; - } - - /* Make wake up HW */ - dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); - dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); - dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); - - for(hwWakeLoop = 0; hwWakeLoop < T_WLANDXE_MAX_HW_ACCESS_WAIT; hwWakeLoop++) - { - wpalReadRegister(WLANDXE_BMU_AVAILABLE_BD_PDU, ®Value); - if(0 != regValue) - { - break; - } - } - - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "Scheduled RX, num free BD/PDU %d, loop Count %d", - regValue, hwWakeLoop); - - for(chLoop = WDTS_CHANNEL_RX_LOW_PRI; chLoop < WDTS_CHANNEL_MAX; chLoop++) - { - testCHCtrlBlk = &tempDxeCtrlBlk->dxeChannel[chLoop]; - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXECtrlRegAddr, &chControlReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXEStatusRegAddr, &chStatusReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXEDesclRegAddr, &chDescReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXELstDesclRegAddr, &chLDescReg); - - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - - if((chControlReg & WLANDXE_DESC_CTRL_VALID) && - (chLDescReg != testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr)) - { - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, " - "HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : RX CH EN Descriptor Async, resync it", channelType[chLoop]); - wpalWriteRegister(testCHCtrlBlk->channelRegister.chDXELstDesclRegAddr, - testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr); - } - else if(!(chControlReg & WLANDXE_DESC_CTRL_VALID) && - (chDescReg != testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr)) - { - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, " - "HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : RX CH DIS Descriptor Async, resync it", channelType[chLoop]); - wpalWriteRegister(testCHCtrlBlk->channelRegister.chDXEDesclRegAddr, - testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr); - } - } - - channelCtrlBlk = (WLANDXE_ChannelCBType *)healthMonitorMsg->pContext; - if(channelCtrlBlk->hitLowResource) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : Still Low Resource, kick DXE TX and restart timer", - channelType[channelCtrlBlk->channelType]); - /* Still Low Resource, Kick DXE again and start timer again */ - wpalTimerStart(&channelCtrlBlk->healthMonitorTimer, - T_WLANDXE_PERIODIC_HEALTH_M_TIME); - } - else - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : Out from Low resource condition, do nothing", - channelType[channelCtrlBlk->channelType]); - /* Recovered from low resource condition - * Not need to do anything */ - } - - return; -} - -/*========================================================================== - @ Function Name - dxeTXHealthMonitor - - @ Description - Monitoring TX channel healthy stataus - If detect any problem, try to recover - - @ Parameters - healthMonitorMsg MSG pointer. - will have low resource TX channel context - - @ Return - NONE - -===========================================================================*/ -void dxeTXHealthMonitor -( - wpt_msg *healthMonitorMsg -) -{ - WLANDXE_ChannelCBType *channelCtrlBlk; - WLANDXE_ChannelCBType *testCHCtrlBlk; - wpt_uint32 regValue; - wpt_uint32 chStatusReg, chControlReg, chDescReg, chLDescReg; - wpt_uint32 hwWakeLoop, chLoop; - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - - if(NULL == healthMonitorMsg) - { - return; - } - - /* First of all kick TX channel - * This will fix if there is any problem with SMSM state */ - dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); - dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); - dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); - - /* Wait till RIVA up */ - for(hwWakeLoop = 0; hwWakeLoop < T_WLANDXE_MAX_HW_ACCESS_WAIT; hwWakeLoop++) - { - wpalReadRegister(WLANDXE_BMU_AVAILABLE_BD_PDU, ®Value); - if(0 != regValue) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "num free BD/PDU %d, loop Count %d", - regValue, hwWakeLoop); - break; - } - } - - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "Scheduled TX, num free BD/PDU %d, loop Count %d", - regValue, hwWakeLoop); - - for(chLoop = 0; chLoop < WDTS_CHANNEL_RX_LOW_PRI; chLoop++) - { - testCHCtrlBlk = &tempDxeCtrlBlk->dxeChannel[chLoop]; - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXECtrlRegAddr, &chControlReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXEStatusRegAddr, &chStatusReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXEDesclRegAddr, &chDescReg); - wpalReadRegister(testCHCtrlBlk->channelRegister.chDXELstDesclRegAddr, &chLDescReg); - - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - - if((chControlReg & WLANDXE_DESC_CTRL_VALID) && - (chLDescReg != testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr)) - { - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, " - "HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : TX CH EN Descriptor Async, resync it", channelType[chLoop]); - wpalWriteRegister(testCHCtrlBlk->channelRegister.chDXELstDesclRegAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr); - } - else if(!(chControlReg & WLANDXE_DESC_CTRL_VALID) && - (chDescReg != testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr)) - { - wpalTrace(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : CCR 0x%x, CSR 0x%x, CDR 0x%x, CLDR 0x%x, " - "HCBO %d, HCBDP 0x%x, HCBDC 0x%x, TCBO %d,TCBDP 0x%x, TCBDC 0x%x", - channelType[chLoop], - chControlReg, chStatusReg, chDescReg, chLDescReg, - testCHCtrlBlk->headCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->headCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->headCtrlBlk->linkedDesc->descCtrl.ctrl, - testCHCtrlBlk->tailCtrlBlk->ctrlBlkOrder, testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDesc->descCtrl.ctrl); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%11s : TX CH DIS Descriptor Async, resync it", channelType[chLoop]); - wpalWriteRegister(testCHCtrlBlk->channelRegister.chDXEDesclRegAddr, - testCHCtrlBlk->tailCtrlBlk->linkedDescPhyAddr); - } - } - - /* TX channel test done, test RX channels */ - channelCtrlBlk = (WLANDXE_ChannelCBType *)healthMonitorMsg->pContext; - channelCtrlBlk->healthMonitorMsg->callback = dxeRXHealthMonitor; - status = wpalPostRxMsg(WDI_GET_PAL_CTX(), - channelCtrlBlk->healthMonitorMsg); - if (eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "TX Low resource Kick DXE MSG Serialize fail status=%d", - status); - } - - return; -} - -/*========================================================================== - @ Function Name - dxeHealthMonitorTimeout - - @ Description - Health Monitor timer started when TX channel low resource condition - And if reciovered from low resource condition, timer would not fired - Timer fired means during certain time, TX CH could not be recovered - - @ Parameters - channelCtxt Low resource condition happen Channel context - - @ Return - NONE - -===========================================================================*/ -void dxeHealthMonitorTimeout -( - void *channelCtxt -) -{ - WLANDXE_ChannelCBType *channelCtrlBlk; - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - - if(NULL == channelCtxt) - { - return; - } - - /* Timeout Fired, DXE TX should kick on TX thread - * Serailize to TX Thread */ - channelCtrlBlk = (WLANDXE_ChannelCBType *)channelCtxt; - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, - "%11s : Health Monitor timer expired", - channelType[channelCtrlBlk->channelType]); - - channelCtrlBlk->healthMonitorMsg->callback = dxeTXHealthMonitor; - status = wpalPostTxMsg(WDI_GET_PAL_CTX(), - channelCtrlBlk->healthMonitorMsg); - if (eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "TX Low resource Kick DXE MSG Serialize fail status=%d", - status); - } - - return; -} - /*========================================================================== @ Function Name dxeCtrlBlkAlloc @@ -1139,10 +919,6 @@ static wpt_status dxeDescAllocAndLink unsigned int idx; void *physAddressAlloc = NULL; wpt_uint32 physAddress; -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - WLANDXE_ChannelCBType *testTXChannelCB = &dxeCtrlBlk->dxeChannel[WDTS_CHANNEL_H2H_TEST_TX]; - WLANDXE_DescCtrlBlkType *currDescCtrlBlk = testTXChannelCB->headCtrlBlk; -#endif /* WLANDXE_TEST_CHANNEL_ENABLE*/ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); @@ -1157,7 +933,6 @@ static wpt_status dxeDescAllocAndLink currentCtrlBlk = channelEntry->headCtrlBlk; -#if !(defined(FEATURE_R33D) || defined(WLANDXE_TEST_CHANNEL_ENABLE)) /* allocate all DXE descriptors for this channel in one chunk */ channelEntry->descriptorAllocation = (WLANDXE_DescType *) wpalDmaMemoryAllocate(sizeof(WLANDXE_DescType)*channelEntry->numDesc, @@ -1170,57 +945,11 @@ static wpt_status dxeDescAllocAndLink return eWLAN_PAL_STATUS_E_RESOURCES; } currentDesc = channelEntry->descriptorAllocation; -#endif /* Allocate pre asigned number of descriptor */ for(idx = 0; idx < channelEntry->numDesc; idx++) { -#ifndef FEATURE_R33D -#ifndef WLANDXE_TEST_CHANNEL_ENABLE // descriptors were allocated in a chunk -- use the current one - memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); -#else - if(WDTS_CHANNEL_H2H_TEST_RX != channelEntry->channelType) - { - // allocate a descriptor - currentDesc = (WLANDXE_DescType *)wpalDmaMemoryAllocate(sizeof(WLANDXE_DescType), - &physAddressAlloc); - memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); - physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); - } - else - { - currentDesc = currDescCtrlBlk->linkedDesc; - physAddress = currDescCtrlBlk->linkedDescPhyAddr; - currDescCtrlBlk = (WLANDXE_DescCtrlBlkType *)currDescCtrlBlk->nextCtrlBlk; - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ -#else -#ifndef WLANDXE_TEST_CHANNEL_ENABLE - currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddressAlloc); - memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); - physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); -#else - if(WDTS_CHANNEL_H2H_TEST_RX != channelEntry->channelType) - { - currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddressAlloc); - memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); - physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); - } - else - { - currentDesc = currDescCtrlBlk->linkedDesc; - physAddress = currDescCtrlBlk->linkedDescPhyAddr; - currDescCtrlBlk = (WLANDXE_DescCtrlBlkType *)currDescCtrlBlk->nextCtrlBlk; - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ -#endif /* FEATURE_R33D */ if(NULL == currentDesc) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -1228,6 +957,9 @@ static wpt_status dxeDescAllocAndLink channelEntry->channelType); return eWLAN_PAL_STATUS_E_FAULT; } + memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, + "Allocated Descriptor VA %pK, PA %pK", currentDesc, physAddressAlloc); currentCtrlBlk->linkedDesc = currentDesc; currentCtrlBlk->linkedDescPhyAddr = physAddress; @@ -1261,14 +993,9 @@ static wpt_status dxeDescAllocAndLink /* If Current Channel is RX channel PAL Packet and OS packet buffer should be * Pre allocated and physical address must be assigned into * Corresponding DXE Descriptor */ -#ifdef WLANDXE_TEST_CHANNEL_ENABLE if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_H2H_TEST_RX == channelEntry->channelType)) -#else - if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { status = dxeRXFrameSingleBufferAlloc(dxeCtrlBlk, channelEntry, @@ -1290,27 +1017,24 @@ static wpt_status dxeDescAllocAndLink currentDesc->dxedesc.dxe_short_desc.dstMemAddrL = channelEntry->extraConfig.refWQ_swapped; } else if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)|| + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { currentDesc->descCtrl.ctrl = channelEntry->extraConfig.cw_ctrl_read; currentDesc->dxedesc.dxe_short_desc.srcMemAddrL = channelEntry->extraConfig.refWQ_swapped; } else { - /* Just in case. H2H Test RX channel, do nothing + /* Just in case. H2H RX channel, do nothing * By Definition this must not happen */ } currentCtrlBlk = currentCtrlBlk->nextCtrlBlk; prevDesc = currentDesc; -#ifndef FEATURE_R33D -#ifndef WLANDXE_TEST_CHANNEL_ENABLE // advance to the next pre-allocated descriptor in the chunk currentDesc++; physAddress = (physAddress + sizeof(WLANDXE_DescType)); -#endif -#endif } HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, @@ -1342,22 +1066,18 @@ static wpt_status dxeSetInterruptPath HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { channelEntry = &dxeCtrlBlk->dxeChannel[idx]; -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - if((WDTS_CHANNEL_TX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_H2H_TEST_TX == channelEntry->channelType)) -#else if((WDTS_CHANNEL_TX_LOW_PRI == channelEntry->channelType) || (WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType)) -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ { interruptPath |= (1 << channelEntry->assignedDMAChannel); } else if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)|| + (WDTS_CHANNEL_RX_FW_LOG == channelEntry->channelType) || + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { interruptPath |= (1 << (channelEntry->assignedDMAChannel + 16)); } @@ -1389,15 +1109,14 @@ static wpt_status dxeSetInterruptPath DXE host driver main control block @ Return - wpt_status + void ===========================================================================*/ -static wpt_status dxeEngineCoreStart +static void dxeEngineCoreStart ( WLANDXE_CtrlBlkType *dxeCtrlBlk ) { - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; wpt_uint32 registerData = 0; wpt_uint8 readRetry; @@ -1455,7 +1174,6 @@ static wpt_status dxeEngineCoreStart dxeSetInterruptPath(dxeCtrlBlk); HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Exit", __func__); - return status; } /*========================================================================== @@ -1540,7 +1258,8 @@ static wpt_status dxeChannelInitProgram } } else if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType) || + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { /* Initialize Descriptor control Word First */ currentCtrlBlk = channelEntry->headCtrlBlk; @@ -1571,7 +1290,7 @@ static wpt_status dxeChannelInitProgram } /* RX Channels, default Control registers MUST BE ENABLED */ - wpalWriteRegister(channelEntry->channelRegister.chDXECtrlRegAddr, + status = wpalWriteRegister(channelEntry->channelRegister.chDXECtrlRegAddr, channelEntry->extraConfig.chan_mask); if(eWLAN_PAL_STATUS_SUCCESS != status) { @@ -1583,15 +1302,6 @@ static wpt_status dxeChannelInitProgram else { /* H2H test channel, not use work Q */ - /* Program pre allocated destination Address */ - status = wpalWriteRegister(channelEntry->channelRegister.chDXEDadrlRegAddr, - WLANDXE_U32_SWAP_ENDIAN(channelEntry->DescBottomLoc->dxedesc.dxe_short_desc.phyNextL)); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeChannelInitProgram Write RX DAddress register fail"); - return status; - } } HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, @@ -1800,7 +1510,8 @@ static wpt_status dxeChannelClose nextDescriptor = NULL; } if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType) || + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { if (NULL != currentCtrlBlk->xfrFrame) { @@ -1823,10 +1534,6 @@ static wpt_status dxeChannelClose wpalPacketFree(currentCtrlBlk->xfrFrame); } } -#if (defined(FEATURE_R33D) || defined(WLANDXE_TEST_CHANNEL_ENABLE)) - // descriptors allocated individually so free them individually - wpalDmaMemoryFree(currentDescriptor); -#endif wpalMemoryFree(currentCtrlBlk); currentCtrlBlk = nextCtrlBlk; @@ -1840,13 +1547,11 @@ static wpt_status dxeChannelClose } } -#if !(defined(FEATURE_R33D) || defined(WLANDXE_TEST_CHANNEL_ENABLE)) // descriptors were allocated as a single chunk so free the chunk if(NULL != channelEntry->descriptorAllocation) { wpalDmaMemoryFree(channelEntry->descriptorAllocation); } -#endif HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Exit", __func__); @@ -1980,7 +1685,7 @@ void dxeRXResourceAvailableTimerExpHandler HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, "RX Low resource, Durign wait time period %d, RX resource not allocated", - T_WLANDXE_MAX_RX_PACKET_WAIT); + wpalGetDxeReplenishRXTimerVal()); //This API wil also try to replenish packets wpalGetNumRxFreePacket(&numRxFreePackets); @@ -2004,19 +1709,25 @@ void dxeRXResourceAvailableTimerExpHandler "%s: Replenish successful. Restart the Rx Low resource timer", __func__); wpalTimerStart(&dxeCtxt->rxResourceAvailableTimer, - T_WLANDXE_MAX_RX_PACKET_WAIT); + wpalGetDxeReplenishRXTimerVal()); return; } } + if(wpalIsDxeSSREnable()) + { + if (NULL != dxeCtxt) + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - if (NULL != dxeCtxt) - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - - wpalWlanReload(); - - if (NULL != usrData) - dxeStartSSRTimer((WLANDXE_CtrlBlkType *)usrData); + wpalWlanReload(); + if (NULL != usrData) + dxeStartSSRTimer((WLANDXE_CtrlBlkType *)usrData); + } + else + { + wpalTimerStart(&dxeCtxt->rxResourceAvailableTimer, + wpalGetDxeReplenishRXTimerVal()); + } return; } #endif @@ -2188,15 +1899,9 @@ static wpt_status dxeRXFrameSingleBufferAlloc wpt_status status = eWLAN_PAL_STATUS_SUCCESS; wpt_packet *currentPalPacketBuffer = NULL; WLANDXE_DescType *currentDesc = NULL; -#ifdef FEATURE_R33D - wpt_uint32 virtualAddressPCIe; - wpt_uint32 physicalAddressPCIe; -#else wpt_iterator iterator; wpt_uint32 allocatedSize = 0; void *physAddress = NULL; -#endif /* FEATURE_R33D */ - currentDesc = currentCtrlBlock->linkedDesc; @@ -2242,7 +1947,7 @@ static wpt_status dxeRXFrameSingleBufferAlloc HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "RX Low resource, wait available resource"); wpalTimerStart(&dxeCtxt->rxResourceAvailableTimer, - T_WLANDXE_MAX_RX_PACKET_WAIT); + wpalGetDxeReplenishRXTimerVal()); } #endif } @@ -2258,31 +1963,12 @@ static wpt_status dxeRXFrameSingleBufferAlloc currentPalPacketBuffer->pBD = NULL; currentPalPacketBuffer->pBDPhys = NULL; currentPalPacketBuffer->BDLength = 0; -#ifdef FEATURE_R33D - status = wpalAllocateShadowRxFrame(currentPalPacketBuffer, - &physicalAddressPCIe, - &virtualAddressPCIe); - if((0 == physicalAddressPCIe) || (0 = virtualAddressPCIe)) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, - "RX NULL Shadow Memory"); - HDXE_ASSERT(0); - return eWLAN_PAL_STATUS_E_FAULT; - } - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, - "RX Shadow Memory Va 0x%x, Pa 0x%x", - virtualAddressPCIe, physicalAddressPCIe); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXFrameBufferAlloc Shadow Mem Alloc fail"); - return status; - } - currentCtrlBlock->shadowBufferVa = virtualAddressPCIe; - currentPalPacketBuffer->pBDPhys = (void *)physicalAddressPCIe; - memset((wpt_uint8 *)currentCtrlBlock->shadowBufferVa, 0, WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE); -#else + + if (channelEntry->channelType == WDTS_CHANNEL_RX_FW_LOG) + wpalPacketRawTrimHead(currentCtrlBlock->xfrFrame, WLANDXE_NL_HEADER_SZ); + status = wpalLockPacketForTransfer(currentPalPacketBuffer); + if(eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -2309,7 +1995,6 @@ static wpt_status dxeRXFrameSingleBufferAlloc return status; } currentPalPacketBuffer->pBDPhys = physAddress; -#endif /* FEATURE_R33D */ /* DXE descriptor must have SWAPPED addres in it's structure * !!! SWAPPED !!! */ @@ -2377,6 +2062,9 @@ static wpt_status dxeRXFrameRefillRing the descriptor. */ if(channelEntry->extraConfig.cw_ctrl_read != currentDesc->descCtrl.ctrl) { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeRXFrameRefillRing, Descriptor write failed"); + ++channelEntry->desc_write_fail_count; //HDXE_ASSERT(0); } @@ -2398,82 +2086,129 @@ static wpt_status dxeRXFrameRefillRing return status; } -/*========================================================================== - @ Function Name - dxeRXFrameRouteUpperLayer - - @ Description - Test DXE descriptors and if any RX frame pending within RING, - Route to upper layer - - @ Parameters - WLANDXE_CtrlBlkType *dxeCtrlBlk, - DXE host driver main control block - WLANDXE_ChannelCBType *channelEntry - Channel specific control block - @ Return - < 0 Any error happen - 0 No frame pulled from RX RING - int number of RX frames pulled from RX ring - -===========================================================================*/ -static wpt_int32 dxeRXFrameRouteUpperLayer +static wpt_uint32 dxeRXLogRefillRing ( - WLANDXE_CtrlBlkType *dxeCtxt, - WLANDXE_ChannelCBType *channelEntry + WLANDXE_CtrlBlkType *dxeCtxt, + WLANDXE_ChannelCBType *channelEntry, + wpt_uint64 bufferAddr, + wpt_uint32 bufferLen ) { wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - WLANDXE_DescCtrlBlkType *currentCtrlBlk = NULL; + WLANDXE_DescCtrlBlkType *currentCtrlBlk = channelEntry->tailCtrlBlk; WLANDXE_DescType *currentDesc = NULL; - wpt_uint32 descCtrl, frameCount = 0, i; - wpt_int32 ret_val = -1; + wpt_uint32 xfrSize, allocatedLen = 0; - currentCtrlBlk = channelEntry->headCtrlBlk; - currentDesc = currentCtrlBlk->linkedDesc; + while(bufferLen > 0 && channelEntry->numFreeDesc > 0) + { + /* Current Control block is free + * and associated frame buffer is not linked with control block anymore + * allocate new frame buffer for current control block */ + status = dxeRXFrameSingleBufferAlloc(dxeCtxt, + channelEntry, + currentCtrlBlk); - /* Descriptoe should be SWAPPED ???? */ - descCtrl = currentDesc->descCtrl.ctrl; + if((eWLAN_PAL_STATUS_SUCCESS != status) && + (eWLAN_PAL_STATUS_E_EXISTS != status)) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, + "dxeRXFrameRefillRing, out of RX buffer pool, break here"); + break; + } - /* Get frames while VALID bit is not set (DMA complete) and a data - * associated with it */ - while(!(WLANDXE_U32_SWAP_ENDIAN(descCtrl) & WLANDXE_DESC_CTRL_VALID) && - (eWLAN_PAL_STATUS_SUCCESS == wpalIsPacketLocked(currentCtrlBlk->xfrFrame)) && - (currentCtrlBlk->xfrFrame->pInternalData != NULL) && - (frameCount < WLANDXE_MAX_REAPED_RX_FRAMES) ) - { - channelEntry->numTotalFrame++; - channelEntry->numFreeDesc++; -#ifdef FEATURE_R33D - /* Transfer Size should be */ - currentDesc->xfrSize = WLANDXE_U32_SWAP_ENDIAN(WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE); - status = wpalPrepareRxFrame(¤tCtrlBlk->xfrFrame, - (wpt_uint32)currentCtrlBlk->xfrFrame->pBDPhys, - currentCtrlBlk->shadowBufferVa, - WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE); - if(eWLAN_PAL_STATUS_SUCCESS != status) + if(eWLAN_PAL_STATUS_E_EXISTS == status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXFrameReady Prepare RX Frame fail"); - return ret_val; + "%s, Descriptor Non-Empty",__func__); } - status = wpalFreeRxFrame(currentCtrlBlk->shadowBufferVa); - if(eWLAN_PAL_STATUS_SUCCESS != status) + + currentDesc = currentCtrlBlk->linkedDesc; + currentDesc->descCtrl.ctrl = channelEntry->extraConfig.cw_ctrl_read; + xfrSize = WLANDXE_FW_LOGGING_XFSIZE > bufferLen ? + bufferLen : WLANDXE_FW_LOGGING_XFSIZE; + currentDesc->xfrSize = xfrSize; + allocatedLen += xfrSize; + bufferLen -= xfrSize; + wpalPacketSetRxLength(currentCtrlBlk->xfrFrame, + xfrSize); + + currentDesc->dxedesc.dxe_short_desc.srcMemAddrL = + WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)(uintptr_t)bufferAddr); + + /* Issue a dummy read from the DXE descriptor DDR location to ensure + that any posted writes are reflected in memory before DXE looks at + the descriptor. */ + if(channelEntry->extraConfig.cw_ctrl_read != currentDesc->descCtrl.ctrl) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXFrameReady Free Shadow RX Frame fail"); - return ret_val; + "%s, Descriptor write failed",__func__); + ++channelEntry->desc_write_fail_count; } -#else /* FEATURE_R33D */ + currentCtrlBlk = currentCtrlBlk->nextCtrlBlk; + --channelEntry->numFreeDesc; + bufferAddr += xfrSize; + } + + channelEntry->tailCtrlBlk = currentCtrlBlk; + + return allocatedLen; +} +/*========================================================================== + @ Function Name + dxeRXFrameRouteUpperLayer + + @ Description + Test DXE descriptors and if any RX frame pending within RING, + Route to upper layer + + @ Parameters + WLANDXE_CtrlBlkType *dxeCtrlBlk, + DXE host driver main control block + WLANDXE_ChannelCBType *channelEntry + Channel specific control block + @ Return + < 0 Any error happen + 0 No frame pulled from RX RING + int number of RX frames pulled from RX ring + +===========================================================================*/ +static wpt_int32 dxeRXFrameRouteUpperLayer +( + WLANDXE_CtrlBlkType *dxeCtxt, + WLANDXE_ChannelCBType *channelEntry +) +{ + wpt_status status = eWLAN_PAL_STATUS_SUCCESS; + WLANDXE_DescCtrlBlkType *currentCtrlBlk = NULL; + WLANDXE_DescType *currentDesc = NULL; + wpt_uint32 descCtrl, frameCount = 0, i; + wpt_int32 ret_val = -1; + + currentCtrlBlk = channelEntry->headCtrlBlk; + currentDesc = currentCtrlBlk->linkedDesc; + + /* Descriptoe should be SWAPPED ???? */ + descCtrl = currentDesc->descCtrl.ctrl; + + /* Get frames while VALID bit is not set (DMA complete) and a data + * associated with it */ + while(!(WLANDXE_U32_SWAP_ENDIAN(descCtrl) & WLANDXE_DESC_CTRL_VALID) && + (eWLAN_PAL_STATUS_SUCCESS == wpalIsPacketLocked(currentCtrlBlk->xfrFrame)) && + (currentCtrlBlk->xfrFrame->pInternalData != NULL) && + (frameCount < WLANDXE_MAX_REAPED_RX_FRAMES) ) + { + channelEntry->numTotalFrame++; + channelEntry->numFreeDesc++; status = wpalUnlockPacket(currentCtrlBlk->xfrFrame); + if (eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "dxeRXFrameReady unable to unlock packet"); return ret_val; } -#endif /* FEATURE_R33D */ + /* This Descriptor is valid, so linked Control block is also valid * Linked Control block has pre allocated packet buffer * So, just let upper layer knows preallocated frame pointer will be OK */ @@ -2483,7 +2218,8 @@ static wpt_int32 dxeRXFrameRouteUpperLayer currentCtrlBlk->xfrFrame = NULL; /* Now try to refill the ring with empty Rx buffers to keep DXE busy */ - dxeRXFrameRefillRing(dxeCtxt, channelEntry); + if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType) + dxeRXFrameRefillRing(dxeCtxt, channelEntry); /* Test next contorl block * if valid, this control block also has new RX frame must be handled */ @@ -2730,6 +2466,25 @@ static wpt_status dxeNotifySmsm HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_HIGH, "C%x S%x", clrSt, setSt); + /* Store the smsm notification sent to firmware */ + tempDxeCtrlBlk->smsmDxeHistogram = (tempDxeCtrlBlk->smsmDxeHistogram << 1); + if(setSt & WPAL_SMSM_WLAN_TX_ENABLE) + { + tempDxeCtrlBlk->smsmDxeHistogram |= 1; + } + else + { + tempDxeCtrlBlk->smsmDxeHistogram &= ~((wpt_uint32)1); + } + tempDxeCtrlBlk->smsmRingsEmptyHistogram = (tempDxeCtrlBlk->smsmRingsEmptyHistogram << 1); + if(setSt & WPAL_SMSM_WLAN_TX_RINGS_EMPTY) + { + tempDxeCtrlBlk->smsmRingsEmptyHistogram |= 1; + } + else + { + tempDxeCtrlBlk->smsmRingsEmptyHistogram &= ~((wpt_uint32)1); + } wpalNotifySmsm(clrSt, setSt); return eWLAN_PAL_STATUS_SUCCESS; @@ -2822,6 +2577,8 @@ void dxeRXEventHandler WLANDXE_ChannelCBType *channelCb = NULL; wpt_uint32 chHighStat = 0; wpt_uint32 chLowStat = 0; + wpt_uint32 chLogRxStat = 0; + wpt_uint32 chLogRxFwStat = 0; wpt_uint32 regValue, chanMask; dxeCtxt = (WLANDXE_CtrlBlkType *)(msgContent->pContext); @@ -2836,20 +2593,56 @@ void dxeRXEventHandler /* Now try to refill the ring with empty Rx buffers to keep DXE busy */ dxeRXFrameRefillRing(dxeCtxt, &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI]); dxeRXFrameRefillRing(dxeCtxt, &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_HIGH_PRI]); - - dxeCtxt = (WLANDXE_CtrlBlkType *)(msgContent->pContext); + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG)) + dxeRXFrameRefillRing(dxeCtxt, &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG]); if((!dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_HIGH_PRI].extraConfig.chEnabled) || - (!dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI].extraConfig.chEnabled)) + (!dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI].extraConfig.chEnabled) || + (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG) && + !dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].extraConfig.chEnabled)) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "DXE already stopped in RX event handler. Just return"); return; } + /* Disable device interrupt */ + /* Read whole interrupt mask register and exclusive only this channel int */ + status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, + &intSrc); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeRXEventHandler Read INT_SRC register fail"); + return; + } + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, + "RX Event Handler INT Source 0x%x", intSrc); + + dxeEnvBlk.rxIntChanlSrc = intSrc&0xFF; + if((WLANDXE_POWER_STATE_IMPS == dxeCtxt->hostPowerState) || (WLANDXE_POWER_STATE_DOWN == dxeCtxt->hostPowerState)) { + if (WLANDXE_POWER_STATE_IMPS == dxeCtxt->hostPowerState) + { + if(0 == intSrc) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Read status: %d, regVal: %d", + __func__, status, intSrc); + } + else + { + /* Register Read was succesful and we have a valid interrupt + * source, so WCN is not power collapsed yet and it should + * not power collapse till we set the synchronization bit + * at the end of this function, safe to pull frames... + */ + goto pull_frames; + } + } + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "%s Riva is in %d, Just Pull frames without any register touch ", __func__, dxeCtxt->hostPowerState); @@ -2881,31 +2674,32 @@ void dxeRXEventHandler if(eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXEventHandler Pull from RX low channel fail"); + "dxeRXEventHandler Pull from RX low channel fail"); } /* LOW Priority CH same above */ channelCb->numFragmentCurrentChain = 1; + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG)) + { + channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG]; + status = dxeRXFrameReady(dxeCtxt, + channelCb, + chLogRxStat); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeRXEventHandler Pull from RX log channel fail"); + } + channelCb->numFragmentCurrentChain = 1; + } /* Interrupt will not enabled at here, it will be enabled at PS mode change */ tempDxeCtrlBlk->rxIntDisabledByIMPS = eWLAN_PAL_TRUE; + dxeEnvBlk.rxIntDisableReturn = VOS_RETURN_ADDRESS; return; } - /* Disable device interrupt */ - /* Read whole interrupt mask register and exclusive only this channel int */ - status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, - &intSrc); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXEventHandler Read INT_SRC register fail"); - return; - } - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, - "RX Event Handler INT Source 0x%x", intSrc); - -#ifndef WLANDXE_TEST_CHANNEL_ENABLE +pull_frames: /* Test High Priority Channel interrupt is enabled or not */ channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_HIGH_PRI]; if(intSrc & (1 << channelCb->assignedDMAChannel)) @@ -2924,11 +2718,12 @@ void dxeRXEventHandler "%11s : 0x%x Error Reported, Reload Driver", channelType[channelCb->channelType], chHighStat); - dxeErrChannelDebug(channelCb, chHighStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); + if (eWLAN_PAL_STATUS_SUCCESS != dxeErrHandler(channelCb, chHighStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } } else if((WLANDXE_CH_STAT_INT_DONE_MASK & chHighStat) || (WLANDXE_CH_STAT_INT_ED_MASK & chHighStat)) @@ -2954,57 +2749,9 @@ void dxeRXEventHandler } else { - channelCb->rxDoneHistogram &= ~1; - } - } -#else - /* Test H2H Test interrupt is enabled or not */ - channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_H2H_TEST_RX]; - if(intSrc & (1 << channelCb->assignedDMAChannel)) - { - status = dxeChannelCleanInt(channelCb, &chStat); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeRXEventHandler INT Clean up fail"); - return; - } - - if(WLANDXE_CH_STAT_INT_ERR_MASK & chStat) - { - /* Error Happen during transaction, Handle it */ - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, - "%11s : 0x%x Error Reported, Reload Driver", - channelType[channelCb->channelType], chStat); - - dxeErrChannelDebug(channelCb, chStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); - } - else if(WLANDXE_CH_STAT_INT_ED_MASK & chStat) - { - /* Handle RX Ready for high priority channel */ - status = dxeRXFrameReady(dxeCtxt, - channelCb, - chStat); - } - /* Update the Rx DONE histogram */ - channelCb->rxDoneHistogram = (channelCb->rxDoneHistogram << 1); - if(WLANDXE_CH_STAT_INT_DONE_MASK & chStat) - { - channelCb->rxDoneHistogram |= 1; - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "DXE Channel Number %d, Rx DONE Histogram 0x%016llx", - channelCb->assignedDMAChannel, channelCb->rxDoneHistogram); - } - else - { - channelCb->rxDoneHistogram &= ~1; + channelCb->rxDoneHistogram &= ~((wpt_uint64)1); } } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ /* Test Low Priority Channel interrupt is enabled or not */ channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI]; @@ -3025,11 +2772,13 @@ void dxeRXEventHandler "%11s : 0x%x Error Reported, Reload Driver", channelType[channelCb->channelType], chLowStat); - dxeErrChannelDebug(channelCb, chLowStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); + if (eWLAN_PAL_STATUS_SUCCESS != + dxeErrHandler(channelCb, chLowStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } } else if((WLANDXE_CH_STAT_INT_ED_MASK & chLowStat) || (WLANDXE_CH_STAT_INT_DONE_MASK & chLowStat)) @@ -3048,11 +2797,139 @@ void dxeRXEventHandler } else { - channelCb->rxDoneHistogram &= ~1; + channelCb->rxDoneHistogram &= ~((wpt_uint64)1); } HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, "RX LOW CH EVNT STAT 0x%x, %d frames handled", chLowStat, channelCb->numFragmentCurrentChain); } + + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG)) + { + channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG]; + + if(intSrc & (1 << channelCb->assignedDMAChannel)) + { + status = dxeChannelCleanInt(channelCb,&chLogRxStat); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeRXEventHandler INT Clean up fail"); + return; + } + + if(WLANDXE_CH_STAT_INT_ERR_MASK & chLogRxStat) + { + /* Error Happen during transaction, Handle it */ + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%11s : 0x%x Error Reported, Reload Driver", + channelType[channelCb->channelType], chLogRxStat); + + if (eWLAN_PAL_STATUS_SUCCESS != + dxeErrHandler(channelCb, chLogRxStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } + + } + else if((WLANDXE_CH_STAT_INT_ED_MASK & chLogRxStat) || + (WLANDXE_CH_STAT_INT_DONE_MASK & chLogRxStat)) + { + /* Handle RX Ready for low priority channel */ + status = dxeRXFrameReady(dxeCtxt, + channelCb, + chLogRxStat); + } + + /* Update the Rx DONE histogram */ + channelCb->rxDoneHistogram = (channelCb->rxDoneHistogram << 1); + if(WLANDXE_CH_STAT_INT_DONE_MASK & chLogRxStat) + { + channelCb->rxDoneHistogram |= 1; + } + else + { + channelCb->rxDoneHistogram &= ~1; + } + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, + "RX LOG CH EVNT STAT 0x%x, %d frames handled", chLogRxStat, channelCb->numFragmentCurrentChain); + } + } + + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_FW_LOG)) + { + channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_FW_LOG]; + + if(intSrc & (1 << channelCb->assignedDMAChannel)) + { + status = dxeChannelCleanInt(channelCb,&chLogRxFwStat); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeRXEventHandler INT Clean up fail"); + return; + } + + if(WLANDXE_CH_STAT_INT_ERR_MASK & chLogRxFwStat) + { + /* Error Happen during transaction, Handle it */ + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%11s : 0x%x Error Reported, Reload Driver", + channelType[channelCb->channelType], chLogRxFwStat); + + if (eWLAN_PAL_STATUS_SUCCESS != + dxeErrHandler(channelCb, chLogRxFwStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } + + } + else if((WLANDXE_CH_STAT_INT_ED_MASK & chLogRxFwStat) || + (WLANDXE_CH_STAT_INT_DONE_MASK & chLogRxFwStat)) + { + if (!dxeCtxt->hostInitiatedH2H) + { + dxeCtxt->receiveMbMsgCB(dxeCtxt->clientCtxt); + } + else + { + status = dxeRXFrameReady(dxeCtxt, + channelCb, + chLogRxFwStat); + if (channelCb->numFreeDesc == channelCb->numDesc) + { + /* + * We have already cleared the interrupts before coming here, + * but it can happen that DXE will copy some new packets after + * that and raise interrupts for those. The packets will be + * processed above but the interrupts will still be pending. + * Its safe to clear those interrupts here because we have + * pulled data from all the allocated descriptors. + */ + dxeChannelCleanInt(channelCb,&chLogRxFwStat); + dxeCtxt->hostInitiatedH2H = 0; + dxeCtxt->receiveLogCompleteCB(dxeCtxt->clientCtxt); + } + } + } + + /* Update the Rx DONE histogram */ + channelCb->rxDoneHistogram = (channelCb->rxDoneHistogram << 1); + if(WLANDXE_CH_STAT_INT_DONE_MASK & chLogRxFwStat) + { + channelCb->rxDoneHistogram |= 1; + } + else + { + channelCb->rxDoneHistogram &= ~1; + } + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, + "RX LOG CH EVNT STAT 0x%x, %d frames handled", chLogRxFwStat, channelCb->numFragmentCurrentChain); + } + } if(eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -3102,12 +2979,50 @@ void dxeRXEventHandler wpalWriteRegister(dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI].channelRegister.chDXECtrlRegAddr, chanMask); + /* We do not have knowledge of firmare capabilities when the + * RX_LOG channel is enabled. But when we get the first interrupt + * we have all the required information. So if MGMT Logging is not + * supported by the firmware, do not re-enable RX_LOG channel + */ + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG) && wpalIsFwLoggingSupported()) + { + if(!(dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].extraConfig.chan_mask & WLANDXE_CH_CTRL_EN_MASK)) + { + HDXE_ASSERT(0); + } + + if (dxeCtxt->rxPalPacketUnavailable && + (WLANDXE_CH_STAT_INT_DONE_MASK & chLogRxStat)) + { + chanMask = dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].extraConfig.chan_mask & + (~WLANDXE_CH_CTRL_INE_DONE_MASK); + dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].doneIntDisabled = 1; + } + else + { + chanMask = dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].extraConfig.chan_mask; + dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].doneIntDisabled = 0; + } + wpalWriteRegister(dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG].channelRegister.chDXECtrlRegAddr, + chanMask); + } /* Clear Interrupt handle processing bit * RIVA may power down */ - wpalReadRegister(WLANDXE_INT_MASK_REG_ADDRESS, ®Value); - regValue &= WLANDXE_RX_INTERRUPT_PRO_UNMASK; - wpalWriteRegister(WLANDXE_INT_MASK_REG_ADDRESS, regValue); + if (!(wpalIsFwLoggingSupported() && wpalIsFwLoggingEnabled())) + { + wpalReadRegister(WLANDXE_INT_MASK_REG_ADDRESS, ®Value); + regValue &= WLANDXE_RX_INTERRUPT_PRO_UNMASK; + wpalWriteRegister(WLANDXE_INT_MASK_REG_ADDRESS, regValue); + } + else + { + wpalReadRegister(WLAN_PMU_SPARE_OUT_ADDRESS, ®Value); + regValue &= (~WLAN_PMU_POWER_DOWN_MASK); + wpalWriteRegister(WLAN_PMU_SPARE_OUT_ADDRESS, regValue); + } + + dxeEnvBlk.rxIntChanlSrc = 0; /* Enable system level ISR */ /* Enable RX ready Interrupt at here */ @@ -3196,6 +3111,16 @@ void dxeRXPacketAvailableEventHandler { break; } + + if (WLANDXE_IS_VALID_CHANNEL(WDTS_CHANNEL_RX_LOG)) + { + channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOG]; + status = dxeRXFrameRefillRing(dxeCtxt,channelCb); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + break; + } + } } while(0); if((WLANDXE_POWER_STATE_IMPS == dxeCtxt->hostPowerState) || @@ -3203,6 +3128,7 @@ void dxeRXPacketAvailableEventHandler { /* Interrupt will not enabled at here, it will be enabled at PS mode change */ tempDxeCtrlBlk->rxIntDisabledByIMPS = eWLAN_PAL_TRUE; + dxeEnvBlk.rxIntDisableReturn = VOS_RETURN_ADDRESS; } } @@ -3233,30 +3159,20 @@ static void dxeRXISR wpt_status status = eWLAN_PAL_STATUS_SUCCESS; wpt_uint32 regValue; -#ifdef FEATURE_R33D - status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, - ®Value); - if(eWLAN_PAL_STATUS_SUCCESS != status) + /* Set Interrupt processing bit + * During this bit set, WLAN HW may not power collapse */ + if (!(wpalIsFwLoggingSupported() && wpalIsFwLoggingEnabled())) { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXCompISR Read INT_SRC_RAW fail"); - return; + wpalReadRegister(WLANDXE_INT_MASK_REG_ADDRESS, ®Value); + regValue |= WLANPAL_RX_INTERRUPT_PRO_MASK; + wpalWriteRegister(WLANDXE_INT_MASK_REG_ADDRESS, regValue); } - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "INT_SRC_RAW 0x%x", regValue); - if(0 == regValue) + else { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "This is not DXE Interrupt, Reject it 0x%x", regValue); - return; + wpalReadRegister(WLAN_PMU_SPARE_OUT_ADDRESS, ®Value); + regValue |= WLAN_PMU_POWER_DOWN_MASK; + wpalWriteRegister(WLAN_PMU_SPARE_OUT_ADDRESS, regValue); } -#endif /* FEATURE_R33D */ - - /* Set Interrupt processing bit - * During this bit set, WLAN HW may not power collapse */ - wpalReadRegister(WLANDXE_INT_MASK_REG_ADDRESS, ®Value); - regValue |= WLANPAL_RX_INTERRUPT_PRO_MASK; - wpalWriteRegister(WLANDXE_INT_MASK_REG_ADDRESS, regValue); /* Disable interrupt at here * Disable RX Ready system level Interrupt at here @@ -3314,19 +3230,15 @@ static wpt_status dxeTXPushFrame { wpt_status status = eWLAN_PAL_STATUS_SUCCESS; WLANDXE_DescCtrlBlkType *currentCtrlBlk = NULL; + WLANDXE_DescCtrlBlkType *tailCtrlBlk = NULL; WLANDXE_DescType *currentDesc = NULL; WLANDXE_DescType *firstDesc = NULL; WLANDXE_DescType *LastDesc = NULL; + WLANDXE_DescType *tailDesc = NULL; void *sourcePhysicalAddress = NULL; wpt_uint32 xferSize = 0; -#ifdef FEATURE_R33D - tx_frm_pcie_vector_t frameVector; - wpt_uint32 Va; - wpt_uint32 fragCount = 0; -#else wpt_iterator iterator; -#endif /* FEATURE_R33D */ - wpt_uint32 isEmpty = 0; + wpt_uint8 KickDxe = 0; HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); @@ -3335,19 +3247,27 @@ static wpt_status dxeTXPushFrame if((0 == tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_TX_LOW_PRI].numRsvdDesc) && (0 == tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_TX_HIGH_PRI].numRsvdDesc)) { - isEmpty = 1; + KickDxe = 1; + } + + /* Kick DXE when the ring is about to fill */ + if (WLANDXE_TX_LOW_RES_THRESHOLD >= channelEntry->numFreeDesc) + { + KickDxe = 1; + tailCtrlBlk = channelEntry->tailCtrlBlk; + tailDesc = tailCtrlBlk->linkedDesc; + + if(tailDesc->descCtrl.ctrl& WLANDXE_DESC_CTRL_VALID) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, + "dxeTXPushFrame Descs threshold reached No DMA"); + } } channelEntry->numFragmentCurrentChain = 0; currentCtrlBlk = channelEntry->headCtrlBlk; /* Initialize interator, TX is fragmented */ -#ifdef FEATURE_R33D - memset(&frameVector, 0, sizeof(tx_frm_pcie_vector_t)); - status = wpalPrepareTxFrame(palPacket, - &frameVector, - &Va); -#else status = wpalLockPacketForTransfer(palPacket); if(eWLAN_PAL_STATUS_SUCCESS != status) { @@ -3357,7 +3277,6 @@ static wpt_status dxeTXPushFrame } status = wpalIteratorInit(&iterator, palPacket); -#endif /* FEATURE_R33D */ if(eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -3381,35 +3300,16 @@ static wpt_status dxeTXPushFrame /* Get next fragment physical address and fragment size * if this is the first trial, will get first physical address * if no more fragment, Descriptor src address will be set as NULL, OK??? */ -#ifdef FEATURE_R33D - if(fragCount == frameVector.num_frg) - { - break; - } - currentCtrlBlk->shadowBufferVa = frameVector.frg[0].va; - sourcePhysicalAddress = (void *)frameVector.frg[fragCount].pa; - xferSize = frameVector.frg[fragCount].size; - fragCount++; - if(0 == xferSize) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame invalid transfer size"); - - HDXE_ASSERT(0); - return eWLAN_PAL_STATUS_E_FAILURE; - } - if(NULL == sourcePhysicalAddress) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame invalid sourcePhysicalAddress"); - HDXE_ASSERT(0); - return eWLAN_PAL_STATUS_E_FAILURE; - } -#else status = wpalIteratorNext(&iterator, palPacket, &sourcePhysicalAddress, &xferSize); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeTXPushFrame Get next frame fail"); + return status; + } if((NULL == sourcePhysicalAddress) || (0 == xferSize)) { @@ -3417,13 +3317,6 @@ static wpt_status dxeTXPushFrame "dxeTXPushFrame end of current frame"); break; } - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame Get next frame fail"); - return status; - } -#endif /* FEATURE_R33D */ /* This is the LAST descriptor valid for this transaction */ LastDesc = currentCtrlBlk->linkedDesc; @@ -3491,13 +3384,14 @@ static wpt_status dxeTXPushFrame { /* Update channel head as next avaliable linked slot */ channelEntry->headCtrlBlk = currentCtrlBlk; - if(isEmpty) + if(KickDxe) { tempDxeCtrlBlk->ringNotEmpty = eWLAN_PAL_TRUE; HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "SMSM_ret LO=%d HI=%d", tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_TX_LOW_PRI].numRsvdDesc, tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_TX_HIGH_PRI].numRsvdDesc ); + dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); tempDxeCtrlBlk->smsmToggled = eWLAN_PAL_TRUE; } @@ -3569,37 +3463,6 @@ static wpt_status dxeTXPushFrame "dxeTXPushFrame LONG Descriptor Format!!!"); } } -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - else if(WDTS_CHANNEL_H2H_TEST_TX == channelEntry->channelType) - { - /* Destination address, Physical memory address */ - status = wpalWriteRegister(channelEntry->channelRegister.chDXEDadrlRegAddr, - WLANDXE_U32_SWAP_ENDIAN(firstDesc->dxedesc.dxe_short_desc.dstMemAddrL)); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame Program dest address register fail"); - return status; - } - /* If descriptor format is SHORT */ - if(channelEntry->channelConfig.useShortDescFmt) - { - status = wpalWriteRegister(channelEntry->channelRegister.chDXEDadrhRegAddr, - 0); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame Program dest address register fail"); - return status; - } - } - else - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXPushFrame LONG Descriptor Format!!!"); - } - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ /* Program Source address register * This address is already programmed into DXE Descriptor @@ -3783,9 +3646,6 @@ static wpt_status dxeTXCompFrame if(WLANDXE_U32_SWAP_ENDIAN(descCtrlValue) & WLANDXE_DESC_CTRL_EOP) { hostCtxt->txCompletedFrames--; -#ifdef FEATURE_R33D - wpalFreeTxFrame(currentCtrlBlk->shadowBufferVa); -#else status = wpalUnlockPacket(currentCtrlBlk->xfrFrame); if (eWLAN_PAL_STATUS_SUCCESS != status) { @@ -3799,7 +3659,6 @@ static wpt_status dxeTXCompFrame } return status; } -#endif /* FEATURE_R33D */ hostCtxt->txCompCB(hostCtxt->clientCtxt, currentCtrlBlk->xfrFrame, eWLAN_PAL_STATUS_SUCCESS); @@ -3815,51 +3674,248 @@ static wpt_status dxeTXCompFrame * in theory, COMP CB must be called already ??? */ if(currentCtrlBlk == channelEntry->headCtrlBlk) { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, - "dxeTXCompFrame caught up with head ptr"); - break; + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, + "dxeTXCompFrame caught up with head ptr"); + break; + } + /* VALID Bit check ???? */ + } + + /* Tail and Head Control block must be same */ + channelEntry->tailCtrlBlk = currentCtrlBlk; + + lowThreshold = channelEntry->channelType == WDTS_CHANNEL_TX_LOW_PRI? + &(hostCtxt->txCompInt.txLowResourceThreshold_LoPriCh): + &(hostCtxt->txCompInt.txLowResourceThreshold_HiPriCh); + + /* If specific channel hit low resource condition send notification to upper layer */ + if((eWLAN_PAL_TRUE == channelEntry->hitLowResource) && + (channelEntry->numFreeDesc > *lowThreshold)) + { + /* Change it back if we raised it for fetching a remaining packet from TL */ + if(WLANDXE_TX_LOW_RES_THRESHOLD > *lowThreshold) + { + *lowThreshold = WLANDXE_TX_LOW_RES_THRESHOLD; + } + + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, + "DXE TX %d channel recovered from low resource", channelEntry->channelType); + hostCtxt->lowResourceCB(hostCtxt->clientCtxt, + channelEntry->channelType, + eWLAN_PAL_TRUE); + channelEntry->hitLowResource = eWLAN_PAL_FALSE; + } + + status = wpalMutexRelease(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeTXCompFrame Mutex Release fail"); + } + + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, + "%s Exit", __func__); + return status; +} + +/*========================================================================== + @ Function Name + dxeTXCleanup + + @ Description + Cleanup the TX channels after DXE Error + + @ Parameters + WLANDXE_CtrlBlkType *dxeCtrlBlk, + DXE host driver main control block + + @ Return + PAL_STATUS_T +===========================================================================*/ +static wpt_status dxeTXCleanup +( + WLANDXE_CtrlBlkType *hostCtxt +) +{ + wpt_status status = eWLAN_PAL_STATUS_SUCCESS; + WLANDXE_DescCtrlBlkType *currentCtrlBlk = NULL; + WLANDXE_DescType *currentDesc = NULL; + wpt_uint32 descCtrlValue = 0; + unsigned int *lowThreshold = NULL; + unsigned int idx; + WLANDXE_ChannelCBType *channelEntry; + + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, + "%s Enter", __func__); + + /* Sanity */ + if((NULL == hostCtxt)) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Invalid ARG", __func__); + return eWLAN_PAL_STATUS_E_INVAL; + } + + if(NULL == hostCtxt->txCompCB) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: TXCompCB is not registered",__func__); + return eWLAN_PAL_STATUS_SUCCESS; + } + + for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + { + channelEntry = &tempDxeCtrlBlk->dxeChannel[idx]; + if(idx != WDTS_CHANNEL_TX_LOW_PRI && idx != WDTS_CHANNEL_TX_HIGH_PRI) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: %11s continue",__func__, + channelType[channelEntry->channelType]); + continue; + } + + status = wpalMutexAcquire(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: %11s Mutex Acquire fail",__func__, + channelType[channelEntry->channelType]); + return status; + } + + currentCtrlBlk = channelEntry->tailCtrlBlk; + currentDesc = currentCtrlBlk->linkedDesc; + + if( currentCtrlBlk == channelEntry->headCtrlBlk ) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: %11s Head and Tail are Same",__func__, + channelType[channelEntry->channelType]); + + status = wpalMutexRelease(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: %11s Mutex Release fail",__func__, + channelType[channelEntry->channelType]); + return status; + } + continue; + } + + while(1) + { + descCtrlValue = currentDesc->descCtrl.ctrl; + if((descCtrlValue & WLANDXE_DESC_CTRL_VALID)) + { + /* invalidate... */ + currentDesc->descCtrl.ctrl &= ~WLANDXE_DESC_CTRL_VALID; + } + + if(currentCtrlBlk->xfrFrame == NULL) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: %11s Invalid transfer frame",__func__, + channelType[channelEntry->channelType]); + HDXE_ASSERT(0); + break; + } + channelEntry->numFreeDesc++; + channelEntry->numRsvdDesc--; + + /* Send Frame TX Complete notification with frame start fragment location */ + if(WLANDXE_U32_SWAP_ENDIAN(descCtrlValue) & WLANDXE_DESC_CTRL_EOP) + { + hostCtxt->txCompletedFrames--; + status = wpalUnlockPacket(currentCtrlBlk->xfrFrame); + if (eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: unable to unlock packet",__func__); + status = wpalMutexRelease(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Mutex Release fail",__func__); + } + return status; + } + hostCtxt->txCompCB(hostCtxt->clientCtxt, + currentCtrlBlk->xfrFrame, + eWLAN_PAL_STATUS_SUCCESS); //mir: SUCCESS or FAILURE? + channelEntry->numFragmentCurrentChain = 0; + } + currentCtrlBlk = currentCtrlBlk->nextCtrlBlk; + currentDesc = currentCtrlBlk->linkedDesc; + + /* Break condition + * Head control block is the control block must be programed for the next TX + * so, head control block is not programmed control block yet + * if loop encounte head control block, stop to complete + * in theory, COMP CB must be called already ??? */ + if(currentCtrlBlk == channelEntry->headCtrlBlk) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: %11s caught up with head ptr",__func__, + channelType[channelEntry->channelType]); + break; + } + /* VALID Bit check ???? */ + } + + /* Tail and Head Control block must be same */ + channelEntry->tailCtrlBlk = currentCtrlBlk; + /* Re-Sync Head and CDR */ + status = wpalWriteRegister(channelEntry->channelRegister.chDXEDesclRegAddr, + channelEntry->headCtrlBlk->linkedDescPhyAddr); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeChannelInitProgram Write DESC Address register fail"); + status = wpalMutexRelease(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: %11s Mutex Release fail", __func__, + channelType[channelEntry->channelType]); + } + return status; } - /* VALID Bit check ???? */ - } - /* Tail and Head Control block must be same */ - channelEntry->tailCtrlBlk = currentCtrlBlk; + lowThreshold = channelEntry->channelType == WDTS_CHANNEL_TX_LOW_PRI? + &(hostCtxt->txCompInt.txLowResourceThreshold_LoPriCh): + &(hostCtxt->txCompInt.txLowResourceThreshold_HiPriCh); - lowThreshold = channelEntry->channelType == WDTS_CHANNEL_TX_LOW_PRI? - &(hostCtxt->txCompInt.txLowResourceThreshold_LoPriCh): - &(hostCtxt->txCompInt.txLowResourceThreshold_HiPriCh); + /* If specific channel hit low resource condition send notification to upper layer */ + if((eWLAN_PAL_TRUE == channelEntry->hitLowResource) && + (channelEntry->numFreeDesc > *lowThreshold)) + { + /* Change it back if we raised it for fetching a remaining packet from TL */ + if(WLANDXE_TX_LOW_RES_THRESHOLD > *lowThreshold) + { + *lowThreshold = WLANDXE_TX_LOW_RES_THRESHOLD; + } - /* If specific channel hit low resource condition send notification to upper layer */ - if((eWLAN_PAL_TRUE == channelEntry->hitLowResource) && - (channelEntry->numFreeDesc > *lowThreshold)) - { - /* Change it back if we raised it for fetching a remaining packet from TL */ - if(WLANDXE_TX_LOW_RES_THRESHOLD > *lowThreshold) + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, + "DXE TX %d channel recovered from low resource", channelEntry->channelType); + hostCtxt->lowResourceCB(hostCtxt->clientCtxt, + channelEntry->channelType, + eWLAN_PAL_TRUE); + channelEntry->hitLowResource = eWLAN_PAL_FALSE; + } + status = wpalMutexRelease(&channelEntry->dxeChannelLock); + if(eWLAN_PAL_STATUS_SUCCESS != status) { - *lowThreshold = WLANDXE_TX_LOW_RES_THRESHOLD; + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: %11s Mutex Release fail", __func__, + channelType[channelEntry->channelType]); } - - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "DXE TX %d channel recovered from low resource", channelEntry->channelType); - hostCtxt->lowResourceCB(hostCtxt->clientCtxt, - channelEntry->channelType, - eWLAN_PAL_TRUE); - channelEntry->hitLowResource = eWLAN_PAL_FALSE; - wpalTimerStop(&channelEntry->healthMonitorTimer); - } - - status = wpalMutexRelease(&channelEntry->dxeChannelLock); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXCompFrame Mutex Release fail"); } HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Exit", __func__); return status; } - /*========================================================================== @ Function Name dxeTXEventHandler @@ -3905,6 +3961,20 @@ void dxeTXEventHandler return; } + /* Read whole interrupt mask register and exclusive only this channel int */ + status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, + &intSrc); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "dxeTXCompleteEventHandler Read INT_DONE_SRC register fail"); + return; + } + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, + "TX Event Handler INT Source 0x%x", intSrc); + + dxeEnvBlk.txCmpIntChanlSrc = intSrc&0xFF; + /* Return from here if the RIVA is in IMPS, to avoid register access */ if(WLANDXE_POWER_STATE_IMPS == dxeCtxt->hostPowerState) { @@ -3934,6 +4004,9 @@ void dxeTXEventHandler HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "TX COMP INT Enabled, remain TX frame count on ring %d", dxeCtxt->txCompletedFrames); + + dxeEnvBlk.txCmpIntChanlSrc = 0; + /*Kicking the DXE after the TX Complete interrupt was enabled - to avoid the posibility of a race*/ dxePsComplete(dxeCtxt, eWLAN_PAL_TRUE); @@ -3957,19 +4030,6 @@ void dxeTXEventHandler return; } - /* Disable device interrupt */ - /* Read whole interrupt mask register and exclusive only this channel int */ - status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, - &intSrc); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXCompleteEventHandler Read INT_DONE_SRC register fail"); - return; - } - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_MED, - "TX Event Handler INT Source 0x%x", intSrc); - /* Test High Priority Channel is the INT source or not */ channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_TX_HIGH_PRI]; if(intSrc & (1 << channelCb->assignedDMAChannel)) @@ -3988,11 +4048,14 @@ void dxeTXEventHandler "%11s : 0x%x Error Reported, Reload Driver", channelType[channelCb->channelType], chStat); - dxeErrChannelDebug(channelCb, chStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); + if (eWLAN_PAL_STATUS_SUCCESS != + dxeErrHandler(channelCb, chStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } + bEnableISR = 1; } else if(WLANDXE_CH_STAT_INT_DONE_MASK & chStat) { @@ -4042,11 +4105,14 @@ void dxeTXEventHandler "%11s : 0x%x Error Reported, Reload Driver", channelType[channelCb->channelType], chStat); - dxeErrChannelDebug(channelCb, chStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); + if (eWLAN_PAL_STATUS_SUCCESS != + dxeErrHandler(channelCb, chStat)) + { + dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; + wpalWlanReload(); + dxeStartSSRTimer(dxeCtxt); + } + bEnableISR = 1; } else if(WLANDXE_CH_STAT_INT_DONE_MASK & chStat) { @@ -4077,53 +4143,6 @@ void dxeTXEventHandler "TX LOW STAT 0x%x RESRVD %d", chStat, channelCb->numRsvdDesc); } - -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - /* Test H2H TX Channel interrupt is enabled or not */ - channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_H2H_TEST_TX]; - if(intSrc & (1 << channelCb->assignedDMAChannel)) - { - status = wpalReadRegister(channelCb->channelRegister.chDXEStatusRegAddr, - &chStat); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeChannelCleanInt Read CH STAT register fail"); - return; - } - - if(WLANDXE_CH_STAT_INT_ERR_MASK & chStat) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, - "%11s : 0x%x Error Reported, Reload Driver", - channelType[channelCb->channelType], chStat); - - dxeErrChannelDebug(channelCb, chStat); - - dxeCtxt->driverReloadInProcessing = eWLAN_PAL_TRUE; - wpalWlanReload(); - dxeStartSSRTimer(dxeCtxt); - } - else if(WLANDXE_CH_STAT_INT_DONE_MASK & chStat) - { - /* Handle TX complete for high priority channel */ - status = dxeTXCompFrame(dxeCtxt, - channelCb); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXEventHandler INT Clean up fail"); - return; - } - } - else - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "unexpected channel state %d", chStat); - } - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ - if((bEnableISR || (dxeCtxt->txCompletedFrames)) && (eWLAN_PAL_FALSE == dxeCtxt->txIntEnable)) { @@ -4137,6 +4156,8 @@ void dxeTXEventHandler } } + dxeEnvBlk.txCmpIntChanlSrc = 0; + /*Kicking the DXE after the TX Complete interrupt was enabled - to avoid the posibility of a race*/ dxePsComplete(dxeCtxt, eWLAN_PAL_TRUE); @@ -4207,7 +4228,8 @@ void dxeTXCompleteProcessing * Then when push frame, no SMSM toggle happen * To avoid permanent TX stall, SMSM toggle is needed at here * With this toggle, host should gaurantee SMSM state should be changed */ - dxeNotifySmsm(eWLAN_PAL_TRUE, dxeCtxt->txRingsEmpty); + dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); + dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); } } @@ -4432,9 +4454,6 @@ static void dxeTXISR { WLANDXE_CtrlBlkType *dxeCtxt = (WLANDXE_CtrlBlkType *)hostCtxt; wpt_status status = eWLAN_PAL_STATUS_SUCCESS; -#ifdef FEATURE_R33D - wpt_uint32 regValue; -#endif /* FEATURE_R33D */ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); @@ -4458,25 +4477,6 @@ static void dxeTXISR return; } -#ifdef FEATURE_R33D - status = wpalReadRegister(WLANDXE_INT_SRC_RAW_ADDRESS, - ®Value); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "dxeTXCompISR Read INT_SRC_RAW fail"); - return; - } - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "INT_SRC_RAW 0x%x", regValue); - if(0 == regValue) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "This is not DXE Interrupt, Reject it"); - return; - } -#endif /* FEATURE_R33D */ - /* Disable TX Complete Interrupt at here */ status = wpalDisableInterrupt(DXE_INTERRUPT_TX_COMPLE); if(eWLAN_PAL_STATUS_SUCCESS != status) @@ -4544,16 +4544,22 @@ void *WLANDXE_Open unsigned int idx; WLANDXE_ChannelCBType *currentChannel = NULL; int smsmInitState; -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - wpt_uint32 sIdx; - WLANDXE_ChannelCBType *channel = NULL; - WLANDXE_DescCtrlBlkType *crntDescCB = NULL; - WLANDXE_DescCtrlBlkType *nextDescCB = NULL; -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ + wpt_uint8 chanMask = WDTS_TRANSPORT_CHANNELS_MASK; HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); + if (wpalIsFwLoggingEnabled()) + { + chanMask |= WDTS_RX_LOG_CHANNEL_MASK; + } + + if (wpalIsFwEvLoggingEnabled()) + { + chanMask |= WDTS_RX_FW_LOG_CHANNEL_MASK; + } + dxeSetEnabledChannels(chanMask); + /* This is temporary allocation */ tempDxeCtrlBlk = (WLANDXE_CtrlBlkType *)wpalMemoryAllocate(sizeof(WLANDXE_CtrlBlkType)); if(NULL == tempDxeCtrlBlk) @@ -4564,46 +4570,14 @@ void *WLANDXE_Open } wpalMemoryZero(tempDxeCtrlBlk, sizeof(WLANDXE_CtrlBlkType)); - status = dxeCommonDefaultConfig(tempDxeCtrlBlk); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "WLANDXE_Open Common Configuration Fail"); - WLANDXE_Close(tempDxeCtrlBlk); - return NULL; - } + dxeCommonDefaultConfig(tempDxeCtrlBlk); - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "WLANDXE_Open Channel %s Open Start", channelType[idx]); currentChannel = &tempDxeCtrlBlk->dxeChannel[idx]; - if(idx == WDTS_CHANNEL_TX_LOW_PRI) - { - currentChannel->channelType = WDTS_CHANNEL_TX_LOW_PRI; - } - else if(idx == WDTS_CHANNEL_TX_HIGH_PRI) - { - currentChannel->channelType = WDTS_CHANNEL_TX_HIGH_PRI; - } - else if(idx == WDTS_CHANNEL_RX_LOW_PRI) - { - currentChannel->channelType = WDTS_CHANNEL_RX_LOW_PRI; - } - else if(idx == WDTS_CHANNEL_RX_HIGH_PRI) - { - currentChannel->channelType = WDTS_CHANNEL_RX_HIGH_PRI; - } -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - else if(idx == WDTS_CHANNEL_H2H_TEST_TX) - { - currentChannel->channelType = WDTS_CHANNEL_H2H_TEST_TX; - } - else if(idx == WDTS_CHANNEL_H2H_TEST_RX) - { - currentChannel->channelType = WDTS_CHANNEL_H2H_TEST_RX; - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ + currentChannel->channelType = idx; /* Config individual channels from channel default setup table */ status = dxeChannelDefaultConfig(tempDxeCtrlBlk, @@ -4635,29 +4609,6 @@ void *WLANDXE_Open return NULL; } - status = wpalTimerInit(¤tChannel->healthMonitorTimer, - dxeHealthMonitorTimeout, - (void *)currentChannel); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "WLANDXE_Open Health Monitor timer init fail %d", idx); - WLANDXE_Close(tempDxeCtrlBlk); - return NULL; - } - - currentChannel->healthMonitorMsg = (wpt_msg *)wpalMemoryAllocate(sizeof(wpt_msg)); - if(NULL == currentChannel->healthMonitorMsg) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "WLANDXE_Open Health Monitor MSG Alloc fail %d", idx); - WLANDXE_Close(tempDxeCtrlBlk); - return NULL; - } - wpalMemoryZero(currentChannel->healthMonitorMsg, sizeof(wpt_msg)); - currentChannel->healthMonitorMsg->callback = dxeTXHealthMonitor; - currentChannel->healthMonitorMsg->pContext = (void *)currentChannel; - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "WLANDXE_Open Channel %s Open Success", channelType[idx]); } @@ -4707,6 +4658,8 @@ void *WLANDXE_Open tempDxeCtrlBlk->txIntDisabledByIMPS = eWLAN_PAL_FALSE; tempDxeCtrlBlk->driverReloadInProcessing = eWLAN_PAL_FALSE; tempDxeCtrlBlk->smsmToggled = eWLAN_PAL_FALSE; + tempDxeCtrlBlk->smsmRingsEmptyHistogram = 0; + tempDxeCtrlBlk->smsmDxeHistogram = 0; /* Initialize SMSM state * Init State is @@ -4718,7 +4671,7 @@ void *WLANDXE_Open { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "SMSM Channel init fail %d", smsmInitState); - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { dxeChannelClose(tempDxeCtrlBlk, &tempDxeCtrlBlk->dxeChannel[idx]); } @@ -4753,9 +4706,7 @@ void *WLANDXE_Open @ Parameters pVoid pDXEContext : DXE module control block - WDTS_RxFrameReadyCbType rxFrameReadyCB : RX Frame ready CB function pointer - WDTS_TxCompleteCbType txCompleteCB : TX complete CB function pointer - WDTS_LowResourceCbType lowResourceCB : Low DXE resource notification CB function pointer + WDTS_ClientCallbacks WDTSCb : Callbacks to WDTS to indicate various events void *userContext : DXE Cliennt control block @ Return @@ -4764,9 +4715,7 @@ void *WLANDXE_Open wpt_status WLANDXE_ClientRegistration ( void *pDXEContext, - WLANDXE_RxFrameReadyCbType rxFrameReadyCB, - WLANDXE_TxCompleteCbType txCompleteCB, - WLANDXE_LowResourceCbType lowResourceCB, + WDTS_ClientCallbacks WDTSCb, void *userContext ) { @@ -4784,27 +4733,6 @@ wpt_status WLANDXE_ClientRegistration return eWLAN_PAL_STATUS_E_INVAL; } - if(NULL == rxFrameReadyCB) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "WLANDXE_ClientRegistration Invalid RX READY CB"); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if(NULL == txCompleteCB) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "WLANDXE_ClientRegistration Invalid txCompleteCB"); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if(NULL == lowResourceCB) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "WLANDXE_ClientRegistration Invalid lowResourceCB"); - return eWLAN_PAL_STATUS_E_INVAL; - } - if(NULL == userContext) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -4815,9 +4743,11 @@ wpt_status WLANDXE_ClientRegistration dxeCtxt = (WLANDXE_CtrlBlkType *)pDXEContext; /* Assign */ - dxeCtxt->rxReadyCB = rxFrameReadyCB; - dxeCtxt->txCompCB = txCompleteCB; - dxeCtxt->lowResourceCB = lowResourceCB; + dxeCtxt->rxReadyCB = WDTSCb.rxFrameReadyCB; + dxeCtxt->txCompCB = WDTSCb.txCompleteCB; + dxeCtxt->lowResourceCB = WDTSCb.lowResourceCB; + dxeCtxt->receiveMbMsgCB = WDTSCb.receiveMbMsgCB; + dxeCtxt->receiveLogCompleteCB = WDTSCb.receiveLogCompleteCB; dxeCtxt->clientCtxt = userContext; HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, @@ -4863,16 +4793,10 @@ wpt_status WLANDXE_Start /* WLANDXE_Start called means DXE engine already initiates * And DXE HW is reset and init finished * But here to make sure HW is initialized, reset again */ - status = dxeEngineCoreStart(dxeCtxt); - if(eWLAN_PAL_STATUS_SUCCESS != status) - { - HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "WLANDXE_Start DXE HW init Fail"); - return status; - } + dxeEngineCoreStart(dxeCtxt); /* Individual Channel Start */ - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, "WLANDXE_Start Channel %s Start", channelType[idx]); @@ -4994,7 +4918,7 @@ wpt_status WLANDXE_TxFrame return eWLAN_PAL_STATUS_E_INVAL; } - if((WDTS_CHANNEL_MAX < channel) || (WDTS_CHANNEL_MAX == channel)) + if(WDTS_CHANNEL_MAX <= channel) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "WLANDXE_Start Invalid channel"); @@ -5081,8 +5005,6 @@ wpt_status WLANDXE_TxFrame dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); } - wpalTimerStart(¤tChannel->healthMonitorTimer, - T_WLANDXE_PERIODIC_HEALTH_M_TIME); } status = wpalMutexRelease(¤tChannel->dxeChannelLock); if(eWLAN_PAL_STATUS_SUCCESS != status) @@ -5145,8 +5067,6 @@ WLANDXE_CompleteTX WDTS_CHANNEL_TX_LOW_PRI, eWLAN_PAL_FALSE); inLowRes = channelCb->hitLowResource = eWLAN_PAL_TRUE; - wpalTimerStart(&channelCb->healthMonitorTimer, - T_WLANDXE_PERIODIC_HEALTH_M_TIME); } } @@ -5185,8 +5105,6 @@ WLANDXE_CompleteTX WDTS_CHANNEL_TX_LOW_PRI, eWLAN_PAL_FALSE); channelCb->hitLowResource = eWLAN_PAL_TRUE; - wpalTimerStart(&channelCb->healthMonitorTimer, - T_WLANDXE_PERIODIC_HEALTH_M_TIME); } } } @@ -5230,13 +5148,8 @@ wpt_status WLANDXE_Stop } dxeCtxt = (WLANDXE_CtrlBlkType *)pDXEContext; - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { - if(VOS_TIMER_STATE_RUNNING == wpalTimerGetCurStatus(&dxeCtxt->dxeChannel[idx].healthMonitorTimer)) - { - wpalTimerStop(&dxeCtxt->dxeChannel[idx].healthMonitorTimer); - } - status = dxeChannelStop(dxeCtxt, &dxeCtxt->dxeChannel[idx]); if(eWLAN_PAL_STATUS_SUCCESS != status) { @@ -5287,12 +5200,6 @@ wpt_status WLANDXE_Close wpt_status status = eWLAN_PAL_STATUS_SUCCESS; wpt_uint32 idx; WLANDXE_CtrlBlkType *dxeCtxt = NULL; -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - wpt_uint32 sIdx; - WLANDXE_ChannelCBType *channel = NULL; - WLANDXE_DescCtrlBlkType *crntDescCB = NULL; - WLANDXE_DescCtrlBlkType *nextDescCB = NULL; -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, "%s Enter", __func__); @@ -5310,29 +5217,10 @@ wpt_status WLANDXE_Close wpalTimerDelete(&dxeCtxt->rxResourceAvailableTimer); #endif wpalTimerDelete(&dxeCtxt->dxeSSRTimer); - for(idx = 0; idx < WDTS_CHANNEL_MAX; idx++) + foreach_valid_channel(idx) { wpalMutexDelete(&dxeCtxt->dxeChannel[idx].dxeChannelLock); - wpalTimerDelete(&dxeCtxt->dxeChannel[idx].healthMonitorTimer); - if(NULL != dxeCtxt->dxeChannel[idx].healthMonitorMsg) - { - wpalMemoryFree(dxeCtxt->dxeChannel[idx].healthMonitorMsg); - } dxeChannelClose(dxeCtxt, &dxeCtxt->dxeChannel[idx]); -#ifdef WLANDXE_TEST_CHANNEL_ENABLE - channel = &dxeCtxt->dxeChannel[idx]; - crntDescCB = channel->headCtrlBlk; - for(sIdx = 0; sIdx < channel->numDesc; sIdx++) - { - nextDescCB = (WLANDXE_DescCtrlBlkType *)crntDescCB->nextCtrlBlk; - wpalMemoryFree((void *)crntDescCB); - crntDescCB = nextDescCB; - if(NULL == crntDescCB) - { - break; - } - } -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ } if(NULL != dxeCtxt->rxIsrMsg) @@ -5753,8 +5641,7 @@ wpt_uint32 WLANDXE_GetFreeTxDataResNumber return (0); } - return - ((WLANDXE_CtrlBlkType *)pDXEContext)->dxeChannel[WDTS_CHANNEL_TX_LOW_PRI].numFreeDesc; + return ((WLANDXE_CtrlBlkType *)pDXEContext)->dxeChannel[WDTS_CHANNEL_TX_LOW_PRI].numFreeDesc; } /*========================================================================== @@ -5852,13 +5739,67 @@ void WLANDXE_ChannelDebug } } - if(debugFlags & WPAL_DEBUG_START_HEALTH_TIMER) + return; +} + +/*========================================================================== + @ Function Name + WLANDXE_KickDxe + + @ Description + Kick DXE when HDD TX time out happen + + @ Parameters + NONE + + @ Return + NONE + +===========================================================================*/ +void WLANDXE_KickDxe(void) +{ + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Kick Dxe for HDD TX timeout",__func__); + /* Make wake up HW */ + dxeNotifySmsm(eWLAN_PAL_FALSE, eWLAN_PAL_TRUE); + dxeNotifySmsm(eWLAN_PAL_TRUE, eWLAN_PAL_FALSE); +} + +wpt_uint32 WLANDXE_SetupLogTransfer(wpt_uint64 bufferAddr, wpt_uint32 bufferLen) +{ + WLANDXE_ChannelCBType *channelEntry; + + channelEntry = &tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_RX_FW_LOG]; + + + return dxeRXLogRefillRing(tempDxeCtrlBlk, channelEntry, bufferAddr, + bufferLen); +} + +wpt_status WLANDXE_StartLogTransfer(void) +{ + WLANDXE_ChannelCBType *channelEntry; + wpt_status status = eWLAN_PAL_STATUS_SUCCESS; + + channelEntry = &tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_RX_FW_LOG]; + + tempDxeCtrlBlk->hostInitiatedH2H = 1; + status = wpalWriteRegister(channelEntry->channelRegister.chDXEDesclRegAddr, + channelEntry->headCtrlBlk->linkedDescPhyAddr); + if(eWLAN_PAL_STATUS_SUCCESS != status) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s Write DESC Address register fail", __func__); + return status; + } + + status = wpalWriteRegister(channelEntry->channelRegister.chDXECtrlRegAddr, + channelEntry->extraConfig.chan_mask); + if(eWLAN_PAL_STATUS_SUCCESS != status) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "DXE TX Stall detect"); - /* Start Stall detect timer and detect stall */ - wpalTimerStart(&tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_TX_LOW_PRI].healthMonitorTimer, - T_WLANDXE_PERIODIC_HEALTH_M_TIME); + "dxeChannelInitProgram Write RX Control register fail"); + return status; } - return; + return status; } diff --git a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_cfg_i.c b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_cfg_i.c index 24ecc91d13b2..4d6b57bd0b7d 100644 --- a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_cfg_i.c +++ b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_cfg_i.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -32,9 +32,6 @@ @brief This file contains the external API exposed by the wlan data transfer abstraction layer module. - Copyright (c) 2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ========================================================================*/ /*=========================================================================== @@ -84,7 +81,8 @@ wpt_uint32 channelBaseAddressList[WLANDXE_DMA_CHANNEL_MAX] = WLANDXE_DMA_CHAN3_BASE_ADDRESS, WLANDXE_DMA_CHAN4_BASE_ADDRESS, WLANDXE_DMA_CHAN5_BASE_ADDRESS, - WLANDXE_DMA_CHAN6_BASE_ADDRESS + WLANDXE_DMA_CHAN6_BASE_ADDRESS, + WLANDXE_DMA_CHAN7_BASE_ADDRESS }; wpt_uint32 channelInterruptMask[WLANDXE_DMA_CHANNEL_MAX] = @@ -95,7 +93,8 @@ wpt_uint32 channelInterruptMask[WLANDXE_DMA_CHANNEL_MAX] = WLANDXE_INT_MASK_CHAN_3, WLANDXE_INT_MASK_CHAN_4, WLANDXE_INT_MASK_CHAN_5, - WLANDXE_INT_MASK_CHAN_6 + WLANDXE_INT_MASK_CHAN_6, + WLANDXE_INT_MASK_CHAN_7 }; WLANDXE_ChannelConfigType chanTXLowPriConfig = @@ -255,21 +254,58 @@ WLANDXE_ChannelConfigType chanRXHighPriConfig = eWLAN_PAL_TRUE }; -#ifdef WLANDXE_TEST_CHANNEL_ENABLE -WLANDXE_ChannelConfigType chanH2HTestConfig = +WLANDXE_ChannelConfigType chanRXLogConfig = { /* Q handle type, Circular */ WLANDXE_CHANNEL_HANDLE_CIRCULA, - /* Number of Descriptor, NOT CLEAR YET !!! */ - 5, + /* Number of Descriptors*/ + 8, - /* MAX num RX Buffer, NOT CLEAR YET !!! */ + /* MAX num RX Buffer*/ + 1, + + /* Reference WQ, RX23 */ + 23, + + /* USB Only, End point info */ 0, - /* Reference WQ, NOT CLEAR YET !!! */ - /* Temporary BMU Work Q 5 */ - 5, + /* Transfer Type */ + WLANDXE_DESC_CTRL_XTYPE_B2H, + + /* Channel Priority 7(Highest) - 0(Lowest)*/ + 1, + + /* BD attached to frames for this pipe */ + eWLAN_PAL_TRUE, + + /* chk_size*/ + 0, + + /* bmuThdSel*/ + 8, + + /* Added in Gen5 for Prefetch*/ + eWLAN_PAL_TRUE, + + /* Use short Descriptor */ + eWLAN_PAL_TRUE +}; + +WLANDXE_ChannelConfigType chanRXFWLogConfig = +{ + /* Q handle type, Circular */ + WLANDXE_CHANNEL_HANDLE_CIRCULA, + + /* Number of Descriptors*/ + 32, + + /* MAX num RX Buffer*/ + 1, + + /* Reference WQ - NA as channel used for H2H */ + 0, /* USB Only, End point info */ 0, @@ -277,37 +313,33 @@ WLANDXE_ChannelConfigType chanH2HTestConfig = /* Transfer Type */ WLANDXE_DESC_CTRL_XTYPE_H2H, - /* Channel Priority 7(Highest) - 0(Lowest), NOT CLEAR YET !!! */ - 5, + /* Channel Priority 7(Highest) - 0(Lowest)*/ + 0, /* BD attached to frames for this pipe */ - eWLAN_PAL_FALSE, + eWLAN_PAL_TRUE, - /* chk_size, NOT CLEAR YET !!!*/ + /* chk_size*/ 0, - /* bmuThdSel, NOT CLEAR YET !!! */ - 0, + /* bmuThdSel*/ + 8, - /* Added in Gen5 for Prefetch, NOT CLEAR YET !!!*/ + /* Added in Gen5 for Prefetch*/ eWLAN_PAL_TRUE, /* Use short Descriptor */ eWLAN_PAL_TRUE }; -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ WLANDXE_ChannelMappingType channelList[WDTS_CHANNEL_MAX] = { {WDTS_CHANNEL_TX_LOW_PRI, WLANDXE_DMA_CHANNEL_0, &chanTXLowPriConfig}, {WDTS_CHANNEL_TX_HIGH_PRI, WLANDXE_DMA_CHANNEL_4, &chanTXHighPriConfig}, {WDTS_CHANNEL_RX_LOW_PRI, WLANDXE_DMA_CHANNEL_1, &chanRXLowPriConfig}, -#ifndef WLANDXE_TEST_CHANNEL_ENABLE {WDTS_CHANNEL_RX_HIGH_PRI, WLANDXE_DMA_CHANNEL_3, &chanRXHighPriConfig}, -#else - {WDTS_CHANNEL_H2H_TEST_TX, WLANDXE_DMA_CHANNEL_2, &chanH2HTestConfig}, - {WDTS_CHANNEL_H2H_TEST_RX, WLANDXE_DMA_CHANNEL_2, &chanH2HTestConfig} -#endif /* WLANDXE_TEST_CHANNEL_ENABLE */ + {WDTS_CHANNEL_RX_LOG, WLANDXE_DMA_CHANNEL_5, &chanRXLogConfig}, + {WDTS_CHANNEL_RX_FW_LOG, WLANDXE_DMA_CHANNEL_7, &chanRXFWLogConfig}, }; WLANDXE_TxCompIntConfigType txCompInt = @@ -331,6 +363,49 @@ WLANDXE_TxCompIntConfigType txCompInt = 10 }; +// Indicates the DXE channels being used in the current run. +static wpt_uint8 dxeEnabledChannels; + +/*========================================================================== + @ Function Name + dxeSetEnabledChannels + + @ Description + + @ Parameters + + @ Return + void + +===========================================================================*/ +void dxeSetEnabledChannels +( + wpt_uint8 enabledChannels +) +{ + dxeEnabledChannels = enabledChannels; +} + +/*========================================================================== + @ Function Name + dxeGetEnabledChannels + + @ Description + + @ Parameters + + @ Return + wpt_uint8 + +===========================================================================*/ +wpt_uint8 dxeGetEnabledChannels +( + void +) +{ + return dxeEnabledChannels; +} + /*========================================================================== @ Function Name dxeCommonDefaultConfig @@ -342,16 +417,14 @@ WLANDXE_TxCompIntConfigType txCompInt = DXE host driver main control block @ Return - wpt_status + void ===========================================================================*/ -wpt_status dxeCommonDefaultConfig +void dxeCommonDefaultConfig ( WLANDXE_CtrlBlkType *dxeCtrlBlk ) { - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - dxeCtrlBlk->rxReadyCB = NULL; dxeCtrlBlk->txCompCB = NULL; dxeCtrlBlk->lowResourceCB = NULL; @@ -359,8 +432,6 @@ wpt_status dxeCommonDefaultConfig wpalMemoryCopy(&dxeCtrlBlk->txCompInt, &txCompInt, sizeof(WLANDXE_TxCompIntConfigType)); - - return status; } /*========================================================================== @@ -469,20 +540,31 @@ wpt_status dxeChannelDefaultConfig (WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType)) { channelEntry->extraConfig.chan_mask |= WLANDXE_CH_CTRL_DIQ_MASK; + if (wpalWcnssIsProntoHwVer3()) + { + HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO, + "Using WQ 6 for TX Low/High PRI Channel"); + channelEntry->channelConfig.refWQ = WLANDXE_PRONTO_TX_WQ; + } } /* RX Channel, Set SIQ bit, Clear DIQ bit since source is not WQ */ else if((WDTS_CHANNEL_RX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_RX_HIGH_PRI == channelEntry->channelType) || + (WDTS_CHANNEL_RX_LOG == channelEntry->channelType)) { channelEntry->extraConfig.chan_mask |= WLANDXE_CH_CTRL_SIQ_MASK; } else { - /* This is test H2H channel, TX, RX not use work Q + /* This is H2H channel, TX, RX not use work Q * Do Nothing */ } - /* Frame Contents Swap */ - channelEntry->extraConfig.chan_mask |= WLANDXE_CH_CTRL_SWAP_MASK; + + if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType) + { + /* Frame Contents Swap */ + channelEntry->extraConfig.chan_mask |= WLANDXE_CH_CTRL_SWAP_MASK; + } /* Host System Using Little Endian */ channelEntry->extraConfig.chan_mask |= WLANDXE_CH_CTRL_ENDIAN_MASK; /* BMU Threshold select */ @@ -505,9 +587,14 @@ wpt_status dxeChannelDefaultConfig * DXE engine will reference this value before DMA transfer */ dxeControlRead = 0; /* Source is a Queue ID, not flat memory address */ - dxeControlRead |= WLANDXE_DESC_CTRL_SIQ; + if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType) + dxeControlRead |= WLANDXE_DESC_CTRL_SIQ; /* Transfer direction is BMU 2 Host */ - dxeControlRead |= WLANDXE_DESC_CTRL_XTYPE_B2H; + if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType) + dxeControlRead |= WLANDXE_DESC_CTRL_XTYPE_B2H; + else + dxeControlRead |= WLANDXE_DESC_CTRL_XTYPE_H2H; + /* End of Packet, RX is single fragment */ dxeControlRead |= WLANDXE_DESC_CTRL_EOP; /* BD Present, default YES, B2H case it must be 0 to insert BD */ @@ -530,11 +617,15 @@ wpt_status dxeChannelDefaultConfig dxeControlRead |= WLANDXE_DESC_CTRL_INT; /* For ready status, this Control WORD must be VALID */ dxeControlRead |= WLANDXE_DESC_CTRL_VALID; + /* Frame Contents Swap */ - dxeControlRead |= WLANDXE_DESC_CTRL_BDT_SWAP; + if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType) + dxeControlRead |= WLANDXE_DESC_CTRL_BDT_SWAP; + /* Host Little Endian */ if((WDTS_CHANNEL_TX_LOW_PRI == channelEntry->channelType) || - (WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType)) + (WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType) || + (WDTS_CHANNEL_RX_FW_LOG == channelEntry->channelType)) { dxeControlRead |= WLANDXE_DESC_CTRL_ENDIANNESS; } @@ -614,6 +705,14 @@ wpt_status dxeChannelDefaultConfig { channelEntry->numDesc = mappedChannel->channelConfig->nDescs; } + else if(WDTS_CHANNEL_RX_LOG == channelEntry->channelType) + { + channelEntry->numDesc = mappedChannel->channelConfig->nDescs; + } + else if(WDTS_CHANNEL_RX_FW_LOG == channelEntry->channelType) + { + channelEntry->numDesc = mappedChannel->channelConfig->nDescs; + } else { channelEntry->numDesc = rxResourceCount / 4; @@ -621,6 +720,7 @@ wpt_status dxeChannelDefaultConfig channelEntry->assignedDMAChannel = mappedChannel->DMAChannel; channelEntry->numFreeDesc = 0; channelEntry->numRsvdDesc = 0; + channelEntry->desc_write_fail_count = 0; channelEntry->numFragmentCurrentChain = 0; channelEntry->numTotalFrame = 0; channelEntry->hitLowResource = eWLAN_PAL_FALSE; diff --git a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_i.h b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_i.h index fa819ef7edf3..23f3b298ea97 100644 --- a/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_i.h +++ b/drivers/staging/prima/CORE/DXE/src/wlan_qct_dxe_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -73,6 +73,14 @@ when who what, where, why * -------------------------------------------------------------------------*/ #define WLANDXE_CTXT_COOKIE 0xC00CC111 +#define foreach_valid_channel(idx) \ + for (idx = 0; idx < WDTS_CHANNEL_MAX; idx++) \ + if (!(dxeGetEnabledChannels() & 1<= 4) && ((staId) < 0xFF)) + (((staId) >= 3) && ((staId) < 0xFF)) #endif #define TKIP_COUNTER_MEASURE_STARTED 1 #define TKIP_COUNTER_MEASURE_STOPED 0 @@ -129,8 +129,14 @@ int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType ); int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType ); VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, - tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *peerMac, +#else + tANI_U8 *peerMac, +#endif + tANI_U16 staId, tANI_U8 ucastSig); void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter); +VOS_STATUS hdd_roamDeregisterTDLSSTA(hdd_adapter_t *pAdapter, tANI_U8 staId); #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter, diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h index f8bfbe96c1f1..b0ccf6a4c0b2 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ \brief Android WLAN Adapter Configuration functions - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ @@ -272,6 +269,18 @@ #define CFG_ENABLE_DYNAMIC_RA_START_RATE_MAX ( 1 ) #define CFG_ENABLE_DYNAMIC_RA_START_RATE_DEFAULT ( 0 ) +/* Bit mask value to enable RTS/CTS for different modes + * for 2.4 GHz, HT20 - 0x0001, for 2.4 GHz, HT40 - 0x0002 + * for 2.4 GHz, VHT20 - 0x0004, for 2.4 GHz, VHT40 - 0x0008 + * for 5 GHz, HT20 - 0x0100, for 5 GHz, HT40 - 0x0200 + * for 5 GHz, VHT20 - 0x0400, for 5 GHz, VHT40 - 0x0800 + * for 5 GHz, VHT80 - 0x1000 + */ +#define CFG_ENABLE_RTSCTS_HTVHT_NAME "gEnableRtsCtsHtVht" +#define CFG_ENABLE_RTSCTS_HTVHT_MIN ( 0x0000 ) +#define CFG_ENABLE_RTSCTS_HTVHT_MAX ( 0x1f0f ) +#define CFG_ENABLE_RTSCTS_HTVHT_DEFAULT ( 0x0000 ) + #define CFG_AUTO_BMPS_TIMER_VALUE_NAME "gAutoBmpsTimerValue" #define CFG_AUTO_BMPS_TIMER_VALUE_MIN ( 1000 ) #define CFG_AUTO_BMPS_TIMER_VALUE_MAX ( 4294967295UL ) @@ -289,6 +298,11 @@ #define CFG_ENABLE_ADAPT_RX_DRAIN_MAX WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMAX #define CFG_ENABLE_ADAPT_RX_DRAIN_DEFAULT WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STADEF +#define CFG_DISABLE_BAR_WAKEUP_HOST_NAME "gDisableBarWakeUp" +#define CFG_DISABLE_BAR_WAKEUP_HOST_MIN 0 +#define CFG_DISABLE_BAR_WAKEUP_HOST_MAX 1 +#define CFG_DISABLE_BAR_WAKEUP_HOST_DEFAULT 0 + typedef enum { eHDD_DOT11_MODE_AUTO = 0, //covers all things we support @@ -315,15 +329,10 @@ typedef enum #define CFG_DOT11_MODE_DEFAULT eHDD_DOT11_MODE_11n #endif -#define CFG_SAP_DOT11_MODE_NAME "gSapDot11Mode" -#define CFG_SAP_DOT11_MODE_MIN eHDD_DOT11_MODE_AUTO -#ifdef WLAN_FEATURE_11AC -#define CFG_SAP_DOT11_MODE_MAX eHDD_DOT11_MODE_11ac -#define CFG_SAP_DOT11_MODE_DEFAULT eHDD_DOT11_MODE_11ac -#else -#define CFG_SAP_DOT11_MODE_MAX eHDD_DOT11_MODE_11b_ONLY -#define CFG_SAP_DOT11_MODE_DEFAULT eHDD_DOT11_MODE_11n -#endif +#define CFG_SAP_ENABLE_11AC_NAME "gSapEnable11AC" +#define CFG_SAP_ENABLE_11AC_MIN ( 0 ) +#define CFG_SAP_ENABLE_11AC_MAX ( 1 ) +#define CFG_SAP_ENABLE_11AC_DEFAULT ( 1 ) #define CFG_CHANNEL_BONDING_MODE_24GHZ_NAME "gChannelBondingMode24GHz" #define CFG_CHANNEL_BONDING_MODE_MIN WNI_CFG_CHANNEL_BONDING_MODE_STAMIN @@ -518,12 +527,12 @@ typedef enum #define CFG_AP_KEEP_ALIVE_PERIOD_NAME "gApKeepAlivePeriod" #define CFG_AP_KEEP_ALIVE_PERIOD_MIN ( 3 ) -#define CFG_AP_KEEP_ALIVE_PERIOD_MAX ( 20 ) +#define CFG_AP_KEEP_ALIVE_PERIOD_MAX ( 255 ) #define CFG_AP_KEEP_ALIVE_PERIOD_DEFAULT ( 5 ) #define CFG_GO_KEEP_ALIVE_PERIOD_NAME "gGoKeepAlivePeriod" #define CFG_GO_KEEP_ALIVE_PERIOD_MIN ( 3 ) -#define CFG_GO_KEEP_ALIVE_PERIOD_MAX ( 20 ) +#define CFG_GO_KEEP_ALIVE_PERIOD_MAX ( 255 ) #define CFG_GO_KEEP_ALIVE_PERIOD_DEFAULT ( 5 ) #define CFG_AP_LINK_MONITOR_PERIOD_NAME "gApLinkMonitorPeriod" @@ -579,12 +588,12 @@ typedef enum #define CFG_ACTIVE_MAX_CHANNEL_TIME_NAME "gActiveMaxChannelTime" #define CFG_ACTIVE_MAX_CHANNEL_TIME_MIN ( 0 ) #define CFG_ACTIVE_MAX_CHANNEL_TIME_MAX ( 10000 ) -#define CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT ( 40 ) +#define CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT ( 50 ) #define CFG_ACTIVE_MIN_CHANNEL_TIME_NAME "gActiveMinChannelTime" #define CFG_ACTIVE_MIN_CHANNEL_TIME_MIN ( 0 ) #define CFG_ACTIVE_MIN_CHANNEL_TIME_MAX ( 10000 ) -#define CFG_ACTIVE_MIN_CHANNEL_TIME_DEFAULT ( 20 ) +#define CFG_ACTIVE_MIN_CHANNEL_TIME_DEFAULT ( 30 ) #define CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_NAME "gActiveMaxChannelTimeBtc" #define CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_MIN ( 0 ) @@ -1252,6 +1261,11 @@ typedef enum #define CFG_BCN_EARLY_TERM_WAKE_MAX ( 255 ) #define CFG_BCN_EARLY_TERM_WAKE_DEFAULT ( 3 ) +#define CFG_ENABLE_ROAM_DELAY_STATS "gEnableRoamDelayStats" +#define CFG_ENABLE_ROAM_DELAY_STATS_MIN ( 0 ) +#define CFG_ENABLE_ROAM_DELAY_STATS_MAX ( 1 ) +#define CFG_ENABLE_ROAM_DELAY_STATS_DEFAULT ( 0 ) + #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING #define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_NAME "gNeighborScanTimerPeriod" #define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN (3) @@ -1399,9 +1413,16 @@ typedef enum #define CFG_ENABLE_BYPASS_11D_MAX ( 1 ) #define CFG_ENABLE_BYPASS_11D_DEFAULT ( 1 ) +/* + * gEnableDFSChnlScan + * 0: disable scan on DFS channels + * 1: enables passive scan on DFS channels + * 2: enables active scan on DFS channels for static list. + * Static or cfg list is the channel list set by ioctl SETROAMSCANCHANNELS. +*/ #define CFG_ENABLE_DFS_CHNL_SCAN_NAME "gEnableDFSChnlScan" #define CFG_ENABLE_DFS_CHNL_SCAN_MIN ( 0 ) -#define CFG_ENABLE_DFS_CHNL_SCAN_MAX ( 1 ) +#define CFG_ENABLE_DFS_CHNL_SCAN_MAX ( 2 ) #define CFG_ENABLE_DFS_CHNL_SCAN_DEFAULT ( 1 ) #define CFG_ENABLE_DFS_PNO_CHNL_SCAN_NAME "gEnableDFSPnoChnlScan" @@ -1503,6 +1524,19 @@ typedef enum #define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MAX ( 900 ) #define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_DEFAULT ( 200 ) +/* RPS configurations */ +#define CFG_RPS_CPU_MAP_MIN (0) +#define CFG_RPS_CPU_MAP_MAX (0xff) + +#define CFG_RPS_CPU_MAP_NAME "rps_mask" +#define CFG_RPS_CPU_MAP_DEFAULT (0x00) + +#define CFG_MULTICAST_HOST_FW_MSGS "gMulticastHostMsgs" +#define CFG_MULTICAST_HOST_FW_MSGS_MIN (0) +#define CFG_MULTICAST_HOST_FW_MSGS_MAX (1) +#define CFG_MULTICAST_HOST_FW_MSGS_DEFAULT (1) + + /* In cfg.dat 1=1MBPS, 2=2MBPS, 3=5_5MBPS, 4=11MBPS, 5=6MBPS, 6=9MBPS, * 7=12MBPS, 8=18MBPS, 9=24MBPS. But 6=9MBPS and 8=18MBPS are not basic * 11g rates and should not be set by gDefaultRateIndex24Ghz. So instead @@ -1520,6 +1554,16 @@ typedef enum #define CFG_DEFAULT_RATE_INDEX_24GH_MAX ( 7 ) #define CFG_DEFAULT_RATE_INDEX_24GH_DEFAULT ( 1 ) + +/* + * This INI item is used to control subsystem restart(SSR) test framework + * Set its value to 1 to enable APPS trigerred SSR testing + */ +#define CFG_ENABLE_CRASH_INJECT "gEnableForceTargetAssert" +#define CFG_ENABLE_CRASH_INJECT_MIN (0) +#define CFG_ENABLE_CRASH_INJECT_MAX (1) +#define CFG_ENABLE_CRASH_INJECT_DEFAULT (0) + static __inline tANI_U32 defHddRateToDefCfgRate( tANI_U32 defRateIndex ) { switch(defRateIndex){ @@ -1741,7 +1785,7 @@ static __inline tANI_U32 defHddRateToDefCfgRate( tANI_U32 defRateIndex ) #define CFG_THERMAL_MIGRATION_ENABLE_NAME "gThermalMitigationEnable" #define CFG_THERMAL_MIGRATION_ENABLE_MIN ( 0 ) #define CFG_THERMAL_MIGRATION_ENABLE_MAX ( 1 ) -#define CFG_THERMAL_MIGRATION_ENABLE_DEFAULT ( 0 ) +#define CFG_THERMAL_MIGRATION_ENABLE_DEFAULT ( 1 ) /* * Enable/Disable Modulated DTIM feature @@ -1875,17 +1919,29 @@ static __inline tANI_U32 defHddRateToDefCfgRate( tANI_U32 defRateIndex ) #define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE "gEnableTDLSOffChannel" #define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MIN (0) #define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MAX (1) -#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_DEFAULT (0) +#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_DEFAULT (1) #define CFG_TDLS_WMM_MODE_ENABLE "gEnableTDLSWmmMode" #define CFG_TDLS_WMM_MODE_ENABLE_MIN (0) #define CFG_TDLS_WMM_MODE_ENABLE_MAX (1) -#define CFG_TDLS_WMM_MODE_ENABLE_DEFAULT (0) +#define CFG_TDLS_WMM_MODE_ENABLE_DEFAULT (1) #define CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE "gEnableTDLSScanCoexistence" #define CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_MIN (0) #define CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_MAX (1) #define CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_DEFAULT (0) + + +/* if gEnableTDLSScan + * 0: Same as gEnableTDLSScanCoexistence ; driver will do disconnect if + * Peer is not buffer STA capable. + * 1: Dut will scan in all cases. + * 2: If peer is not buffer STA capable, use CTS2self to do scan. +*/ +#define CFG_TDLS_SCAN_ENABLE "gEnableTDLSScan" +#define CFG_TDLS_SCAN_ENABLE_MIN (0) +#define CFG_TDLS_SCAN_ENABLE_MAX (2) +#define CFG_TDLS_SCAN_ENABLE_DEFAULT (0) #endif #ifdef WLAN_FEATURE_LINK_LAYER_STATS @@ -1962,7 +2018,7 @@ static __inline tANI_U32 defHddRateToDefCfgRate( tANI_U32 defRateIndex ) #define CFG_VHT_AMPDU_LEN_EXP_NAME "gVhtMaxAmpduLenExp" #define CFG_VHT_AMPDU_LEN_EXP_MIN ( 0 ) #define CFG_VHT_AMPDU_LEN_EXP_MAX ( 7 ) -#define CFG_VHT_AMPDU_LEN_EXP_DEFAULT ( 3 ) +#define CFG_VHT_AMPDU_LEN_EXP_DEFAULT ( 7 ) #endif @@ -2141,20 +2197,20 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ */ #define CFG_ASD_PROBE_INTERVAL_NAME "gAsdProbeInterval" #define CFG_ASD_PROBE_INTERVAL_DEFAULT (50) -#define CFG_ASD_PROBE_INTERVAL_MIN (10) -#define CFG_ASD_PROBE_INTERVAL_MAX (100) +#define CFG_ASD_PROBE_INTERVAL_MIN (1) +#define CFG_ASD_PROBE_INTERVAL_MAX (500) /* RSSI Threshold used to trigger probing activity/selection process*/ #define CFG_ASD_TRIGGER_THRESHOLD_NAME "gAsdTriggerThreshold" -#define CFG_ASD_TRIGGER_THRESHOLD_DEFAULT (-75) -#define CFG_ASD_TRIGGER_THRESHOLD_MIN (-120) -#define CFG_ASD_TRIGGER_THRESHOLD_MAX (0) +#define CFG_ASD_TRIGGER_THRESHOLD_DEFAULT (-60) +#define CFG_ASD_TRIGGER_THRESHOLD_MIN (-100) +#define CFG_ASD_TRIGGER_THRESHOLD_MAX (-10) /*RSSI Hysteresis Threshold for RSSI-RTT*/ #define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_NAME "gAsdRTTRssiHystThreshold" -#define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_DEFAULT (50) +#define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_DEFAULT (3) #define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_MIN (0) -#define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_MAX (100) +#define CFG_ASD_RTT_RSSI_HYST_THRESHOLD_MAX (5) //Enable debug for remain on channel issues #define CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_NAME "gDebugP2pRemainOnChannel" @@ -2167,7 +2223,21 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_CTS2S_DURING_BTC_SCO_MIN WNI_CFG_BTC_CTS2S_DURING_SCO_STAMIN #define CFG_CTS2S_DURING_BTC_SCO_MAX WNI_CFG_BTC_CTS2S_DURING_SCO_STAMAX +#define CFG_BTC_FAST_WLAN_CONN_PREF "gBtcFastWlanConnPref" +#define CFG_BTC_FAST_WLAN_CONN_PREF_DEFAULT ( 1 ) +#define CFG_BTC_FAST_WLAN_CONN_PREF_MIN ( 0 ) +#define CFG_BTC_FAST_WLAN_CONN_PREF_MAX ( 5 ) + +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN "gBtcStaticOppWlanIdleWlanLen" +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_DEFAULT ( 40000 ) +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MIN ( 0 ) +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MAX ( 250000 ) + +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN "gBtcStaticOppWlanIdleBtLen" +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_DEFAULT ( 40000 ) +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MIN ( 0 ) +#define CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MAX ( 250000 ) /* * Connection related log Enable/Disable. * 0x1 - Enable mgmt pkt logs (no probe req/rsp). @@ -2203,7 +2273,7 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_ROAMING_DFS_CHANNEL_NAME "gAllowDFSChannelRoam" #define CFG_ROAMING_DFS_CHANNEL_MIN (0) #define CFG_ROAMING_DFS_CHANNEL_MAX (1) -#define CFG_ROAMING_DFS_CHANNEL_DEFAULT (0) +#define CFG_ROAMING_DFS_CHANNEL_DEFAULT (1) #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE @@ -2226,6 +2296,16 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_WLAN_LOGGING_NUM_BUF_DEFAULT ( 32 ) #endif //WLAN_LOGGING_SOCK_SVC_ENABLE +#define CFG_IGNORE_PEER_ERP_INFO_NAME "gIgnorePeerErpInfo" +#define CFG_IGNORE_PEER_ERP_INFO_MIN ( 0 ) +#define CFG_IGNORE_PEER_ERP_INFO_MAX ( 1 ) +#define CFG_IGNORE_PEER_ERP_INFO_DEFAULT ( 0 ) + +#define CFG_IGNORE_PEER_HT_MODE_NAME "gIgnorePeerHTopMode" +#define CFG_IGNORE_PEER_HT_MODE_MIN ( 0 ) +#define CFG_IGNORE_PEER_HT_MODE_MAX ( 1 ) +#define CFG_IGNORE_PEER_HT_MODE_DEFAULT ( 0 ) + #define CFG_INITIAL_DWELL_TIME_NAME "gInitialDwellTime" #define CFG_INITIAL_DWELL_TIME_DEFAULT (0) #define CFG_INITIAL_DWELL_TIME_MIN (0) @@ -2281,11 +2361,58 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_MAX (1) #define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_DEFAULT (0) +/* gEnableMacAddrSpoof = 0 => disable mac spoofing + = 1 => enable mac spoofing in both HOST and FW + = 2 => enable mac spoofing in FW and + disable mac spoofing in HOST + */ #define CFG_ENABLE_MAC_ADDR_SPOOFING "gEnableMacAddrSpoof" #define CFG_ENABLE_MAC_ADDR_SPOOFING_MIN (0) -#define CFG_ENABLE_MAC_ADDR_SPOOFING_MAX (1) +#define CFG_ENABLE_MAC_ADDR_SPOOFING_MAX (2) #define CFG_ENABLE_MAC_ADDR_SPOOFING_DEFAULT (0) +/* Disable Mac Spoof for p2p Scan */ +#define CFG_DISABLE_P2P_MAC_ADDR_SPOOFING "gDisableP2PMacAddrSpoof" +#define CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_MIN (0) +#define CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_MAX (1) +#define CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_DEFAULT (0) + + +#define CFG_ENABLE_MGMT_LOGGING "gEnableMgmtLogging" +#define CFG_ENABLE_MGMT_LOGGING_MIN (0) +#define CFG_ENABLE_MGMT_LOGGING_MAX (1) +#define CFG_ENABLE_MGMT_LOGGING_DEFAULT (0) + +#define CFG_ENABLE_BMUHW_TRACING "gEnableBMUHWtracing" +#define CFG_ENABLE_BMUHW_TRACING_MIN (0) +#define CFG_ENABLE_BMUHW_TRACING_MAX (1) +#define CFG_ENABLE_BMUHW_TRACING_DEFAULT (1) + +#define CFG_ENABLE_FW_LOGGING "gEnableFWLogging" +#define CFG_ENABLE_FW_LOGGING_MIN (0) +#define CFG_ENABLE_FW_LOGGING_MAX (1) +#define CFG_ENABLE_FW_LOGGING_DEFAULT (1) + +// firmware will wakeup the host to send logs always +#define CFG_ENABLE_FW_CONTINIOUS_LOGGING "gEnableContFWLogging" +#define CFG_ENABLE_FW_CONTINIOUS_LOGGING_MIN (0) +#define CFG_ENABLE_FW_CONTINIOUS_LOGGING_MAX (1) +#define CFG_ENABLE_FW_CONTINIOUS_LOGGING_DEFAULT (0) + +/* when firmware log reaches this threshold and + * if host is awake it will push the logs. + */ +#define CFG_MIN_LOGGING_BUFFER_SIZE "gMinLoggingBufferSize" +#define CFG_MIN_LOGGING_BUFFER_SIZE_MIN (0) +#define CFG_MIN_LOGGING_BUFFER_SIZE_MAX (6) +#define CFG_MIN_LOGGING_BUFFER_SIZE_DEFAULT (1) + +// Max ring size in firmware to log msgs when host is suspended state +#define CFG_MAX_LOGGING_BUFFER_SIZE "gMaxLoggingBufferSize" +#define CFG_MAX_LOGGING_BUFFER_SIZE_MIN (0) +#define CFG_MAX_LOGGING_BUFFER_SIZE_MAX (6) +#define CFG_MAX_LOGGING_BUFFER_SIZE_DEFAULT (6) + #define CFG_ENABLE_CH_AVOID "gEnableChannelAvoidance" #define CFG_ENABLE_CH_AVOID_MIN ( 0 ) #define CFG_ENABLE_CH_AVOID_MAX ( 1 ) @@ -2296,6 +2423,13 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_MAX_CONCURRENT_CONNECTIONS_MIN ( 1 ) #define CFG_MAX_CONCURRENT_CONNECTIONS_MAX ( 4 ) +#ifdef WLAN_FEATURE_AP_HT40_24G +#define CFG_ENABLE_HT_2040_COEX "gApHT4024G" +#define CFG_ENABLE_HT_2040_COEX_MIN ( 0 ) +#define CFG_ENABLE_HT_2040_COEX_MAX ( 1 ) +#define CFG_ENABLE_HT_2040_COEX_DEFAULT ( 0 ) +#endif + //Enable Dynamic WMM PS support #define CFG_ENABLE_DYNAMIC_WMMPS_NAME "gEnableDynamicWMMPS" #define CFG_ENABLE_DYNAMIC_WMM_PS_MIN (0) @@ -2370,20 +2504,72 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_MAX_UAPSD_INACT_INTVL_MAX (255) #define CFG_MAX_UAPSD_INACT_INTVL_DEFAULT (10) -/* - * This will enable DHCP packet logging for debugging purpose - * The log level is set as INFO. - */ -#define CFG_DEBUG_DHCP "gEnableDhcpDebug" -#define CFG_DEBUG_DHCP_DISABLE ( 0 ) -#define CFG_DEBUG_DHCP_ENABLE ( 1 ) -#define CFG_DEBUG_DHCP_DEFAULT ( CFG_DEBUG_DHCP_DISABLE ) - #define CFG_BURST_MODE_BE_TXOP_VALUE "gBurstModeTXOPValue" #define CFG_BURST_MODE_BE_TXOP_VALUE_MIN ( 0 ) #define CFG_BURST_MODE_BE_TXOP_VALUE_MAX ( 12288 ) #define CFG_BURST_MODE_BE_TXOP_VALUE_DEFAULT ( 0 ) +#define CFG_P2P_LISTEN_DEFER_INTERVAL_NAME "gP2PListenDeferInterval" +#define CFG_P2P_LISTEN_DEFER_INTERVAL_MIN ( 100 ) +#define CFG_P2P_LISTEN_DEFER_INTERVAL_MAX ( 200 ) +#define CFG_P2P_LISTEN_DEFER_INTERVAL_DEFAULT ( 100 ) + +#define CFG_BTC_ENABLE_IND_TIMER_VALUE "gBtcEnableIndTimerVal" +#define CFG_BTC_ENABLE_IND_TIMER_VALUE_MIN ( 5 ) +#define CFG_BTC_ENABLE_IND_TIMER_VALUE_MAX ( 60 ) +#define CFG_BTC_ENABLE_IND_TIMER_VALUE_DEFAULT ( 60 ) + +#define CFG_DXE_REPLENISH_RX_TIMER_VALUE "gDXEReplenishRXTimerVal" +#define CFG_DXE_REPLENISH_RX_TIMER_VALUE_MIN ( 0 ) +#define CFG_DXE_REPLENISH_RX_TIMER_VALUE_MAX ( 20000 ) +#define CFG_DXE_REPLENISH_RX_TIMER_VALUE_DEFAULT ( 6000 ) + +#define CFG_DXE_SSR_ENABLE "gDxeSSREnable" +#define CFG_DXE_SSR_ENABLE_DEFAULT ( 1 ) +#define CFG_DXE_SSR_ENABLE_MIN ( 0 ) +#define CFG_DXE_SSR_ENABLE_MAX ( 1 ) + +#define CFG_TOGGLE_ARP_BDRATES_NAME "gToggleArpBDRates" +#define CFG_TOGGLE_ARP_BDRATES_MIN 0 +#define CFG_TOGGLE_ARP_BDRATES_MAX 2 +#define CFG_TOGGLE_ARP_BDRATES_DEFAULT 0 + +/* + * If within gLinkFailTimeout period(values is mentioned in msec) if FW + * doesn't receive acks for gLinkFailTxCnt number of packets, then link will + * be disconnected. + */ + +#define CFG_LINK_FAIL_TIMEOUT_NAME "gLinkFailTimeout" +#define CFG_LINK_FAIL_TIMEOUT_MIN ( 1000 ) +#define CFG_LINK_FAIL_TIMEOUT_MAX ( 60000 ) +#define CFG_LINK_FAIL_TIMEOUT_DEF ( 6000 ) + +#define CFG_LINK_FAIL_TX_CNT_NAME "gLinkFailTxCnt" +#define CFG_LINK_FAIL_TX_CNT_MIN ( 50 ) +#define CFG_LINK_FAIL_TX_CNT_MAX ( 1000 ) +#define CFG_LINK_FAIL_TX_CNT_DEF ( 200 ) + +#define CFG_OPTIMIZE_CA_EVENT_NAME "gOptimizeCAevent" +#define CFG_OPTIMIZE_CA_EVENT_DISABLE ( 0 ) +#define CFG_OPTIMIZE_CA_EVENT_ENABLE ( 1 ) +#define CFG_OPTIMIZE_CA_EVENT_DEFAULT ( 0 ) + +/* + * BOffsetCorrectionEnable : This ini will control enabling/disabling + * of rate dependent power offsets in firmware + */ + +#define CFG_SAR_BOFFSET_SET_CORRECTION_NAME "gBOffsetCorrectionEnable" +#define CFG_SAR_BOFFSET_SET_CORRECTION_MIN (0) +#define CFG_SAR_BOFFSET_SET_CORRECTION_MAX (1) +#define CFG_SAR_BOFFSET_SET_CORRECTION_DEFAULT (0) + +#define CFG_MAXCHAN_FOR_CHANTIME_CORR_NAME "gMaxChannelForMoreDwellTime" +#define CFG_MAXCHAN_FOR_CHANTIME_CORR_MIN (0) +#define CFG_MAXCHAN_FOR_CHANTIME_CORR_MAX (35) +#define CFG_MAXCHAN_FOR_CHANTIME_CORR_DEFAULT (10) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -2515,6 +2701,7 @@ typedef struct v_BOOL_t fFTResourceReqSupported; #endif + v_BOOL_t gEnableRoamDelayStats; #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING v_U16_t nNeighborScanPeriod; v_U8_t nNeighborReassocRssiThreshold; @@ -2755,6 +2942,7 @@ typedef struct v_U32_t fEnableTDLSOffChannel; v_U32_t fEnableTDLSWmmMode; v_BOOL_t fEnableTDLSScanCoexSupport; + v_BOOL_t fEnableTDLSScan; #endif #ifdef WLAN_FEATURE_LINK_LAYER_STATS v_BOOL_t fEnableLLStats; @@ -2831,7 +3019,7 @@ typedef struct v_BOOL_t gEnableStrictRegulatoryForFCC; v_BOOL_t advertiseConcurrentOperation; v_U32_t defaultRateIndex24Ghz; - eHddDot11Mode sapDot11Mode; + v_BOOL_t sapEnable11AC; v_BOOL_t cfgRAFilterEnable; v_U16_t cfgRARateLimitInterval; v_U8_t allowDFSChannelRoam; @@ -2842,7 +3030,7 @@ typedef struct v_U32_t wlanLoggingFEToConsole; v_U32_t wlanLoggingNumBuf; #endif - + v_BOOL_t ignorePeerErpInfo; v_BOOL_t initialScanSkipDFSCh; v_U32_t cfgBtcFatalHidnSniffBlkGuidance; v_U32_t cfgBtcCriticalHidnSniffBlkGuidance; @@ -2855,7 +3043,14 @@ typedef struct #endif v_U32_t deferImpsTime; v_BOOL_t sendDeauthBeforeCon; - v_BOOL_t enableMacSpoofing; + v_U8_t enableMacSpoofing; + v_BOOL_t disableP2PMacSpoofing; + v_BOOL_t enableMgmtLogging; + v_BOOL_t enableBMUHWtracing; + v_BOOL_t enableFWLogging; + v_BOOL_t enableContFWLogging; + v_U8_t minLoggingBufferSize; + v_U8_t maxLoggingBufferSize; v_BOOL_t fenableCHAvoidance; v_U8_t gMaxConcurrentActiveSessions; @@ -2867,12 +3062,34 @@ typedef struct v_U32_t uapsdConsecTxCntMeasWindow; v_U32_t maxPsPollInWmmUapsdMode; v_U32_t maxUapsdInactivityIntervals; - v_U8_t enableDhcpDebug; /* Enable/Disable dhcp debug */ v_U32_t burstModeTXOPValue; v_U8_t acsScanBandPreference; v_U16_t acsBandSwitchThreshold; v_U32_t enableDynamicRAStartRate; + v_U32_t enableRtsCtsHtVht; +#ifdef WLAN_FEATURE_AP_HT40_24G + v_BOOL_t apHT40_24GEnabled; +#endif + v_U16_t gP2PListenDeferInterval; + v_U8_t btcEnableIndTimerVal; + v_U8_t btcFastWlanConnPref; + v_U32_t dxeReplenishRXTimerVal; + v_U32_t dxeSSREnable; + v_U8_t multicast_host_msgs; + v_BOOL_t toggleArpBDRates; + v_U32_t btcStaticOppWlanIdleWlanLen; + v_U32_t btcStaticOppWlanIdleBtLen; + v_U32_t linkFailTimeout; + v_U32_t linkFailTxCnt; + v_BOOL_t ignorePeerHTopMode; + v_U8_t gOptimizeCAevent; + v_BOOL_t crash_inject_enabled; + v_U16_t rps_mask; + v_U8_t boffset_correction_enable; + v_BOOL_t disableBarWakeUp; + v_U8_t max_chan_for_dwell_time_cfg; } hdd_config_t; + /*--------------------------------------------------------------------------- Function declarations and documenation -------------------------------------------------------------------------*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h index b8fd5b43f291..a2869a6ebd18 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -163,7 +163,8 @@ enum qca_nl80211_vendor_subcmds { /* Set nodfs_flag */ QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40, /* Get Concurrency Matrix */ - QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42 + QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42, + QCA_NL80211_VENDOR_SUBCMD_SETBAND = 105, }; enum qca_nl80211_vendor_subcmds_index { @@ -192,6 +193,7 @@ enum qca_nl80211_vendor_subcmds_index { QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE_INDEX, /*EXT TDLS*/ QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX, + QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX, }; enum qca_wlan_vendor_attr @@ -209,6 +211,8 @@ enum qca_wlan_vendor_attr * by enum qca_roaming_policy. */ QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5, QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6, + /* Unsigned 32-bit value from enum qca_set_band. */ + QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE = 12, /* keep last */ QCA_WLAN_VENDOR_ATTR_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1, @@ -319,6 +323,28 @@ enum qca_wlan_vendor_attr_ll_stats_clr QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST - 1, }; +/** + * enum qca_wlan_vendor_attr_ll_stats_results_type - ll stats result type + * + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_INVALID: Initial invalid value + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO: Link layer stats type radio + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE: Link layer stats type interface + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER: Link layer stats type peer + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST: Last value + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_MAX: Max value + */ +enum qca_wlan_vendor_attr_ll_stats_results_type { + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_INVALID = 0, + + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO = 1, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER, + + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_MAX = + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST - 1 +}; + enum qca_wlan_vendor_attr_ll_stats_results { QCA_WLAN_VENDOR_ATTR_LL_STATS_INVALID = 0, @@ -545,6 +571,21 @@ enum qca_wlan_vendor_attr_ll_stats_results */ QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA, + /* Unsigned 64bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME, + + /* Unsigned 32bit value to indicate ll stats result type */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE, + /* keep last */ QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX = @@ -858,6 +899,8 @@ enum qca_wlan_vendor_attr_get_concurrency_matrix { #define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */ #define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA Concurrency */ +#define WIFI_FEATURE_LINK_LAYER_STATS 0x10000 /* Link layer stats */ + /* Add more features here */ enum qca_wlan_vendor_attr_set_no_dfs_flag { @@ -879,7 +922,7 @@ enum qca_wlan_vendor_attr_set_no_dfs_flag #ifdef FEATURE_WLAN_CH_AVOID -#define HDD_MAX_AVOID_FREQ_RANGES 4 +#define HDD_MAX_AVOID_FREQ_RANGES 15 typedef struct sHddAvoidFreqRange { u32 startFreq; @@ -916,7 +959,7 @@ VOS_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t *pAdapter, #ifdef FEATURE_WLAN_WAPI void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t* pAdapter, - u8 key_index, const u8 *mac_addr, u8 *key , int key_Len); + u8 key_index, const u8 *mac_addr, const u8 *key , int key_Len); #endif struct wiphy *wlan_hdd_cfg80211_wiphy_alloc(int priv_size); @@ -965,6 +1008,13 @@ extern void wlan_hdd_cfg80211_update_replayCounterCallback(void *callbackContext void* wlan_hdd_change_country_code_cb(void *pAdapter); void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel); +v_U8_t* wlan_hdd_cfg80211_get_ie_ptr( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_U8_t *pIes, +#else + v_U8_t *pIes, +#endif + int length, v_U8_t eid); #ifdef FEATURE_WLAN_CH_AVOID int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, @@ -976,4 +1026,20 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, void *pMsg); #endif /* WLAN_FEATURE_EXTSCAN */ +void wlan_hdd_cfg80211_nan_init(hdd_context_t *pHddCtx); + +#if !(defined (SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC)) +static inline struct sk_buff * +backported_cfg80211_vendor_event_alloc(struct wiphy *wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + struct wireless_dev *wdev, +#endif + int approxlen, + int event_idx, gfp_t gfp) +{ + return cfg80211_vendor_event_alloc(wiphy, approxlen, event_idx, gfp); +} +#define cfg80211_vendor_event_alloc backported_cfg80211_vendor_event_alloc +#endif + #endif diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_dp_utils.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_dp_utils.h index ac48abdfd6a4..fb1ce32dbcc9 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_dp_utils.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_dp_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -63,6 +63,7 @@ typedef struct hdd_list_s hdd_list_node_t anchor; v_SIZE_t count; v_SIZE_t max_size; + int ratelimit_count; spinlock_t lock; } hdd_list_t; diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ether.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ether.h index 5b2c48e4faf9..1ea13c75fcf8 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ether.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ether.h @@ -32,9 +32,6 @@ This module describes Ethernet packet formats for processing by HDD. - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /* $Header$ */ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ftm.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ftm.h index a2f56424c364..a28f17824dcf 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ftm.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_ftm.h @@ -145,6 +145,7 @@ typedef enum { WLAN_FTM_INITIALIZED, WLAN_FTM_STOPPED, WLAN_FTM_STARTED, + WLAN_FTM_STARTING, } wlan_hdd_ftm_state; typedef struct wlan_hdd_ftm_status_s { @@ -166,6 +167,7 @@ typedef struct wlan_hdd_ftm_status_s v_U8_t *targetNVTablePointer; v_U32_t processedNVTableSize; v_U8_t *tempNVTableBuffer; + struct completion startCmpVar; } wlan_hdd_ftm_status_t; typedef struct ftm_msg_s diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_host_offload.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_host_offload.h index 4e1df0df2d23..4eb11765eebb 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_host_offload.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_host_offload.h @@ -34,8 +34,6 @@ \brief Android WLAN HDD Host Offload API - Copyright 2011 (c) QUALCOMM Incorporated. All Rights Reserved. - QUALCOMM Proprietary and Confidential. ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_hostapd.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_hostapd.h index 371725776739..0e1692327688 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_hostapd.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_hostapd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,8 +33,6 @@ \file WLAN_HDD_HOSTAPD_H.h \brief Linux HDD HOSTAPD include file - Copyright 2008-2013 (c) Qualcomm, Incorporated. - All Rights Reserved. ==========================================================================*/ /*--------------------------------------------------------------------------- @@ -60,7 +58,7 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd VOS_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held); -VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter); +VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held); eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4]); diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_includes.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_includes.h index efe3fe4d08cb..e8d38031eb4c 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_includes.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_includes.h @@ -34,9 +34,6 @@ \brief Internal includes for the Linux HDD - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_keep_alive.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_keep_alive.h index 5e05f5f274d3..a3aff13c9558 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_keep_alive.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_keep_alive.h @@ -34,8 +34,6 @@ \brief Android WLAN HDD Keep-Alive API - Copyright 2011 (c) QUALCOMM Incorporated. All Rights Reserved. - QUALCOMM Proprietary and Confidential. ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h index c61cb08ee10d..fad2a6242a2d 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,9 +35,6 @@ \file WLAN_HDD_MAIN_H.h \brief Linux HDD Adapter Type - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ @@ -72,8 +69,11 @@ /** Number of attempts to detect/remove card */ #define LIBRA_CARD_INSERT_DETECT_MAX_COUNT 5 #define LIBRA_CARD_REMOVE_DETECT_MAX_COUNT 5 -/** Number of Tx Queues */ -#define NUM_TX_QUEUES 4 + +/** Number of Tx Queues. This should be same as the one + * used in TL WLANTL_NUM_TX_QUEUES */ +#define NUM_TX_QUEUES 5 + /** HDD's internal Tx Queue Length. Needs to be a power of 2 */ #define HDD_TX_QUEUE_MAX_LEN 128 /** HDD internal Tx Queue Low Watermark. Net Device TX queue is disabled @@ -101,11 +101,13 @@ #define TDLS_INIT_DONE (6) /** Maximum time(ms)to wait for disconnect to complete **/ -#define WLAN_WAIT_TIME_DISCONNECT 2000 +#define WLAN_WAIT_TIME_DISCONNECT 5000 #define WLAN_WAIT_TIME_STATS 800 #define WLAN_WAIT_TIME_POWER 800 #define WLAN_WAIT_TIME_COUNTRY 1000 #define WLAN_WAIT_TIME_CHANNEL_UPDATE 600 +#define FW_STATE_WAIT_TIME 500 +#define FW_STATE_RSP_LEN 100 /* Amount of time to wait for sme close session callback. This value should be larger than the timeout used by WDI to wait for a response from WCNSS */ @@ -134,6 +136,7 @@ #define CRDA_WAIT_TIME 300 #endif +#define WAIT_TIME_FW_LOGS 2000 /* Scan Req Timeout */ #define WLAN_WAIT_TIME_SCAN_REQ 100 @@ -231,6 +234,9 @@ typedef v_U8_t tWlanHddMacAddr[HDD_MAC_ADDR_LEN]; #define MIN(a, b) (a > b ? b : a) #endif + +#define HDD_MAX_STA_COUNT (HAL_NUM_STA) + /* * Generic asynchronous request/response support * @@ -270,13 +276,26 @@ struct statsContext unsigned int magic; }; +struct getFrameLogCtx +{ + struct completion completion; + hdd_adapter_t *pAdapter; + unsigned int magic; +}; + extern spinlock_t hdd_context_lock; #define STATS_CONTEXT_MAGIC 0x53544154 //STAT #define RSSI_CONTEXT_MAGIC 0x52535349 //RSSI #define POWER_CONTEXT_MAGIC 0x504F5752 //POWR -#define SNR_CONTEXT_MAGIC 0x534E5200 //SNR #define BCN_MISS_RATE_CONTEXT_MAGIC 0x513F5753 +#define FW_STATS_CONTEXT_MAGIC 0x5022474E //FW STATS +#define GET_FRAME_LOG_MAGIC 0x464c4f47 //FLOG +#define MON_MODE_MSG_MAGIC 0x51436B3A //MON_MODE + +#define MON_MODE_MSG_TIMEOUT 5000 +#define MON_MODE_START 1 +#define MON_MODE_STOP 0 /* * Driver miracast parameters 0-Disabled @@ -641,6 +660,65 @@ typedef enum{ HDD_SSR_DISABLED, }e_hdd_ssr_required; +/*--------------------------------------------------------------------------- + hdd_ibss_peer_info_params_t +---------------------------------------------------------------------------*/ +typedef struct +{ + v_U8_t staIdx; //StaIdx + v_U32_t txRate; //Current Tx Rate + v_U32_t mcsIndex; //MCS Index + v_U32_t txRateFlags; //TxRate Flags + v_S7_t rssi; //RSSI +}hdd_ibss_peer_info_params_t; + +typedef struct { + /** The station entry is used or not */ + v_BOOL_t isUsed; + + /** Station ID reported back from HAL. Broadcast + * uses station ID zero by default. */ + v_U8_t ucSTAId; + + /** MAC address of the station */ + v_MACADDR_t macAddrSTA; + + /** Current Station state so HDD knows how to deal with packet + * queue. Most recent states used to change TL STA state. */ + WLANTL_STAStateType tlSTAState; + + /** Transmit queues for each AC (VO,VI,BE etc). */ + hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; + + /** Might need to differentiate queue depth in contention case */ + v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; + + /**Track whether OS TX queue has been disabled.*/ + v_BOOL_t txSuspended[NUM_TX_QUEUES]; + + /** Track QoS status of station */ + v_BOOL_t isQosEnabled; + + /** The station entry for which Deauth is in progress */ + v_BOOL_t isDeauthInProgress; + +} hdd_ibss_station_info_t; + +typedef struct +{ + /** Request status */ + v_U32_t status; + + /** Number of peers */ + v_U8_t numIBSSPeers; + + /* IBSS Station table */ + hdd_ibss_station_info_t ibssStaInfo[HDD_MAX_NUM_IBSS_STA]; + + /** Peer Info parameters */ + hdd_ibss_peer_info_params_t ibssPeerList[HDD_MAX_NUM_IBSS_STA]; +}hdd_ibss_peer_info_t; + struct hdd_station_ctx { /** Handle to the Wireless Extension State */ @@ -669,6 +747,8 @@ struct hdd_station_ctx /*Save the wep/wpa-none keys*/ tCsrRoamSetKey ibss_enc_key; + hdd_ibss_peer_info_t ibss_peer_info; + v_BOOL_t hdd_ReassocScenario; }; @@ -731,9 +811,28 @@ struct hdd_ap_ctx_s beacon_data_t *beacon; }; +#define NUM_FILTERS_SUPPORTED 1 +struct filter +{ + v_MACADDR_t macAddr; + v_BOOL_t isA1filter; + v_BOOL_t isA2filter; + v_BOOL_t isA3filter; +}; + struct hdd_mon_ctx_s { - hdd_adapter_t *pAdapterForTx; + /* start or stop */ + v_BOOL_t state; + /*Conversion of packet required or not*/ + v_BOOL_t is80211to803ConReq; + v_U32_t ChannelNo; + v_U32_t ChannelBW; + v_BOOL_t crcCheckEnabled; + v_U8_t numOfMacFilters; + struct filter mmFilters[NUM_FILTERS_SUPPORTED]; + v_U64_t typeSubtypeBitmap; + v_U64_t rsvd; }; typedef struct hdd_scaninfo_s @@ -833,6 +932,12 @@ typedef enum #endif +typedef struct +{ + struct completion completion; + tANI_U32 magic; + hdd_adapter_t *pAdapter; +}fwStatsContext_t; #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN" @@ -962,12 +1067,22 @@ struct hdd_adapter_s #endif v_S7_t rssi; + v_S7_t rssi_on_disconnect; tANI_U8 snr; struct work_struct monTxWorkQueue; struct sk_buff *skb_to_tx; + /* sta_id to mac addr hash*/ + spinlock_t sta_hash_lock; + tANI_U8 is_sta_id_hash_initialized; + struct sta_hash{ + tANI_U16 mask; + tANI_U16 idx_bits; + hdd_list_t *bins; + } sta_id_hash; + union { hdd_station_ctx_t station; hdd_ap_ctx_t ap; @@ -1031,12 +1146,23 @@ struct hdd_adapter_s v_BOOL_t isLinkLayerStatsSet; #endif /* DSCP to UP QoS Mapping */ - sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP+1]; + sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_MAX_DSCP+1]; /* Lock for active sessions while processing deauth/Disassoc */ spinlock_t lock_for_active_session; + tSirFwStatsResult fwStatsRsp; + + /* Time stamp for last completed RoC request */ + v_TIME_t lastRocTs; + + /* work queue to defer the back to back p2p_listen */ + struct delayed_work roc_work; + + /* Time stamp for start RoC request */ + v_TIME_t startRocTs; }; #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) +#define WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.monitor) #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx) @@ -1082,9 +1208,29 @@ typedef struct typedef struct { - v_MACADDR_t randomMacAddr; + v_MACADDR_t randomMacAddr; + v_U8_t isReqDeferred; + v_U8_t isEnabled; + struct mutex macSpoofingLock; }macAddrSpoof_t; +#define WLAN_WAIT_TIME_LL_STATS 5000 + +#ifdef WLAN_FEATURE_LINK_LAYER_STATS +/** + * struct hdd_ll_stats_context - hdd link layer stats context + * + * @request_id: userspace-assigned link layer stats request id + * @request_bitmap: userspace-assigned link layer stats request bitmap + * @response_event: LL stats request wait event + */ +struct hdd_ll_stats_context { + uint32_t request_id; + uint32_t request_bitmap; + struct completion response_event; +}; +#endif /* End of WLAN_FEATURE_LINK_LAYER_STATS */ + /** Adapter stucture definition */ struct hdd_context_s @@ -1143,7 +1289,6 @@ struct hdd_context_s #else struct completion driver_crda_req; #endif - /* Completion variable to indicate updation of channel */ struct completion wiphy_channel_update_event; @@ -1211,10 +1356,8 @@ struct hdd_context_s /* Thermal mitigation information */ hdd_thermal_mitigation_info_t tmInfo; -#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - struct wake_lock rx_wake_lock; -#endif + vos_wake_lock_t rx_wake_lock; #endif /* @@ -1233,11 +1376,7 @@ struct hdd_context_s /*is_dyanmic_channel_range_set is set to 1 when Softap_set_channel_range is invoked*/ v_BOOL_t is_dynamic_channel_range_set; - -#ifdef WLAN_OPEN_SOURCE - struct wake_lock sap_wake_lock; -#endif - + vos_wake_lock_t sap_wake_lock; #ifdef FEATURE_WLAN_TDLS eTDLSSupportMode tdls_mode; eTDLSSupportMode tdls_mode_last; @@ -1247,6 +1386,7 @@ struct hdd_context_s tdls_scan_context_t tdls_scan_ctxt; /* Lock to avoid race condition during TDLS operations*/ struct mutex tdls_lock; + v_BOOL_t is_tdls_btc_enabled; #endif hdd_traffic_monitor_t traffic_monitor; @@ -1308,6 +1448,15 @@ struct hdd_context_s * IP */ struct notifier_block ipv4_notifier; + //Lock to avoid race condition during wmm operations + struct mutex wmmLock; + v_BOOL_t mgmt_frame_logging; + v_BOOL_t isSetBandByNL; +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + struct hdd_ll_stats_context ll_stats_context; +#endif /* End of WLAN_FEATURE_LINK_LAYER_STATS */ + unsigned long last_suspend_success; + v_U32_t continuous_suspend_fail_cnt; }; @@ -1320,6 +1469,47 @@ struct hdd_context_s #define WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx) \ (pHddCtx->isLoadUnloadInProgress & \ (WLAN_HDD_LOAD_IN_PROGRESS | WLAN_HDD_UNLOAD_IN_PROGRESS)) + +/* Logging of both Mgmt and Data pkts are supported by HW in both TX & RX. + * But only support for logging of Mgmt pkts is supported from host driver. + */ +typedef enum +{ + WLAN_FRAME_LOGGING_FRAMETYPE_DATA, + WLAN_FRAME_LOGGING_FRAMETYPE_MGMT, +} WLAN_FRAME_LOGGING_FRAMETYPE; + +// Only first 64/128 bytes of Mgmt/Data pkts can be logged. +typedef enum +{ + WLAN_MGMT_LOGGING_FRAMESIZE_64BYTES = 64, + WLAN_MGMT_LOGGING_FRAMESIZE_128BYTES = 128, +} WLAN_MGMT_LOGGING_FRAMESIZE; + +/* In Circular Mode HW buffer will be filled in circular fashion with buffer + * overwritten when buffer memory is full and new pkt is to be logged. + * Freeze mode will stop filling the buffer memory when buffer is full and thus + * no more pkts will logged unless buffer memory is freed. + */ +typedef enum +{ + WLAN_FRAME_LOGGING_BUFFERMODE_CIRCULAR, + WLAN_FRAME_LOGGING_BUFFERMODE_FREEZE, +} WLAN_FRAME_LOGGING_BUFFERMODE; + +/* WLAN_FRAME_LOG_EN - Enables frame logging in HW + * WLAN_BMUHW_TRACE_LOG_EN - 8K/16K memory buffer will be used for logging + * WLAN_QXDM_LOG_EN - FW QXDM logs will be routed through host driver + * WLAN_DPU_TXP_LOG_EN - pkts will be logged at both DPU and TXP HW block. + */ +typedef enum +{ + WLAN_FRAME_LOG_EN = 1<<0, + WLAN_BMUHW_TRACE_LOG_EN = 1<<1, + WLAN_QXDM_LOG_EN = 1<<2, + WLAN_DPU_TXP_LOG_EN = 1<<3, +} WLAN_ENABLE_HW_FW_LOG_TYPE; + /*--------------------------------------------------------------------------- Function declarations and documenation -------------------------------------------------------------------------*/ @@ -1355,17 +1545,22 @@ VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ); void hdd_dump_concurrency_info(hdd_context_t *pHddCtx); hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ); hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr ); +hdd_adapter_t *hdd_get_adapter_by_sme_session_id( hdd_context_t *pHddCtx, + tANI_U32 sme_session_id ); hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ); VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ); hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ); -void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); +void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ); VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, const v_BOOL_t bCloseSession ); void hdd_set_station_ops( struct net_device *pWlanDev ); tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx); void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr); v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ); - +void wlan_hdd_mon_set_typesubtype( hdd_mon_ctx_t *pMonCtx,int type); +void hdd_mon_post_msg_cb(void *context); +VOS_STATUS wlan_hdd_mon_postMsg(void *cookie, hdd_mon_ctx_t *pMonCtx, + void* callback); void hdd_set_conparam ( v_UINT_t newParam ); tVOS_CON_MODE hdd_get_conparam( void ); @@ -1373,9 +1568,10 @@ void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext); v_BOOL_t wlan_hdd_is_GO_power_collapse_allowed(hdd_context_t* pHddCtx); v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx); v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx); -void hdd_abort_mac_scan(hdd_context_t* pHddCtx, tANI_U8 sessionId, - eCsrAbortReason reason); -void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); +tSirAbortScanStatus hdd_abort_mac_scan(hdd_context_t* pHddCtx, + tANI_U8 sessionId, + eCsrAbortReason reason); +VOS_STATUS hdd_processSpoofMacAddrRequest(hdd_context_t *pHddCtx); void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id); @@ -1388,11 +1584,12 @@ void wlan_hdd_incr_active_session(hdd_context_t *pHddCtx, void wlan_hdd_decr_active_session(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter); -void hdd_prevent_suspend(void); -void hdd_allow_suspend(void); -void hdd_prevent_suspend_timeout(v_U32_t timeout); +void hdd_prevent_suspend(uint32_t reason); +void hdd_allow_suspend(uint32_t reason); +void hdd_prevent_suspend_timeout(v_U32_t timeout, uint32_t reason); bool hdd_is_ssr_required(void); void hdd_set_ssr_required(e_hdd_ssr_required value); +void hdd_set_pre_close(hdd_context_t *pHddCtx); VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx); VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type); @@ -1405,8 +1602,10 @@ void hdd_reset_pwrparams(hdd_context_t *pHddCtx); int wlan_hdd_validate_context(hdd_context_t *pHddCtx); v_BOOL_t hdd_is_valid_mac_address(const tANI_U8* pMacAddr); VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); +VOS_STATUS hdd_is_any_session_connected(hdd_context_t *pHddCtx); void hdd_ipv4_notifier_work_queue(struct work_struct *work); -v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx, v_BOOL_t isRoC ); +v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx); +void hdd_set_ibss_ops(hdd_adapter_t *pAdapter); #ifdef WLAN_FEATURE_PACKET_FILTERING int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType, tANI_U8 sessionId); #endif @@ -1470,5 +1669,79 @@ VOS_STATUS wlan_hdd_init_channels_for_cc(hdd_context_t *pHddCtx, driver_load_ty #endif VOS_STATUS wlan_hdd_cancel_remain_on_channel(hdd_context_t *pHddCtx); +hdd_remain_on_chan_ctx_t *hdd_get_remain_on_channel_ctx(hdd_context_t *pHddCtx); + +VOS_STATUS wlan_hdd_handle_dfs_chan_scan(hdd_context_t *pHddCtx, + tANI_U8 dfsScanMode); + +v_U8_t hdd_is_fw_logging_enabled(void); +v_U8_t hdd_is_fw_ev_logging_enabled(void); + +#define HDD_STA_ID_HASH_MULTIPLIER 2 + +struct hdd_align_mac_addr_t { + uint16 bytes_ab; + uint16 bytes_cd; + uint16 bytes_ef; +}; + +typedef struct hdd_staid_hash_node +{ + hdd_list_node_t node; + v_U8_t sta_id; + v_MACADDR_t mac_addr; +}hdd_staid_hash_node_t; + +/* sta_id hash related APIs */ +VOS_STATUS hdd_sta_id_hash_attach(hdd_adapter_t *pAdapter); +VOS_STATUS hdd_sta_id_hash_detach(hdd_adapter_t *pAdapter); +int hdd_sta_id_hash_calculate_index(hdd_adapter_t *pAdapter, + v_MACADDR_t *mac_addr_in); +VOS_STATUS hdd_sta_id_hash_add_entry(hdd_adapter_t *pAdapter, + v_U8_t sta_id, v_MACADDR_t *mac_addr); +VOS_STATUS hdd_sta_id_hash_remove_entry(hdd_adapter_t *pAdapter, + v_U8_t sta_id, v_MACADDR_t *mac_addr); +int hdd_sta_id_find_from_mac_addr(hdd_adapter_t *pAdapter, + v_MACADDR_t *mac_addr_in); +void hdd_init_frame_logging(hdd_context_t *pHddCtx); + +int hdd_enable_disable_ca_event(hdd_context_t *pHddCtx, + tANI_U8* command, tANI_U8 cmd_len); +void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind); + +#ifdef WLAN_FEATURE_LINK_LAYER_STATS +/** + * hdd_init_ll_stats_ctx() - initialize link layer stats context + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +static inline void hdd_init_ll_stats_ctx(hdd_context_t *hdd_ctx) +{ + init_completion(&hdd_ctx->ll_stats_context.response_event); + hdd_ctx->ll_stats_context.request_bitmap = 0; + + return; +} +#else +static inline void hdd_init_ll_stat_ctx(void) +{ + return; +} +#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +void hdd_wlan_free_wiphy_channels(struct wiphy *wiphy); +void hdd_initialize_adapter_common(hdd_adapter_t *pAdapter); + +/** + * hdd_drv_cmd_validate() - Validates for space in hdd driver command + * @command: pointer to input data (its a NULL terminated string) + * @len: length of command name + * + * This function checks for space after command name and if no space + * is found returns error. + * + * Return: 0 for success non-zero for failure + */ +int hdd_drv_cmd_validate(tANI_U8 *command, int len); #endif // end #if !defined( WLAN_HDD_MAIN_H ) diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_oemdata.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_oemdata.h index f484b5135b07..db3857dc6ab5 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_oemdata.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_oemdata.h @@ -33,9 +33,6 @@ \brief Internal includes for the oem data - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_p2p.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_p2p.h index 1326fab3900e..4e733f039fc1 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_p2p.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_p2p.h @@ -32,11 +32,10 @@ \file wlan_hdd_p2p.h \brief Linux HDD P2P include file - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ +#include +#include #define ACTION_FRAME_TX_TIMEOUT 2000 #define WAIT_CANCEL_REM_CHAN 1000 #define WAIT_REM_CHAN_READY 1000 @@ -58,6 +57,8 @@ #define WLAN_HDD_SET_WEP_FRM_FC(__fc__) ( (__fc__) = ((__fc__) | 0x40)) #endif //WLAN_FEATURE_11W +#define HDD_P2P_MAX_ROC_DURATION 1000 + enum hdd_rx_flags { HDD_RX_FLAG_DECRYPTED = 1 << 0, HDD_RX_FLAG_MMIC_STRIPPED = 1 << 1, @@ -128,17 +129,19 @@ int hdd_setP2pPs( struct net_device *dev, void *msgData ); int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command ); int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command ); -void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, +void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, tANI_U32 nFrameLength, tANI_U8* pbFrames, tANI_U8 frameType, tANI_U32 rxChan, tANI_S8 rxRssi); - void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ); void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess ); int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter); VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) +int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_mgmt_tx_params *params, u64 *cookie); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct wireless_dev *wdev, struct ieee80211_channel *chan, bool offchan, #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) @@ -194,5 +197,5 @@ int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct wireless_dev *wdev ); #else int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev ); #endif - +void hdd_p2p_roc_work_queue(struct work_struct *work); #endif // __P2P_H diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_request_manager.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_request_manager.h new file mode 100644 index 000000000000..357ef2a12d69 --- /dev/null +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_request_manager.h @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __WLAN_HDD_REQUEST_MANAGER_H__ +#define __WLAN_HDD_REQUEST_MANAGER_H__ + +/** + * DOC: WLAN HDD REQUEST MANAGER + * + * Many operations within the wlan driver occur in an asynchronous + * manner. Requests are received by HDD via one of the kernel + * interfaces (ioctl, nl80211, virtual file system, etc.). The + * requests are translated to an internal format and are then passed + * to lower layers, usually via SME, for processing. For requests + * which require a response, that response comes up from the lower + * layers in a separate thread of execution, ultimately resulting in a + * call to a callback function that was provided by HDD as part of the + * initial request. So a mechanism is needed to synchronize the + * request and response. This framework provides that mechanism. + * + * Once the framework has been initialized, the typical sequence of + * events is as follows: + * + * Request Thread: + * 1. Create a &struct hdd_request_params which describes the request. + * 2. Call hdd_request_alloc() to allocate a &struct hdd_request. + * 3. Call hdd_request_priv() to get a pointer to the private data. + * 4. Place any information which must be shared with the Response + * Callback in the private data area. + * 5. Call hdd_request_cookie() to get the unique cookie assigned + * to the request. + * 6. Call the underlying request handling API, passing the cookie + * as the callback's private context. + * 7. Call hdd_request_wait_for_response() to wait for the response + * (or for the request to time out). + * 8. Use the return status to see if the request was successful. If + * it was, retrieve any response information from the private + * structure and prepare a response for userspace. + * 9. Call hdd_request_put() to relinquish access to the request. + * 10. Return status to the caller. + * + * Response Callback: + * 1. Call hdd_request_get() with the provided cookie to see if the + * request structure is still valid. If it returns %NULL then + * return since this means the request thread has already timed + * out. + * 2. Call hdd_request_priv() to get access to the private data area. + * 3. Write response data into the private data area. + * 4. Call hdd_request_complete() to indicate that the response is + * ready to be processed by the request thread. + * 5. Call hdd_request_put() to relinquish the callback function's + * reference to the request. + */ + +/* this is opaque to clients */ +struct hdd_request; + +/** + * typedef hdd_request_dealloc - Private data deallocation function + */ +typedef void (*hdd_request_dealloc)(void *priv); + +/** + * struct hdd_request_params - HDD request parameters + * @priv_size: Size of the private data area required to pass + * information between the request thread and the response callback. + * @timeout_ms: The amount of time to wait for a response in milliseconds. + * @dealloc: Function to be called when the request is destroyed to + * deallocate any allocations made in the private area of the + * request struct. Can be %NULL if no private allocations are + * made. + */ +struct hdd_request_params { + uint32_t priv_size; + uint32_t timeout_ms; + hdd_request_dealloc dealloc; +}; + +/** + * hdd_request_alloc() - Allocate a request struct + * @params: parameter block that specifies the attributes of the + * request + * + * This function will attempt to allocate a &struct hdd_request with + * the specified @params. If successful, the caller can then use + * request struct to make an asynchronous request. Once the request is + * no longer needed, the reference should be relinquished via a call + * to hdd_request_put(). + * + * Return: A pointer to an allocated &struct hdd_request (which also + * contains room for the private buffer) if the allocation is + * successful, %NULL if the allocation fails. + */ +struct hdd_request *hdd_request_alloc(const struct hdd_request_params *params); + +/** + * hdd_request_priv() - Get pointer to request private data + * @request: The request struct that contains the private data + * + * This function will return a pointer to the private data area that + * is part of the request struct. The caller must already have a valid + * reference to @request from either hdd_request_alloc() or + * hdd_request_get(). + * + * Returns: pointer to the private data area. Note that this pointer + * will always be an offset from the input @request pointer and hence + * this function will never return %NULL. + */ +void *hdd_request_priv(struct hdd_request *request); + +/** + * hdd_request_cookie() - Get cookie of a request + * @request: The request struct associated with the request + * + * This function will return the unique cookie that has been assigned + * to the request. This cookie can subsequently be passed to + * hdd_request_get() to retrieve the request. + * + * Note that the cookie is defined as a void pointer as it is intended + * to be passed as an opaque context pointer from HDD to underlying + * layers when making a request, and subsequently passed back to HDD + * as an opaque pointer in an asynchronous callback. + * + * Returns: The cookie assigned to the request. + */ +void *hdd_request_cookie(struct hdd_request *request); + +/** + * hdd_request_get() - Get a reference to a request struct + * @cookie: The cookie of the request struct that needs to be + * referenced + * + * This function will use the cookie to determine if the associated + * request struct is valid, and if so, will increment the reference + * count of the struct. This means the caller is guaranteed that the + * request struct is valid and the underlying private data can be + * dereferenced. + * + * Returns: The pointer to the request struct associated with @cookie + * if the request is still valid, %NULL if the underlying request + * struct is no longer valid. + */ +struct hdd_request *hdd_request_get(void *cookie); + +/** + * hdd_request_put() - Release a reference to a request struct + * @request: The request struct that no longer needs to be referenced + * + * This function will decrement the reference count of the struct, and + * will clean up the request if this is the last reference. The caller + * must already have a valid reference to @request, either from + * hdd_request_alloc() or hdd_request_get(). + * + * Returns: Nothing + */ +void hdd_request_put(struct hdd_request *request); + +/** + * hdd_request_wait_for_response() - Wait for a response + * @request: The request struct associated with the request + * + * This function will wait until either a response is received and + * communicated via hdd_request_complete(), or until the request + * timeout period expires. + * + * Returns: 0 if a response was received, -ETIMEDOUT if the response + * timed out. + */ +int hdd_request_wait_for_response(struct hdd_request *request); + +/** + * hdd_request_complete() - Complete a request + * @request: The request struct associated with the request + * + * This function is used to indicate that a response has been received + * and that any information required by the request thread has been + * copied into the private data area of the request struct. This will + * unblock any hdd_request_wait_for_response() that is pending on this + * @request. + * + * Returns: Nothing + */ +void hdd_request_complete(struct hdd_request *request); + +/** + * hdd_request_manager_init() - Initialize the HDD Request Manager + * + * This function must be called during system initialization to + * initialize the HDD Request Manager. + * + * Returns: Nothing + */ +void hdd_request_manager_init(void); + +/** + * hdd_request_manager_deinit() - Deinitialize the HDD Request Manager + * + * This function must be called during system shutdown to deinitialize + * the HDD Request Manager. + * + * Returns: Nothing + */ +void hdd_request_manager_deinit(void); + +#endif /* __WLAN_HDD_REQUEST_MANAGER_H__ */ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h index 6e6250295bd7..249dda170822 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h @@ -33,9 +33,6 @@ \file wlan_hdd_softap_tx_rx.h \brief Linux HDD SOFTAP Tx/RX APIs - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tdls.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tdls.h index 403b3b2d68ce..880ab1c5d828 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tdls.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tdls.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,6 +34,8 @@ \brief Linux HDD TDLS include file ==========================================================================*/ +#ifdef FEATURE_WLAN_TDLS + #define MAX_NUM_TDLS_PEER 3 #define TDLS_SUB_DISCOVERY_PERIOD 100 @@ -63,6 +65,14 @@ should not be more than 2000 */ #define TDLS_IS_CONNECTED(peer) \ ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \ (eTDLS_LINK_TEARING == (peer)->link_status)) + +/* TDLS Off Channel Bandwidth Offset */ +#define TDLS_OFF_CHANNEL_BW_OFFSET 0 + +/* TDLS Channel Switch Request */ +#define TDLS_CHANNEL_SWITCH_ENABLE 1 +#define TDLS_CHANNEL_SWITCH_DISABLE 2 + typedef struct { tANI_U32 tdls; @@ -139,7 +149,12 @@ typedef enum { WIFI_TDLS_FAILED /* Direct link failed */ } tdls_state_t; -typedef int (*cfg80211_exttdls_callback)(tANI_U8* mac, +typedef int (*cfg80211_exttdls_callback)( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8* mac, +#else + tANI_U8* mac, +#endif tANI_S32 state, tANI_S32 reason, void *ctx); @@ -209,6 +224,9 @@ typedef struct _hddTdlsPeer_t { /*EXT TDLS*/ tTDLSLinkReason reason; cfg80211_exttdls_callback state_change_notification; + tANI_BOOLEAN isOffChannelConfigured; + tANI_BOOLEAN isOffChannelEstablished; + tdls_req_params_t peerParams; } hddTdlsPeer_t; typedef struct { @@ -224,53 +242,127 @@ int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_init(hdd_context_t * pHddCtx); -void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter); +void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter, tANI_BOOLEAN mutexLock); void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac); void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac); -int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, u8 *mac, u8 tx); +int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 tx); -int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, u8 *mac, u8 staId); +int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 staId); -hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, u8 *mac, tANI_BOOLEAN mutexLock); +hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_BOOLEAN mutexLock); -hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, u8 *mac); +hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif +); -int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, u8 *mac, +int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tCsrTdlsLinkEstablishParams* tdlsLinkEstablishParams); -hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac); +hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif + ); -int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, u8* mac, tTDLSCapType cap); +int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8* mac, +#else + u8* mac, +#endif + tTDLSCapType cap); void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, tTDLSLinkStatus status, tTDLSLinkReason reason); void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, - u8* mac, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tTDLSLinkStatus linkStatus, tTDLSLinkReason reason); int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac); int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else u8 *mac, +#endif tCsrStaParams *StaParams, tANI_BOOLEAN isBufSta, - tANI_BOOLEAN isOffChannelSupported); - -int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, u8 *mac, tANI_S8 rxRssi); + tANI_BOOLEAN isOffChannelSupported, + tANI_BOOLEAN isQosWmmSta); + +int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_S8 rxRssi); -int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, u8 *mac, tANI_U8 responder); +int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_U8 responder); int wlan_hdd_tdls_get_responder(hdd_adapter_t *pAdapter, u8 *mac); -int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, u8 *mac, tANI_U8 uSignature); +int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_U8 uSignature); int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *config); -int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, u8 *mac); +int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif + ); tANI_U16 wlan_hdd_tdlsConnectedPeers(hdd_adapter_t *pAdapter); @@ -290,7 +382,13 @@ void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter); u8 wlan_hdd_tdls_is_peer_progress(hdd_adapter_t *pAdapter, u8 *mac); -hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, u8* mac, u8 skip_self); +hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 skip_self, tANI_BOOLEAN mutexLock); void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, eTDLSSupportMode tdls_mode, @@ -325,15 +423,38 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, hddTdlsPeer_t *curr_peer, tANI_U16 reason); -int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, u8 *mac, +int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tANI_BOOLEAN forcePeer); -int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, u8 *peer); +int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer +#else + u8 *peer +#endif +); int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer, +#else u8 *peer, +#endif + tdls_req_params_t *tdls_peer_params, cfg80211_exttdls_callback callback); +void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter, + hdd_context_t *pHddCtx); +void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx); /*EXT TDLS*/ int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8* mac, +#else tANI_U8* mac, +#endif tANI_S32 *state, tANI_S32 *reason); void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, @@ -341,7 +462,36 @@ void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, tANI_S32 *reason); int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer, cfg80211_exttdls_callback callback); +int hdd_set_tdls_scan_type(hdd_adapter_t *pAdapter, + tANI_U8 *ptr); // tdlsoffchan -hddTdlsPeer_t *wlan_hdd_tdls_get_first_connected_peer(hdd_adapter_t *pAdapter); +hddTdlsPeer_t *wlan_hdd_tdls_get_connected_peer(hdd_adapter_t *pAdapter); + +int wlan_hdd_validate_tdls_context(hdd_context_t *pHddCtx, tdlsCtx_t *pTdlsCtx); + +void wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx); +#else +static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter, + hdd_context_t *pHddCtx) +{ +} +static inline void +wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx) +{ +} +static inline void +wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx) +{ +} +#endif +void wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(hdd_adapter_t *pAdapter, + u8 *mac, v_S7_t rssiAvg); + + +tdlsConnInfo_t *wlan_hdd_get_conn_info(hdd_context_t *pHddCtx, + tANI_U8 idx); + +v_VOID_t wlan_hdd_tdls_initiator_wait_cb(v_PVOID_t userData); + #endif // __HDD_TDSL_H diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_trace.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_trace.h index 191ec4938db7..aef3ef5922e2 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_trace.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,6 +31,7 @@ #include "macTrace.h" #define NO_SESSION 0xFF +#define TRACE_CODE_HDD_RX_SME_MSG 0xFF enum { @@ -81,6 +82,8 @@ enum TRACE_CODE_HDD_CHANGE_STATION, TRACE_CODE_HDD_CFG80211_UPDATE_BSS, TRACE_CODE_HDD_CFG80211_SCAN, + TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START, + TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP, TRACE_CODE_HDD_REMAIN_ON_CHANNEL, TRACE_CODE_HDD_REMAINCHANREADYHANDLER, TRACE_CODE_HDD_CFG80211_CANCEL_REMAIN_ON_CHANNEL, @@ -91,13 +94,22 @@ enum TRACE_CODE_HDD_CFG80211_DEL_STA, TRACE_CODE_HDD_CFG80211_ADD_STA, TRACE_CODE_HDD_CFG80211_SET_PMKSA, + TRACE_CODE_HDD_CFG80211_DEL_PMKSA, TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES, TRACE_CODE_HDD_CFG80211_TDLS_MGMT, TRACE_CODE_HDD_CFG80211_TDLS_OPER, TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA, TRACE_CODE_HDD_UNSUPPORTED_IOCTL, TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL, - TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL + TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL, + TRACE_CODE_HDD_STOP_NETDEV, + TRACE_CODE_HDD_WAKE_NETDEV, + TRACE_CODE_HDD_FLUSH_TX_QUEUES, + TRACE_CODE_HDD_CFG80211_RESUME_WLAN, + TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN, + TRACE_CODE_HDD_CFG80211_SET_MAC_ACL, + TRACE_CODE_HDD_CFG80211_TESTMODE, + TRACE_CODE_HDD_CFG80211_DUMP_SURVEY, }; extern void hddTraceDump(void *pMac, tpvosTraceRecord pRecord, tANI_U16 recIndex); diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tx_rx.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tx_rx.h index a94dacf3850b..5fab1806f277 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tx_rx.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_tx_rx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -111,20 +111,30 @@ #define DHCP_OPTION53_STATUS_OFFSET ( 0x11C ) /* WLAN_DHCP_DEBUG */ - - +#define TID3 0x60 /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------- +/*--------------------------------------------------------------------------- Function declarations and documenation - -------------------------------------------------------------------------*/ + -------------------------------------------------------------------------*/ +/**============================================================================ + @brief hdd_ibss_hard_start_xmit() - Function registered with the Linux OS for + transmitting packets in IBSS mode. + + @param skb : [in] pointer to OS packet (sk_buff) + @param dev : [in] pointer to network device + + @return : NET_XMIT_DROP if packets are dropped + : NET_XMIT_SUCCESS if packet is enqueued succesfully + ===========================================================================*/ +extern int hdd_ibss_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); /**============================================================================ - @brief hdd_hard_start_xmit() - Function registered with the Linux OS for + @brief hdd_hard_start_xmit() - Function registered with the Linux OS for transmitting packets @param skb : [in] pointer to OS packet (sk_buff) @@ -156,6 +166,26 @@ extern void hdd_tx_timeout(struct net_device *dev); ===========================================================================*/ extern struct net_device_stats* hdd_stats(struct net_device *dev); +/**============================================================================ + @brief hdd_ibss_init_tx_rx() - Init function to initialize Tx/RX + modules in HDD + + @param pAdapter : [in] pointer to adapter context + @return : VOS_STATUS_E_FAILURE if any errors encountered + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +extern void hdd_ibss_init_tx_rx( hdd_adapter_t *pAdapter ); + +/**============================================================================ + @brief hdd_ibss_deinit_tx_rx() - Deinit function to clean up Tx/RX + modules in HDD + + @param pAdapter : [in] pointer to adapter context.. + @return : VOS_STATUS_E_FAILURE if any errors encountered. + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +extern VOS_STATUS hdd_ibss_deinit_tx_rx( hdd_adapter_t *pAdapter ); + /**============================================================================ @brief hdd_init_tx_rx() - Init function to initialize Tx/RX modules in HDD @@ -202,6 +232,26 @@ extern VOS_STATUS hdd_tx_complete_cbk( v_VOID_t *vosContext, vos_pkt_t *pVosPacket, VOS_STATUS vosStatusIn ); +/**============================================================================ + @brief hdd_ibss_tx_fetch_packet_cbk() - Callback function invoked by TL to + fetch a packet for transmission. + + @param vosContext : [in] pointer to VOS context + @param staId : [in] Station for which TL is requesting a pkt + @param ucAC : [in] pointer to access category requested by TL + @param pVosPacket : [out] pointer to VOS packet packet pointer + @param pPktMetaInfo : [out] pointer to meta info for the pkt + + @return : VOS_STATUS_E_EMPTY if no packets to transmit + : VOS_STATUS_E_FAILURE if any errors encountered + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +extern VOS_STATUS hdd_ibss_tx_fetch_packet_cbk( v_VOID_t *vosContext, + v_U8_t *pStaId, + WLANTL_ACEnumType ucAC, + vos_pkt_t **ppVosPacket, + WLANTL_MetaInfoType *pPktMetaInfo ); + /**============================================================================ @brief hdd_tx_fetch_packet_cbk() - Callback function invoked by TL to fetch a packet for transmission. @@ -237,6 +287,8 @@ extern VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, extern VOS_STATUS hdd_tx_low_resource_cbk( vos_pkt_t *pVosPacket, v_VOID_t *userData ); +extern VOS_STATUS hdd_rx_packet_monitor_cbk(v_VOID_t *vosContext,vos_pkt_t *pVosPacket, int conversion); + /**============================================================================ @brief hdd_rx_packet_cbk() - Receive callback registered with TL. TL will call this to notify the HDD when a packet was received @@ -325,4 +377,25 @@ void hdd_wmm_acquire_access_required(hdd_adapter_t *pAdapter, ========================================================================*/ void hdd_dump_dhcp_pkt(struct sk_buff *skb, int path); +#ifdef FEATURE_WLAN_DIAG_SUPPORT +/** + * wlan_hdd_log_eapol() - Function to check and extract EAPOL params + * @skb: skb data + * @event_type: One of enum wifi_connectivity_events to indicate Tx/Rx + * + * This function parses the input skb data to get the EAPOL params,if the + * packet is EAPOL and store it in the pointer passed as input + * + * Return: None + * + */ +void wlan_hdd_log_eapol(struct sk_buff *skb, + uint8_t event_type); +#else +static inline void wlan_hdd_log_eapol(struct sk_buff *skb, + uint8_t event_type) +{ +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + #endif // end #if !defined( WLAN_HDD_TX_RX_H ) diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wext.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wext.h index c15445d43d24..01fc05839c33 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wext.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -176,7 +176,7 @@ typedef enum #define IE_VENDOR_OUI_SIZE 4 /** Maximum Length of WPA/RSN IE */ -#define MAX_WPA_RSN_IE_LEN 40 +#define MAX_WPA_RSN_IE_LEN 255 /** Maximum Number of WEP KEYS */ #define MAX_WEP_KEYS 4 @@ -274,6 +274,13 @@ typedef enum WEXT_SCAN_PENDING_MAX } hdd_scan_pending_option_e; +enum +{ + WLAN_HDD_GET_FRAME_LOG_CMD_CLEAR = 1<<0, + WLAN_HDD_GET_FRAME_LOG_CMD_SEND_AND_CLEAR = 1<<1, + WLAN_HDD_GET_FRAME_LOG_CMD_BMU_TRACING = 1<<2, +}; + /* * This structure contains the interface level (granularity) * configuration information in support of wireless extensions. @@ -336,6 +343,11 @@ typedef struct ccp_freq_chan_map_s{ v_U32_t chan; }hdd_freq_chan_map_t; +struct stats_class_a_ctx { + tCsrGlobalClassAStatsInfo class_a_stats; +}; + + #define wlan_hdd_get_wps_ie_ptr(ie, ie_len) \ wlan_hdd_get_vendor_oui_ie_ptr(WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE, ie, ie_len) @@ -414,7 +426,7 @@ extern int hdd_priv_get_data(struct iw_point *p_priv_data, extern void *mem_alloc_copy_from_user_helper(const void *wrqu_data, size_t len); void hdd_clearRoamProfileIe( hdd_adapter_t *pAdapter); -void hdd_GetClassA_statisticsCB(void *pStats, void *pContext); +void hdd_get_class_a_statistics_cb(void *stats, void *context); VOS_STATUS wlan_hdd_check_ula_done(hdd_adapter_t *pAdapter); @@ -455,6 +467,6 @@ void* wlan_hdd_change_country_code_callback(void *pAdapter); int hdd_setBand(struct net_device *dev, u8 ui_band); int hdd_setBand_helper(struct net_device *dev, const char *command); - +VOS_STATUS wlan_hdd_get_frame_logs(hdd_adapter_t *pAdapter, v_U8_t flag); #endif // __WEXT_IW_H__ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wmm.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wmm.h index 7d0b2886779d..76c2837b45f0 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wmm.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wmm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -193,7 +193,6 @@ typedef struct typedef struct { struct list_head wmmContextList; - struct mutex wmmLock; hdd_wmm_ac_status_t wmmAcStatus[WLANTL_MAX_AC]; v_BOOL_t wmmQap; v_BOOL_t wmmQosConnection; @@ -265,8 +264,14 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb); @return : Qdisc queue index ===========================================================================*/ -v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb); - +v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + , void *accel_priv +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + , select_queue_fallback_t fallbac +#endif +); /**============================================================================ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wowl.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wowl.h index 5aeb487988ce..93ae7f97de09 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wowl.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_wowl.h @@ -96,9 +96,6 @@ the device in BMPS mode (if not already in BMPS). If attempt to BMPS fails, request for WoWL will be rejected. - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /* $Header$ */ diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_qct_driver.h b/drivers/staging/prima/CORE/HDD/inc/wlan_qct_driver.h index d7bedae111d0..f231690439b3 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_qct_driver.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_qct_driver.h @@ -34,9 +34,6 @@ \brief Header file for Wireless LAN Host Device Driver Kernel Module - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/HDD/src/bap_hdd_main.c b/drivers/staging/prima/CORE/HDD/src/bap_hdd_main.c index 328f5e137016..99cddbd7d96a 100644 --- a/drivers/staging/prima/CORE/HDD/src/bap_hdd_main.c +++ b/drivers/staging/prima/CORE/HDD/src/bap_hdd_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,9 +31,6 @@ \brief 802.11 BT-AMP PAL Host Device Driver implementation - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -487,7 +484,7 @@ static VOS_STATUS WLANBAP_STAFetchPktCB return VosStatus; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s: pVosPkt(vos_pkt_t *)=%p", __func__, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s: pVosPkt(vos_pkt_t *)=%pK", __func__, pVosPkt ); VosStatus = WLANBAP_XlateTxDataPkt( pctx->bapHdl, pPhyCtx->PhyLinkHdl, @@ -511,7 +508,7 @@ static VOS_STATUS WLANBAP_STAFetchPktCB // provide the meta-info BAP provided previously *tlMetaInfo = TlMetaInfo; - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: *vosDataBuff(vos_pkt_t *)=%p", __func__, *vosDataBuff ); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: *vosDataBuff(vos_pkt_t *)=%pK", __func__, *vosDataBuff ); return(VOS_STATUS_SUCCESS); } // WLANBAP_STAFetchPktCB() @@ -668,7 +665,7 @@ static VOS_STATUS WLANBAP_TxCompCB BslClientCtxType* ppctx; static int num_packets; - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "WLANBAP_TxCompCB. vosDataBuff(vos_pkt_t *)=%p", vosDataBuff ); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "WLANBAP_TxCompCB. vosDataBuff(vos_pkt_t *)=%pK", vosDataBuff ); // be aware that pHddHdl can be NULL or can point to the per association // BSL context from the register data plane. In either case it does not @@ -4131,7 +4128,7 @@ static int BSL_Write(struct sk_buff *skb) case HCI_ACLDATA_PKT: // Directly execute the data write VOS_TRACE(VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: HCI ACL data tx, skb=%p", + "%s: HCI ACL data tx, skb=%pK", __func__, skb); // ACL data hdev->stat.acl_tx++; @@ -4167,11 +4164,11 @@ static int BSL_Write(struct sk_buff *skb) // save away the pctx context...so it can be retrieved by the work procedure. pHciContext->pctx = pctx; pHciContext->magic = BT_AMP_HCI_CTX_MAGIC; - INIT_WORK(&pHciContext->hciInterfaceProcessing, + vos_init_work(&pHciContext->hciInterfaceProcessing, bslWriteFinish); VOS_TRACE(VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: Scheduling work for skb %p, BT-AMP Client context %p, work %p", + "%s: Scheduling work for skb %pK, BT-AMP Client context %pK, work %pK", __func__, skb, pctx, pHciContext); status = schedule_work(&pHciContext->hciInterfaceProcessing); @@ -4235,7 +4232,7 @@ static void bslWriteFinish(struct work_struct *work) v_SIZE_t written = 0; VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_LOW, - "%s: Entered, context %p", + "%s: Entered, context %pK", __func__, pctx); // Sanity check inputs @@ -4302,7 +4299,7 @@ static void bslWriteFinish(struct work_struct *work) }; VOS_TRACE(VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: Freeing skb %p", + "%s: Freeing skb %pK", __func__, skb); consume_skb(skb); diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c index 07ea0ab67050..56775f2b6497 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -53,20 +53,19 @@ #include "wlan_nlink_common.h" #include "wlan_btc_svc.h" #include "wlan_hdd_power.h" +#include "wlan_hdd_trace.h" #include #include #include #include "wlan_hdd_cfg80211.h" #include "csrInsideApi.h" #include "wlan_hdd_p2p.h" -#ifdef FEATURE_WLAN_TDLS +#include #include "wlan_hdd_tdls.h" -#endif #include "sme_Api.h" #include "wlan_hdd_hostapd.h" -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif +#include v_BOOL_t mibIsDot11DesiredBssTypeInfrastructure( hdd_adapter_t *pAdapter ); @@ -431,8 +430,8 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) vos_mem_zero(ftIe, DOT11F_IE_FTINFO_MAX_LEN); vos_mem_zero(ricIe, DOT11F_IE_RICDESCRIPTOR_MAX_LEN); - sme_GetRICIEs( pHddCtx->hHal, (u8 *)ricIe, - DOT11F_IE_FTINFO_MAX_LEN, &ric_ies_length ); + sme_GetRICIEs(pHddCtx->hHal, (u8 *)ricIe, + DOT11F_IE_RICDESCRIPTOR_MAX_LEN, &ric_ies_length ); if (ric_ies_length == 0) { hddLog(LOGW, @@ -505,6 +504,7 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) if (auth_resp_len == 0) { hddLog(LOGE, "%s: AuthRsp FTIES is of length 0", __func__); + kfree(buff); return; } @@ -535,7 +535,7 @@ static void hdd_SendNewAPChannelInfo(struct net_device *dev, hdd_adapter_t *pAda if (descriptor == NULL) { hddLog(LOGE, - "%s: pCsrRoamInfo->pBssDesc=%p", + "%s: pCsrRoamInfo->pBssDesc=%pK", __func__, descriptor); return; } @@ -743,32 +743,224 @@ void hdd_connRemoveConnectInfo( hdd_station_ctx_t *pHddStaCtx ) vos_mem_zero( &pHddStaCtx->conn_info.SSID, sizeof( tCsrSSIDInfo ) ); } -/* TODO Revist this function. and data path */ -static VOS_STATUS hdd_roamDeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) + +VOS_STATUS hdd_ibss_deinit_tx_rx_sta ( hdd_adapter_t *pAdapter, v_U8_t STAId ) +{ + v_U8_t ac; + /**Track whether OS TX queue has been disabled.*/ + v_BOOL_t txSuspended[NUM_TX_QUEUES]; + v_U8_t tlAC; + v_U8_t i; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_ibss_peer_info_t *pPeerInfo; + + if( NULL == pHddStaCtx ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD station context NULL ",__func__); + return VOS_STATUS_E_FAILURE; + } + + pPeerInfo = &pHddStaCtx->ibss_peer_info; + if (FALSE == pPeerInfo->ibssStaInfo[STAId].isUsed) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Deinit station not inited %d", __func__, STAId ); + return VOS_STATUS_E_FAILURE; + } + + hdd_flush_ibss_tx_queues(pAdapter, STAId); + + for (ac = HDD_LINUX_AC_VO; ac <= HDD_LINUX_AC_BK; ac++) + { + tlAC = hdd_QdiscAcToTlAC[ac]; + txSuspended[ac] = pPeerInfo->ibssStaInfo[STAId].txSuspended[tlAC]; + } + + vos_mem_zero(&pPeerInfo->ibssStaInfo[STAId], sizeof(hdd_ibss_station_info_t)); + + /* re-init hdd list, since netdev can still open adapter until + * driver gets unloaded + */ + for (i = 0; i < NUM_TX_QUEUES; i ++) + { + hdd_list_init(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i], + HDD_TX_QUEUE_MAX_LEN); + } + + for (ac = HDD_LINUX_AC_VO; ac <= HDD_LINUX_AC_BK; ac++) + { + if (txSuspended[ac]) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: TX queue re-enabled", __func__); + netif_wake_subqueue(pAdapter->dev, ac); + } + } + return VOS_STATUS_SUCCESS; +} + +static VOS_STATUS hdd_ibss_DeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) { VOS_STATUS vosStatus; - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - if (WLAN_HDD_IBSS != pAdapter->device_mode) + vosStatus = WLANTL_ClearSTAClient( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staId ); + if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { - hdd_disconnect_tx_rx(pAdapter); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: WLANTL_ClearSTAClient() failed to for staID %d. " + "Status= %d [0x%08X]", + __func__, staId, vosStatus, vosStatus ); } - else + + vosStatus = hdd_ibss_deinit_tx_rx_sta ( pAdapter, staId ); + if( VOS_STATUS_E_FAILURE == vosStatus ) { - // Need to cleanup all queues only if the last peer leaves - if (eConnectionState_IbssDisconnected == pHddStaCtx->conn_info.connState) - { - netif_tx_disable(pAdapter->dev); - netif_carrier_off(pAdapter->dev); - hdd_disconnect_tx_rx(pAdapter); - } - else - { - // There is atleast one more peer, do not cleanup all queues - hdd_flush_ibss_tx_queues(pAdapter, staId); - } + VOS_TRACE ( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "hdd_ibss_deinit_tx_rx_sta() failed for staID %d. " + "Status = %d [0x%08X]", + staId, vosStatus, vosStatus ); } + return( vosStatus ); +} + +VOS_STATUS hdd_ibss_init_tx_rx_sta( hdd_adapter_t *pAdapter, v_U8_t STAId, v_MACADDR_t *pmacAddrSTA) +{ + v_U8_t i = 0; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_ibss_peer_info_t * pPeerInfo = &pHddStaCtx->ibss_peer_info; + + if (pPeerInfo->ibssStaInfo[STAId].isUsed) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Reinit station %d", __func__, STAId ); + return VOS_STATUS_E_FAILURE; + } + + vos_mem_zero(&pPeerInfo->ibssStaInfo[STAId], sizeof(hdd_ibss_station_info_t)); + for (i = 0; i < NUM_TX_QUEUES; i ++) + { + hdd_list_init(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i], HDD_TX_QUEUE_MAX_LEN); + } + + pPeerInfo->ibssStaInfo[STAId].isUsed = VOS_TRUE; + pPeerInfo->ibssStaInfo[STAId].isDeauthInProgress = VOS_FALSE; + vos_copy_macaddr( &pPeerInfo->ibssStaInfo[STAId].macAddrSTA, pmacAddrSTA); + + return VOS_STATUS_SUCCESS; +} + +static VOS_STATUS hdd_ibss_RegisterSTA( hdd_adapter_t *pAdapter, + tCsrRoamInfo *pRoamInfo, + v_U8_t staId, + v_MACADDR_t *pPeerMacAddress, + tSirBssDescription *pBssDesc ) +{ + VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; + WLAN_STADescType staDesc = {0}; + eCsrEncryptionType connectedCipherAlgo; + v_BOOL_t fConnected; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_ibss_peer_info_t * pPeerInfo = &pHddStaCtx->ibss_peer_info; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if ( pPeerInfo->ibssStaInfo[staId].isUsed ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "clean up old entry for STA %d", staId); + hdd_ibss_DeregisterSTA( pAdapter, staId ); + } + + staDesc.ucSTAId = staId; + staDesc.wSTAType = WLAN_STA_IBSS; + + // Note that for IBSS, the STA MAC address and BSSID are goign to be different where + // in infrastructure, they are the same (BSSID is the MAC address of the AP). So, + // for IBSS we have a second field to pass to TL in the STA descriptor that we don't + // pass when making an Infrastructure connection. + vos_mem_copy(staDesc.vSTAMACAddress.bytes, pPeerMacAddress->bytes,sizeof(pPeerMacAddress->bytes)); + vos_mem_copy( staDesc.vBSSIDforIBSS.bytes, pHddStaCtx->conn_info.bssId, 6 ); + vos_copy_macaddr( &staDesc.vSelfMACAddress, &pAdapter->macAddressCurrent ); + + if (hdd_wmm_is_active(pAdapter)) + { + staDesc.ucQosEnabled = 1; + } + else + { + staDesc.ucQosEnabled = 0; + } + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "HDD SOFTAP register TL QoS_enabled=%d", + staDesc.ucQosEnabled ); + + fConnected = hdd_connGetConnectedCipherAlgo( pHddStaCtx, &connectedCipherAlgo ); + if ( connectedCipherAlgo != eCSR_ENCRYPT_TYPE_NONE ) + { + staDesc.ucProtectedFrame = 1; + } + else + { + staDesc.ucProtectedFrame = 0; + + } + + hdd_ibss_init_tx_rx_sta(pAdapter, staId, &staDesc.vSTAMACAddress); + + // UMA is Not ready yet, Xlation will be done by TL + staDesc.ucSwFrameTXXlation = 1; + staDesc.ucSwFrameRXXlation = 1; + staDesc.ucAddRmvLLC = 1; + // Initialize signatures and state + staDesc.ucUcastSig = pRoamInfo->ucastSig; + staDesc.ucBcastSig = pRoamInfo->bcastSig; + staDesc.ucInitState = WLANTL_STA_AUTHENTICATED; + + staDesc.ucIsReplayCheckValid = VOS_FALSE; + + // Register the Station with TL. + vosStatus = WLANTL_RegisterSTAClient( pHddCtx->pvosContext, + hdd_rx_packet_cbk, + hdd_tx_complete_cbk, + hdd_ibss_tx_fetch_packet_cbk, &staDesc, + pBssDesc->rssi ); + if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "WLANTL_RegisterSTAClient() failed to register. Status= %d [0x%08X]", + vosStatus, vosStatus ); + return vosStatus; + } + + //Timer value should be in milliseconds + if ( pHddCtx->cfg_ini->dynSplitscan && + ( VOS_TIMER_STATE_RUNNING != + vos_timer_getCurrentState(&pHddCtx->tx_rx_trafficTmr))) + { + vos_timer_start(&pHddCtx->tx_rx_trafficTmr, + pHddCtx->cfg_ini->trafficMntrTmrForSplitScan); + } + + pPeerInfo->ibssStaInfo[staId].ucSTAId = staId; + pPeerInfo->ibssStaInfo[staId].isQosEnabled = staDesc.ucQosEnabled; + + vosStatus = WLANTL_ChangeSTAState( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staDesc.ucSTAId, + WLANTL_STA_AUTHENTICATED ); + + pPeerInfo->ibssStaInfo[staId].tlSTAState = WLANTL_STA_AUTHENTICATED; + pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; + + return( vosStatus ); +} + +/* TODO Revist this function. and data path */ +static VOS_STATUS hdd_roamDeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) +{ + VOS_STATUS vosStatus; + + hdd_disconnect_tx_rx(pAdapter); + vosStatus = WLANTL_ClearSTAClient( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staId ); if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { @@ -802,6 +994,7 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } // notify apps that we can't pass traffic anymore + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(dev); netif_carrier_off(dev); //TxTimeoutCount need to reset in case of disconnect handler @@ -854,9 +1047,10 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * driver so not sending the status of the connection to supplicant*/ if(pHddCtx->isLoadUnloadInProgress == WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS) { - hddLog(VOS_TRACE_LEVEL_INFO_HIGH, - "%s: sent disconnected event to nl80211", - __func__); + if (sendDisconInd) + hddLog(VOS_TRACE_LEVEL_INFO_HIGH, + "%s: sent disconnected event to nl80211", + __func__); #ifdef WLAN_FEATURE_P2P_DEBUG if(pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) { @@ -874,6 +1068,10 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } } #endif + if ((roamStatus == eCSR_ROAM_LOSTLINK) && + !pRoamInfo->reasonCode) + wlan_hdd_get_frame_logs(pAdapter, + WLAN_HDD_GET_FRAME_LOG_CMD_SEND_AND_CLEAR); /*Only send indication to kernel if not initiated by kernel*/ if ( sendDisconInd ) { @@ -887,6 +1085,14 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); } } + + if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) + { + hddLog(LOG1, + FL("P2P client is getting removed and we are tryig to re-enable TDLS")); + wlan_hdd_tdls_reenable(pHddCtx); + } + //If the Device Mode is Station // and the P2P Client is Connected //Enable BMPS @@ -928,38 +1134,98 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * if (eCSR_ROAM_IBSS_LEAVE == roamStatus) { + v_U8_t i; + sta_id = IBSS_BROADCAST_STAID; - vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); + vstatus = hdd_ibss_DeregisterSTA( pAdapter, sta_id ); if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "hdd_roamDeregisterSTA() failed to for staID %d. " - "Status= %d [0x%x]", + FL("hdd_roamDeregisterSTA() failed to for staID %d. " + "Status= %d [0x%x]"), sta_id, status, status ); status = eHAL_STATUS_FAILURE; } - pHddCtx->sta_to_adapter[sta_id] = NULL; - } + /*Clear all the peer sta register with TL.*/ + for (i =0; i < HDD_MAX_NUM_IBSS_STA; i++ ) + { + if (0 != pHddStaCtx->conn_info.staId[i]) + { + sta_id = pHddStaCtx->conn_info.staId[i]; + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Deregister StaID %d"),sta_id); + vstatus = hdd_ibss_DeregisterSTA( pAdapter, sta_id ); + if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("hdd_roamDeregisterSTA() failed to for staID %d. " + "Status= %d [0x%x]"), + sta_id, status, status ); + status = eHAL_STATUS_FAILURE; + } + + vstatus = hdd_sta_id_hash_remove_entry(pAdapter, + sta_id, &pHddStaCtx->conn_info.peerMacAddress[i]); + if (vstatus != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not able to remove staid hash %d"), + sta_id); + status = eHAL_STATUS_FAILURE; + } else { + hddLog(VOS_TRACE_LEVEL_INFO, + FL("ibss station removed sta_id %d mac:" + MAC_ADDRESS_STR), sta_id, + MAC_ADDR_ARRAY(pHddStaCtx->conn_info.peerMacAddress[i].bytes)); + } + /*set the staid and peer mac as 0, all other reset are + * done in hdd_connRemoveConnectInfo. + */ + pHddStaCtx->conn_info.staId[i]= 0; + vos_mem_zero( &pHddStaCtx->conn_info.peerMacAddress[i], sizeof( v_MACADDR_t ) ); - sta_id = pHddStaCtx->conn_info.staId[0]; + if (sta_id < (WLAN_MAX_STA_COUNT + 3)) + pHddCtx->sta_to_adapter[sta_id] = NULL; + } + } - //We should clear all sta register with TL, for now, only one. - vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); - if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) + } + else { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "hdd_roamDeregisterSTA() failed to for staID %d. " - "Status= %d [0x%x]", + sta_id = pHddStaCtx->conn_info.staId[0]; + + //We should clear all sta register with TL, for now, only one. + vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); + if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("hdd_roamDeregisterSTA() failed to for staID %d. " + "Status= %d [0x%x]"), sta_id, status, status ); - status = eHAL_STATUS_FAILURE; + status = eHAL_STATUS_FAILURE; + } + + pHddCtx->sta_to_adapter[sta_id] = NULL; } - pHddCtx->sta_to_adapter[sta_id] = NULL; +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + if (VOS_STATUS_SUCCESS != + WLANTL_ClearInterfaceStats((WLAN_HDD_GET_CTX(pAdapter))->pvosContext, + pHddStaCtx->conn_info.staId[0], WIFI_STATS_IFACE_AC)) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s:" + "WLANTL_ClearInterfaceStats Failed", __func__); + } + pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VO] = 0; + pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VI] = 0; + pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BE] = 0; + pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BK] = 0; +#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ // Clear saved connection information in HDD hdd_connRemoveConnectInfo( pHddStaCtx ); @@ -988,6 +1254,56 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * complete(&pAdapter->disconnect_comp_var); return( status ); } + +static void hdd_postTLPacketPendingInd(hdd_adapter_t *pAdapter, + v_U8_t staId) +{ + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + v_SINT_t i; + v_SIZE_t size; + VOS_STATUS status; + v_BOOL_t granted = VOS_FALSE; + + if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) || + (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) || + (pAdapter->device_mode == WLAN_HDD_P2P_DEVICE)) + { + //Indicate to TL that there is pending data if a queue is non empty + for (i = WLANTL_AC_HIGH_PRIO; i>=0; --i) + { + size = 0; + hdd_list_size(&pAdapter->wmm_tx_queue[i], &size); + if (size > 0) + { + if (i != WLANTL_AC_HIGH_PRIO) + { + if (VOS_FALSE == + pAdapter->hddWmmStatus.wmmAcStatus[i].wmmAcAccessAllowed) + { + hdd_wmm_acquire_access(pAdapter, + (WLANTL_ACEnumType)i, &granted); + pAdapter->psbChanged |= (1 << i); + } + else + granted = VOS_TRUE; + } + + if (granted || (i == WLANTL_AC_HIGH_PRIO)) + { + status = WLANTL_STAPktPending(pHddCtx->pvosContext, + staId, (WLANTL_ACEnumType)i); + if (!VOS_IS_STATUS_SUCCESS(status)) + { + VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, + "%s: Failure in indicating pkt to TL for QID=%d", + __func__, i); + } + } + } + } + } +} + static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, v_U8_t staId, @@ -1009,26 +1325,12 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, // Get the Station ID from the one saved during the assocation. staDesc.ucSTAId = staId; - if ( pHddStaCtx->conn_info.connDot11DesiredBssType == eMib_dot11DesiredBssType_infrastructure) - { - staDesc.wSTAType = WLAN_STA_INFRA; + staDesc.wSTAType = WLAN_STA_INFRA; - // grab the bssid from the connection info in the adapter structure and hand that - // over to TL when registering. - vos_mem_copy( staDesc.vSTAMACAddress.bytes, pHddStaCtx->conn_info.bssId,sizeof(pHddStaCtx->conn_info.bssId) ); - } - else - { - // for an IBSS 'connect', setup the Station Descriptor for TL. - staDesc.wSTAType = WLAN_STA_IBSS; - - // Note that for IBSS, the STA MAC address and BSSID are goign to be different where - // in infrastructure, they are the same (BSSID is the MAC address of the AP). So, - // for IBSS we have a second field to pass to TL in the STA descriptor that we don't - // pass when making an Infrastructure connection. - vos_mem_copy( staDesc.vSTAMACAddress.bytes, pPeerMacAddress->bytes,sizeof(pPeerMacAddress->bytes) ); - vos_mem_copy( staDesc.vBSSIDforIBSS.bytes, pHddStaCtx->conn_info.bssId,6 ); - } + // grab the bssid from the connection info in the adapter structure and hand that + // over to TL when registering. + vos_mem_copy( staDesc.vSTAMACAddress.bytes, pHddStaCtx->conn_info.bssId, + sizeof(pHddStaCtx->conn_info.bssId) ); vos_copy_macaddr( &staDesc.vSelfMACAddress, &pAdapter->macAddressCurrent ); @@ -1057,7 +1359,6 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, staDesc.ucIsEseSta = pRoamInfo->isESEAssoc; #endif //FEATURE_WLAN_ESE -#ifdef VOLANS_ENABLE_SW_REPLAY_CHECK /* check whether replay check is valid for the station or not */ if( (eCSR_ENCRYPT_TYPE_TKIP == connectedCipherAlgo) || (eCSR_ENCRYPT_TYPE_AES == connectedCipherAlgo)) { @@ -1068,7 +1369,6 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "HDD register TL ucIsReplayCheckValid %d: Replay check is needed for station", staDesc.ucIsReplayCheckValid); } - else { /* For other encryption modes replay check is @@ -1077,7 +1377,6 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "HDD register TL ucIsReplayCheckValid %d", staDesc.ucIsReplayCheckValid); } -#endif #ifdef FEATURE_WLAN_WAPI hddLog(LOG1, "%s: WAPI STA Registered: %d", __func__, pAdapter->wapi_info.fIsWapiSta); @@ -1144,6 +1443,8 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, WLANTL_STA_AUTHENTICATED ); pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; + + hdd_postTLPacketPendingInd(pAdapter, staDesc.ucSTAId); } else { @@ -1252,9 +1553,10 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /* HDD has initiated disconnect, do not send connect result indication * to kernel as it will be handled by __cfg80211_disconnect. */ - if(( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) && - (( eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || - ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)) ) + if (((eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) || + (eConnectionState_NotConnected == pHddStaCtx->conn_info.connState)) && + ((eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || + (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus))) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL(" Disconnect from HDD in progress ")); @@ -1335,9 +1637,6 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs else hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Wrong Staid: %d", __func__, pRoamInfo->staId); -#ifdef FEATURE_WLAN_TDLS - wlan_hdd_tdls_connection_callback(pAdapter); -#endif //For reassoc, the station is already registered, all we need is to change the state //of the STA in TL. //If authentication is required (WPA/WPA2/DWEP), change TL to CONNECTED instead of AUTHENTICATED @@ -1422,10 +1721,10 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs (int)pRoamInfo->pBssDesc->channelId); hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, assocRsplen); -#ifdef DEBUG_ROAM_DELAY - //HACK we are using the buff len as Auth Type - vos_record_roam_event(e_HDD_SEND_REASSOC_RSP, NULL, 0); -#endif + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_SEND_REASSOC_RSP, NULL, 0); + } cfg80211_roamed(dev,chan, pRoamInfo->bssid, pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, GFP_KERNEL); @@ -1476,10 +1775,10 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs if(ft_carrier_on) { hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); -#ifdef DEBUG_ROAM_DELAY - //HACK we are using the buff len as Auth Type - vos_record_roam_event(e_HDD_SEND_REASSOC_RSP, NULL, 0); -#endif + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_SEND_REASSOC_RSP, NULL, 0); + } } else #endif /* FEATURE_WLAN_ESE */ @@ -1488,7 +1787,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs hddLog(VOS_TRACE_LEVEL_INFO, "%s: sending connect indication to nl80211:" " for bssid " MAC_ADDRESS_STR - " reason:%d and Status:%d\n", + " result:%d and Status:%d", __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), roamResult, roamStatus); @@ -1543,6 +1842,8 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs pHddStaCtx->conn_info.staId[ 0 ], WLANTL_STA_AUTHENTICATED ); pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; + hdd_postTLPacketPendingInd(pAdapter, + pHddStaCtx->conn_info.staId[0]); } } @@ -1561,11 +1862,19 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs vos_mem_zero( &pAdapter->hdd_stats.hddPmfStats, sizeof(pAdapter->hdd_stats.hddPmfStats) ); #endif + // Start the Queue if ( !hddDisconInProgress ) + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_wake_all_queues(dev); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_ENABLE_TX_QUEUE, NULL, 0); + } + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_ENABLE_TX_QUEUE, NULL, 0); + } +#ifdef FEATURE_WLAN_TDLS + wlan_hdd_tdls_connection_callback(pAdapter); #endif } else @@ -1575,15 +1884,21 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); if (pRoamInfo) pr_info("wlan: connection failed with " MAC_ADDRESS_STR - " reason:%d and Status:%d\n", + " result:%d and Status:%d", MAC_ADDR_ARRAY(pRoamInfo->bssid), roamResult, roamStatus); else pr_info("wlan: connection failed with " MAC_ADDRESS_STR - " reason:%d and Status:%d\n", + " result:%d and Status:%d", MAC_ADDR_ARRAY(pWextState->req_bssId), roamResult, roamStatus); + if (( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus) || + ((roamResult != eCSR_ROAM_RESULT_ASSOCIATED) && + (eCSR_ROAM_ASSOCIATION_COMPLETION == roamStatus))) + wlan_hdd_get_frame_logs(pAdapter, + WLAN_HDD_GET_FRAME_LOG_CMD_SEND_AND_CLEAR); + /* Set connection state to eConnectionState_NotConnected only when CSR * has completed operation - with a ASSOCIATION_FAILURE status */ @@ -1638,24 +1953,29 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs * completed operation - with a ASSOCIATION_FAILURE status.*/ if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) { + + if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) + { + hddLog(LOG1, + FL("Assoication Failure for P2P client and we are trying to re-enable TDLS")); + wlan_hdd_tdls_reenable(pHddCtx); + } + if (pRoamInfo) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: send connect failure to nl80211:" " for bssid " MAC_ADDRESS_STR - " reason:%d and Status:%d\n" , + " result:%d and Status:%d reasonCode %d" , __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), - roamResult, roamStatus); + roamResult, roamStatus, pRoamInfo->reasonCode); else hddLog(VOS_TRACE_LEVEL_ERROR, "%s: connect failed:" " for bssid " MAC_ADDRESS_STR - " reason:%d and Status:%d\n" , + " result:%d and Status:%d" , __func__, MAC_ADDR_ARRAY(pWextState->req_bssId), roamResult, roamStatus); - /*Clear the roam profile*/ - hdd_clearRoamProfileIe( pAdapter ); - /* inform association failure event to nl80211 */ if ( eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL == roamResult ) { @@ -1672,28 +1992,21 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs } else { - if (pRoamInfo){ - eCsrAuthType authType = - pWextState->roamProfile.AuthType.authType[0]; - v_BOOL_t isWep = (authType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || - (authType == eCSR_AUTH_TYPE_SHARED_KEY); - - /* In case of OPEN-WEP or SHARED-WEP authentication, - * send exact protocol reason code. This enables user - * applications to reconnect the station with correct - * configuration. - */ + if (pRoamInfo) cfg80211_connect_result ( dev, pRoamInfo->bssid, NULL, 0, NULL, 0, - isWep ? pRoamInfo->reasonCode : + pRoamInfo->reasonCode ? + pRoamInfo->reasonCode : WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_KERNEL ); - } else + else cfg80211_connect_result ( dev, pWextState->req_bssId, NULL, 0, NULL, 0, WLAN_STATUS_UNSPECIFIED_FAILURE, - GFP_KERNEL ); + GFP_KERNEL ); } + /*Clear the roam profile*/ + hdd_clearRoamProfileIe( pAdapter ); } hdd_wmm_init( pAdapter ); @@ -1703,6 +2016,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs WLANTL_AssocFailed(pRoamInfo->staId); } + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(dev); netif_carrier_off(dev); @@ -1722,7 +2036,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs hddLog(VOS_TRACE_LEVEL_INFO,"Restart Sap as SAP channel is %d " "and STA channel is %d", pHostapdAdapter->sessionCtx.ap.operatingChannel, (int)pRoamInfo->pBssDesc->channelId); - hdd_restart_softap(pHddCtx, pHostapdAdapter); + hdd_hostapd_stop(pHostapdAdapter->dev); } } } @@ -1741,6 +2055,11 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ) { + hdd_context_t *pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; + v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; + struct cfg80211_bss *bss; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: id %d, status %d, result %d", __func__, pAdapter->dev->name, roamId, roamStatus, roamResult); @@ -1751,9 +2070,6 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS: case eCSR_ROAM_RESULT_IBSS_COALESCED: { - hdd_context_t *pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; - v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; - if (NULL == pRoamInfo) { VOS_ASSERT(0); @@ -1772,13 +2088,17 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, /*notify wmm */ hdd_wmm_connect(pAdapter, pRoamInfo, eCSR_BSS_TYPE_IBSS); pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = pAdapter; - hdd_roamRegisterSTA (pAdapter, pRoamInfo, - IBSS_BROADCAST_STAID, - &broadcastMacAddr, pRoamInfo->pBssDesc); if (pRoamInfo->pBssDesc) { - struct cfg80211_bss *bss; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + struct ieee80211_channel *chan; + int chan_no; + unsigned int freq; +#endif + hdd_ibss_RegisterSTA (pAdapter, pRoamInfo, + IBSS_BROADCAST_STAID, + &broadcastMacAddr, pRoamInfo->pBssDesc); /* we created the IBSS, notify supplicant */ hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: created ibss " @@ -1795,15 +2115,68 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, __func__, pAdapter->dev->name); return; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + chan_no = pRoamInfo->pBssDesc->channelId; + if (chan_no <= 14) + freq = ieee80211_channel_to_frequency(chan_no, + IEEE80211_BAND_2GHZ); + else + freq = ieee80211_channel_to_frequency(chan_no, + IEEE80211_BAND_5GHZ); + + chan = ieee80211_get_channel(pAdapter->wdev.wiphy, freq); + + if (chan) + cfg80211_ibss_joined(pAdapter->dev, bss->bssid, + chan, GFP_KERNEL); + else + hddLog(LOGE, FL("%s: chanId: %d, can't find channel"), + pAdapter->dev->name, + (int)pRoamInfo->pBssDesc->channelId); +#else cfg80211_ibss_joined(pAdapter->dev, bss->bssid, GFP_KERNEL); +#endif cfg80211_put_bss( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) pHddCtx->wiphy, #endif bss); } + else + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: NULL Bss Desc",__func__); + } + /* Set Broadcast key again in case IBSS_COALESCED as DEL BSS, + * in IBSS_COALESCED will remove the BC key. + */ + if ((eCSR_ROAM_RESULT_IBSS_COALESCED == roamResult) && + ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY + == pHddStaCtx->ibss_enc_key.encType + ||eCSR_ENCRYPT_TYPE_WEP104_STATICKEY + == pHddStaCtx->ibss_enc_key.encType + ||eCSR_ENCRYPT_TYPE_TKIP == pHddStaCtx->ibss_enc_key.encType + ||eCSR_ENCRYPT_TYPE_AES == pHddStaCtx->ibss_enc_key.encType )) + { + u8 grpmacaddr[WNI_CFG_BSSID_LEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; + VOS_STATUS vosStatus; + + pHddStaCtx->ibss_enc_key.keyDirection = eSIR_TX_RX; + + memcpy(&pHddStaCtx->ibss_enc_key.peerMac, + grpmacaddr, WNI_CFG_BSSID_LEN); + hddLog(VOS_TRACE_LEVEL_INFO, + FL(" SET GTK in case of COALESCED")); + vosStatus = sme_RoamSetKey( WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, &pHddStaCtx->ibss_enc_key, &roamId ); + if ( VOS_STATUS_SUCCESS != vosStatus ) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sme_RoamSetKey failed, returned %d"),vosStatus); + } + } break; } @@ -1832,10 +2205,12 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, return FALSE. ===========================================================================*/ -static int roamSaveIbssStation( hdd_station_ctx_t *pHddStaCtx, v_U8_t staId, v_MACADDR_t *peerMacAddress ) +static int roamSaveIbssStation(hdd_adapter_t *pAdapter, v_U8_t staId, v_MACADDR_t *peerMacAddress) { int fSuccess = FALSE; int idx = 0; + VOS_STATUS status; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); for ( idx = 0; idx < HDD_MAX_NUM_IBSS_STA; idx++ ) { @@ -1850,6 +2225,18 @@ static int roamSaveIbssStation( hdd_station_ctx_t *pHddStaCtx, v_U8_t staId, v_M } } + status = hdd_sta_id_hash_add_entry(pAdapter, staId, peerMacAddress); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not able to add staid hash %d"), staId); + return FALSE; + } + + hddLog(VOS_TRACE_LEVEL_INFO, + FL("New station added sta_id %d mac:" + MAC_ADDRESS_STR), staId, + MAC_ADDR_ARRAY(peerMacAddress->bytes)); + return( fSuccess ); } /**============================================================================ @@ -1867,21 +2254,32 @@ static int roamRemoveIbssStation( hdd_adapter_t *pAdapter, v_U8_t staId ) v_U8_t del_idx = 0; v_U8_t empty_slots = 0; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + VOS_STATUS status; for ( idx = 0; idx < HDD_MAX_NUM_IBSS_STA; idx++ ) { if ( staId == pHddStaCtx->conn_info.staId[ idx ] ) { pHddStaCtx->conn_info.staId[ idx ] = 0; - - vos_zero_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ idx ] ); - - fSuccess = TRUE; - - // Note the deleted Index, if its 0 we need special handling - del_idx = idx; - - empty_slots++; + status = hdd_sta_id_hash_remove_entry(pAdapter, + staId, &pHddStaCtx->conn_info.peerMacAddress[idx]); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not able to remove staid hash %d"), staId ); + fSuccess = FALSE; + } else { + hddLog(VOS_TRACE_LEVEL_INFO, + FL("station removed sta_id %d mac:" + MAC_ADDRESS_STR), staId, + MAC_ADDR_ARRAY(pHddStaCtx->conn_info.peerMacAddress[idx].bytes)); + + vos_zero_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ idx ] ); + + fSuccess = TRUE; + // Note the deleted Index, if its 0 we need special handling + del_idx = idx; + empty_slots++; + } } else { @@ -2049,7 +2447,9 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo v_BOOL_t fConnected = FALSE; VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + WLANTL_STAStateType prevTLState = WLANTL_STA_INIT; ENTER(); if (NULL == pRoamInfo) @@ -2079,6 +2479,8 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo { vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext, IBSS_BROADCAST_STAID); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "WLAN TL STA GTK Installed for STAID=%d", IBSS_BROADCAST_STAID); pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; } else @@ -2098,6 +2500,9 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo } else { + WLANTL_GetSTAState(pHddCtx->pvosContext, + pHddStaCtx->conn_info.staId[0], + &prevTLState); // TODO: Considering getting a state machine in HDD later. // This routine is invoked twice. 1)set PTK 2)set GTK. // The folloing if statement will be TRUE when setting GTK. @@ -2106,9 +2511,10 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo if ( ( eCSR_ROAM_RESULT_AUTHENTICATED == roamResult ) && (pRoamInfo != NULL) && !pRoamInfo->fAuthRequired ) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, "Key set " - "for StaId= %d. Changing TL state to AUTHENTICATED", - pHddStaCtx->conn_info.staId[ 0 ] ); + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, "Key set " + "for StaId=%d. Changing TL state to AUTHENTICATED from" + " state:%d", pHddStaCtx->conn_info.staId[0], prevTLState); // Connections that do not need Upper layer authentication, // transition TL to 'Authenticated' state after the keys are set. @@ -2117,6 +2523,10 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo WLANTL_STA_AUTHENTICATED ); pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; + + if (WLANTL_STA_AUTHENTICATED != prevTLState) + hdd_postTLPacketPendingInd(pAdapter, + pHddStaCtx->conn_info.staId[0]); //Need to call offload because when roaming happen at that time fwr //clean offload info as part of the DelBss // No need to configure offload if host was not suspended @@ -2130,17 +2540,41 @@ static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRo { spin_unlock(&pHddCtx->filter_lock); } -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_SET_GTK_RSP, NULL, 0); -#endif + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_SET_GTK_RSP, NULL, 0); + } } else { vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext, pHddStaCtx->conn_info.staId[ 0 ]); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_SET_PTK_RSP, (void *)pRoamInfo->peerMac, 6); -#endif + + /* In case of OSEN move TL to 'Authenticated' after PTK is set */ + if (pWextState->roamProfile.bOSENAssociation == VOS_TRUE) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, "PTK set" + " for StaId=%d. Due to OSEN, Changing TL state to" + "AUTHENTICATED from state:%d", + pHddStaCtx->conn_info.staId[0], prevTLState); + + vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, + pHddStaCtx->conn_info.staId[ 0 ], + WLANTL_STA_AUTHENTICATED ); + + pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; + + if (WLANTL_STA_AUTHENTICATED != prevTLState) + hdd_postTLPacketPendingInd(pAdapter, + pHddStaCtx->conn_info.staId[0]); + } + + + + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_SET_PTK_RSP, (void *)pRoamInfo->peerMac, 6); + } } pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; @@ -2215,7 +2649,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t case eCSR_ROAM_RESULT_IBSS_NEW_PEER: { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - struct station_info staInfo; + struct station_info *staInfo; pr_info ( "IBSS New Peer indication from SME " "with peerMac " MAC_ADDRESS_STR " BSSID: " MAC_ADDRESS_STR " and stationID= %d", @@ -2223,7 +2657,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId), pRoamInfo->staId ); - if ( !roamSaveIbssStation( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pRoamInfo->staId, (v_MACADDR_t *)pRoamInfo->peerMac ) ) + if ( !roamSaveIbssStation( pAdapter, pRoamInfo->staId, (v_MACADDR_t *)pRoamInfo->peerMac ) ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "New IBSS peer but we already have the max we can handle. Can't register this one" ); @@ -2237,7 +2671,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t IBSS_BROADCAST_STAID,pHddStaCtx->conn_info.bssId); // Register the Station with TL for the new peer. - vosStatus = hdd_roamRegisterSTA( pAdapter, + vosStatus = hdd_ibss_RegisterSTA( pAdapter, pRoamInfo, pRoamInfo->staId, (v_MACADDR_t *)pRoamInfo->peerMac, @@ -2249,13 +2683,22 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t vosStatus, vosStatus ); } pHddStaCtx->ibss_sta_generation++; - memset(&staInfo, 0, sizeof(staInfo)); - staInfo.filled = 0; - staInfo.generation = pHddStaCtx->ibss_sta_generation; + + staInfo = vos_mem_malloc(sizeof(*staInfo)); + if (staInfo == NULL) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "memory allocation for station_info failed"); + return eHAL_STATUS_FAILED_ALLOC; + } + + memset(staInfo, 0, sizeof(*staInfo)); + staInfo->filled = 0; + staInfo->generation = pHddStaCtx->ibss_sta_generation; cfg80211_new_sta(pAdapter->dev, (const u8 *)pRoamInfo->peerMac, - &staInfo, GFP_KERNEL); + staInfo, GFP_KERNEL); + vos_mem_free(staInfo); if ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pHddStaCtx->ibss_enc_key.encType ||eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pHddStaCtx->ibss_enc_key.encType @@ -2263,6 +2706,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t ||eCSR_ENCRYPT_TYPE_AES == pHddStaCtx->ibss_enc_key.encType ) { pHddStaCtx->ibss_enc_key.keyDirection = eSIR_TX_RX; + memcpy(&pHddStaCtx->ibss_enc_key.peerMac, pRoamInfo->peerMac, WNI_CFG_BSSID_LEN); @@ -2282,6 +2726,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t } } netif_carrier_on(pAdapter->dev); + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues(pAdapter->dev); break; } @@ -2309,7 +2754,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId), pRoamInfo->staId ); - hdd_roamDeregisterSTA( pAdapter, pRoamInfo->staId ); + hdd_ibss_DeregisterSTA( pAdapter, pRoamInfo->staId ); pHddCtx->sta_to_adapter[pRoamInfo->staId] = NULL; pHddStaCtx->ibss_sta_generation++; @@ -2324,6 +2769,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, "Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME"); // Stop only when we are inactive + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, @@ -2353,8 +2799,13 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t Return: VOS_STATUS ===========================================================================*/ -VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, - tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig) +VOS_STATUS hdd_roamRegisterTDLSSTA(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *peerMac, +#else + tANI_U8 *peerMac, +#endif + tANI_U16 staId, tANI_U8 ucastSig) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; @@ -2411,12 +2862,10 @@ VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, /* tdls Direct Link do not need bcastSig */ staDesc.ucBcastSig = 0 ; -#ifdef VOLANS_ENABLE_SW_REPLAY_CHECK if(staDesc.ucProtectedFrame) staDesc.ucIsReplayCheckValid = VOS_TRUE; else staDesc.ucIsReplayCheckValid = VOS_FALSE; -#endif staDesc.ucInitState = WLANTL_STA_CONNECTED ; @@ -2444,7 +2893,7 @@ VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, return( vosStatus ); } -static VOS_STATUS hdd_roamDeregisterTDLSSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) +VOS_STATUS hdd_roamDeregisterTDLSSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) { VOS_STATUS vosStatus; vosStatus = WLANTL_ClearSTAClient( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staId ); @@ -2475,7 +2924,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, eHalStatus status = eHAL_STATUS_FAILURE ; tANI_U8 staIdx; -#ifdef WLAN_FEATURE_TDLS_DEBUG VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, ("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR), roamResult == eCSR_ROAM_RESULT_ADD_TDLS_PEER ? @@ -2491,7 +2939,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, roamResult == eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP ? "LINK_ESTABLISH_REQ_RSP" : "UNKNOWN", pRoamInfo->staId, MAC_ADDR_ARRAY(pRoamInfo->peerMac)); -#endif switch( roamResult ) { case eCSR_ROAM_RESULT_ADD_TDLS_PEER: @@ -2500,6 +2947,7 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("%s: Add Sta is failed. %d"),__func__, pRoamInfo->statusCode); + wlan_hdd_tdls_check_bmps(pAdapter); } else { @@ -2541,6 +2989,7 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, pRoamInfo->peerMac, pRoamInfo->staId, pRoamInfo->ucastSig); + wlan_hdd_tdls_increment_peer_count(pAdapter); } else { @@ -2588,12 +3037,28 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, ("HDD: del STA IDX = %x"), pRoamInfo->staId) ; - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac, TRUE); - if (NULL != curr_peer && TDLS_IS_CONNECTED(curr_peer)) + mutex_lock(&pHddCtx->tdls_lock); + curr_peer = wlan_hdd_tdls_find_peer(pAdapter, + pRoamInfo->peerMac, FALSE); + if (NULL != curr_peer) { - hdd_roamDeregisterTDLSSTA ( pAdapter, pRoamInfo->staId ); - wlan_hdd_tdls_decrement_peer_count(pAdapter); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + " Current status for peer" MAC_ADDRESS_STR "is %d", + MAC_ADDR_ARRAY(pRoamInfo->peerMac), curr_peer->link_status); + if (TDLS_IS_CONNECTED(curr_peer) || + (eTDLS_LINK_CONNECTING == curr_peer->link_status)) + { + mutex_unlock(&pHddCtx->tdls_lock); + hdd_roamDeregisterTDLSSTA ( pAdapter, pRoamInfo->staId ); + } + else + mutex_unlock(&pHddCtx->tdls_lock); + + wlan_hdd_tdls_decrement_peer_count(pAdapter); } + else + mutex_unlock(&pHddCtx->tdls_lock); + wlan_hdd_tdls_reset_peer(pAdapter, pRoamInfo->peerMac); pHddCtx->tdlsConnInfo[staIdx].staId = 0 ; @@ -2616,8 +3081,11 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, __func__, pRoamInfo->reasonCode); #ifdef CONFIG_TDLS_IMPLICIT - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac, TRUE); + mutex_lock(&pHddCtx->tdls_lock); + curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac, + FALSE); wlan_hdd_tdls_indicate_teardown(pAdapter, curr_peer, pRoamInfo->reasonCode); + mutex_unlock(&pHddCtx->tdls_lock); #endif status = eHAL_STATUS_SUCCESS ; break ; @@ -2665,10 +3133,12 @@ static void iw_full_power_cbfn (void *pContext, eHalStatus status) hdd_context_t *pHddCtx = NULL; int ret; + ENTER(); + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pAdapter [%p]", + "%s: Bad param, pAdapter [%pK]", __func__, pAdapter); return; } @@ -2677,8 +3147,6 @@ static void iw_full_power_cbfn (void *pContext, eHalStatus status) ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid (%d)", __func__, ret); return; } @@ -2686,6 +3154,8 @@ static void iw_full_power_cbfn (void *pContext, eHalStatus status) { sme_RequestBmps(WLAN_HDD_GET_HAL_CTX(pAdapter), NULL, NULL); } + + EXIT(); } eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, @@ -2720,6 +3190,9 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 return eHAL_STATUS_FAILURE; } + + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_RX_SME_MSG, + pAdapter->sessionId, roamStatus)); switch( roamStatus ) { case eCSR_ROAM_SESSION_OPENED: @@ -2759,28 +3232,29 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 // after reassoc. { struct net_device *dev = pAdapter->dev; + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(dev); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_DISABLE_TX_QUEUE, NULL, 0); -#endif + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_DISABLE_TX_QUEUE, NULL, 0); + } /* - * Deregister for this STA with TL with the objective to flush - * all the packets for this STA from wmm_tx_queue. If not done here, - * we would run into a race condition (CR390567) wherein TX - * thread would schedule packets from wmm_tx_queue AFTER peer STA has - * been deleted. And, these packets get assigned with a STA idx of - * self-sta (since the peer STA has been deleted) and get transmitted - * on the new channel before the reassoc request. Since there will be - * no ACK on the new channel, each packet gets retransmitted which - * takes several seconds before the transmission of reassoc request. - * This leads to reassoc-timeout and roam failure. + * Deregister this STA with TL, but do not flush the packets + * for this STA from wmm_tx_queue. Since there is no valid STA + * for these packets they will not be transmitted. Eventually + * after the reassociation is successful, these packets will be + * transmitted after registering STA with TL again. This ensures + * that driver does not drop packets during roaming. */ - status = hdd_roamDeregisterSTA( pAdapter, pHddStaCtx->conn_info.staId [0] ); - if ( !VOS_IS_STATUS_SUCCESS(status ) ) + status = WLANTL_ClearSTAClient(pHddCtx->pvosContext, + pHddStaCtx->conn_info.staId[0]); + if (!VOS_IS_STATUS_SUCCESS(status)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - FL("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]"), - pHddStaCtx->conn_info.staId[0], status, status ); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("WLANTL_ClearSTAClient failed for staID %d." + "Status= %d [0x%x]"), pHddStaCtx->conn_info.staId[0], + status, status); halStatus = eHAL_STATUS_FAILURE; } } @@ -2795,6 +3269,7 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 struct net_device *dev = pAdapter->dev; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); // notify apps that we can't pass traffic anymore + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(dev); #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) if (pHddStaCtx->ft_carrier_on == FALSE) @@ -2886,15 +3361,26 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 case eCSR_ROAM_MIC_ERROR_IND: halStatus = hdd_RoamMicErrorIndicationHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); break; - + case eCSR_ROAM_LOST_LINK_PARAMS_IND: + { + /* + * The RSSI will be subtracted from 100 as FW is sending the RSSI by + * adding the 100 value. + */ + pAdapter->rssi_on_disconnect = pRoamInfo->u.pLostLinkParams->rssi - 100; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s : Rssi on Disconnect : %d", + __func__, pAdapter->rssi_on_disconnect); + break; + } case eCSR_ROAM_SET_KEY_COMPLETE: { hdd_context_t* pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; if((pHddCtx) && - (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) && (TRUE == pHddCtx->hdd_wlan_suspended) && - (eCSR_ROAM_RESULT_NONE == roamResult)) + ((eCSR_ROAM_RESULT_NONE == roamResult)|| + (pRoamInfo && pRoamInfo->is11rAssoc))) { /* Send DTIM period to the FW; only if the wlan is already in suspend. This is the case with roaming (reassoc), @@ -2903,7 +3389,6 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 before the ENTER_BMPS_REQ ensures Listen Interval is regained back to LI * Modulated DTIM */ hdd_set_pwrparams(pHddCtx); - pHddStaCtx->hdd_ReassocScenario = VOS_FALSE; /* At this point, device should not be in BMPS; if due to unexpected scenario, if we are in BMPS, @@ -2918,8 +3403,27 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 eSME_FULL_PWR_NEEDED_BY_HDD); } } + + if ((pHddCtx) && + (FULL_POWER == pmcGetPmcState(pHddCtx->hHal)) && + (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) && + ((eCSR_ROAM_RESULT_NONE == roamResult) || + (pRoamInfo && pRoamInfo->is11rAssoc))) + { + hddLog( LOG1, FL("Device in full power." + "Stop and start traffic timer for roaming")); + pmcStopTrafficTimer(pHddCtx->hHal); + if (pmcStartTrafficTimer(pHddCtx->hHal, + TRAFFIC_TIMER_ROAMING) != eHAL_STATUS_SUCCESS) + { + hddLog(LOGP, FL("Cannot start traffic timer")); + } + } + halStatus = hdd_RoamSetKeyCompleteHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); - pHddStaCtx->hdd_ReassocScenario = FALSE; + if ((eCSR_ROAM_RESULT_NONE == roamResult) || + (pRoamInfo && pRoamInfo->is11rAssoc)) + pHddStaCtx->hdd_ReassocScenario = FALSE; } break; #ifdef WLAN_FEATURE_VOWIFI_11R @@ -2974,15 +3478,6 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 } break; #endif - - case eCSR_ROAM_INDICATE_MGMT_FRAME: - hdd_indicateMgmtFrame( pAdapter, - pRoamInfo->nFrameLength, - pRoamInfo->pbFrames, - pRoamInfo->frameType, - pRoamInfo->rxChan, - pRoamInfo->rxRssi ); - break; case eCSR_ROAM_REMAIN_CHAN_READY: hdd_remainChanReadyHandler( pAdapter ); break; @@ -3034,7 +3529,12 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 break; } #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ - default: + case eCSR_ROAM_UPDATE_MAX_RATE_IND: + { + pAdapter->maxRateFlags = roamResult; + break; + } + default: break; } return( halStatus ); @@ -3206,6 +3706,7 @@ static tANI_S32 hdd_ProcessGENIE(hdd_adapter_t *pAdapter, tDot11fIERSN dot11RSNIE; tDot11fIEWPA dot11WPAIE; tANI_U32 i; + tANI_U32 status; tANI_U8 *pRsnIe; tANI_U16 RSNIeLen; tPmkidCacheInfo PMKIDCache[4]; // Local transfer memory @@ -3216,14 +3717,6 @@ static tANI_S32 hdd_ProcessGENIE(hdd_adapter_t *pAdapter, memset( &dot11WPAIE, 0 , sizeof(tDot11fIEWPA) ); memset( &dot11RSNIE, 0 , sizeof(tDot11fIERSN) ); - // Validity checks - if ((gen_ie_len < VOS_MIN(DOT11F_IE_RSN_MIN_LEN, DOT11F_IE_WPA_MIN_LEN)) || - (gen_ie_len > VOS_MAX(DOT11F_IE_RSN_MAX_LEN, DOT11F_IE_WPA_MAX_LEN)) ) - { - hddLog(LOGE, "%s: Invalid DOT11F IE Length passed :%d", - __func__, gen_ie_len); - return -EINVAL; - } // Type check if ( gen_ie[0] == DOT11F_EID_RSN) { @@ -3239,10 +3732,17 @@ static tANI_S32 hdd_ProcessGENIE(hdd_adapter_t *pAdapter, pRsnIe = gen_ie + 2; RSNIeLen = gen_ie_len - 2; // Unpack the RSN IE - dot11fUnpackIeRSN((tpAniSirGlobal) halHandle, + status = dot11fUnpackIeRSN((tpAniSirGlobal) halHandle, pRsnIe, RSNIeLen, &dot11RSNIE); + if (DOT11F_FAILED(status)) + { + hddLog(LOGE, + FL("Parse failure in hdd_ProcessGENIE (0x%08x)"), + status); + return -EINVAL; + } // Copy out the encryption and authentication types hddLog(LOG1, FL("%s: pairwise cipher suite count: %d"), __func__, dot11RSNIE.pwise_cipher_suite_count ); @@ -3309,10 +3809,18 @@ static tANI_S32 hdd_ProcessGENIE(hdd_adapter_t *pAdapter, pRsnIe = gen_ie + 2 + 4; RSNIeLen = gen_ie_len - (2 + 4); // Unpack the WPA IE - dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, + status = dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, pRsnIe, RSNIeLen, &dot11WPAIE); + if (DOT11F_FAILED(status)) + { + hddLog(LOGE, + FL("Parse failure in hdd_ProcessGENIE (0x%08x)"), + status); + return -EINVAL; + } + // Copy out the encryption and authentication types hddLog(LOG1, FL("%s: WPA unicast cipher suite count: %d"), __func__, dot11WPAIE.unicast_cipher_count ); @@ -3340,8 +3848,8 @@ int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType) eCsrEncryptionType RSNEncryptType; eCsrEncryptionType mcRSNEncryptType; #ifdef WLAN_FEATURE_11W - u_int8_t RSNMfpRequired; - u_int8_t RSNMfpCapable; + u_int8_t RSNMfpRequired = 0; + u_int8_t RSNMfpCapable = 0; #endif struct ether_addr bSsid; // MAC address of assoc peer // MAC address of assoc peer @@ -3394,10 +3902,14 @@ int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType) } #ifdef WLAN_FEATURE_11W + hddLog( LOG1, FL("RSNMfpRequired = %d, RSNMfpCapable = %d"), + RSNMfpRequired, RSNMfpCapable); pWextState->roamProfile.MFPRequired = RSNMfpRequired; pWextState->roamProfile.MFPCapable = RSNMfpCapable; #endif - hddLog( LOG1, "%s: CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d", __func__, *RSNAuthType, RSNEncryptType, mcRSNEncryptType); + hddLog( LOG1, + FL("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d"), + *RSNAuthType, RSNEncryptType, mcRSNEncryptType); } return 0; } @@ -3519,7 +4031,7 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) /**--------------------------------------------------------------------------- - \brief iw_set_essid() - + \brief __iw_set_essid() - This function sets the ssid received from wpa_supplicant to the CSR roam profile. @@ -3531,31 +4043,59 @@ int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) --------------------------------------------------------------------------*/ -int iw_set_essid(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int __iw_set_essid(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { v_U32_t status = 0; hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; v_U32_t roamId; tCsrRoamProfile *pRoamProfile; eMib_dot11DesiredBssType connectedBssType; eCsrAuthType RSNAuthType; - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + tHalHandle hHal; + hdd_station_ctx_t *pHddStaCtx; + int ret = 0; ENTER(); - - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } if(pWextState->mTKIPCounterMeasures == TKIP_COUNTER_MEASURE_STARTED) { hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s :Counter measure is in progress", __func__); return -EBUSY; @@ -3678,8 +4218,46 @@ int iw_set_essid(struct net_device *dev, hdd_select_cbmode(pAdapter, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->AdHocChannel5G); } + /* + * Change conn_state to connecting before sme_RoamConnect(), + * because sme_RoamConnect() has a direct path to call + * hdd_smeRoamCallback(), which will change the conn_state + * If direct path, conn_state will be accordingly changed + * to NotConnected or Associated by either + * hdd_AssociationCompletionHandler() or hdd_DisConnectHandler() + * in sme_RoamCallback() + * if sme_RomConnect is to be queued, + * Connecting state will remain until it is completed. + * + * If connection state is not changed, + * connection state will remain in eConnectionState_NotConnected state. + * In hdd_AssociationCompletionHandler, "hddDisconInProgress" is set to true + * if conn state is eConnectionState_NotConnected. + * If "hddDisconInProgress" is set to true then cfg80211 layer is not + * informed of connect result indication which is an issue. + */ + if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode || + WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Set HDD connState to eConnectionState_Connecting")); + hdd_connSetConnectionState(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), + eConnectionState_Connecting); + } status = sme_RoamConnect( hHal,pAdapter->sessionId, &(pWextState->roamProfile), &roamId); + + if ((eHAL_STATUS_SUCCESS != status) && + (WLAN_HDD_INFRA_STATION == pAdapter->device_mode || + WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sme_RoamConnect (session %d) failed with status %d. -> NotConnected"), + pAdapter->sessionId, status); + /* change back to NotAssociated */ + hdd_connSetConnectionState(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), + eConnectionState_NotConnected); + } pRoamProfile->ChannelInfo.ChannelList = NULL; pRoamProfile->ChannelInfo.numOfChannels = 0; @@ -3687,9 +4265,22 @@ int iw_set_essid(struct net_device *dev, return status; } +int iw_set_essid(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_essid(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief iw_get_essid() - + \brief __iw_get_essid() - This function returns the essid to the wpa_supplicant. \param - dev - Pointer to the net device. @@ -3699,15 +4290,49 @@ int iw_set_essid(struct net_device *dev, \return - 0 for success, non zero for failure --------------------------------------------------------------------------*/ -int iw_get_essid(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, char *extra) +int __iw_get_essid(struct net_device *dev, + struct iw_request_info *info, + struct iw_point *dwrq, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_wext_state_t *wextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *wextBuf; + hdd_station_ctx_t *pHddStaCtx; + int ret = 0; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } + + wextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == wextBuf) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: wextBuf is NULL",__func__); + return -EINVAL; + } + if((pHddStaCtx->conn_info.connState == eConnectionState_Associated && wextBuf->roamProfile.SSIDs.SSIDList->SSID.length > 0) || ((pHddStaCtx->conn_info.connState == eConnectionState_IbssConnected || @@ -3725,9 +4350,22 @@ int iw_get_essid(struct net_device *dev, EXIT(); return 0; } + +int iw_get_essid(struct net_device *dev, + struct iw_request_info *info, + struct iw_point *dwrq, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_essid(dev, info, dwrq, extra); + vos_ssr_unprotect(__func__); + + return ret; +} /**--------------------------------------------------------------------------- - \brief iw_set_auth() - + \brief __iw_set_auth() - This function sets the auth type received from the wpa_supplicant. \param - dev - Pointer to the net device. @@ -3737,25 +4375,53 @@ int iw_get_essid(struct net_device *dev, \return - 0 for success, non zero for failure --------------------------------------------------------------------------*/ -int iw_set_auth(struct net_device *dev,struct iw_request_info *info, - union iwreq_data *wrqu,char *extra) +int __iw_set_auth(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); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pWextState; + hdd_station_ctx_t *pHddStaCtx; + tCsrRoamProfile *pRoamProfile; eCsrEncryptionType mcEncryptionType; eCsrEncryptionType ucEncryptionType; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } + + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + + pRoamProfile = &pWextState->roamProfile; + switch(wrqu->param.flags & IW_AUTH_INDEX) { case IW_AUTH_WPA_VERSION: @@ -3951,9 +4617,22 @@ int iw_set_auth(struct net_device *dev,struct iw_request_info *info, EXIT(); return 0; } + +int iw_set_auth(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_auth(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief iw_get_auth() - + \brief __iw_get_auth() - This function returns the auth type to the wpa_supplicant. \param - dev - Pointer to the net device. @@ -3963,21 +4642,41 @@ int iw_set_auth(struct net_device *dev,struct iw_request_info *info, \return - 0 for success, non zero for failure --------------------------------------------------------------------------*/ -int iw_get_auth(struct net_device *dev,struct iw_request_info *info, - union iwreq_data *wrqu,char *extra) +int __iw_get_auth(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); - hdd_wext_state_t *pWextState= WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile; + hdd_adapter_t* pAdapter; + hdd_wext_state_t *pWextState; + tCsrRoamProfile *pRoamProfile; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + pRoamProfile = &pWextState->roamProfile; + switch(pRoamProfile->negotiatedAuthType) { case eCSR_AUTH_TYPE_WPA_NONE: @@ -4089,9 +4788,22 @@ int iw_get_auth(struct net_device *dev,struct iw_request_info *info, EXIT(); return 0; } + +int iw_get_auth(struct net_device *dev,struct iw_request_info *info, + union iwreq_data *wrqu,char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_auth(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief iw_set_ap_address() - + \brief __iw_set_ap_address() - This function calls the sme_RoamConnect function to associate to the AP with the specified BSSID received from the wpa_supplicant. @@ -4102,24 +4814,64 @@ int iw_get_auth(struct net_device *dev,struct iw_request_info *info, \return - 0 for success, non zero for failure --------------------------------------------------------------------------*/ -int iw_set_ap_address(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int __iw_set_ap_address(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(WLAN_HDD_GET_PRIV_PTR(dev)); - v_U8_t *pMacAddress=NULL; + hdd_station_ctx_t *pHddStaCtx; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + v_U8_t *pMacAddress = NULL; + int ret = 0; + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL", __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pHddStaCtx is NULL", __func__); + return -EINVAL; + } + pMacAddress = (v_U8_t*) wrqu->ap_addr.sa_data; VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s "MAC_ADDRESS_STR, __func__, MAC_ADDR_ARRAY(pMacAddress)); vos_mem_copy( pHddStaCtx->conn_info.bssId, pMacAddress, sizeof( tCsrBssid )); - EXIT(); + EXIT(); return 0; } + +int iw_set_ap_address(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_ap_address(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief iw_get_ap_address() - + \brief __iw_get_ap_address() - This function returns the BSSID to the wpa_supplicant \param - dev - Pointer to the net device. - info - Pointer to the iw_request_info. @@ -4128,15 +4880,38 @@ int iw_set_ap_address(struct net_device *dev, \return - 0 for success, non zero for failure --------------------------------------------------------------------------*/ -int iw_get_ap_address(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int __iw_get_ap_address(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); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(WLAN_HDD_GET_PRIV_PTR(dev)); + hdd_station_ctx_t *pHddStaCtx; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL", __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: pHddStaCtx is NULL", __func__); + return -EINVAL; + } + if ((pHddStaCtx->conn_info.connState == eConnectionState_Associated) || (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState)) { @@ -4150,6 +4925,19 @@ int iw_get_ap_address(struct net_device *dev, return 0; } +int iw_get_ap_address(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_ap_address(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + #ifdef WLAN_FEATURE_11W /**--------------------------------------------------------------------------- @@ -4209,12 +4997,20 @@ void hdd_indicateUnprotMgmtFrame( hdd_adapter_t *pAdapter, /* Get pAdapter from Destination mac address of the frame */ if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DISASSOC) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + cfg80211_rx_unprot_mlme_mgmt(pAdapter->dev, pbFrames, nFrameLength); +#else cfg80211_send_unprot_disassoc(pAdapter->dev, pbFrames, nFrameLength); +#endif pAdapter->hdd_stats.hddPmfStats.numUnprotDisassocRx++; } else if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DEAUTH) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + cfg80211_rx_unprot_mlme_mgmt(pAdapter->dev, pbFrames, nFrameLength); +#else cfg80211_send_unprot_deauth(pAdapter->dev, pbFrames, nFrameLength); +#endif pAdapter->hdd_stats.hddPmfStats.numUnprotDeauthRx++; } else diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c index 5acb5b66c3fd..c51e08ed6578 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1859,6 +1859,13 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_FT_RESOURCE_REQ_MAX ), #endif + REG_VARIABLE( CFG_ENABLE_ROAM_DELAY_STATS, WLAN_PARAM_Integer, + hdd_config_t, gEnableRoamDelayStats, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_ROAM_DELAY_STATS_DEFAULT, + CFG_ENABLE_ROAM_DELAY_STATS_MIN, + CFG_ENABLE_ROAM_DELAY_STATS_MAX ), + #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING REG_DYNAMIC_VARIABLE( CFG_NEIGHBOR_SCAN_TIMER_PERIOD_NAME, WLAN_PARAM_Integer, hdd_config_t, nNeighborScanPeriod, @@ -2574,6 +2581,13 @@ REG_VARIABLE( CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE, WLAN_PARAM_Integer, CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_DEFAULT, CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_MIN, CFG_TDLS_SCAN_COEX_SUPPORT_ENABLE_MAX ), + +REG_VARIABLE( CFG_TDLS_SCAN_ENABLE, WLAN_PARAM_Integer, + hdd_config_t, fEnableTDLSScan, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TDLS_SCAN_ENABLE_DEFAULT, + CFG_TDLS_SCAN_ENABLE_MIN, + CFG_TDLS_SCAN_ENABLE_MAX ), #endif #ifdef WLAN_FEATURE_LINK_LAYER_STATS @@ -2989,12 +3003,12 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_DEFAULT_RATE_INDEX_24GH_MIN, CFG_DEFAULT_RATE_INDEX_24GH_MAX ), - REG_VARIABLE( CFG_SAP_DOT11_MODE_NAME, WLAN_PARAM_Integer, - hdd_config_t, sapDot11Mode, + REG_VARIABLE( CFG_SAP_ENABLE_11AC_NAME, WLAN_PARAM_Integer, + hdd_config_t, sapEnable11AC, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, - CFG_SAP_DOT11_MODE_DEFAULT, - CFG_SAP_DOT11_MODE_MIN, - CFG_SAP_DOT11_MODE_MAX ), + CFG_SAP_ENABLE_11AC_DEFAULT, + CFG_SAP_ENABLE_11AC_MIN, + CFG_SAP_ENABLE_11AC_MAX ), REG_VARIABLE(CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer, hdd_config_t, cfgRAFilterEnable, @@ -3040,6 +3054,22 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_WLAN_LOGGING_NUM_BUF_MAX ), #endif //WLAN_LOGGING_SOCK_SVC_ENABLE + REG_VARIABLE( CFG_IGNORE_PEER_ERP_INFO_NAME, WLAN_PARAM_Integer, + hdd_config_t, ignorePeerErpInfo, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_IGNORE_PEER_ERP_INFO_DEFAULT, + CFG_IGNORE_PEER_ERP_INFO_MIN, + CFG_IGNORE_PEER_ERP_INFO_MAX ), + + REG_VARIABLE( CFG_IGNORE_PEER_HT_MODE_NAME, WLAN_PARAM_Integer, + hdd_config_t, ignorePeerHTopMode, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_IGNORE_PEER_HT_MODE_DEFAULT, + CFG_IGNORE_PEER_HT_MODE_MIN, + CFG_IGNORE_PEER_HT_MODE_MAX ), + REG_VARIABLE(CFG_INITIAL_DWELL_TIME_NAME, WLAN_PARAM_Integer, hdd_config_t, nInitialDwellTime, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3119,6 +3149,55 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_ENABLE_MAC_ADDR_SPOOFING_MIN, CFG_ENABLE_MAC_ADDR_SPOOFING_MAX), + REG_VARIABLE(CFG_DISABLE_P2P_MAC_ADDR_SPOOFING, WLAN_PARAM_Integer, + hdd_config_t, disableP2PMacSpoofing, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_DEFAULT, + CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_MIN, + CFG_DISABLE_P2P_MAC_ADDR_SPOOFING_MAX), + + REG_VARIABLE(CFG_ENABLE_MGMT_LOGGING, WLAN_PARAM_Integer, + hdd_config_t, enableMgmtLogging, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_MGMT_LOGGING_DEFAULT, + CFG_ENABLE_MGMT_LOGGING_MIN, + CFG_ENABLE_MGMT_LOGGING_MAX), + + REG_VARIABLE(CFG_ENABLE_BMUHW_TRACING, WLAN_PARAM_Integer, + hdd_config_t, enableBMUHWtracing, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_BMUHW_TRACING_DEFAULT, + CFG_ENABLE_BMUHW_TRACING_MIN, + CFG_ENABLE_BMUHW_TRACING_MAX), + + REG_VARIABLE(CFG_ENABLE_FW_LOGGING, WLAN_PARAM_Integer, + hdd_config_t, enableFWLogging, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_LOGGING_DEFAULT, + CFG_ENABLE_FW_LOGGING_MIN, + CFG_ENABLE_FW_LOGGING_MAX), + + REG_VARIABLE(CFG_ENABLE_FW_CONTINIOUS_LOGGING, WLAN_PARAM_Integer, + hdd_config_t, enableContFWLogging, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_CONTINIOUS_LOGGING_DEFAULT, + CFG_ENABLE_FW_CONTINIOUS_LOGGING_MIN, + CFG_ENABLE_FW_CONTINIOUS_LOGGING_MAX), + + REG_VARIABLE(CFG_MIN_LOGGING_BUFFER_SIZE, WLAN_PARAM_Integer, + hdd_config_t, minLoggingBufferSize, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MIN_LOGGING_BUFFER_SIZE_DEFAULT, + CFG_MIN_LOGGING_BUFFER_SIZE_MIN, + CFG_MIN_LOGGING_BUFFER_SIZE_MAX), + + REG_VARIABLE(CFG_MAX_LOGGING_BUFFER_SIZE, WLAN_PARAM_Integer, + hdd_config_t, maxLoggingBufferSize, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MAX_LOGGING_BUFFER_SIZE_DEFAULT, + CFG_MAX_LOGGING_BUFFER_SIZE_MIN, + CFG_MAX_LOGGING_BUFFER_SIZE_MAX), + REG_VARIABLE(CFG_ENABLE_CH_AVOID, WLAN_PARAM_Integer, hdd_config_t, fenableCHAvoidance, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3132,6 +3211,16 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_MAX_CONCURRENT_CONNECTIONS_DEFAULT, CFG_MAX_CONCURRENT_CONNECTIONS_MIN, CFG_MAX_CONCURRENT_CONNECTIONS_MAX ), + +#ifdef WLAN_FEATURE_AP_HT40_24G + REG_VARIABLE(CFG_ENABLE_HT_2040_COEX, WLAN_PARAM_Integer, + hdd_config_t, apHT40_24GEnabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_HT_2040_COEX_DEFAULT, + CFG_ENABLE_HT_2040_COEX_MIN, + CFG_ENABLE_HT_2040_COEX_MAX ), +#endif + REG_VARIABLE( CFG_ENABLE_DYNAMIC_WMMPS_NAME, WLAN_PARAM_Integer, hdd_config_t, enableDynamicWMMPS, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3188,14 +3277,6 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_MAX_UAPSD_INACT_INTVL_MIN, CFG_MAX_UAPSD_INACT_INTVL_MAX ), - REG_VARIABLE( CFG_DEBUG_DHCP, WLAN_PARAM_Integer, - hdd_config_t, enableDhcpDebug, - VAR_FLAGS_OPTIONAL | - VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_DEBUG_DHCP_DEFAULT, - CFG_DEBUG_DHCP_DISABLE, - CFG_DEBUG_DHCP_ENABLE ), - REG_VARIABLE( CFG_BURST_MODE_BE_TXOP_VALUE, WLAN_PARAM_Integer, hdd_config_t, burstModeTXOPValue, VAR_FLAGS_OPTIONAL | @@ -3217,6 +3298,138 @@ REG_VARIABLE( CFG_EXTSCAN_ENABLE, WLAN_PARAM_Integer, CFG_ENABLE_DYNAMIC_RA_START_RATE_DEFAULT, CFG_ENABLE_DYNAMIC_RA_START_RATE_MIN, CFG_ENABLE_DYNAMIC_RA_START_RATE_MAX), + + REG_VARIABLE( CFG_P2P_LISTEN_DEFER_INTERVAL_NAME, WLAN_PARAM_Integer, + hdd_config_t, gP2PListenDeferInterval, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_P2P_LISTEN_DEFER_INTERVAL_DEFAULT, + CFG_P2P_LISTEN_DEFER_INTERVAL_MIN, + CFG_P2P_LISTEN_DEFER_INTERVAL_MAX), + + REG_VARIABLE( CFG_BTC_ENABLE_IND_TIMER_VALUE, WLAN_PARAM_Integer, + hdd_config_t, btcEnableIndTimerVal, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BTC_ENABLE_IND_TIMER_VALUE_DEFAULT, + CFG_BTC_ENABLE_IND_TIMER_VALUE_MIN, + CFG_BTC_ENABLE_IND_TIMER_VALUE_MAX), + + REG_VARIABLE( CFG_BTC_FAST_WLAN_CONN_PREF , WLAN_PARAM_Integer, + hdd_config_t, btcFastWlanConnPref, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BTC_FAST_WLAN_CONN_PREF_DEFAULT, + CFG_BTC_FAST_WLAN_CONN_PREF_MIN, + CFG_BTC_FAST_WLAN_CONN_PREF_MAX ), + + REG_VARIABLE( CFG_ENABLE_RTSCTS_HTVHT_NAME, WLAN_PARAM_Integer, + hdd_config_t, enableRtsCtsHtVht, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_RTSCTS_HTVHT_DEFAULT, + CFG_ENABLE_RTSCTS_HTVHT_MIN, + CFG_ENABLE_RTSCTS_HTVHT_MAX), + + REG_VARIABLE( CFG_DXE_REPLENISH_RX_TIMER_VALUE, WLAN_PARAM_Integer, + hdd_config_t, dxeReplenishRXTimerVal, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DXE_REPLENISH_RX_TIMER_VALUE_DEFAULT, + CFG_DXE_REPLENISH_RX_TIMER_VALUE_MIN, + CFG_DXE_REPLENISH_RX_TIMER_VALUE_MAX ), + + REG_VARIABLE( CFG_DXE_SSR_ENABLE, WLAN_PARAM_Integer, + hdd_config_t, dxeSSREnable, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DXE_SSR_ENABLE_DEFAULT, + CFG_DXE_SSR_ENABLE_MIN, + CFG_DXE_SSR_ENABLE_MAX ), + + REG_VARIABLE( CFG_MULTICAST_HOST_FW_MSGS, WLAN_PARAM_Integer, + hdd_config_t, multicast_host_msgs, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MULTICAST_HOST_FW_MSGS_DEFAULT, + CFG_MULTICAST_HOST_FW_MSGS_MIN, + CFG_MULTICAST_HOST_FW_MSGS_MAX), + + REG_VARIABLE( CFG_TOGGLE_ARP_BDRATES_NAME, WLAN_PARAM_Integer, + hdd_config_t, toggleArpBDRates, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TOGGLE_ARP_BDRATES_DEFAULT, + CFG_TOGGLE_ARP_BDRATES_MIN, + CFG_TOGGLE_ARP_BDRATES_MAX), + + REG_VARIABLE( CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN , WLAN_PARAM_Integer, + hdd_config_t, btcStaticOppWlanIdleWlanLen, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_DEFAULT, + CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MIN, + CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MAX ), + + REG_VARIABLE( CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN , WLAN_PARAM_Integer, + hdd_config_t, btcStaticOppWlanIdleBtLen, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_DEFAULT, + CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MIN, + CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MAX ), + + REG_VARIABLE( CFG_LINK_FAIL_TIMEOUT_NAME , WLAN_PARAM_Integer, + hdd_config_t, linkFailTimeout, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_LINK_FAIL_TIMEOUT_DEF, + CFG_LINK_FAIL_TIMEOUT_MIN, + CFG_LINK_FAIL_TIMEOUT_MAX ), + + REG_VARIABLE( CFG_LINK_FAIL_TX_CNT_NAME , WLAN_PARAM_Integer, + hdd_config_t, linkFailTxCnt, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_LINK_FAIL_TX_CNT_DEF, + CFG_LINK_FAIL_TX_CNT_MIN, + CFG_LINK_FAIL_TX_CNT_MAX ), + REG_VARIABLE( CFG_OPTIMIZE_CA_EVENT_NAME, WLAN_PARAM_Integer, + hdd_config_t, gOptimizeCAevent, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OPTIMIZE_CA_EVENT_DEFAULT, + CFG_OPTIMIZE_CA_EVENT_DISABLE, + CFG_OPTIMIZE_CA_EVENT_ENABLE ), + REG_VARIABLE( CFG_ENABLE_CRASH_INJECT, WLAN_PARAM_Integer, + hdd_config_t, crash_inject_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_CRASH_INJECT_DEFAULT, + CFG_ENABLE_CRASH_INJECT_MIN, + CFG_ENABLE_CRASH_INJECT_MAX), + + REG_VARIABLE( CFG_RPS_CPU_MAP_NAME, WLAN_PARAM_HexInteger, + hdd_config_t, rps_mask, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RPS_CPU_MAP_DEFAULT, + CFG_RPS_CPU_MAP_MIN, + CFG_RPS_CPU_MAP_MAX), + + REG_VARIABLE(CFG_SAR_BOFFSET_SET_CORRECTION_NAME, WLAN_PARAM_Integer, + hdd_config_t, boffset_correction_enable, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAR_BOFFSET_SET_CORRECTION_DEFAULT, + CFG_SAR_BOFFSET_SET_CORRECTION_MIN, + CFG_SAR_BOFFSET_SET_CORRECTION_MAX), + + REG_VARIABLE(CFG_DISABLE_BAR_WAKEUP_HOST_NAME, WLAN_PARAM_Integer, + hdd_config_t, disableBarWakeUp, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DISABLE_BAR_WAKEUP_HOST_DEFAULT, + CFG_DISABLE_BAR_WAKEUP_HOST_MIN, + CFG_DISABLE_BAR_WAKEUP_HOST_MAX), + + REG_VARIABLE( CFG_MAXCHAN_FOR_CHANTIME_CORR_NAME, WLAN_PARAM_Integer, + hdd_config_t, max_chan_for_dwell_time_cfg, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MAXCHAN_FOR_CHANTIME_CORR_DEFAULT, + CFG_MAXCHAN_FOR_CHANTIME_CORR_MIN, + CFG_MAXCHAN_FOR_CHANTIME_CORR_MAX ), }; /* @@ -3348,9 +3561,9 @@ VOS_STATUS hdd_parse_config_ini(hdd_context_t* pHddCtx) goto config_exit; } - hddLog(LOGE, "%s: qcom_cfg.ini Size %zu", __func__, fw->size); + hddLog(VOS_TRACE_LEVEL_INFO , "%s: qcom_cfg.ini Size %zu", __func__, fw->size); - buffer = (char*)vos_mem_malloc(fw->size); + buffer = (char*)vos_mem_vmalloc(fw->size); if(NULL == buffer) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: kmalloc failure",__func__); @@ -3374,7 +3587,7 @@ VOS_STATUS hdd_parse_config_ini(hdd_context_t* pHddCtx) * buffer address and modifying the buffer value. */ line = get_next_line(buffer, (pTemp + (fw->size-1))); - if(line > (pTemp + fw->size)) { + if(line >= (pTemp + fw->size)) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: INI file seems to be corrupted", __func__); vos_status = VOS_STATUS_E_FAILURE; @@ -3429,7 +3642,7 @@ VOS_STATUS hdd_parse_config_ini(hdd_context_t* pHddCtx) config_exit: release_firmware(fw); - vos_mem_free(pTemp); + vos_mem_vfree(pTemp); return vos_status; } @@ -3553,6 +3766,7 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [fFTResourceReqSupported] Value = [%u] ",pHddCtx->cfg_ini->fFTResourceReqSupported); #endif + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gEnableRoamDelayStats] Value = [%u] ",pHddCtx->cfg_ini->gEnableRoamDelayStats); #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [nNeighborReassocRssiThreshold] Value = [%u] ",pHddCtx->cfg_ini->nNeighborReassocRssiThreshold); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [nNeighborLookupRssiThreshold] Value = [%u] ",pHddCtx->cfg_ini->nNeighborLookupRssiThreshold); @@ -3621,11 +3835,32 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAsdProbeInterval] Value = [%u]",pHddCtx->cfg_ini->gAsdProbeInterval); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAsdTriggerThreshold] Value = [%hhd]",pHddCtx->cfg_ini->gAsdTriggerThreshold); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAsdRTTRssiHystThreshold]Value = [%u]",pHddCtx->cfg_ini->gAsdRTTRssiHystThreshold); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [gIgnorePeerErpInfo] Value = [%u] ", + pHddCtx->cfg_ini->ignorePeerErpInfo); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [disableP2PMacSpoofing] Value = [%u] ", + pHddCtx->cfg_ini->disableP2PMacSpoofing); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gRoamtoDFSChannel] Value = [%u] ",pHddCtx->cfg_ini->allowDFSChannelRoam); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gMaxConcurrentActiveSessions] Value = [%u] ", pHddCtx->cfg_ini->gMaxConcurrentActiveSessions); +#ifdef WLAN_FEATURE_AP_HT40_24G + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gApHT4024G] Value = [%u]", pHddCtx->cfg_ini->apHT40_24GEnabled); +#endif VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAcsScanBandPreference] Value = [%u] ",pHddCtx->cfg_ini->acsScanBandPreference); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSBandSwitchThreshold] value = [%u]\n",pHddCtx->cfg_ini->acsBandSwitchThreshold); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gDeferScanTimeInterval] value = [%u]\n",pHddCtx->cfg_ini->nDeferScanTimeInterval); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSBandSwitchThreshold] value = [%u]",pHddCtx->cfg_ini->acsBandSwitchThreshold); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gDeferScanTimeInterval] value = [%u]",pHddCtx->cfg_ini->nDeferScanTimeInterval); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gEnableTDLSScan] value = [%u]\n",pHddCtx->cfg_ini->fEnableTDLSScan); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gDxeReplenishRXTimerVal] Value = [%u] ", pHddCtx->cfg_ini->dxeReplenishRXTimerVal); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gDxeSSREnable] Value = [%u] ", pHddCtx->cfg_ini->dxeSSREnable); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [toggleArpBDRates] Value = [%u] ", pHddCtx->cfg_ini->toggleArpBDRates); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gEnableForceTargetAssert] Value = [%u] ", pHddCtx->cfg_ini->crash_inject_enabled); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [disableBarWakeUp] Value = [%u] ", + pHddCtx->cfg_ini->disableBarWakeUp); + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [gMaxChannelForMoreDwellTime] Value = [%u] ", + pHddCtx->cfg_ini->max_chan_for_dwell_time_cfg); } @@ -3703,7 +3938,7 @@ VOS_STATUS hdd_cfg_get_config(hdd_context_t *pHddCtx, char *pBuf, int buflen) // ideally we want to return the config to the application // however the config is too big so we just printk() for now #ifdef RETURN_IN_BUFFER - if (curlen <= buflen) + if (curlen < buflen) { // copy string + '\0' memcpy(pCur, configStr, curlen+1); @@ -5121,6 +5356,96 @@ v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx ) hddLog(LOGE, "Could not pass on" "WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE to CCM"); } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_BTC_FAST_WLAN_CONN_PREF, + pConfig->btcFastWlanConnPref, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_BTC_FAST_WLAN_CONN_PREF "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_ENABLE_RTSCTS_HTVHT, + pConfig->enableRtsCtsHtVht, + NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on" + "WNI_CFG_ENABLE_RTSCTS_HTVHT to CCM"); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_TOGGLE_ARP_BDRATES, + pConfig->toggleArpBDRates, + NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on" + "WNI_CFG_TOGGLE_ARP_BDRATES to CCM"); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, + pConfig->btcStaticOppWlanIdleWlanLen, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, + pConfig->btcStaticOppWlanIdleBtLen, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_LINK_FAIL_TIMEOUT, + pConfig->linkFailTimeout, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_LINK_FAIL_TIMEOUT "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_LINK_FAIL_TX_CNT, + pConfig->linkFailTxCnt, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_LINK_FAIL_TX_CNT "); + } + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_OPTIMIZE_CA_EVENT, + pConfig->gOptimizeCAevent, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_OPTIMIZE_CA_EVENT "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_ENABLE_MAC_ADDR_SPOOFING, + pConfig->enableMacSpoofing, NULL, + eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_ENABLE_MAC_ADDR_SPOOFING "); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_SAR_BOFFSET_SET_CORRECTION, + pConfig->boffset_correction_enable, + NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_SAR_BOFFSET_SET_CORRECTION to CCM"); + } + + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_DISABLE_BAR_WAKE_UP_HOST, + pConfig->disableBarWakeUp, + NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + fStatus = FALSE; + hddLog(LOGE, "Could not pass on WNI_CFG_DISABLE_BAR_WAKE_UP_HOST to CCM"); + } + return fStatus; } @@ -5321,10 +5646,13 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->csrConfig.neighborRoamConfig.nMaxNeighborRetries = pConfig->nMaxNeighborReqTries; smeConfig->csrConfig.neighborRoamConfig.nNeighborResultsRefreshPeriod = pConfig->nNeighborResultsRefreshPeriod; smeConfig->csrConfig.neighborRoamConfig.nEmptyScanRefreshPeriod = pConfig->nEmptyScanRefreshPeriod; - //Making Forced 5G roaming to tightly coupled with the gEnableFirstScan2GOnly=1 only. - if(pConfig->enableFirstScan2GOnly) + //Making Forced 5G roaming to tightly coupled with the gEnableFirstScan2GOnly + //=1 only, Also making sure if HW does not support 5G RF band then no need to + //enable this feature even though it is enabled in .ini. + if((pConfig->enableFirstScan2GOnly) && (pConfig->nBandCapability != eCSR_BAND_24)) { - smeConfig->csrConfig.neighborRoamConfig.nNeighborInitialForcedRoamTo5GhEnable = pConfig->nNeighborInitialForcedRoamTo5GhEnable; + smeConfig->csrConfig.neighborRoamConfig.nNeighborInitialForcedRoamTo5GhEnable + = pConfig->nNeighborInitialForcedRoamTo5GhEnable; } hdd_string_to_u8_array( pConfig->neighborScanChanList, smeConfig->csrConfig.neighborRoamConfig.neighborScanChanList.channelList, @@ -5345,7 +5673,13 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->csrConfig.enableTxLdpc = pConfig->enableTxLdpc; smeConfig->csrConfig.isAmsduSupportInAMPDU = pConfig->isAmsduSupportInAMPDU; - smeConfig->csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin; + if(pConfig->nBandCapability != eCSR_BAND_24) + { + smeConfig->csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin; + } + smeConfig->csrConfig.ignorePeerErpInfo = pConfig->ignorePeerErpInfo; + smeConfig->csrConfig.ignorePeerHTopMode = pConfig->ignorePeerHTopMode; + smeConfig->csrConfig.disableP2PMacSpoofing = pConfig->disableP2PMacSpoofing; smeConfig->csrConfig.initialScanSkipDFSCh = pConfig->initialScanSkipDFSCh; smeConfig->csrConfig.isCoalesingInIBSSAllowed = @@ -5362,9 +5696,15 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->fEnableDebugLog = pHddCtx->cfg_ini->gEnableDebugLog; smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon; - + smeConfig->csrConfig.nOBSSScanWidthTriggerInterval = + pConfig->nOBSSScanWidthTriggerInterval; smeConfig->fDeferIMPSTime = pHddCtx->cfg_ini->deferImpsTime; + smeConfig->fBtcEnableIndTimerVal = pHddCtx->cfg_ini->btcEnableIndTimerVal; + smeConfig->csrConfig.roamDelayStatsEnabled = pHddCtx->cfg_ini->gEnableRoamDelayStats; + smeConfig->csrConfig.max_chan_for_dwell_time_cfg = + pHddCtx->cfg_ini->max_chan_for_dwell_time_cfg; + vos_set_multicast_logging(pHddCtx->cfg_ini->multicast_host_msgs); halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) { diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c index 56a027fc8c76..49feb7b4398c 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -23,6 +23,7 @@ * This file was originally distributed by Qualcomm Atheros, Inc. * under proprietary terms before Copyright ownership was assigned * to the Linux Foundation. + * */ @@ -89,11 +90,9 @@ #include "bap_hdd_misc.h" #endif #include -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" #include "wlan_hdd_wmm.h" #include "wlan_qct_wda.h" -#endif #include "wlan_nv.h" #include "wlan_hdd_dev_pwr.h" @@ -131,12 +130,6 @@ .flags = flag, \ } -#ifndef WLAN_FEATURE_TDLS_DEBUG -#define TDLS_LOG_LEVEL VOS_TRACE_LEVEL_INFO -#else -#define TDLS_LOG_LEVEL VOS_TRACE_LEVEL_ERROR -#endif - #ifdef WLAN_FEATURE_VOWIFI_11R #define WLAN_AKM_SUITE_FT_8021X 0x000FAC03 #define WLAN_AKM_SUITE_FT_PSK 0x000FAC04 @@ -177,6 +170,14 @@ */ #define EXTTDLS_EVENT_BUF_SIZE 4096 +/* + * Values for Mac spoofing feature + * + */ +#define MAC_ADDR_SPOOFING_FW_HOST_DISABLE 0 +#define MAC_ADDR_SPOOFING_FW_HOST_ENABLE 1 +#define MAC_ADDR_SPOOFING_FW_ENABLE_HOST_DISABLE 2 + static const u32 hdd_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, @@ -203,7 +204,7 @@ static inline int is_broadcast_ether_addr(const u8 *addr) (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -static struct ieee80211_channel hdd_channels_2_4_GHZ[] = +const static struct ieee80211_channel hdd_channels_2_4_GHZ[] = { HDD2GHZCHAN(2412, 1, 0) , HDD2GHZCHAN(2417, 2, 0) , @@ -228,7 +229,7 @@ static struct ieee80211_channel hdd_social_channels_2_4_GHZ[] = HDD2GHZCHAN(2462, 11, 0) , }; -static struct ieee80211_channel hdd_channels_5_GHZ[] = +const static struct ieee80211_channel hdd_channels_5_GHZ[] = { HDD5GHZCHAN(4920, 240, 0) , HDD5GHZCHAN(4940, 244, 0) , @@ -296,7 +297,7 @@ static struct ieee80211_rate a_mode_rates[] = static struct ieee80211_supported_band wlan_hdd_band_2_4_GHZ = { - .channels = hdd_channels_2_4_GHZ, + .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_2_4_GHZ), .band = IEEE80211_BAND_2GHZ, .bitrates = g_mode_rates, @@ -334,7 +335,7 @@ static struct ieee80211_supported_band wlan_hdd_band_p2p_2_4_GHZ = static struct ieee80211_supported_band wlan_hdd_band_5_GHZ = { - .channels = hdd_channels_5_GHZ, + .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_5_GHZ), .band = IEEE80211_BAND_5GHZ, .bitrates = a_mode_rates, @@ -626,6 +627,9 @@ int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, } vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif sizeof(tHddAvoidFreqList), QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX, GFP_KERNEL); @@ -646,6 +650,153 @@ int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, } #endif /* FEATURE_WLAN_CH_AVOID */ +/* + * FUNCTION: __wlan_hdd_cfg80211_nan_request + * This is called when wlan driver needs to send vendor specific + * nan request event. + */ +static int __wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + tNanRequestReq nan_req; + VOS_STATUS status; + int ret_val = -1; + struct net_device *dev = wdev->netdev; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + + if (0 == data_len) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("NAN - Invalid Request, length = 0")); + return ret_val; + } + + if (NULL == data) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("NAN - Invalid Request, data is NULL")); + return ret_val; + } + + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("HDD context is not valid")); + return -EINVAL; + } + + hddLog(LOG1, FL("Received NAN command")); + vos_trace_hex_dump( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + (tANI_U8 *)data, data_len); + + /* check the NAN Capability */ + if (TRUE != sme_IsFeatureSupportedByFW(NAN)) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("NAN is not supported by Firmware")); + return -EINVAL; + } + + nan_req.request_data_len = data_len; + nan_req.request_data = data; + + status = sme_NanRequest(hHal, &nan_req, pAdapter->sessionId); + if (VOS_STATUS_SUCCESS == status) + { + ret_val = 0; + } + return ret_val; +} + +/* + * FUNCTION: wlan_hdd_cfg80211_nan_request + * Wrapper to protect the nan vendor command from ssr + */ +static int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_nan_request(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +/* + * FUNCTION: wlan_hdd_cfg80211_nan_callback + * This is a callback function and it gets called + * when we need to report nan response event to + * upper layers. + */ +static void wlan_hdd_cfg80211_nan_callback(void* ctx, tSirNanEvent* msg) +{ + hdd_context_t *pHddCtx = (hdd_context_t *)ctx; + struct sk_buff *vendor_event; + int status; + tSirNanEvent *data; + + ENTER(); + if (NULL == msg) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL(" msg received here is null")); + return; + } + data = msg; + + status = wlan_hdd_validate_context(pHddCtx); + + if (0 != status) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("HDD context is not valid")); + return; + } + + vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif + data->event_data_len + + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX, + GFP_KERNEL); + + if (!vendor_event) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("cfg80211_vendor_event_alloc failed")); + return; + } + if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NAN, + data->event_data_len, data->event_data)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("QCA_WLAN_VENDOR_ATTR_NAN put fail")); + kfree_skb(vendor_event); + return; + } + cfg80211_vendor_event(vendor_event, GFP_KERNEL); + EXIT(); +} + +/* + * FUNCTION: wlan_hdd_cfg80211_nan_init + * This function is called to register the callback to sme layer + */ +inline void wlan_hdd_cfg80211_nan_init(hdd_context_t *pHddCtx) +{ + sme_NanRegisterCallback(pHddCtx->hHal, wlan_hdd_cfg80211_nan_callback); +} + + #ifdef WLAN_FEATURE_LINK_LAYER_STATS static v_BOOL_t put_wifi_rate_stat( tpSirWifiRateStat stats, @@ -711,6 +862,8 @@ static v_BOOL_t put_wifi_peer_info( tpSirWifiPeerInfo stats, rateInfo = nla_nest_start(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_RATE_INFO); + if(!rateInfo) + return FALSE; for (i = 0; i < stats->numRate; i++) { struct nlattr *rates; @@ -718,6 +871,8 @@ static v_BOOL_t put_wifi_peer_info( tpSirWifiPeerInfo stats, stats->rateStats + (i * sizeof(tSirWifiRateStat))); rates = nla_nest_start(vendor_event, i); + if(!rates) + return FALSE; if (FALSE == put_wifi_rate_stat(pRateStats, vendor_event)) { @@ -927,6 +1082,9 @@ static v_BOOL_t put_wifi_iface_stats(hdd_adapter_t *pAdapter, if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE) || + nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_BEACON_RX, pWifiIfaceStat->beaconRx) || nla_put_u32(vendor_event, @@ -956,10 +1114,20 @@ static v_BOOL_t put_wifi_iface_stats(hdd_adapter_t *pAdapter, wmmInfo = nla_nest_start(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_INFO); + if(!wmmInfo) + { + vos_mem_free(pWifiIfaceStatTL); + return FALSE; + } for (i = 0; i < WIFI_AC_MAX; i++) { struct nlattr *wmmStats; wmmStats = nla_nest_start(vendor_event, i); + if(!wmmStats) + { + vos_mem_free(pWifiIfaceStatTL); + return FALSE; + } if (FALSE == put_wifi_wmm_ac_stat( &pWifiIfaceStat->AccessclassStats[i], vendor_event)) @@ -1067,18 +1235,17 @@ static v_VOID_t hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, v_VOID_t *pData) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - tpSirWifiRateStat pWifiRateStat; tpSirWifiPeerStat pWifiPeerStat; tpSirWifiPeerInfo pWifiPeerInfo; struct nlattr *peerInfo; struct sk_buff *vendor_event; int status, i; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid") ); return; } @@ -1087,70 +1254,6 @@ static v_VOID_t hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, hddLog(VOS_TRACE_LEVEL_INFO, "LL_STATS_PEER_ALL : numPeers %u", pWifiPeerStat->numPeers); - { - for (i = 0; i < pWifiPeerStat->numPeers; i++) - { - pWifiPeerInfo = (tpSirWifiPeerInfo) - ((uint8 *)pWifiPeerStat->peerInfo + - ( i * sizeof(tSirWifiPeerInfo))); - - if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) { - pWifiPeerInfo->type = WIFI_PEER_AP; - } - if (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) { - pWifiPeerInfo->type = WIFI_PEER_P2P_GO; - } - - hddLog(VOS_TRACE_LEVEL_INFO, - " %d) LL_STATS Channel Stats " - " Peer Type %u " - " peerMacAddress %pM " - " capabilities 0x%x " - " numRate %u ", - i, - pWifiPeerInfo->type, - pWifiPeerInfo->peerMacAddress, - pWifiPeerInfo->capabilities, - pWifiPeerInfo->numRate); - { - int j; - for (j = 0; j < pWifiPeerInfo->numRate; j++) - { - pWifiRateStat = (tpSirWifiRateStat) - ((tANI_U8 *) pWifiPeerInfo->rateStats + - ( j * sizeof(tSirWifiRateStat))); - - hddLog(VOS_TRACE_LEVEL_INFO, - " peer Rate Stats " - " preamble %u " - " nss %u " - " bw %u " - " rateMcsIdx %u " - " reserved %u " - " bitrate %u " - " txMpdu %u " - " rxMpdu %u " - " mpduLost %u " - " retries %u " - " retriesShort %u " - " retriesLong %u", - pWifiRateStat->rate.preamble, - pWifiRateStat->rate.nss, - pWifiRateStat->rate.bw, - pWifiRateStat->rate.rateMcsIdx, - pWifiRateStat->rate.reserved, - pWifiRateStat->rate.bitrate, - pWifiRateStat->txMpdu, - pWifiRateStat->rxMpdu, - pWifiRateStat->mpduLost, - pWifiRateStat->retries, - pWifiRateStat->retriesShort, - pWifiRateStat->retriesLong); - } - } - } - } - /* * Allocate a size of 4096 for the peer stats comprising * each of size = sizeof (tSirWifiPeerInfo) + numRate * @@ -1159,18 +1262,19 @@ static v_VOID_t hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, * that number of rates shall not exceed beyond 50 with * the sizeof (tSirWifiRateStat) being 32. */ - vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - LL_STATS_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX, - GFP_KERNEL); + vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy, + LL_STATS_EVENT_BUF_SIZE); if (!vendor_event) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: cfg80211_vendor_event_alloc failed", + "%s: cfg80211_vendor_cmd_alloc_reply_skb failed", __func__); return; } if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER) || + nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS, pWifiPeerStat->numPeers)) { @@ -1182,15 +1286,31 @@ static v_VOID_t hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, peerInfo = nla_nest_start(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO); + if(!peerInfo) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO put fail", + __func__); + kfree_skb(vendor_event); + return; + } pWifiPeerInfo = (tpSirWifiPeerInfo) ((uint8 *) pWifiPeerStat->peerInfo); for (i = 1; i <= pWifiPeerStat->numPeers; i++) { - struct nlattr *peers = nla_nest_start(vendor_event, i); int numRate = pWifiPeerInfo->numRate; + struct nlattr *peers = nla_nest_start(vendor_event, i); + if(!peers) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: peer stats put fail", + __func__); + kfree_skb(vendor_event); + return; + } if (FALSE == put_wifi_peer_info( pWifiPeerInfo, vendor_event)) { @@ -1207,7 +1327,8 @@ static v_VOID_t hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, nla_nest_end(vendor_event, peers); } nla_nest_end(vendor_event, peerInfo); - cfg80211_vendor_event(vendor_event, GFP_KERNEL); + cfg80211_vendor_cmd_reply(vendor_event); + EXIT(); } /* @@ -1224,11 +1345,11 @@ static v_VOID_t hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter, hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); int status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid") ); return; } /* @@ -1238,14 +1359,12 @@ static v_VOID_t hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter, * a call on the limit based on the data requirements on * interface statistics. */ - vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - LL_STATS_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_LL_IFACE_STATS_INDEX, - GFP_KERNEL); + vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy, + LL_STATS_EVENT_BUF_SIZE); if (!vendor_event) { hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed") ); + FL("cfg80211_vendor_cmd_alloc_reply_skb failed") ); return; } @@ -1273,94 +1392,8 @@ static v_VOID_t hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter, hddLog(VOS_TRACE_LEVEL_INFO, "WMI_LINK_STATS_IFACE Data"); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_IFACE: " - " Mode %u " - " MAC %pM " - " State %u " - " Roaming %u " - " capabilities 0x%x " - " SSID %s " - " BSSID %pM", - pWifiIfaceStat->info.mode, - pWifiIfaceStat->info.macAddr, - pWifiIfaceStat->info.state, - pWifiIfaceStat->info.roaming, - pWifiIfaceStat->info.capabilities, - pWifiIfaceStat->info.ssid, - pWifiIfaceStat->info.bssid); - - hddLog(VOS_TRACE_LEVEL_INFO, - " AP country str: %c%c%c", - pWifiIfaceStat->info.apCountryStr[0], - pWifiIfaceStat->info.apCountryStr[1], - pWifiIfaceStat->info.apCountryStr[2]); - - - hddLog(VOS_TRACE_LEVEL_INFO, - " Country Str Association: %c%c%c", - pWifiIfaceStat->info.countryStr[0], - pWifiIfaceStat->info.countryStr[1], - pWifiIfaceStat->info.countryStr[2]); - - hddLog(VOS_TRACE_LEVEL_INFO, - " beaconRx %u " - " mgmtRx %u " - " mgmtActionRx %u " - " mgmtActionTx %u " - " rssiMgmt %d " - " rssiData %d " - " rssiAck %d", - pWifiIfaceStat->beaconRx, - pWifiIfaceStat->mgmtRx, - pWifiIfaceStat->mgmtActionRx, - pWifiIfaceStat->mgmtActionTx, - pWifiIfaceStat->rssiMgmt, - pWifiIfaceStat->rssiData, - pWifiIfaceStat->rssiAck ); - - - { - int i; - for (i = 0 ; i < WIFI_AC_MAX; i ++) - { - hddLog(VOS_TRACE_LEVEL_INFO, - - " %d) LL_STATS IFACE: " - " ac: %u txMpdu: %u " - " rxMpdu: %u txMcast: %u " - " rxMcast: %u rxAmpdu: %u " - " txAmpdu: %u mpduLost: %u " - " retries: %u retriesShort: %u " - " retriesLong: %u contentionTimeMin: %u " - " contentionTimeMax: %u contentionTimeAvg: %u " - " contentionNumSamples: %u", - i, - pWifiIfaceStat->AccessclassStats[i].ac, - pWifiIfaceStat->AccessclassStats[i].txMpdu, - pWifiIfaceStat->AccessclassStats[i].rxMpdu, - pWifiIfaceStat->AccessclassStats[i].txMcast, - pWifiIfaceStat->AccessclassStats[i].rxMcast, - pWifiIfaceStat->AccessclassStats[i].rxAmpdu, - pWifiIfaceStat->AccessclassStats[i].txAmpdu, - pWifiIfaceStat->AccessclassStats[i].mpduLost, - pWifiIfaceStat->AccessclassStats[i].retries, - pWifiIfaceStat-> - AccessclassStats[i].retriesShort, - pWifiIfaceStat->AccessclassStats[i].retriesLong, - pWifiIfaceStat-> - AccessclassStats[i].contentionTimeMin, - pWifiIfaceStat-> - AccessclassStats[i].contentionTimeMax, - pWifiIfaceStat-> - AccessclassStats[i].contentionTimeAvg, - pWifiIfaceStat-> - AccessclassStats[i].contentionNumSamples); - - } - } - - cfg80211_vendor_event(vendor_event, GFP_KERNEL); + cfg80211_vendor_cmd_reply(vendor_event); + EXIT(); } /* @@ -1379,11 +1412,11 @@ static v_VOID_t hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); struct nlattr *chList; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid") ); return; } pWifiRadioStat = (tpSirWifiRadioStat) pData; @@ -1413,19 +1446,19 @@ static v_VOID_t hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, * sizeof (tSirWifiChannelStats) being 24 bytes. */ - vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - LL_STATS_EVENT_BUF_SIZE + NLMSG_HDRLEN , - QCA_NL80211_VENDOR_SUBCMD_LL_RADIO_STATS_INDEX, - GFP_KERNEL); - + vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy, + LL_STATS_EVENT_BUF_SIZE); if (!vendor_event) { hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed") ); + FL("cfg80211_vendor_cmd_alloc_reply_skb failed") ); return; } if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO) || + nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID, pWifiRadioStat->radio) || nla_put_u32(vendor_event, @@ -1467,6 +1500,14 @@ static v_VOID_t hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, chList = nla_nest_start(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO); + if(!chList) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO put fail", + __func__); + kfree_skb(vendor_event); + return; + } for (i = 0; i < pWifiRadioStat->numChannels; i++) { struct nlattr *chInfo; @@ -1475,24 +1516,15 @@ static v_VOID_t hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, pWifiRadioStat->channels + (i * sizeof(tSirWifiChannelStats))); - hddLog(VOS_TRACE_LEVEL_INFO, - " %d) Channel Info" - " width is %u " - " CenterFreq %u " - " CenterFreq0 %u " - " CenterFreq1 %u " - " onTime %u " - " ccaBusyTime %u", - i, - pWifiChannelStats->channel.width, - pWifiChannelStats->channel.centerFreq, - pWifiChannelStats->channel.centerFreq0, - pWifiChannelStats->channel.centerFreq1, - pWifiChannelStats->onTime, - pWifiChannelStats->ccaBusyTime); - - chInfo = nla_nest_start(vendor_event, i); + if(!chInfo) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: failed to put chInfo", + __func__); + kfree_skb(vendor_event); + return; + } if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_WIDTH, @@ -1522,7 +1554,9 @@ static v_VOID_t hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, } nla_nest_end(vendor_event, chList); - cfg80211_vendor_event(vendor_event, GFP_KERNEL); + cfg80211_vendor_cmd_reply(vendor_event); + + EXIT(); return; } @@ -1537,20 +1571,18 @@ static void hdd_link_layer_stats_ind_callback ( void *pCtx, { hdd_context_t *pHddCtx = (hdd_context_t *)pCtx; hdd_adapter_t *pAdapter = NULL; + struct hdd_ll_stats_context *context; tpSirLLStatsResults linkLayerStatsResults = (tpSirLLStatsResults)pRsp; int status; - status = wlan_hdd_validate_context(pHddCtx); + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return; } - - pAdapter = hdd_get_adapter_by_macaddr(pHddCtx, macAddr); if (NULL == pAdapter) { @@ -1568,38 +1600,52 @@ static void hdd_link_layer_stats_ind_callback ( void *pCtx, { case SIR_HAL_LL_STATS_RESULTS_RSP: { - hddLog(VOS_TRACE_LEVEL_INFO, - FL("RESPONSE SIR_HAL_LL_STATS_RESULTS_RSP") ); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE paramID = 0x%x", - linkLayerStatsResults->paramId); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE ifaceId = %u MAC: %pM", - linkLayerStatsResults->ifaceId, macAddr); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE respId = %u", - linkLayerStatsResults->respId); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE moreResultToFollow = %u", + hddLog(VOS_TRACE_LEVEL_INFO, + "LL_STATS RESP paramID = 0x%x, ifaceId = %u MAC: %pM " + "respId = %u, moreResultToFollow = %u", + linkLayerStatsResults->paramId, linkLayerStatsResults->ifaceId, + macAddr, linkLayerStatsResults->respId, linkLayerStatsResults->moreResultToFollow); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE result = %p", - linkLayerStatsResults->result); + spin_lock(&hdd_context_lock); + context = &pHddCtx->ll_stats_context; + /* validate response received from target */ + if ((context->request_id != linkLayerStatsResults->respId) || + !(context->request_bitmap & linkLayerStatsResults->paramId)) + { + spin_unlock(&hdd_context_lock); + hddLog(LOGE, + FL("Error : Request id %d response id %d request bitmap 0x%x" + "response bitmap 0x%x"), + context->request_id, linkLayerStatsResults->respId, + context->request_bitmap, linkLayerStatsResults->paramId); + return; + } + spin_unlock(&hdd_context_lock); + if ( linkLayerStatsResults->paramId & WMI_LINK_STATS_RADIO ) { hdd_link_layer_process_radio_stats(pAdapter, (v_VOID_t *)linkLayerStatsResults->result); + spin_lock(&hdd_context_lock); + context->request_bitmap &= ~(WMI_LINK_STATS_RADIO); + spin_unlock(&hdd_context_lock); } else if ( linkLayerStatsResults->paramId & WMI_LINK_STATS_IFACE ) { hdd_link_layer_process_iface_stats(pAdapter, (v_VOID_t *)linkLayerStatsResults->result); + spin_lock(&hdd_context_lock); + context->request_bitmap &= ~(WMI_LINK_STATS_IFACE); + spin_unlock(&hdd_context_lock); } else if ( linkLayerStatsResults->paramId & WMI_LINK_STATS_ALL_PEER ) { hdd_link_layer_process_peer_stats(pAdapter, (v_VOID_t *)linkLayerStatsResults->result); + spin_lock(&hdd_context_lock); + context->request_bitmap &= ~(WMI_LINK_STATS_ALL_PEER); + spin_unlock(&hdd_context_lock); } /* WMI_LINK_STATS_ALL_PEER */ else { @@ -1607,12 +1653,20 @@ static void hdd_link_layer_stats_ind_callback ( void *pCtx, FL("INVALID LL_STATS_NOTIFY RESPONSE ***********")); } + spin_lock(&hdd_context_lock); + /* complete response event if all requests are completed */ + if (0 == context->request_bitmap) + complete(&context->response_event); + spin_unlock(&hdd_context_lock); + break; } default: hddLog(VOS_TRACE_LEVEL_ERROR, "invalid event type %d", indType); break; } + + EXIT(); return; } @@ -1626,10 +1680,10 @@ qca_wlan_vendor_ll_set_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX +1] = { .type = NLA_U32 }, }; -static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, - struct wireless_dev *wdev, - void *data, - int data_len) +static int __wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) { int status; struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX + 1]; @@ -1637,13 +1691,12 @@ static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); - hdd_station_ctx_t *pHddStaCtx; + + ENTER(); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } @@ -1697,15 +1750,11 @@ static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_SET reqId = %d", linkLayerStatsSetReq.reqId); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_SET MAC = %pM", linkLayerStatsSetReq.macAddr); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_SET mpduSizeThreshold = %d", - linkLayerStatsSetReq.mpduSizeThreshold); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_SET aggressive Statistics Gathering = %d", - linkLayerStatsSetReq.aggressiveStatisticsGathering); + "LL_STATS_SET reqId = %d, MAC = %pM, mpduSizeThreshold = %d " + "Statistics Gathering = %d ", + linkLayerStatsSetReq.reqId, linkLayerStatsSetReq.macAddr, + linkLayerStatsSetReq.mpduSizeThreshold, + linkLayerStatsSetReq.aggressiveStatisticsGathering); if (eHAL_STATUS_SUCCESS != sme_SetLinkLayerStatsIndCB( pHddCtx->hHal, @@ -1717,21 +1766,6 @@ static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, } - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - if (VOS_STATUS_SUCCESS != - WLANTL_ClearInterfaceStats((WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - pHddStaCtx->conn_info.staId[0], WIFI_STATS_IFACE)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s:" - "WLANTL_ClearInterfaceStats Failed", __func__); - return -EINVAL; - } - - pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VO] = 0; - pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VI] = 0; - pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BE] = 0; - pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BK] = 0; - if (eHAL_STATUS_SUCCESS != sme_LLStatsSetReq( pHddCtx->hHal, &linkLayerStatsSetReq)) { @@ -1742,8 +1776,22 @@ static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, pAdapter->isLinkLayerStatsSet = 1; + EXIT(); return 0; } +static int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_ll_stats_set(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} const struct nla_policy @@ -1762,23 +1810,26 @@ qca_wlan_vendor_ll_get_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX +1] = [QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK] = { .type = NLA_U32 }, }; -static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, - struct wireless_dev *wdev, - void *data, - int data_len) +static int __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) { + unsigned long rc; + struct hdd_ll_stats_context *context; hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX + 1]; tSirLLStatsGetReq linkLayerStatsGetReq; struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); int status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL ; } @@ -1788,6 +1839,14 @@ static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, "%s: HDD adapter is Null", __func__); return -ENODEV; } + + if (pHddStaCtx == NULL) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + "%s: HddStaCtx is Null", __func__); + return -ENODEV; + } + /* check the LLStats Capability */ if ( (TRUE != pHddCtx->cfg_ini->fEnableLLStats) || (TRUE != sme_IsFeatureSupportedByFW(LINK_LAYER_STATS_MEAS))) @@ -1806,6 +1865,13 @@ static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, return -EINVAL; } + if (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Roaming in progress, so unable to proceed this request", __func__); + return -EBUSY; + } + if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX, (struct nlattr *)data, data_len, qca_wlan_vendor_ll_get_policy)) @@ -1840,13 +1906,17 @@ static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, pAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t)); hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_GET reqId = %d", linkLayerStatsGetReq.reqId); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_GET MAC = %pM", linkLayerStatsGetReq.macAddr); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_GET paramIdMask = %d", + "LL_STATS_GET reqId = %d, MAC = %pM, paramIdMask = %d", + linkLayerStatsGetReq.reqId, linkLayerStatsGetReq.macAddr, linkLayerStatsGetReq.paramIdMask); + spin_lock(&hdd_context_lock); + context = &pHddCtx->ll_stats_context; + context->request_id = linkLayerStatsGetReq.reqId; + context->request_bitmap = linkLayerStatsGetReq.paramIdMask; + INIT_COMPLETION(context->response_event); + spin_unlock(&hdd_context_lock); + if (eHAL_STATUS_SUCCESS != sme_LLStatsGetReq( pHddCtx->hHal, &linkLayerStatsGetReq)) { @@ -1854,9 +1924,35 @@ static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, "sme_LLStatsGetReq Failed", __func__); return -EINVAL; } + + rc = wait_for_completion_timeout(&context->response_event, + msecs_to_jiffies(WLAN_WAIT_TIME_LL_STATS)); + if (!rc) + { + hddLog(LOGE, + FL("Target response timed out request id %d request bitmap 0x%x"), + context->request_id, context->request_bitmap); + return -ETIMEDOUT; + } + + EXIT(); return 0; } +static int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_ll_stats_get(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + const struct nla_policy qca_wlan_vendor_ll_clr_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX +1] = @@ -1867,10 +1963,10 @@ qca_wlan_vendor_ll_clr_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX +1] = [QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP] = {.type = NLA_U8 }, }; -static int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, - struct wireless_dev *wdev, - void *data, - int data_len) +static int __wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) { hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX + 1]; @@ -1881,11 +1977,11 @@ static int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, u8 stopReq; int status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } @@ -1945,14 +2041,11 @@ static int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, pAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t)); hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_CLEAR reqId = %d", linkLayerStatsClearReq.reqId); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_CLEAR MAC = %pM", linkLayerStatsClearReq.macAddr); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_CLEAR statsClearReqMask = 0x%X", - linkLayerStatsClearReq.statsClearReqMask); - hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_CLEAR stopReq = %d", + "LL_STATS_CLEAR reqId = %d, MAC = %pM," + "statsClearReqMask = 0x%X, stopReq = %d", + linkLayerStatsClearReq.reqId, + linkLayerStatsClearReq.macAddr, + linkLayerStatsClearReq.statsClearReqMask, linkLayerStatsClearReq.stopReq); if (eHAL_STATUS_SUCCESS == sme_LLStatsClearReq(pHddCtx->hHal, @@ -2009,7 +2102,24 @@ static int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, } return -ENOMEM; } + + EXIT(); return -EINVAL; +} +static int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_ll_stats_clear(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; + + } #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ @@ -2022,6 +2132,8 @@ wlan_hdd_extscan_config_policy { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND] = { .type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS] = + { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME] = { .type = NLA_U32 }, @@ -2048,8 +2160,9 @@ wlan_hdd_extscan_config_policy [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX] = { .type = NLA_U32 }, - [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID] = - { .type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW] = { .type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH] = @@ -2075,13 +2188,22 @@ static void wlan_hdd_cfg80211_extscan_get_capabilities_ind(void *ctx, void *pMsg tpSirEXTScanCapabilitiesEvent pData = (tpSirEXTScanCapabilitiesEvent) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) + { return; } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); + return; + } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES_INDEX, GFP_KERNEL); @@ -2138,6 +2260,7 @@ static void wlan_hdd_cfg80211_extscan_get_capabilities_ind(void *ctx, void *pMsg } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2153,14 +2276,21 @@ static void wlan_hdd_cfg80211_extscan_start_rsp(void *ctx, void *pMsg) struct sk_buff *skb = NULL; tpAniSirGlobal pMac = PMAC_STRUCT( pHddCtx->hHal ); + ENTER(); - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + if (wlan_hdd_validate_context(pHddCtx)){ + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START_INDEX, GFP_KERNEL); @@ -2196,6 +2326,7 @@ static void wlan_hdd_cfg80211_extscan_start_rsp(void *ctx, void *pMsg) cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2210,13 +2341,21 @@ static void wlan_hdd_cfg80211_extscan_stop_rsp(void *ctx, void *pMsg) hdd_context_t *pHddCtx = (hdd_context_t *)ctx; struct sk_buff *skb = NULL; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)){ + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP_INDEX, GFP_KERNEL); @@ -2237,6 +2376,7 @@ static void wlan_hdd_cfg80211_extscan_stop_rsp(void *ctx, void *pMsg) } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2253,12 +2393,21 @@ static void wlan_hdd_cfg80211_extscan_set_bss_hotlist_rsp(void *ctx, tpSirEXTScanSetBssidHotListRspParams pData = (tpSirEXTScanSetBssidHotListRspParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)){ return; } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); + return; + } + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST_INDEX, GFP_KERNEL); @@ -2280,6 +2429,7 @@ static void wlan_hdd_cfg80211_extscan_set_bss_hotlist_rsp(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2295,13 +2445,21 @@ static void wlan_hdd_cfg80211_extscan_reset_bss_hotlist_rsp(void *ctx, tpSirEXTScanResetBssidHotlistRspParams pData = (tpSirEXTScanResetBssidHotlistRspParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST_INDEX, GFP_KERNEL); @@ -2322,6 +2480,7 @@ static void wlan_hdd_cfg80211_extscan_reset_bss_hotlist_rsp(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2338,13 +2497,21 @@ static void wlan_hdd_cfg80211_extscan_set_signf_wifi_change_rsp(void *ctx, tpSirEXTScanSetSignificantChangeRspParams pData = (tpSirEXTScanSetSignificantChangeRspParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE_INDEX, GFP_KERNEL); @@ -2366,6 +2533,7 @@ static void wlan_hdd_cfg80211_extscan_set_signf_wifi_change_rsp(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2382,13 +2550,21 @@ static void wlan_hdd_cfg80211_extscan_reset_signf_wifi_change_rsp(void *ctx, tpSirEXTScanResetSignificantChangeRspParams pData = (tpSirEXTScanResetSignificantChangeRspParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE_INDEX, GFP_KERNEL); @@ -2410,6 +2586,7 @@ static void wlan_hdd_cfg80211_extscan_reset_signf_wifi_change_rsp(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2427,11 +2604,17 @@ static void wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, tpSirWifiScanResultEvent pData = (tpSirWifiScanResultEvent) pMsg; tpSirWifiScanResult pSirWifiScanResult; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } + totalResults = pData->numOfAps; hddLog(VOS_TRACE_LEVEL_INFO, "Req Id (%u)", pData->requestId); hddLog(VOS_TRACE_LEVEL_INFO, "Num results (%u)", pData->numOfAps); @@ -2443,6 +2626,9 @@ static void wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, totalResults -= EXTSCAN_MAX_CACHED_RESULTS_PER_IND; skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX, GFP_KERNEL); @@ -2570,6 +2756,7 @@ static void wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, cfg80211_vendor_event(skb, GFP_KERNEL); } while (totalResults > 0); + EXIT(); return; fail: kfree_skb(skb); @@ -2584,13 +2771,21 @@ static void wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, struct sk_buff *skb = NULL; tANI_U32 i; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX, GFP_KERNEL); @@ -2682,6 +2877,7 @@ static void wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; fail: @@ -2698,12 +2894,21 @@ static void wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind(void *ctx, tpSirWifiSignificantChangeEvent pData = (tpSirWifiSignificantChangeEvent) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE_INDEX, GFP_KERNEL); @@ -2780,6 +2985,7 @@ static void wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind(void *ctx, goto fail; } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; fail: kfree_skb(skb); @@ -2794,13 +3000,21 @@ static void wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, tpSirWifiFullScanResultEvent pData = (tpSirWifiFullScanResultEvent) (pMsg); - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)) { + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX, GFP_KERNEL); @@ -2872,6 +3086,7 @@ static void wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2887,13 +3102,21 @@ static void wlan_hdd_cfg80211_extscan_scan_res_available_event(void *ctx, tpSirEXTScanResultsAvailableIndParams pData = (tpSirEXTScanResultsAvailableIndParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)){ + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE_INDEX, GFP_KERNEL); @@ -2918,6 +3141,7 @@ static void wlan_hdd_cfg80211_extscan_scan_res_available_event(void *ctx, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2932,13 +3156,21 @@ static void wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx, void *pMsg) tpSirEXTScanProgressIndParams pData = (tpSirEXTScanProgressIndParams) pMsg; - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx)){ + return; + } + if (!pMsg) + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null")); return; } skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT_INDEX, GFP_KERNEL); @@ -2967,6 +3199,7 @@ static void wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx, void *pMsg) } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return; nla_put_failure: @@ -2979,8 +3212,9 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, { hdd_context_t *pHddCtx = (hdd_context_t *)ctx; + ENTER(); + if (wlan_hdd_validate_context(pHddCtx)) { - hddLog(VOS_TRACE_LEVEL_INFO, FL("HDD context is not valid")); return; } @@ -3041,11 +3275,12 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, hddLog(VOS_TRACE_LEVEL_ERROR, FL("invalid event type %d "), evType); break; } + EXIT(); } -static int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, - struct wireless_dev *wdev, - void *data, int dataLen) +static int __wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) { tSirGetEXTScanCapabilitiesReqParams reqMsg; struct net_device *dev = wdev->netdev; @@ -3055,12 +3290,11 @@ static int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; eHalStatus status; - hddLog(VOS_TRACE_LEVEL_INFO, FL("Entering")); + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3099,14 +3333,26 @@ static int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, FL("sme_EXTScanGetCapabilities failed(err=%d)"), status); return -EINVAL; } - + EXIT(); return 0; } +static int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + int ret = 0; -static int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, - struct wireless_dev *wdev, - void *data, int dataLen) + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_get_capabilities(wiphy, wdev, data, dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) { tSirEXTScanGetCachedResultsReqParams reqMsg; struct net_device *dev = wdev->netdev; @@ -3116,11 +3362,11 @@ static int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; eHalStatus status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3170,15 +3416,28 @@ static int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, FL("sme_getCachedResults failed(err=%d)"), status); return -EINVAL; } + EXIT(); return 0; failed: return -EINVAL; } +static int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_get_cached_results(wiphy, wdev, data, dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} -static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) { tpSirEXTScanSetBssidHotListReqParams pReqMsg = NULL; struct net_device *dev = wdev->netdev; @@ -3193,11 +3452,11 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, tANI_U8 i = 0; int rem; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3244,10 +3503,20 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, pReqMsg->numAp = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP]); + if (pReqMsg->numAp > WLAN_EXTSCAN_MAX_HOTLIST_APS) { + hddLog(LOGE, FL("Number of AP: %u exceeds max: %u"), + pReqMsg->numAp, WLAN_EXTSCAN_MAX_HOTLIST_APS); + goto fail; + } hddLog(VOS_TRACE_LEVEL_INFO, FL("Number of AP (%d)"), pReqMsg->numAp); nla_for_each_nested(apTh, tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM], rem) { + if (i == pReqMsg->numAp) { + hddLog(LOGW, FL("Ignoring excess AP")); + break; + } + if(nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, nla_data(apTh), nla_len(apTh), NULL)) { @@ -3295,6 +3564,13 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, FL("Channel (%u)"), pReqMsg->ap[i].channel); i++; } + + if (i < pReqMsg->numAp) { + hddLog(LOGW, FL("Number of AP %u less than expected %u"), + i, pReqMsg->numAp); + pReqMsg->numAp = i; + } + status = sme_SetBssHotlist(pHddCtx->hHal, pReqMsg); if (!HAL_STATUS_SUCCESS(status)) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -3304,7 +3580,7 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, } vos_mem_free(pReqMsg); - + EXIT(); return 0; fail: @@ -3312,9 +3588,23 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, return -EINVAL; } -static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(wiphy, wdev, data, + dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) { tpSirEXTScanSetSignificantChangeReqParams pReqMsg = NULL; struct net_device *dev = wdev->netdev; @@ -3329,11 +3619,11 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, int i = 0; int rem; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3408,6 +3698,11 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, } pReqMsg->numAp = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP]); + if (pReqMsg->numAp > WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS) { + hddLog(LOGE, FL("Number of AP %u exceeds max %u"), + pReqMsg->numAp, WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS); + goto fail; + } hddLog(VOS_TRACE_LEVEL_INFO, FL("Number of AP (%d)"), pReqMsg->numAp); pReqMsg->sessionId = pAdapter->sessionId; @@ -3415,6 +3710,12 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, nla_for_each_nested(apTh, tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM], rem) { + + if (i == pReqMsg->numAp) { + hddLog(LOGW, FL("Ignoring excess AP")); + break; + } + if(nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, nla_data(apTh), nla_len(apTh), @@ -3463,6 +3764,12 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, i++; } + if (i < pReqMsg->numAp) { + hddLog(LOGW, FL("Number of AP %u less than expected %u"), + i, pReqMsg->numAp); + pReqMsg->numAp = i; + } + status = sme_SetSignificantChange(pHddCtx->hHal, pReqMsg); if (!HAL_STATUS_SUCCESS(status)) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -3471,7 +3778,7 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, return -EINVAL; } vos_mem_free(pReqMsg); - hddLog(VOS_TRACE_LEVEL_ERROR, FL(" Exiting")); + EXIT(); return 0; fail: @@ -3479,34 +3786,40 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, return -EINVAL; } -static int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) { - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - tANI_U32 ChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; - tANI_U8 numChannels = 0; - struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; - tANI_U32 requestId; - tWifiBand wifiBand; - eHalStatus status; - struct sk_buff *replySkb; - tANI_U8 i; + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_set_significant_change(wiphy, wdev, data, + dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + tANI_U32 ChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; + tANI_U8 numChannels = 0; + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + tANI_U32 requestId; + tWifiBand wifiBand; + eHalStatus status; + struct sk_buff *replySkb; + tANI_U8 i; + int ret; + + ENTER(); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Entering")); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); - return -EINVAL; - } - /* check the EXTScan Capability */ - if ( (TRUE != pHddCtx->cfg_ini->fEnableEXTScan) || - (TRUE != sme_IsFeatureSupportedByFW(EXTENDED_SCAN))) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("EXTScan not enabled/supported by Firmware")); return -EINVAL; } @@ -3568,12 +3881,29 @@ static int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, return -EINVAL; } - return cfg80211_vendor_cmd_reply(replySkb); + ret = cfg80211_vendor_cmd_reply(replySkb); + + EXIT(); + return ret; } -static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_get_valid_channels(wiphy, wdev, data, + dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) { tpSirEXTScanStartReqParams pReqMsg = NULL; struct net_device *dev = wdev->netdev; @@ -3589,11 +3919,11 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, eHalStatus status; tANI_U32 j = 0, index = 0; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3802,6 +4132,7 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, } vos_mem_free(pReqMsg); + EXIT(); return 0; fail: @@ -3809,9 +4140,22 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, return -EINVAL; } -static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_start(wiphy, wdev, data, dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) { tSirEXTScanStopReqParams reqMsg; struct net_device *dev = wdev->netdev; @@ -3820,11 +4164,11 @@ static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; eHalStatus status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3863,12 +4207,26 @@ static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, return -EINVAL; } + EXIT(); return 0; } -static int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_stop(wiphy, wdev, data, dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) { tSirEXTScanResetBssidHotlistReqParams reqMsg; struct net_device *dev = wdev->netdev; @@ -3877,11 +4235,11 @@ static int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; eHalStatus status; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3919,14 +4277,27 @@ static int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, FL("sme_ResetBssHotlist failed(err=%d)"), status); return -EINVAL; } - + EXIT(); return 0; } -static int wlan_hdd_cfg80211_extscan_reset_significant_change( +static int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(wiphy, wdev, data, dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_extscan_reset_significant_change( struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int dataLen) + const void *data, int dataLen) { tSirEXTScanResetSignificantChangeReqParams reqMsg; struct net_device *dev = wdev->netdev; @@ -3935,12 +4306,11 @@ static int wlan_hdd_cfg80211_extscan_reset_significant_change( struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; eHalStatus status; - hddLog(VOS_TRACE_LEVEL_INFO, FL(" Entering")); + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } /* check the EXTScan Capability */ @@ -3980,17 +4350,34 @@ static int wlan_hdd_cfg80211_extscan_reset_significant_change( return -EINVAL; } - hddLog(VOS_TRACE_LEVEL_ERROR, FL(" Exiting")); + EXIT(); return 0; } +static int wlan_hdd_cfg80211_extscan_reset_significant_change( + struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int dataLen) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_extscan_reset_significant_change(wiphy, + wdev, data, + dataLen); + vos_ssr_unprotect(__func__); + + return ret; +} #endif /* WLAN_FEATURE_EXTSCAN */ /*EXT TDLS*/ static const struct nla_policy wlan_hdd_tdls_config_enable_policy[QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX +1] = { - [QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAC_ADDR] = {.type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAC_ADDR] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, [QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_CHANNEL] = {.type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_GLOBAL_OPERATING_CLASS] = {.type = NLA_S32 }, @@ -4002,7 +4389,9 @@ wlan_hdd_tdls_config_enable_policy[QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX +1] = static const struct nla_policy wlan_hdd_tdls_config_disable_policy[QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX +1] = { - [QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAC_ADDR] = {.type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAC_ADDR] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, }; @@ -4010,7 +4399,9 @@ static const struct nla_policy wlan_hdd_tdls_config_state_change_policy[ QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAX +1] = { - [QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAC_ADDR] = {.type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAC_ADDR] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, [QCA_WLAN_VENDOR_ATTR_TDLS_NEW_STATE] = {.type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_TDLS_STATE_REASON] = {.type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_TDLS_STATE_CHANNEL] = {.type = NLA_S32 }, @@ -4023,7 +4414,9 @@ static const struct nla_policy wlan_hdd_tdls_config_get_status_policy[ QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX +1] = { - [QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAC_ADDR] = {.type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAC_ADDR] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, [QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_STATE] = {.type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_REASON] = {.type = NLA_S32 }, [QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_CHANNEL] = {.type = NLA_S32 }, @@ -4035,28 +4428,31 @@ wlan_hdd_tdls_config_get_status_policy[ static const struct nla_policy wlan_hdd_mac_config[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX+1] = { - [QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI] = {.type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI] = { + .type = NLA_UNSPEC, + .len = VOS_MAC_ADDR_FIRST_3_BYTES}, }; -static int wlan_hdd_cfg80211_set_spoofed_mac_oui(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_set_spoofed_mac_oui(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, + const void *data, int data_len) { hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX + 1]; + ENTER(); + if (0 != wlan_hdd_validate_context(pHddCtx)){ - hddLog(VOS_TRACE_LEVEL_ERROR, FL("hdd Ctx invalid while spoof macAddr")); return -EINVAL; } - if (FALSE == pHddCtx->cfg_ini->enableMacSpoofing) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("MAC_SPOOFED_SCAN disabled in ini")); + if (0 == pHddCtx->cfg_ini->enableMacSpoofing) { + hddLog(VOS_TRACE_LEVEL_INFO, FL("MAC_SPOOFED_SCAN disabled in ini")); return -ENOTSUPP; - } + } if (TRUE != sme_IsFeatureSupportedByFW(MAC_SPOOFED_SCAN)){ - hddLog(VOS_TRACE_LEVEL_ERROR, FL("MAC_SPOOFED_SCAN not supported by FW")); + hddLog(VOS_TRACE_LEVEL_INFO, FL("MAC_SPOOFED_SCAN not supported by FW")); return -ENOTSUPP; } @@ -4076,30 +4472,47 @@ static int wlan_hdd_cfg80211_set_spoofed_mac_oui(struct wiphy *wiphy, tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]), VOS_MAC_ADDR_LAST_3_BYTES); - vos_trace_hex_dump( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,nla_data( + pHddCtx->spoofMacAddr.isEnabled = TRUE; + + vos_trace_hex_dump( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, nla_data( tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]), VOS_MAC_ADDR_FIRST_3_BYTES); - - if (VOS_STATUS_SUCCESS != vos_randomize_n_bytes( - (void *)(&pHddCtx->spoofMacAddr.randomMacAddr.bytes[3]), - VOS_MAC_ADDR_LAST_3_BYTES)) { - hddLog(LOGE, FL("Failed to generate random Mac Addr")); + if ((pHddCtx->spoofMacAddr.randomMacAddr.bytes[0] == 0) && + (pHddCtx->spoofMacAddr.randomMacAddr.bytes[1] == 0) && + (pHddCtx->spoofMacAddr.randomMacAddr.bytes[2] == 0)) + { + hddLog(LOG1, FL("ZERO MAC OUI Recieved. Disabling Spoofing")); + vos_mem_zero(pHddCtx->spoofMacAddr.randomMacAddr.bytes, + VOS_MAC_ADDRESS_LEN); + pHddCtx->spoofMacAddr.isEnabled = FALSE; } - vos_trace_hex_dump( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - pHddCtx->spoofMacAddr.randomMacAddr.bytes, - VOS_MAC_ADDR_SIZE); - if (eHAL_STATUS_SUCCESS != sme_SpoofMacAddrReq(pHddCtx->hHal, - &pHddCtx->spoofMacAddr.randomMacAddr)) { + if (VOS_STATUS_SUCCESS != hdd_processSpoofMacAddrRequest(pHddCtx)) + { hddLog(LOGE, FL("Failed to send Spoof Mac Addr to FW")); } + EXIT(); return 0; } -static int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_set_spoofed_mac_oui(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_spoofed_mac_oui(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, + const void *data, int data_len) { u8 peer[6] = {0}; @@ -4113,14 +4526,22 @@ static int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, tANI_S32 global_operating_class = 0; tANI_S32 channel = 0; struct sk_buff *skb = NULL; + int retVal; + + ENTER(); + + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return -EINVAL; + } ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) { - + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid HDD context")); return -EINVAL; } if (pHddCtx->cfg_ini->fTDLSExternalControl == FALSE) { - + hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS external control is disabled")); return -ENOTSUPP; } if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX, @@ -4141,13 +4562,8 @@ static int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, sizeof(peer)); hddLog(VOS_TRACE_LEVEL_INFO, FL(MAC_ADDRESS_STR),MAC_ADDR_ARRAY(peer)); - ret = wlan_hdd_tdls_get_status(pAdapter, peer, &state, &reason); + wlan_hdd_tdls_get_status(pAdapter, peer, &state, &reason); - if (0 != ret) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("get status Failed")); - return -EINVAL; - } skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 4 * sizeof(s32) + NLMSG_HDRLEN); @@ -4180,35 +4596,66 @@ static int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, goto nla_put_failure; } - return cfg80211_vendor_cmd_reply(skb); + retVal = cfg80211_vendor_cmd_reply(skb); + EXIT(); + return retVal; nla_put_failure: kfree_skb(skb); return -EINVAL; } -static int wlan_hdd_cfg80211_exttdls_callback(tANI_U8* mac, +static int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_exttdls_get_status(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int wlan_hdd_cfg80211_exttdls_callback( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8* mac, +#else + tANI_U8* mac, +#endif tANI_S32 state, tANI_S32 reason, void *ctx) { hdd_adapter_t* pAdapter = (hdd_adapter_t*)ctx; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); struct sk_buff *skb = NULL; tANI_S32 global_operating_class = 0; tANI_S32 channel = 0; + hdd_context_t *pHddCtx; + + ENTER(); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if (wlan_hdd_validate_context(pHddCtx)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid ")); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid HDD context")); return -EINVAL; } if (pHddCtx->cfg_ini->fTDLSExternalControl == FALSE) { - + hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS external control is disabled")); return -ENOTSUPP; } - skb = cfg80211_vendor_event_alloc( - pHddCtx->wiphy, + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + NULL, +#endif EXTTDLS_EVENT_BUF_SIZE + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX, GFP_KERNEL); @@ -4248,6 +4695,7 @@ static int wlan_hdd_cfg80211_exttdls_callback(tANI_U8* mac, } cfg80211_vendor_event(skb, GFP_KERNEL); + EXIT(); return (0); nla_put_failure: @@ -4255,27 +4703,40 @@ static int wlan_hdd_cfg80211_exttdls_callback(tANI_U8* mac, return -EINVAL; } -static int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, + const void *data, int data_len) { u8 peer[6] = {0}; struct net_device *dev = wdev->netdev; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX + 1]; eHalStatus status; tdls_req_params_t pReqMsg = {0}; + int ret; + hdd_adapter_t *pAdapter; + + ENTER(); + + if (!dev) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Dev pointer is NULL")); + return -EINVAL; + } + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return -EINVAL; + } status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid HDD context")); return -EINVAL; } if (pHddCtx->cfg_ini->fTDLSExternalControl == FALSE) { - + hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS external control is disabled")); return -ENOTSUPP; } if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX, @@ -4336,31 +4797,62 @@ static int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO, FL("Bandwidth (%d)"), pReqMsg.min_bandwidth_kbps); - return (wlan_hdd_tdls_extctrl_config_peer(pAdapter, + ret = wlan_hdd_tdls_extctrl_config_peer(pAdapter, peer, - wlan_hdd_cfg80211_exttdls_callback)); + &pReqMsg, + wlan_hdd_cfg80211_exttdls_callback); + + EXIT(); + return ret; } -static int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, +static int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_exttdls_enable(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, + const void *data, int data_len) { u8 peer[6] = {0}; struct net_device *dev = wdev->netdev; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX + 1]; eHalStatus status; + int ret; + hdd_adapter_t *pAdapter; + + ENTER(); + + if (!dev) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Dev pointer is NULL")); + return -EINVAL; + } + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adapter is NULL")); + return -EINVAL; + } status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid HDD context")); return -EINVAL; } if (pHddCtx->cfg_ini->fTDLSExternalControl == FALSE) { - + hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS external control is disabled")); return -ENOTSUPP; } if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX, @@ -4380,20 +4872,45 @@ static int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, sizeof(peer)); hddLog(VOS_TRACE_LEVEL_INFO, FL(MAC_ADDRESS_STR),MAC_ADDR_ARRAY(peer)); - return (wlan_hdd_tdls_extctrl_deconfig_peer(pAdapter, peer)); + ret = wlan_hdd_tdls_extctrl_deconfig_peer(pAdapter, peer); + + EXIT(); + return ret; +} + +static int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_exttdls_disable(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; } static int -wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, +__wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int data_len) + const void *data, int data_len) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); struct sk_buff *skb = NULL; tANI_U32 fset = 0; + int ret = 0; + ENTER(); + + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } if (wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { hddLog(LOG1, FL("Infra Station mode is supported by driver")); fset |= WIFI_FEATURE_INFRA; @@ -4426,12 +4943,10 @@ wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, } #endif -#ifdef WLAN_FEATURE_NAN if (sme_IsFeatureSupportedByFW(NAN)) { hddLog(LOG1, FL("NAN is supported by firmware")); fset |= WIFI_FEATURE_NAN; } -#endif /* D2D RTT is not supported currently by default */ if (sme_IsFeatureSupportedByFW(RTT)) { @@ -4475,6 +4990,11 @@ wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, fset |= WIFI_FEATURE_AP_STA; #endif +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + fset |= WIFI_FEATURE_LINK_LAYER_STATS; + hddLog(LOG1, FL("Link layer stats is supported by driver")); +#endif + skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(fset) + NLMSG_HDRLEN); @@ -4489,7 +5009,9 @@ wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, goto nla_put_failure; } - return cfg80211_vendor_cmd_reply(skb); + ret = cfg80211_vendor_cmd_reply(skb); + EXIT(); + return ret; nla_put_failure: kfree_skb(skb); @@ -4497,47 +5019,73 @@ wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, } static int -wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, +wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, int data_len) + const void *data, int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_supported_features(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +#define MAX_CONCURRENT_MATRIX \ + QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX +#define MATRIX_CONFIG_PARAM_SET_SIZE_MAX \ + QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX +static const struct nla_policy +wlan_hdd_get_concurrency_matrix_policy[MAX_CONCURRENT_MATRIX + 1] = { + [MATRIX_CONFIG_PARAM_SET_SIZE_MAX] = {.type = NLA_U32}, +}; + +static int +__wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) { uint32_t feature_set_matrix[WLAN_HDD_MAX_FEATURE_SET] = {0}; uint8_t i, feature_sets, max_feature_sets; - struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX + 1]; + struct nlattr *tb[MAX_CONCURRENT_MATRIX + 1]; struct sk_buff *reply_skb; + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + int ret; ENTER(); - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX, - data, data_len, NULL)) { + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + if (nla_parse(tb, MAX_CONCURRENT_MATRIX, data, data_len, + wlan_hdd_get_concurrency_matrix_policy)) { hddLog(LOGE, FL("Invalid ATTR")); return -EINVAL; } /* Parse and fetch max feature set */ - if (!tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]) { + if (!tb[MATRIX_CONFIG_PARAM_SET_SIZE_MAX]) { hddLog(LOGE, FL("Attr max feature set size failed")); return -EINVAL; } - max_feature_sets = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]); + max_feature_sets = nla_get_u32(tb[MATRIX_CONFIG_PARAM_SET_SIZE_MAX]); hddLog(LOG1, FL("Max feature set size (%d)"), max_feature_sets); /* Fill feature combination matrix */ feature_sets = 0; - if (feature_sets >= WLAN_HDD_MAX_FEATURE_SET) goto max_buffer_err; feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | WIFI_FEATURE_P2P; - if (feature_sets >= WLAN_HDD_MAX_FEATURE_SET) goto max_buffer_err; feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | WIFI_FEATURE_SOFT_AP; - if (feature_sets >= WLAN_HDD_MAX_FEATURE_SET) goto max_buffer_err; feature_set_matrix[feature_sets++] = WIFI_FEATURE_P2P | WIFI_FEATURE_SOFT_AP; - if (feature_sets >= WLAN_HDD_MAX_FEATURE_SET) goto max_buffer_err; feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | WIFI_FEATURE_SOFT_AP | WIFI_FEATURE_P2P; @@ -4566,15 +5114,31 @@ wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, return -EINVAL; } - return cfg80211_vendor_cmd_reply(reply_skb); + ret = cfg80211_vendor_cmd_reply(reply_skb); + EXIT(); + return ret; } hddLog(LOGE, FL("Feature set matrix: buffer alloc fail")); return -ENOMEM; -max_buffer_err: - hddLog(LOGE, FL("Feature set max buffer size reached. feature_sets(%d) max(%d)"), - feature_sets, WLAN_HDD_MAX_FEATURE_SET); - return -EINVAL; +} + +#undef MAX_CONCURRENT_MATRIX +#undef MATRIX_CONFIG_PARAM_SET_SIZE_MAX + +static int +wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_concurrency_matrix(wiphy, wdev, data, + data_len); + vos_ssr_unprotect(__func__); + + return ret; } static const struct nla_policy @@ -4584,9 +5148,9 @@ wlan_hdd_set_no_dfs_flag_config_policy[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX [QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG] = {.type = NLA_U32 }, }; -static int wlan_hdd_cfg80211_disable_dfs_channels(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_disable_dfs_channels(struct wiphy *wiphy, struct wireless_dev *wdev, - void *data, + const void *data, int data_len) { struct net_device *dev = wdev->netdev; @@ -4597,10 +5161,10 @@ static int wlan_hdd_cfg80211_disable_dfs_channels(struct wiphy *wiphy, eHalStatus status; u32 dfsFlag = 0; + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return -EINVAL; } if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX, @@ -4625,18 +5189,37 @@ static int wlan_hdd_cfg80211_disable_dfs_channels(struct wiphy *wiphy, sme_disable_dfs_channel(hHal, dfsFlag); sme_FilterScanResults(hHal, pAdapter->sessionId); + + EXIT(); return 0; } +static int wlan_hdd_cfg80211_disable_dfs_channels(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_disable_dfs_channels(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; + +} + const struct nla_policy qca_wlan_vendor_attr[QCA_WLAN_VENDOR_ATTR_MAX+1] = { [QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY] = { .type = NLA_U32 }, - [QCA_WLAN_VENDOR_ATTR_MAC_ADDR] = { .type = NLA_UNSPEC }, + [QCA_WLAN_VENDOR_ATTR_MAC_ADDR] = { + .type = NLA_UNSPEC, + .len = HDD_MAC_ADDR_LEN}, }; -static int wlan_hdd_cfg80211_firmware_roaming(struct wiphy *wiphy, - struct wireless_dev *wdev, void *data, int data_len) +static int __wlan_hdd_cfg80211_firmware_roaming(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int data_len) { u8 bssid[6] = {0}; @@ -4646,10 +5229,11 @@ static int wlan_hdd_cfg80211_firmware_roaming(struct wiphy *wiphy, v_U32_t isFwrRoamEnabled = FALSE; int ret; - if (NULL == pHddCtx) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); - return -EINVAL; + ENTER(); + + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { + return ret; } ret = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, @@ -4677,14 +5261,101 @@ static int wlan_hdd_cfg80211_firmware_roaming(struct wiphy *wiphy, return -EINVAL; } - memcpy(bssid, nla_data( - tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]), - sizeof(bssid)); - hddLog(VOS_TRACE_LEVEL_INFO, FL(MAC_ADDRESS_STR),MAC_ADDR_ARRAY(bssid)); + memcpy(bssid, nla_data( + tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]), + sizeof(bssid)); + hddLog(VOS_TRACE_LEVEL_INFO, FL(MAC_ADDRESS_STR),MAC_ADDR_ARRAY(bssid)); + + //Update roaming + status = sme_ConfigFwrRoaming((tHalHandle)(pHddCtx->hHal), isFwrRoamEnabled); + EXIT(); + return status; +} + +static int wlan_hdd_cfg80211_firmware_roaming(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int data_len) +{ + int ret = 0; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_firmware_roaming(wiphy, wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + +/** + * __wlan_hdd_cfg80211_setband() - set band + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Return: 0 on success, negative errno on failure + */ +static int +__wlan_hdd_cfg80211_setband(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + struct net_device *dev = wdev->netdev; + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_MAX + 1]; + int ret; + static const struct nla_policy policy[QCA_WLAN_VENDOR_ATTR_MAX + 1] + = {[QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE] = { .type = NLA_U32 }}; + + ENTER(); + + ret = wlan_hdd_validate_context(hdd_ctx); + if (0 != ret) { + hddLog(LOGE, FL("HDD context is not valid")); + return ret; + } + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, + policy)) { + hddLog(LOGE, FL("Invalid ATTR")); + return -EINVAL; + } + + if (!tb[QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE]) { + hddLog(LOGE, FL("attr QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE failed")); + return -EINVAL; + } + + hdd_ctx->isSetBandByNL = TRUE; + ret = hdd_setBand(dev, + nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE])); + hdd_ctx->isSetBandByNL = FALSE; + + EXIT(); + return ret; +} + +/** + * wlan_hdd_cfg80211_setband() - Wrapper to offload packets + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * Return: 0 on success; errno on failure + */ +static int wlan_hdd_cfg80211_setband(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret = 0; - //Update roaming - status = sme_ConfigFwrRoaming((tHalHandle)(pHddCtx->hHal), isFwrRoamEnabled); - return status; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_setband(wiphy, + wdev, data, data_len); + vos_ssr_unprotect(__func__); + + return ret; } const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = @@ -4695,8 +5366,18 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_firmware_roaming + .doit = (void *)wlan_hdd_cfg80211_firmware_roaming + }, + + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NAN, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = (void *)wlan_hdd_cfg80211_nan_request }, + #ifdef WLAN_FEATURE_LINK_LAYER_STATS { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4704,7 +5385,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_ll_stats_clear + .doit = (void *)wlan_hdd_cfg80211_ll_stats_clear }, { @@ -4713,7 +5394,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_ll_stats_set + .doit = (void *)wlan_hdd_cfg80211_ll_stats_set }, { @@ -4722,7 +5403,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_ll_stats_get + .doit = (void *)wlan_hdd_cfg80211_ll_stats_get }, #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ #ifdef WLAN_FEATURE_EXTSCAN @@ -4732,7 +5413,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_start + .doit = (void *)wlan_hdd_cfg80211_extscan_start }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4740,14 +5421,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_stop + .doit = (void *)wlan_hdd_cfg80211_extscan_stop }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_extscan_get_valid_channels + .doit = (void *)wlan_hdd_cfg80211_extscan_get_valid_channels }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4755,7 +5436,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_get_capabilities + .doit = (void *)wlan_hdd_cfg80211_extscan_get_capabilities }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4763,7 +5444,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_get_cached_results + .doit = (void *)wlan_hdd_cfg80211_extscan_get_cached_results }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4771,7 +5452,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_set_bssid_hotlist + .doit = (void *)wlan_hdd_cfg80211_extscan_set_bssid_hotlist }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4779,7 +5460,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_reset_bssid_hotlist + .doit = (void *)wlan_hdd_cfg80211_extscan_reset_bssid_hotlist }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4787,7 +5468,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_set_significant_change + .doit = (void *)wlan_hdd_cfg80211_extscan_set_significant_change }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4795,7 +5476,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_extscan_reset_significant_change + .doit = (void *)wlan_hdd_cfg80211_extscan_reset_significant_change }, #endif /* WLAN_FEATURE_EXTSCAN */ /*EXT TDLS*/ @@ -4805,7 +5486,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_exttdls_enable + .doit = (void *)wlan_hdd_cfg80211_exttdls_enable }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -4813,43 +5494,51 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_exttdls_disable + .doit = (void *)wlan_hdd_cfg80211_exttdls_disable }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_exttdls_get_status + .doit = (void *)wlan_hdd_cfg80211_exttdls_get_status }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_get_supported_features + .doit = (void *)wlan_hdd_cfg80211_get_supported_features }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_disable_dfs_channels + .doit = (void *)wlan_hdd_cfg80211_disable_dfs_channels }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_MAC_OUI, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_set_spoofed_mac_oui + .doit = (void *)wlan_hdd_cfg80211_set_spoofed_mac_oui }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_get_concurrency_matrix + .doit = (void *)wlan_hdd_cfg80211_get_concurrency_matrix }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SETBAND, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = (void *)wlan_hdd_cfg80211_setband + } }; /* vendor specific events */ @@ -4953,6 +5642,12 @@ struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = .vendor_id = QCA_NL80211_VENDOR_ID, .subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE }, + + { + .vendor_id = QCA_NL80211_VENDOR_ID, + .subcmd = QCA_NL80211_VENDOR_SUBCMD_NAN + }, + }; /* @@ -5069,8 +5764,11 @@ int wlan_hdd_cfg80211_init(struct device *dev, /* This will disable updating of NL channels from passive to * active if a beacon is received on passive channel. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS; +#else wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS; - +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) @@ -5078,7 +5776,11 @@ int wlan_hdd_cfg80211_init(struct device *dev, | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | WIPHY_FLAG_OFFCHAN_TX; - wiphy->country_ie_pref = NL80211_COUNTRY_IE_IGNORE_CORE; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + wiphy->regulatory_flags = REGULATORY_COUNTRY_IE_IGNORE; +#else + wiphy->country_ie_pref = NL80211_COUNTRY_IE_IGNORE_CORE; +#endif #endif #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) @@ -5108,6 +5810,10 @@ int wlan_hdd_cfg80211_init(struct device *dev, } #endif/*FEATURE_WLAN_SCAN_PNO*/ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + wiphy->features |= NL80211_FEATURE_HT_IBSS; +#endif + #ifdef CONFIG_ENABLE_LINUX_REG /* even with WIPHY_FLAG_CUSTOM_REGULATORY, driver can still register regulatory callback and @@ -5122,16 +5828,21 @@ int wlan_hdd_cfg80211_init(struct device *dev, wiphy->max_scan_ssids = MAX_SCAN_SSID; - wiphy->max_scan_ie_len = SIR_MAC_MAX_IE_LENGTH; + wiphy->max_scan_ie_len = SIR_MAC_MAX_ADD_IE_LENGTH; wiphy->max_acl_mac_addrs = MAX_ACL_MAC_ADDRESS; /* Supports STATION & AD-HOC modes right now */ - wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) - | BIT(NL80211_IFTYPE_ADHOC) - | BIT(NL80211_IFTYPE_P2P_CLIENT) - | BIT(NL80211_IFTYPE_P2P_GO) - | BIT(NL80211_IFTYPE_AP); + wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) + | BIT(NL80211_IFTYPE_ADHOC) + | BIT(NL80211_IFTYPE_P2P_CLIENT) + | BIT(NL80211_IFTYPE_P2P_GO) + | BIT(NL80211_IFTYPE_AP); + + if (VOS_MONITOR_MODE == hdd_get_conparam()) + { + wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); + } if( pCfg->advertiseConcurrentOperation ) { @@ -5168,19 +5879,51 @@ int wlan_hdd_cfg80211_init(struct device *dev, { wlan_hdd_band_5_GHZ.ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; } + /* + * In case of static linked driver at the time of driver unload, + * module exit doesn't happens. Module cleanup helps in cleaning + * of static memory. + * If driver load happens statically, at the time of driver unload, + * wiphy flags don't get reset because of static memory. + * It's better not to store channel in static memory. + */ + wiphy->bands[IEEE80211_BAND_2GHZ] = &wlan_hdd_band_2_4_GHZ; + wiphy->bands[IEEE80211_BAND_2GHZ]->channels = + (struct ieee80211_channel *)vos_mem_malloc(sizeof(hdd_channels_2_4_GHZ)); + if (wiphy->bands[IEEE80211_BAND_2GHZ]->channels == NULL) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not enough memory to allocate channels")); + return -ENOMEM; + } + vos_mem_copy(wiphy->bands[IEEE80211_BAND_2GHZ]->channels, + &hdd_channels_2_4_GHZ[0], + sizeof(hdd_channels_2_4_GHZ)); - wiphy->bands[IEEE80211_BAND_2GHZ] = &wlan_hdd_band_2_4_GHZ; - if (true == hdd_is_5g_supported(pHddCtx)) - { - wiphy->bands[IEEE80211_BAND_5GHZ] = &wlan_hdd_band_5_GHZ; - } + if (true == hdd_is_5g_supported(pHddCtx)) + { + wiphy->bands[IEEE80211_BAND_5GHZ] = &wlan_hdd_band_5_GHZ; + wiphy->bands[IEEE80211_BAND_5GHZ]->channels = + (struct ieee80211_channel *)vos_mem_malloc(sizeof(hdd_channels_5_GHZ)); + if (wiphy->bands[IEEE80211_BAND_5GHZ]->channels == NULL) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not enough memory to allocate channels")); + vos_mem_free(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); + wiphy->bands[IEEE80211_BAND_2GHZ]->channels = NULL; + return -ENOMEM; + } + vos_mem_copy(wiphy->bands[IEEE80211_BAND_5GHZ]->channels, + &hdd_channels_5_GHZ[0], + sizeof(hdd_channels_5_GHZ)); + } for (i = 0; i < IEEE80211_NUM_BANDS; i++) { if (NULL == wiphy->bands[i]) { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wiphy->bands[i] is NULL, i = %d", + hddLog(VOS_TRACE_LEVEL_INFO,"%s: wiphy->bands[i] is NULL, i = %d", __func__, i); continue; } @@ -5273,16 +6016,15 @@ void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy) } } } - /* This function registers for all frame which supplicant is interested in */ void wlan_hdd_cfg80211_register_frames(hdd_adapter_t* pAdapter) { tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); /* Register for all P2P action, public action etc frames */ v_U16_t type = (SIR_MAC_MGMT_FRAME << 2) | ( SIR_MAC_MGMT_ACTION << 4); - ENTER(); - + /* Register frame indication call back */ + sme_register_mgmt_frame_ind_callback(hHal, hdd_indicate_mgmt_frame); /* Right now we are registering these frame when driver is getting initialized. Once we will move to 2.6.37 kernel, in which we have frame register ops, we will move this code as a part of that */ @@ -5368,7 +6110,7 @@ void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t* pAdapter) #ifdef FEATURE_WLAN_WAPI void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t* pAdapter, u8 key_index, - const u8 *mac_addr, u8 *key , int key_Len) + const u8 *mac_addr, const u8 *key , int key_Len) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); tCsrRoamSetKey setKey; @@ -5540,10 +6282,16 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, } -v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(v_U8_t *pIes, int length, v_U8_t eid) +v_U8_t* wlan_hdd_cfg80211_get_ie_ptr( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + const v_U8_t *pIes, +#else + v_U8_t *pIes, +#endif + int length, v_U8_t eid) { int left = length; - v_U8_t *ptr = pIes; + v_U8_t *ptr = (v_U8_t *)pIes; v_U8_t elem_id,elem_len; while(left >= 2) @@ -6082,10 +6830,10 @@ VOS_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,int chann } /** - * FUNCTION: wlan_hdd_cfg80211_set_channel + * FUNCTION: __wlan_hdd_cfg80211_set_channel * This function is used to set the channel number */ -static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device *dev, +static int __wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device *dev, struct ieee80211_channel *chan, enum nl80211_channel_type channel_type ) @@ -6099,7 +6847,6 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device ENTER(); - if( NULL == dev ) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -6118,11 +6865,8 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -6234,6 +6978,21 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device return status; } +static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, + struct net_device *dev, + struct ieee80211_channel *chan, + enum nl80211_channel_type channel_type + ) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_channel(wiphy, dev, chan, channel_type); + vos_ssr_unprotect(__func__); + + return ret; +} + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, struct beacon_parameters *params) @@ -6241,7 +7000,8 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, struct cfg80211_beacon_data *params, const u8 *ssid, size_t ssid_len, - enum nl80211_hidden_ssid hidden_ssid) + enum nl80211_hidden_ssid hidden_ssid, + v_U8_t auth_type) #endif { tsap_Config_t *pConfig; @@ -6265,9 +7025,8 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, tSmeConfigParams *psmeConfig; v_BOOL_t MFPCapable = VOS_FALSE; v_BOOL_t MFPRequired = VOS_FALSE; - eHddDot11Mode sapDot11Mode = - (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->sapDot11Mode; - + v_BOOL_t sapEnable11AC = + (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->sapEnable11AC; ENTER(); iniConfig = pHddCtx->cfg_ini; @@ -6346,7 +7105,22 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, { pConfig->ieee80211d = 0; } - pConfig->authType = eSAP_AUTO_SWITCH; + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) + if (params->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) + pConfig->authType = eSAP_OPEN_SYSTEM; + else if (params->auth_type == NL80211_AUTHTYPE_SHARED_KEY) + pConfig->authType = eSAP_SHARED_KEY; + else + pConfig->authType = eSAP_AUTO_SWITCH; +#else + if (auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) + pConfig->authType = eSAP_OPEN_SYSTEM; + else if (auth_type == NL80211_AUTHTYPE_SHARED_KEY) + pConfig->authType = eSAP_SHARED_KEY; + else + pConfig->authType = eSAP_AUTO_SWITCH; +#endif capab_info = pMgmt_frame->u.beacon.capab_info; @@ -6561,17 +7335,14 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, #ifdef WLAN_FEATURE_11AC /* Overwrite the hostapd setting for HW mode only for 11ac. - * This is valid only if mode is set to 11n in hostapd, either AUTO or - * 11ac in .ini and 11ac is supported by both host and firmware. + * This is valid only if mode is set to 11n in hostapd, sapEnable11AC + * is set in .ini and 11ac is supported by both host and firmware. * Otherwise, leave whatever is set in hostapd (a OR b OR g OR n mode) */ if( ((pConfig->SapHw_mode == eSAP_DOT11_MODE_11n) || (pConfig->SapHw_mode == eSAP_DOT11_MODE_11n_ONLY)) && - (( sapDot11Mode == eHDD_DOT11_MODE_AUTO ) || - ( sapDot11Mode == eHDD_DOT11_MODE_11ac ) || - ( sapDot11Mode == eHDD_DOT11_MODE_11ac_ONLY ) ) && - (sme_IsFeatureSupportedByDriver(DOT11AC)) && - (sme_IsFeatureSupportedByFW(DOT11AC)) ) + (sapEnable11AC) && (sme_IsFeatureSupportedByDriver(DOT11AC)) && + (sme_IsFeatureSupportedByFW(DOT11AC)) ) { v_U32_t operatingBand = 0; pConfig->SapHw_mode = eSAP_DOT11_MODE_11ac; @@ -6597,12 +7368,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, } #endif - if ( AUTO_CHANNEL_SELECT != pConfig->channel ) - { - sme_SelectCBMode(hHal, - sapConvertSapPhyModeToCsrPhyMode(pConfig->SapHw_mode), - pConfig->channel); - } // ht_capab is not what the name conveys,this is used for protection bitmap pConfig->ht_capab = (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->apProtection; @@ -6659,8 +7424,18 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, psmeConfig = (tSmeConfigParams*) vos_mem_malloc(sizeof(tSmeConfigParams)); if ( NULL != psmeConfig) { + vos_mem_zero(psmeConfig, sizeof (tSmeConfigParams)); sme_GetConfigParam(hHal, psmeConfig); pConfig->scanBandPreference = psmeConfig->csrConfig.scanBandPreference; +#ifdef WLAN_FEATURE_AP_HT40_24G + if (((pHostapdAdapter->device_mode == WLAN_HDD_SOFTAP) + || (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO)) + && pHddCtx->cfg_ini->apHT40_24GEnabled) + { + psmeConfig->csrConfig.apHT40_24GEnabled = 1; + sme_UpdateConfig (hHal, psmeConfig); + } +#endif vos_mem_free(psmeConfig); } pConfig->acsBandSwitchThreshold = iniConfig->acsBandSwitchThreshold; @@ -6735,11 +7510,8 @@ static int __wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -6805,6 +7577,7 @@ static int __wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy, int status; ENTER(); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_BEACON, pAdapter->sessionId, pHddStaCtx->conn_info.authType)); @@ -6814,11 +7587,8 @@ static int __wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -6881,7 +7651,6 @@ static int __wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy, hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = NULL; hdd_scaninfo_t *pScanInfo = NULL; - hdd_adapter_t *staAdapter = NULL; VOS_STATUS status; long ret; @@ -6899,26 +7668,11 @@ static int __wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy, pAdapter->sessionId, pAdapter->device_mode)); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } - staAdapter = hdd_get_adapter(pAdapter->pHddCtx, WLAN_HDD_INFRA_STATION); - if (NULL == staAdapter) - { - staAdapter = hdd_get_adapter(pAdapter->pHddCtx, WLAN_HDD_P2P_CLIENT); - if (NULL == staAdapter) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: HDD adapter context for STA/P2P-CLI is Null", - __func__); - } - } - pScanInfo = &pHddCtx->scan_info; hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %s (%d)", @@ -7067,10 +7821,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, ENTER(); - if (NULL == dev) + if (NULL == dev || NULL == params) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Device is Null", __func__); + "%s: Device or params is Null", __func__); return -ENODEV; } @@ -7094,11 +7848,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -7122,7 +7873,16 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, return -EALREADY; } - status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, ¶ms->beacon, params->dtim_period); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) + status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, + &new, + ¶ms->beacon); +#else + status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, + &new, + ¶ms->beacon, + params->dtim_period); +#endif if (status != 0) { @@ -7140,7 +7900,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, #endif #endif status = wlan_hdd_cfg80211_start_bss(pAdapter, ¶ms->beacon, params->ssid, - params->ssid_len, params->hidden_ssid); + params->ssid_len, params->hidden_ssid, + params->auth_type); } EXIT(); @@ -7178,11 +7939,8 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -7212,7 +7970,8 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, pAdapter->sessionCtx.ap.beacon = new; - status = wlan_hdd_cfg80211_start_bss(pAdapter, params, NULL, 0, 0); + status = wlan_hdd_cfg80211_start_bss(pAdapter, params, NULL, 0, 0, + pAdapter->sessionCtx.ap.sapConfig.authType); } EXIT(); @@ -7239,9 +7998,23 @@ static int __wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy, struct bss_parameters *params) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); + if (NULL == pAdapter) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD adapter is Null", __func__); + return -ENODEV; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_CHANGE_BSS, pAdapter->sessionId, params->ap_isolate)); @@ -7330,11 +8103,8 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, TRACE_CODE_HDD_CFG80211_CHANGE_IFACE, pAdapter->sessionId, type)); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -7370,6 +8140,21 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, /* Reset the current device mode bit mask*/ wlan_hdd_clear_concurrency_mode(pHddCtx, pAdapter->device_mode); + if ((pAdapter->device_mode == WLAN_HDD_P2P_DEVICE) && + ((type == NL80211_IFTYPE_P2P_CLIENT) || + (type == NL80211_IFTYPE_P2P_GO))) + { + /* Notify Mode change in case of concurrency. + * Below function invokes TDLS teardown Functionality Since TDLS is + * not Supported in case of concurrency i.e Once P2P session + * is detected disable offchannel and teardown TDLS links + */ + hddLog(LOG1, + FL("Device mode = %d Interface type = %d"), + pAdapter->device_mode, type); + hdd_tdls_notify_mode_change(pAdapter, pHddCtx); + } + if( (pAdapter->device_mode == WLAN_HDD_INFRA_STATION) || (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) || (pAdapter->device_mode == WLAN_HDD_P2P_DEVICE) @@ -7404,6 +8189,11 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, //Check for sub-string p2p to confirm its a p2p interface if (NULL != strstr(ndev->name,"p2p")) { +#ifdef FEATURE_WLAN_TDLS + mutex_lock(&pHddCtx->tdls_lock); + wlan_hdd_tdls_exit(pAdapter, TRUE); + mutex_unlock(&pHddCtx->tdls_lock); +#endif pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ? WLAN_HDD_P2P_DEVICE : WLAN_HDD_P2P_CLIENT; } @@ -7412,26 +8202,8 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ? WLAN_HDD_INFRA_STATION: WLAN_HDD_P2P_CLIENT; } -#ifdef FEATURE_WLAN_TDLS - /* The open adapter for the p2p shall skip initializations in - * tdls_init if the device mode is WLAN_HDD_P2P_DEVICE, for - * TDLS is supported only on WLAN_HDD_P2P_CLIENT. Hence invoke - * tdls_init when the change_iface sets the device mode to - * WLAN_HDD_P2P_CLIENT. - */ - - if ( pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) - { - if (0 != wlan_hdd_sta_tdls_init (pAdapter)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: tdls initialization failed", __func__); - return -EINVAL; - } - } -#endif - break; + case NL80211_IFTYPE_ADHOC: hddLog(VOS_TRACE_LEVEL_INFO, "%s: setting interface Type to ADHOC", __func__); @@ -7440,6 +8212,14 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode); pAdapter->device_mode = WLAN_HDD_IBSS; wdev->iftype = type; + hdd_set_ibss_ops( pAdapter ); + hdd_ibss_init_tx_rx( pAdapter ); + + status = hdd_sta_id_hash_attach(pAdapter); + if (VOS_STATUS_SUCCESS != status) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Failed to initialize hash for IBSS")); + } break; case NL80211_IFTYPE_AP: @@ -7469,7 +8249,7 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, if (pP2pAdapter) { hdd_stop_adapter(pHddCtx, pP2pAdapter, VOS_TRUE); - hdd_deinit_adapter(pHddCtx, pP2pAdapter); + hdd_deinit_adapter(pHddCtx, pP2pAdapter, TRUE); hdd_close_adapter(pHddCtx, pP2pAdapter, VOS_TRUE); } } @@ -7492,7 +8272,7 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, mutex_lock(&pHddCtx->tdls_lock); #endif //De-init the adapter. - hdd_deinit_adapter( pHddCtx, pAdapter ); + hdd_deinit_adapter( pHddCtx, pAdapter, TRUE); memset(&pAdapter->sessionCtx, 0, sizeof(pAdapter->sessionCtx)); pAdapter->device_mode = (type == NL80211_IFTYPE_AP) ? WLAN_HDD_SOFTAP : WLAN_HDD_P2P_GO; @@ -7571,6 +8351,14 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, } hdd_set_conparam(1); + status = hdd_sta_id_hash_attach(pAdapter); + if (VOS_STATUS_SUCCESS != status) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Failed to initialize hash for AP")); + return -EINVAL; + } + /*interface type changed update in wiphy structure*/ if(wdev) { @@ -7611,7 +8399,7 @@ int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, */ mutex_lock(&pHddCtx->tdls_lock); #endif - hdd_deinit_adapter( pHddCtx, pAdapter ); + hdd_deinit_adapter( pHddCtx, pAdapter, TRUE); wdev->iftype = type; //Check for sub-string p2p to confirm its a p2p interface if (NULL != strstr(ndev->name,"p2p")) @@ -7745,17 +8533,34 @@ int wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, #ifdef FEATURE_WLAN_TDLS static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, - struct net_device *dev, u8 *mac, bool update, tCsrStaParams *StaParams) + struct net_device *dev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + bool update, tCsrStaParams *StaParams) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); - VOS_STATUS status; hddTdlsPeer_t *pTdlsPeer; long ret; tANI_U16 numCurrTdlsPeers; + hdd_adapter_t *pAdapter; + VOS_STATUS status; ENTER(); + if (!dev) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Dev pointer is NULL")); + return -EINVAL; + } + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adapter is NULL")); + return -EINVAL; + } + if (NULL == pHddCtx || NULL == pHddCtx->cfg_ini) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -7766,7 +8571,7 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, if ((eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) || (eTDLS_SUPPORT_DISABLED == pHddCtx->tdls_mode)) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: TDLS mode is disabled OR not enabled in FW." MAC_ADDRESS_STR " Request declined.", __func__, MAC_ADDR_ARRAY(mac)); @@ -7784,12 +8589,14 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, return -EBUSY; } + mutex_lock(&pHddCtx->tdls_lock); pTdlsPeer = wlan_hdd_tdls_get_peer(pAdapter, mac); if ( NULL == pTdlsPeer ) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " (update %d) not exist. return invalid", __func__, MAC_ADDR_ARRAY(mac), update); + mutex_unlock(&pHddCtx->tdls_lock); return -EINVAL; } @@ -7798,10 +8605,11 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, ((pTdlsPeer->link_status >= eTDLS_LINK_CONNECTING) || (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " link_status %d. staId %d. add station ignored.", __func__, MAC_ADDR_ARRAY(mac), pTdlsPeer->link_status, pTdlsPeer->staId); + mutex_unlock(&pHddCtx->tdls_lock); return 0; } /* in change station, we accept only when staId is valid */ @@ -7809,16 +8617,19 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, ((pTdlsPeer->link_status > eTDLS_LINK_CONNECTING) || (!TDLS_STA_INDEX_VALID(pTdlsPeer->staId)))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + tANI_U16 staId = pTdlsPeer->staId; + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " link status %d. staId %d. change station %s.", - __func__, MAC_ADDR_ARRAY(mac), pTdlsPeer->link_status, pTdlsPeer->staId, - (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)) ? "ignored" : "declined"); - return (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)) ? 0 : -EPERM; + __func__, MAC_ADDR_ARRAY(mac), pTdlsPeer->link_status, staId, + (TDLS_STA_INDEX_VALID(staId)) ? "ignored" : "declined"); + mutex_unlock(&pHddCtx->tdls_lock); + return (TDLS_STA_INDEX_VALID(staId)) ? 0 : -EPERM; } + mutex_unlock(&pHddCtx->tdls_lock); /* when others are on-going, we want to change link_status to idle */ - if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, mac, TRUE)) + if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, mac, TRUE, TRUE)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR @@ -7844,14 +8655,17 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, else { hddTdlsPeer_t *pTdlsPeer; - pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, mac, TRUE); + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, mac, FALSE); if (pTdlsPeer && TDLS_IS_CONNECTED(pTdlsPeer)) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " already connected. Request declined.", __func__, MAC_ADDR_ARRAY(mac)); return -EPERM; } + mutex_unlock(&pHddCtx->tdls_lock); } if (0 == update) wlan_hdd_tdls_set_link_status(pAdapter, @@ -7862,23 +8676,23 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, /* debug code */ if (NULL != StaParams) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: TDLS Peer Parameters.", __func__); if(StaParams->htcap_present) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "ht_capa->cap_info: %0x", StaParams->HTCap.capInfo); - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "ht_capa->extended_capabilities: %0x", StaParams->HTCap.extendedHtCapInfo); } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "params->capability: %0x",StaParams->capability); - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "params->ext_capab_len: %0x",StaParams->extn_capability[0]); if(StaParams->vhtcap_present) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "rxMcsMap %x rxHighest %x txMcsMap %x txHighest %x", StaParams->VHTCap.suppMcs.rxMcsMap, StaParams->VHTCap.suppMcs.rxHighest, StaParams->VHTCap.suppMcs.txMcsMap, StaParams->VHTCap.suppMcs.txHighest); @@ -7887,7 +8701,7 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, int i = 0; VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Supported rates:"); for (i = 0; i < sizeof(StaParams->supported_rates); i++) - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "[%d]: %x ", i, StaParams->supported_rates[i]); } } /* end debug code */ @@ -7902,13 +8716,34 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, if (!update) { - status = sme_AddTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter), + /*Before adding sta make sure that device exited from BMPS*/ + if (TRUE == sme_IsPmcBmps(WLAN_HDD_GET_HAL_CTX(pAdapter))) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Adding tdls peer sta. Disable BMPS", __func__); + status = hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set BMPS/IMPS")); + } + } + + ret = sme_AddTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, mac); + if (ret != eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Failed to add TDLS peer STA. Enable Bmps")); + wlan_hdd_tdls_check_bmps(pAdapter); + return -EPERM; + } } else { - status = sme_ChangeTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter), + ret = sme_ChangeTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, mac, StaParams); + if (ret != eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to change TDLS peer STA params")); + return -EPERM; + } } ret = wait_for_completion_interruptible_timeout(&pAdapter->tdls_add_station_comp, @@ -7941,23 +8776,31 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, } #endif -static int wlan_hdd_change_station(struct wiphy *wiphy, +static int __wlan_hdd_change_station(struct wiphy *wiphy, struct net_device *dev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else u8 *mac, +#endif struct station_parameters *params) { VOS_STATUS status = VOS_STATUS_SUCCESS; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); + hdd_adapter_t *pAdapter; hdd_context_t *pHddCtx; hdd_station_ctx_t *pHddStaCtx; v_MACADDR_t STAMacAddress; + int ret = 0; #ifdef FEATURE_WLAN_TDLS tCsrStaParams StaParams = {0}; tANI_U8 isBufSta = 0; tANI_U8 isOffChannelSupported = 0; + tANI_U8 isQosWmmSta = FALSE; #endif + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if ((NULL == pAdapter)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -7969,22 +8812,21 @@ static int wlan_hdd_change_station(struct wiphy *wiphy, TRACE_CODE_HDD_CHANGE_STATION, pAdapter->sessionId, params->listen_interval)); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - if ((NULL == pHddCtx) || (NULL == pHddStaCtx)) + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "invalid HDD state or HDD station context"); - return -EINVAL; + return ret; } - if (pHddCtx->isLogpInProgress) + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + + if (NULL == pHddStaCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EAGAIN; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "invalid HDD station context"); + return -EINVAL; } - vos_mem_copy(STAMacAddress.bytes, mac, sizeof(v_MACADDR_t)); if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) @@ -8035,15 +8877,31 @@ static int wlan_hdd_change_station(struct wiphy *wiphy, } StaParams.supported_channels_len = j; } + if (params->supported_oper_classes_len > + SIR_MAC_MAX_SUPP_OPER_CLASSES) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "received oper classes:%d, resetting it to max supported %d", + params->supported_oper_classes_len, + SIR_MAC_MAX_SUPP_OPER_CLASSES); + params->supported_oper_classes_len = + SIR_MAC_MAX_SUPP_OPER_CLASSES; + } vos_mem_copy(StaParams.supported_oper_classes, params->supported_oper_classes, params->supported_oper_classes_len); StaParams.supported_oper_classes_len = params->supported_oper_classes_len; + if (params->ext_capab_len > sizeof(StaParams.extn_capability)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "received extn capabilities: %d, reset to max supported", + params->ext_capab_len); + params->ext_capab_len = sizeof(StaParams.extn_capability); + } + if (0 != params->ext_capab_len) vos_mem_copy(StaParams.extn_capability, params->ext_capab, - sizeof(StaParams.extn_capability)); + params->ext_capab_len); if (NULL != params->ht_capa) { @@ -8091,9 +8949,22 @@ static int wlan_hdd_change_station(struct wiphy *wiphy, isOffChannelSupported = 1; } } + + if (pHddCtx->cfg_ini->fEnableTDLSWmmMode && + (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME))) { + + /* TDLS Peer is WME/QoS capable */ + isQosWmmSta = TRUE; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS Peer is QOS capable isQosWmmSta= %d HTcapPresent= %d", + __func__, isQosWmmSta, StaParams.htcap_present); + status = wlan_hdd_tdls_set_peer_caps( pAdapter, mac, &StaParams, isBufSta, - isOffChannelSupported); + isOffChannelSupported, + isQosWmmSta); if (VOS_STATUS_SUCCESS != status) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -8114,6 +8985,27 @@ static int wlan_hdd_change_station(struct wiphy *wiphy, return status; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +static int wlan_hdd_change_station(struct wiphy *wiphy, + struct net_device *dev, + const u8 *mac, + struct station_parameters *params) +#else +static int wlan_hdd_change_station(struct wiphy *wiphy, + struct net_device *dev, + u8 *mac, + struct station_parameters *params) +#endif +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_change_station(wiphy, dev, mac, params); + vos_ssr_unprotect(__func__); + + return ret; +} + /* * FUNCTION: __wlan_hdd_cfg80211_add_key * This function is used to initialize the key information @@ -8143,6 +9035,11 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, VOS_STATUS vos_status; eHalStatus halStatus; hdd_context_t *pHddCtx; + uint8_t i; + v_MACADDR_t *peerMacAddr; + u64 rsc_counter = 0; + uint8_t staid = HDD_MAX_STA_COUNT; + bool pairwise_set_key = false; ENTER(); @@ -8151,11 +9048,8 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, pAdapter->sessionId, params->key_len)); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -8179,15 +9073,26 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, return -EINVAL; } + if (CSR_MAX_RSC_LEN < params->seq_len) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Invalid seq length %d", __func__, + params->seq_len); + + return -EINVAL; + } + hddLog(VOS_TRACE_LEVEL_INFO, - "%s: called with key index = %d & key length %d", - __func__, key_index, params->key_len); + "%s: called with key index = %d & key length %d & seq length %d", + __func__, key_index, params->key_len, params->seq_len); + + peerMacAddr = (v_MACADDR_t *)mac_addr; /*extract key idx, key len and key*/ vos_mem_zero(&setKey,sizeof(tCsrRoamSetKey)); setKey.keyId = key_index; setKey.keyLength = params->key_len; vos_mem_copy(&setKey.Key[0],params->key, params->key_len); + vos_mem_copy(&setKey.keyRsc[0], params->seq, params->seq_len); switch (params->cipher) { @@ -8293,6 +9198,7 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, __func__, __LINE__); setKey.keyDirection = eSIR_TX_RX; vos_mem_copy(setKey.peerMac, mac_addr,WNI_CFG_BSSID_LEN); + pairwise_set_key = true; } if ((WLAN_HDD_IBSS == pAdapter->device_mode) && !pairwise) { @@ -8323,6 +9229,9 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); vos_status = wlan_hdd_check_ula_done(pAdapter); + if (peerMacAddr && (pairwise_set_key == true)) + staid = hdd_sta_id_find_from_mac_addr(pAdapter, peerMacAddr); + if ( vos_status != VOS_STATUS_SUCCESS ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -8384,6 +9293,9 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, } } + if (pairwise_set_key == true) + staid = pHddStaCtx->conn_info.staId[0]; + pWextState->roamProfile.Keys.KeyLength[key_index] = (u8)params->key_len; pWextState->roamProfile.Keys.defaultIndex = key_index; @@ -8491,13 +9403,21 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, } } + if (pairwise_set_key == true) { + for (i = 0; i < params->seq_len; i++) { + rsc_counter |= (params->seq[i] << i*8); + } + + WLANTL_SetKeySeqCounter(pVosContext, rsc_counter, staid); + } + end: /* Need to clear any trace of key value in the memory. * Thus zero out the memory even though it is local * variable. */ vos_mem_zero(&setKey, sizeof(setKey)); - + EXIT(); return status; } @@ -8552,11 +9472,30 @@ static int __wlan_hdd_cfg80211_get_key( #endif { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( ndev ); - hdd_wext_state_t *pWextState= WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile); + hdd_wext_state_t *pWextState = NULL; + tCsrRoamProfile *pRoamProfile = NULL; struct key_params params; + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); + + if (NULL == pAdapter) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD adapter is Null", __func__); + return -ENODEV; + } - ENTER(); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + pRoamProfile = &(pWextState->roamProfile); hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %s (%d)", __func__, hdd_device_modetoString(pAdapter->device_mode), @@ -8608,6 +9547,7 @@ static int __wlan_hdd_cfg80211_get_key( params.seq = NULL; params.key = &pRoamProfile->Keys.KeyMaterial[key_index][0]; callback(cookie, ¶ms); + EXIT(); return 0; } @@ -8644,18 +9584,18 @@ static int wlan_hdd_cfg80211_get_key( } /* - * FUNCTION: wlan_hdd_cfg80211_del_key + * FUNCTION: __wlan_hdd_cfg80211_del_key * This function is used to delete the key information */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) -static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool pairwise, const u8 *mac_addr ) #else -static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, struct net_device *ndev, u8 key_index, const u8 *mac_addr @@ -8752,6 +9692,35 @@ static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, return status; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) +static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, + struct net_device *ndev, + u8 key_index, + bool pairwise, + const u8 *mac_addr + ) +#else +static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, + struct net_device *ndev, + u8 key_index, + const u8 *mac_addr + ) +#endif +{ + int ret; + + vos_ssr_protect(__func__); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) + ret = __wlan_hdd_cfg80211_del_key(wiphy, ndev, key_index, pairwise, + mac_addr); +#else + ret = __wlan_hdd_cfg80211_del_key(wiphy, ndev, key_index, mac_addr); +#endif + vos_ssr_unprotect(__func__); + + return ret; +} + /* * FUNCTION: __wlan_hdd_cfg80211_set_default_key * This function is used to set the default tx key index @@ -8809,11 +9778,8 @@ static int __wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -8897,7 +9863,7 @@ static int __wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, pAPCtx->wepKey[key_index].keyDirection = eSIR_TX_DEFAULT; } } - + EXIT(); return status; } @@ -8944,8 +9910,6 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss( int rssi = 0; struct cfg80211_bss *bss = NULL; - ENTER(); - if( NULL == pBssDesc ) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: pBssDesc is NULL", __func__); @@ -8984,7 +9948,11 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss( rssi = (VOS_MIN ((pBssDesc->rssi + pBssDesc->sinr), 0))*100; - return cfg80211_inform_bss(wiphy, chan, pBssDesc->bssId, + return cfg80211_inform_bss(wiphy, chan, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + CFG80211_BSS_FTYPE_UNKNOWN, +#endif + pBssDesc->bssId, le64_to_cpu(*(__le64 *)pBssDesc->timeStamp), pBssDesc->capabilityInfo, pBssDesc->beaconInterval, ie, ie_length, @@ -9035,22 +10003,11 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, struct timespec ts; #endif + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - - /*bss_update is not allowed during wlan driver loading or unloading*/ - if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s:Loading_unloading in Progress. Ignore!!!",__func__); - return NULL; - } - - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return NULL; } @@ -9154,7 +10111,8 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, pAdapter->sessionCtx.station.conn_info.connState ) && ( VOS_TRUE == vos_mem_compare(bss_desc->bssId, pAdapter->sessionCtx.station.conn_info.bssId, - WNI_CFG_BSSID_LEN))) + WNI_CFG_BSSID_LEN)) && + (pHddCtx->hdd_wlan_suspended == FALSE)) { /* supplicant takes the signal strength in terms of mBm(100*dBm) */ rssi = (pAdapter->rssi * 100); @@ -9165,8 +10123,8 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, } hddLog(VOS_TRACE_LEVEL_INFO, "%s: BSSID:" MAC_ADDRESS_STR " Channel:%d" - "RSSI:%d", __func__, MAC_ADDR_ARRAY(mgmt->bssid), - chan->center_freq, (int)(rssi/100)); + " RSSI:%d", __func__, MAC_ADDR_ARRAY(mgmt->bssid), + vos_freq_to_chan(chan->center_freq), (int)(rssi/100)); bss_status = cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, rssi, GFP_KERNEL); @@ -9225,7 +10183,7 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, tScanResultHandle pResult; struct cfg80211_bss *bss_status = NULL; hdd_context_t *pHddCtx; - + bool is_p2p_scan = false; ENTER(); MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -9250,7 +10208,13 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, return VOS_STATUS_E_PERM; } - + if (pAdapter->request != NULL) + { + if ((pAdapter->request->n_ssids == 1) + && (pAdapter->request->ssids != NULL) + && vos_mem_compare(&pAdapter->request->ssids[0], "DIRECT-", 7)) + is_p2p_scan = true; + } /* * start getting scan results and populate cgf80211 BSS database */ @@ -9261,6 +10225,8 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, { hddLog(VOS_TRACE_LEVEL_INFO, "%s: No scan result Status %d", __func__, status); + wlan_hdd_get_frame_logs(pAdapter, + WLAN_HDD_GET_FRAME_LOG_CMD_SEND_AND_CLEAR); return status; } @@ -9278,7 +10244,12 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, * ieee80211_mgmt(probe response) and passing to c * fg80211_inform_bss_frame. * */ - + if(is_p2p_scan && (pScanResult->ssId.ssId != NULL) && + !vos_mem_compare( pScanResult->ssId.ssId, "DIRECT-", 7) ) + { + pScanResult = sme_ScanResultGetNext(hHal, pResult); + continue; //Skip the non p2p bss entries + } bss_status = wlan_hdd_cfg80211_inform_bss_frame(pAdapter, &pScanResult->BssDescriptor); @@ -9301,7 +10272,7 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, } sme_ScanResultPurge(hHal, pResult); - + is_p2p_scan = false; return 0; } @@ -9499,18 +10470,26 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, struct net_device *dev = (struct net_device *) pContext; //struct wireless_dev *wdev = dev->ieee80211_ptr; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hdd_scaninfo_t *pScanInfo = &pHddCtx->scan_info; + hdd_scaninfo_t *pScanInfo; struct cfg80211_scan_request *req = NULL; int ret = 0; bool aborted = false; long waitRet = 0; tANI_U8 i; + hdd_context_t *pHddCtx; ENTER(); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (NULL == pHddCtx) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is Null")); + goto allow_suspend; + } + + pScanInfo = &pHddCtx->scan_info; + hddLog(VOS_TRACE_LEVEL_INFO, - "%s called with halHandle = %p, pContext = %p," + "%s called with halHandle = %pK, pContext = %pK," "scanID = %d, returned status = %d", __func__, halHandle, pContext, (int) scanId, (int) status); @@ -9622,21 +10601,26 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, cfg80211_scan_done(req, aborted); complete(&pScanInfo->abortscan_event_var); + if ((pHddCtx->cfg_ini->enableMacSpoofing == MAC_ADDR_SPOOFING_FW_HOST_ENABLE + ) && (pHddCtx->spoofMacAddr.isEnabled + || pHddCtx->spoofMacAddr.isReqDeferred)) { + /* Generate new random mac addr for next scan */ + hddLog(VOS_TRACE_LEVEL_INFO, "scan completed - generate new spoof mac addr"); + hdd_processSpoofMacAddrRequest(pHddCtx); + } + allow_suspend: /* release the wake lock at the end of the scan*/ - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); /* Acquire wakelock to handle the case where APP's tries to suspend * immediatly after the driver gets connect request(i.e after scan) * from supplicant, this result in app's is suspending and not able * to process the connect request to AP */ - hdd_prevent_suspend_timeout(1000); + hdd_prevent_suspend_timeout(1000, WIFI_POWER_EVENT_WAKELOCK_SCAN); #ifdef FEATURE_WLAN_TDLS - if (!(eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode)) - { - wlan_hdd_tdls_scan_done_callback(pAdapter); - } + wlan_hdd_tdls_scan_done_callback(pAdapter); #endif EXIT(); @@ -9648,7 +10632,7 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, * Go through each adapter and check if Connection is in progress * */ -v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx, v_BOOL_t isRoC ) +v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; hdd_station_ctx_t *pHddStaCtx = NULL; @@ -9676,18 +10660,26 @@ v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx, v_BOOL_t isRoC ) "%s: Adapter with device mode %s (%d) exists", __func__, hdd_device_modetoString(pAdapter->device_mode), pAdapter->device_mode); - if ((((!isRoC) && (WLAN_HDD_INFRA_STATION == pAdapter->device_mode)) || + if (((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) || (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)) && (eConnectionState_Connecting == (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: %p(%d) Connection is in progress", __func__, + "%s: %pK(%d) Connection is in progress", __func__, + WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pAdapter->sessionId); + return VOS_TRUE; + } + if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) && + smeNeighborMiddleOfRoaming(WLAN_HDD_GET_HAL_CTX(pAdapter))) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: %pK(%d) Reassociation is in progress", __func__, WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pAdapter->sessionId); return VOS_TRUE; } - if (((!isRoC) && (WLAN_HDD_INFRA_STATION == pAdapter->device_mode)) || + if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) || (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)) { @@ -9758,6 +10750,10 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, hdd_scaninfo_t *pScanInfo = NULL; v_U8_t* pP2pIe = NULL; int ret = 0; + v_U8_t *pWpsIe=NULL; + bool is_p2p_scan = false; + v_S7_t rssi=0; + hdd_station_ctx_t *pHddStaCtx=NULL; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) struct net_device *dev = NULL; @@ -9776,17 +10772,13 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, ENTER(); - hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %s (%d)", __func__, hdd_device_modetoString(pAdapter->device_mode), pAdapter->device_mode); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -9799,6 +10791,13 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, cfg_param = pHddCtx->cfg_ini; pScanInfo = &pHddCtx->scan_info; + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if ( (pHddStaCtx != NULL) && (TRUE == hdd_connIsConnected(pHddStaCtx))) + { + wlan_hdd_get_roam_rssi(pAdapter, &rssi); + hddLog(VOS_TRACE_LEVEL_INFO, FL("rssi: %d"), rssi); + } + #ifdef WLAN_BTAMP_FEATURE //Scan not supported when AMP traffic is on. if (VOS_TRUE == WLANBAP_AmpSessionOn()) @@ -9827,6 +10826,14 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, return -EBUSY; } + // Don't allow scan if PNO scan is going on. + if (pHddCtx->isPnoEnable) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("pno scan in progress")); + return -EBUSY; + } + //Don't Allow Scan and return busy if Remain On //Channel and action frame is pending //Otherwise Cancel Remain On Channel and allow Scan @@ -9836,29 +10843,6 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Remain On Channel Pending", __func__); return -EBUSY; } -#ifdef FEATURE_WLAN_TDLS - /* if tdls disagree scan right now, return immediately. - tdls will schedule the scan when scan is allowed. (return SUCCESS) - or will reject the scan if any TDLS is in progress. (return -EBUSY) - */ - status = wlan_hdd_tdls_scan_callback (pAdapter, - wiphy, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) - dev, -#endif - request); - if(status <= 0) - { - if(!status) - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: TDLS in progress." - "scan rejected %d", __func__, status); - else - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: TDLS teardown is ongoing %d", - __func__, status); - - return status; - } -#endif if (mutex_lock_interruptible(&pHddCtx->tmInfo.tmOperationLock)) { @@ -9877,7 +10861,7 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, /* Check if scan is allowed at this point of time. */ - if (hdd_isConnectionInProgress(pHddCtx, VOS_FALSE)) + if (hdd_isConnectionInProgress(pHddCtx)) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Scan not allowed", __func__); return -EBUSY; @@ -9885,10 +10869,6 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, vos_mem_zero( &scanRequest, sizeof(scanRequest)); - hddLog(VOS_TRACE_LEVEL_INFO, "scan request for ssid = %d", - (int)request->n_ssids); - - /* Even though supplicant doesn't provide any SSIDs, n_ssids is set to 1. * Becasue of this, driver is assuming that this is not wildcard scan and so * is not aging out the scan results. @@ -9997,32 +10977,41 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, * This rule is not applicable if scan is p2p scan. * This condition will work only in case when last request no of channels * and channels are exactly same as new request. + * This should be done only in connected state + * Scan shouldn't be defered for WPS scan case. */ - if (pScanInfo->last_scan_timestamp !=0 && - (FALSE == request->no_cck) && // no_cck is set during p2p find. - ((vos_timer_get_system_time() - pScanInfo->last_scan_timestamp ) < pHddCtx->cfg_ini->nDeferScanTimeInterval)) + + pWpsIe = wlan_hdd_get_wps_ie_ptr((v_U8_t*)request->ie,request->ie_len); + /* if wps ie is NULL , then only defer scan */ + if ( pWpsIe == NULL && + (VOS_STATUS_SUCCESS == hdd_is_any_session_connected(pHddCtx))) { - if (pScanInfo->last_scan_numChannels == scanRequest.ChannelInfo.numOfChannels && - vos_mem_compare(pScanInfo->last_scan_channelList, - channelList, pScanInfo->last_scan_numChannels)) - { - hddLog(VOS_TRACE_LEVEL_WARN, - " New and old station scan time differ is less then %u", - pHddCtx->cfg_ini->nDeferScanTimeInterval); + if ( pScanInfo->last_scan_timestamp !=0 && + ((vos_timer_get_system_time() - pScanInfo->last_scan_timestamp ) < pHddCtx->cfg_ini->nDeferScanTimeInterval)) + { + if ( request->no_cck == FALSE && scanRequest.ChannelInfo.numOfChannels != 1 && + (pScanInfo->last_scan_numChannels == scanRequest.ChannelInfo.numOfChannels) && + vos_mem_compare(pScanInfo->last_scan_channelList, + channelList, pScanInfo->last_scan_numChannels)) + { + hddLog(VOS_TRACE_LEVEL_WARN, + " New and old station scan time differ is less then %u", + pHddCtx->cfg_ini->nDeferScanTimeInterval); - ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy, + ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy, pAdapter); - hddLog(VOS_TRACE_LEVEL_WARN, - "Return old cached scan as all channels and no of channels are same"); + hddLog(VOS_TRACE_LEVEL_WARN, + "Return old cached scan as all channels and no of channels are same"); - if (0 > ret) - hddLog(VOS_TRACE_LEVEL_INFO, "%s: NO SCAN result", __func__); + if (0 > ret) + hddLog(VOS_TRACE_LEVEL_INFO, "%s: NO SCAN result", __func__); - cfg80211_scan_done(request, eCSR_SCAN_SUCCESS); + cfg80211_scan_done(request, eCSR_SCAN_SUCCESS); - status = eHAL_STATUS_SUCCESS; - goto free_mem; + status = eHAL_STATUS_SUCCESS; + goto free_mem; + } } } @@ -10037,8 +11026,13 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, * the AP doesnt respond to our probe req then association * fails which is not desired */ + if ((request->n_ssids == 1) + && (request->ssids != NULL) + && vos_mem_compare(&request->ssids[0], "DIRECT-", 7)) + is_p2p_scan = true; - if( request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN ) + if( is_p2p_scan || + (request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN) ) { hddLog(VOS_TRACE_LEVEL_DEBUG, "Flushing P2P Results"); sme_ScanFlushP2PResult( WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -10060,7 +11054,7 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) || (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)) { - if ( request->ie_len <= SIR_MAC_MAX_IE_LENGTH) + if (request->ie_len <= SIR_MAC_MAX_ADD_IE_LENGTH) { pwextBuf->roamProfile.nAddIEScanLength = request->ie_len; memcpy( pwextBuf->roamProfile.addIEScan, @@ -10134,6 +11128,29 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, INIT_COMPLETION(pScanInfo->scan_req_completion_event); +#ifdef FEATURE_WLAN_TDLS + /* if tdls disagree scan right now, return immediately. + tdls will schedule the scan when scan is allowed. (return SUCCESS) + or will reject the scan if any TDLS is in progress. (return -EBUSY) + */ + status = wlan_hdd_tdls_scan_callback (pAdapter, + wiphy, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) + dev, +#endif + request); + if(status <= 0) + { + if(!status) + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: TDLS in progress." + "scan rejected %d", __func__, status); + else + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: TDLS teardown is ongoing %d", + __func__, status); + goto free_mem; + } +#endif + /* acquire the wakelock to avoid the apps suspend during the scan. To * address the following issues. * 1) Disconnected scenario: we are not allowing the suspend as WLAN is not in @@ -10142,7 +11159,7 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, * 2) Connected scenario: If we allow the suspend during the scan, RIVA will * be stuck in full power because of resume BMPS */ - hdd_prevent_suspend(); + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "requestType %d, scanType %d, minChnTime %d, maxChnTime %d," @@ -10151,6 +11168,28 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, scanRequest.minChnTime, scanRequest.maxChnTime, scanRequest.p2pSearch, scanRequest.skipDfsChnlInP2pSearch); + if (pHddCtx->spoofMacAddr.isEnabled && + pHddCtx->cfg_ini->enableMacSpoofing == 1) + { + hddLog(VOS_TRACE_LEVEL_INFO, + "%s: MAC Spoofing enabled for current scan", __func__); + /* Updating SelfSta Mac Addr in TL which will be used to get staidx + * to fill TxBds for probe request during current scan + */ + status = WLANTL_updateSpoofMacAddr(pHddCtx->pvosContext, + &pHddCtx->spoofMacAddr.randomMacAddr, &pAdapter->macAddressCurrent); + + if(status != VOS_STATUS_SUCCESS) + { + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); + status = -EFAULT; +#ifdef FEATURE_WLAN_TDLS + wlan_hdd_tdls_scan_done_callback(pAdapter); +#endif + goto free_mem; + } + } + wlan_hdd_get_frame_logs(pAdapter, WLAN_HDD_GET_FRAME_LOG_CMD_CLEAR); status = sme_ScanRequest( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &scanRequest, &scanId, &hdd_cfg80211_scan_done_callback, dev ); @@ -10168,7 +11207,11 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, } else { status = -EIO; } - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); + +#ifdef FEATURE_WLAN_TDLS + wlan_hdd_tdls_scan_done_callback(pAdapter); +#endif goto free_mem; } @@ -10189,7 +11232,6 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, vos_mem_free( channelList ); EXIT(); - return status; } @@ -10243,10 +11285,15 @@ void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel) hddDot11Mode = iniDot11Mode; break; } - /* This call decides required channel bonding mode */ - sme_SelectCBMode((WLAN_HDD_GET_CTX(pAdapter)->hHal), +#ifdef WLAN_FEATURE_AP_HT40_24G + if (operationChannel > SIR_11B_CHANNEL_END) +#endif + { + /* This call decides required channel bonding mode */ + sme_SelectCBMode((WLAN_HDD_GET_CTX(pAdapter)->hHal), hdd_cfg_xlate_to_csr_phy_mode(hddDot11Mode), operationChannel); + } } /* @@ -10254,7 +11301,8 @@ void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel) * This function is used to start the association process */ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, - const u8 *ssid, size_t ssid_len, const u8 *bssid, u8 operatingChannel) + const u8 *ssid, size_t ssid_len, const u8 *bssid, + const u8 *bssid_hint, u8 operatingChannel) { int status = 0; hdd_wext_state_t *pWextState; @@ -10262,6 +11310,7 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, v_U32_t roamId; tCsrRoamProfile *pRoamProfile; eCsrAuthType RSNAuthType; + const u8 *pValidBssid = NULL; ENTER(); @@ -10271,8 +11320,6 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, status = wlan_hdd_validate_context(pHddCtx); if (status) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid!", __func__); return status; } @@ -10289,6 +11336,8 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, hdd_station_ctx_t *pHddStaCtx; pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + wlan_hdd_get_frame_logs(pAdapter, WLAN_HDD_GET_FRAME_LOG_CMD_CLEAR); + if (HDD_WMM_USER_MODE_NO_QOS == (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->WmmMode) { @@ -10310,15 +11359,23 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, ssid, ssid_len); if (bssid) + { + pValidBssid = bssid; + } + else if (bssid_hint) + { + pValidBssid = bssid_hint; + } + if (pValidBssid) { pRoamProfile->BSSIDs.numOfBSSIDs = 1; - vos_mem_copy((void *)(pRoamProfile->BSSIDs.bssid), bssid, + vos_mem_copy((void *)(pRoamProfile->BSSIDs.bssid), pValidBssid, WNI_CFG_BSSID_LEN); /* Save BSSID in seperate variable as well, as RoamProfile BSSID is getting zeroed out in the association process. And in case of join failure we should send valid BSSID to supplicant */ - vos_mem_copy((void *)(pWextState->req_bssId), bssid, + vos_mem_copy((void *)(pWextState->req_bssId), pValidBssid, WNI_CFG_BSSID_LEN); } else @@ -10396,18 +11453,29 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, hdd_select_cbmode(pAdapter,operatingChannel); } - /* change conn_state to connecting before sme_RoamConnect(), because sme_RoamConnect() - * has a direct path to call hdd_smeRoamCallback(), which will change the conn_state - * If direct path, conn_state will be accordingly changed to NotConnected or Associated - * by either hdd_AssociationCompletionHandler() or hdd_DisConnectHandler() in sme_RoamCallback() - * if sme_RomConnect is to be queued, Connecting state will remain until it is completed. - */ + /* + * Change conn_state to connecting before sme_RoamConnect(), + * because sme_RoamConnect() has a direct path to call + * hdd_smeRoamCallback(), which will change the conn_state + * If direct path, conn_state will be accordingly changed + * to NotConnected or Associated by either + * hdd_AssociationCompletionHandler() or hdd_DisConnectHandler() + * in sme_RoamCallback() + * if sme_RomConnect is to be queued, + * Connecting state will remain until it is completed. + * If connection state is not changed, + * connection state will remain in eConnectionState_NotConnected state. + * In hdd_AssociationCompletionHandler, "hddDisconInProgress" is set to true + * if conn state is eConnectionState_NotConnected. + * If "hddDisconInProgress" is set to true then cfg80211 layer is not + * informed of connect result indication which is an issue. + */ + if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode || WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_Connecting", - __func__); + FL("Set HDD connState to eConnectionState_Connecting")); hdd_connSetConnectionState(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), eConnectionState_Connecting); } @@ -10419,8 +11487,9 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter, WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: sme_RoamConnect (session %d) failed with " - "status %d. -> NotConnected", __func__, pAdapter->sessionId, status); + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sme_RoamConnect (session %d) failed with status %d. -> NotConnected"), + pAdapter->sessionId, status); /* change back to NotAssociated */ hdd_connSetConnectionState(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), eConnectionState_NotConnected); @@ -10578,7 +11647,7 @@ static int wlan_hdd_cfg80211_set_cipher( hdd_adapter_t *pAdapter, if (!cipher) { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: received cipher %d - considering none", + hddLog(VOS_TRACE_LEVEL_INFO, "%s: received cipher %d - considering none", __func__, cipher); encryptionType = eCSR_ENCRYPT_TYPE_NONE; } @@ -10652,12 +11721,20 @@ static int wlan_hdd_cfg80211_set_cipher( hdd_adapter_t *pAdapter, * This function is used to parse WPA/RSN IE's. */ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *ie, +#else u8 *ie, +#endif size_t ie_len ) { hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *genie = ie; +#else u8 *genie = ie; +#endif v_U16_t remLen = ie_len; #ifdef FEATURE_WLAN_WAPI v_U32_t akmsuite[MAX_NUM_AKM_SUITES]; @@ -10680,6 +11757,14 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, eLen = *genie++; remLen -= 2; + /* Sanity check on eLen */ + if (eLen > remLen) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Invalid IE length[%d] for IE[0x%X]", + __func__, eLen, elementId); + VOS_ASSERT(0); + return -EINVAL; + } + hddLog(VOS_TRACE_LEVEL_INFO, "%s: IE[0x%X], LEN[%d]", __func__, elementId, eLen); @@ -10698,7 +11783,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, hddLog (VOS_TRACE_LEVEL_INFO, "%s Set WPS IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE. " "Need bigger buffer space"); @@ -10715,6 +11800,13 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, } else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) { + if (eLen > (MAX_WPA_RSN_IE_LEN - 2)) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Invalid WPA RSN IE length[%d]", + __func__, eLen); + VOS_ASSERT(0); + return -EINVAL; + } + hddLog (VOS_TRACE_LEVEL_INFO, "%s Set WPA IE (len %d)",__func__, eLen + 2); memset( pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN ); memcpy( pWextState->WPARSNIE, genie - 2, (eLen + 2) /*ie_len*/); @@ -10728,7 +11820,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, hddLog (VOS_TRACE_LEVEL_INFO, "%s Set P2P IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE " "Need bigger buffer space"); @@ -10752,7 +11844,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, hddLog (VOS_TRACE_LEVEL_INFO, "%s Set WFD IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE " "Need bigger buffer space"); @@ -10776,7 +11868,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, hddLog (VOS_TRACE_LEVEL_INFO, "%s Set HS20 IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE " "Need bigger buffer space"); @@ -10797,7 +11889,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, hddLog (VOS_TRACE_LEVEL_INFO, "%s Set OSEN IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE " "Need bigger buffer space"); @@ -10812,12 +11904,13 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, pWextState->roamProfile.nAddIEAssocLength = pWextState->assocAddIE.length; } - break; - if (WLAN_HDD_IBSS == pAdapter->device_mode) { + /* Update only for WPA IE */ + if (!memcmp(genie, WPA_OUI_TYPE, WPA_OUI_TYPE_SIZE) && + (WLAN_HDD_IBSS == pAdapter->device_mode)) { /* populating as ADDIE in beacon frames */ if (ccmCfgSetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), - WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA, genie - 2, eLen + 2, + WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA, (u8 *)genie - 2, eLen + 2, NULL, eANI_BOOLEAN_FALSE)== eHAL_STATUS_SUCCESS) { if (ccmCfgSetInt(WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -10920,32 +12013,40 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, "on WNI_CFG_PROBE_RSP_ADDNIE_FLAG to CCM"); } } - else - { - // Reset WNI_CFG_PROBE_RSP Flags - wlan_hdd_reset_prob_rspies(pAdapter); - - hddLog(VOS_TRACE_LEVEL_INFO, - "%s: No Probe Response IE received in set beacon", - __func__); - } } /* end of if (WLAN_HDD_IBSS == pAdapter->device_mode) */ break; case DOT11F_EID_RSN: + if (eLen > (MAX_WPA_RSN_IE_LEN - 2)) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Invalid WPA RSN IE length[%d], exceeds %d bytes", + __func__, eLen, MAX_WPA_RSN_IE_LEN - 2); + VOS_ASSERT(0); + return -EINVAL; + } hddLog (VOS_TRACE_LEVEL_INFO, "%s Set RSN IE(len %d)",__func__, eLen + 2); memset( pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN ); memcpy( pWextState->WPARSNIE, genie - 2, (eLen + 2)/*ie_len*/); pWextState->roamProfile.pRSNReqIE = pWextState->WPARSNIE; pWextState->roamProfile.nRSNReqIELength = eLen + 2; //ie_len; break; - /* Appending Extended Capabilities with Interworking bit set in Assoc Req */ + + /* Appending extended capabilities with Interworking or + * bsstransition bit set in Assoc Req. + * + * In assoc req this EXT Cap will only be taken into account if + * interworkingService or bsstransition bit is set to 1. + * Driver is only interested in interworkingService and + * bsstransition capability from supplicant. + * If in future any other EXT Cap info is + * required from supplicat, it needs to be handled while + * sending Assoc Req in LIM. + */ case DOT11F_EID_EXTCAP: { v_U16_t curAddIELen = pWextState->assocAddIE.length; hddLog (VOS_TRACE_LEVEL_INFO, "%s Set Extended CAPS IE(len %d)", __func__, eLen + 2); - if( SIR_MAC_MAX_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) + if( SIR_MAC_MAX_ADD_IE_LENGTH < (pWextState->assocAddIE.length + eLen) ) { hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate assocAddIE " "Need bigger buffer space"); @@ -11014,7 +12115,13 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, * Parse the received IE to find the WPA IE * */ -static bool hdd_isWPAIEPresent(u8 *ie, u8 ie_len) +static bool hdd_isWPAIEPresent( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + const u8 *ie, +#else + u8 *ie, +#endif + u8 ie_len) { v_U8_t eLen = 0; v_U16_t remLen = ie_len; @@ -11050,9 +12157,9 @@ static bool hdd_isWPAIEPresent(u8 *ie, u8 ie_len) * This function is used to initialize the security * parameters during connect operation. */ -int wlan_hdd_cfg80211_set_privacy( hdd_adapter_t *pAdapter, +int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter, struct cfg80211_connect_params *req - ) + ) { int status = 0; hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); @@ -11273,18 +12380,11 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, } status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } - if (vos_max_concurrent_connections_reached()) { - hddLog(VOS_TRACE_LEVEL_INFO, FL("Reached max concurrent connections")); - return -ECONNREFUSED; - } #ifdef WLAN_BTAMP_FEATURE //Infra connect not supported when AMP traffic is on. @@ -11312,6 +12412,11 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, " connection")); return -EALREADY; } + /* Check for max concurrent connections after doing disconnect if any*/ + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Reached max concurrent connections")); + return -ECONNREFUSED; + } /*initialise security parameters*/ status = wlan_hdd_cfg80211_set_privacy(pAdapter, req); @@ -11322,19 +12427,36 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, __func__); return status; } + + if (pHddCtx->spoofMacAddr.isEnabled) + { + hddLog(VOS_TRACE_LEVEL_INFO, + "%s: MAC Spoofing enabled ", __func__); + /* Updating SelfSta Mac Addr in TL which will be used to get staidx + * to fill TxBds for probe request during SSID scan which may happen + * as part of connect command + */ + status = WLANTL_updateSpoofMacAddr(pHddCtx->pvosContext, + &pHddCtx->spoofMacAddr.randomMacAddr, &pAdapter->macAddressCurrent); + if (status != VOS_STATUS_SUCCESS) + return -ECONNREFUSED; + } + if ( req->channel ) { status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, req->ssid_len, req->bssid, + req->bssid_hint, req->channel->hw_value); } else { status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, - req->ssid_len, req->bssid, 0); + req->ssid_len, req->bssid, + req->bssid_hint, 0); } - if (0 > status) + if (0 != status) { //ReEnable BMPS if disabled if((VOS_STATUS_SUCCESS == exitbmpsStatus) && @@ -11378,15 +12500,18 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); long ret; - status = wlan_hdd_validate_context(pHddCtx); + ENTER(); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } - + /* Indicate sme of disconnect so that in progress connection or preauth + * can be aborted + */ + sme_abortConnection(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId); pHddCtx->isAmpAllowed = VOS_TRUE; /* Need to apply spin lock before decreasing active sessions @@ -11413,6 +12538,7 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) * the tx frames after BSS/STA has been deleted and will not send * back a response resulting in WDI timeout */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); @@ -11454,6 +12580,7 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) FL("Set HDD connState to eConnectionState_NotConnected")); pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; + EXIT(); return result; } @@ -11468,36 +12595,46 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, ) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); - tCsrRoamProfile *pRoamProfile = - &(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->roamProfile; int status; - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + tCsrRoamProfile *pRoamProfile; + hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; #ifdef FEATURE_WLAN_TDLS tANI_U8 staIdx; #endif ENTER(); - MTRACE(vos_trace(VOS_MODULE_ID_HDD, - TRACE_CODE_HDD_CFG80211_DISCONNECT, - pAdapter->sessionId, reason)); - hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %s(%d)", - __func__, hdd_device_modetoString(pAdapter->device_mode), - pAdapter->device_mode); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return -EINVAL; + } - hddLog(VOS_TRACE_LEVEL_INFO, "%s: Disconnect called with reason code %d", - __func__, reason); + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (!pHddStaCtx) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD STA context is NULL")); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } + pRoamProfile = &(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->roamProfile; + + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_DISCONNECT, + pAdapter->sessionId, reason)); + hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %s(%d)", + __func__, hdd_device_modetoString(pAdapter->device_mode), + pAdapter->device_mode); + + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Disconnect called with reason code %d", + __func__, reason); + if (NULL != pRoamProfile) { /*issue disconnect request to SME, if station is in connected state*/ @@ -11537,7 +12674,7 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId, eCSR_SCAN_ABORT_DEFAULT); } - + wlan_hdd_cancel_existing_remain_on_channel(pAdapter); #ifdef FEATURE_WLAN_TDLS /* First clean up the tdls peers if any */ for (staIdx = 0 ; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) @@ -11547,13 +12684,18 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, { uint8 *mac; mac = pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes; - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: call sme_DeleteTdlsPeerSta staId %d sessionId %d " MAC_ADDRESS_STR, __func__, pHddCtx->tdlsConnInfo[staIdx].staId, pAdapter->sessionId, MAC_ADDR_ARRAY(mac)); - sme_DeleteTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, - mac); + status = sme_DeleteTdlsPeerSta( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + mac); + if (status != eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to delete TDLS peer STA")); + return -EPERM; + } } } #endif @@ -11579,6 +12721,7 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_ERROR, "%s: No valid roam profile", __func__); } + EXIT(); return status; } @@ -11606,6 +12749,7 @@ static int wlan_hdd_cfg80211_set_privacy_ibss( ) { int status = 0; + tANI_U32 ret; hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -11635,12 +12779,26 @@ static int wlan_hdd_cfg80211_set_privacy_ibss( if ( NULL != ie ) { pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA; + if (ie[1] < DOT11F_IE_WPA_MIN_LEN || + ie[1] > DOT11F_IE_WPA_MAX_LEN) { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: invalid ie len:%d", + __func__, ie[1]); + return -EINVAL; + } // Unpack the WPA IE //Skip past the EID byte and length byte - and four byte WiFi OUI - dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, + ret = dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, &ie[2+4], ie[1] - 4, &dot11WPAIE); + if (DOT11F_FAILED(ret)) + { + hddLog(LOGE, + FL("unpack failed status:(0x%08x)"), + ret); + return -EINVAL; + } + /*Extract the multicast cipher, the encType for unicast cipher for wpa-none is none*/ encryptionType = @@ -11695,9 +12853,9 @@ static int __wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); tCsrRoamProfile *pRoamProfile; int status; - bool alloc_bssid = VOS_FALSE; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + tSirMacAddr bssid; ENTER(); @@ -11710,11 +12868,8 @@ static int __wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, pAdapter->device_mode); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -11756,6 +12911,7 @@ static int __wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, "%s:ccmCfgStInt faild for WNI_CFG_IBSS_AUTO_BSSID", __func__); return -EIO; } + vos_mem_copy((v_U8_t *)bssid, (v_U8_t *)params->bssid, sizeof(bssid)); } else if(pHddCtx->cfg_ini->isCoalesingInIBSSAllowed == 0) { @@ -11766,17 +12922,10 @@ static int __wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, "%s:ccmCfgStInt faild for WNI_CFG_IBSS_AUTO_BSSID", __func__); return -EIO; } - params->bssid = vos_mem_malloc(sizeof(VOS_MAC_ADDR_SIZE)); - if (!params->bssid) - { - hddLog (VOS_TRACE_LEVEL_ERROR, - "%s:Failed memory allocation", __func__); - return -EIO; - } - vos_mem_copy((v_U8_t *)params->bssid, + + vos_mem_copy((v_U8_t *)bssid, (v_U8_t *)&pHddCtx->cfg_ini->IbssBssid.bytes[0], - VOS_MAC_ADDR_SIZE); - alloc_bssid = VOS_TRUE; + sizeof(bssid)); } /* Set Channel */ @@ -11843,22 +12992,14 @@ static int __wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, /* Issue connect start */ status = wlan_hdd_cfg80211_connect_start(pAdapter, params->ssid, - params->ssid_len, params->bssid, + params->ssid_len, (const u8 *)&bssid, NULL, pHddStaCtx->conn_info.operationChannel); if (0 > status) - { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: connect failed", __func__); - return status; - } - if (NULL != params->bssid && - pHddCtx->cfg_ini->isCoalesingInIBSSAllowed == 0 && - alloc_bssid == VOS_TRUE) - { - vos_mem_free(params->bssid); - } - return 0; + EXIT(); + return status; } static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, @@ -11895,11 +13036,8 @@ static int __wlan_hdd_cfg80211_leave_ibss( struct wiphy *wiphy, TRACE_CODE_HDD_CFG80211_LEAVE_IBSS, pAdapter->sessionId, eCSR_DISCONNECT_REASON_IBSS_LEAVE)); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -11928,6 +13066,7 @@ static int __wlan_hdd_cfg80211_leave_ibss( struct wiphy *wiphy, sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_IBSS_LEAVE); + EXIT(); return 0; } @@ -11957,15 +13096,14 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, int status; ENTER(); - MTRACE(vos_trace(VOS_MODULE_ID_HDD, + + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_WIPHY_PARAMS, NO_SESSION, wiphy->rts_threshold)); - status = wlan_hdd_validate_context(pHddCtx); + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -12072,6 +13210,7 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, } } + EXIT(); return 0; } @@ -12109,15 +13248,13 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, int status; ENTER(); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_TXPOWER, NO_SESSION, type )); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -12158,6 +13295,7 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, return -EIO; } + EXIT(); return 0; } @@ -12190,10 +13328,10 @@ static int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, } /* - * FUNCTION: wlan_hdd_cfg80211_get_txpower + * FUNCTION: __wlan_hdd_cfg80211_get_txpower * This function is used to read the txpower */ -static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) struct wireless_dev *wdev, #endif @@ -12207,11 +13345,8 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, ENTER(); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); *dbm = 0; return status; } @@ -12223,6 +13358,9 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, return -ENOENT; } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_GET_TXPOWER, + pAdapter->sessionId, pAdapter->device_mode)); wlan_hdd_get_classAstats(pAdapter); *dbm = pAdapter->hdd_stats.ClassA_stat.max_pwr; @@ -12230,8 +13368,32 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, return 0; } +static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + struct wireless_dev *wdev, +#endif + int *dbm) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_txpower(wiphy, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + wdev, +#endif + dbm); + vos_ssr_unprotect(__func__); + + return ret; +} + static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, - u8* mac, struct station_info *sinfo) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8* mac, +#else + u8* mac, +#endif + struct station_info *sinfo) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -12281,21 +13443,17 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_devic } status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } + wlan_hdd_get_station_stats(pAdapter); + rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags; wlan_hdd_get_rssi(pAdapter, &sinfo->signal); sinfo->filled |= STATION_INFO_SIGNAL; - wlan_hdd_get_station_stats(pAdapter); - rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags; - /*overwrite rate_flags if MAX link-speed need to be reported*/ if ((eHDD_LINK_SPEED_REPORT_MAX == pCfg->reportMaxLinkSpeed) || (eHDD_LINK_SPEED_REPORT_MAX_SCALED == pCfg->reportMaxLinkSpeed && @@ -12525,16 +13683,16 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_devic if (supported_mcs_rate[j].beacon_rate_index == MCSRates[i]) { currentRate = supported_mcs_rate[j].supported_rate[rateFlag]; + maxMCSIdx = supported_mcs_rate[j].beacon_rate_index; break; } } if ((j < temp) && (currentRate > maxRate)) { maxRate = currentRate; - maxSpeedMCS = 1; - maxMCSIdx = supported_mcs_rate[j].beacon_rate_index; } } + maxSpeedMCS = 1; } } @@ -12685,9 +13843,13 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_devic EXIT(); return 0; } - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, + const u8* mac, struct station_info *sinfo) +#else static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, u8* mac, struct station_info *sinfo) +#endif { int ret; @@ -12720,11 +13882,8 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -12752,13 +13911,13 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, **/ vos_status = wlan_hdd_enter_bmps(pAdapter, !mode); - EXIT(); if (VOS_STATUS_E_FAILURE == vos_status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to enter bmps mode", __func__); return -EINVAL; } + EXIT(); return 0; } @@ -12774,17 +13933,28 @@ static int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, return ret; } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) -static int wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy, - struct net_device *netdev, - u8 key_index) +static int __wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy, + struct net_device *netdev, + u8 key_index) { ENTER(); return 0; } + +static int wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy, + struct net_device *netdev, + u8 key_index) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_set_default_mgmt_key(wiphy, netdev, key_index); + vos_ssr_unprotect(__func__); + return ret; +} #endif //LINUX_VERSION_CODE #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -static int wlan_hdd_set_txq_params(struct wiphy *wiphy, +static int __wlan_hdd_set_txq_params(struct wiphy *wiphy, struct net_device *dev, struct ieee80211_txq_params *params) { @@ -12792,7 +13962,7 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy, return 0; } #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) -static int wlan_hdd_set_txq_params(struct wiphy *wiphy, +static int __wlan_hdd_set_txq_params(struct wiphy *wiphy, struct ieee80211_txq_params *params) { ENTER(); @@ -12800,6 +13970,31 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy, } #endif //LINUX_VERSION_CODE +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +static int wlan_hdd_set_txq_params(struct wiphy *wiphy, + struct net_device *dev, + struct ieee80211_txq_params *params) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_set_txq_params(wiphy, dev, params); + vos_ssr_unprotect(__func__); + return ret; +} +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) +static int wlan_hdd_set_txq_params(struct wiphy *wiphy, + struct ieee80211_txq_params *params) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_set_txq_params(wiphy, params); + vos_ssr_unprotect(__func__); + return ret; +} +#endif + static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, struct tagCsrDelStaParams *pDelStaParams) @@ -12811,6 +14006,7 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, v_U8_t staId; v_CONTEXT_t pVosContext = NULL; ptSapContext pSapCtx = NULL; + ENTER(); if ( NULL == pAdapter ) @@ -12825,11 +14021,8 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -12923,9 +14116,14 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, struct station_del_parameters *param) #else +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, + struct net_device *dev, const u8 *mac) +#else static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, u8 *mac) #endif +#endif { int ret; struct tagCsrDelStaParams delStaParams; @@ -12935,6 +14133,7 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, #ifdef CFG80211_DEL_STA_V2 if (NULL == param) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Invalid argumet passed", __func__); + vos_ssr_unprotect(__func__); return -EINVAL; } @@ -12942,7 +14141,7 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, param->subtype, &delStaParams); #else - WLANSAP_PopulateDelStaParams(mac, eCsrForcedDeauthSta, + WLANSAP_PopulateDelStaParams(mac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, (SIR_MAC_MGMT_DEAUTH >> 4), &delStaParams); #endif ret = __wlan_hdd_cfg80211_del_station(wiphy, dev, &delStaParams); @@ -12953,14 +14152,36 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, } static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, - struct net_device *dev, u8 *mac, struct station_parameters *params) + struct net_device *dev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + struct station_parameters *params) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int status = -EPERM; #ifdef FEATURE_WLAN_TDLS u32 mask, set; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + return status; + } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_ADD_STA, pAdapter->sessionId, params->listen_interval)); @@ -12968,11 +14189,9 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, set = params->sta_flags_set; -#ifdef WLAN_FEATURE_TDLS_DEBUG - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: mask 0x%x set 0x%x " MAC_ADDRESS_STR, __func__, mask, set, MAC_ADDR_ARRAY(mac)); -#endif if (mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) { if (set & BIT(NL80211_STA_FLAG_TDLS_PEER)) { @@ -12980,11 +14199,18 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, } } #endif + EXIT(); return status; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, + struct net_device *dev, const u8 *mac, + struct station_parameters *params) +#else static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev, u8 *mac, struct station_parameters *params) +#endif { int ret; @@ -13006,6 +14232,8 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device hdd_context_t *pHddCtx; tPmkidCacheInfo pmk_id; + ENTER(); + // Validate pAdapter if ( NULL == pAdapter ) { @@ -13019,7 +14247,7 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device } if (!pmksa->bssid || !pmksa->pmkid) { - hddLog(LOGE, FL("pmksa->bssid(%p) or pmksa->pmkid(%p) is NULL"), + hddLog(LOGE, FL("pmksa->bssid(%pK) or pmksa->pmkid(%pK) is NULL"), pmksa->bssid, pmksa->pmkid); return -EINVAL; } @@ -13029,11 +14257,8 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -13051,6 +14276,7 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device TRACE_CODE_HDD_CFG80211_SET_PMKSA, pAdapter->sessionId, result)); + EXIT(); return HAL_STATUS_SUCCESS(result) ? 0 : -EINVAL; } @@ -13075,6 +14301,8 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device hdd_context_t *pHddCtx; int status = 0; + ENTER(); + /* Validate pAdapter */ if (NULL == pAdapter) { @@ -13097,17 +14325,17 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } /*Retrieve halHandle*/ halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_DEL_PMKSA, + pAdapter->sessionId, 0)); /* Delete the PMKID CSR cache */ if (eHAL_STATUS_SUCCESS != sme_RoamDelPMKIDfromCache(halHandle, @@ -13117,7 +14345,8 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device status = -EINVAL; } - return status; + EXIT(); + return status; } @@ -13141,7 +14370,7 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_devic hdd_context_t *pHddCtx; int status = 0; - hddLog(VOS_TRACE_LEVEL_DEBUG, "%s: flushing PMKSA ",__func__); + ENTER(); /* Validate pAdapter */ if (NULL == pAdapter) @@ -13153,11 +14382,8 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_devic pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -13170,7 +14396,7 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_devic hddLog(VOS_TRACE_LEVEL_ERROR, FL("Cannot flush PMKIDCache")); status = -EINVAL; } - + EXIT(); return status; } @@ -13193,14 +14419,28 @@ static int __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy, { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); if (NULL == pAdapter) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter is NULL", __func__); return -ENODEV; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: STA Context is NULL", __func__); + return -EINVAL; + } MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES, @@ -13222,6 +14462,8 @@ static int __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy, sme_SetFTIEs( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, (const u8 *)ftie->ie, ftie->ie_len); + + EXIT(); return 0; } @@ -13280,7 +14522,14 @@ void hdd_cfg80211_sched_scan_done_callback(void *callbackContext, if (0 > ret) hddLog(VOS_TRACE_LEVEL_INFO, "%s: NO SCAN result", __func__); - + else + { + /* Acquire wakelock to handle the case where APP's tries to suspend + * immediatly after the driver gets connect request(i.e after pno) + * from supplicant, this result in app's is suspending and not able + * to process the connect request to AP */ + hdd_prevent_suspend_timeout(1000, WIFI_POWER_EVENT_WAKELOCK_SCAN); + } cfg80211_sched_scan_results(pHddCtx->wiphy); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: cfg80211 scan result database updated", __func__); @@ -13329,6 +14578,8 @@ void hdd_cfg80211_sched_scan_start_status_cb(void *callbackContext, VOS_STATUS s hdd_adapter_t *pAdapter = callbackContext; hdd_context_t *pHddCtx; + ENTER(); + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -13339,8 +14590,6 @@ void hdd_cfg80211_sched_scan_start_status_cb(void *callbackContext, VOS_STATUS s pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if (0 != wlan_hdd_validate_context(pHddCtx)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return; } @@ -13353,6 +14602,7 @@ void hdd_cfg80211_sched_scan_start_status_cb(void *callbackContext, VOS_STATUS s pAdapter->pno_req_status = (status == VOS_STATUS_SUCCESS) ? 0 : -EBUSY; complete(&pAdapter->pno_comp_var); + EXIT(); } /* @@ -13375,6 +14625,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, hdd_config_t *pConfig = NULL; v_U32_t num_ignore_dfs_ch = 0; + ENTER(); + if (NULL == pAdapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -13387,8 +14639,6 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, if (0 != ret) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return -EINVAL; } @@ -13400,6 +14650,9 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, "%s: HAL context is Null!!!", __func__); return -EINVAL; } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START, + pAdapter->sessionId, pAdapter->device_mode)); sme_ScanFlushResult(hHal, pAdapter->sessionId); ret = wlan_hdd_scan_abort(pAdapter); if (ret < 0) @@ -13686,6 +14939,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, vos_mem_free(pnoRequest.p24GProbeTemplate); if (pnoRequest.p5GProbeTemplate) vos_mem_free(pnoRequest.p5GProbeTemplate); + + EXIT(); return ret; } @@ -13750,6 +15005,7 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: LOGP in Progress. Ignore!!!", __func__); + pHddCtx->isPnoEnable = FALSE; return ret; } @@ -13771,6 +15027,14 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy, pnoRequest.enable = 0; /* Disable PNO */ pnoRequest.ucNetworksCount = 0; + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP, + pAdapter->sessionId, pAdapter->device_mode)); + + INIT_COMPLETION(pAdapter->pno_comp_var); + pnoRequest.statusCallback = hdd_cfg80211_sched_scan_start_status_cb; + pnoRequest.callbackContext = pAdapter; + pAdapter->pno_req_status = 0; status = sme_SetPreferredNetworkList(hHal, &pnoRequest, pAdapter->sessionId, NULL, pAdapter); @@ -13781,7 +15045,22 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy, ret = -EINVAL; goto error; } - pHddCtx->isPnoEnable = FALSE; + ret = wait_for_completion_timeout( + &pAdapter->pno_comp_var, + msecs_to_jiffies(WLAN_WAIT_TIME_PNO)); + if (0 >= ret) + { + // Did not receive the response for PNO disable in time. + // Assuming the PNO disable was success. + // Returning error from here, because we timeout, results + // in side effect of Wifi (Wifi Setting) not to work. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Timed out waiting for PNO to be disabled")); + ret = 0; + } + + ret = pAdapter->pno_req_status; + pHddCtx->isPnoEnable = (ret == 0) ? FALSE : TRUE; error: VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, @@ -13811,31 +15090,69 @@ static int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy, #ifdef FEATURE_WLAN_TDLS #if TDLS_MGMT_VERSION2 -static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, - u8 *peer, u8 action_code, u8 dialog_token, - u16 status_code, u32 peer_capability, const u8 *buf, size_t len) +static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + u8 *peer, u8 action_code, + u8 dialog_token, + u16 status_code, u32 peer_capability, + const u8 *buf, size_t len) +#else /* TDLS_MGMT_VERSION2 */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) || defined(WITH_BACKPORTS) +static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + const u8 *peer, u8 action_code, + u8 dialog_token, u16 status_code, + u32 peer_capability, bool initiator, + const u8 *buf, size_t len) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) +static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + const u8 *peer, u8 action_code, + u8 dialog_token, u16 status_code, + u32 peer_capability, const u8 *buf, + size_t len) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) +static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + u8 *peer, u8 action_code, + u8 dialog_token, + u16 status_code, u32 peer_capability, + const u8 *buf, size_t len) #else -static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, - u8 *peer, u8 action_code, u8 dialog_token, - u16 status_code, const u8 *buf, size_t len) +static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + u8 *peer, u8 action_code, + u8 dialog_token, + u16 status_code, const u8 *buf, + size_t len) +#endif #endif { - - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - u8 peerMac[6]; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; VOS_STATUS status; int max_sta_failed = 0; int responder; long rc; -#if !(TDLS_MGMT_VERSION2) + int ret; +#if !(TDLS_MGMT_VERSION2) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) u32 peer_capability = 0; #endif tANI_U16 numCurrTdlsPeers; + hdd_station_ctx_t *pHddStaCtx = NULL; + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_MGMT, pAdapter->sessionId, action_code)); + + pHddCtx = wiphy_priv(wiphy); if (NULL == pHddCtx || NULL == pHddCtx->cfg_ini) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -13854,13 +15171,43 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d return -EBUSY; } - if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) + if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Unloading/Loading in Progress. Ignore!!!", __func__); + return -EAGAIN; + } + + if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS mode is disabled OR not enabled in FW." + MAC_ADDRESS_STR " action %d declined.", + __func__, MAC_ADDR_ARRAY(peer), action_code); + return -ENOTSUPP; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + + if( NULL == pHddStaCtx ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD station context NULL ",__func__); + return -EINVAL; + } + + /* STA should be connected and authenticated + * before sending any TDLS frames + */ + if ((eConnectionState_Associated != pHddStaCtx->conn_info.connState) || + (FALSE == pHddStaCtx->conn_info.uIsAuthenticated)) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: TDLS mode is disabled OR not enabled in FW." - MAC_ADDRESS_STR " action %d declined.", - __func__, MAC_ADDR_ARRAY(peer), action_code); - return -ENOTSUPP; + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "STA is not connected or unauthenticated. " + "connState %u, uIsAuthenticated %u", + pHddStaCtx->conn_info.connState, + pHddStaCtx->conn_info.uIsAuthenticated); + return -EAGAIN; } /* other than teardown frame, other mgmt frames are not sent if disabled */ @@ -13869,12 +15216,12 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d /* if tdls_mode is disabled to respond to peer's request */ if (eTDLS_SUPPORT_DISABLED == pHddCtx->tdls_mode) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " TDLS mode is disabled. action %d declined.", __func__, MAC_ADDR_ARRAY(peer), action_code); - return -ENOTSUPP; + return -ENOTSUPP; } if (vos_max_concurrent_connections_reached()) @@ -13886,7 +15233,7 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d if (WLAN_IS_TDLS_SETUP_ACTION(action_code)) { - if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, peer, TRUE)) + if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, peer, TRUE, TRUE)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR @@ -13933,24 +15280,24 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d else { hddTdlsPeer_t *pTdlsPeer; - pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE); + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, FALSE); if (pTdlsPeer && TDLS_IS_CONNECTED(pTdlsPeer)) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s:" MAC_ADDRESS_STR " already connected. action %d declined.", __func__, MAC_ADDR_ARRAY(peer), action_code); return -EPERM; } + mutex_unlock(&pHddCtx->tdls_lock); } } - vos_mem_copy(peerMac, peer, 6); -#ifdef WLAN_FEATURE_TDLS_DEBUG - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " action %d, dialog_token %d status %d, len = %zu", "tdls_mgmt", MAC_ADDR_ARRAY(peer), action_code, dialog_token, status_code, len); -#endif /*Except teardown responder will not be used so just make 0*/ responder = 0; @@ -13958,7 +15305,9 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d { hddTdlsPeer_t *pTdlsPeer; - pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peerMac, TRUE); + + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, FALSE); if(pTdlsPeer && TDLS_IS_CONNECTED(pTdlsPeer)) responder = pTdlsPeer->is_responder; @@ -13968,8 +15317,10 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d "%s: " MAC_ADDRESS_STR " peer doesn't exist or not connected %d dialog_token %d status %d, len = %zu", __func__, MAC_ADDR_ARRAY(peer), (NULL == pTdlsPeer) ? -1 : pTdlsPeer->link_status, dialog_token, status_code, len); + mutex_unlock(&pHddCtx->tdls_lock); return -EPERM; } + mutex_unlock(&pHddCtx->tdls_lock); } /* For explicit trigger of DIS_REQ come out of BMPS for @@ -13980,12 +15331,18 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d { if (TRUE == sme_IsPmcBmps(WLAN_HDD_GET_HAL_CTX(pAdapter))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Sending frame action_code %u.Disable BMPS", __func__, action_code); - hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); + status = hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set BMPS/IMPS")); + } + } + if (SIR_MAC_TDLS_DIS_REQ != action_code) { + if (0 != wlan_hdd_tdls_set_cap(pAdapter, peer, eTDLS_CAP_SUPPORTED)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set TDLS capabilities")); + } } - if (SIR_MAC_TDLS_DIS_REQ != action_code) - wlan_hdd_tdls_set_cap(pAdapter, peerMac, eTDLS_CAP_SUPPORTED); } /* make sure doesn't call send_mgmt() while it is pending */ @@ -13994,24 +15351,42 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " action %d couldn't sent, as one is pending. return EBUSY", __func__, MAC_ADDR_ARRAY(peer), action_code); - return -EBUSY; + ret = -EBUSY; + goto tx_failed; } pAdapter->mgmtTxCompletionStatus = TDLS_CTX_MAGIC; INIT_COMPLETION(pAdapter->tdls_mgmt_comp); - status = sme_SendTdlsMgmtFrame(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, - peerMac, action_code, dialog_token, status_code, peer_capability, (tANI_U8 *)buf, len, responder); + status = sme_SendTdlsMgmtFrame(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, peer, action_code, dialog_token, + status_code, peer_capability, (tANI_U8 *)buf, len, + responder); if (VOS_STATUS_SUCCESS != status) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: sme_SendTdlsMgmtFrame failed!", __func__); pAdapter->mgmtTxCompletionStatus = FALSE; - wlan_hdd_tdls_check_bmps(pAdapter); - return -EINVAL; + ret = -EINVAL; + goto tx_failed; + } + + if ((SIR_MAC_TDLS_DIS_REQ == action_code) || + (SIR_MAC_TDLS_DIS_RSP == action_code)) + { + /* for DIS_REQ/DIS_RSP, supplicant don't consider the return status. + * So we no need to wait for tdls_mgmt_comp for sending ack status. + */ + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: tx done for frm %u", __func__, action_code); + return 0; } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Wait for tdls_mgmt_comp. Timeout %u ms", __func__, + WAIT_TIME_TDLS_MGMT); + rc = wait_for_completion_interruptible_timeout(&pAdapter->tdls_mgmt_comp, msecs_to_jiffies(WAIT_TIME_TDLS_MGMT)); @@ -14029,36 +15404,130 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d return -EAGAIN; } - wlan_hdd_tdls_check_bmps(pAdapter); - return -EINVAL; + ret = -EINVAL; + goto tx_failed; + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Mgmt Tx Completion status %ld TxCompletion %u", + __func__, rc, pAdapter->mgmtTxCompletionStatus); } if (max_sta_failed) { - wlan_hdd_tdls_check_bmps(pAdapter); - return max_sta_failed; + ret = max_sta_failed; + goto tx_failed; } if (SIR_MAC_TDLS_SETUP_RSP == action_code) { - wlan_hdd_tdls_set_responder(pAdapter, peerMac, TRUE); + if (0 != wlan_hdd_tdls_set_responder(pAdapter, peer, TRUE)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set TDLS responder: Setup Response")); + } } else if (SIR_MAC_TDLS_SETUP_CNF == action_code) { - wlan_hdd_tdls_set_responder(pAdapter, peerMac, FALSE); + if (0 != wlan_hdd_tdls_set_responder(pAdapter, peer, FALSE)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set TDLS responder: Setup Response")); + } } return 0; + +tx_failed: + /* add_station will be called before sending TDLS_SETUP_REQ and + * TDLS_SETUP_RSP and as part of add_station driver will enable + * BMPS. NL80211_TDLS_DISABLE_LINK will be called if the tx of + * TDLS_SETUP_REQ or TDLS_SETUP_RSP fails. BMPS will be enabled + * as part of processing NL80211_TDLS_DISABLE_LINK. So need to + * enable BMPS for TDLS_SETUP_REQ and TDLS_SETUP_RSP if tx fails. + */ + + if ((SIR_MAC_TDLS_SETUP_REQ == action_code) || + (SIR_MAC_TDLS_SETUP_RSP == action_code)) + wlan_hdd_tdls_check_bmps(pAdapter); + return ret; } +#if TDLS_MGMT_VERSION2 +static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, + u8 *peer, u8 action_code, u8 dialog_token, + u16 status_code, u32 peer_capability, + const u8 *buf, size_t len) +#else /* TDLS_MGMT_VERSION2 */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) +static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + const u8 *peer, u8 action_code, + u8 dialog_token, u16 status_code, + u32 peer_capability, bool initiator, + const u8 *buf, size_t len) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + const u8 *peer, u8 action_code, + u8 dialog_token, u16 status_code, + u32 peer_capability, const u8 *buf, + size_t len) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) +static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, + struct net_device *dev, + u8 *peer, u8 action_code, + u8 dialog_token, + u16 status_code, u32 peer_capability, + const u8 *buf, size_t len) +#else +static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, + u8 *peer, u8 action_code, u8 dialog_token, + u16 status_code, const u8 *buf, size_t len) +#endif +#endif +{ + int ret; + + vos_ssr_protect(__func__); +#if TDLS_MGMT_VERSION2 + ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code, + dialog_token, status_code, + peer_capability, buf, len); +#else /* TDLS_MGMT_VERSION2 */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) || defined(WITH_BACKPORTS) + ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code, + dialog_token, status_code, + peer_capability, initiator, + buf, len); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) + ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code, + dialog_token, status_code, + peer_capability, buf, len); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) + ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code, + dialog_token, status_code, + peer_capability, buf, len); +#else + ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code, + dialog_token, status_code, buf, len); +#endif +#endif + vos_ssr_unprotect(__func__); + + return ret; +} int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer, +#else u8 *peer, +#endif + tdls_req_params_t *tdls_peer_params, cfg80211_exttdls_callback callback) { - hddTdlsPeer_t *pTdlsPeer; + hddTdlsPeer_t *pTdlsPeer = NULL; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, " %s : NL80211_TDLS_SETUP for " MAC_ADDRESS_STR, __func__, MAC_ADDR_ARRAY(peer)); @@ -14067,24 +15536,73 @@ int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - " %s TDLS External control and Implicit Trigger not enabled ", - __func__); + " %s TDLS External control (%d) and Implicit Trigger (%d) not enabled ", + __func__, pHddCtx->cfg_ini->fTDLSExternalControl, + pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger); return -ENOTSUPP; } /* To cater the requirement of establishing the TDLS link * irrespective of the data traffic , get an entry of TDLS peer. */ + mutex_lock(&pHddCtx->tdls_lock); pTdlsPeer = wlan_hdd_tdls_get_peer(pAdapter, peer); if (pTdlsPeer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: peer " MAC_ADDRESS_STR " not existing", __func__, MAC_ADDR_ARRAY(peer)); + mutex_unlock(&pHddCtx->tdls_lock); return -EINVAL; } + /* check FW TDLS Off Channel capability */ + if ((TRUE == sme_IsFeatureSupportedByFW(TDLS_OFF_CHANNEL)) && + (TRUE == pHddCtx->cfg_ini->fEnableTDLSOffChannel) && + (NULL != tdls_peer_params)) + { + pTdlsPeer->peerParams.channel = tdls_peer_params->channel; + pTdlsPeer->peerParams.global_operating_class = + tdls_peer_params->global_operating_class; + pTdlsPeer->peerParams.max_latency_ms = tdls_peer_params->max_latency_ms; + pTdlsPeer->peerParams.min_bandwidth_kbps = + tdls_peer_params->min_bandwidth_kbps; + /* check configured channel is valid, non dfs and + * not current operating channel */ + if ((sme_IsTdlsOffChannelValid(WLAN_HDD_GET_HAL_CTX(pAdapter), + tdls_peer_params->channel)) && + (pHddStaCtx) && + (tdls_peer_params->channel != + pHddStaCtx->conn_info.operationChannel)) + { + pTdlsPeer->isOffChannelConfigured = TRUE; + } + else + { + pTdlsPeer->isOffChannelConfigured = FALSE; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Configured Tdls Off Channel is not valid", __func__); + + } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: tdls_off_channel %d isOffChannelConfigured %d " + "current operating channel %d", + __func__, pTdlsPeer->peerParams.channel, + pTdlsPeer->isOffChannelConfigured, + (pHddStaCtx ? pHddStaCtx->conn_info.operationChannel : 0)); + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: TDLS off channel FW capability %d, " + "host capab %d or Invalid TDLS Peer Params", __func__, + sme_IsFeatureSupportedByFW(TDLS_OFF_CHANNEL), + pHddCtx->cfg_ini->fEnableTDLSOffChannel); + } + if ( 0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, TRUE) ) { + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, " %s TDLS Add Force Peer Failed", __func__); @@ -14093,17 +15611,26 @@ int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, /*EXT TDLS*/ if ( 0 != wlan_hdd_set_callback(pTdlsPeer, callback) ) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, " %s TDLS set callback Failed", __func__); return -EINVAL; } + mutex_unlock(&pHddCtx->tdls_lock); + return(0); } -int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, u8 *peer) +int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer +#else + u8 *peer +#endif +) { hddTdlsPeer_t *pTdlsPeer; @@ -14112,52 +15639,83 @@ int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, u8 *peer) " %s : NL80211_TDLS_TEARDOWN for " MAC_ADDRESS_STR, __func__, MAC_ADDR_ARRAY(peer)); + if (0 != wlan_hdd_validate_context(pHddCtx)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is NULL")); + return -EINVAL; + } + if ( (FALSE == pHddCtx->cfg_ini->fTDLSExternalControl) || (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - " %s TDLS External control and Implicit Trigger not enabled ", - __func__); + " %s TDLS External control (%d) and Implicit Trigger (%d) not enabled ", + __func__, pHddCtx->cfg_ini->fTDLSExternalControl, + pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger); return -ENOTSUPP; } - - pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE); + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, FALSE); if ( NULL == pTdlsPeer ) { + mutex_unlock(&pHddCtx->tdls_lock); hddLog(VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR - " peer not exsting", + " peer not existing", __func__, MAC_ADDR_ARRAY(peer)); return -EINVAL; } else { wlan_hdd_tdls_indicate_teardown(pAdapter, pTdlsPeer, eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); + /* if channel switch is configured, reset + the channel for this peer */ + if (TRUE == pTdlsPeer->isOffChannelConfigured) + { + pTdlsPeer->peerParams.channel = 0; + pTdlsPeer->isOffChannelConfigured = FALSE; + } } - if ( 0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, FALSE) ) + if ( 0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, FALSE) ) { + mutex_unlock(&pHddCtx->tdls_lock); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to set force peer")); return -EINVAL; + } /*EXT TDLS*/ if ( 0 != wlan_hdd_set_callback(pTdlsPeer, NULL )) { - + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, " %s TDLS set callback Failed", __func__); return -EINVAL; } - return(0); + mutex_unlock(&pHddCtx->tdls_lock); + + return(0); } static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, - u8 *peer, enum nl80211_tdls_operation oper) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer, +#else + u8 *peer, +#endif + enum nl80211_tdls_operation oper) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); int status; hddTdlsPeer_t *pTdlsPeer; + ENTER(); + + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return -EINVAL; + } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_OPER, pAdapter->sessionId, oper)); @@ -14169,11 +15727,8 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device } status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -14182,8 +15737,10 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device FALSE == sme_IsFeatureSupportedByFW(TDLS)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "TDLS Disabled in INI OR not enabled in FW. " - "Cannot process TDLS commands"); + "TDLS Disabled in INI (%d) OR not enabled in FW (%d) " + "Cannot process TDLS commands", + pHddCtx->cfg_ini->fEnableTDLSSupport, + sme_IsFeatureSupportedByFW(TDLS)); return -ENOTSUPP; } @@ -14194,6 +15751,13 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device long ret; tCsrTdlsLinkEstablishParams tdlsLinkEstablishParams; WLAN_STADescType staDesc; + tANI_U16 numCurrTdlsPeers = 0; + hddTdlsPeer_t *connPeer = NULL; + tANI_U8 suppChannelLen = 0; + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + " %s : NL80211_TDLS_ENABLE_LINK for " MAC_ADDRESS_STR, + __func__, MAC_ADDR_ARRAY(peer)); pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE); memset(&staDesc, 0, sizeof(staDesc)); @@ -14217,18 +15781,70 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device return -EINVAL; } + /* before starting tdls connection, set tdls + * off channel established status to default value */ + pTdlsPeer->isOffChannelEstablished = FALSE; + /* TDLS Off Channel, Disable tdls channel switch, + when there are more than one tdls link */ + numCurrTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); + if (numCurrTdlsPeers == 2) + { + /* get connected peer and send disable tdls off chan */ + connPeer = wlan_hdd_tdls_get_connected_peer(pAdapter); + if ((connPeer) && + (connPeer->isOffChannelSupported == TRUE) && + (connPeer->isOffChannelConfigured == TRUE)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: More then one peer connected, Disable " + "TDLS channel switch", __func__); + + connPeer->isOffChannelEstablished = FALSE; + + ret = sme_SendTdlsChanSwitchReq( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + connPeer->peerMac, + connPeer->peerParams.channel, + TDLS_OFF_CHANNEL_BW_OFFSET, + TDLS_CHANNEL_SWITCH_DISABLE); + if (ret != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Failed to send TDLS switch channel request")); + } + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: No TDLS Connected Peer or " + "isOffChannelSupported %d " + "isOffChannelConfigured %d", + __func__, + (connPeer ? (connPeer->isOffChannelSupported) + : -1), + (connPeer ? (connPeer->isOffChannelConfigured) + : -1)); + } + } + if (eTDLS_LINK_CONNECTED != pTdlsPeer->link_status) { if (IS_ADVANCE_TDLS_ENABLE) { if (0 != wlan_hdd_tdls_get_link_establish_params( pAdapter, peer,&tdlsLinkEstablishParams)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to get link establishment params")); return -EINVAL; } INIT_COMPLETION(pAdapter->tdls_link_establish_req_comp); - sme_SendTdlsLinkEstablishParams(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, peer, &tdlsLinkEstablishParams); + ret = sme_SendTdlsLinkEstablishParams( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, peer, + &tdlsLinkEstablishParams); + if (ret != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to send link establishment params")); + } /* Send TDLS peer UAPSD capabilities to the firmware and * register with the TL on after the response for this operation * is received . @@ -14239,18 +15855,45 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device if (ret <= 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Link Establish Request Faled Status %ld", - __func__, ret); + FL("Link Establish Request Failed Status %ld"), + ret); return -EINVAL; } } + wlan_hdd_tdls_set_peer_link_status(pTdlsPeer, eTDLS_LINK_CONNECTED, eTDLS_LINK_SUCCESS); staDesc.ucSTAId = pTdlsPeer->staId; staDesc.ucQosEnabled = tdlsLinkEstablishParams.qos; - WLANTL_UpdateTdlsSTAClient(pHddCtx->pvosContext, - &staDesc); + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: tdlsLinkEstablishParams of peer " + MAC_ADDRESS_STR "uapsdQueues: %d" + "qos: %d maxSp: %d isBufSta: %d isOffChannelSupported: %d" + "isResponder: %d peerstaId: %d", + __func__, + MAC_ADDR_ARRAY(tdlsLinkEstablishParams.peerMac), + tdlsLinkEstablishParams.uapsdQueues, + tdlsLinkEstablishParams.qos, + tdlsLinkEstablishParams.maxSp, + tdlsLinkEstablishParams.isBufSta, + tdlsLinkEstablishParams.isOffChannelSupported, + tdlsLinkEstablishParams.isResponder, + pTdlsPeer->staId); + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: StaDesc ucSTAId: %d ucQosEnabled: %d", + __func__, + staDesc.ucSTAId, + staDesc.ucQosEnabled); + + ret = WLANTL_UpdateTdlsSTAClient( + pHddCtx->pvosContext, + &staDesc); + if (ret != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to update TDLS STA params")); + } /* Mark TDLS client Authenticated .*/ status = WLANTL_ChangeSTAState( pHddCtx->pvosContext, @@ -14261,16 +15904,103 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device if (pTdlsPeer->is_responder == 0) { v_U8_t staId = (v_U8_t)pTdlsPeer->staId; + tdlsConnInfo_t *tdlsInfo; + + tdlsInfo = wlan_hdd_get_conn_info(pHddCtx, staId); + + /* Initialize initiator wait callback */ + vos_timer_init( + &pTdlsPeer->initiatorWaitTimeoutTimer, + VOS_TIMER_TYPE_SW, + wlan_hdd_tdls_initiator_wait_cb, + tdlsInfo); wlan_hdd_tdls_timer_restart(pAdapter, &pTdlsPeer->initiatorWaitTimeoutTimer, WAIT_TIME_TDLS_INITIATOR); /* suspend initiator TX until it receives direct packet from the reponder or WAIT_TIME_TDLS_INITIATOR timer expires */ - WLANTL_SuspendDataTx( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - &staId, NULL); + ret = WLANTL_SuspendDataTx( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, + &staId, NULL); + if (ret != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to suspend data tx")); + } + } + + if ((TRUE == pTdlsPeer->isOffChannelSupported) && + (TRUE == pTdlsPeer->isOffChannelConfigured)) + { + suppChannelLen = + tdlsLinkEstablishParams.supportedChannelsLen; + + if ((suppChannelLen > 0) && + (suppChannelLen <= SIR_MAC_MAX_SUPP_CHANNELS)) + { + tANI_U8 suppPeerChannel = 0; + int i = 0; + for (i = 0U; i < suppChannelLen; i++) + { + suppPeerChannel = + tdlsLinkEstablishParams.supportedChannels[i]; + + pTdlsPeer->isOffChannelSupported = FALSE; + if (suppPeerChannel == + pTdlsPeer->peerParams.channel) + { + pTdlsPeer->isOffChannelSupported = TRUE; + break; + } + } + } + else + { + pTdlsPeer->isOffChannelSupported = FALSE; + } + } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS channel switch request for channel " + "%d isOffChannelConfigured %d suppChannelLen " + "%d isOffChannelSupported %d", __func__, + pTdlsPeer->peerParams.channel, + pTdlsPeer->isOffChannelConfigured, + suppChannelLen, + pTdlsPeer->isOffChannelSupported); + + /* TDLS Off Channel, Enable tdls channel switch, + when their is only one tdls link and it supports */ + numCurrTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); + if ((numCurrTdlsPeers == 1) && + (TRUE == pTdlsPeer->isOffChannelSupported) && + (TRUE == pTdlsPeer->isOffChannelConfigured)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Send TDLS channel switch request for channel %d", + __func__, pTdlsPeer->peerParams.channel); + + pTdlsPeer->isOffChannelEstablished = TRUE; + ret = sme_SendTdlsChanSwitchReq(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + pTdlsPeer->peerMac, + pTdlsPeer->peerParams.channel, + TDLS_OFF_CHANNEL_BW_OFFSET, + TDLS_CHANNEL_SWITCH_ENABLE); + if (ret != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS offchannel: Failed to send TDLS switch channel req")); + } } - wlan_hdd_tdls_increment_peer_count(pAdapter); + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: TDLS channel switch request not sent" + " numCurrTdlsPeers %d " + "isOffChannelSupported %d " + "isOffChannelConfigured %d", + __func__, numCurrTdlsPeers, + pTdlsPeer->isOffChannelSupported, + pTdlsPeer->isOffChannelConfigured); + } + } wlan_hdd_tdls_check_bmps(pAdapter); @@ -14290,17 +16020,29 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device pTdlsPeer->staId, ucAc[ac], tlTid[ac], tlTid[ac], 0, 0, WLANTL_BI_DIR ); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to enable UAPSD for AC")); + } } } } - } break; case NL80211_TDLS_DISABLE_LINK: { - pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE); + tANI_U16 numCurrTdlsPeers = 0; + hddTdlsPeer_t *connPeer = NULL; + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + " %s : NL80211_TDLS_DISABLE_LINK for " MAC_ADDRESS_STR, + __func__, MAC_ADDR_ARRAY(peer)); + + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, FALSE); + if ( NULL == pTdlsPeer ) { + mutex_unlock(&pHddCtx->tdls_lock); hddLog(VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " (oper %d) not exsting. ignored", __func__, MAC_ADDR_ARRAY(peer), (int)oper); @@ -14316,22 +16058,42 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device { long status; - + /* set tdls off channel status to false for this peer */ + pTdlsPeer->isOffChannelEstablished = FALSE; wlan_hdd_tdls_set_peer_link_status(pTdlsPeer, eTDLS_LINK_TEARING, (pTdlsPeer->link_status == eTDLS_LINK_TEARING)? eTDLS_LINK_UNSPECIFIED: eTDLS_LINK_DROPPED_BY_REMOTE); + mutex_unlock(&pHddCtx->tdls_lock); + INIT_COMPLETION(pAdapter->tdls_del_station_comp); - sme_DeleteTdlsPeerSta( WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, peer ); + status = sme_DeleteTdlsPeerSta( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, peer ); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to delete TDLS peer STA")); + } status = wait_for_completion_interruptible_timeout(&pAdapter->tdls_del_station_comp, msecs_to_jiffies(WAIT_TIME_TDLS_DEL_STA)); + + mutex_lock(&pHddCtx->tdls_lock); + pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, FALSE); + if ( NULL == pTdlsPeer ) { + mutex_unlock(&pHddCtx->tdls_lock); + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR + " peer was freed in other context", + __func__, MAC_ADDR_ARRAY(peer)); + return -EINVAL; + } + wlan_hdd_tdls_set_peer_link_status(pTdlsPeer, eTDLS_LINK_IDLE, eTDLS_LINK_UNSPECIFIED); + mutex_unlock(&pHddCtx->tdls_lock); + if (status <= 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -14339,9 +16101,69 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device __func__, status); return -EPERM; } + + /* TDLS Off Channel, Enable tdls channel switch, + when their is only one tdls link and it supports */ + numCurrTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); + if (numCurrTdlsPeers == 1) + { + tSirMacAddr peerMac; + int channel; + + mutex_lock(&pHddCtx->tdls_lock); + connPeer = wlan_hdd_tdls_get_connected_peer(pAdapter); + + if (connPeer == NULL) { + mutex_unlock(&pHddCtx->tdls_lock); + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s connPeer is NULL", __func__); + return -EINVAL; + } + + vos_mem_copy(peerMac, connPeer->peerMac, sizeof(tSirMacAddr)); + channel = connPeer->peerParams.channel; + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS channel switch " + "isOffChannelSupported %d " + "isOffChannelConfigured %d " + "isOffChannelEstablished %d", + __func__, + (connPeer ? connPeer->isOffChannelSupported : -1), + (connPeer ? connPeer->isOffChannelConfigured : -1), + (connPeer ? connPeer->isOffChannelEstablished : -1)); + + if ((connPeer) && + (connPeer->isOffChannelSupported == TRUE) && + (connPeer->isOffChannelConfigured == TRUE)) + { + connPeer->isOffChannelEstablished = TRUE; + mutex_unlock(&pHddCtx->tdls_lock); + status = sme_SendTdlsChanSwitchReq( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + peerMac, + channel, + TDLS_OFF_CHANNEL_BW_OFFSET, + TDLS_CHANNEL_SWITCH_ENABLE); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to send TDLS switch channel req")); + } + } + else + mutex_unlock(&pHddCtx->tdls_lock); + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: TDLS channel switch request not sent " + "numCurrTdlsPeers %d ", + __func__, numCurrTdlsPeers); + } } else { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: TDLS Peer Station doesn't exist.", __func__); } @@ -14354,7 +16176,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device if (0 != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Error in TDLS Teardown", __func__); + FL("Error in TDLS Teardown")); return status; } break; @@ -14363,12 +16185,13 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device { status = wlan_hdd_tdls_extctrl_config_peer(pAdapter, peer, + NULL, NULL); if (0 != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Error in TDLS Setup", __func__); + FL("Error in TDLS Setup")); return status; } break; @@ -14376,7 +16199,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device case NL80211_TDLS_DISCOVERY_REQ: /* We don't support in-driver setup/teardown/discovery */ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - "%s: We don't support in-driver setup/teardown/discovery " + "%s: Driver doesn't support in-driver setup/teardown/discovery " ,__func__); return -ENOTSUPP; default: @@ -14384,11 +16207,18 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device "%s: unsupported event",__func__); return -ENOTSUPP; } + + EXIT(); return 0; } static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, - u8 *peer, enum nl80211_tdls_operation oper) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *peer, +#else + u8 *peer, +#endif + enum nl80211_tdls_operation oper) { int ret; @@ -14409,10 +16239,21 @@ int wlan_hdd_cfg80211_send_tdls_discover_req(struct wiphy *wiphy, #if TDLS_MGMT_VERSION2 return wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, WLAN_TDLS_DISCOVERY_REQUEST, 1, 0, 0, NULL, 0); +#else +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) + return wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, + WLAN_TDLS_DISCOVERY_REQUEST, 1, 0, 0, 0, NULL, 0); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) + return wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, + WLAN_TDLS_DISCOVERY_REQUEST, 1, 0, 0, NULL, 0); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + return wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, + WLAN_TDLS_DISCOVERY_REQUEST, 1, 0, 0, NULL, 0); #else return wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, WLAN_TDLS_DISCOVERY_REQUEST, 1, 0, NULL, 0); #endif +#endif /* KERNEL_VERSION */ } #endif @@ -14494,7 +16335,6 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *d ENTER(); - if (NULL == pAdapter) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -14507,11 +16347,8 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *d pAdapter->sessionId, pAdapter->device_mode)); result = wlan_hdd_validate_context(pHddCtx); - if (0 != result) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return result; } @@ -14582,6 +16419,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *d vos_mem_zero(&hddGtkOffloadReqParams, sizeof(hddGtkOffloadReqParams)); + EXIT(); return eHAL_STATUS_SUCCESS; } @@ -14598,11 +16436,12 @@ int wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev } #endif /*WLAN_FEATURE_GTK_OFFLOAD*/ /* - * FUNCTION: wlan_hdd_cfg80211_set_mac_acl + * FUNCTION: __wlan_hdd_cfg80211_set_mac_acl * This function is used to set access control policy */ -static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, - struct net_device *dev, const struct cfg80211_acl_data *params) +static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, + struct net_device *dev, + const struct cfg80211_acl_data *params) { int i; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -14630,11 +16469,8 @@ static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -14650,6 +16486,9 @@ static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"acl policy: = %d" "no acl entries = %d", params->acl_policy, params->n_acl_entries); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_SET_MAC_ACL, + pAdapter->sessionId, pAdapter->device_mode)); if (WLAN_HDD_SOFTAP == pAdapter->device_mode) { @@ -14727,9 +16566,22 @@ static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, return -EINVAL; } + EXIT(); return 0; } +static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, + struct net_device *dev, + const struct cfg80211_acl_data *params) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_mac_acl(wiphy, dev, params); + vos_ssr_unprotect(__func__); + + return ret; +} + #ifdef WLAN_NL80211_TESTMODE #ifdef FEATURE_WLAN_LPHB void wlan_hdd_cfg80211_lphb_ind_handler @@ -14810,6 +16662,14 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len #ifdef FEATURE_WLAN_LPHB hdd_context_t *pHddCtx = wiphy_priv(wiphy); eHalStatus smeStatus; + + ENTER(); + + err = wlan_hdd_validate_context(pHddCtx); + if (0 != err) + { + return err; + } #endif /* FEATURE_WLAN_LPHB */ err = nla_parse(tb, WLAN_HDD_TM_ATTR_MAX, data, len, wlan_hdd_tm_policy); @@ -14827,6 +16687,9 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len return -EINVAL; } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_TESTMODE, + NO_SESSION, nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD]))); switch (nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD])) { #ifdef FEATURE_WLAN_LPHB @@ -14848,11 +16711,23 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len buf = nla_data(tb[WLAN_HDD_TM_ATTR_DATA]); buf_len = nla_len(tb[WLAN_HDD_TM_ATTR_DATA]); + if (buf_len > sizeof(*hb_params)) { + hddLog(LOGE, FL("buf_len=%d exceeded hb_params size limit"), + buf_len); + return -ERANGE; + } + hb_params_temp =(tSirLPHBReq *)buf; if ((hb_params_temp->cmd == LPHB_SET_TCP_PARAMS_INDID) && (hb_params_temp->params.lphbTcpParamReq.timePeriodSec == 0)) return -EINVAL; + if (buf_len > sizeof(*hb_params)) { + hddLog(LOGE, FL("buf_len=%d exceeded hb_params size limit"), + buf_len); + return -ERANGE; + } + hb_params = (tSirLPHBReq *)vos_mem_malloc(sizeof(tSirLPHBReq)); if (NULL == hb_params) { @@ -14861,6 +16736,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len return -EINVAL; } + vos_mem_zero(hb_params, sizeof(tSirLPHBReq)); vos_mem_copy(hb_params, buf, buf_len); smeStatus = sme_LPHBConfigReq((tHalHandle)(pHddCtx->hHal), hb_params, @@ -14880,10 +16756,15 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len return -EOPNOTSUPP; } - return err; + EXIT(); + return err; } -static int wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) +static int wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + struct wireless_dev *wdev, +#endif + void *data, int len) { int ret; @@ -14925,11 +16806,8 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -14951,11 +16829,21 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, return -ENONET; } + if (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Roaming in progress, hence return ", __func__); + return -ENONET; + } + halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter); wlan_hdd_get_snr(pAdapter, &snr); wlan_hdd_get_rssi(pAdapter, &rssi); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_DUMP_SURVEY, + pAdapter->sessionId, pAdapter->device_mode)); sme_GetOperationChannel(halHandle, &channel, pAdapter->sessionId); hdd_wlan_get_freq(channel, &freq); @@ -14996,6 +16884,7 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, return -ENONET; } + EXIT(); return 0; } @@ -15026,27 +16915,13 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) ENTER(); - if ( NULL == pHddCtx ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: HddCtx validation failed", __func__); - return 0; - } - - if (pHddCtx->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: LOGP in Progress. Ignore!!!", __func__); - return 0; - } - - if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx)) + if (0 != wlan_hdd_validate_context(pHddCtx)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return 0; } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_RESUME_WLAN, + NO_SESSION, pHddCtx->isWiphySuspended)); spin_lock(&pHddCtx->schedScan_lock); pHddCtx->isWiphySuspended = FALSE; if (TRUE != pHddCtx->isSchedScanUpdatePending) @@ -15060,7 +16935,6 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) pHddCtx->isSchedScanUpdatePending = FALSE; spin_unlock(&pHddCtx->schedScan_lock); - status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) @@ -15081,13 +16955,15 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) * results in app's is in suspended state and not able to * process the connect request to AP */ - hdd_prevent_suspend_timeout(2000); + hdd_prevent_suspend_timeout(2000, + WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN); cfg80211_sched_scan_results(pHddCtx->wiphy); } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s : cfg80211 scan result database updated", __func__); + EXIT(); return 0; } @@ -15097,6 +16973,7 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Failed to find Adapter", __func__); + EXIT(); return 0; } @@ -15119,15 +16996,20 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, struct cfg80211_wowlan *wow) { hdd_context_t *pHddCtx = wiphy_priv(wiphy); + int ret = 0; ENTER(); - if (NULL == pHddCtx) + + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: HddCtx validation failed", __func__); - return 0; + return ret; } + + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN, + NO_SESSION, pHddCtx->isWiphySuspended)); pHddCtx->isWiphySuspended = TRUE; EXIT(); diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_debugfs.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_debugfs.c index 52b6a61074e6..b53edcc3be58 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_debugfs.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_debugfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -28,28 +28,36 @@ #ifdef WLAN_OPEN_SOURCE #include #include +#include #define MAX_USER_COMMAND_SIZE_WOWL_ENABLE 8 #define MAX_USER_COMMAND_SIZE_WOWL_PATTERN 512 #define MAX_USER_COMMAND_SIZE_FRAME 4096 -static ssize_t wcnss_wowenable_write(struct file *file, +static ssize_t __wcnss_wowenable_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - hdd_adapter_t *pAdapter = (hdd_adapter_t *)file->private_data; - + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; char cmd[MAX_USER_COMMAND_SIZE_WOWL_ENABLE + 1]; char *sptr, *token; v_U8_t wow_enable = 0; v_U8_t wow_mp = 0; v_U8_t wow_pbm = 0; + ENTER(); + + pAdapter = (hdd_adapter_t *)file->private_data; if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Invalid adapter or adapter has invalid magic.", __func__); - + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != wlan_hdd_validate_context(pHddCtx)) + { return -EINVAL; } @@ -122,15 +130,27 @@ static ssize_t wcnss_wowenable_write(struct file *file, return -EFAULT; } - + EXIT(); return count; } -static ssize_t wcnss_wowpattern_write(struct file *file, +static ssize_t wcnss_wowenable_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - hdd_adapter_t *pAdapter = (hdd_adapter_t *)file->private_data; + ssize_t ret; + vos_ssr_protect(__func__); + ret = __wcnss_wowenable_write(file, buf, count, ppos); + vos_ssr_unprotect(__func__); + + return ret; +} + +static ssize_t __wcnss_wowpattern_write(struct file *file, + const char __user *buf, size_t count, loff_t *ppos) +{ + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; char cmd[MAX_USER_COMMAND_SIZE_WOWL_PATTERN + 1]; char *sptr, *token; v_U8_t pattern_idx = 0; @@ -138,6 +158,9 @@ static ssize_t wcnss_wowpattern_write(struct file *file, char *pattern_buf; char *pattern_mask; + ENTER(); + + pAdapter = (hdd_adapter_t *)file->private_data; if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -146,7 +169,11 @@ static ssize_t wcnss_wowpattern_write(struct file *file, return -EINVAL; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != wlan_hdd_validate_context(pHddCtx)) + { + return -EINVAL; + } if (!sme_IsFeatureSupportedByFW(WOW)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -209,18 +236,29 @@ static ssize_t wcnss_wowpattern_write(struct file *file, hdd_add_wowl_ptrn_debugfs(pAdapter, pattern_idx, pattern_offset, pattern_buf, pattern_mask); - + EXIT(); return count; } -static ssize_t wcnss_patterngen_write(struct file *file, +static ssize_t wcnss_wowpattern_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - hdd_adapter_t *pAdapter = (hdd_adapter_t *)file->private_data; + ssize_t ret; + + vos_ssr_protect(__func__); + ret = __wcnss_wowpattern_write(file, buf, count, ppos); + vos_ssr_unprotect(__func__); + + return ret; +} + +static ssize_t __wcnss_patterngen_write(struct file *file, + const char __user *buf, size_t count, loff_t *ppos) +{ + hdd_adapter_t *pAdapter; hdd_context_t *pHddCtx; tSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams; tSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams; - char *cmd, *sptr, *token; v_U8_t pattern_idx = 0; v_U8_t pattern_duration = 0; @@ -228,6 +266,9 @@ static ssize_t wcnss_patterngen_write(struct file *file, v_U16_t pattern_len = 0; v_U16_t i = 0; + ENTER(); + + pAdapter = (hdd_adapter_t *)file->private_data; if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -236,8 +277,11 @@ static ssize_t wcnss_patterngen_write(struct file *file, return -EINVAL; } - pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != wlan_hdd_validate_context(pHddCtx)) + { + return -EINVAL; + } if (!sme_IsFeatureSupportedByFW(WLAN_PERIODIC_TX_PTRN)) { @@ -411,6 +455,7 @@ static ssize_t wcnss_patterngen_write(struct file *file, vos_mem_free(addPeriodicTxPtrnParams); vos_mem_free(cmd); + EXIT(); return count; failure: @@ -418,16 +463,59 @@ static ssize_t wcnss_patterngen_write(struct file *file, return -EINVAL; } -static int wcnss_debugfs_open(struct inode *inode, struct file *file) +static ssize_t wcnss_patterngen_write(struct file *file, + const char __user *buf, size_t count, loff_t *ppos) +{ + ssize_t ret; + + vos_ssr_protect(__func__); + ret = __wcnss_patterngen_write(file, buf, count, ppos); + vos_ssr_unprotect(__func__); + + return ret; + +} + +static int __wcnss_debugfs_open(struct inode *inode, struct file *file) { + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + + ENTER(); + + pAdapter = (hdd_adapter_t *)file->private_data; + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: Invalid adapter or adapter has invalid magic.", + __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != wlan_hdd_validate_context(pHddCtx)) + { + return -EINVAL; + } + if (inode->i_private) { file->private_data = inode->i_private; } - + EXIT(); return 0; } +static int wcnss_debugfs_open(struct inode *inode, struct file *file) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wcnss_debugfs_open(inode, file); + vos_ssr_unprotect(__func__); + + return ret; +} + static const struct file_operations fops_wowenable = { .write = wcnss_wowenable_write, .open = wcnss_debugfs_open, diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c index 4b842737e8ec..7dcc821a2f74 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -47,6 +47,7 @@ * Include Files * -------------------------------------------------------------------------*/ #include +#include #ifdef ANI_BUS_TYPE_PLATFORM #include #else @@ -107,6 +108,7 @@ static bool suspend_notify_sent; static int wlan_suspend(hdd_context_t* pHddCtx) { long rc = 0; + VOS_STATUS status = VOS_STATUS_SUCCESS; pVosSchedContext vosSchedContext = NULL; @@ -117,10 +119,36 @@ static int wlan_suspend(hdd_context_t* pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Global VOS_SCHED context is Null",__func__); return 0; } - if(!vos_is_apps_power_collapse_allowed(pHddCtx)) + + if (!pHddCtx->last_suspend_success) + pHddCtx->last_suspend_success = vos_timer_get_system_time(); + + if (!vos_is_apps_power_collapse_allowed(pHddCtx)) { /* Fail this suspend */ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Fail wlan suspend: not in IMPS/BMPS", __func__); + pHddCtx->continuous_suspend_fail_cnt++; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Fail wlan suspend: not in IMPS/BMPS, continuous Failcnt %d"), + pHddCtx->continuous_suspend_fail_cnt); + + /* + * call vos_wlanRestart() if power collapse fails for + * WLAN_POWER_COLLAPSE_FAIL_THRESHOLD time. + */ + if ((vos_timer_get_system_time() - pHddCtx->last_suspend_success) >= + WLAN_POWER_COLLAPSE_FAIL_THRESHOLD) + { + pHddCtx->last_suspend_success = 0; + + if (!(vos_isLoadUnloadInProgress() || + vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) + { + pHddCtx->continuous_suspend_fail_cnt = 0; + status = vos_wlanRestart(); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Triggering SSR, SSR status = %d"),status); + } + } return -EPERM; } @@ -132,7 +160,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) INIT_COMPLETION(pHddCtx->tx_sus_event_var); /* Indicate Tx Thread to Suspend */ - set_bit(TX_SUSPEND_EVENT_MASK, &vosSchedContext->txEventFlag); + set_bit(TX_SUSPEND_EVENT, &vosSchedContext->txEventFlag); wake_up_interruptible(&vosSchedContext->txWaitQueue); @@ -150,7 +178,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) * Thread then it means it is going to suspend, so do not return failure * from here. */ - if (!test_and_clear_bit(TX_SUSPEND_EVENT_MASK, + if (!test_and_clear_bit(TX_SUSPEND_EVENT, &vosSchedContext->txEventFlag)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -158,6 +186,24 @@ static int wlan_suspend(hdd_context_t* pHddCtx) goto tx_suspend; } + /* + * call vos_wlanRestart() if suspend for + * WLAN_POWER_COLLAPSE_FAIL_THRESHOLD time. + */ + if ((vos_timer_get_system_time() - pHddCtx->last_suspend_success) >= + WLAN_POWER_COLLAPSE_FAIL_THRESHOLD) + { + pHddCtx->last_suspend_success = 0; + + if (!(vos_isLoadUnloadInProgress() || + vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) + { + status = vos_wlanRestart(); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Triggering SSR, SSR status = %d"),status); + pHddCtx->continuous_suspend_fail_cnt = 0; + } + } return -ETIME; } @@ -168,7 +214,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) INIT_COMPLETION(pHddCtx->rx_sus_event_var); /* Indicate Rx Thread to Suspend */ - set_bit(RX_SUSPEND_EVENT_MASK, &vosSchedContext->rxEventFlag); + set_bit(RX_SUSPEND_EVENT, &vosSchedContext->rxEventFlag); wake_up_interruptible(&vosSchedContext->rxWaitQueue); @@ -185,7 +231,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) * Thread then it means it is going to suspend, so do not return failure * from here. */ - if (!test_and_clear_bit(RX_SUSPEND_EVENT_MASK, + if (!test_and_clear_bit(RX_SUSPEND_EVENT, &vosSchedContext->rxEventFlag)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -199,6 +245,25 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Set the Tx Thread as Resumed */ pHddCtx->isTxThreadSuspended = FALSE; + /* + * call vos_wlanRestart() if suspend for + * WLAN_POWER_COLLAPSE_FAIL_THRESHOLD time. + */ + if ((vos_timer_get_system_time() - pHddCtx->last_suspend_success) >= + WLAN_POWER_COLLAPSE_FAIL_THRESHOLD) + { + pHddCtx->last_suspend_success = 0; + + if (!(vos_isLoadUnloadInProgress() || + vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) + { + status = vos_wlanRestart(); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Triggering SSR, SSR status = %d"),status); + pHddCtx->continuous_suspend_fail_cnt = 0; + } + } + return -ETIME; } @@ -209,14 +274,15 @@ static int wlan_suspend(hdd_context_t* pHddCtx) INIT_COMPLETION(pHddCtx->mc_sus_event_var); /* Indicate MC Thread to Suspend */ - set_bit(MC_SUSPEND_EVENT_MASK, &vosSchedContext->mcEventFlag); + set_bit(MC_SUSPEND_EVENT, &vosSchedContext->mcEventFlag); wake_up_interruptible(&vosSchedContext->mcWaitQueue); /* Wait for Suspend Confirmation from MC Thread */ - rc = wait_for_completion_interruptible_timeout(&pHddCtx->mc_sus_event_var, msecs_to_jiffies(200)); + rc = wait_for_completion_interruptible_timeout(&pHddCtx->mc_sus_event_var, + msecs_to_jiffies(200)); - if(!rc) + if (rc <= 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: MC Thread: timeout while suspending %ld", @@ -227,7 +293,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) * Thread then it means it is going to suspend, so do not return failure * from here. */ - if (!test_and_clear_bit(MC_SUSPEND_EVENT_MASK, + if (!test_and_clear_bit(MC_SUSPEND_EVENT, &vosSchedContext->mcEventFlag)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -247,6 +313,25 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Set the Tx Thread as Resumed */ pHddCtx->isTxThreadSuspended = FALSE; + /* + * call vos_wlanRestart() if suspend for + * WLAN_POWER_COLLAPSE_FAIL_THRESHOLD time. + */ + if ((vos_timer_get_system_time() - pHddCtx->last_suspend_success) >= + WLAN_POWER_COLLAPSE_FAIL_THRESHOLD) + { + pHddCtx->last_suspend_success = 0; + + if (!(vos_isLoadUnloadInProgress() || + vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) + { + status = vos_wlanRestart(); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Triggering SSR, SSR status = %d"),status); + pHddCtx->continuous_suspend_fail_cnt = 0; + } + } + return -ETIME; } @@ -256,6 +341,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Set the Station state as Suspended */ pHddCtx->isWlanSuspended = TRUE; + pHddCtx->last_suspend_success = 0; return 0; } @@ -321,21 +407,21 @@ static void wlan_resume(hdd_context_t* pHddCtx) @return None ----------------------------------------------------------------------------*/ -int hddDevSuspendHdlr(struct device *dev) +int __hddDevSuspendHdlr(struct device *dev) { int ret = 0; hdd_context_t* pHddCtx = NULL; - pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); + ENTER(); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: WLAN suspended by platform driver",__func__); + pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); /* Get the HDD context */ - if(!pHddCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: HDD context is Null",__func__); - return 0; + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } - if(pHddCtx->isWlanSuspended == TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in suspended state",__func__); @@ -357,9 +443,21 @@ int hddDevSuspendHdlr(struct device *dev) suspend_notify_sent = true; } #endif + + EXIT(); return 0; } +int hddDevSuspendHdlr(struct device *dev) +{ + int ret; + vos_ssr_protect(__func__); + ret = __hddDevSuspendHdlr(dev); + vos_ssr_unprotect(__func__); + + return ret; +} + /*---------------------------------------------------------------------------- @brief Function to resume the wlan driver. @@ -371,14 +469,19 @@ int hddDevSuspendHdlr(struct device *dev) @return None ----------------------------------------------------------------------------*/ -int hddDevResumeHdlr(struct device *dev) +int __hddDevResumeHdlr(struct device *dev) { hdd_context_t* pHddCtx = NULL; + int ret = 0; - pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); - - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed by Android OS",__func__); + ENTER(); + pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } if(pHddCtx->isWlanSuspended != TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in resumed state",__func__); @@ -394,10 +497,21 @@ int hddDevResumeHdlr(struct device *dev) suspend_notify_sent = false; } #endif - + EXIT(); return 0; } +int hddDevResumeHdlr(struct device *dev) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hddDevResumeHdlr(dev); + vos_ssr_unprotect(__func__); + + return ret; +} + static const struct dev_pm_ops pm_ops = { .suspend = hddDevSuspendHdlr, .resume = hddDevResumeHdlr, @@ -419,10 +533,7 @@ static const struct dev_pm_ops pm_ops = { ----------------------------------------------------------------------------*/ VOS_STATUS hddRegisterPmOps(hdd_context_t *pHddCtx) { - wcnss_wlan_set_drvdata(pHddCtx->parent_dev, pHddCtx); -#ifndef FEATURE_R33D wcnss_wlan_register_pm_ops(pHddCtx->parent_dev, &pm_ops); -#endif /* FEATURE_R33D */ return VOS_STATUS_SUCCESS; } @@ -441,9 +552,7 @@ VOS_STATUS hddRegisterPmOps(hdd_context_t *pHddCtx) ----------------------------------------------------------------------------*/ VOS_STATUS hddDeregisterPmOps(hdd_context_t *pHddCtx) { -#ifndef FEATURE_R33D wcnss_wlan_unregister_pm_ops(pHddCtx->parent_dev, &pm_ops); -#endif /* FEATURE_R33D */ return VOS_STATUS_SUCCESS; } @@ -462,21 +571,19 @@ void hddDevTmTxBlockTimeoutHandler(void *usrData) { hdd_context_t *pHddCtx = (hdd_context_t *)usrData; hdd_adapter_t *staAdapater; - /* Sanity, This should not happen */ - if(NULL == pHddCtx) + + ENTER(); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, - "%s: NULL Context", __func__); - VOS_ASSERT(0); - return; + return; } staAdapater = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); - if(NULL == staAdapater) + if ((NULL == staAdapater) || (WLAN_HDD_ADAPTER_MAGIC != staAdapater->magic)) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, - "%s: NULL Adapter", __func__); + FL("invalid Adapter %pK"), staAdapater); VOS_ASSERT(0); return; } @@ -490,11 +597,12 @@ void hddDevTmTxBlockTimeoutHandler(void *usrData) pHddCtx->tmInfo.txFrameCount = 0; /* Resume TX flow */ - + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_wake_all_queues(staAdapater->dev); pHddCtx->tmInfo.qBlocked = VOS_FALSE; mutex_unlock(&pHddCtx->tmInfo.tmOperationLock); + EXIT(); return; } diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dp_utils.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dp_utils.c index b1a9ecf602b9..7a18c4e773d8 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dp_utils.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_dp_utils.c @@ -31,9 +31,6 @@ \brief Utility functions for data path module Description... - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==============================================================================**/ /* $HEADER$ */ diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c index d90d807815d3..e2aec64beadd 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -31,9 +31,6 @@ * \brief power management functions * * Description -* Copyright 2009 (c) Qualcomm, Incorporated. -* All Rights Reserved. -* Qualcomm Confidential and Proprietary. * ==============================================================================**/ /* $HEADER$ */ @@ -66,6 +63,7 @@ #include #include #include "cfgApi.h" +#include #ifdef WLAN_BTAMP_FEATURE #include "bapApi.h" @@ -311,6 +309,7 @@ VOS_STATUS hdd_enter_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) long ret; //Stop the Interface TX queue. + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); @@ -374,6 +373,7 @@ VOS_STATUS hdd_enter_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: vos_stop return failed %d", __func__, vosStatus); VOS_ASSERT(0); + VOS_BUG(0); } pHddCtx->hdd_ps_state = eHDD_SUSPEND_DEEP_SLEEP; @@ -413,6 +413,7 @@ VOS_STATUS hdd_exit_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Failed in vos_start",__func__); + VOS_BUG(0); goto err_deep_sleep; } @@ -454,20 +455,24 @@ VOS_STATUS hdd_exit_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) } -void hdd_ipv6_notifier_work_queue(struct work_struct *work) +void __hdd_ipv6_notifier_work_queue(struct work_struct *work) { hdd_adapter_t* pAdapter = container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue); hdd_context_t *pHddCtx; int status; - hddLog(LOG1, FL("Reconfiguring NS Offload")); + ENTER(); + if (NULL == pAdapter) + { + hddLog(LOGE, FL("Adapter is invalid")); + return; + } pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(LOGE, FL("HDD context is invalid")); return; } @@ -500,12 +505,16 @@ void hdd_ipv6_notifier_work_queue(struct work_struct *work) */ wlan_hdd_set_mc_addr_list(pAdapter, TRUE); #endif - - + EXIT(); } - -int wlan_hdd_ipv6_changed(struct notifier_block *nb, +void hdd_ipv6_notifier_work_queue(struct work_struct *work) +{ + vos_ssr_protect(__func__); + __hdd_ipv6_notifier_work_queue(work); + vos_ssr_unprotect(__func__); +} +int __wlan_hdd_ipv6_changed(struct notifier_block *nb, unsigned long data, void *arg) { struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)arg; @@ -515,11 +524,11 @@ int wlan_hdd_ipv6_changed(struct notifier_block *nb, VOS_STATUS vos_status; int status; + ENTER(); pHddCtx = container_of(nb, hdd_context_t, ipv6_notifier); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(LOGE, FL("HDD context is invalid")); return NOTIFY_DONE; } @@ -545,10 +554,20 @@ int wlan_hdd_ipv6_changed(struct notifier_block *nb, vos_status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); pAdapterNode = pNext; } - + EXIT(); return NOTIFY_DONE; } +int wlan_hdd_ipv6_changed(struct notifier_block *nb, + unsigned long data, void *arg) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_ipv6_changed( nb, data, arg); + vos_ssr_unprotect(__func__); + return ret; +} + /* * Function: hdd_conf_hostoffload * Central function to configure the supported offloads, @@ -708,11 +727,8 @@ void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, int fenable) pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); - if (0 != ret) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid")); return; } @@ -929,23 +945,28 @@ void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, int fenable) { vos_mem_free(selfIPv6AddrValid); } + EXIT(); return; } #endif -void hdd_ipv4_notifier_work_queue(struct work_struct *work) +void __hdd_ipv4_notifier_work_queue(struct work_struct *work) { hdd_adapter_t* pAdapter = container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue); hdd_context_t *pHddCtx; int status; - hddLog(LOG1, FL("Reconfiguring ARP Offload")); + ENTER(); + if (NULL == pAdapter) + { + hddLog(LOGE, FL("Adapter is invalid")); + return; + } pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(LOGE, FL("HDD context is invalid")); return; } @@ -967,9 +988,17 @@ void hdd_ipv4_notifier_work_queue(struct work_struct *work) // of IPv4 notifier again. hdd_conf_arp_offload(pAdapter, 2); } + EXIT(); } -int wlan_hdd_ipv4_changed(struct notifier_block *nb, +void hdd_ipv4_notifier_work_queue(struct work_struct *work) +{ + vos_ssr_protect(__func__); + __hdd_ipv4_notifier_work_queue(work); + vos_ssr_unprotect(__func__); +} + +int __wlan_hdd_ipv4_changed(struct notifier_block *nb, unsigned long data, void *arg) { struct in_ifaddr *ifa = (struct in_ifaddr *)arg; @@ -982,11 +1011,11 @@ int wlan_hdd_ipv4_changed(struct notifier_block *nb, VOS_STATUS vos_status; int status; + ENTER(); pHddCtx = container_of(nb, hdd_context_t, ipv4_notifier); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(LOGE, FL("HDD context is invalid")); return NOTIFY_DONE; } @@ -1029,10 +1058,20 @@ int wlan_hdd_ipv4_changed(struct notifier_block *nb, vos_status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); pAdapterNode = pNext; } - + EXIT(); return NOTIFY_DONE; } +int wlan_hdd_ipv4_changed(struct notifier_block *nb, + unsigned long data, void *arg) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_ipv4_changed( nb, data, arg); + vos_ssr_unprotect(__func__); + return ret; +} + /**---------------------------------------------------------------------------- \brief hdd_conf_arp_offload() - Configure ARP offload @@ -1058,7 +1097,7 @@ VOS_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, int fenable) tSirHostOffloadReq offLoadRequest; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hddLog(VOS_TRACE_LEVEL_INFO, FL(" fenable = %d \n"), fenable); + hddLog(VOS_TRACE_LEVEL_INFO, FL(" fenable = %d "), fenable); if(fenable) { @@ -1163,6 +1202,7 @@ void hdd_mcbc_filter_modification(hdd_context_t* pHddCtx, * disable Broadcast filtering, Anding with the negation * of Broadcast BIT */ + hddLog(VOS_TRACE_LEVEL_INFO, FL(" ARP offload is enabled")); *pMcBcFilter &= ~(HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST); } @@ -1174,6 +1214,7 @@ void hdd_mcbc_filter_modification(hdd_context_t* pHddCtx, * disable Multicast filtering, Anding with the negation * of Multicast BIT */ + hddLog(VOS_TRACE_LEVEL_INFO, FL(" NS offload is enabled")); *pMcBcFilter &= ~(HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST); } #endif @@ -1191,7 +1232,7 @@ void hdd_conf_mcastbcast_filter(hdd_context_t* pHddCtx, v_BOOL_t setfilter) eHalStatus halStatus = eHAL_STATUS_FAILURE; tpSirWlanSetRxpFilters wlanRxpFilterParam = vos_mem_malloc(sizeof(tSirWlanSetRxpFilters)); - if(NULL == wlanRxpFilterParam) + if (NULL == wlanRxpFilterParam) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_mem_alloc failed ", __func__); @@ -1213,10 +1254,22 @@ void hdd_conf_mcastbcast_filter(hdd_context_t* pHddCtx, v_BOOL_t setfilter) wlanRxpFilterParam->setMcstBcstFilter = setfilter; halStatus = sme_ConfigureRxpFilter(pHddCtx->hHal, wlanRxpFilterParam); + + if (setfilter && (eHAL_STATUS_SUCCESS == halStatus)) + { + pHddCtx->hdd_mcastbcast_filter_set = TRUE; + } + + hddLog(VOS_TRACE_LEVEL_INFO, "%s to post set/reset filter to" + "lower mac with status %d" + "configuredMcstBcstFilterSetting = %d" + "setMcstBcstFilter = %d",(eHAL_STATUS_SUCCESS != halStatus) ? + "Failed" : "Success", halStatus, + wlanRxpFilterParam->configuredMcstBcstFilterSetting, + wlanRxpFilterParam->setMcstBcstFilter); + if (eHAL_STATUS_SUCCESS != halStatus) vos_mem_free(wlanRxpFilterParam); - if(setfilter && (eHAL_STATUS_SUCCESS == halStatus)) - pHddCtx->hdd_mcastbcast_filter_set = TRUE; } static void hdd_conf_suspend_ind(hdd_context_t* pHddCtx, @@ -1373,6 +1426,13 @@ void hdd_suspend_wlan(void) return; } + if (pHddCtx->hdd_wlan_suspended) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Ignore suspend wlan, Already suspended!", __func__); + return; + } + pHddCtx->hdd_wlan_suspended = TRUE; hdd_set_pwrparams(pHddCtx); status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); @@ -1408,6 +1468,7 @@ void hdd_suspend_wlan(void) if (pHddCtx->cfg_ini->nEnableSuspend == WLAN_MAP_SUSPEND_TO_STANDBY) { //stop the interface before putting the chip to standby + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); } @@ -1666,6 +1727,13 @@ void hdd_resume_wlan(void) return; } + if (!pHddCtx->hdd_wlan_suspended) + { + hddLog(VOS_TRACE_LEVEL_INFO, + "%s: Ignore resume wlan, Already resumed!", __func__); + return; + } + pHddCtx->hdd_wlan_suspended = FALSE; /*loop through all adapters. Concurrency */ status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); @@ -1758,7 +1826,7 @@ VOS_STATUS hdd_wlan_reset_initialization(void) hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Preventing the phone from going to suspend",__func__); // Prevent the phone from going to sleep - hdd_prevent_suspend(); + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); return VOS_STATUS_SUCCESS; } @@ -1896,22 +1964,22 @@ VOS_STATUS hdd_wlan_shutdown(void) */ /* Wait for MC to exit */ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Shutting down MC thread",__func__); - set_bit(MC_SHUTDOWN_EVENT_MASK, &vosSchedContext->mcEventFlag); - set_bit(MC_POST_EVENT_MASK, &vosSchedContext->mcEventFlag); + set_bit(MC_SHUTDOWN_EVENT, &vosSchedContext->mcEventFlag); + set_bit(MC_POST_EVENT, &vosSchedContext->mcEventFlag); wake_up_interruptible(&vosSchedContext->mcWaitQueue); wait_for_completion(&vosSchedContext->McShutdown); /* Wait for TX to exit */ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Shutting down TX thread",__func__); - set_bit(TX_SHUTDOWN_EVENT_MASK, &vosSchedContext->txEventFlag); - set_bit(TX_POST_EVENT_MASK, &vosSchedContext->txEventFlag); + set_bit(TX_SHUTDOWN_EVENT, &vosSchedContext->txEventFlag); + set_bit(TX_POST_EVENT, &vosSchedContext->txEventFlag); wake_up_interruptible(&vosSchedContext->txWaitQueue); wait_for_completion(&vosSchedContext->TxShutdown); /* Wait for RX to exit */ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Shutting down RX thread",__func__); - set_bit(RX_SHUTDOWN_EVENT_MASK, &vosSchedContext->rxEventFlag); - set_bit(RX_POST_EVENT_MASK, &vosSchedContext->rxEventFlag); + set_bit(RX_SHUTDOWN_EVENT, &vosSchedContext->rxEventFlag); + set_bit(RX_POST_EVENT, &vosSchedContext->rxEventFlag); wake_up_interruptible(&vosSchedContext->rxWaitQueue); wait_for_completion(&vosSchedContext->RxShutdown); @@ -1970,6 +2038,9 @@ VOS_STATUS hdd_wlan_shutdown(void) vos_sched_flush_mc_mqs(vosSchedContext); vos_sched_flush_tx_mqs(vosSchedContext); vos_sched_flush_rx_mqs(vosSchedContext); +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + wlan_logging_flush_pkt_queue(); +#endif /* Deinit all the TX and MC queues */ vos_sched_deinit_mqs(vosSchedContext); @@ -2016,7 +2087,7 @@ VOS_STATUS hdd_wlan_re_init(void) struct device *dev = NULL; hdd_ssr_timer_del(); - hdd_prevent_suspend(); + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); #ifdef HAVE_WCNSS_CAL_DOWNLOAD /* wait until WCNSS driver downloads NV */ @@ -2117,6 +2188,7 @@ VOS_STATUS hdd_wlan_re_init(void) if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_start failed",__func__); + VOS_BUG(0); goto err_vosclose; } @@ -2170,8 +2242,6 @@ VOS_STATUS hdd_wlan_re_init(void) /* Restart all adapters */ hdd_start_all_adapters(pHddCtx); - pHddCtx->isLogpInProgress = FALSE; - vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); pHddCtx->hdd_mcastbcast_filter_set = FALSE; pHddCtx->btCoexModeSet = FALSE; hdd_register_mcast_bcast_filter(pHddCtx); @@ -2183,8 +2253,19 @@ VOS_STATUS hdd_wlan_re_init(void) hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hddRegisterPmOps failed",__func__); goto err_bap_stop; } + +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + if (pHddCtx->cfg_ini->wlanLoggingEnable && + (pHddCtx->cfg_ini->enableFWLogging || + pHddCtx->cfg_ini->enableMgmtLogging || + pHddCtx->cfg_ini->enableContFWLogging)) + { + hdd_init_frame_logging(pHddCtx); + } +#endif + /* Allow the phone to go to sleep */ - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); /* register for riva power on lock */ if (req_riva_power_on_lock("wlan")) { @@ -2193,6 +2274,9 @@ VOS_STATUS hdd_wlan_re_init(void) goto err_unregister_pmops; } vos_set_reinit_in_progress(VOS_MODULE_ID_VOSS, FALSE); + + sme_register_mgmt_frame_ind_callback(pHddCtx->hHal,hdd_indicate_mgmt_frame); + #ifdef WLAN_FEATURE_EXTSCAN sme_EXTScanRegisterCallback(pHddCtx->hHal, wlan_hdd_cfg80211_extscan_callback, @@ -2226,8 +2310,6 @@ VOS_STATUS hdd_wlan_re_init(void) /* If we hit this, it means wlan driver is in bad state and needs * driver unload and load. */ - if (pHddCtx) - pHddCtx->isLogpInProgress = FALSE; vos_set_reinit_in_progress(VOS_MODULE_ID_VOSS, FALSE); return VOS_STATUS_E_FAILURE; } @@ -2250,6 +2332,7 @@ VOS_STATUS hdd_wlan_re_init(void) pHddCtx->cfg_ini= NULL; wiphy_unregister(pHddCtx->wiphy); + hdd_wlan_free_wiphy_channels(pHddCtx->wiphy); wiphy_free(pHddCtx->wiphy); } vos_preClose(&pVosContext); @@ -2260,7 +2343,7 @@ VOS_STATUS hdd_wlan_re_init(void) err_re_init: /* Allow the phone to go to sleep */ - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); vos_set_reinit_in_progress(VOS_MODULE_ID_VOSS, FALSE); VOS_BUG(0); return -EPERM; diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_ftm.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_ftm.c index c0250eafc4cb..cbe31d01277e 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_ftm.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_ftm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,9 +31,6 @@ \brief This file contains the WLAN factory test mode implementation - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -89,19 +86,13 @@ #define FTM_CHAIN_SEL_R0_ON 1 #define FTM_CHAIN_SEL_T0_ON 2 #define FTM_CHAIN_SEL_R0_T0_ON 3 -#define FTM_CHAIN_SEL_MAX 3 +#define FTM_CHAIN_SEL_ANTENNA_0 7 +#define FTM_CHAIN_SEL_ANTENNA_1 8 +#define FTM_CHAIN_SEL_MAX 8 #define WCNSS_TXFIR_OFFSET 0x00018000 -#ifndef QWLAN_PHYDBG_BASE -#define QWLAN_PHYDBG_BASE 0x03004000 -#endif /* QWLAN_PHYDBG_BASE */ - -#ifndef QWLAN_PHYDBG_TXPKT_CNT_REG -#define QWLAN_PHYDBG_TXPKT_CNT_REG (QWLAN_PHYDBG_BASE + 0x6C) #define QWLAN_PHYDBG_TXPKT_CNT_CNT_MASK 0xFFFF -#endif - #ifndef QWLAN_AGC_CHANNEL_FREQ_REG_OFFSET #define QWLAN_AGC_CHANNEL_FREQ_REG_OFFSET 0x00013c34 @@ -109,26 +100,6 @@ #endif /* QWLAN_AGC_CHANNEL_FREQ_REG_OFFSET */ -#ifndef QWLAN_RFAPB_BASE -#define QWLAN_RFAPB_BASE 0x0E02F800 -#endif /* QWLAN_RFAPB_BASE */ - -#ifndef QWLAN_RFAPB_REV_ID_REG -#define QWLAN_RFAPB_REV_ID_REG (QWLAN_RFAPB_BASE + 0x00) -#endif /* QWLAN_RFAPB_REV_ID_REG */ - -#ifndef QWLAN_TXCTL_BASE -#define QWLAN_TXCTL_BASE 0x03012000 -#endif /* QWLAN_TXCTL_BASE */ - -#ifndef QWLAN_TXCTL_FSHIFT_REG -#define QWLAN_TXCTL_FSHIFT_REG (QWLAN_TXCTL_BASE + 0x20) -#define QWLAN_TXCTL_FSHIFT_BW14_OFFSET 0x02 -#define QWLAN_TXCTL_FSHIFT_BW14_MASK 0x1C -#define QWLAN_TXCTL_FSHIFT_BW12_OFFSET 0x00 -#define QWLAN_TXCTL_FSHIFT_BW12_MASK 0x03 -#endif /* QWLAN_TXCTL_FSHIFT_REG */ - /* To set 4MAC addresses from given first MAC address, * Last byte value within given MAC address must less than 0xFF - 3 */ #define QWLAN_MAX_MAC_LAST_BYTE_VALUE 0xFC @@ -156,15 +127,6 @@ static int wlan_ftm_register_wext(hdd_adapter_t *pAdapter); static int wlan_ftm_stop(hdd_context_t *pHddCtx); VOS_STATUS wlan_write_to_efs (v_U8_t *pData, v_U16_t data_len); -/* for PRIMA: all the available frequency, channal pair i the table are defined for channel frequency @ RF center frequency - Since it is associated to agc.channel_freq register for mapping. - For channel bonding, the channel number is +2 or -2 for CB with primary high, or with primary low respectively. -*/ -static const freq_chan_t freq_chan_tbl[] = { - {2412, 1}, {2417, 2},{2422, 3}, {2427, 4}, {2432, 5}, {2437, 6}, {2442, 7}, - {2447, 8}, {2452, 9},{2457, 10},{2462, 11},{2467 ,12},{2472, 13},{2484, 14} -}; - static rateStr2rateIndex_t rateName_rateIndex_tbl[] = { { HAL_PHY_RATE_11B_LONG_1_MBPS, "11B_LONG_1_MBPS"}, @@ -656,6 +618,15 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_PVOID_t devHandl goto err_probe_event; } + if(vos_event_init(&(gpVosContext->fwLogsComplete)) != VOS_STATUS_SUCCESS ) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Unable to init fwLogsComplete",__func__); + VOS_ASSERT(0); + + goto err_wda_complete_event; + } + /* Initialize the free message queue */ vStatus = vos_mq_init(&gpVosContext->freeVosMq); if (! VOS_IS_STATUS_SUCCESS(vStatus)) @@ -665,7 +636,7 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_PVOID_t devHandl "%s: Failed to initialize VOS free message queue %d", __func__, vStatus); VOS_ASSERT(0); - goto err_wda_complete_event; + goto err_fw_logs_complete_event; } for (iter = 0; iter < VOS_CORE_MAX_MESSAGES; iter++) @@ -787,6 +758,9 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_PVOID_t devHandl err_msg_queue: vos_mq_deinit(&gpVosContext->freeVosMq); +err_fw_logs_complete_event: + vos_event_destroy(&gpVosContext->fwLogsComplete); + err_wda_complete_event: vos_event_destroy(&gpVosContext->wdaCompleteEvent); @@ -851,12 +825,26 @@ static VOS_STATUS wlan_ftm_vos_close( v_CONTEXT_t vosContext ) VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } - vosStatus = WDA_close( vosContext ); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if ( TRUE == WDA_needShutdown(vosContext)) { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to close WDA %d", __func__, vosStatus); - VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + vosStatus = WDA_shutdown(vosContext, VOS_TRUE); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: Failed to shutdown WDA %d", __func__, vosStatus); + VOS_ASSERT(VOS_IS_STATUS_SUCCESS(vosStatus)); + } + + } + else + { + vosStatus = WDA_close(vosContext); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to close WDA %d", __func__, vosStatus); + VOS_ASSERT(VOS_IS_STATUS_SUCCESS(vosStatus)); + } } vos_mq_deinit(&((pVosContextType)vosContext)->freeVosMq); @@ -877,6 +865,14 @@ static VOS_STATUS wlan_ftm_vos_close( v_CONTEXT_t vosContext ) VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } + vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to destroy fwLogsComplete %d", __func__, vosStatus); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + return VOS_STATUS_SUCCESS; } @@ -1024,7 +1020,7 @@ static VOS_STATUS wlan_ftm_priv_set_wfgain(hdd_adapter_t *pAdapter,v_S15_t dGain return VOS_STATUS_E_FAILURE; } - if (rfGain > 31 || rfGain <0) { + if (rfGain > 31) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:rf gain value is invalid", __func__); return VOS_STATUS_E_FAILURE; @@ -1215,6 +1211,14 @@ static VOS_STATUS wlan_ftm_priv_enable_chain(hdd_adapter_t *pAdapter,v_U16_t cha case FTM_CHAIN_SEL_T0_ON: chainSelect = PHY_CHAIN_SEL_T0_ON; break; + + case FTM_CHAIN_SEL_ANTENNA_0: + chainSelect = PHY_CHAIN_SEL_ANT_0; + break; + + case FTM_CHAIN_SEL_ANTENNA_1: + chainSelect = PHY_CHAIN_SEL_ANT_1; + break; } vos_mem_set(pMsgBuf, sizeof(tPttMsgbuffer), 0); @@ -1567,6 +1571,7 @@ int wlan_hdd_ftm_open(hdd_context_t *pHddCtx) } pHddCtx->ftm.ftm_state = WLAN_FTM_INITIALIZED; + init_completion(&pHddCtx->ftm.startCmpVar); return VOS_STATUS_SUCCESS; @@ -1715,6 +1720,8 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) return VOS_STATUS_SUCCESS; } + pHddCtx->ftm.ftm_state = WLAN_FTM_STARTING; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Starting Libra SW", __func__); @@ -1770,6 +1777,7 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) "%s: WDA_NVDownload_Start reporting other error",__func__); } VOS_ASSERT(0); + WDA_setNeedShutdown(pHddCtx->pvosContext); goto err_status_failure; } @@ -1830,6 +1838,7 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) err_status_failure: + pHddCtx->ftm.ftm_state = WLAN_FTM_INITIALIZED; return VOS_STATUS_E_FAILURE; } @@ -3226,6 +3235,7 @@ void wlan_hdd_process_ftm_cmd pVosContextType pVosContext = (pVosContextType)(pHddCtx->pvosContext); int hostState; tPttMsgbuffer *tempRspBuffer = NULL; + static int count; ENTER(); @@ -3261,6 +3271,19 @@ void wlan_hdd_process_ftm_cmd return ; } + if (VOS_FTM_MODE != hdd_get_conparam()) + { + count++; + if (count == 1 || !(count % 10)) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Driver not loaded in FTM" + " mode, current mode: %d ",__func__, hdd_get_conparam()); + } + pHddCtx->ftm.pResponseBuf->ftm_err_code = WLAN_FTM_FAILURE; + wlan_ftm_send_response(pHddCtx); + return ; + } + switch (pRequestBuf->ftmpkt.ftm_cmd_type) { case WLAN_FTM_START: @@ -3279,6 +3302,7 @@ void wlan_hdd_process_ftm_cmd ,__func__); pHddCtx->ftm.pResponseBuf->ftm_err_code = WLAN_FTM_FAILURE; wlan_ftm_send_response(pHddCtx); + complete(&pHddCtx->ftm.startCmpVar); return; } /* Ptt application running on the host PC expects the length to be one byte less that what we have received*/ @@ -3287,7 +3311,7 @@ void wlan_hdd_process_ftm_cmd pHddCtx->ftm.pResponseBuf->ftmpkt.ftm_cmd_type = 0; wlan_ftm_send_response(pHddCtx); - + complete(&pHddCtx->ftm.startCmpVar); break; case WLAN_FTM_STOP: @@ -3517,9 +3541,6 @@ static unsigned int get_primary_channel(unsigned int center_channel,unsigned int { unsigned int primary_channel = center_channel; - if (center_channel <= 14) - return primary_channel ; - switch (cb) { case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: @@ -4311,7 +4332,6 @@ static VOS_STATUS wlan_ftm_priv_get_channel(hdd_adapter_t *pAdapter,v_U16_t *pCh uPttMsgs *pMsgBody; VOS_STATUS status; v_U16_t freq; - v_U8_t indx=0; long ret; hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx; @@ -4378,16 +4398,8 @@ static VOS_STATUS wlan_ftm_priv_get_channel(hdd_adapter_t *pAdapter,v_U16_t *pCh freq = ((v_U16_t)pMsgBody->DbgReadRegister.regValue & QWLAN_AGC_CHANNEL_FREQ_FREQ_MASK); - while ((indx < SIZE_OF_TABLE(freq_chan_tbl)) && (freq != freq_chan_tbl[indx].freq)) - indx++; - if (indx >= SIZE_OF_TABLE(freq_chan_tbl)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:Invalid Frequency!!!",__func__); - status = VOS_STATUS_E_FAILURE; - goto done; - } - - *pChannel = freq_chan_tbl[indx].chan; + *pChannel = vos_freq_to_chan(freq); + (*pChannel) ? (status = VOS_STATUS_SUCCESS) : (status = VOS_STATUS_E_FAILURE); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Channel = %d freq = %d",*pChannel, freq); done: @@ -4460,148 +4472,13 @@ static VOS_STATUS wlan_ftm_priv_get_txpower(hdd_adapter_t *pAdapter,v_U16_t *pTx status = VOS_STATUS_E_FAILURE; goto done; } - *pTxPwr = ((((pMsgBody->GetTxPowerReport.pwrTemplateIndex & 0x1F) + 4)*50)/100); + *pTxPwr = pMsgBody->GetTxPowerReport.pwrTemplateIndex; done: return status; } -/**--------------------------------------------------------------------------- - - \brief wlan_ftm_priv_get_ftm_version() - - - This function gets ftm driver and firmware version. - - \param - pAdapter - Pointer HDD Context. - - pTxRate - Poniter to get the Tx rate. - - \return - 0 for success, non zero for failure - - --------------------------------------------------------------------------*/ - -VOS_STATUS wlan_ftm_priv_get_ftm_version(hdd_adapter_t *pAdapter,char *pftmVer) -{ - uPttMsgs *pMsgBody; - VOS_STATUS status; - v_U32_t reg_val; - char *buf = pftmVer; - hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx; - int lenRes = 0; - int lenBuf = WE_FTM_MAX_STR_LEN; - long ret; - - 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 (NULL == pMsgBuf) - { - 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; - - pMsgBody = &pMsgBuf->msgBody; - pMsgBody->DbgReadRegister.regAddr = QWLAN_RFAPB_REV_ID_REG; - - 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; - - } - ret = wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, - msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT)); - if (0 >= ret ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("wait on ftm_comp_var failed %ld"), ret); - } - - 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; - } - - reg_val = (v_U16_t)pMsgBody->DbgReadRegister.regValue; - - init_completion(&pHddCtx->ftm.ftm_comp_var); - - pMsgBuf->msgId = PTT_MSG_GET_BUILD_RELEASE_NUMBER; - pMsgBuf->msgBodyLength = sizeof(tMsgPttGetBuildReleaseNumber) + PTT_HEADER_LENGTH; - - pMsgBody = &pMsgBuf->msgBody; - - 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; - } - ret = wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, - msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT)); - if (0 >= ret ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("wait on ftm_comp_var failed %ld"), ret); - } - - lenRes = snprintf(buf, lenBuf, "%s_",WLAN_CHIP_VERSION); - if(lenRes < 0 || lenRes >= lenBuf) - { - status = VOS_STATUS_E_FAILURE; - goto done; - } - - buf += lenRes; - lenBuf -= lenRes; - - /*Read the RevID*/ - lenRes = snprintf(buf, lenBuf, "%x.%x-",(v_U8_t)(reg_val >> 8), (v_U8_t)(reg_val &0x000000FF)); - if(lenRes < 0 || lenRes >= lenBuf) - { - status = VOS_STATUS_E_FAILURE; - goto done; - } - - buf += lenRes; - lenBuf -= lenRes; - - lenRes = snprintf(buf, lenBuf, "%s-", QWLAN_VERSIONSTR); - if(lenRes < 0 || lenRes >= lenBuf) - { - status = VOS_STATUS_E_FAILURE; - goto done; - } - - buf += lenRes; - lenBuf -= lenRes; - - -done: - - return status; - -} - /**--------------------------------------------------------------------------- \brief wlan_ftm_priv_get_txrate() - @@ -4618,11 +4495,8 @@ VOS_STATUS wlan_ftm_priv_get_ftm_version(hdd_adapter_t *pAdapter,char *pftmVer) static VOS_STATUS wlan_ftm_priv_get_txrate(hdd_adapter_t *pAdapter,char *pTxRate) { - uPttMsgs *pMsgBody; - VOS_STATUS status; - v_U16_t rate_index,ii; - long ret; - + VOS_STATUS status = VOS_STATUS_SUCCESS; + v_U16_t ii; hdd_context_t *pHddCtx = (hdd_context_t *)pAdapter->pHddCtx; if (pHddCtx->ftm.ftm_state != WLAN_FTM_STARTED) @@ -4632,51 +4506,8 @@ static VOS_STATUS wlan_ftm_priv_get_txrate(hdd_adapter_t *pAdapter,char *pTxRate return VOS_STATUS_E_FAILURE; } - if (NULL == pMsgBuf) - { - 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; - - pMsgBody = &pMsgBuf->msgBody; - - 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; - } - ret = wait_for_completion_interruptible_timeout(&pHddCtx->ftm.ftm_comp_var, - msecs_to_jiffies(WLAN_FTM_COMMAND_TIME_OUT)); - if (0 >= ret ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("wait on ftm_comp_var failed %ld"), ret); - } - - 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__); - status = VOS_STATUS_E_FAILURE; - goto done; - } - for(ii = 0; ii < SIZE_OF_TABLE(rateName_rateIndex_tbl); ii++) { - if(rateName_rateIndex_tbl[ii].rate_index == rate_index) + if(rateName_rateIndex_tbl[ii].rate_index == ftm_status.frameParams.rate) break; } if(ii >= SIZE_OF_TABLE(rateName_rateIndex_tbl)) @@ -4686,8 +4517,8 @@ static VOS_STATUS wlan_ftm_priv_get_txrate(hdd_adapter_t *pAdapter,char *pTxRate goto done; } strlcpy(pTxRate,rateName_rateIndex_tbl[ii].rate_str, WE_FTM_MAX_STR_LEN); -done: +done: return status; } @@ -5021,7 +4852,7 @@ static VOS_STATUS wlan_ftm_priv_set_mac_address(hdd_adapter_t *pAdapter,char *bu } /* set param sub-ioctls */ -static int iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info *info, +static int __iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret,sub_cmd; @@ -5029,8 +4860,18 @@ static int iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info char *param; VOS_STATUS status; hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; struct iw_point s_priv_data; + ENTER(); + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + ret =0; /* helper function to get iwreq_data with compat handling. */ if (hdd_priv_get_data(&s_priv_data, wrqu)) @@ -5044,9 +4885,21 @@ static int iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info return -EINVAL; } + pAdapter = (hdd_adapter_t *)netdev_priv(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } sub_cmd = s_priv_data.flags; length = s_priv_data.length; - pAdapter = (hdd_adapter_t *)netdev_priv(dev); /* we cannot use iotctl_private_iw_point in kernel to allocate memory * to store data from userspace as IW_SETCHAR_GETNONE is defined as @@ -5113,19 +4966,47 @@ static int iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info OUT: kfree(param); + EXIT(); return ret; } -static int iw_ftm_setint_getnone(struct net_device *dev, struct iw_request_info *info, +static int iw_ftm_setchar_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = (netdev_priv(dev)); + int ret; + + vos_ssr_protect(__func__); + ret = __iw_ftm_setchar_getnone(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __iw_ftm_setint_getnone(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int *value = (int *)extra; int sub_cmd = value[0]; int set_value = value[1]; int ret = 0; /* success */ VOS_STATUS status; + ENTER(); + + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } switch(sub_cmd) { case WE_FTM_ON_OFF: @@ -5289,18 +5170,46 @@ static int iw_ftm_setint_getnone(struct net_device *dev, struct iw_request_info } } + EXIT(); return ret; } +static int iw_ftm_setint_getnone(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_ftm_setint_getnone(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} /* get param sub-ioctls */ -static int iw_ftm_setnone_getint(struct net_device *dev, struct iw_request_info *info, +static int __iw_ftm_setnone_getint(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = (netdev_priv(dev)); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int *value = (int *)extra; int ret = 0; /* success */ VOS_STATUS status; + ENTER(); + + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + switch (value[0]) { case WE_GET_CHANNEL: @@ -5343,16 +5252,45 @@ static int iw_ftm_setnone_getint(struct net_device *dev, struct iw_request_info } } + EXIT(); + return ret; +} + +static int iw_ftm_setnone_getint(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_ftm_setnone_getint(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + return ret; } -static int iw_ftm_get_char_setnone(struct net_device *dev, struct iw_request_info *info, +static int __iw_ftm_get_char_setnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int sub_cmd = wrqu->data.flags; VOS_STATUS status; - hdd_adapter_t *pAdapter = (netdev_priv(dev)); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } switch(sub_cmd) { case WE_GET_MAC_ADDRESS: @@ -5380,18 +5318,6 @@ static int iw_ftm_get_char_setnone(struct net_device *dev, struct iw_request_inf wrqu->data.length = strlen(extra)+1; break; } - case WE_GET_FTM_VERSION: - { - status = wlan_ftm_priv_get_ftm_version(pAdapter, extra); - - if(status != VOS_STATUS_SUCCESS) - { - hddLog(VOS_TRACE_LEVEL_FATAL, "wlan_ftm_priv_get_mac_address failed =%d",status); - return -EINVAL; - } - wrqu->data.length = strlen(extra)+1; - break; - } case WE_GET_FTM_STATUS: { status = wlan_ftm_priv_get_status(pAdapter, extra); @@ -5425,9 +5351,23 @@ static int iw_ftm_get_char_setnone(struct net_device *dev, struct iw_request_inf } } + EXIT(); return 0; } +static int iw_ftm_get_char_setnone(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_ftm_get_char_setnone(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + + return ret; +} + VOS_STATUS wlan_write_to_efs (v_U8_t *pData, v_U16_t data_len) { #if defined(MSM_PLATFORM) @@ -5488,7 +5428,7 @@ VOS_STATUS wlan_write_to_efs (v_U8_t *pData, v_U16_t data_len) } /* action sub-ioctls */ -static int iw_ftm_setnone_getnone(struct net_device *dev, struct iw_request_info *info, +static int __iw_ftm_setnone_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int sub_cmd = wrqu->data.flags; @@ -5528,18 +5468,47 @@ static int iw_ftm_setnone_getnone(struct net_device *dev, struct iw_request_info return ret; } -static int iw_ftm_set_var_ints_getnone(struct net_device *dev, struct iw_request_info *info, +static int iw_ftm_setnone_getnone(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_ftm_setnone_getnone(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __iw_ftm_set_var_ints_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = (netdev_priv(dev)); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int sub_cmd = wrqu->data.flags; int *value = (int*)wrqu->data.pointer; + int ret = 0; + + ENTER(); if(wrqu->data.length != 2) { - hddLog(LOGE, "Invalid number of Arguments %d \n", wrqu->data.length); + hddLog(LOGE, "Invalid number of Arguments %d ", wrqu->data.length); + return -EINVAL; + } + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); return -EINVAL; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } switch (sub_cmd) { case WE_SET_TX_WF_GAIN: @@ -5563,15 +5532,35 @@ static int iw_ftm_set_var_ints_getnone(struct net_device *dev, struct iw_request default: { - hddLog(LOGE, "Invalid IOCTL command %d \n", sub_cmd ); + hddLog(LOGE, "Invalid IOCTL command %d ", sub_cmd ); break; } } + EXIT(); return 0; } +static int iw_ftm_set_var_ints_getnone(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + vos_ssr_protect(__func__); + ret = __iw_ftm_set_var_ints_getnone(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + static const iw_handler we_ftm_private[] = { [WLAN_FTM_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_ftm_setint_getnone, //set priv ioctl @@ -5713,11 +5702,6 @@ static const struct iw_priv_args we_ftm_private_args[] = { IW_PRIV_TYPE_CHAR| WE_FTM_MAX_STR_LEN, "get_mac_address" }, - { WE_GET_FTM_VERSION, - 0, - IW_PRIV_TYPE_CHAR| WE_FTM_MAX_STR_LEN, - "ftm_version" }, - { WE_GET_TX_RATE, 0, IW_PRIV_TYPE_CHAR| WE_FTM_MAX_STR_LEN, diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c index 9f40cb3dd3a0..705d1c3236fe 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -30,9 +30,6 @@ \file wlan_hdd_hostapd.c \brief WLAN Host Device Driver implementation - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ /**========================================================================= @@ -61,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +75,11 @@ #include "wlan_nlink_common.h" #include "wlan_btc_svc.h" #include +#include "wlan_hdd_tdls.h" #include "wlan_hdd_p2p.h" #include "cfgApi.h" -#include "wniCfgAp.h" +#include "wniCfg.h" +#include "wlan_hdd_request_manager.h" #ifdef FEATURE_WLAN_CH_AVOID #include "wcnss_wlan.h" @@ -160,7 +160,7 @@ safeChannelType safeChannels[NUM_20MHZ_RF_CHANNELS] = *-------------------------------------------------------------------------*/ /**--------------------------------------------------------------------------- - \brief hdd_hostapd_open() - HDD Open function for hostapd interface + \brief __hdd_hostapd_open() - HDD Open function for hostapd interface This is called in response to ifconfig up @@ -169,7 +169,7 @@ safeChannelType safeChannels[NUM_20MHZ_RF_CHANNELS] = \return - 0 for success non-zero for failure --------------------------------------------------------------------------*/ -int hdd_hostapd_open (struct net_device *dev) +int __hdd_hostapd_open (struct net_device *dev) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -187,15 +187,28 @@ int hdd_hostapd_open (struct net_device *dev) TRACE_CODE_HDD_HOSTAPD_OPEN_REQUEST, NO_SESSION, 0)); //Turn ON carrier state netif_carrier_on(dev); - //Enable all Tx queues + //Enable all Tx queues + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues(dev); - + EXIT(); return 0; } + +int hdd_hostapd_open (struct net_device *dev) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hdd_hostapd_open(dev); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief hdd_hostapd_stop() - HDD stop function for hostapd interface + \brief __hdd_hostapd_stop() - HDD stop function for hostapd interface This is called in response to ifconfig down @@ -204,11 +217,12 @@ int hdd_hostapd_open (struct net_device *dev) \return - 0 for success non-zero for failure --------------------------------------------------------------------------*/ -int hdd_hostapd_stop (struct net_device *dev) +int __hdd_hostapd_stop (struct net_device *dev) { ENTER(); if(NULL != dev) { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); //Stop all tx queues netif_tx_disable(dev); @@ -219,9 +233,21 @@ int hdd_hostapd_stop (struct net_device *dev) EXIT(); return 0; } + +int hdd_hostapd_stop (struct net_device *dev) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hdd_hostapd_stop(dev); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief hdd_hostapd_uninit() - HDD uninit function + \brief __hdd_hostapd_uninit() - HDD uninit function This is called during the netdev unregister to uninitialize all data associated with the device @@ -231,24 +257,44 @@ associated with the device \return - void --------------------------------------------------------------------------*/ -static void hdd_hostapd_uninit (struct net_device *dev) +static void __hdd_hostapd_uninit (struct net_device *dev) { hdd_adapter_t *pHostapdAdapter = netdev_priv(dev); + hdd_context_t *pHddCtx; ENTER(); - if (pHostapdAdapter && pHostapdAdapter->pHddCtx) + if (WLAN_HDD_ADAPTER_MAGIC != pHostapdAdapter->magic) { - hdd_deinit_adapter(pHostapdAdapter->pHddCtx, pHostapdAdapter); - - /* after uninit our adapter structure will no longer be valid */ - pHostapdAdapter->dev = NULL; + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Invalid magic")); + return; } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + if (NULL == pHddCtx) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("NULL pHddCtx")); + return; + } + + hdd_deinit_adapter(pHostapdAdapter->pHddCtx, pHostapdAdapter, TRUE); + + /* after uninit our adapter structure will no longer be valid */ + pHostapdAdapter->dev = NULL; + pHostapdAdapter->magic = 0; EXIT(); } +static void hdd_hostapd_uninit (struct net_device *dev) +{ + vos_ssr_protect(__func__); + __hdd_hostapd_uninit(dev); + vos_ssr_unprotect(__func__); + return; +} /**============================================================================ @brief hdd_hostapd_hard_start_xmit() - Function registered with the Linux OS for transmitting packets. There are 2 versions of this function. One that uses @@ -264,11 +310,22 @@ int hdd_hostapd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { return 0; } -int hdd_hostapd_change_mtu(struct net_device *dev, int new_mtu) + +int __hdd_hostapd_change_mtu(struct net_device *dev, int new_mtu) { return 0; } +int hdd_hostapd_change_mtu(struct net_device *dev, int new_mtu) +{ + int ret; + vos_ssr_protect(__func__); + ret = __hdd_hostapd_change_mtu(dev, new_mtu); + vos_ssr_unprotect(__func__); + + return ret; +} + static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter, hdd_priv_data_t *priv_data) { @@ -281,6 +338,8 @@ static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter, * Note that valid pointers are provided by caller */ + ENTER(); + if (priv_data->total_len <= 0 || priv_data->total_len > HOSTAPD_IOCTL_COMMAND_STRLEN_MAX) { @@ -293,11 +352,8 @@ static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter, goto exit; } status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -353,6 +409,11 @@ static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter, hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); tANI_U8 filterType = 0; tANI_U8 *value; + + ret = hdd_drv_cmd_validate(command, 8); + if (ret) + goto exit; + value = command + 9; /* Convert the value from ascii to integer */ @@ -391,12 +452,21 @@ static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter, hdd_tx_rx_pkt_cnt_stat_timer_handler(pHddCtx); sme_SetMiracastMode(pHddCtx->hHal, pHddCtx->drvr_miracast); } + else if (strncasecmp(command, "DISABLE_CA_EVENT", 16) == 0) + { + ret = hdd_drv_cmd_validate(command, 16); + if (ret) + goto exit; + + ret = hdd_enable_disable_ca_event(pHddCtx, command, 16); + } exit: if (command) { kfree(command); } + EXIT(); return ret; } @@ -454,13 +524,15 @@ static int hdd_hostapd_driver_ioctl(hdd_adapter_t *pAdapter, struct ifreq *ifr) return ret; } -static int hdd_hostapd_ioctl(struct net_device *dev, +static int __hdd_hostapd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { hdd_adapter_t *pAdapter; hdd_context_t *pHddCtx; int ret; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -483,7 +555,6 @@ static int hdd_hostapd_ioctl(struct net_device *dev, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (ret) { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: invalid context", __func__); ret = -EBUSY; goto exit; } @@ -502,12 +573,25 @@ static int hdd_hostapd_ioctl(struct net_device *dev, break; } exit: + EXIT(); return ret; } +static int hdd_hostapd_ioctl(struct net_device *dev, + struct ifreq *ifr, int cmd) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hdd_hostapd_ioctl(dev, ifr, cmd); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief hdd_hostapd_set_mac_address() - + \brief __hdd_hostapd_set_mac_address() - This function sets the user specified mac address using the command ifconfig wlanX hw ether . @@ -517,22 +601,52 @@ static int hdd_hostapd_ioctl(struct net_device *dev, --------------------------------------------------------------------------*/ -static int hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) +static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) { struct sockaddr *psta_mac_addr = addr; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); EXIT(); return 0; } + +static int hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hdd_hostapd_set_mac_address(dev, addr); + vos_ssr_unprotect(__func__); + + return ret; +} + void hdd_hostapd_inactivity_timer_cb(v_PVOID_t usrDataForCallback) { struct net_device *dev = (struct net_device *)usrDataForCallback; v_BYTE_t we_custom_event[64]; union iwreq_data wrqu; -#ifdef DISABLE_CONCURRENCY_AUTOSAVE - VOS_STATUS vos_status; hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; +#ifdef DISABLE_CONCURRENCY_AUTOSAVE + VOS_STATUS vos_status; hdd_ap_ctx_t *pHddApCtx; #endif /*DISABLE_CONCURRENCY_AUTOSAVE */ @@ -543,9 +657,21 @@ void hdd_hostapd_inactivity_timer_cb(v_PVOID_t usrDataForCallback) ENTER(); + pHostapdAdapter = netdev_priv(dev); + if ((NULL == pHostapdAdapter) || + (WLAN_HDD_ADAPTER_MAGIC != pHostapdAdapter->magic)) + { + hddLog(LOGE, FL("invalid adapter: %pK"), pHostapdAdapter); + return; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + { + return; + } #ifdef DISABLE_CONCURRENCY_AUTOSAVE if (vos_concurrent_open_sessions_running()) - { + { /* This timer routine is going to be called only when AP persona is up. @@ -554,7 +680,6 @@ void hdd_hostapd_inactivity_timer_cb(v_PVOID_t usrDataForCallback) that if Autosave is enabled next time and other session was down only then we bring down AP */ - pHostapdAdapter = netdev_priv(dev); pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); vos_status = vos_timer_start( &pHddApCtx->hdd_ap_inactivity_timer, @@ -641,19 +766,19 @@ void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, v_PVOID_t usrDataForCallb } } -static int hdd_stop_p2p_link(hdd_adapter_t *pHostapdAdapter,v_PVOID_t usrDataForCallback) +static int hdd_stop_bss_link(hdd_adapter_t *pHostapdAdapter,v_PVOID_t usrDataForCallback) { struct net_device *dev; hdd_context_t *pHddCtx = NULL; VOS_STATUS status = VOS_STATUS_SUCCESS; dev = (struct net_device *)usrDataForCallback; + ENTER(); pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); return status; } @@ -661,7 +786,7 @@ static int hdd_stop_p2p_link(hdd_adapter_t *pHostapdAdapter,v_PVOID_t usrDataFor { if ( VOS_STATUS_SUCCESS == (status = WLANSAP_StopBss((WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext) ) ) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("Deleting P2P link!!!!!!")); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("Deleting SAP/P2P link!!!!!!")); } clear_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags); wlan_hdd_decr_active_session(pHddCtx, pHostapdAdapter->device_mode); @@ -696,6 +821,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa struct iw_michaelmicfailure msg; v_CONTEXT_t pVosContext = NULL; ptSapContext pSapCtx = NULL; + hdd_config_t *cfg_param; dev = (struct net_device *)usrDataForCallback; pHostapdAdapter = netdev_priv(dev); @@ -719,6 +845,8 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa sapEvent = pSapEvent->sapHddEventCode; memset(&wrqu, '\0', sizeof(wrqu)); pHddCtx = (hdd_context_t*)(pHostapdAdapter->pHddCtx); + cfg_param = pHddCtx->cfg_ini; + switch(sapEvent) { @@ -730,21 +858,37 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa pHostapdState->vosStatus = pSapEvent->sapevt.sapStartBssCompleteEvent.status; vos_status = vos_event_set(&pHostapdState->vosEvent); - + if (!VOS_IS_STATUS_SUCCESS(vos_status) || pHostapdState->vosStatus) - { + { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("ERROR: startbss event failed!!")); goto stopbss; } else - { + { + if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) + { + if ((cfg_param->dynSplitscan) && + (!pHddCtx->issplitscan_enabled)) + { + pHddCtx->issplitscan_enabled = TRUE; + sme_enable_disable_split_scan( + WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), + cfg_param->nNumStaChanCombinedConc, + cfg_param->nNumP2PChanCombinedConc); + } + } + pHddApCtx->uBCStaId = pSapEvent->sapevt.sapStartBssCompleteEvent.staId; //@@@ need wep logic here to set privacy bit vos_status = hdd_softap_Register_BC_STA(pHostapdAdapter, pHddApCtx->uPrivacy); if (!VOS_IS_STATUS_SUCCESS(vos_status)) + { hddLog(LOGW, FL("Failed to register BC STA %d"), vos_status); + hdd_stop_bss_link(pHostapdAdapter, usrDataForCallback); + } } - + if (0 != (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->nAPAutoShutOff) { // AP Inactivity timer init and start @@ -810,6 +954,14 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa sapCleanupChannelList(); pHddApCtx->operatingChannel = 0; //Invalidate the channel info. + + if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) + { + hddLog(LOG1, + FL("P2P Go is getting removed and we are trying to re-enable TDLS")); + wlan_hdd_tdls_reenable(pHddCtx); + } + goto stopbss; case eSAP_STA_SET_KEY_EVENT: //TODO: forward the message to hostapd once implementtation is done for now just print @@ -904,27 +1056,38 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa #ifdef WLAN_OPEN_SOURCE if (wake_lock_active(&pHddCtx->sap_wake_lock)) { - wake_unlock(&pHddCtx->sap_wake_lock); + vos_wake_lock_release(&pHddCtx->sap_wake_lock, + WIFI_POWER_EVENT_WAKELOCK_SAP); } - wake_lock_timeout(&pHddCtx->sap_wake_lock, msecs_to_jiffies(HDD_SAP_WAKE_LOCK_DURATION)); + vos_wake_lock_timeout_release(&pHddCtx->sap_wake_lock, + HDD_SAP_WAKE_LOCK_DURATION, + WIFI_POWER_EVENT_WAKELOCK_SAP); + #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) { - struct station_info staInfo; + struct station_info *staInfo; v_U16_t iesLen = pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.iesLen; - memset(&staInfo, 0, sizeof(staInfo)); + staInfo = vos_mem_malloc(sizeof(*staInfo)); + if (staInfo == NULL) { + hddLog(LOGE, FL("alloc station_info failed")); + return VOS_STATUS_E_NOMEM; + } + + memset(staInfo, 0, sizeof(*staInfo)); if (iesLen <= MAX_ASSOC_IND_IE_LEN ) { - staInfo.assoc_req_ies = + staInfo->assoc_req_ies = (const u8 *)&pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.ies[0]; - staInfo.assoc_req_ies_len = iesLen; + staInfo->assoc_req_ies_len = iesLen; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,31)) - staInfo.filled |= STATION_INFO_ASSOC_REQ_IES; + staInfo->filled |= STATION_INFO_ASSOC_REQ_IES; #endif cfg80211_new_sta(dev, (const u8 *)&pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.staMac.bytes[0], - &staInfo, GFP_KERNEL); + staInfo, GFP_KERNEL); + vos_mem_free(staInfo); } else { @@ -1033,13 +1196,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa vos_mem_free(pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas);// Release caller allocated memory here pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas = NULL; return VOS_STATUS_SUCCESS; - case eSAP_INDICATE_MGMT_FRAME: - hdd_indicateMgmtFrame( pHostapdAdapter, - pSapEvent->sapevt.sapManagementFrameInfo.nFrameLength, - pSapEvent->sapevt.sapManagementFrameInfo.pbFrames, - pSapEvent->sapevt.sapManagementFrameInfo.frameType, - pSapEvent->sapevt.sapManagementFrameInfo.rxChan, 0); - return VOS_STATUS_SUCCESS; case eSAP_REMAIN_CHAN_READY: hdd_remainChanReadyHandler( pHostapdAdapter ); return VOS_STATUS_SUCCESS; @@ -1089,10 +1245,10 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa return VOS_STATUS_SUCCESS; case eSAP_MAC_TRIG_STOP_BSS_EVENT : - vos_status = hdd_stop_p2p_link(pHostapdAdapter, usrDataForCallback); + vos_status = hdd_stop_bss_link(pHostapdAdapter, usrDataForCallback); if (!VOS_IS_STATUS_SUCCESS(vos_status)) { - hddLog(LOGW, FL("hdd_stop_p2p_link failed %d"), vos_status); + hddLog(LOGW, FL("hdd_stop_bss_link failed %d"), vos_status); } return VOS_STATUS_SUCCESS; @@ -1175,6 +1331,7 @@ int hdd_softap_unpackIE( tANI_U8 *pRsnIe; tANI_U16 RSNIeLen; + tANI_U32 status; if (NULL == halHandle) { @@ -1200,10 +1357,18 @@ int hdd_softap_unpackIE( RSNIeLen = gen_ie_len - 2; // Unpack the RSN IE memset(&dot11RSNIE, 0, sizeof(tDot11fIERSN)); - dot11fUnpackIeRSN((tpAniSirGlobal) halHandle, - pRsnIe, - RSNIeLen, + status = dot11fUnpackIeRSN((tpAniSirGlobal) halHandle, + pRsnIe, + RSNIeLen, &dot11RSNIE); + if (DOT11F_FAILED(status)) + { + hddLog(LOGE, + FL("unpack failed for RSN IE status:(0x%08x)"), + status); + return -EINVAL; + } + // Copy out the encryption and authentication types hddLog(LOG1, FL("%s: pairwise cipher suite count: %d"), __func__, dot11RSNIE.pwise_cipher_suite_count ); @@ -1237,10 +1402,18 @@ int hdd_softap_unpackIE( RSNIeLen = gen_ie_len - (2 + 4); // Unpack the WPA IE memset(&dot11WPAIE, 0, sizeof(tDot11fIEWPA)); - dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, - pRsnIe, - RSNIeLen, + status = dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, + pRsnIe, + RSNIeLen, &dot11WPAIE); + if (DOT11F_FAILED(status)) + { + hddLog(LOGE, + FL("unpack failed for WPA IE status:(0x%08x)"), + status); + return -EINVAL; + } + // Copy out the encryption and authentication types hddLog(LOG1, FL("%s: WPA unicast cipher suite count: %d"), __func__, dot11WPAIE.unicast_cipher_count ); @@ -1364,35 +1537,6 @@ void hdd_hostapd_update_unsafe_channel_list(hdd_context_t *pHddCtx, return; } -/**--------------------------------------------------------------------------- - \brief hdd_restart_softap() - - Restart SAP on STA channel to support - STA + SAP concurrency. - - --------------------------------------------------------------------------*/ -void hdd_restart_softap -( - hdd_context_t *pHddCtx, - hdd_adapter_t *pHostapdAdapter -) -{ - tSirChAvoidIndType *chAvoidInd; - - chAvoidInd = - (tSirChAvoidIndType *)vos_mem_malloc(sizeof(tSirChAvoidIndType)); - if (NULL == chAvoidInd) - { - hddLog(VOS_TRACE_LEVEL_INFO, FL("CH_AVOID IND buffer alloc Fail")); - return ; - } - chAvoidInd->avoidRangeCount = 1; - chAvoidInd->avoidFreqRange[0].startFreq = - vos_chan_to_freq(pHostapdAdapter->sessionCtx.ap.operatingChannel); - chAvoidInd->avoidFreqRange[0].endFreq = - vos_chan_to_freq(pHostapdAdapter->sessionCtx.ap.operatingChannel); - hdd_hostapd_ch_avoid_cb((void *)pHddCtx, (void *)chAvoidInd); - vos_mem_free(chAvoidInd); -} /**--------------------------------------------------------------------------- \brief hdd_hostapd_ch_avoid_cb() - @@ -1426,6 +1570,13 @@ void hdd_hostapd_ch_avoid_cb v_CONTEXT_t pVosContext; tHddAvoidFreqList hddAvoidFreqList; tANI_U32 i; +#ifdef WLAN_FEATURE_AP_HT40_24G + ptSapContext pSapCtx = NULL; + tHalHandle hHal; + v_U8_t cbMode; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + v_U32_t delay; +#endif /* Basic sanity */ if ((NULL == pAdapter) || (NULL == indParam)) @@ -1527,6 +1678,12 @@ void hdd_hostapd_ch_avoid_cb /* Get SAP context first * SAP and P2PGO would not concurrent */ pHostapdAdapter = hdd_get_adapter(hddCtxt, WLAN_HDD_SOFTAP); +#ifdef WLAN_FEATURE_AP_HT40_24G + if (NULL == pHostapdAdapter) + { + pHostapdAdapter = hdd_get_adapter(hddCtxt, WLAN_HDD_P2P_GO); + } +#endif if ((pHostapdAdapter) && (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) && (unsafeChannelCount)) @@ -1537,25 +1694,145 @@ void hdd_hostapd_ch_avoid_cb pHostapdAdapter->sessionCtx.ap.operatingChannel); for (channelLoop = 0; channelLoop < unsafeChannelCount; channelLoop++) { - if (((unsafeChannelList[channelLoop] == - pHostapdAdapter->sessionCtx.ap.operatingChannel)) && - (AUTO_CHANNEL_SELECT == - pHostapdAdapter->sessionCtx.ap.sapConfig.channel)) - { - /* current operating channel is un-safe channel - * restart driver */ - hdd_hostapd_stop(pHostapdAdapter->dev); - /* On LE, this event is handled by wlan-services to restart SAP. - On android, this event would be ignored. */ - wlan_hdd_send_svc_nlink_msg(WLAN_SVC_SAP_RESTART_IND, NULL, 0); - break; - } + if ((unsafeChannelList[channelLoop] == + pHostapdAdapter->sessionCtx.ap.operatingChannel)) + { + if ((AUTO_CHANNEL_SELECT == + pHostapdAdapter->sessionCtx.ap.sapConfig.channel) + && (WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode)) + { + /* current operating channel is un-safe channel + * restart driver */ + hdd_hostapd_stop(pHostapdAdapter->dev); + /* On LE, this event is handled by wlan-services to + * restart SAP. On android, this event would be + * ignored. + */ + wlan_hdd_send_svc_nlink_msg(WLAN_SVC_SAP_RESTART_IND, + NULL, 0); + } + return; + } } } +#ifdef WLAN_FEATURE_AP_HT40_24G + if (hddCtxt->cfg_ini->apHT40_24GEnabled) + { + pSapCtx = VOS_GET_SAP_CB(pVosContext); + + if(pSapCtx == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + FL("psapCtx is NULL")); + return; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("SAP Secondary channel: %d "), + pSapCtx->sap_sec_chan); + + /* tHalHandle */ + hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); + + if (NULL == hHal) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("In invalid hHal")); + return; + } + + cbMode = sme_GetChannelBondingMode24G(hHal); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Selected Channel bonding : %d"), cbMode); + + if (cbMode && (pSapCtx->sap_sec_chan > 0)) + { + int i; + eHalStatus halStatus; + + for (i = 0; i < unsafeChannelCount; i++) + { + if ((pSapCtx->sap_sec_chan == unsafeChannelList[i])) + { + /* Current SAP Secondary channel is un-safe channel */ + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Move SAP from HT40 to HT20")); + + halStatus = sme_SetHT2040Mode(hHal, pSapCtx->sessionId, + PHY_SINGLE_CHANNEL_CENTERED); + + if (halStatus == eHAL_STATUS_FAILURE) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to change HT20/40 mode")); + return; + } + + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(hHal, + PHY_SINGLE_CHANNEL_CENTERED); + return; + } + } + } + + if ((!pSapCtx->numHT40IntoSta) + && (pHostapdAdapter) + && (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags))) + { + /* if Unsafe channel is Zero or SAP Primary/Secondary channel + * are Safe then start HT20/40 timer to Move SAP from HT20 + * to HT40. + */ + if (((!unsafeChannelCount) + || (!sapCheckHT40SecondaryIsNotAllowed(pSapCtx))) && (!cbMode)) + { + /* Stop Previous Running HT20/40 Timer & Start timer + with (OBSS TransitionDelayFactor * obss interval) + delay after time out move AP from HT20 -> HT40 + mode + */ + if (VOS_TIMER_STATE_RUNNING == pSapCtx->sap_HT2040_timer.state) + { + vosStatus = vos_timer_stop(&pSapCtx->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + + delay = + (pSapCtx->ObssScanInterval * pSapCtx->ObssTransitionDelayFactor); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Start HT20/40 transition timer (%d sec)"), delay); + + vosStatus = vos_timer_start( &pSapCtx->sap_HT2040_timer, + (delay * 1000)); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Start HT20/40 timer")); + } + else + { + /* Stop HT20/40 Timer */ + if (VOS_TIMER_STATE_RUNNING == pSapCtx->sap_HT2040_timer.state) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Stop HT20/40 transition timer")); + vosStatus = vos_timer_stop(&pSapCtx->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + } + } + } +#endif return; } - #endif /* FEATURE_WLAN_CH_AVOID */ int @@ -1565,6 +1842,7 @@ static __iw_softap_setparam(struct net_device *dev, { hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); tHalHandle hHal; + hdd_context_t *pHddCtx = NULL; int *value = (int *)extra; int sub_cmd = value[0]; int set_value = value[1]; @@ -1572,14 +1850,23 @@ static __iw_softap_setparam(struct net_device *dev, int ret = 0; /* success */ v_CONTEXT_t pVosContext; - if (!pHostapdAdapter || !pHostapdAdapter->pHddCtx) + ENTER(); + + if (NULL == pHostapdAdapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: either hostapd Adapter is null or HDD ctx is null", + "%s: hostapd Adapter is null", __func__); return -1; } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return -1; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); if (!hHal) { @@ -1602,12 +1889,12 @@ static __iw_softap_setparam(struct net_device *dev, case QCSAP_PARAM_CLR_ACL: if ( VOS_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext )) { - ret = -EIO; + ret = -EIO; } break; case QCSAP_PARAM_ACL_MODE: - if ((eSAP_ALLOW_ALL < (eSapMacAddrACL)set_value) || + if ((eSAP_ALLOW_ALL < (eSapMacAddrACL)set_value) || (eSAP_ACCEPT_UNLESS_DENIED > (eSapMacAddrACL)set_value)) { hddLog(LOGE, FL("Invalid ACL Mode value %d"), set_value); @@ -1703,6 +1990,15 @@ static __iw_softap_setparam(struct net_device *dev, } break; } + case QCSAP_PARAM_GET_FRAME_LOGS: + { + if (wlan_hdd_get_frame_logs(pHostapdAdapter, set_value) + != VOS_STATUS_SUCCESS) + { + ret = -EINVAL; + } + break; + } default: hddLog(LOGE, FL("Invalid setparam command %d value %d"), @@ -1711,6 +2007,7 @@ static __iw_softap_setparam(struct net_device *dev, break; } + EXIT(); return ret; } @@ -1733,15 +2030,44 @@ static __iw_softap_getparam(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + hdd_adapter_t *pHostapdAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; int *value = (int *)extra; int sub_cmd = value[0]; eHalStatus status; int ret = 0; /* success */ - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; + v_CONTEXT_t pVosContext; + + ENTER(); + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pVosContext Context is NULL",__func__); + return -EINVAL; + } switch (sub_cmd) { case QCSAP_PARAM_MAX_ASSOC: @@ -1784,17 +2110,17 @@ static __iw_softap_getparam(struct net_device *dev, } } break; - + case QCSAP_PARAM_CLR_ACL: if ( VOS_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext )) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("WLANSAP_ClearACL failed")); - ret = -EIO; - } + ret = -EIO; + } *value = 0; break; - + case QCSAP_PARAM_GET_WLAN_DBG: { vos_trace_display(); @@ -1815,6 +2141,7 @@ static __iw_softap_getparam(struct net_device *dev, } + EXIT(); return ret; } @@ -1855,22 +2182,43 @@ int __iw_softap_modify_acl(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; + hdd_adapter_t *pHostapdAdapter; + v_CONTEXT_t pVosContext; + hdd_context_t *pHddCtx; v_BYTE_t *value = (v_BYTE_t*)extra; v_U8_t pPeerStaMac[VOS_MAC_ADDR_SIZE]; int listType, cmd, i; int ret = 0; /* success */ ENTER(); - for (i=0; ipvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Vos Context is NULL",__func__); + return -EINVAL; + } + for (i=0; ioperatingChannel; + + EXIT(); return 0; } @@ -1930,13 +2299,36 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + hdd_adapter_t *pHostapdAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; int *value = (int *)extra; - int set_value; + int set_value, ret = 0; tSirMacAddr bssid = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; tSirMacAddr selfMac = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } if (NULL == value) return -ENOMEM; @@ -1954,6 +2346,7 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, return -EIO; } + EXIT(); return 0; } @@ -1983,10 +2376,29 @@ static __iw_display_data_path_snapshot(struct net_device *dev, * TL State (with Per Client infor) * DXE Snapshot (Called at the end of TL Snapshot) */ - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - hddLog(LOGE, "%s: called for SAP",__func__); + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } hdd_wmm_tx_snapshot(pHostapdAdapter); WLANTL_TLDebugMessage(WLANTL_DEBUG_TX_SNAPSHOT); + + EXIT(); return 0; } @@ -2009,13 +2421,43 @@ static __iw_softap_set_tx_power(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; + tHalHandle hHal; int *value = (int *)extra; - int set_value; + int set_value, ret = 0; ptSapContext pSapCtx = NULL; + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Vos Context is NULL",__func__); + return -EINVAL; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } if (NULL == value) return -ENOMEM; @@ -2035,6 +2477,7 @@ static __iw_softap_set_tx_power(struct net_device *dev, return -EIO; } + EXIT(); return 0; } @@ -2068,11 +2511,14 @@ static int __iw_softap_set_trafficmonitor(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); + hdd_adapter_t *pAdapter; int *isSetTrafficMon = (int *)extra; hdd_context_t *pHddCtx; int status; + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, @@ -2083,11 +2529,8 @@ static int __iw_softap_set_trafficmonitor(struct net_device *dev, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -2121,6 +2564,8 @@ static int __iw_softap_set_trafficmonitor(struct net_device *dev, } } + + EXIT(); return 0; } @@ -2144,7 +2589,8 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; hdd_station_info_t *pStaInfo = NULL; char *buf; int cnt = 0; @@ -2154,6 +2600,23 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev, u32 maclist_index; v_CONTEXT_t pVosContext = NULL; ptSapContext pSapCtx = NULL; + + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + /* * NOTE WELL: this is a "get" ioctl but it uses an even ioctl * number, and even numbered iocts are supposed to have "set" @@ -2175,12 +2638,6 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev, return -EINVAL; } - /* allocate local buffer to build the response */ - buf = kmalloc(wrqu->data.length, GFP_KERNEL); - if (!buf) { - hddLog(LOG1, "%s: failed to allocate response buffer", __func__); - return -ENOMEM; - } pVosContext = ( WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; pSapCtx = VOS_GET_SAP_CB(pVosContext); if(pSapCtx == NULL){ @@ -2188,6 +2645,14 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev, FL("psapCtx is NULL")); return -EFAULT; } + + /* allocate local buffer to build the response */ + buf = kmalloc(wrqu->data.length, GFP_KERNEL); + if (!buf) { + hddLog(LOG1, "%s: failed to allocate response buffer", __func__); + return -ENOMEM; + } + pStaInfo = pSapCtx->aStaInfo; /* start indexing beyond where the record count will be written */ maclist_index = sizeof(maclist_index); @@ -2213,6 +2678,8 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev, ret = -EFAULT; } kfree(buf); + + EXIT(); return ret; } @@ -2248,10 +2715,32 @@ static __iw_softap_disassoc_sta(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_U8_t *peerMacAddr; - + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; + v_U8_t *peerMacAddr; + int ret = 0; + ENTER(); + + if (!capable(CAP_NET_ADMIN)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } /* iwpriv tool or framework calls this ioctl with * data passed in extra (less than 16 octets); */ @@ -2283,11 +2772,27 @@ static __iw_softap_ap_stats(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; WLANTL_TRANSFER_STA_TYPE statBuffer; char *pstatbuf; - int len; + int len, ret = 0; + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } memset(&statBuffer, 0, sizeof(statBuffer)); WLANSAP_GetStatistics((WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext, &statBuffer, (v_BOOL_t)wrqu->data.flags); @@ -2319,6 +2824,8 @@ static __iw_softap_ap_stats(struct net_device *dev, strlcpy(extra, pstatbuf, len); wrqu->data.length = len; kfree(pstatbuf); + + EXIT(); return 0; } @@ -2340,10 +2847,9 @@ static int __iw_softap_set_channel_range(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); - + hdd_adapter_t *pHostapdAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; int *value = (int *)extra; int startChannel = value[0]; int endChannel = value[1]; @@ -2351,6 +2857,35 @@ static int __iw_softap_set_channel_range(struct net_device *dev, VOS_STATUS status; int ret = 0; /* success */ + ENTER(); + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } status = WLANSAP_SetChannelRange(hHal,startChannel,endChannel,band); if(status != VOS_STATUS_SUCCESS) { @@ -2361,6 +2896,7 @@ static int __iw_softap_set_channel_range(struct net_device *dev, pHddCtx->is_dynamic_channel_range_set = 1; + EXIT(); return ret; } @@ -2387,13 +2923,36 @@ int __iw_softap_get_channel_list(struct net_device *dev, v_U8_t bandStartChannel = RF_CHAN_1; v_U8_t bandEndChannel = RF_CHAN_165; v_U32_t temp_num_channels = 0; - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + hdd_adapter_t *pHostapdAdapter; + tHalHandle hHal; v_REGDOMAIN_t domainIdCurrentSoftap; tpChannelListInfo channel_list = (tpChannelListInfo) extra; eCsrBand curBand = eCSR_BAND_ALL; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); + pHostapdAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } if (eHAL_STATUS_SUCCESS != sme_GetFreqBand(hHal, &curBand)) { hddLog(LOGE,FL("not able get the current frequency band")); @@ -2486,30 +3045,58 @@ int __iw_get_genie(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; - eHalStatus status; + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; + VOS_STATUS status; v_U32_t length = DOT11F_IE_RSN_MAX_LEN; v_U8_t genIeBytes[DOT11F_IE_RSN_MAX_LEN]; + int ret = 0; + ENTER(); + + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is not valid ",__func__); + return -EINVAL; + } hddLog(LOG1,FL("getGEN_IE ioctl")); // Actually retrieve the RSN IE from CSR. (We previously sent it down in the CSR Roam Profile.) status = WLANSap_getstationIE_information(pVosContext, &length, genIeBytes); - length = VOS_MIN((u_int16_t) length, DOT11F_IE_RSN_MAX_LEN); - if (wrqu->data.length < length || - copy_to_user(wrqu->data.pointer, - (v_VOID_t*)genIeBytes, length)) - { - hddLog(LOG1, "%s: failed to copy data to user buffer", __func__); + + if (VOS_STATUS_SUCCESS != status) { + hddLog(LOGE, FL("failed to get sta ies")); return -EFAULT; } + wrqu->data.length = length; - - hddLog(LOG1,FL(" RSN IE of %d bytes returned"), wrqu->data.length ); - - + if (length > DOT11F_IE_RSN_MAX_LEN) { + hddLog(LOGE, + FL("invalid buffer length length:%d"), length); + return -E2BIG; + } + + vos_mem_copy(extra, genIeBytes, length); + + hddLog(LOG1, FL("RSN IE of %d bytes returned"), wrqu->data.length); + EXIT(); return 0; } @@ -2533,11 +3120,35 @@ int __iw_get_WPSPBCProbeReqIEs(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); sQcSapreq_WPSPBCProbeReqIES_t WPSPBCProbeReqIEs; - hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + hdd_ap_ctx_t *pHddApCtx; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + if (NULL == pHddApCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: AP context is NULL",__func__); + return -EINVAL; + } + hddLog(LOG1,FL("get_WPSPBCProbeReqIEs ioctl")); memset((void*)&WPSPBCProbeReqIEs, 0, sizeof(WPSPBCProbeReqIEs)); @@ -2593,10 +3204,34 @@ int __iw_set_auth_hostap(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); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pWextState; + int ret = 0; ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } switch(wrqu->param.flags & IW_AUTH_INDEX) { case IW_AUTH_TKIP_COUNTERMEASURES: @@ -2605,8 +3240,8 @@ int __iw_set_auth_hostap(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "Counter Measure started %d", wrqu->param.value); pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STARTED; - } - else { + } + else { hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "Counter Measure stopped=%d", wrqu->param.value); pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STOPED; @@ -2614,16 +3249,16 @@ int __iw_set_auth_hostap(struct net_device *dev, hdd_softap_tkip_mic_fail_counter_measure(pAdapter, wrqu->param.value); - } + } break; - + default: - + hddLog(LOGW, "%s called with unsupported auth type %d", __func__, wrqu->param.flags & IW_AUTH_INDEX); break; } - + EXIT(); return 0; } @@ -2645,35 +3280,64 @@ static int __iw_set_ap_encodeext(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; - hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + hdd_adapter_t *pHostapdAdapter; + v_CONTEXT_t pVosContext; + hdd_context_t *pHddCtx; + hdd_ap_ctx_t *pHddApCtx; int retval = 0; VOS_STATUS vstatus; struct iw_encode_ext *ext = (struct iw_encode_ext*)extra; v_U8_t groupmacaddr[WNI_CFG_BSSID_LEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; int key_index; struct iw_point *encoding = &wrqu->encoding; - tCsrRoamSetKey setKey; + tCsrRoamSetKey setKey; // tCsrRoamRemoveKey RemoveKey; int i; - ENTER(); - + ENTER(); + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + retval = wlan_hdd_validate_context(pHddCtx); + if (0 != retval) + { + return retval; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pVosContext is NULL",__func__); + return -EINVAL; + } + pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + if (NULL == pHddApCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: AP Context is NULL",__func__); + return -EINVAL; + } + key_index = encoding->flags & IW_ENCODE_INDEX; - + if(key_index > 0) { - + /*Convert from 1-based to 0-based keying*/ key_index--; } - if(!ext->key_len) { -#if 0 + if(!ext->key_len || ext->key_len > CSR_MAX_KEY_LEN) { +#if 0 /*Set the encrytion type to NONE*/ #if 0 pRoamProfile->EncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_NONE; #endif - + RemoveKey.keyId = key_index; if(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { /*Key direction for group is RX only*/ @@ -2713,7 +3377,7 @@ static int __iw_set_ap_encodeext(struct net_device *dev, retval = -EINVAL; } #endif - return retval; + return -EINVAL; } @@ -2722,9 +3386,7 @@ static int __iw_set_ap_encodeext(struct net_device *dev, setKey.keyId = key_index; setKey.keyLength = ext->key_len; - if(ext->key_len <= CSR_MAX_KEY_LEN) { - vos_mem_copy(&setKey.Key[0],ext->key,ext->key_len); - } + vos_mem_copy(&setKey.Key[0],ext->key,ext->key_len); if(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { /*Key direction for group is RX only*/ @@ -2815,8 +3477,9 @@ static int __iw_set_ap_encodeext(struct net_device *dev, "[%4d] WLANSAP_SetKeySta returned ERROR status= %d", __LINE__, vstatus ); retval = -EINVAL; } - - return retval; + + EXIT(); + return retval; } static int iw_set_ap_encodeext(struct net_device *dev, @@ -2832,10 +3495,10 @@ static int iw_set_ap_encodeext(struct net_device *dev, return ret; } -static int iw_set_ap_mlme(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) +static int __iw_set_ap_mlme(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) { #if 0 hdd_adapter_t *pAdapter = (netdev_priv(dev)); @@ -2880,6 +3543,20 @@ static int iw_set_ap_mlme(struct net_device *dev, // return status; } +static int iw_set_ap_mlme(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_ap_mlme(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + static int __iw_get_ap_rts_threshold(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -2935,22 +3612,49 @@ static int __iw_get_ap_freq(struct net_device *dev, struct iw_freq *fwrq, char *extra) { v_U32_t status = FALSE, channel = 0, freq = 0; - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter; tHalHandle hHal; hdd_hostapd_state_t *pHostapdState; - hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + hdd_ap_ctx_t *pHddApCtx; + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pHostapdAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:LOGP in Progress. Ignore!!!",__func__); - return status; + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } - pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter); + if (NULL == pHostapdState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pHostapdState is NULL",__func__); + return -EINVAL; + } hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); - + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter); + if (NULL == pHddApCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: AP context is NULL",__func__); + return -EINVAL; + } if(pHostapdState->bssState == BSS_STOP ) { if (ccmCfgGetInt(hHal, WNI_CFG_CURRENT_CHANNEL, &channel) @@ -2986,7 +3690,9 @@ static int __iw_get_ap_freq(struct net_device *dev, fwrq->e = MHZ; } } - return 0; + + EXIT(); + return 0; } static int iw_get_ap_freq(struct net_device *dev, @@ -3002,408 +3708,40 @@ static int iw_get_ap_freq(struct net_device *dev, return ret; } -static int __iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int status = 0; - - wrqu->mode = IW_MODE_MASTER; - - return status; -} - -static int iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - vos_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); - vos_ssr_unprotect(__func__); - - return ret; -} - -static int __iw_softap_setwpsie(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) -{ - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; - hdd_hostapd_state_t *pHostapdState; - eHalStatus halStatus= eHAL_STATUS_SUCCESS; - u_int8_t *wps_genie; - u_int8_t *fwps_genie; - u_int8_t *pos; - tpSap_WPSIE pSap_WPSIe; - u_int8_t WPSIeType; - u_int16_t length; - struct iw_point s_priv_data; - ENTER(); - - /* helper function to get iwreq_data with compat handling. */ - if (hdd_priv_get_data(&s_priv_data, wrqu)) - { - return -EINVAL; - } - - if ((NULL == s_priv_data.pointer) || (s_priv_data.length < QCSAP_MAX_WSC_IE)) - { - return -EINVAL; - } - - wps_genie = mem_alloc_copy_from_user_helper(s_priv_data.pointer, - s_priv_data.length); - - if(NULL == wps_genie) - { - hddLog(LOG1, "%s: failed to alloc memory " - "and copy data from user buffer", __func__); - return -EFAULT; - } - - fwps_genie = wps_genie; - - pSap_WPSIe = vos_mem_malloc(sizeof(tSap_WPSIE)); - if (NULL == pSap_WPSIe) - { - hddLog(LOGE, "VOS unable to allocate memory"); - kfree(fwps_genie); - return -ENOMEM; - } - vos_mem_zero(pSap_WPSIe, sizeof(tSap_WPSIE)); - - hddLog(LOG1,"%s WPS IE type[0x%X] IE[0x%X], LEN[%d]", __func__, wps_genie[0], wps_genie[1], wps_genie[2]); - WPSIeType = wps_genie[0]; - if ( wps_genie[0] == eQC_WPS_BEACON_IE) - { - pSap_WPSIe->sapWPSIECode = eSAP_WPS_BEACON_IE; - wps_genie = wps_genie + 1; - switch ( wps_genie[0] ) - { - case DOT11F_EID_WPA: - if (wps_genie[1] < 2 + 4) - { - vos_mem_free(pSap_WPSIe); - kfree(fwps_genie); - return -EINVAL; - } - else if (memcmp(&wps_genie[2], "\x00\x50\xf2\x04", 4) == 0) - { - hddLog (LOG1, "%s Set WPS BEACON IE(len %d)",__func__, wps_genie[1]+2); - pos = &wps_genie[6]; - while (((size_t)pos - (size_t)&wps_genie[6]) < (wps_genie[1] - 4) ) - { - switch((u_int16_t)(*pos<<8) | *(pos+1)) - { - case HDD_WPS_ELEM_VERSION: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.Version = *pos; - hddLog(LOG1, "WPS version %d", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.Version); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_VER_PRESENT; - pos += 1; - break; - - case HDD_WPS_ELEM_WPS_STATE: - pos +=4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.wpsState = *pos; - hddLog(LOG1, "WPS State %d", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.wpsState); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_STATE_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_APSETUPLOCK: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.APSetupLocked = *pos; - hddLog(LOG1, "AP setup lock %d", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.APSetupLocked); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_APSETUPLOCK_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_SELECTEDREGISTRA: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.SelectedRegistra = *pos; - hddLog(LOG1, "Selected Registra %d", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.SelectedRegistra); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_SELECTEDREGISTRA_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_DEVICE_PASSWORD_ID: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.DevicePasswordID = (*pos<<8) | *(pos+1); - hddLog(LOG1, "Password ID: %x", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.DevicePasswordID); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_DEVICEPASSWORDID_PRESENT; - pos += 2; - break; - case HDD_WPS_ELEM_REGISTRA_CONF_METHODS: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.SelectedRegistraCfgMethod = (*pos<<8) | *(pos+1); - hddLog(LOG1, "Select Registra Config Methods: %x", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.SelectedRegistraCfgMethod); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT; - pos += 2; - break; - - case HDD_WPS_ELEM_UUID_E: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSBeaconIE.UUID_E, pos, length); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_UUIDE_PRESENT; - pos += length; - break; - case HDD_WPS_ELEM_RF_BANDS: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.RFBand = *pos; - hddLog(LOG1, "RF band: %d", pSap_WPSIe->sapwpsie.sapWPSBeaconIE.RFBand); - pSap_WPSIe->sapwpsie.sapWPSBeaconIE.FieldPresent |= WPS_BEACON_RF_BANDS_PRESENT; - pos += 1; - break; - - default: - hddLog (LOGW, "UNKNOWN TLV in WPS IE(%x)", (*pos<<8 | *(pos+1))); - vos_mem_free(pSap_WPSIe); - kfree(fwps_genie); - return -EINVAL; - } - } - } - else { - hddLog (LOGE, "%s WPS IE Mismatch %X", - __func__, wps_genie[0]); - } - break; - - default: - hddLog (LOGE, "%s Set UNKNOWN IE %X",__func__, wps_genie[0]); - vos_mem_free(pSap_WPSIe); - kfree(fwps_genie); - return 0; - } - } - else if( wps_genie[0] == eQC_WPS_PROBE_RSP_IE) - { - pSap_WPSIe->sapWPSIECode = eSAP_WPS_PROBE_RSP_IE; - wps_genie = wps_genie + 1; - switch ( wps_genie[0] ) - { - case DOT11F_EID_WPA: - if (wps_genie[1] < 2 + 4) - { - vos_mem_free(pSap_WPSIe); - kfree(fwps_genie); - return -EINVAL; - } - else if (memcmp(&wps_genie[2], "\x00\x50\xf2\x04", 4) == 0) - { - hddLog (LOG1, "%s Set WPS PROBE RSP IE(len %d)",__func__, wps_genie[1]+2); - pos = &wps_genie[6]; - while (((size_t)pos - (size_t)&wps_genie[6]) < (wps_genie[1] - 4) ) - { - switch((u_int16_t)(*pos<<8) | *(pos+1)) - { - case HDD_WPS_ELEM_VERSION: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.Version = *pos; - hddLog(LOG1, "WPS version %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.Version); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_VER_PRESENT; - pos += 1; - break; - - case HDD_WPS_ELEM_WPS_STATE: - pos +=4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.wpsState = *pos; - hddLog(LOG1, "WPS State %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.wpsState); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_STATE_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_APSETUPLOCK: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.APSetupLocked = *pos; - hddLog(LOG1, "AP setup lock %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.APSetupLocked); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_APSETUPLOCK_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_SELECTEDREGISTRA: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SelectedRegistra = *pos; - hddLog(LOG1, "Selected Registra %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SelectedRegistra); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_SELECTEDREGISTRA_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_DEVICE_PASSWORD_ID: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DevicePasswordID = (*pos<<8) | *(pos+1); - hddLog(LOG1, "Password ID: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DevicePasswordID); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_DEVICEPASSWORDID_PRESENT; - pos += 2; - break; - case HDD_WPS_ELEM_REGISTRA_CONF_METHODS: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SelectedRegistraCfgMethod = (*pos<<8) | *(pos+1); - hddLog(LOG1, "Select Registra Config Methods: %x", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SelectedRegistraCfgMethod); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT; - pos += 2; - break; - case HDD_WPS_ELEM_RSP_TYPE: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ResponseType = *pos; - hddLog(LOG1, "Config Methods: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ResponseType); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_RESPONSETYPE_PRESENT; - pos += 1; - break; - case HDD_WPS_ELEM_UUID_E: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.UUID_E, pos, length); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_UUIDE_PRESENT; - pos += length; - break; - - case HDD_WPS_ELEM_MANUFACTURER: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.Manufacture.num_name = length; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.Manufacture.name, pos, length); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_MANUFACTURE_PRESENT; - pos += length; - break; - - case HDD_WPS_ELEM_MODEL_NAME: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ModelName.num_text = length; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ModelName.text, pos, length); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_MODELNAME_PRESENT; - pos += length; - break; - case HDD_WPS_ELEM_MODEL_NUM: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ModelNumber.num_text = length; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ModelNumber.text, pos, length); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_MODELNUMBER_PRESENT; - pos += length; - break; - case HDD_WPS_ELEM_SERIAL_NUM: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SerialNumber.num_text = length; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SerialNumber.text, pos, length); - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_SERIALNUMBER_PRESENT; - pos += length; - break; - case HDD_WPS_ELEM_PRIMARY_DEVICE_TYPE: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.PrimaryDeviceCategory = (*pos<<8 | *(pos+1)); - hddLog(LOG1, "primary dev category: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.PrimaryDeviceCategory); - pos += 2; - - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.PrimaryDeviceOUI, pos, HDD_WPS_DEVICE_OUI_LEN); - hddLog(LOG1, "primary dev oui: %02x, %02x, %02x, %02x", pos[0], pos[1], pos[2], pos[3]); - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DeviceSubCategory = (*pos<<8 | *(pos+1)); - hddLog(LOG1, "primary dev sub category: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DeviceSubCategory); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT; - break; - case HDD_WPS_ELEM_DEVICE_NAME: - pos += 2; - length = *pos<<8 | *(pos+1); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DeviceName.num_text = length; - vos_mem_copy(pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.DeviceName.text, pos, length); - pos += length; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_DEVICENAME_PRESENT; - break; - case HDD_WPS_ELEM_CONFIG_METHODS: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.ConfigMethod = (*pos<<8) | *(pos+1); - hddLog(LOG1, "Config Methods: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.SelectedRegistraCfgMethod); - pos += 2; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_CONFIGMETHODS_PRESENT; - break; - - case HDD_WPS_ELEM_RF_BANDS: - pos += 4; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.RFBand = *pos; - hddLog(LOG1, "RF band: %d", pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.RFBand); - pos += 1; - pSap_WPSIe->sapwpsie.sapWPSProbeRspIE.FieldPresent |= WPS_PROBRSP_RF_BANDS_PRESENT; - break; - } // switch - } - } - else - { - hddLog (LOGE, "%s WPS IE Mismatch %X",__func__, wps_genie[0]); - } - - } // switch - } - halStatus = WLANSAP_Set_WpsIe(pVosContext, pSap_WPSIe); - pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter); - if( pHostapdState->bCommit && WPSIeType == eQC_WPS_PROBE_RSP_IE) - { - //hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - //v_CONTEXT_t pVosContext = pHostapdAdapter->pvosContext; - WLANSAP_Update_WpsIe ( pVosContext ); - } - - vos_mem_free(pSap_WPSIe); - kfree(fwps_genie); - EXIT(); - return halStatus; -} - -static int iw_softap_setwpsie(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) -{ - int ret; - - vos_ssr_protect(__func__); - ret = __iw_softap_setwpsie(dev, info, wrqu, extra); - vos_ssr_unprotect(__func__); - - return ret; -} - static int __iw_softap_stopbss(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter; VOS_STATUS status = VOS_STATUS_SUCCESS; hdd_context_t *pHddCtx = NULL; ENTER(); - + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); return status; } - if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) + if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { if ( VOS_STATUS_SUCCESS == (status = WLANSAP_StopBss((WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext) ) ) { hdd_hostapd_state_t *pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter); status = vos_wait_single_event(&pHostapdState->vosEvent, 10000); - + if (!VOS_IS_STATUS_SUCCESS(status)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("ERROR: HDD vos wait for single_event failed!!")); VOS_ASSERT(0); } @@ -3435,8 +3773,23 @@ static int __iw_softap_version(struct net_device *dev, char *extra) { hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } hdd_wlan_get_version(pHostapdAdapter, wrqu, extra); EXIT(); return 0; @@ -3456,22 +3809,48 @@ static int iw_softap_version(struct net_device *dev, return ret; } -VOS_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, v_U8_t *pBuf, int buf_len) +int hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, v_U8_t *pBuf, int buf_len) { v_U8_t i; int len = 0; const char sta_info_header[] = "staId staAddress\n"; - - v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; + v_CONTEXT_t pVosContext; + hdd_context_t *pHddCtx; ptSapContext pSapCtx = NULL; + + ENTER(); + + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != wlan_hdd_validate_context(pHddCtx)) + { + return VOS_STATUS_E_FAULT; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: VOS context is not valid",__func__); + return VOS_STATUS_E_FAULT; + } pSapCtx = VOS_GET_SAP_CB(pVosContext); - if(pSapCtx == NULL){ + if(pSapCtx == NULL) + { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, FL("psapCtx is NULL")); return VOS_STATUS_E_FAULT; } - len = scnprintf(pBuf, buf_len, sta_info_header); + len = snprintf(pBuf, buf_len, sta_info_header); + if (len >= buf_len) { + hddLog(LOGE, FL("Insufficient buffer:%d, %d"), buf_len, len); + return -E2BIG; + } pBuf += len; buf_len -= len; @@ -3487,6 +3866,10 @@ VOS_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, v_U8_t *pBuf, int bu pSapCtx->aStaInfo[i].macAddrSTA.bytes[3], pSapCtx->aStaInfo[i].macAddrSTA.bytes[4], pSapCtx->aStaInfo[i].macAddrSTA.bytes[5]); + if (len >= buf_len) { + hddLog(LOGE, FL("Insufficient buffer:%d, %d"), buf_len, len); + return -E2BIG; + } pBuf += len; buf_len -= len; } @@ -3495,65 +3878,108 @@ VOS_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, v_U8_t *pBuf, int bu break; } } - return VOS_STATUS_SUCCESS; + EXIT(); + return 0; } -static int iw_softap_get_sta_info(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) +static int __iw_softap_get_sta_info(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) { hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - VOS_STATUS status; + int ret; ENTER(); - status = hdd_softap_get_sta_info(pHostapdAdapter, extra, WE_SAP_MAX_STA_INFO); - if ( !VOS_IS_STATUS_SUCCESS( status ) ) { + ret = hdd_softap_get_sta_info(pHostapdAdapter, extra, WE_SAP_MAX_STA_INFO); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s Failed!!!",__func__); - return -EINVAL; + return ret; } wrqu->data.length = strlen(extra); EXIT(); return 0; } +static int iw_softap_get_sta_info(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_softap_get_sta_info(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + static int __iw_set_ap_genie(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); - v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext; + + hdd_adapter_t *pHostapdAdapter; + hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; eHalStatus halStatus= eHAL_STATUS_SUCCESS; u_int8_t *genie = (u_int8_t *)extra; - + int ret = 0; + ENTER(); - + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pVosContext = pHddCtx->pvosContext; + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: VOS Context is NULL",__func__); + return -EINVAL; + } if(!wrqu->data.length) { EXIT(); return 0; } - switch (genie[0]) + if (wrqu->data.length > DOT11F_IE_RSN_MAX_LEN) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: WPARSN Ie input length is more than max[%d]", __func__, + wrqu->data.length); + return -EINVAL; + } + + switch (genie[0]) { - case DOT11F_EID_WPA: + case DOT11F_EID_WPA: case DOT11F_EID_RSN: if((WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uPrivacy == 0) { hdd_softap_Deregister_BC_STA(pHostapdAdapter); hdd_softap_Register_BC_STA(pHostapdAdapter, 1); - } + } (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uPrivacy = 1; halStatus = WLANSAP_Set_WPARSNIes(pVosContext, genie, wrqu->data.length); break; - + default: hddLog (LOGE, "%s Set UNKNOWN IE %X",__func__, genie[0]); halStatus = 0; } - + EXIT(); - return halStatus; + return halStatus; } static int iw_set_ap_genie(struct net_device *dev, @@ -3572,8 +3998,15 @@ static int iw_set_ap_genie(struct net_device *dev, static VOS_STATUS wlan_hdd_get_classAstats_for_station(hdd_adapter_t *pAdapter, u8 staid) { eHalStatus hstatus; - long lrc; - struct statsContext context; + int ret; + void *cookie; + struct hdd_request *request; + struct stats_class_a_ctx *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; + if (NULL == pAdapter) { @@ -3581,17 +4014,21 @@ static VOS_STATUS wlan_hdd_get_classAstats_for_station(hdd_adapter_t *pAdapter, return VOS_STATUS_E_FAULT; } - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); + hstatus = sme_GetStatistics( WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_HDD, SME_GLOBAL_CLASSA_STATS, - hdd_GetClassA_statisticsCB, + hdd_get_class_a_statistics_cb, 0, // not periodic FALSE, //non-cached results staid, - &context); + cookie); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -3600,30 +4037,25 @@ static VOS_STATUS wlan_hdd_get_classAstats_for_station(hdd_adapter_t *pAdapter, } else { - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while retrieving link speed", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + FL("SME timeout while retrieving link speed")); + } + else + { + priv = hdd_request_priv(request); + pAdapter->hdd_stats.ClassA_stat = priv->class_a_stats; } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); return VOS_STATUS_SUCCESS; } @@ -3634,7 +4066,7 @@ int __iw_get_softap_linkspeed(struct net_device *dev, char *extra) { - hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); + hdd_adapter_t *pHostapdAdapter; hdd_context_t *pHddCtx; char *pLinkSpeed = (char*)extra; char *pmacAddress; @@ -3645,13 +4077,19 @@ int __iw_get_softap_linkspeed(struct net_device *dev, VOS_STATUS status = VOS_STATUS_E_FAILURE; int rc, valid; - pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + ENTER(); + pHostapdAdapter = (netdev_priv(dev)); + if (NULL == pHostapdAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); valid = wlan_hdd_validate_context(pHddCtx); - if (0 != valid) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context not valid")); return valid; } @@ -3671,7 +4109,7 @@ int __iw_get_softap_linkspeed(struct net_device *dev, kfree(pmacAddress); return -EFAULT; } - pmacAddress[MAC_ADDRESS_STR_LEN] = '\0'; + pmacAddress[MAC_ADDRESS_STR_LEN-1] = '\0'; status = hdd_string_to_hex (pmacAddress, MAC_ADDRESS_STR_LEN, macAddress ); kfree(pmacAddress); @@ -3735,6 +4173,7 @@ int __iw_get_softap_linkspeed(struct net_device *dev, return -EIO; } + EXIT(); return 0; } @@ -3762,7 +4201,7 @@ static const iw_handler hostapd_handler[] = (iw_handler) NULL, /* SIOCSIWFREQ */ (iw_handler) iw_get_ap_freq, /* SIOCGIWFREQ */ (iw_handler) NULL, /* SIOCSIWMODE */ - (iw_handler) iw_get_mode, /* SIOCGIWMODE */ + (iw_handler) NULL, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ @@ -3824,6 +4263,8 @@ static const struct iw_priv_args hostapd_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam" }, { QCSAP_IOCTL_SETPARAM, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "" }, + { QCSAP_PARAM_GET_FRAME_LOGS, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "getFrameLogs" }, { QCSAP_PARAM_MAX_ASSOC, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setMaxAssoc" }, { QCSAP_PARAM_HIDE_SSID, @@ -3848,9 +4289,7 @@ static const struct iw_priv_args hostapd_private_args[] = { { QCSAP_PARAM_ACL_MODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setAclMode" }, { QCSAP_IOCTL_GET_STAWPAIE, - IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, 0, "get_staWPAIE" }, - { QCSAP_IOCTL_SETWPAIE, - IW_PRIV_TYPE_BYTE | QCSAP_MAX_WSC_IE | IW_PRIV_SIZE_FIXED, 0, "setwpaie" }, + 0, IW_PRIV_TYPE_BYTE | DOT11F_IE_RSN_MAX_LEN, "get_staWPAIE" }, { QCSAP_IOCTL_STOPBSS, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED, 0, "stopbss" }, { QCSAP_IOCTL_VERSION, 0, @@ -3946,7 +4385,6 @@ static const iw_handler hostapd_private[] = { [QCSAP_IOCTL_SETPARAM - SIOCIWFIRSTPRIV] = iw_softap_setparam, //set priv ioctl [QCSAP_IOCTL_GETPARAM - SIOCIWFIRSTPRIV] = iw_softap_getparam, //get priv ioctl [QCSAP_IOCTL_GET_STAWPAIE - SIOCIWFIRSTPRIV] = iw_get_genie, //get station genIE - [QCSAP_IOCTL_SETWPAIE - SIOCIWFIRSTPRIV] = iw_softap_setwpsie, [QCSAP_IOCTL_STOPBSS - SIOCIWFIRSTPRIV] = iw_softap_stopbss, // stop bss [QCSAP_IOCTL_VERSION - SIOCIWFIRSTPRIV] = iw_softap_version, // get driver version [QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES - SIOCIWFIRSTPRIV] = iw_get_WPSPBCProbeReqIEs, @@ -3954,7 +4392,7 @@ static const iw_handler hostapd_private[] = { [QCSAP_IOCTL_ASSOC_STA_MACADDR - SIOCIWFIRSTPRIV] = iw_softap_getassoc_stamacaddr, [QCSAP_IOCTL_DISASSOC_STA - SIOCIWFIRSTPRIV] = iw_softap_disassoc_sta, [QCSAP_IOCTL_AP_STATS - SIOCIWFIRSTPRIV] = iw_softap_ap_stats, - [QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_three_ints_getnone, + [QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_three_ints_getnone, [QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_var_ints_getnone, [QCSAP_IOCTL_SET_CHANNEL_RANGE - SIOCIWFIRSTPRIV] = iw_softap_set_channel_range, [QCSAP_IOCTL_MODIFY_ACL - SIOCIWFIRSTPRIV] = iw_softap_modify_acl, @@ -4012,7 +4450,7 @@ void hdd_set_ap_ops( struct net_device *pWlanHostapdDev ) } VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) -{ +{ hdd_hostapd_state_t * phostapdBuf; struct net_device *dev = pAdapter->dev; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); @@ -4029,9 +4467,12 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) } ENTER(); - // Allocate the Wireless Extensions state structure + // Allocate the Wireless Extensions state structure phostapdBuf = WLAN_HDD_GET_HOSTAP_STATE_PTR( pAdapter ); - + + spin_lock_init(&pAdapter->sta_hash_lock); + pAdapter->is_sta_id_hash_initialized = VOS_FALSE; + sme_SetCurrDeviceMode(pHddCtx->hHal, pAdapter->device_mode); #ifdef FEATURE_WLAN_CH_AVOID @@ -4065,8 +4506,6 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) return status; } - init_completion(&pAdapter->session_close_comp_var); - init_completion(&pAdapter->session_open_comp_var); sema_init(&(WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->semWpsPBCOverlapInd, 1); @@ -4091,8 +4530,6 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) set_bit(WMM_INIT_DONE, &pAdapter->event_flags); - wlan_hdd_set_monitor_tx_adapter( WLAN_HDD_GET_CTX(pAdapter), pAdapter ); - return status; error_wmm_init: @@ -4107,8 +4544,11 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd hdd_adapter_t *pHostapdAdapter = NULL; v_CONTEXT_t pVosContext= NULL; - pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, ether_setup, NUM_TX_QUEUES); - + pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) + NET_NAME_UNKNOWN, +#endif + ether_setup, NUM_TX_QUEUES); if (pWlanHostapdDev != NULL) { pHostapdAdapter = netdev_priv(pWlanHostapdDev); @@ -4142,13 +4582,6 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev ; pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy; pHostapdAdapter->wdev.netdev = pWlanHostapdDev; - init_completion(&pHostapdAdapter->tx_action_cnf_event); - init_completion(&pHostapdAdapter->cancel_rem_on_chan_var); - init_completion(&pHostapdAdapter->rem_on_chan_ready_event); - init_completion(&pHostapdAdapter->ula_complete); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) - init_completion(&pHostapdAdapter->offchannel_tx_event); -#endif SET_NETDEV_DEV(pWlanHostapdDev, pHddCtx->parent_dev); } @@ -4192,7 +4625,7 @@ VOS_STATUS hdd_register_hostapd( hdd_adapter_t *pAdapter, tANI_U8 rtnl_lock_held return status; } -VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter) +VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held) { ENTER(); @@ -4203,7 +4636,16 @@ VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter) detatch the wireless device handlers */ if (pAdapter->dev) { - pAdapter->dev->wireless_handlers = NULL; + if (TRUE == rtnl_held) + { + pAdapter->dev->wireless_handlers = NULL; + } + else + { + rtnl_lock(); + pAdapter->dev->wireless_handlers = NULL; + rtnl_unlock(); + } } EXIT(); return 0; diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c index 834dec805edf..3f943dab277d 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ \brief WLAN Host Device Driver implementation - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -123,6 +120,7 @@ int wlan_hdd_ftm_start(hdd_context_t *pAdapter); #endif #include "wlan_hdd_debugfs.h" #include "sapInternal.h" +#include "wlan_hdd_request_manager.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -153,7 +151,6 @@ static struct kparam_string fwpath = { static char *country_code; static int enable_11d = -1; static int enable_dfs_chan_scan = -1; -static int gbcnMissRate = -1; #ifndef MODULE static int wlan_hdd_inited; @@ -197,9 +194,8 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, //wait time for beacon miss rate. #define BCN_MISS_RATE_TIME 500 -#ifdef WLAN_OPEN_SOURCE -static struct wake_lock wlan_wake_lock; -#endif +static vos_wake_lock_t wlan_wake_lock; + /* set when SSR is needed after unload */ static e_hdd_ssr_required isSsrRequired = HDD_SSR_NOT_REQUIRED; @@ -211,7 +207,14 @@ void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback); void hdd_set_wlan_suspend_mode(bool suspend); v_U16_t hdd_select_queue(struct net_device *dev, - struct sk_buff *skb); + struct sk_buff *skb +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + , void *accel_priv +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + , select_queue_fallback_t fallback +#endif +); #ifdef WLAN_FEATURE_PACKET_FILTERING static void hdd_set_multicast_list(struct net_device *dev); @@ -229,6 +232,11 @@ static VOS_STATUS hdd_parse_reassoc_command_data(tANI_U8 *pValue, tANI_U8 *pTargetApBssid, tANI_U8 *pChannel); #endif + +/* Store WLAN driver info in a global variable such that crash debugger + can extract it from driver debug symbol and crashdump for post processing */ +tANI_U8 g_wlan_driver[ ] = "pronto_driver"; + #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) VOS_STATUS hdd_parse_get_cckm_ie(tANI_U8 *pValue, tANI_U8 **pCckmIe, tANI_U8 *pCckmIeLen); #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ @@ -251,7 +259,7 @@ const char * hdd_device_modetoString(v_U8_t device_mode) } } -static int hdd_netdev_notifier_call(struct notifier_block * nb, +static int __hdd_netdev_notifier_call(struct notifier_block * nb, unsigned long state, void *ndev) { @@ -352,6 +360,17 @@ static int hdd_netdev_notifier_call(struct notifier_block * nb, return NOTIFY_DONE; } +static int hdd_netdev_notifier_call(struct notifier_block * nb, + unsigned long state, + void *ndev) +{ + int ret; + vos_ssr_protect(__func__); + ret = __hdd_netdev_notifier_call( nb, state, ndev); + vos_ssr_unprotect(__func__); + return ret; +} + struct notifier_block hdd_netdev_notifier = { .notifier_call = hdd_netdev_notifier_call, }; @@ -463,25 +482,26 @@ static void hdd_wdi_trace_enable(wpt_moduleid moduleId, v_U32_t bitmask) */ int wlan_hdd_validate_context(hdd_context_t *pHddCtx) { - ENTER(); if (NULL == pHddCtx || NULL == pHddCtx->cfg_ini) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: HDD context is Null", __func__); return -ENODEV; } if (pHddCtx->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: LOGP in Progress. Ignore!!!", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: LOGP %s. Ignore!!", __func__, + vos_is_wlan_in_badState(VOS_MODULE_ID_HDD, NULL) + ?"failed":"in Progress"); return -EAGAIN; } if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return -EAGAIN; } @@ -1185,7 +1205,7 @@ static void hdd_batch_scan_result_ind_callback if ((NULL == pBatchScanRsp) || (NULL == pReq)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: pBatchScanRsp is %p pReq %p", __func__, pBatchScanRsp, pReq); + "%s: pBatchScanRsp is %pK pReq %pK", __func__, pBatchScanRsp, pReq); isLastAp = TRUE; goto done; } @@ -1209,7 +1229,7 @@ static void hdd_batch_scan_result_ind_callback if (NULL == pScanList) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: pScanList is %p", __func__, pScanList); + "%s: pScanList is %pK", __func__, pScanList); isLastAp = TRUE; goto done; } @@ -1236,7 +1256,7 @@ static void hdd_batch_scan_result_ind_callback if (NULL == pApMetaInfo) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: pApMetaInfo is %p", __func__, pApMetaInfo); + "%s: pApMetaInfo is %pK", __func__, pApMetaInfo); isLastAp = TRUE; goto done; } @@ -1685,12 +1705,12 @@ int hdd_handle_batch_scan_ioctl int ret = 0; hdd_context_t *pHddCtx; + ENTER(); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid!", __func__); goto exit; } @@ -1913,53 +1933,93 @@ int hdd_handle_batch_scan_ioctl } exit: - + EXIT(); return ret; } #endif/*End of FEATURE_WLAN_BATCH_SCAN*/ -static void getBcnMissRateCB(VOS_STATUS status, int bcnMissRate, void *data) +struct bcn_miss_rate_priv { + int bcn_miss_rate; +}; + +/** + * get_bcn_miss_rate_cb() callback invoked on receiving beacon miss + * rate from firmware + * @status: Status of get beacon miss rate operation + * @bcnMissRate: Beacon miss rate + * @context: Context passed while registering callback + * + * This function is invoked by WDA layer on receiving + * WDI_GET_BCN_MISS_RATE_RSP + * + * Return: None + */ +static void get_bcn_miss_rate_cb(VOS_STATUS status, int bcnMissRate, + void *context) { - bcnMissRateContext_t *pCBCtx; + struct hdd_request *request; + struct bcn_miss_rate_priv *priv; - if (NULL == data) - { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("argument data is NULL")); - return; - } + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); + priv = hdd_request_priv(request); - pCBCtx = (bcnMissRateContext_t *)data; - gbcnMissRate = -1; + if (VOS_STATUS_SUCCESS == status) + priv->bcn_miss_rate = bcnMissRate; + else + hddLog(VOS_TRACE_LEVEL_ERROR, FL("failed to get bcnMissRate")); - if (pCBCtx->magic != BCN_MISS_RATE_CONTEXT_MAGIC) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("invalid context magic: %08x"), pCBCtx->magic); - spin_unlock(&hdd_context_lock); - return ; - } + hdd_request_complete(request); + hdd_request_put(request); - if (VOS_STATUS_SUCCESS == status) - { - gbcnMissRate = bcnMissRate; - } - else - { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("failed to get bcnMissRate")); - } + return; +} - complete(&(pCBCtx->completion)); - spin_unlock(&hdd_context_lock); +struct fw_stats_priv { + tSirFwStatsResult *fw_stats; +}; - return; +/** + * hdd_fw_stats_cb() callback invoked on receiving firmware stats + * from firmware + * @status: Status of get firmware stats operation + * @fwStatsResult: firmware stats + * @context: Context passed while registering callback + * + * This function is invoked by WDA layer on receiving + * WDI_GET_FW_STATS_RSP + * + * Return: None + */ +static void hdd_fw_stats_cb(VOS_STATUS status, + tSirFwStatsResult *fwStatsResult, void *context) +{ + struct hdd_request *request; + struct fw_stats_priv *priv; + + hddLog(VOS_TRACE_LEVEL_INFO, FL("with status = %d"),status); + + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } + priv = hdd_request_priv(request); + + if (VOS_STATUS_SUCCESS == status) + *priv->fw_stats = *fwStatsResult; + else + priv->fw_stats = NULL; + + hdd_request_complete(request); + hdd_request_put(request); + return; } static int hdd_get_dwell_time(hdd_config_t *pCfg, tANI_U8 *command, char *extra, tANI_U8 n, tANI_U8 *len) @@ -2012,6 +2072,14 @@ static int hdd_get_dwell_time(hdd_config_t *pCfg, tANI_U8 *command, char *extra, return ret; } +int hdd_drv_cmd_validate(tANI_U8 *command, int len) +{ + if (command[len] != ' ') + return -EINVAL; + + return 0; +} + static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) { tHalHandle hHal; @@ -2034,6 +2102,9 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) if (strncmp(command, "SETDWELLTIME ACTIVE MAX", 23) == 0 ) { + if (hdd_drv_cmd_validate(command, 23)) + return -EINVAL; + value = value + 24; temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN || @@ -2050,6 +2121,9 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) } else if (strncmp(command, "SETDWELLTIME ACTIVE MIN", 23) == 0) { + if (hdd_drv_cmd_validate(command, 23)) + return -EINVAL; + value = value + 24; temp = kstrtou32(value, 10, &val); if (temp !=0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_MIN || @@ -2066,6 +2140,9 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) } else if (strncmp(command, "SETDWELLTIME PASSIVE MAX", 24) == 0) { + if (hdd_drv_cmd_validate(command, 24)) + return -EINVAL; + value = value + 25; temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_PASSIVE_MAX_CHANNEL_TIME_MIN || @@ -2082,6 +2159,9 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) } else if (strncmp(command, "SETDWELLTIME PASSIVE MIN", 24) == 0) { + if (hdd_drv_cmd_validate(command, 24)) + return -EINVAL; + value = value + 25; temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_PASSIVE_MIN_CHANNEL_TIME_MIN || @@ -2098,6 +2178,9 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) } else if (strncmp(command, "SETDWELLTIME", 12) == 0) { + if (hdd_drv_cmd_validate(command, 12)) + return -EINVAL; + value = value + 13; temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN || @@ -2119,6 +2202,81 @@ static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) return ret; } +static int hdd_cmd_setFccChannel(hdd_context_t *pHddCtx, tANI_U8 *cmd, + tANI_U8 cmd_len) +{ + tANI_U8 *value; + tANI_U8 fcc_constraint; + + eHalStatus status; + int ret = 0; + value = cmd + cmd_len + 1; + + ret = kstrtou8(value, 10, &fcc_constraint); + if ((ret < 0) || (fcc_constraint > 1)) { + /* + * If the input value is greater than max value of datatype, + * then also it is a failure + */ + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: value out of range", __func__); + return -EINVAL; + } + + status = sme_handleSetFccChannel(pHddCtx->hHal, fcc_constraint); + if (status != eHAL_STATUS_SUCCESS) + ret = -EPERM; + + return ret; +} + +/**--------------------------------------------------------------------------- + + \brief hdd_enable_disable_ca_event() - When Host sends IOCTL (enabled), + FW will send *ONE* CA ind to Host(even though it is duplicate). + When Host send IOCTL (disable), FW doesn't perform any action. + Whenever any change in CA *and* WLAN is in SAP/P2P-GO mode, FW + sends CA ind to host. (regard less of IOCTL status) + \param - pHddCtx - HDD context + \param - command - command received from framework + \param - cmd_len - len of the command + + \return - 0 on success, appropriate error values on failure. + + --------------------------------------------------------------------------*/ +int hdd_enable_disable_ca_event(hdd_context_t *pHddCtx, tANI_U8* command, tANI_U8 cmd_len) +{ + tANI_U8 set_value; + int ret = 0; + eHalStatus status; + + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + ret = -EINVAL; + goto exit; + } + + if (pHddCtx->cfg_ini->gOptimizeCAevent == 0) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "Enable gOptimizeCAevent" + " ini param to control channel avooidance indication"); + ret = 0; + goto exit; + } + + set_value = command[cmd_len + 1] - '0'; + status = sme_enableDisableChanAvoidIndEvent(pHddCtx->hHal, set_value); + if (status != eHAL_STATUS_SUCCESS) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Failed to send" + " enableDisableChanAoidance command to SME\n", __func__); + ret = -EINVAL; + } + +exit: + return ret; +} static int hdd_driver_command(hdd_adapter_t *pAdapter, hdd_priv_data_t *ppriv_data) @@ -2129,6 +2287,11 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, hdd_scaninfo_t *pScanInfo = NULL; int ret = 0; int status; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + struct cfg80211_mgmt_tx_params params; +#endif + + ENTER(); /* * Note that valid pointers are provided by caller */ @@ -2148,9 +2311,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); - return status; + ret = -EINVAL; + goto exit; } /* Allocate +1 for '\0' */ command = kmalloc(priv_data.total_len + 1, GFP_KERNEL); @@ -2201,27 +2363,55 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, { tANI_U8 *ptr = command ; + ret = hdd_drv_cmd_validate(command, 7); + if (ret) + goto exit; + /* Change band request received */ /* First 8 bytes will have "SETBAND " and * 9 byte will have band setting value */ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: SetBandCommand Info comm %s UL %d, TL %d", __func__, command, priv_data.used_len, priv_data.total_len); - /* Change band request received */ - ret = hdd_setBand_helper(pAdapter->dev, ptr); - if(ret < 0) - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: failed to set band ret=%d", __func__, ret); + if(VOS_FTM_MODE != hdd_get_conparam()) + { + /* Change band request received */ + ret = hdd_setBand_helper(pAdapter->dev, ptr); + if(ret < 0) + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: failed to set band ret=%d", __func__, ret); + } } else if(strncmp(command, "SETWMMPS", 8) == 0) { tANI_U8 *ptr = command; + + ret = hdd_drv_cmd_validate(command, 8); + if (ret) + goto exit; + ret = hdd_wmmps_helper(pAdapter, ptr); } + + else if(strncmp(command, "TDLSSCAN", 8) == 0) + { + tANI_U8 *ptr = command; + + ret = hdd_drv_cmd_validate(command, 8); + if (ret) + goto exit; + + ret = hdd_set_tdls_scan_type(pAdapter, ptr); + } + else if ( strncasecmp(command, "COUNTRY", 7) == 0 ) { char *country_code; + ret = hdd_drv_cmd_validate(command, 7); + if (ret) + goto exit; + country_code = command + 8; INIT_COMPLETION(pAdapter->change_country_code); @@ -2268,7 +2458,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, else if(strncmp(command, "SETSUSPENDMODE", 14) == 0) { int suspend = 0; - tANI_U8 *ptr = (tANI_U8*)command + 15; + tANI_U8 *ptr; + + ret = hdd_drv_cmd_validate(command, 14); + if (ret) + goto exit; + + ptr = (tANI_U8*)command + 15; suspend = *ptr - '0'; MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -2284,6 +2480,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 lookUpThreshold = CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_DEFAULT; eHalStatus status = eHAL_STATUS_SUCCESS; + ret = hdd_drv_cmd_validate(command, 14); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMTRIGGER */ value = value + 15; @@ -2347,7 +2547,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, TRACE_CODE_HDD_GETROAMTRIGGER_IOCTL, pAdapter->sessionId, lookUpThreshold)); len = scnprintf(extra, sizeof(extra), "%s %d", command, rssi); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2361,6 +2562,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 roamScanPeriod = 0; tANI_U16 neighborEmptyScanRefreshPeriod = CFG_EMPTY_SCAN_REFRESH_PERIOD_DEFAULT; + ret = hdd_drv_cmd_validate(command, 17); + if (ret) + goto exit; + /* input refresh period is in terms of seconds */ /* Move pointer to ahead of SETROAMSCANPERIOD */ value = value + 18; @@ -2414,8 +2619,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETROAMSCANPERIOD", (nEmptyScanRefreshPeriod/1000)); /* Returned value is in units of seconds */ - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -2428,6 +2633,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 roamScanRefreshPeriod = 0; tANI_U16 neighborScanRefreshPeriod = CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_DEFAULT; + ret = hdd_drv_cmd_validate(command, 24); + if (ret) + goto exit; + /* input refresh period is in terms of seconds */ /* Move pointer to ahead of SETROAMSCANREFRESHPERIOD */ value = value + 25; @@ -2476,8 +2685,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETROAMSCANREFRESHPERIOD", (value/1000)); /* Returned value is in units of seconds */ - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -2491,6 +2700,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_BOOLEAN roamMode = CFG_LFR_FEATURE_ENABLED_DEFAULT; + ret = hdd_drv_cmd_validate(command, SIZE_OF_SETROAMMODE); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMMODE */ value = value + SIZE_OF_SETROAMMODE + 1; @@ -2537,7 +2750,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, sme_UpdateIsFastRoamIniFeatureEnabled((tHalHandle)(pHddCtx->hHal), roamMode); } /* GETROAMMODE */ - else if (strncmp(priv_data.buf, "GETROAMMODE", SIZE_OF_GETROAMMODE) == 0) + else if (strncmp(command, "GETROAMMODE", SIZE_OF_GETROAMMODE) == 0) { tANI_BOOLEAN roamMode = sme_getIsLfrFeatureEnabled((tHalHandle)(pHddCtx->hHal)); char extra[32]; @@ -2552,8 +2765,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, roamMode = CFG_LFR_FEATURE_ENABLED_MIN; len = scnprintf(extra, sizeof(extra), "%s %d", command, roamMode); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -2568,6 +2781,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 roamRssiDiff = CFG_ROAM_RSSI_DIFF_DEFAULT; + ret = hdd_drv_cmd_validate(command, 12); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMDELTA */ value = value + 13; /* Convert the value from ascii to integer */ @@ -2602,7 +2819,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pHddCtx->cfg_ini->RoamRssiDiff = roamRssiDiff; sme_UpdateRoamRssiDiff((tHalHandle)(pHddCtx->hHal), roamRssiDiff); } - else if (strncmp(priv_data.buf, "GETROAMDELTA", 12) == 0) + else if (strncmp(command, "GETROAMDELTA", 12) == 0) { tANI_U8 roamRssiDiff = sme_getRoamRssiDiff((tHalHandle)(pHddCtx->hHal)); char extra[32]; @@ -2613,8 +2830,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pAdapter->sessionId, roamRssiDiff)); len = scnprintf(extra, sizeof(extra), "%s %d", command, roamRssiDiff); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -2634,8 +2851,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, TRACE_CODE_HDD_GETBAND_IOCTL, pAdapter->sessionId, band)); len = scnprintf(extra, sizeof(extra), "%s %d", command, band); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -2708,7 +2925,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, ChannelList[j]); } - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2737,7 +2955,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETCCXMODE", eseMode); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2766,7 +2985,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETOKCMODE", okcMode); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2782,7 +3002,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETFASTROAM", lfrMode); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2798,7 +3019,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", "GETFASTTRANSITION", ft); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2811,6 +3033,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 minTime = CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_DEFAULT; + ret = hdd_drv_cmd_validate(command, 25); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMSCANCHANNELMINTIME */ value = value + 26; /* Convert the value from ascii to integer */ @@ -2944,6 +3170,16 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, vos_mem_free(buf); buf = NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + params.chan = &chan; + params.offchan = 0; + params.wait = dwellTime; + params.buf = finalBuf; + params.len = finalLen; + params.no_cck = 1; + params.dont_wait_for_ack = 1; + ret = wlan_hdd_mgmt_tx(NULL, &pAdapter->wdev, ¶ms, &cookie); +#else wlan_hdd_mgmt_tx( NULL, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) &(pAdapter->wdev), @@ -2956,6 +3192,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, #endif dwellTime, finalBuf, finalLen, 1, 1, &cookie ); +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)*/ vos_mem_free(finalBuf); } else if (strncmp(command, "GETROAMSCANCHANNELMINTIME", 25) == 0) @@ -2970,7 +3207,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL, pAdapter->sessionId, val)); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -2983,6 +3221,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U16 maxTime = CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_DEFAULT; + ret = hdd_drv_cmd_validate(command, 18); + if (ret) + goto exit; + /* Move pointer to ahead of SETSCANCHANNELTIME */ value = value + 19; /* Convert the value from ascii to integer */ @@ -3026,7 +3268,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* value is interms of msec */ len = scnprintf(extra, sizeof(extra), "%s %d", "GETSCANCHANNELTIME", val); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -3039,6 +3282,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U16 val = CFG_NEIGHBOR_SCAN_TIMER_PERIOD_DEFAULT; + ret = hdd_drv_cmd_validate(command, 15); + if (ret) + goto exit; + /* Move pointer to ahead of SETSCANHOMETIME */ value = value + 16; /* Convert the value from ascii to integer */ @@ -3082,7 +3329,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* value is interms of msec */ len = scnprintf(extra, sizeof(extra), "%s %d", "GETSCANHOMETIME", val); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -3095,6 +3343,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 val = CFG_ROAM_INTRA_BAND_DEFAULT; + ret = hdd_drv_cmd_validate(command, 16); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMINTRABAND */ value = value + 17; /* Convert the value from ascii to integer */ @@ -3137,7 +3389,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* value is interms of msec */ len = scnprintf(extra, sizeof(extra), "%s %d", "GETROAMINTRABAND", val); - if (copy_to_user(priv_data.buf, &extra, len + 1)) + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); @@ -3150,6 +3403,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 nProbes = CFG_ROAM_SCAN_N_PROBES_DEFAULT; + ret = hdd_drv_cmd_validate(command, 14); + if (ret) + goto exit; + /* Move pointer to ahead of SETSCANNPROBES */ value = value + 15; /* Convert the value from ascii to integer */ @@ -3184,15 +3441,15 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pHddCtx->cfg_ini->nProbes = nProbes; sme_UpdateRoamScanNProbes((tHalHandle)(pHddCtx->hHal), nProbes); } - else if (strncmp(priv_data.buf, "GETSCANNPROBES", 14) == 0) + else if (strncmp(command, "GETSCANNPROBES", 14) == 0) { tANI_U8 val = sme_getRoamScanNProbes((tHalHandle)(pHddCtx->hHal)); char extra[32]; tANI_U8 len = 0; len = scnprintf(extra, sizeof(extra), "%s %d", command, val); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -3204,6 +3461,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U16 homeAwayTime = CFG_ROAM_SCAN_HOME_AWAY_TIME_DEFAULT; + ret = hdd_drv_cmd_validate(command, 19); + if (ret) + goto exit; + /* Move pointer to ahead of SETSCANHOMEAWAYTIME */ /* input value is in units of msec */ value = value + 20; @@ -3241,15 +3502,15 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, sme_UpdateRoamScanHomeAwayTime((tHalHandle)(pHddCtx->hHal), homeAwayTime, eANI_BOOLEAN_TRUE); } } - else if (strncmp(priv_data.buf, "GETSCANHOMEAWAYTIME", 19) == 0) + else if (strncmp(command, "GETSCANHOMEAWAYTIME", 19) == 0) { tANI_U16 val = sme_getRoamScanHomeAwayTime((tHalHandle)(pHddCtx->hHal)); char extra[32]; tANI_U8 len = 0; len = scnprintf(extra, sizeof(extra), "%s %d", command, val); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -3316,6 +3577,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_BOOLEAN wesMode = CFG_ENABLE_WES_MODE_NAME_DEFAULT; + ret = hdd_drv_cmd_validate(command, 10); + if (ret) + goto exit; + /* Move pointer to ahead of SETWESMODE */ value = value + 11; /* Convert the value from ascii to integer */ @@ -3349,15 +3614,15 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pHddCtx->cfg_ini->isWESModeEnabled = wesMode; sme_UpdateWESMode((tHalHandle)(pHddCtx->hHal), wesMode); } - else if (strncmp(priv_data.buf, "GETWESMODE", 10) == 0) + else if (strncmp(command, "GETWESMODE", 10) == 0) { tANI_BOOLEAN wesMode = sme_GetWESMode((tHalHandle)(pHddCtx->hHal)); char extra[32]; tANI_U8 len = 0; len = scnprintf(extra, sizeof(extra), "%s %d", command, wesMode); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -3371,6 +3636,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 lfrMode = CFG_LFR_FEATURE_ENABLED_DEFAULT; + ret = hdd_drv_cmd_validate(command, 11); + if (ret) + goto exit; + /* Move pointer to ahead of SETFASTROAM */ value = value + 12; /* Convert the value from ascii to integer */ @@ -3412,6 +3681,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 ft = CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT; + ret = hdd_drv_cmd_validate(command, 17); + if (ret) + goto exit; + /* Move pointer to ahead of SETFASTROAM */ value = value + 18; /* Convert the value from ascii to integer */ @@ -3446,7 +3719,65 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pHddCtx->cfg_ini->isFastTransitionEnabled = ft; sme_UpdateFastTransitionEnabled((tHalHandle)(pHddCtx->hHal), ft); } + else if (strncmp(command, "SETDFSSCANMODE", 14) == 0) + { + tANI_U8 *value = command; + tANI_U8 dfsScanMode = DFS_CHNL_SCAN_ENABLED_NORMAL; + + ret = hdd_drv_cmd_validate(command, 14); + if (ret) + goto exit; + + /* Move pointer to ahead of SETDFSSCANMODE */ + value = value + 15; + /* Convert the value from ascii to integer */ + ret = kstrtou8(value, 10, &dfsScanMode); + if (ret < 0) + { + /* If the input value is greater than max value of + datatype, then also kstrtou8 fails + */ + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: kstrtou8 failed range [%d - %d]", __func__, + CFG_ENABLE_DFS_CHNL_SCAN_MIN, + CFG_ENABLE_DFS_CHNL_SCAN_MAX); + ret = -EINVAL; + goto exit; + } + + if ((dfsScanMode < CFG_ENABLE_DFS_CHNL_SCAN_MIN) || + (dfsScanMode > CFG_ENABLE_DFS_CHNL_SCAN_MAX)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "dfsScanMode value %d is out of range" + " (Min: %d Max: %d)", dfsScanMode, + CFG_ENABLE_DFS_CHNL_SCAN_MIN, + CFG_ENABLE_DFS_CHNL_SCAN_MAX); + ret = -EINVAL; + goto exit; + } + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Received Command to Set DFS Scan Mode = %d", + __func__, dfsScanMode); + + ret = wlan_hdd_handle_dfs_chan_scan(pHddCtx, dfsScanMode); + } + else if (strncmp(command, "GETDFSSCANMODE", 14) == 0) + { + tANI_U8 dfsScanMode = sme_GetDFSScanMode(pHddCtx->hHal); + char extra[32]; + tANI_U8 len = 0; + len = scnprintf(extra, sizeof(extra), "%s %d", command, dfsScanMode); + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: failed to copy data to user buffer", __func__); + ret = -EFAULT; + goto exit; + } + } else if (strncmp(command, "FASTREASSOC", 11) == 0) { tANI_U8 *value = command; @@ -3507,7 +3838,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* Proceed with scan/roam */ smeIssueFastRoamNeighborAPEvent(WLAN_HDD_GET_HAL_CTX(pAdapter), &targetApBssid[0], - (tSmeFastRoamTrigger)(trigger)); + (tSmeFastRoamTrigger)(trigger), + channel); } #endif #ifdef FEATURE_WLAN_ESE @@ -3516,6 +3848,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 eseMode = CFG_ESE_FEATURE_ENABLED_DEFAULT; + ret = hdd_drv_cmd_validate(command, 10); + if (ret) + goto exit; + /* Check if the features OKC/ESE/11R are supported simultaneously, then this operation is not permitted (return FAILURE) */ if (sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)) && @@ -3567,6 +3903,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_BOOLEAN roamScanControl = 0; + ret = hdd_drv_cmd_validate(command, 18); + if (ret) + goto exit; + /* Move pointer to ahead of SETROAMSCANCONTROL */ value = value + 19; /* Convert the value from ascii to integer */ @@ -3600,6 +3940,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tANI_U8 okcMode = CFG_OKC_FEATURE_ENABLED_DEFAULT; + ret = hdd_drv_cmd_validate(command, 10); + if (ret) + goto exit; + /* Check if the features OKC/ESE/11R are supported simultaneously, then this operation is not permitted (return FAILURE) */ if (sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)) && @@ -3647,7 +3991,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, pHddCtx->cfg_ini->isOkcIniFeatureEnabled = okcMode; } #endif /* FEATURE_WLAN_OKC */ - else if (strncmp(priv_data.buf, "GETROAMSCANCONTROL", 18) == 0) + else if (strncmp(command, "GETROAMSCANCONTROL", 18) == 0) { tANI_BOOLEAN roamScanControl = sme_GetRoamScanControl((tHalHandle)(pHddCtx->hHal)); char extra[32]; @@ -3655,8 +3999,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, roamScanControl); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -3669,6 +4013,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 filterType = 0; tANI_U8 *value = command; + ret = hdd_drv_cmd_validate(command, 21); + if (ret) + goto exit; + /* Move pointer to ahead of ENABLE_PKTFILTER_IPV6 */ value = value + 22; @@ -3701,6 +4049,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, char *dhcpPhase; int ret; + ret = hdd_drv_cmd_validate(command, 10); + if (ret) + goto exit; + dhcpPhase = command + 11; if ('1' == *dhcpPhase) { @@ -3750,6 +4102,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, memset(extra, 0, sizeof(extra)); ret = hdd_get_dwell_time(pCfg, command, extra, sizeof(extra), &len); + len = VOS_MIN(priv_data.total_len, len + 1); if (ret != 0 || copy_to_user(priv_data.buf, &extra, len + 1)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -3767,6 +4120,11 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, { tANI_U8 filterType = 0; tANI_U8 *value; + + ret = hdd_drv_cmd_validate(command, 8); + if (ret) + goto exit; + value = command + 9; /* Convert the value from ascii to integer */ @@ -3812,6 +4170,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tSirRateUpdateInd *rateUpdate; eHalStatus status; + ret = hdd_drv_cmd_validate(command, 9); + if (ret) + goto exit; + /* Only valid for SAP mode */ if (WLAN_HDD_SOFTAP != pAdapter->device_mode) { @@ -3907,6 +4269,10 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tAniTrafStrmMetrics tsmMetrics; pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + ret = hdd_drv_cmd_validate(command, 11); + if (ret) + goto exit; + /* if not associated, return error */ if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { @@ -3981,8 +4347,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tsmMetrics.UplinkPktLoss, tsmMetrics.UplinkPktCount, tsmMetrics.RoamingCount, tsmMetrics.RoamingDly); - if (copy_to_user(priv_data.buf, &extra, len + 1)) - { + len = VOS_MIN(priv_data.total_len, len + 1); + if (copy_to_user(priv_data.buf, &extra, len)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; @@ -4056,8 +4422,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, { eHalStatus status; char buf[32], len; - long waitRet; - bcnMissRateContext_t getBcnMissRateCtx; + void *cookie; + struct hdd_request *request; + struct bcn_miss_rate_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -4069,56 +4440,78 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, goto exit; } - init_completion(&(getBcnMissRateCtx.completion)); - getBcnMissRateCtx.magic = BCN_MISS_RATE_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + ret = -ENOMEM; + goto exit; + } + cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); + priv->bcn_miss_rate = -1; status = sme_getBcnMissRate((tHalHandle)(pHddCtx->hHal), pAdapter->sessionId, - (void *)getBcnMissRateCB, - (void *)(&getBcnMissRateCtx)); + (void *)get_bcn_miss_rate_cb, + cookie); if( eHAL_STATUS_SUCCESS != status) { hddLog(VOS_TRACE_LEVEL_INFO, FL("GETBCNMISSRATE: fail to post WDA cmd")); ret = -EINVAL; - goto exit; + goto free_bcn_miss_rate_req; } - waitRet = wait_for_completion_interruptible_timeout - (&getBcnMissRateCtx.completion, BCN_MISS_RATE_TIME); - if(waitRet <= 0) + ret = hdd_request_wait_for_response(request); + if(ret) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("failed to wait on bcnMissRateComp %d"), ret); - //Make magic number to zero so that callback is not called. - spin_lock(&hdd_context_lock); - getBcnMissRateCtx.magic = 0x0; - spin_unlock(&hdd_context_lock); ret = -EINVAL; - goto exit; + goto free_bcn_miss_rate_req; } hddLog(VOS_TRACE_LEVEL_INFO, - FL("GETBCNMISSRATE: bcnMissRate: %d"), gbcnMissRate); + FL("GETBCNMISSRATE: bcnMissRate: %d"), priv->bcn_miss_rate); + + if (priv->bcn_miss_rate == -1) { + ret = -EFAULT; + goto free_bcn_miss_rate_req; + } - len = snprintf(buf, sizeof(buf), "GETBCNMISSRATE %d", gbcnMissRate); + len = snprintf(buf, sizeof(buf), "GETBCNMISSRATE %d", + priv->bcn_miss_rate); if (copy_to_user(priv_data.buf, &buf, len + 1)) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; - goto exit; + goto free_bcn_miss_rate_req; } ret = len; + +free_bcn_miss_rate_req: + hdd_request_put(request); } #ifdef FEATURE_WLAN_TDLS else if (strncmp(command, "TDLSSECONDARYCHANNELOFFSET", 26) == 0) { tANI_U8 *value = command; int set_value; + + ret = hdd_drv_cmd_validate(command, 26); + if (ret) + goto exit; + /* Move pointer to ahead of TDLSOFFCH*/ value += 26; - sscanf(value, "%d", &set_value); + if (!(sscanf(value, "%d", &set_value))) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("No input identified")); + ret = -EINVAL; + goto exit; + } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Tdls offchannel offset:%d", __func__, set_value); @@ -4132,9 +4525,20 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "TDLSOFFCHANNELMODE", 18) == 0) { tANI_U8 *value = command; int set_value; + + ret = hdd_drv_cmd_validate(command, 18); + if (ret) + goto exit; + /* Move pointer to ahead of tdlsoffchnmode*/ value += 18; - sscanf(value, "%d", &set_value); + ret = sscanf(value, "%d", &set_value); + if (ret != 1) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("No input identified")); + ret = -EINVAL; + goto exit; + } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Tdls offchannel mode:%d", __func__, set_value); @@ -4147,10 +4551,22 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "TDLSOFFCHANNEL", 14) == 0) { tANI_U8 *value = command; int set_value; + + ret = hdd_drv_cmd_validate(command, 14); + if (ret) + goto exit; + /* Move pointer to ahead of TDLSOFFCH*/ value += 14; - sscanf(value, "%d", &set_value); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + ret = sscanf(value, "%d", &set_value); + if (ret != 1) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "Wrong value is given for hdd_set_tdls_offchannel"); + ret = -EINVAL; + goto exit; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Tdls offchannel num: %d", __func__, set_value); ret = iw_set_tdlsoffchannel(pHddCtx, set_value); @@ -4161,15 +4577,186 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } } #endif + else if (strncmp(command, "GETFWSTATS", 10) == 0) + { + eHalStatus status; + char *buf = NULL; + char len; + tSirFwStatsResult *fwStatsRsp = &(pAdapter->fwStatsRsp), + *fw_stats_result; + tANI_U8 *ptr = command; + int stats; + void *cookie; + struct hdd_request *request; + struct fw_stats_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; + + ret = hdd_drv_cmd_validate(command, 10); + if (ret) + goto exit; + + stats = *(ptr + 11) - '0'; + hddLog(VOS_TRACE_LEVEL_INFO, FL("stats = %d "),stats); + if (!IS_FEATURE_FW_STATS_ENABLE) + { + hddLog(VOS_TRACE_LEVEL_INFO, + FL("Get Firmware stats feature not supported")); + ret = -EINVAL; + goto exit; + } + + if (FW_STATS_MAX <= stats || 0 >= stats) + { + hddLog(VOS_TRACE_LEVEL_INFO, + FL(" stats %d not supported"),stats); + ret = -EINVAL; + goto exit; + } + + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + ret = -ENOMEM; + goto exit; + } + cookie = hdd_request_cookie(request); + + status = sme_GetFwStats( (tHalHandle)pHddCtx->hHal, stats, + cookie, hdd_fw_stats_cb); + if (eHAL_STATUS_SUCCESS != status) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL(" fail to post WDA cmd status = %d"), status); + ret = -EINVAL; + hdd_request_put(request); + goto exit; + } + ret = hdd_request_wait_for_response(request); + if (ret) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on GwtFwstats")); + ret = -EINVAL; + hdd_request_put(request); + goto exit; + } + + priv = hdd_request_priv(request); + fw_stats_result = priv->fw_stats; + fwStatsRsp->type = 0; + if (NULL != fw_stats_result) + { + switch (fw_stats_result->type ) + { + case FW_UBSP_STATS: + { + tSirUbspFwStats *stats = + &fwStatsRsp->fwStatsData.ubspStats; + memcpy(fwStatsRsp, fw_stats_result, + sizeof(tSirFwStatsResult)); + hddLog(VOS_TRACE_LEVEL_INFO, + FL("ubsp_enter_cnt = %d ubsp_jump_ddr_cnt = %d"), + stats->ubsp_enter_cnt, + stats->ubsp_jump_ddr_cnt); + } + break; + + default: + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("No handling for stats type %d"), + fw_stats_result->type); + } + } + } + hdd_request_put(request); + + if (fwStatsRsp->type) + { + buf = kmalloc(FW_STATE_RSP_LEN, GFP_KERNEL); + if (!buf) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL(" failed to allocate memory")); + ret = -ENOMEM; + goto exit; + } + switch( fwStatsRsp->type ) + { + case FW_UBSP_STATS: + { + len = snprintf(buf, FW_STATE_RSP_LEN, + "GETFWSTATS: ubsp_enter_cnt %d ubsp_jump_ddr_cnt %d", + fwStatsRsp->fwStatsData.ubspStats.ubsp_enter_cnt, + fwStatsRsp->fwStatsData.ubspStats.ubsp_jump_ddr_cnt); + } + break; + default: + { + hddLog(VOS_TRACE_LEVEL_ERROR, FL( "No handling for stats type %d"),fwStatsRsp->type); + ret = -EFAULT; + kfree(buf); + goto exit; + } + } + if (copy_to_user(priv_data.buf, buf, len + 1)) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL(" failed to copy data to user buffer")); + ret = -EFAULT; + kfree(buf); + goto exit; + } + ret = len; + kfree(buf); + } + else + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("failed to fetch the stats")); + ret = -EFAULT; + goto exit; + } + + } + else if (strncasecmp(command, "SET_FCC_CHANNEL", 15) == 0) + { + ret = hdd_drv_cmd_validate(command, 15); + if (ret) + goto exit; + + /* + * this command wld be called by user-space when it detects WLAN + * ON after airplane mode is set. When APM is set, WLAN turns off. + * But it can be turned back on. Otherwise; when APM is turned back + * off, WLAN wld turn back on. So at that point the command is + * expected to come down. 0 means disable, 1 means enable. The + * constraint is removed when parameter 1 is set or different + * country code is set + */ + ret = hdd_cmd_setFccChannel(pHddCtx, command, 15); + } + else if (strncasecmp(command, "DISABLE_CA_EVENT", 16) == 0) + { + ret = hdd_drv_cmd_validate(command, 16); + if (ret) + goto exit; + + ret = hdd_enable_disable_ca_event(pHddCtx, command, 16); + } else { MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_UNSUPPORTED_IOCTL, pAdapter->sessionId, 0)); - hddLog( VOS_TRACE_LEVEL_WARN, "%s: Unsupported GUI command %s", - __func__, command); + hddLog( VOS_TRACE_LEVEL_WARN, FL("Unsupported GUI command %s"), + command); } } exit: + EXIT(); if (command) { kfree(command); @@ -4235,6 +4822,8 @@ int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) hdd_context_t *pHddCtx; int ret; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, @@ -4257,8 +4846,6 @@ int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: invalid context", __func__); ret = -EBUSY; goto exit; } @@ -4277,6 +4864,7 @@ int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) break; } exit: + EXIT(); return ret; } @@ -4291,6 +4879,11 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return ret; } +int hdd_mon_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + return 0; +} + #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) /**--------------------------------------------------------------------------- @@ -4316,7 +4909,8 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, tCsrEseBeaconReq *pEseBcnReq) { tANI_U8 *inPtr = pValue; - int tempInt = 0; + uint8_t input = 0; + uint32_t tempInt = 0; int j = 0, i = 0, v = 0; char buf[32]; @@ -4338,17 +4932,18 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, /*no argument followed by spaces*/ if ('\0' == *inPtr) return -EINVAL; - /*getting the first argument ie measurement token*/ + /*getting the first argument ie Number of IE fields */ v = sscanf(inPtr, "%31s ", buf); if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtos8(buf, 10, &input); if ( v < 0) return -EINVAL; - pEseBcnReq->numBcnReqIe = tempInt; + input = VOS_MIN(input, SIR_ESE_MAX_MEAS_IE_REQS); + pEseBcnReq->numBcnReqIe = input; + + hddLog(LOG1, "Number of Bcn Req Ie fields: %d", pEseBcnReq->numBcnReqIe); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, - "Number of Bcn Req Ie fields(%d)", pEseBcnReq->numBcnReqIe); for (j = 0; j < (pEseBcnReq->numBcnReqIe); j++) { @@ -4368,27 +4963,27 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, v = sscanf(inPtr, "%31s ", buf); if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtou32(buf, 10, &tempInt); if (v < 0) return -EINVAL; switch (i) { case 0: /* Measurement token */ - if (tempInt <= 0) + if (!tempInt) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "Invalid Measurement Token(%d)", tempInt); + "Invalid Measurement Token: %u", tempInt); return -EINVAL; } pEseBcnReq->bcnReq[j].measurementToken = tempInt; break; case 1: /* Channel number */ - if ((tempInt <= 0) || + if ((!tempInt) || (tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "Invalid Channel Number(%d)", tempInt); + "Invalid Channel Number: %u", tempInt); return -EINVAL; } pEseBcnReq->bcnReq[j].channel = tempInt; @@ -4398,18 +4993,18 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, if ((tempInt < eSIR_PASSIVE_SCAN) || (tempInt > eSIR_BEACON_TABLE)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "Invalid Scan Mode(%d) Expected{0|1|2}", tempInt); + "Invalid Scan Mode(%u) Expected{0|1|2}", tempInt); return -EINVAL; } pEseBcnReq->bcnReq[j].scanMode= tempInt; break; case 3: /* Measurement duration */ - if (((tempInt <= 0) && (pEseBcnReq->bcnReq[j].scanMode != eSIR_BEACON_TABLE)) || - ((tempInt < 0) && (pEseBcnReq->bcnReq[j].scanMode == eSIR_BEACON_TABLE))) + if (((!tempInt) && (pEseBcnReq->bcnReq[j].scanMode != eSIR_BEACON_TABLE)) || + ((pEseBcnReq->bcnReq[j].scanMode == eSIR_BEACON_TABLE))) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "Invalid Measurement Duration(%d)", tempInt); + "Invalid Measurement Duration: %u", tempInt); return -EINVAL; } pEseBcnReq->bcnReq[j].measurementDuration = tempInt; @@ -4432,72 +5027,47 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue, return VOS_STATUS_SUCCESS; } -static void hdd_GetTsmStatsCB( tAniTrafStrmMetrics tsmMetrics, const tANI_U32 staId, void *pContext ) -{ - struct statsContext *pStatsContext = NULL; - hdd_adapter_t *pAdapter = NULL; - - if (NULL == pContext) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pContext [%p]", - __func__, pContext); - return; - } +struct tsm_priv { + tAniTrafStrmMetrics tsm_metrics; +}; - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); +static void hdd_get_tsm_stats_cb(tAniTrafStrmMetrics tsm_metrics, + const tANI_U32 sta_id, void *context) +{ + struct hdd_request *request; + struct tsm_priv *priv; - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - if ((NULL == pAdapter) || (STATS_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - return; - } + ENTER(); - /* context is valid so caller is still waiting */ + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* copy over the tsm stats */ - pAdapter->tsmStats.UplinkPktQueueDly = tsmMetrics.UplinkPktQueueDly; - vos_mem_copy(pAdapter->tsmStats.UplinkPktQueueDlyHist, - tsmMetrics.UplinkPktQueueDlyHist, - sizeof(pAdapter->tsmStats.UplinkPktQueueDlyHist)/ - sizeof(pAdapter->tsmStats.UplinkPktQueueDlyHist[0])); - pAdapter->tsmStats.UplinkPktTxDly = tsmMetrics.UplinkPktTxDly; - pAdapter->tsmStats.UplinkPktLoss = tsmMetrics.UplinkPktLoss; - pAdapter->tsmStats.UplinkPktCount = tsmMetrics.UplinkPktCount; - pAdapter->tsmStats.RoamingCount = tsmMetrics.RoamingCount; - pAdapter->tsmStats.RoamingDly = tsmMetrics.RoamingDly; + priv = hdd_request_priv(request); + priv->tsm_metrics = tsm_metrics; - /* notify the caller */ - complete(&pStatsContext->completion); + hdd_request_complete(request); + hdd_request_put(request); - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + EXIT(); } - - - static VOS_STATUS hdd_get_tsm_stats(hdd_adapter_t *pAdapter, const tANI_U8 tid, tAniTrafStrmMetrics* pTsmMetrics) { hdd_station_ctx_t *pHddStaCtx = NULL; eHalStatus hstatus; VOS_STATUS vstatus = VOS_STATUS_SUCCESS; - long lrc; - struct statsContext context; hdd_context_t *pHddCtx = NULL; + int ret; + void *cookie; + struct hdd_request *request; + struct tsm_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { @@ -4508,16 +5078,18 @@ static VOS_STATUS hdd_get_tsm_stats(hdd_adapter_t *pAdapter, const tANI_U8 tid, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - /* we are connected prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); /* query tsm stats */ - hstatus = sme_GetTsmStats(pHddCtx->hHal, hdd_GetTsmStatsCB, + hstatus = sme_GetTsmStats(pHddCtx->hHal, hdd_get_tsm_stats_cb, pHddStaCtx->conn_info.staId[ 0 ], pHddStaCtx->conn_info.bssId, - &context, pHddCtx->pvosContext, tid); + cookie, pHddCtx->pvosContext, tid); if (eHAL_STATUS_SUCCESS != hstatus) { @@ -4528,45 +5100,21 @@ static VOS_STATUS hdd_get_tsm_stats(hdd_adapter_t *pAdapter, const tANI_U8 tid, else { /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: SME %s while retrieving statistics", __func__, (0 == lrc) ? "timeout" : "interrupt"); vstatus = VOS_STATUS_E_TIMEOUT; + } else { + priv = hdd_request_priv(request); + *pTsmMetrics = priv->tsm_metrics; } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); - if (VOS_STATUS_SUCCESS == vstatus) - { - pTsmMetrics->UplinkPktQueueDly = pAdapter->tsmStats.UplinkPktQueueDly; - vos_mem_copy(pTsmMetrics->UplinkPktQueueDlyHist, - pAdapter->tsmStats.UplinkPktQueueDlyHist, - sizeof(pAdapter->tsmStats.UplinkPktQueueDlyHist)/ - sizeof(pAdapter->tsmStats.UplinkPktQueueDlyHist[0])); - pTsmMetrics->UplinkPktTxDly = pAdapter->tsmStats.UplinkPktTxDly; - pTsmMetrics->UplinkPktLoss = pAdapter->tsmStats.UplinkPktLoss; - pTsmMetrics->UplinkPktCount = pAdapter->tsmStats.UplinkPktCount; - pTsmMetrics->RoamingCount = pAdapter->tsmStats.RoamingCount; - pTsmMetrics->RoamingDly = pAdapter->tsmStats.RoamingDly; - } return vstatus; } #endif /*FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ @@ -5181,6 +5729,7 @@ int __hdd_open(struct net_device *dev) VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Enabling Tx Queues", __func__); /* Enable TX queues only when we are connected */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues(dev); } @@ -5209,7 +5758,7 @@ int hdd_open(struct net_device *dev) return ret; } -int hdd_mon_open (struct net_device *dev) +int __hdd_mon_open (struct net_device *dev) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -5219,10 +5768,25 @@ int hdd_mon_open (struct net_device *dev) return -EINVAL; } - netif_start_queue(dev); - return 0; } + +int hdd_mon_open (struct net_device *dev) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __hdd_mon_open(dev); + vos_ssr_unprotect(__func__); + + return ret; +} + +int hdd_mon_stop(struct net_device *dev) +{ + return 0; +} + /**--------------------------------------------------------------------------- \brief __hdd_stop() - HDD stop function @@ -5249,15 +5813,13 @@ int __hdd_stop (struct net_device *dev) "%s: pAdapter is Null", __func__); return -ENODEV; } - MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_OPEN_REQUEST, + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_STOP_REQUEST, pAdapter->sessionId, pAdapter->device_mode)); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid!", __func__); return ret; } @@ -5276,6 +5838,7 @@ int __hdd_stop (struct net_device *dev) /* Disable TX on the interface, after this hard_start_xmit() will not * be called on that interface */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); /* Mark the interface status as "down" for outside world */ @@ -5295,7 +5858,7 @@ int __hdd_stop (struct net_device *dev) mutex_lock(&pHddCtx->tdls_lock); #endif /* DeInit the adapter. This ensures datapath cleanup as well */ - hdd_deinit_adapter(pHddCtx, pAdapter); + hdd_deinit_adapter(pHddCtx, pAdapter, TRUE); #ifdef FEATURE_WLAN_TDLS mutex_unlock(&pHddCtx->tdls_lock); #endif @@ -5416,7 +5979,7 @@ static void __hdd_uninit (struct net_device *dev) #ifdef FEATURE_WLAN_TDLS mutex_lock(&pHddCtx->tdls_lock); #endif - hdd_deinit_adapter(pHddCtx, pAdapter); + hdd_deinit_adapter(pHddCtx, pAdapter, TRUE); #ifdef FEATURE_WLAN_TDLS mutex_unlock(&pHddCtx->tdls_lock); #endif @@ -5710,11 +6273,26 @@ VOS_STATUS hdd_read_cfg_file(v_VOID_t *pCtx, char *pFileName, static int __hdd_set_mac_address(struct net_device *dev, void *addr) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; struct sockaddr *psta_mac_addr = addr; eHalStatus halStatus = eHAL_STATUS_SUCCESS; + int ret = 0; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } memcpy(&pAdapter->macAddressCurrent, psta_mac_addr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); @@ -5796,12 +6374,12 @@ void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr) }; static struct net_device_ops wlan_mon_drv_ops = { .ndo_open = hdd_mon_open, - .ndo_stop = hdd_stop, + .ndo_stop = hdd_mon_stop, .ndo_uninit = hdd_uninit, .ndo_start_xmit = hdd_mon_hard_start_xmit, .ndo_tx_timeout = hdd_tx_timeout, .ndo_get_stats = hdd_stats, - .ndo_do_ioctl = hdd_ioctl, + .ndo_do_ioctl = hdd_mon_ioctl, .ndo_set_mac_address = hdd_set_mac_address, }; @@ -5823,6 +6401,15 @@ void hdd_set_station_ops( struct net_device *pWlanDev ) #endif } +void hdd_set_ibss_ops( hdd_adapter_t *pAdapter ) +{ + #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) + wlan_drv_ops.ndo_start_xmit = hdd_ibss_hard_start_xmit; + #else + pAdapter->dev->hard_start_xmit = hdd_ibss_hard_start_xmit; + #endif +} + static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMacAddr macAddr, const char* name ) { struct net_device *pWlanDev = NULL; @@ -5830,8 +6417,11 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac /* * cfg80211 initialization and registration.... */ - pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, ether_setup, NUM_TX_QUEUES); - + pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) + NET_NAME_UNKNOWN, +#endif + ether_setup, NUM_TX_QUEUES); if(pWlanDev != NULL) { @@ -5845,32 +6435,7 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac pAdapter->magic = WLAN_HDD_ADAPTER_MAGIC; spin_lock_init(&pAdapter->lock_for_active_session); - init_completion(&pAdapter->session_open_comp_var); - init_completion(&pAdapter->session_close_comp_var); - init_completion(&pAdapter->disconnect_comp_var); - init_completion(&pAdapter->linkup_event_var); - init_completion(&pAdapter->cancel_rem_on_chan_var); - init_completion(&pAdapter->rem_on_chan_ready_event); - init_completion(&pAdapter->pno_comp_var); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) - init_completion(&pAdapter->offchannel_tx_event); -#endif - init_completion(&pAdapter->tx_action_cnf_event); -#ifdef FEATURE_WLAN_TDLS - init_completion(&pAdapter->tdls_add_station_comp); - init_completion(&pAdapter->tdls_del_station_comp); - init_completion(&pAdapter->tdls_mgmt_comp); - init_completion(&pAdapter->tdls_link_establish_req_comp); -#endif - init_completion(&pHddCtx->mc_sus_event_var); - init_completion(&pHddCtx->tx_sus_event_var); - init_completion(&pHddCtx->rx_sus_event_var); - init_completion(&pAdapter->ula_complete); - init_completion(&pAdapter->change_country_code); - #ifdef FEATURE_WLAN_BATCH_SCAN - init_completion(&pAdapter->hdd_set_batch_scan_req_var); - init_completion(&pAdapter->hdd_get_batch_scan_req_var); pAdapter->pBatchScanRsp = NULL; pAdapter->numScanList = 0; pAdapter->batchScanState = eHDD_BATCH_SCAN_STATE_STOPPED; @@ -5993,6 +6558,9 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) VOS_STATUS status = VOS_STATUS_E_FAILURE; long rc = 0; + spin_lock_init( &pAdapter->sta_hash_lock); + pAdapter->is_sta_id_hash_initialized = VOS_FALSE; + INIT_COMPLETION(pAdapter->session_open_comp_var); sme_SetCurrDeviceMode(pHddCtx->hHal, pAdapter->device_mode); //Open a SME session for future operation @@ -6028,12 +6596,13 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) status = VOS_STATUS_E_FAILURE; goto error_register_wext; } + //Safe to register the hard_start_xmit function again -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - wlan_drv_ops.ndo_start_xmit = hdd_hard_start_xmit; -#else - pWlanDev->hard_start_xmit = hdd_hard_start_xmit; -#endif + #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) + wlan_drv_ops.ndo_start_xmit = hdd_hard_start_xmit; + #else + pWlanDev->hard_start_xmit = hdd_hard_start_xmit; + #endif //Set the Connection State to Not Connected hddLog(VOS_TRACE_LEVEL_INFO, @@ -6067,23 +6636,8 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) set_bit(WMM_INIT_DONE, &pAdapter->event_flags); -#ifdef FEATURE_WLAN_TDLS - if(0 != wlan_hdd_sta_tdls_init(pAdapter)) - { - status = VOS_STATUS_E_FAILURE; - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wlan_hdd_sta_tdls_init failed",__func__); - goto error_tdls_init; - } - set_bit(TDLS_INIT_DONE, &pAdapter->event_flags); -#endif - return VOS_STATUS_SUCCESS; -#ifdef FEATURE_WLAN_TDLS -error_tdls_init: - clear_bit(WMM_INIT_DONE, &pAdapter->event_flags); - hdd_wmm_adapter_close(pAdapter); -#endif error_wmm_init: clear_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags); hdd_deinit_tx_rx(pAdapter); @@ -6094,7 +6648,7 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) { INIT_COMPLETION(pAdapter->session_close_comp_var); if (eHAL_STATUS_SUCCESS == sme_CloseSession(pHddCtx->hHal, - pAdapter->sessionId, + pAdapter->sessionId, VOS_TRUE, hdd_smeCloseSessionCallback, pAdapter)) { unsigned long rc; @@ -6127,19 +6681,30 @@ void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT)); if (rc <= 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s ERROR: HDD Wait for Action Confirmation Failed!! %ld" - , __func__, rc); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s ERROR: HDD Wait for Action Confirmation Failed!! %ld" + , __func__, rc); + + // Inform tx status as FAILURE to upper layer and free cfgState->buf + hdd_sendActionCnf( pAdapter, FALSE ); } } return; } -void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) +void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ) { ENTER(); switch ( pAdapter->device_mode ) { + case WLAN_HDD_IBSS: + { + if(test_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags)) + { + hdd_ibss_deinit_tx_rx( pAdapter ); + clear_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags); + } + } case WLAN_HDD_INFRA_STATION: case WLAN_HDD_P2P_CLIENT: case WLAN_HDD_P2P_DEVICE: @@ -6157,14 +6722,6 @@ void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) } hdd_cleanup_actionframe(pHddCtx, pAdapter); -#ifdef FEATURE_WLAN_TDLS - if(test_bit(TDLS_INIT_DONE, &pAdapter->event_flags)) - { - wlan_hdd_tdls_exit(pAdapter); - clear_bit(TDLS_INIT_DONE, &pAdapter->event_flags); - } -#endif - break; } @@ -6180,24 +6737,18 @@ void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) hdd_cleanup_actionframe(pHddCtx, pAdapter); - hdd_unregister_hostapd(pAdapter); + hdd_unregister_hostapd(pAdapter, rtnl_held); hdd_set_conparam( 0 ); - wlan_hdd_set_monitor_tx_adapter( WLAN_HDD_GET_CTX(pAdapter), NULL ); break; } case WLAN_HDD_MONITOR: { - hdd_adapter_t* pAdapterforTx = pAdapter->sessionCtx.monitor.pAdapterForTx; if(test_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags)) { hdd_deinit_tx_rx( pAdapter ); clear_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags); } - if(NULL != pAdapterforTx) - { - hdd_cleanup_actionframe(pHddCtx, pAdapterforTx); - } break; } @@ -6313,7 +6864,9 @@ void hdd_set_pwrparams(hdd_context_t *pHddCtx) /* switch to the DTIM specified in cfg.ini */ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "Switch to DTIM %d", powerRequest.uListenInterval); + "Switch to DTIM %d Listen interval %d", + powerRequest.uDTIMPeriod, + powerRequest.uListenInterval); sme_SetPowerParams( pHddCtx->hHal, &powerRequest, TRUE); break; @@ -6348,7 +6901,11 @@ void hdd_reset_pwrparams(hdd_context_t *pHddCtx) VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx) { VOS_STATUS status = VOS_STATUS_SUCCESS; - + if (WLAN_HDD_IS_UNLOAD_IN_PROGRESS(pHddCtx)) + { + hddLog( LOGE, FL("Wlan Unload in progress")); + return VOS_STATUS_E_PERM; + } if(pHddCtx->cfg_ini->fIsBmpsEnabled) { sme_EnablePowerSave(pHddCtx->hHal, ePMC_BEACON_MODE_POWER_SAVE); @@ -6482,6 +7039,35 @@ VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type) return status; } +void hdd_mon_post_msg_cb(void *context) +{ + struct hdd_request *request; + + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } + + hdd_request_complete(request); + hdd_request_put(request); +} + +void hdd_init_mon_mode (hdd_adapter_t *pAdapter) + { + hdd_mon_ctx_t *pMonCtx = NULL; + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + + pMonCtx->state = 0; + pMonCtx->ChannelNo = 1; + pMonCtx->ChannelBW = 20; + pMonCtx->crcCheckEnabled = 1; + pMonCtx->typeSubtypeBitmap = 0xFFFF00000000; + pMonCtx->is80211to803ConReq = 1; + pMonCtx->numOfMacFilters = 0; + } + + hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, const char *iface_name, tSirMacAddr macAddr, tANI_U8 rtnl_held ) @@ -6544,6 +7130,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, mutex_unlock(&pHddCtx->tdls_lock); #endif + hdd_initialize_adapter_common(pAdapter); status = hdd_init_station_mode( pAdapter ); if( VOS_STATUS_SUCCESS != status ) goto err_free_netdev; @@ -6554,7 +7141,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, #ifdef FEATURE_WLAN_TDLS mutex_lock(&pHddCtx->tdls_lock); #endif - hdd_deinit_adapter(pHddCtx, pAdapter); + hdd_deinit_adapter(pHddCtx, pAdapter, rtnl_held); #ifdef FEATURE_WLAN_TDLS mutex_unlock(&pHddCtx->tdls_lock); #endif @@ -6562,17 +7149,27 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, } // Workqueue which gets scheduled in IPv4 notification callback. - INIT_WORK(&pAdapter->ipv4NotifierWorkQueue, hdd_ipv4_notifier_work_queue); + vos_init_work(&pAdapter->ipv4NotifierWorkQueue, hdd_ipv4_notifier_work_queue); #ifdef WLAN_NS_OFFLOAD // Workqueue which gets scheduled in IPv6 notification callback. - INIT_WORK(&pAdapter->ipv6NotifierWorkQueue, hdd_ipv6_notifier_work_queue); + vos_init_work(&pAdapter->ipv6NotifierWorkQueue, hdd_ipv6_notifier_work_queue); #endif //Stop the Interface TX queue. + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); //netif_tx_disable(pWlanDev); netif_carrier_off(pAdapter->dev); + if (WLAN_HDD_P2P_CLIENT == session_type || + WLAN_HDD_P2P_DEVICE == session_type) + { + /* Initialize the work queue to defer the + * back to back RoC request */ + vos_init_delayed_work(&pAdapter->roc_work, + hdd_p2p_roc_work_queue); + } + break; } @@ -6592,21 +7189,39 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, NL80211_IFTYPE_P2P_GO; pAdapter->device_mode = session_type; + hdd_initialize_adapter_common(pAdapter); status = hdd_init_ap_mode(pAdapter); if( VOS_STATUS_SUCCESS != status ) goto err_free_netdev; + status = hdd_sta_id_hash_attach(pAdapter); + if (VOS_STATUS_SUCCESS != status) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + FL("failed to attach hash for session %d"), session_type); + hdd_deinit_adapter(pHddCtx, pAdapter, rtnl_held); + goto err_free_netdev; + } + status = hdd_register_hostapd( pAdapter, rtnl_held ); if( VOS_STATUS_SUCCESS != status ) { - hdd_deinit_adapter(pHddCtx, pAdapter); + hdd_deinit_adapter(pHddCtx, pAdapter, rtnl_held); goto err_free_netdev; } - + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); hdd_set_conparam( 1 ); + + if (WLAN_HDD_P2P_GO == session_type) + { + /* Initialize the work queue to + * defer the back to back RoC request */ + INIT_DELAYED_WORK(&pAdapter->roc_work, + hdd_p2p_roc_work_queue); + } break; } case WLAN_HDD_MONITOR: @@ -6619,34 +7234,33 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, return NULL; } + // Register wireless extensions + if( VOS_STATUS_SUCCESS != (status = hdd_register_wext(pAdapter->dev))) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + "hdd_register_wext() failed with status code %08d [x%08x]", + status, status ); + status = VOS_STATUS_E_FAILURE; + } + pAdapter->wdev.iftype = NL80211_IFTYPE_MONITOR; pAdapter->device_mode = session_type; - status = hdd_register_interface( pAdapter, rtnl_held ); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29) pAdapter->dev->netdev_ops = &wlan_mon_drv_ops; #else pAdapter->dev->open = hdd_mon_open; pAdapter->dev->hard_start_xmit = hdd_mon_hard_start_xmit; + pAdapter->dev->stop = hdd_mon_stop; + pAdapter->dev->do_ioctl = hdd_mon_ioctl; #endif + status = hdd_register_interface( pAdapter, rtnl_held ); + hdd_init_mon_mode( pAdapter ); + hdd_initialize_adapter_common(pAdapter); hdd_init_tx_rx( pAdapter ); set_bit(INIT_TX_RX_SUCCESS, &pAdapter->event_flags); - //Set adapter to be used for data tx. It will use either GO or softap. - pAdapter->sessionCtx.monitor.pAdapterForTx = - hdd_get_adapter(pAdapter->pHddCtx, WLAN_HDD_SOFTAP); - if (NULL == pAdapter->sessionCtx.monitor.pAdapterForTx) - { - pAdapter->sessionCtx.monitor.pAdapterForTx = - hdd_get_adapter(pAdapter->pHddCtx, WLAN_HDD_P2P_GO); - } - /* This workqueue will be used to transmit management packet over - * monitor interface. */ - if (NULL == pAdapter->sessionCtx.monitor.pAdapterForTx) { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s:Failed:hdd_get_adapter",__func__); - return NULL; - } - - INIT_WORK(&pAdapter->sessionCtx.monitor.pAdapterForTx->monTxWorkQueue, - hdd_mon_tx_work_queue); + //Stop the Interface TX queue. + netif_tx_disable(pAdapter->dev); + netif_carrier_off(pAdapter->dev); } break; case WLAN_HDD_FTM: @@ -6666,9 +7280,11 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, pAdapter->device_mode = session_type; status = hdd_register_interface( pAdapter, rtnl_held ); + hdd_initialize_adapter_common(pAdapter); hdd_init_tx_rx( pAdapter ); //Stop the Interface TX queue. + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); } @@ -6684,7 +7300,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, if( VOS_STATUS_SUCCESS == status ) { - //Add it to the hdd's session list. + //Add it to the hdd's session list. pHddAdapterNode = vos_mem_malloc( sizeof( hdd_adapter_list_node_t ) ); if( NULL == pHddAdapterNode ) { @@ -6867,6 +7483,7 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, union iwreq_data wrqu; v_U8_t retry = 0; long ret; + VOS_STATUS status; if (pHddCtx->isLogpInProgress) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, @@ -6879,11 +7496,25 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, pScanInfo = &pHddCtx->scan_info; switch(pAdapter->device_mode) { + case WLAN_HDD_IBSS: + if ( VOS_TRUE == bCloseSession ) + { + status = hdd_sta_id_hash_detach(pAdapter); + if (status != VOS_STATUS_SUCCESS) + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sta id hash detach failed")); + } + case WLAN_HDD_INFRA_STATION: case WLAN_HDD_P2P_CLIENT: case WLAN_HDD_P2P_DEVICE: { hdd_station_ctx_t *pstation = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); +#ifdef FEATURE_WLAN_TDLS + mutex_lock(&pHddCtx->tdls_lock); + wlan_hdd_tdls_exit(pAdapter, TRUE); + mutex_unlock(&pHddCtx->tdls_lock); +#endif if( hdd_connIsConnected(pstation) || (pstation->conn_info.connState == eConnectionState_Connecting) ) { @@ -6935,7 +7566,8 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId, eCSR_SCAN_ABORT_DEFAULT); } - if (pAdapter->device_mode != WLAN_HDD_INFRA_STATION) + if ((pAdapter->device_mode != WLAN_HDD_INFRA_STATION) && + (pAdapter->device_mode != WLAN_HDD_IBSS)) { while (pAdapter->is_roc_inprogress) { @@ -6950,24 +7582,26 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: ROC completion is not received.!!!", __func__); - sme_CancelRemainOnChannel(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId); + if (eHAL_STATUS_SUCCESS != + sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter), + pAdapter->sessionId )) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Cancel Remain on Channel")); + } wait_for_completion_interruptible_timeout( &pAdapter->cancel_rem_on_chan_var, msecs_to_jiffies(WAIT_CANCEL_REM_CHAN)); break; } } + vos_flush_delayed_work(&pAdapter->roc_work); } #ifdef WLAN_NS_OFFLOAD -#ifdef WLAN_OPEN_SOURCE - cancel_work_sync(&pAdapter->ipv6NotifierWorkQueue); -#endif + vos_flush_work(&pAdapter->ipv6NotifierWorkQueue); #endif -#ifdef WLAN_OPEN_SOURCE - cancel_work_sync(&pAdapter->ipv4NotifierWorkQueue); -#endif + vos_flush_work(&pAdapter->ipv4NotifierWorkQueue); /* It is possible that the caller of this function does not * wish to close the session @@ -6977,7 +7611,7 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, { INIT_COMPLETION(pAdapter->session_close_comp_var); if (eHAL_STATUS_SUCCESS == - sme_CloseSession(pHddCtx->hHal, pAdapter->sessionId, + sme_CloseSession(pHddCtx->hHal, pAdapter->sessionId, VOS_FALSE, hdd_smeCloseSessionCallback, pAdapter)) { unsigned long ret; @@ -6998,6 +7632,14 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, case WLAN_HDD_SOFTAP: case WLAN_HDD_P2P_GO: + if ( VOS_TRUE == bCloseSession ) + { + status = hdd_sta_id_hash_detach(pAdapter); + if (status != VOS_STATUS_SUCCESS) + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sta id hash detach failed")); + } + //Any softap specific cleanup here... if (pAdapter->device_mode == WLAN_HDD_P2P_GO) { while (pAdapter->is_roc_inprogress) { @@ -7016,6 +7658,8 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, break; } } + + vos_flush_delayed_work(&pAdapter->roc_work); } mutex_lock(&pHddCtx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags)) @@ -7071,9 +7715,6 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, break; case WLAN_HDD_MONITOR: -#ifdef WLAN_OPEN_SOURCE - cancel_work_sync(&pAdapter->sessionCtx.monitor.pAdapterForTx->monTxWorkQueue); -#endif break; default: @@ -7164,6 +7805,7 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ) while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) { pAdapter = pAdapterNode->pAdapter; + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); netif_carrier_off(pAdapter->dev); @@ -7171,6 +7813,15 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ) hdd_deinit_tx_rx(pAdapter); + if(pAdapter->device_mode == WLAN_HDD_IBSS ) + hdd_ibss_deinit_tx_rx(pAdapter); + + status = hdd_sta_id_hash_detach(pAdapter); + if (status != VOS_STATUS_SUCCESS) + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sta id hash detach failed for session id %d"), + pAdapter->sessionId); + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); if (test_bit(WMM_INIT_DONE, &pAdapter->event_flags)) @@ -7191,6 +7842,11 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ) } #endif +#ifdef FEATURE_WLAN_TDLS + mutex_lock(&pHddCtx->tdls_lock); + wlan_hdd_tdls_exit(pAdapter, TRUE); + mutex_unlock(&pHddCtx->tdls_lock); +#endif status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } @@ -7226,13 +7882,15 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ) connState = (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState; hdd_init_station_mode(pAdapter); + /* Open the gates for HDD to receive Wext commands */ pAdapter->isLinkUpSvcNeeded = FALSE; pHddCtx->scan_info.mScanPending = FALSE; pHddCtx->scan_info.waitScanResult = FALSE; //Trigger the initial scan - hdd_wlan_initial_scan(pAdapter); + if (!pHddCtx->isLogpInProgress) + hdd_wlan_initial_scan(pAdapter); //Indicate disconnect event to supplicant if associated previously if (eConnectionState_Associated == connState || @@ -7313,7 +7971,13 @@ VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ) hddLog(VOS_TRACE_LEVEL_INFO, "%s: Set HDD connState to eConnectionState_NotConnected", __func__); + spin_lock_bh(&pAdapter->lock_for_active_session); + if (eConnectionState_Associated == pHddStaCtx->conn_info.connState) + { + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); + } pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; + spin_unlock_bh(&pAdapter->lock_for_active_session); init_completion(&pAdapter->disconnect_comp_var); sme_RoamDisconnect(pHddCtx->hHal, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); @@ -7431,14 +8095,19 @@ void hdd_set_ssr_required( e_hdd_ssr_required value) isSsrRequired = value; } +void hdd_set_pre_close( hdd_context_t *pHddCtx) +{ + sme_PreClose(pHddCtx->hHal); +} + VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx, hdd_adapter_list_node_t** ppAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_peek_front ( &pHddCtx->hddAdapters, (hdd_list_node_t**) ppAdapterNode ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7447,12 +8116,12 @@ VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx, hdd_adapter_list_node_t** pNextAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_peek_next ( &pHddCtx->hddAdapters, (hdd_list_node_t*) pAdapterNode, (hdd_list_node_t**)pNextAdapterNode ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7460,10 +8129,10 @@ VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx, hdd_adapter_list_node_t* pAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_remove_node ( &pHddCtx->hddAdapters, &pAdapterNode->node ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7471,10 +8140,10 @@ VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx, hdd_adapter_list_node_t** ppAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_remove_front( &pHddCtx->hddAdapters, (hdd_list_node_t**) ppAdapterNode ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7482,10 +8151,10 @@ VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx, hdd_adapter_list_node_t* pAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_insert_back ( &pHddCtx->hddAdapters, (hdd_list_node_t*) pAdapterNode ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7493,10 +8162,10 @@ VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx, hdd_adapter_list_node_t* pAdapterNode) { VOS_STATUS status; - spin_lock(&pHddCtx->hddAdapters.lock); + spin_lock_bh(&pHddCtx->hddAdapters.lock); status = hdd_list_insert_front ( &pHddCtx->hddAdapters, (hdd_list_node_t*) pAdapterNode ); - spin_unlock(&pHddCtx->hddAdapters.lock); + spin_unlock_bh(&pHddCtx->hddAdapters.lock); return status; } @@ -7551,6 +8220,34 @@ hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ) } +hdd_adapter_t *hdd_get_adapter_by_sme_session_id( hdd_context_t *pHddCtx, + tANI_U32 sme_session_id ) +{ + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_adapter_t *pAdapter; + VOS_STATUS vos_status; + + + vos_status = hdd_get_front_adapter( pHddCtx, &pAdapterNode); + + while ((NULL != pAdapterNode) && (VOS_STATUS_SUCCESS == vos_status)) + { + pAdapter = pAdapterNode->pAdapter; + + if (pAdapter->sessionId == sme_session_id) + return pAdapter; + + vos_status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: sme_session_id %d does not exist with host", + __func__, sme_session_id); + + return NULL; +} + hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; @@ -7601,28 +8298,6 @@ hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ) } -/**--------------------------------------------------------------------------- - - \brief hdd_set_monitor_tx_adapter() - - - This API initializes the adapter to be used while transmitting on monitor - adapter. - - \param - pHddCtx - Pointer to the HDD context. - pAdapter - Adapter that will used for TX. This can be NULL. - \return - None. - --------------------------------------------------------------------------*/ -void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) -{ - hdd_adapter_t *pMonAdapter; - - pMonAdapter = hdd_get_adapter( pHddCtx, WLAN_HDD_MONITOR ); - - if( NULL != pMonAdapter ) - { - pMonAdapter->sessionCtx.monitor.pAdapterForTx = pAdapter; - } -} /**--------------------------------------------------------------------------- \brief hdd_get_operating_channel() - @@ -7679,36 +8354,45 @@ v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ) #ifdef WLAN_FEATURE_PACKET_FILTERING /**--------------------------------------------------------------------------- - \brief hdd_set_multicast_list() - + \brief __hdd_set_multicast_list() - This used to set the multicast address list. \param - dev - Pointer to the WLAN device. - skb - Pointer to OS packet (sk_buff). - \return - success/fail + \return - success/fail --------------------------------------------------------------------------*/ -static void hdd_set_multicast_list(struct net_device *dev) +static void __hdd_set_multicast_list(struct net_device *dev) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int mc_count; - int i = 0; + int i = 0, ret = 0; struct netdev_hw_addr *ha; + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter context is Null", __func__); return; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return; + } if (dev->flags & IFF_ALLMULTI) { hddLog(VOS_TRACE_LEVEL_INFO, "%s: allow all multicast frames", __func__); pAdapter->mc_addr_list.mc_cnt = 0; } - else + else { mc_count = netdev_mc_count(dev); hddLog(VOS_TRACE_LEVEL_INFO, @@ -7729,13 +8413,22 @@ static void hdd_set_multicast_list(struct net_device *dev) memset(&(pAdapter->mc_addr_list.addr[i][0]), 0, ETH_ALEN); memcpy(&(pAdapter->mc_addr_list.addr[i][0]), ha->addr, ETH_ALEN); hddLog(VOS_TRACE_LEVEL_INFO, "%s: mlist[%d] = "MAC_ADDRESS_STR, - __func__, i, + __func__, i, MAC_ADDR_ARRAY(pAdapter->mc_addr_list.addr[i])); i++; } } + + EXIT(); return; } + +static void hdd_set_multicast_list(struct net_device *dev) +{ + vos_ssr_protect(__func__); + __hdd_set_multicast_list(dev); + vos_ssr_unprotect(__func__); +} #endif /**--------------------------------------------------------------------------- @@ -7751,7 +8444,14 @@ static void hdd_set_multicast_list(struct net_device *dev) --------------------------------------------------------------------------*/ v_U16_t hdd_select_queue(struct net_device *dev, - struct sk_buff *skb) + struct sk_buff *skb +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + , void *accel_priv +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + , select_queue_fallback_t fallback +#endif +) { return hdd_wmm_select_queue(dev, skb); } @@ -7822,6 +8522,27 @@ void hdd_wlan_initial_scan(hdd_adapter_t *pAdapter) vos_mem_free(scanReq.ChannelInfo.ChannelList); } +void hdd_purge_cmd_list_all_adapters( hdd_context_t *pHddCtx ) +{ + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + VOS_STATUS status; + hdd_adapter_t *pAdapter; + + ENTER(); + + status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); + + while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) + { + pAdapter = pAdapterNode->pAdapter; + + status = sme_PurgeCmdList(pHddCtx->hHal, pAdapter->sessionId); + status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); + pAdapterNode = pNext; + } + + EXIT(); +} /**--------------------------------------------------------------------------- \brief hdd_full_power_callback() - HDD full power callback function @@ -7840,12 +8561,12 @@ static void hdd_full_power_callback(void *callbackContext, eHalStatus status) struct statsContext *pContext = callbackContext; hddLog(VOS_TRACE_LEVEL_INFO, - "%s: context = %p, status = %d", __func__, pContext, status); + "%s: context = %pK, status = %d", __func__, pContext, status); if (NULL == callbackContext) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, context [%p]", + "%s: Bad param, context [%pK]", __func__, callbackContext); return; } @@ -7878,6 +8599,154 @@ static void hdd_full_power_callback(void *callbackContext, eHalStatus status) spin_unlock(&hdd_context_lock); } +void wlan_hdd_mon_set_typesubtype( hdd_mon_ctx_t *pMonCtx,int type) +{ + pMonCtx->typeSubtypeBitmap = 0; + if( type%10 ) /* Management Packets */ + pMonCtx->typeSubtypeBitmap |= 0xFFFF; + type/=10; + if( type%10 ) /* Control Packets */ + pMonCtx->typeSubtypeBitmap |= 0xFFFF0000; + type/=10; + if( type%10 ) /* Data Packets */ + pMonCtx->typeSubtypeBitmap |= 0xFFFF00000000; +} + +VOS_STATUS wlan_hdd_mon_postMsg(void *context, hdd_mon_ctx_t *pMonCtx, + void* callback) +{ + vos_msg_t monMsg; + tSirMonModeReq *pMonModeReq; + + if (MON_MODE_START == pMonCtx->state) + monMsg.type = WDA_MON_START_REQ; + else if (MON_MODE_STOP == pMonCtx->state) + monMsg.type = WDA_MON_STOP_REQ; + else { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("invalid monitor state %d"), pMonCtx->state); + return VOS_STATUS_E_FAILURE; + } + + pMonModeReq = vos_mem_malloc(sizeof(tSirMonModeReq)); + if (pMonModeReq == NULL) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("fail to allocate memory for monitor mode req")); + return VOS_STATUS_E_FAILURE; + } + + pMonModeReq->context = context; + pMonModeReq->data = pMonCtx; + pMonModeReq->callback = callback; + + monMsg.reserved = 0; + monMsg.bodyptr = pMonModeReq; + monMsg.bodyval = 0; + + if (VOS_STATUS_SUCCESS != vos_mq_post_message( + VOS_MODULE_ID_WDA,(vos_msg_t *)&monMsg)) { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: : Failed to post Msg to HAL",__func__); + vos_mem_free(pMonModeReq); + } + return VOS_STATUS_SUCCESS; +} + +void wlan_hdd_mon_close(hdd_context_t *pHddCtx) +{ + VOS_STATUS vosStatus; + v_CONTEXT_t pVosContext = pHddCtx->pvosContext; + hdd_mon_ctx_t *pMonCtx = NULL; + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; + + hdd_adapter_t *pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_MONITOR); + if(pAdapter == NULL || pVosContext == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:pAdapter is NULL",__func__); + return ; + } + + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + if (pMonCtx!= NULL && pMonCtx->state == MON_MODE_START) { + pMonCtx->state = MON_MODE_STOP; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return; + } + cookie = hdd_request_cookie(request); + + if (VOS_STATUS_SUCCESS != + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to post MON MODE REQ")); + pMonCtx->state = MON_MODE_START; + goto req_put; + } + + ret = hdd_request_wait_for_response(request); + if (ret) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("timeout on monitor mode completion %d"), ret); + +req_put: + hdd_request_put(request); + } + + hdd_UnregisterWext(pAdapter->dev); + + vos_mon_stop( pVosContext ); + + vosStatus = vos_sched_close( pVosContext ); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: Failed to close VOSS Scheduler",__func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + + vosStatus = vos_nv_close(); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to close NV", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + + vos_close(pVosContext); + + #ifdef WLAN_KD_READY_NOTIFIER + nl_srv_exit(pHddCtx->ptt_pid); + #else + nl_srv_exit(); + #endif + + hdd_close_all_adapters( pHddCtx ); +} +/** + * hdd_wlan_free_wiphy_channels - free Channel pointer for wiphy + * @ wiphy: the wiphy to validate against + * + * Return: void + */ +void hdd_wlan_free_wiphy_channels(struct wiphy *wiphy) +{ + int i =0; + for (i = 0; i < IEEE80211_NUM_BANDS; i++) + { + if (NULL != wiphy->bands[i] && + (NULL != wiphy->bands[i]->channels)) + { + vos_mem_free(wiphy->bands[i]->channels); + wiphy->bands[i]->channels = NULL; + } + } +} /**--------------------------------------------------------------------------- \brief hdd_wlan_exit() - HDD WLAN exit function @@ -7902,18 +8771,32 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) ENTER(); -#ifdef WLAN_NS_OFFLOAD - hddLog(LOGE, FL("Unregister IPv6 notifier")); - unregister_inet6addr_notifier(&pHddCtx->ipv6_notifier); -#endif - hddLog(LOGE, FL("Unregister IPv4 notifier")); - unregister_inetaddr_notifier(&pHddCtx->ipv4_notifier); - if (VOS_FTM_MODE != hdd_get_conparam()) + if (VOS_MONITOR_MODE == hdd_get_conparam()) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: MONITOR MODE",__func__); + wlan_hdd_mon_close(pHddCtx); + goto free_hdd_ctx; + } + else if (VOS_FTM_MODE != hdd_get_conparam()) { // Unloading, restart logic is no more required. wlan_hdd_restart_deinit(pHddCtx); +#ifdef FEATURE_WLAN_TDLS + /* At the time of driver unloading; if tdls connection is present; + * hdd_rx_packet_cbk calls wlan_hdd_tdls_find_peer. + * wlan_hdd_tdls_find_peer always checks for valid context; + * as load/unload in progress there can be a race condition. + * hdd_rx_packet_cbk calls wlan_hdd_tdls_find_peer only + * when tdls state is enabled. + * As soon as driver set load/unload flag; tdls flag also needs + * to be disabled so that hdd_rx_packet_cbk won't call + * wlan_hdd_tdls_find_peer. + */ + wlan_hdd_tdls_set_mode(pHddCtx, eTDLS_SUPPORT_DISABLED, FALSE); +#endif + vosStatus = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); while (NULL != pAdapterNode && VOS_STATUS_E_EMPTY != vosStatus) { @@ -7923,6 +8806,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) /* Disable TX on the interface, after this hard_start_xmit() will * not be called on that interface */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(pAdapter->dev); /* Mark the interface status as "down" for outside world */ @@ -7934,7 +8818,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) #ifdef FEATURE_WLAN_TDLS mutex_lock(&pHddCtx->tdls_lock); #endif - hdd_deinit_adapter(pHddCtx, pAdapter); + hdd_deinit_adapter(pHddCtx, pAdapter, FALSE); #ifdef FEATURE_WLAN_TDLS mutex_unlock(&pHddCtx->tdls_lock); #endif @@ -7950,6 +8834,10 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) vosStatus = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } + + //Purge all sme cmd's for all interface + hdd_purge_cmd_list_all_adapters(pHddCtx); + // Cancel any outstanding scan requests. We are about to close all // of our adapters, but an adapter structure is what SME passes back // to our callback function. Hence if there are any outstanding scan @@ -7965,18 +8853,34 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) // Power has completed all scans will be cancelled. if (pHddCtx->scan_info.mScanPending) { - hddLog(VOS_TRACE_LEVEL_INFO, - FL("abort scan mode: %d sessionId: %d"), - pAdapter->device_mode, - pAdapter->sessionId); - hdd_abort_mac_scan(pHddCtx, - pHddCtx->scan_info.sessionId, - eCSR_SCAN_ABORT_DEFAULT); + if(NULL != pAdapter) + { + hddLog(VOS_TRACE_LEVEL_INFO, + FL("abort scan mode: %d sessionId: %d"), + pAdapter->device_mode, + pAdapter->sessionId); + } + hdd_abort_mac_scan(pHddCtx, + pHddCtx->scan_info.sessionId, + eCSR_SCAN_ABORT_DEFAULT); } } else { hddLog(VOS_TRACE_LEVEL_INFO,"%s: FTM MODE",__func__); + if (pHddCtx->ftm.ftm_state == WLAN_FTM_STARTING) + { + INIT_COMPLETION(pHddCtx->ftm.startCmpVar); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: in middle of FTM START", __func__); + lrc = wait_for_completion_timeout(&pHddCtx->ftm.startCmpVar, + msecs_to_jiffies(20000)); + if(!lrc) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: timedout on ftmStartCmpVar fatal error", __func__); + } + } wlan_hdd_ftm_close(pHddCtx); goto free_hdd_ctx; } @@ -8045,6 +8949,13 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) /* continue -- need to clean up as much as possible */ } } + if ((eHAL_STATUS_SUCCESS == halStatus) || + (eHAL_STATUS_PMC_PENDING == halStatus && lrc > 0)) + { + /* This will issue a dump command which will clean up + BTQM queues and unblock MC thread */ + vos_fwDumpReq(274, 0, 0, 0, 0, 1); + } /* either we never sent a request, we sent a request and received a response or we sent a request and timed out. if we never sent a @@ -8061,8 +8972,21 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) powerContext.magic = 0; spin_unlock(&hdd_context_lock); + /* If Device is shutdown, no point for SME to wait for responses + from device. Pre Close SME */ + if(wcnss_device_is_shutdown()) + { + sme_PreClose(pHddCtx->hHal); + } hdd_debugfs_exit(pHddCtx); +#ifdef WLAN_NS_OFFLOAD + hddLog(LOG1, FL("Unregister IPv6 notifier")); + unregister_inet6addr_notifier(&pHddCtx->ipv6_notifier); +#endif + hddLog(LOG1, FL("Unregister IPv4 notifier")); + unregister_inetaddr_notifier(&pHddCtx->ipv4_notifier); + // Unregister the Net Device Notifier unregister_netdevice_notifier(&hdd_netdev_notifier); @@ -8084,6 +9008,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Failed to stop VOSS",__func__); VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + VOS_BUG(0); } //This requires pMac access, Call this before vos_close(). @@ -8098,14 +9023,12 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) "%s: Failed to close VOSS Scheduler",__func__); VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } -#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK /* Destroy the wake lock */ - wake_lock_destroy(&pHddCtx->rx_wake_lock); + vos_wake_lock_destroy(&pHddCtx->rx_wake_lock); #endif /* Destroy the wake lock */ - wake_lock_destroy(&pHddCtx->sap_wake_lock); -#endif + vos_wake_lock_destroy(&pHddCtx->sap_wake_lock); #ifdef CONFIG_ENABLE_LINUX_REG vosStatus = vos_nv_close(); @@ -8144,6 +9067,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) hdd_close_all_adapters( pHddCtx ); +free_hdd_ctx: /* free the power on lock from platform driver */ if (free_riva_power_on_lock("wlan")) { @@ -8151,8 +9075,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) __func__); } -free_hdd_ctx: - //Free up dynamically allocated members inside HDD Adapter if (pHddCtx->cfg_ini) { @@ -8160,11 +9082,14 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) pHddCtx->cfg_ini= NULL; } + hdd_request_manager_deinit(); + /* FTM mode, WIPHY did not registered If un-register here, system crash will happen */ if (VOS_FTM_MODE != hdd_get_conparam()) { wiphy_unregister(wiphy) ; + hdd_wlan_free_wiphy_channels(wiphy); } wiphy_free(wiphy) ; if (hdd_is_ssr_required()) @@ -8290,31 +9215,26 @@ VOS_STATUS hdd_post_voss_start_config(hdd_context_t* pHddCtx) } /* wake lock APIs for HDD */ -void hdd_prevent_suspend(void) +void hdd_prevent_suspend(uint32_t reason) { -#ifdef WLAN_OPEN_SOURCE - wake_lock(&wlan_wake_lock); -#else - wcnss_prevent_suspend(); -#endif + + vos_wake_lock_acquire(&wlan_wake_lock, reason); + } -void hdd_allow_suspend(void) +void hdd_allow_suspend(uint32_t reason) { -#ifdef WLAN_OPEN_SOURCE - wake_unlock(&wlan_wake_lock); -#else - wcnss_allow_suspend(); -#endif + + vos_wake_lock_release(&wlan_wake_lock, reason); + } -void hdd_prevent_suspend_timeout(v_U32_t timeout) +void hdd_prevent_suspend_timeout(v_U32_t timeout, uint32_t reason) { -#ifdef WLAN_OPEN_SOURCE - wake_lock_timeout(&wlan_wake_lock, msecs_to_jiffies(timeout)); -#else - /* Do nothing as there is no API in wcnss for timeout*/ -#endif + + vos_wake_lock_timeout_release(&wlan_wake_lock, timeout, + reason); + } /**--------------------------------------------------------------------------- @@ -8461,8 +9381,13 @@ void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len) struct sk_buff *skb; struct nlmsghdr *nlh; tAniMsgHdr *ani_hdr; + int flags = GFP_KERNEL; + void *nl_data = NULL; + + if (in_interrupt() || irqs_disabled() || in_atomic()) + flags = GFP_ATOMIC; - skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), GFP_KERNEL); + skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), flags); if(skb == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -8485,6 +9410,13 @@ void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len) nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr))); skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr))); break; + case WLAN_MSG_RPS_ENABLE_IND: + ani_hdr->length = len; + nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + len)); + nl_data = (char *)ani_hdr + sizeof(tAniMsgHdr); + memcpy(nl_data, data, len); + skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr) + len)); + break; default: VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "Attempt to send unknown nlink message %d", type); @@ -8515,12 +9447,12 @@ boolean hdd_is_5g_supported(hdd_context_t * pHddCtx) */ if (WCNSS_XO_48MHZ == wcnss_wlan_iris_xo_mode()) { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Hardware supports 5Ghz", __func__); + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Hardware supports 5Ghz", __func__); return true; } else { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Hardware doesn't supports 5Ghz", + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Hardware doesn't supports 5Ghz", __func__); return false; } @@ -8587,6 +9519,91 @@ static int hdd_generate_iface_mac_addr_auto(hdd_context_t *pHddCtx, return 0; } +int wlan_hdd_mon_open(hdd_context_t *pHddCtx) +{ + VOS_STATUS status; + v_CONTEXT_t pVosContext= NULL; + hdd_adapter_t *pAdapter= NULL; + + pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if (NULL == pVosContext) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Trying to open VOSS without a PreOpen", __func__); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + status = vos_nv_open(); + if (!VOS_IS_STATUS_SUCCESS(status)) + { + /* NV module cannot be initialized */ + hddLog( VOS_TRACE_LEVEL_FATAL, + "%s: vos_nv_open failed", __func__); + return VOS_STATUS_E_FAILURE; + } + + status = vos_init_wiphy_from_nv_bin(); + if (!VOS_IS_STATUS_SUCCESS(status)) + { + /* NV module cannot be initialized */ + hddLog( VOS_TRACE_LEVEL_FATAL, + "%s: vos_init_wiphy failed", __func__); + goto err_vos_nv_close; + } + + status = vos_open( &pVosContext, pHddCtx->parent_dev); + if ( !VOS_IS_STATUS_SUCCESS( status )) + { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_open failed", __func__); + goto err_vos_nv_close; + } + + status = vos_mon_start( pVosContext ); + if ( !VOS_IS_STATUS_SUCCESS( status ) ) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_start failed",__func__); + goto err_vosclose; + } + + WLANTL_SetMonRxCbk( pVosContext, hdd_rx_packet_monitor_cbk ); + WDA_featureCapsExchange(pVosContext); + wcnss_wlan_set_drvdata(pHddCtx->parent_dev, pHddCtx); + + pAdapter = hdd_open_adapter( pHddCtx, WLAN_HDD_MONITOR, "wlan%d", + wlan_hdd_get_intf_addr(pHddCtx), FALSE ); + if( pAdapter == NULL ) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: hdd_open_adapter failed", __func__); + goto err_close_adapter; + } + + //Initialize the nlink service + if(nl_srv_init() != 0) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: nl_srv_init failed", __func__); + goto err_close_adapter; + } + return VOS_STATUS_SUCCESS; + +err_close_adapter: + hdd_close_all_adapters( pHddCtx ); + vos_mon_stop( pVosContext ); +err_vosclose: + status = vos_sched_close( pVosContext ); + if (!VOS_IS_STATUS_SUCCESS(status)) { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: Failed to close VOSS Scheduler", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status ) ); + } + vos_close(pVosContext ); + +err_vos_nv_close: + vos_nv_close(); + +return status; +} /**--------------------------------------------------------------------------- \brief hdd_11d_scan_done - callback to be executed when 11d scan is @@ -8613,6 +9630,154 @@ static eHalStatus hdd_11d_scan_done(tHalHandle halHandle, void *pContext, return eHAL_STATUS_SUCCESS; } +/**--------------------------------------------------------------------------- + + \brief hdd_init_frame_logging_done - callback to be executed when mgmt frame + logging is completed successfully. + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_init_frame_logging_done(void *fwlogInitCbContext, VOS_STATUS status) +{ + hdd_context_t* pHddCtx = (hdd_context_t*)fwlogInitCbContext; + + if (NULL == pHddCtx) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: HDD context is NULL",__func__); + return; + } + + if ((VOS_STATUS_SUCCESS == status) && + (TRUE == pHddCtx->cfg_ini->enableMgmtLogging)) + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Mgmt Frame Logging init successful")); + pHddCtx->mgmt_frame_logging = TRUE; + } + else + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Mgmt Frame Logging init not success")); + pHddCtx->mgmt_frame_logging = FALSE; + } + + return; +} +/**--------------------------------------------------------------------------- + + \brief hdd_init_frame_logging - function to initialize frame logging. + Currently only Mgmt Frames are logged in both TX + and Rx direction and are sent to userspace + application using logger thread when queried. + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_init_frame_logging(hdd_context_t* pHddCtx) +{ + eHalStatus halStatus = eHAL_STATUS_FAILURE; + tpSirFWLoggingInitParam wlanFWLoggingInitParam; + + if (TRUE != sme_IsFeatureSupportedByFW(MGMT_FRAME_LOGGING) && + TRUE != sme_IsFeatureSupportedByFW(LOGGING_ENHANCEMENT)) + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("MGMT_FRAME_LOGGING not supp by FW")); + return; + } + + wlanFWLoggingInitParam = vos_mem_malloc(sizeof(tSirFWLoggingInitParam)); + if(NULL == wlanFWLoggingInitParam) + { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_mem_alloc failed ", __func__); + return; + } + + vos_mem_set(wlanFWLoggingInitParam, sizeof(tSirFWLoggingInitParam), 0); + + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Configuring %s %s %s Logging",__func__, + pHddCtx->cfg_ini->enableFWLogging?"FW Log,":"", + pHddCtx->cfg_ini->enableContFWLogging ? "Cont FW log,":"", + pHddCtx->cfg_ini->enableMgmtLogging ? "Mgmt Pkt Log":""); + + if (pHddCtx->cfg_ini->enableFWLogging || + pHddCtx->cfg_ini->enableContFWLogging) + { + wlanFWLoggingInitParam->enableFlag |= WLAN_QXDM_LOG_EN; + } + + if (pHddCtx->cfg_ini->enableMgmtLogging) + { + wlanFWLoggingInitParam->enableFlag |= WLAN_FRAME_LOG_EN; + } + if (pHddCtx->cfg_ini->enableBMUHWtracing) + { + wlanFWLoggingInitParam->enableFlag |= WLAN_BMUHW_TRACE_LOG_EN; + } + + wlanFWLoggingInitParam->frameType = WLAN_FRAME_LOGGING_FRAMETYPE_MGMT; + wlanFWLoggingInitParam->frameSize = WLAN_MGMT_LOGGING_FRAMESIZE_128BYTES; + wlanFWLoggingInitParam->bufferMode = WLAN_FRAME_LOGGING_BUFFERMODE_CIRCULAR; + wlanFWLoggingInitParam->continuousFrameLogging = + pHddCtx->cfg_ini->enableContFWLogging; + + wlanFWLoggingInitParam->enableFlag &= ~WLAN_DPU_TXP_LOG_EN; + + wlanFWLoggingInitParam->minLogBufferSize = + pHddCtx->cfg_ini->minLoggingBufferSize; + wlanFWLoggingInitParam->maxLogBufferSize = + pHddCtx->cfg_ini->maxLoggingBufferSize; + wlanFWLoggingInitParam->fwlogInitCallback = hdd_init_frame_logging_done; + wlanFWLoggingInitParam->fwlogInitCbContext= pHddCtx; + + halStatus = sme_InitMgmtFrameLogging(pHddCtx->hHal, wlanFWLoggingInitParam); + + if (eHAL_STATUS_SUCCESS != halStatus) + { + vos_mem_free(wlanFWLoggingInitParam); + } + + return; +} + +static void hdd_dp_util_send_rps_ind(hdd_context_t *hdd_ctxt) +{ + hdd_adapter_t *adapter; + hdd_adapter_list_node_t *adapter_node, *next; + VOS_STATUS status = VOS_STATUS_SUCCESS; + struct wlan_rps_data rps_data; + int count; + + if(!hdd_ctxt->cfg_ini->rps_mask) + { + return; + } + + for (count=0; count < WLAN_SVC_IFACE_NUM_QUEUES; count++) + { + rps_data.cpu_map[count] = hdd_ctxt->cfg_ini->rps_mask; + } + + rps_data.num_queues = WLAN_SVC_IFACE_NUM_QUEUES; + + hddLog(LOG1, FL("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x"), + rps_data.cpu_map[0], rps_data.cpu_map[1],rps_data.cpu_map[2], + rps_data.cpu_map[3], rps_data.cpu_map[4], rps_data.cpu_map[5]); + + status = hdd_get_front_adapter (hdd_ctxt, &adapter_node); + + while (NULL != adapter_node && VOS_STATUS_SUCCESS == status) + { + adapter = adapter_node->pAdapter; + if (NULL != adapter) { + strlcpy(rps_data.ifname, adapter->dev->name, + sizeof(rps_data.ifname)); + wlan_hdd_send_svc_nlink_msg(WLAN_MSG_RPS_ENABLE_IND, + (void *)&rps_data,sizeof(rps_data)); + } + status = hdd_get_next_adapter (hdd_ctxt, adapter_node, &next); + adapter_node = next; + } +} /**--------------------------------------------------------------------------- @@ -8659,11 +9824,21 @@ int hdd_wlan_startup(struct device *dev ) vos_mem_zero(pHddCtx, sizeof( hdd_context_t )); pHddCtx->wiphy = wiphy; - hdd_prevent_suspend(); + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); pHddCtx->isLoadUnloadInProgress = WLAN_HDD_LOAD_IN_PROGRESS; vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE); + /* register for riva power on lock to platform driver + * Locking power early to ensure FW doesn't reset by kernel while + * host driver is busy initializing itself */ + if (req_riva_power_on_lock("wlan")) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: req riva power on lock failed", + __func__); + goto err_free_hdd_context; + } + /*Get vos context here bcoz vos_open requires it*/ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); @@ -8688,6 +9863,12 @@ int hdd_wlan_startup(struct device *dev ) init_completion(&pHddCtx->scan_info.abortscan_event_var); init_completion(&pHddCtx->wiphy_channel_update_event); init_completion(&pHddCtx->ssr_comp_var); + init_completion(&pHddCtx->mc_sus_event_var); + init_completion(&pHddCtx->tx_sus_event_var); + init_completion(&pHddCtx->rx_sus_event_var); + + + hdd_init_ll_stats_ctx(pHddCtx); #ifdef CONFIG_ENABLE_LINUX_REG init_completion(&pHddCtx->linux_reg_req); @@ -8706,6 +9887,9 @@ int hdd_wlan_startup(struct device *dev ) */ mutex_init(&pHddCtx->tdls_lock); #endif + mutex_init(&pHddCtx->spoofMacAddr.macSpoofingLock); + mutex_init(&pHddCtx->wmmLock); + /* By default Strict Regulatory For FCC should be false */ pHddCtx->nEnableStrictRegulatoryForFCC = FALSE; @@ -8717,6 +9901,8 @@ int hdd_wlan_startup(struct device *dev ) goto err_free_hdd_context; } + hdd_request_manager_init(); + vos_mem_zero(pHddCtx->cfg_ini, sizeof( hdd_config_t )); // Read and parse the qcom_cfg.ini file @@ -8824,11 +10010,24 @@ int hdd_wlan_startup(struct device *dev ) goto err_free_hdd_context; } hddLog(VOS_TRACE_LEVEL_FATAL,"%s: FTM driver loaded success fully",__func__); - + pHddCtx->isLoadUnloadInProgress = WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS; vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); return VOS_STATUS_SUCCESS; } + if( VOS_MONITOR_MODE == hdd_get_conparam()) + { + if ( VOS_STATUS_SUCCESS != wlan_hdd_mon_open(pHddCtx)) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: wlan_hdd_mon_open Failed",__func__); + goto err_free_hdd_context; + } + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Driver loaded in Monitor Mode",__func__); + pHddCtx->isLoadUnloadInProgress = WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS; + vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); + return VOS_STATUS_SUCCESS; + } + //Open watchdog module if(pHddCtx->cfg_ini->fIsLogpEnabled) { @@ -8870,7 +10069,7 @@ int hdd_wlan_startup(struct device *dev ) } #endif - + vos_set_roam_delay_stats_enabled(pHddCtx->cfg_ini->gEnableRoamDelayStats); status = vos_open( &pVosContext, pHddCtx->parent_dev); if ( !VOS_IS_STATUS_SUCCESS( status )) { @@ -9017,6 +10216,7 @@ int hdd_wlan_startup(struct device *dev ) if ( !VOS_IS_STATUS_SUCCESS( status ) ) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_start failed",__func__); + VOS_BUG(0); goto err_vosclose; } @@ -9082,6 +10282,8 @@ int hdd_wlan_startup(struct device *dev ) } #endif + wcnss_wlan_set_drvdata(pHddCtx->parent_dev, pHddCtx); + if (VOS_STA_SAP_MODE == hdd_get_conparam()) { pAdapter = hdd_open_adapter( pHddCtx, WLAN_HDD_SOFTAP, "softap.%d", @@ -9268,21 +10470,13 @@ int hdd_wlan_startup(struct device *dev ) goto err_unregister_pmops; } - /* register for riva power on lock to platform driver */ - if (req_riva_power_on_lock("wlan")) - { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: req riva power on lock failed", - __func__); - goto err_unregister_pmops; - } - // register net device notifier for device change notification ret = register_netdevice_notifier(&hdd_netdev_notifier); if(ret < 0) { hddLog(VOS_TRACE_LEVEL_ERROR,"%s: register_netdevice_notifier failed",__func__); - goto err_free_power_on_lock; + goto err_unregister_pmops; } //Initialize the nlink service @@ -9325,11 +10519,30 @@ int hdd_wlan_startup(struct device *dev ) } //TODO: To Remove enableDhcpDebug and use gEnableDebugLog for //EAPOL and DHCP - pHddCtx->cfg_ini->enableDhcpDebug = CFG_DEBUG_DHCP_ENABLE; - pHddCtx->cfg_ini->gEnableDebugLog = VOS_PKT_PROTO_TYPE_EAPOL; + if (!pHddCtx->cfg_ini->gEnableDebugLog) + pHddCtx->cfg_ini->gEnableDebugLog = + VOS_PKT_PROTO_TYPE_EAPOL | VOS_PKT_PROTO_TYPE_DHCP | + VOS_PKT_PROTO_TYPE_ARP; } + + if (pHddCtx->cfg_ini->wlanLoggingEnable && + (pHddCtx->cfg_ini->enableFWLogging || + pHddCtx->cfg_ini->enableMgmtLogging || + pHddCtx->cfg_ini->enableContFWLogging)) + { + hdd_init_frame_logging(pHddCtx); + } + else + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Logging disabled in ini")); + } + #endif + + if (vos_is_multicast_logging()) + wlan_logging_set_log_level(); + hdd_register_mcast_bcast_filter(pHddCtx); if (VOS_STA_SAP_MODE != hdd_get_conparam()) { @@ -9342,26 +10555,23 @@ int hdd_wlan_startup(struct device *dev ) mutex_init(&pHddCtx->sap_lock); mutex_init(&pHddCtx->roc_lock); - -#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK /* Initialize the wake lcok */ - wake_lock_init(&pHddCtx->rx_wake_lock, - WAKE_LOCK_SUSPEND, + vos_wake_lock_init(&pHddCtx->rx_wake_lock, "qcom_rx_wakelock"); + #endif /* Initialize the wake lcok */ - wake_lock_init(&pHddCtx->sap_wake_lock, - WAKE_LOCK_SUSPEND, + vos_wake_lock_init(&pHddCtx->sap_wake_lock, "qcom_sap_wakelock"); -#endif + vos_event_init(&pHddCtx->scan_info.scan_finished_event); pHddCtx->scan_info.scan_pending_option = WEXT_SCAN_PENDING_GIVEUP; pHddCtx->isLoadUnloadInProgress = WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS; vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); #ifdef FEATURE_WLAN_SCAN_PNO /*SME must send channel update configuration to RIVA*/ @@ -9369,6 +10579,10 @@ int hdd_wlan_startup(struct device *dev ) #endif /* Send the update default channel list to the FW*/ sme_UpdateChannelList(pHddCtx->hHal); + + /* Fwr capabilities received, Set the Dot11 mode */ + sme_SetDefDot11Mode(pHddCtx->hHal); + #ifndef CONFIG_ENABLE_LINUX_REG /*updating wiphy so that regulatory user hints can be processed*/ if (wiphy) @@ -9387,6 +10601,8 @@ int hdd_wlan_startup(struct device *dev ) hdd_tx_rx_pkt_cnt_stat_timer_handler, (void *)pHddCtx); } + wlan_hdd_cfg80211_nan_init(pHddCtx); + #ifdef WLAN_FEATURE_EXTSCAN sme_EXTScanRegisterCallback(pHddCtx->hHal, wlan_hdd_cfg80211_extscan_callback, @@ -9400,11 +10616,11 @@ int hdd_wlan_startup(struct device *dev ) ret = register_inet6addr_notifier(&pHddCtx->ipv6_notifier); if (ret) { - hddLog(LOGE, FL("Failed to register IPv6 notifier")); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to register IPv6 notifier")); } else { - hddLog(LOGE, FL("Registered IPv6 notifier")); + hddLog(VOS_TRACE_LEVEL_INFO, FL("Registered IPv6 notifier")); } #endif @@ -9414,12 +10630,13 @@ int hdd_wlan_startup(struct device *dev ) ret = register_inetaddr_notifier(&pHddCtx->ipv4_notifier); if (ret) { - hddLog(LOGE, FL("Failed to register IPv4 notifier")); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to register IPv4 notifier")); } else { - hddLog(LOGE, FL("Registered IPv4 notifier")); + hddLog(VOS_TRACE_LEVEL_INFO, FL("Registered IPv4 notifier")); } + hdd_dp_util_send_rps_ind(pHddCtx); goto success; @@ -9432,9 +10649,6 @@ int hdd_wlan_startup(struct device *dev ) err_reg_netdev: unregister_netdevice_notifier(&hdd_netdev_notifier); -err_free_power_on_lock: - free_riva_power_on_lock("wlan"); - err_unregister_pmops: hddDevTmUnregisterNotifyCallback(pHddCtx); hddDeregisterPmOps(pHddCtx); @@ -9457,6 +10671,8 @@ int hdd_wlan_startup(struct device *dev ) err_unregister_wiphy: #endif wiphy_unregister(wiphy) ; + hdd_wlan_free_wiphy_channels(wiphy); + err_vosstop: vos_stop(pVosContext); @@ -9481,11 +10697,13 @@ int hdd_wlan_startup(struct device *dev ) vos_watchdog_close(pVosContext); err_config: + hdd_request_manager_deinit(); kfree(pHddCtx->cfg_ini); pHddCtx->cfg_ini= NULL; err_free_hdd_context: - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); + free_riva_power_on_lock("wlan"); wiphy_free(wiphy) ; //kfree(wdev) ; VOS_BUG(1); @@ -9536,11 +10754,8 @@ static int hdd_driver_init( void) ENTER(); -#ifdef WLAN_OPEN_SOURCE - wake_lock_init(&wlan_wake_lock, WAKE_LOCK_SUSPEND, "wlan"); -#endif + vos_wake_lock_init(&wlan_wake_lock, "wlan"); - hddTraceInit(); pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); @@ -9554,16 +10769,13 @@ static int hdd_driver_init( void) #ifdef HAVE_WCNSS_CAL_DOWNLOAD /* wait until WCNSS driver downloads NV */ - while (!wcnss_device_ready() && 5 >= ++max_retries) { + while (!wcnss_device_ready() && 10 >= ++max_retries) { msleep(1000); } - if (max_retries >= 5) { + if (max_retries >= 10) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WCNSS driver not ready", __func__); -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif - + vos_wake_lock_destroy(&wlan_wake_lock); #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE wlan_logging_sock_deinit_svc(); #endif @@ -9606,6 +10818,7 @@ static int hdd_driver_init( void) break; } + hddTraceInit(); #ifndef MODULE /* For statically linked driver, call hdd_set_conparam to update curr_con_mode */ @@ -9632,11 +10845,7 @@ static int hdd_driver_init( void) #ifdef MEMORY_DEBUG vos_mem_exit(); #endif - -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif - + vos_wake_lock_destroy(&wlan_wake_lock); #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE wlan_logging_sock_deinit_svc(); #endif @@ -9718,14 +10927,29 @@ static void hdd_driver_exit(void) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: module exit called before probe",__func__); } + else if (VOS_MONITOR_MODE == hdd_get_conparam()) + { + hddLog(VOS_TRACE_LEVEL_INFO,"%s: MONITOR MODE",__func__); + pHddCtx->isLoadUnloadInProgress = WLAN_HDD_UNLOAD_IN_PROGRESS; + vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE); + hdd_wlan_exit(pHddCtx); + vos_preClose( &pVosContext ); + goto done; + } else { - INIT_COMPLETION(pHddCtx->ssr_comp_var); + /* We wait for active entry threads to exit from driver + * by waiting until rtnl_lock is available. + */ + rtnl_lock(); + rtnl_unlock(); - if (pHddCtx->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:SSR in Progress; block rmmod !!!", __func__); + INIT_COMPLETION(pHddCtx->ssr_comp_var); + if ((pHddCtx->isLogpInProgress) && (FALSE == + vos_is_wlan_in_badState(VOS_MODULE_ID_HDD, NULL))) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s:SSR in Progress; block rmmod !!!", __func__); rc = wait_for_completion_timeout(&pHddCtx->ssr_comp_var, msecs_to_jiffies(30000)); if(!rc) @@ -9734,39 +10958,37 @@ static void hdd_driver_exit(void) "%s:SSR timedout, fatal error", __func__); VOS_BUG(0); } - } + } - rtnl_lock(); pHddCtx->isLoadUnloadInProgress = WLAN_HDD_UNLOAD_IN_PROGRESS; vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE); - rtnl_unlock(); - - /* Driver Need to send country code 00 in below condition - * 1) If gCountryCodePriority is set to 1; and last country - * code set is through 11d. This needs to be done in case - * when NV country code is 00. - * This Needs to be done as when kernel store last country - * code and if stored country code is not through 11d, - * in sme_HandleChangeCountryCodeByUser we will disable 11d - * in next load/unload as soon as we get any country through - * 11d. In sme_HandleChangeCountryCodeByUser - * pMsg->countryCode will be last countryCode and - * pMac->scan.countryCode11d will be country through 11d so - * due to mismatch driver will disable 11d. - * - */ - if ((eANI_BOOLEAN_TRUE == sme_Is11dCountrycode(pHddCtx->hHal) && + /* Driver Need to send country code 00 in below condition + * 1) If gCountryCodePriority is set to 1; and last country + * code set is through 11d. This needs to be done in case + * when NV country code is 00. + * This Needs to be done as when kernel store last country + * code and if stored country code is not through 11d, + * in sme_HandleChangeCountryCodeByUser we will disable 11d + * in next load/unload as soon as we get any country through + * 11d. In sme_HandleChangeCountryCodeByUser + * pMsg->countryCode will be last countryCode and + * pMac->scan.countryCode11d will be country through 11d so + * due to mismatch driver will disable 11d. + * + */ + + if ((eANI_BOOLEAN_TRUE == sme_Is11dCountrycode(pHddCtx->hHal) && pHddCtx->cfg_ini->fSupplicantCountryCodeHasPriority && sme_Is11dSupported(pHddCtx->hHal))) - { - hddLog(VOS_TRACE_LEVEL_INFO, + { + hddLog(VOS_TRACE_LEVEL_INFO, FL("CountryCode 00 is being set while unloading driver")); - vos_nv_getRegDomainFromCountryCode(®Id , "00", COUNTRY_USER); - } + vos_nv_getRegDomainFromCountryCode(®Id , "00", COUNTRY_USER); + } - //Do all the cleanup before deregistering the driver - hdd_wlan_exit(pHddCtx); + //Do all the cleanup before deregistering the driver + hdd_wlan_exit(pHddCtx); } vos_preClose( &pVosContext ); @@ -9783,9 +11005,7 @@ static void hdd_driver_exit(void) #endif done: -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif + vos_wake_lock_destroy(&wlan_wake_lock); pr_info("%s: driver unloaded\n", WLAN_MODULE_NAME); } @@ -9943,7 +11163,7 @@ VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t *pAdapter, ENTER(); - hddLog(LOG1, "hdd_softap_sta_deauth:(%p, false)", + hddLog(LOG1, "hdd_softap_sta_deauth:(%pK, false)", (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); //Ignore request to deauth bcmc station @@ -9997,7 +11217,8 @@ int hdd_del_all_sta(hdd_adapter_t *pAdapter) WLANSAP_PopulateDelStaParams( pSapCtx->aStaInfo[i].macAddrSTA.bytes, - eCsrForcedDeauthSta, SIR_MAC_MGMT_DEAUTH >> 4, + eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, + SIR_MAC_MGMT_DEAUTH >> 4, &delStaParams); vos_status = hdd_softap_sta_deauth(pAdapter, &delStaParams); if (VOS_IS_STATUS_SUCCESS(vos_status)) @@ -10030,7 +11251,7 @@ void hdd_softap_sta_disassoc(hdd_adapter_t *pAdapter,v_U8_t *pDestMacAddress) ENTER(); - hddLog( LOGE, "hdd_softap_sta_disassoc:(%p, false)", (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + hddLog( LOGE, "hdd_softap_sta_disassoc:(%pK, false)", (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); //Ignore request to disassoc bcmc station if( pDestMacAddress[0] & 0x1 ) @@ -10045,7 +11266,7 @@ void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t *pAdapter,v_BOOL_t e ENTER(); - hddLog( LOGE, "hdd_softap_tkip_mic_fail_counter_measure:(%p, false)", (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + hddLog( LOGE, "hdd_softap_tkip_mic_fail_counter_measure:(%pK, false)", (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); WLANSAP_SetCounterMeasure(pVosContext, (v_BOOL_t)enable); } @@ -10148,6 +11369,19 @@ v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx) (eANI_BOOLEAN_TRUE == scanRspPending) || (eANI_BOOLEAN_TRUE == inMiddleOfRoaming)) { + if(pmcState == FULL_POWER && + sme_IsCoexScoIndicationSet(pHddCtx->hHal)) + { + /* + * When SCO indication comes from Coex module , host will + * enter in to full power mode, but this should not prevent + * apps processor power collapse. + */ + hddLog(LOG1, + FL("Allow apps power collapse" + "even when sco indication is set")); + return TRUE; + } hddLog( LOGE, "%s: do not allow APPS power collapse-" "pmcState = %d scanRspPending = %d inMiddleOfRoaming = %d", __func__, pmcState, scanRspPending, inMiddleOfRoaming ); @@ -10372,11 +11606,17 @@ static VOS_STATUS wlan_hdd_framework_restart(hdd_context_t *pHddCtx) /* Iterate over all adapters/devices */ status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); + if ((NULL == pAdapterNode) || (VOS_STATUS_SUCCESS != status)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("fail to get adapter: %pK %d"), pAdapterNode, status); + goto end; + } + do { - if( (status == VOS_STATUS_SUCCESS) && - pAdapterNode && - pAdapterNode->pAdapter) + if(pAdapterNode->pAdapter && + WLAN_HDD_ADAPTER_MAGIC == pAdapterNode->pAdapter->magic) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "restarting the driver(intf:\'%s\' mode:%d :try %d)", @@ -10394,14 +11634,17 @@ static VOS_STATUS wlan_hdd_framework_restart(hdd_context_t *pHddCtx) * the driver. * */ - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + cfg80211_rx_unprot_mlme_mgmt(pAdapterNode->pAdapter->dev, (u_int8_t*)mgmt, len); +#else cfg80211_send_unprot_deauth(pAdapterNode->pAdapter->dev, (u_int8_t*)mgmt, len ); +#endif } status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } while((NULL != pAdapterNode) && (VOS_STATUS_SUCCESS == status)); - + end: /* Free the allocated management frame */ kfree(mgmt); @@ -10462,7 +11705,7 @@ VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx) } /* Send reset FIQ to WCNSS to invoke SSR. */ #ifdef HAVE_WCNSS_RESET_INTR - wcnss_reset_intr(); + wcnss_reset_fiq(TRUE); #endif return status; @@ -10525,33 +11768,138 @@ VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx) return sme_isSta_p2p_clientConnected(pHddCtx->hHal); } + +/* + * API to find if the firmware will send logs using DXE channel + */ +v_U8_t hdd_is_fw_logging_enabled(void) +{ + hdd_context_t *pHddCtx; + + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, + vos_get_global_context(VOS_MODULE_ID_HDD, NULL)); + + return (pHddCtx && pHddCtx->cfg_ini->enableMgmtLogging); +} + +/* + * API to find if the firmware will send trace logs using DXE channel + */ +v_U8_t hdd_is_fw_ev_logging_enabled(void) +{ + hdd_context_t *pHddCtx; + + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, + vos_get_global_context(VOS_MODULE_ID_HDD, NULL)); + + return (pHddCtx && pHddCtx->cfg_ini->enableFWLogging); +} +/* + * API to find if there is any session connected + */ +VOS_STATUS hdd_is_any_session_connected(hdd_context_t *pHddCtx) +{ + return sme_is_any_session_connected(pHddCtx->hHal); +} + + int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_scaninfo_t *pScanInfo = NULL; long status = 0; + tSirAbortScanStatus abortScanStatus; pScanInfo = &pHddCtx->scan_info; + INIT_COMPLETION(pScanInfo->abortscan_event_var); if (pScanInfo->mScanPending) { - INIT_COMPLETION(pScanInfo->abortscan_event_var); - hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId, - eCSR_SCAN_ABORT_DEFAULT); - - status = wait_for_completion_interruptible_timeout( + abortScanStatus = hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId, + eCSR_SCAN_ABORT_DEFAULT); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("abortScanStatus: %d"), abortScanStatus); + + /* If there is active scan command lets wait for the completion else + * there is no need to wait as scan command might be in the SME pending + * command list. + */ + if (abortScanStatus == eSIR_ABORT_ACTIVE_SCAN_LIST_NOT_EMPTY) + { + status = wait_for_completion_interruptible_timeout( &pScanInfo->abortscan_event_var, msecs_to_jiffies(5000)); - if (0 >= status) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + if (0 >= status) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Timeout or Interrupt occurred while waiting for abort" "scan, status- %ld", __func__, status); - return -ETIMEDOUT; + return -ETIMEDOUT; + } + } + else if (abortScanStatus == eSIR_ABORT_SCAN_FAILURE) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("hdd_abort_mac_scan failed")); + return -VOS_STATUS_E_FAILURE; } } return 0; } +/** + * hdd_indicate_mgmt_frame() - Wrapper to indicate management frame to + * user space + * @frame_ind: Management frame data to be informed. + * + * This function is used to indicate management frame to + * user space + * + * Return: None + * + */ +void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind) +{ + hdd_context_t *hdd_ctx = NULL; + hdd_adapter_t *adapter = NULL; + v_CONTEXT_t vos_context = NULL; + struct ieee80211_mgmt *mgmt = + (struct ieee80211_mgmt *)frame_ind->frameBuf; + + /* Get the global VOSS context.*/ + vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!vos_context) { + hddLog(LOGE, FL("Global VOS context is Null")); + return; + } + /* Get the HDD context.*/ + hdd_ctx = + (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, vos_context ); + + if (0 != wlan_hdd_validate_context(hdd_ctx)) + { + return; + } + + if (frame_ind->frameLen < ieee80211_hdrlen(mgmt->frame_control)) { + hddLog(LOGE, FL(" Invalid frame length")); + return; + } + + adapter = hdd_get_adapter_by_sme_session_id(hdd_ctx, + frame_ind->sessionId); + + if ((NULL != adapter) && + (WLAN_HDD_ADAPTER_MAGIC == adapter->magic)) + __hdd_indicate_mgmt_frame(adapter, + frame_ind->frameLen, + frame_ind->frameBuf, + frame_ind->frameType, + frame_ind->rxChan, + frame_ind->rxRssi); + return; + +} + VOS_STATUS wlan_hdd_cancel_remain_on_channel(hdd_context_t *pHddCtx) { hdd_adapter_t *pAdapter; @@ -10583,6 +11931,439 @@ VOS_STATUS wlan_hdd_cancel_remain_on_channel(hdd_context_t *pHddCtx) } return VOS_STATUS_SUCCESS; } + +hdd_remain_on_chan_ctx_t *hdd_get_remain_on_channel_ctx(hdd_context_t *pHddCtx) +{ + hdd_adapter_t *pAdapter; + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_cfg80211_state_t *cfgState; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; + VOS_STATUS vosStatus; + + vosStatus = hdd_get_front_adapter (pHddCtx, &pAdapterNode); + while (NULL != pAdapterNode && VOS_STATUS_E_EMPTY != vosStatus) + { + pAdapter = pAdapterNode->pAdapter; + if (NULL != pAdapter) + { + cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (pRemainChanCtx) + break; + } + vosStatus = hdd_get_next_adapter (pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + return pRemainChanCtx; +} + +/** + * wlan_hdd_handle_dfs_chan_scan () - handles disable/enable DFS channels + * + * @pHddCtx: HDD context within host driver + * @dfsScanMode: dfsScanMode passed from ioctl + * + */ + +VOS_STATUS wlan_hdd_handle_dfs_chan_scan(hdd_context_t *pHddCtx, + tANI_U8 dfsScanMode) +{ + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_adapter_t *pAdapter; + VOS_STATUS vosStatus; + hdd_station_ctx_t *pHddStaCtx; + eHalStatus status = eHAL_STATUS_SUCCESS; + + if(!pHddCtx) + { + hddLog(LOGE, FL("HDD context is Null")); + return eHAL_STATUS_FAILURE; + } + + if (pHddCtx->scan_info.mScanPending) + { + hddLog(LOG1, FL("Aborting scan for sessionId: %d"), + pHddCtx->scan_info.sessionId); + hdd_abort_mac_scan(pHddCtx, + pHddCtx->scan_info.sessionId, + eCSR_SCAN_ABORT_DEFAULT); + } + + if (!dfsScanMode) + { + vosStatus = hdd_get_front_adapter( pHddCtx, &pAdapterNode); + while ((NULL != pAdapterNode) && + (VOS_STATUS_SUCCESS == vosStatus)) + { + pAdapter = pAdapterNode->pAdapter; + + if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) + { + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + + if(!pHddStaCtx) + { + hddLog(LOGE, FL("HDD STA context is Null")); + return eHAL_STATUS_FAILURE; + } + + /* if STA is already connected on DFS channel, + disconnect immediately*/ + if (hdd_connIsConnected(pHddStaCtx) && + (NV_CHANNEL_DFS == + vos_nv_getChannelEnabledState( + pHddStaCtx->conn_info.operationChannel))) + { + status = sme_RoamDisconnect(pHddCtx->hHal, + pAdapter->sessionId, + eCSR_DISCONNECT_REASON_UNSPECIFIED); + hddLog(LOG1, FL("Client connected on DFS channel %d," + "sme_RoamDisconnect returned with status: %d" + "for sessionid: %d"), pHddStaCtx->conn_info. + operationChannel, status, pAdapter->sessionId); + } + } + + vosStatus = hdd_get_next_adapter(pHddCtx, pAdapterNode, + &pNext); + pAdapterNode = pNext; + } + } + + sme_UpdateDFSScanMode(pHddCtx->hHal, dfsScanMode); + sme_UpdateDFSRoamMode(pHddCtx->hHal, + (dfsScanMode != DFS_CHNL_SCAN_DISABLED)); + + status = sme_HandleDFSChanScan(pHddCtx->hHal); + if (!HAL_STATUS_SUCCESS(status)) + { + hddLog(LOGE, + FL("Failed in sme_HandleDFSChanScan (err=%d)"), status); + return status; + } + + return status; +} + +static int hdd_log2_ceil(unsigned value) +{ + /* need to switch to unsigned math so that negative values + * will right-shift towards 0 instead of -1 + */ + unsigned tmp = value; + int log2 = -1; + + if (value == 0) + return 0; + + while (tmp) { + log2++; + tmp >>= 1; + } + if (1U << log2 != value) + log2++; + + return log2; +} + +/** + * hdd_sta_id_hash_attach() - initialize sta id to macaddr hash + * @pAdapter: adapter handle + * + * Return: vos status + */ +VOS_STATUS hdd_sta_id_hash_attach(hdd_adapter_t *pAdapter) +{ + int hash_elem, log2, i; + + spin_lock_bh( &pAdapter->sta_hash_lock); + if (pAdapter->is_sta_id_hash_initialized == VOS_TRUE) { + spin_unlock_bh( &pAdapter->sta_hash_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: hash already attached for session id %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_SUCCESS; + } + spin_unlock_bh( &pAdapter->sta_hash_lock); + + hash_elem = WLAN_MAX_STA_COUNT; + hash_elem *= HDD_STA_ID_HASH_MULTIPLIER; + log2 = hdd_log2_ceil(hash_elem); + hash_elem = 1 << log2; + + pAdapter->sta_id_hash.mask = hash_elem - 1; + pAdapter->sta_id_hash.idx_bits = log2; + pAdapter->sta_id_hash.bins = + vos_mem_malloc(hash_elem *sizeof(hdd_list_t)); + if (!pAdapter->sta_id_hash.bins) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: malloc failed for session %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_E_NOMEM; + } + + for (i = 0; i < hash_elem; i++) + hdd_list_init(&pAdapter->sta_id_hash.bins[i], WLAN_MAX_STA_COUNT); + + spin_lock_bh( &pAdapter->sta_hash_lock); + pAdapter->is_sta_id_hash_initialized = VOS_TRUE; + spin_unlock_bh( &pAdapter->sta_hash_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Station ID Hash attached for session id %d", + __func__, pAdapter->sessionId); + + return VOS_STATUS_SUCCESS; +} + +/** + * hdd_sta_id_hash_detach() - deinit sta_id to macaddr hash + * @pAdapter: adapter handle + * + * Return: vos status + */ +VOS_STATUS hdd_sta_id_hash_detach(hdd_adapter_t *pAdapter) +{ + int hash_elem, i; + v_SIZE_t size; + + spin_lock_bh( &pAdapter->sta_hash_lock); + if (pAdapter->is_sta_id_hash_initialized != VOS_TRUE) { + spin_unlock_bh( &pAdapter->sta_hash_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: hash not initialized for session id %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_SUCCESS; + } + + pAdapter->is_sta_id_hash_initialized = VOS_FALSE; + spin_unlock_bh( &pAdapter->sta_hash_lock); + + hash_elem = 1 << pAdapter->sta_id_hash.idx_bits; + + /* free all station info*/ + for (i = 0; i < hash_elem; i++) { + hdd_list_size(&pAdapter->sta_id_hash.bins[i], &size); + if (size != 0) { + VOS_STATUS status; + hdd_staid_hash_node_t *sta_info_node = NULL; + hdd_staid_hash_node_t *next_node = NULL; + status = hdd_list_peek_front ( &pAdapter->sta_id_hash.bins[i], + (hdd_list_node_t**) &sta_info_node ); + + while ( NULL != sta_info_node && VOS_STATUS_SUCCESS == status ) + { + status = hdd_list_remove_node( &pAdapter->sta_id_hash.bins[i], + &sta_info_node->node); + vos_mem_free(sta_info_node); + + status = hdd_list_peek_next (&pAdapter->sta_id_hash.bins[i], + (hdd_list_node_t*)sta_info_node, + (hdd_list_node_t**)&next_node); + sta_info_node = next_node; + } + } + } + + vos_mem_free(pAdapter->sta_id_hash.bins); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Station ID Hash detached for session id %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_SUCCESS; +} + +/** + * hdd_sta_id_hash_calculate_index() - derive index from macaddr + * @pAdapter: adapter handle + * @mac_addr_in: input mac address + * + * Return: index derived from mac address + */ +int hdd_sta_id_hash_calculate_index(hdd_adapter_t *pAdapter, + v_MACADDR_t *mac_addr_in) +{ + uint16 index; + struct hdd_align_mac_addr_t * mac_addr = + (struct hdd_align_mac_addr_t *)mac_addr_in; + + index = mac_addr->bytes_ab ^ + mac_addr->bytes_cd ^ mac_addr->bytes_ef; + index ^= index >> pAdapter->sta_id_hash.idx_bits; + index &= pAdapter->sta_id_hash.mask; + return index; +} + +/** + * hdd_sta_id_hash_add_entry() - add entry in hash + * @pAdapter: adapter handle + * @sta_id: station id + * @mac_addr: mac address + * + * Return: vos status + */ +VOS_STATUS hdd_sta_id_hash_add_entry(hdd_adapter_t *pAdapter, + v_U8_t sta_id, v_MACADDR_t *mac_addr) +{ + uint16 index; + hdd_staid_hash_node_t *sta_info_node = NULL; + + index = hdd_sta_id_hash_calculate_index(pAdapter, mac_addr); + sta_info_node = vos_mem_malloc(sizeof(hdd_staid_hash_node_t)); + if (!sta_info_node) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: malloc failed", __func__); + return VOS_STATUS_E_NOMEM; + } + + sta_info_node->sta_id = sta_id; + vos_mem_copy(&sta_info_node->mac_addr, mac_addr, sizeof(v_MACADDR_t)); + + spin_lock_bh( &pAdapter->sta_hash_lock); + if (pAdapter->is_sta_id_hash_initialized != VOS_TRUE) { + spin_unlock_bh( &pAdapter->sta_hash_lock); + vos_mem_free(sta_info_node); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: hash is not initialized for session id %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_E_FAILURE; + } + + hdd_list_insert_back ( &pAdapter->sta_id_hash.bins[index], + (hdd_list_node_t*) sta_info_node ); + spin_unlock_bh( &pAdapter->sta_hash_lock); + return VOS_STATUS_SUCCESS; +} + +/** + * hdd_sta_id_hash_remove_entry() - remove entry from hash + * @pAdapter: adapter handle + * @sta_id: station id + * @mac_addr: mac address + * + * Return: vos status + */ +VOS_STATUS hdd_sta_id_hash_remove_entry(hdd_adapter_t *pAdapter, + v_U8_t sta_id, v_MACADDR_t *mac_addr) +{ + uint16 index; + VOS_STATUS status; + hdd_staid_hash_node_t *sta_info_node = NULL; + hdd_staid_hash_node_t *next_node = NULL; + + spin_lock_bh( &pAdapter->sta_hash_lock); + if (pAdapter->is_sta_id_hash_initialized != VOS_TRUE) { + spin_unlock_bh( &pAdapter->sta_hash_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: hash is not initialized for session id %d", + __func__, pAdapter->sessionId); + return VOS_STATUS_E_FAILURE; + } + + index = hdd_sta_id_hash_calculate_index(pAdapter, mac_addr); + status = hdd_list_peek_front ( &pAdapter->sta_id_hash.bins[index], + (hdd_list_node_t**) &sta_info_node ); + + while ( NULL != sta_info_node && VOS_STATUS_SUCCESS == status ) + { + if (sta_info_node->sta_id == sta_id) { + status = hdd_list_remove_node( &pAdapter->sta_id_hash.bins[index], + &sta_info_node->node); + vos_mem_free(sta_info_node); + break; + } + status = hdd_list_peek_next (&pAdapter->sta_id_hash.bins[index], + (hdd_list_node_t*)sta_info_node, (hdd_list_node_t**)&next_node); + sta_info_node = next_node; + } + spin_unlock_bh( &pAdapter->sta_hash_lock); + return status; +} + +/** + * hdd_sta_id_find_from_mac_addr() - find sta id from mac address + * @pAdapter: adapter handle + * @mac_addr_in: mac address + * + * Return: station id + */ +int hdd_sta_id_find_from_mac_addr(hdd_adapter_t *pAdapter, + v_MACADDR_t *mac_addr_in) +{ + uint8 is_found = 0; + uint8 sta_id = HDD_WLAN_INVALID_STA_ID; + uint16 index; + VOS_STATUS status; + hdd_staid_hash_node_t *sta_info_node = NULL; + hdd_staid_hash_node_t *next_node = NULL; + + spin_lock_bh( &pAdapter->sta_hash_lock); + if (pAdapter->is_sta_id_hash_initialized != VOS_TRUE) { + spin_unlock_bh( &pAdapter->sta_hash_lock); + hddLog(VOS_TRACE_LEVEL_INFO, + FL("hash is not initialized for session id %d"), + pAdapter->sessionId); + return HDD_WLAN_INVALID_STA_ID; + } + + index = hdd_sta_id_hash_calculate_index(pAdapter, mac_addr_in); + status = hdd_list_peek_front ( &pAdapter->sta_id_hash.bins[index], + (hdd_list_node_t**) &sta_info_node ); + + while ( NULL != sta_info_node && VOS_STATUS_SUCCESS == status ) + { + if (vos_mem_compare(&sta_info_node->mac_addr, + mac_addr_in, sizeof(v_MACADDR_t))) { + is_found = 1; + sta_id = sta_info_node->sta_id; + break; + } + status = hdd_list_peek_next (&pAdapter->sta_id_hash.bins[index], + (hdd_list_node_t*)sta_info_node, + (hdd_list_node_t**)&next_node); + sta_info_node = next_node; + } + spin_unlock_bh( &pAdapter->sta_hash_lock); + return sta_id; +} + +void hdd_initialize_adapter_common(hdd_adapter_t *pAdapter) +{ + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s: pAdapter is NULL ", __func__); + return; + } + init_completion(&pAdapter->session_open_comp_var); + init_completion(&pAdapter->session_close_comp_var); + init_completion(&pAdapter->disconnect_comp_var); + init_completion(&pAdapter->linkup_event_var); + init_completion(&pAdapter->cancel_rem_on_chan_var); + init_completion(&pAdapter->rem_on_chan_ready_event); + init_completion(&pAdapter->pno_comp_var); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) + init_completion(&pAdapter->offchannel_tx_event); +#endif + init_completion(&pAdapter->tx_action_cnf_event); +#ifdef FEATURE_WLAN_TDLS + init_completion(&pAdapter->tdls_add_station_comp); + init_completion(&pAdapter->tdls_del_station_comp); + init_completion(&pAdapter->tdls_mgmt_comp); + init_completion(&pAdapter->tdls_link_establish_req_comp); +#endif + +#ifdef WLAN_FEATURE_RMC + init_completion(&pAdapter->ibss_peer_info_comp); +#endif /* WLAN_FEATURE_RMC */ + init_completion(&pAdapter->ula_complete); + init_completion(&pAdapter->change_country_code); + +#ifdef FEATURE_WLAN_BATCH_SCAN + init_completion(&pAdapter->hdd_set_batch_scan_req_var); + init_completion(&pAdapter->hdd_get_batch_scan_req_var); +#endif + + return; +} + //Register the module init/exit functions module_init(hdd_module_init); module_exit(hdd_module_exit); diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_oemdata.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_oemdata.c index da578bc271da..146efdd6f195 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_oemdata.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,7 +45,7 @@ #include #include #include - +#include /*--------------------------------------------------------------------------------------------- \brief hdd_OemDataReqCallback() - @@ -97,7 +97,7 @@ static eHalStatus hdd_OemDataReqCallback(tHalHandle hHal, /**-------------------------------------------------------------------------------------------- - \brief iw_get_oem_data_rsp() - + \brief __iw_get_oem_data_rsp() - This function gets the oem data response. This invokes the respective sme functionality. Function for handling the oem data rsp @@ -111,8 +111,8 @@ static eHalStatus hdd_OemDataReqCallback(tHalHandle hHal, \return - 0 for success, non zero for failure -----------------------------------------------------------------------------------------------*/ -int iw_get_oem_data_rsp( - struct net_device *dev, +int __iw_get_oem_data_rsp( + struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -121,16 +121,23 @@ int iw_get_oem_data_rsp( eHalStatus status; struct iw_oem_data_rsp* pHddOemDataRsp; tOemDataRsp* pSmeOemDataRsp; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; - hdd_adapter_t *pAdapter = (netdev_priv(dev)); - - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + rc = wlan_hdd_validate_context(pHddCtx); + if (0 != rc) + { + return rc; } - do { //get the oem data response from sme @@ -157,12 +164,28 @@ int iw_get_oem_data_rsp( } } while(0); + EXIT(); return rc; } +int iw_get_oem_data_rsp( + struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_oem_data_rsp(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**-------------------------------------------------------------------------------------------- - \brief iw_set_oem_data_req() - + \brief __iw_set_oem_data_req() - This function sets the oem data req configuration. This invokes the respective sme oem data req functionality. Function for @@ -176,8 +199,8 @@ int iw_get_oem_data_rsp( \return - 0 for success, non zero for failure -----------------------------------------------------------------------------------------------*/ -int iw_set_oem_data_req( - struct net_device *dev, +int __iw_set_oem_data_req( + struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -186,17 +209,47 @@ int iw_set_oem_data_req( eHalStatus status = eHAL_STATUS_SUCCESS; struct iw_oem_data_req *pOemDataReq = NULL; tOemDataReqConfig oemDataReqConfig; - tANI_U32 oemDataReqID = 0; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pwextBuf; + + ENTER(); - hdd_adapter_t *pAdapter = (netdev_priv(dev)); - hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + rc = wlan_hdd_validate_context(pHddCtx); + if (0 != rc) + { + return rc; + } + + pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pwextBuf) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pwextBuf is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + if (pHddCtx->isPnoEnable) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return -EBUSY; + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("pno scan in progress")); + return -EBUSY; } do @@ -243,8 +296,23 @@ int iw_set_oem_data_req( } while(0); + EXIT(); return rc; } +int iw_set_oem_data_req( + struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_oem_data_req(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} #endif diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_p2p.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_p2p.c index 4cea876d7006..dfdc2f0d7e98 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_p2p.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_p2p.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,9 +31,6 @@ \brief WLAN Host Device Driver implementation for P2P commands interface - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -78,7 +75,7 @@ tANI_U8* hdd_getActionString( tANI_U16 MsgType ) CASE_RETURN_STRING(SIR_MAC_ACTION_UNPROT_WNM); CASE_RETURN_STRING(SIR_MAC_ACTION_TDLS); CASE_RETURN_STRING(SIR_MAC_ACITON_MESH); - CASE_RETURN_STRING(SIR_MAC_ACTION_MULTIHOP); + CASE_RETURN_STRING(SIR_MAC_ACTION_MHF); CASE_RETURN_STRING(SIR_MAC_SELF_PROTECTED); CASE_RETURN_STRING(SIR_MAC_ACTION_WME); CASE_RETURN_STRING(SIR_MAC_ACTION_VHT); @@ -108,7 +105,6 @@ const char *p2p_action_frame_type[]={"GO Negotiation Request", tP2PConnectionStatus globalP2PConnectionStatus = P2P_NOT_ACTIVE; #endif -#ifdef WLAN_FEATURE_TDLS_DEBUG #define MAX_TDLS_ACTION_FRAME_TYPE 11 const char *tdls_action_frame_type[] = {"TDLS Setup Request", "TDLS Setup Response", @@ -121,7 +117,6 @@ const char *tdls_action_frame_type[] = {"TDLS Setup Request", "TDLS Peer PSM Response", "TDLS Peer Traffic Response", "TDLS Discovery Request" }; -#endif extern struct net_device_ops net_ops_struct; @@ -178,36 +173,40 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx, { hdd_adapter_t *pAdapter = (hdd_adapter_t*) pCtx; hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - hdd_remain_on_chan_ctx_t *pRemainChanCtx = cfgState->remain_on_chan_ctx; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + rem_on_channel_request_type_t req_type; + if (pHddCtx == NULL) { hddLog(LOGE, "%s: Hdd Context is NULL", __func__); return eHAL_STATUS_FAILURE; } + + mutex_lock(&pHddCtx->roc_lock); + + pRemainChanCtx = cfgState->remain_on_chan_ctx; if (pRemainChanCtx == NULL) { - hddLog( LOGW, - "%s: No Rem on channel pending for which Rsp is received", __func__); - return eHAL_STATUS_SUCCESS; + hddLog( LOGW, + "%s: No Rem on channel pending for which Rsp is received", __func__); + mutex_unlock(&pHddCtx->roc_lock); + return eHAL_STATUS_SUCCESS; } - mutex_lock(&pHddCtx->roc_lock); hddLog( VOS_TRACE_LEVEL_INFO, "Received ROC rsp (request type %d, channel %d, cookie %llu", pRemainChanCtx->rem_on_chan_request, pRemainChanCtx->chan.center_freq, pRemainChanCtx->cookie); - cfgState->remain_on_chan_ctx = NULL; vos_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer); vos_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer); - mutex_unlock(&pHddCtx->roc_lock); if ( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request ) { if( cfgState->buf ) { - hddLog( LOGP, + hddLog( LOG1, "%s: We need to receive yet an ack from one of tx packet", __func__); } @@ -223,8 +222,11 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx, pRemainChanCtx->chan_type, #endif GFP_KERNEL); + pAdapter->lastRocTs = vos_timer_get_system_time(); } + req_type = pRemainChanCtx->rem_on_chan_request; + mutex_unlock(&pHddCtx->roc_lock); if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || @@ -232,7 +234,7 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx, ) { tANI_U8 sessionId = pAdapter->sessionId; - if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request ) + if( REMAIN_ON_CHANNEL_REQUEST == req_type ) { sme_DeregisterMgmtFrame( hHal, sessionId, @@ -240,32 +242,38 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx, NULL, 0 ); } } - else if ( ( WLAN_HDD_SOFTAP== pAdapter->device_mode ) || - ( WLAN_HDD_P2P_GO == pAdapter->device_mode ) - ) + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) { WLANSAP_DeRegisterMgmtFrame( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, (SIR_MAC_MGMT_FRAME << 2) | ( SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0 ); } - if (pRemainChanCtx->action_pkt_buff.frame_ptr != NULL - && pRemainChanCtx->action_pkt_buff.frame_length != 0) + mutex_lock(&pHddCtx->roc_lock); + if ( pRemainChanCtx ) { - vos_mem_free(pRemainChanCtx->action_pkt_buff.frame_ptr); + if (pRemainChanCtx->action_pkt_buff.frame_ptr != NULL + && pRemainChanCtx->action_pkt_buff.frame_length != 0) + { + vos_mem_free(pRemainChanCtx->action_pkt_buff.frame_ptr); + } } vos_mem_free( pRemainChanCtx ); pRemainChanCtx = NULL; + cfgState->remain_on_chan_ctx = NULL; + mutex_unlock(&pHddCtx->roc_lock); + if (eHAL_STATUS_SUCCESS != status) + complete(&pAdapter->rem_on_chan_ready_event); complete(&pAdapter->cancel_rem_on_chan_var); pAdapter->is_roc_inprogress = FALSE; - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); return eHAL_STATUS_SUCCESS; } VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) { hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - hdd_remain_on_chan_ctx_t *pRemainChanCtx = cfgState->remain_on_chan_ctx; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); int status = 0; @@ -276,14 +284,18 @@ VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) } mutex_lock(&pHddCtx->roc_lock); - if(cfgState->remain_on_chan_ctx != NULL) + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if(pRemainChanCtx != NULL) { - hddLog(VOS_TRACE_LEVEL_INFO, - "Cancel Existing ROC (cookie=%llu)", - cfgState->remain_on_chan_ctx->cookie); - - vos_timer_stop(&cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer); + if(VOS_TIMER_STATE_RUNNING == vos_timer_getCurrentState( + &pRemainChanCtx->hdd_remain_on_chan_timer)) + { + hddLog(VOS_TRACE_LEVEL_INFO, + "Cancel Existing ROC (cookie=%llu)", + pRemainChanCtx->cookie); + vos_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer); + } /* Wait till remain on channel ready indication before issuing cancel * remain on channel request, otherwise if remain on channel not * received and if the driver issues cancel remain on channel then lim @@ -291,53 +303,93 @@ VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) */ if (pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress != TRUE) { + mutex_unlock(&pHddCtx->roc_lock); status = wait_for_completion_interruptible_timeout( &pAdapter->rem_on_chan_ready_event, msecs_to_jiffies(WAIT_REM_CHAN_READY)); if (0 >= status) { + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (pRemainChanCtx) + pRemainChanCtx->is_pending_roc_cancelled = TRUE; + mutex_unlock(&pHddCtx->roc_lock); hddLog( LOGE, - "%s: timeout waiting for remain on channel" - " ready indication %d", + "%s: timeout waiting for remain on channel" + " ready indication %d", __func__, status); - pRemainChanCtx->is_pending_roc_cancelled = TRUE; - mutex_unlock(&pHddCtx->roc_lock); return VOS_STATUS_E_FAILURE; } - INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); - pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (NULL == pRemainChanCtx) + { + mutex_unlock(&pHddCtx->roc_lock); + hddLog( LOGE, + "%s-%d: pRemainChanCtx is NULL", + __func__, __LINE__); + return VOS_STATUS_E_FAILURE; + } + /* Check again if cancel remain on channel is started. + * If its started wait for its completiona and return. + */ + if (TRUE == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) + { + mutex_unlock(&pHddCtx->roc_lock); + hddLog( LOG1, + "ROC timer cancellation in progress," + " wait for completion"); + status = wait_for_completion_interruptible_timeout( + &pAdapter->cancel_rem_on_chan_var, + msecs_to_jiffies(WAIT_CANCEL_REM_CHAN)); + if (0 >= status) + { + hddLog( LOGE, + "%s:wait on cancel_rem_on_chan_var failed %d", + __func__, status); + return VOS_STATUS_E_FAILURE; + } + return VOS_STATUS_SUCCESS; + } + else + pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; mutex_unlock(&pHddCtx->roc_lock); + INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); - /* Issue abort remain on chan request to sme. - * The remain on channel callback will make sure the remain_on_chan - * expired event is sent. - */ - if (( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || - ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || - ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode )) - { - sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter ), - pAdapter->sessionId ); - } - else if ( (WLAN_HDD_SOFTAP== pAdapter->device_mode) || - (WLAN_HDD_P2P_GO == pAdapter->device_mode)) - { - WLANSAP_CancelRemainOnChannel( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); - } + /* Issue abort remain on chan request to sme. + * The remain on channel callback will make sure the remain_on_chan + * expired event is sent. + */ + if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || + ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || + ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode )) + { + if (eHAL_STATUS_SUCCESS != + sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter ), + pAdapter->sessionId )) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Cancel Remain on Channel")); + } + } + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) + { + WLANSAP_CancelRemainOnChannel( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + } - status = wait_for_completion_interruptible_timeout( - &pAdapter->cancel_rem_on_chan_var, - msecs_to_jiffies(WAIT_CANCEL_REM_CHAN)); - if (0 >= status) - { - hddLog( LOGE, - "%s: timeout waiting for cancel remain on channel" - " ready indication %d", - __func__, status); - } - hdd_allow_suspend(); + status = wait_for_completion_interruptible_timeout( + &pAdapter->cancel_rem_on_chan_var, + msecs_to_jiffies(WAIT_CANCEL_REM_CHAN)); + if (0 >= status) + { + hddLog( LOGE, + "%s: timeout waiting for cancel remain on channel" + " ready indication %d", + __func__, status); + } + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); } else { @@ -396,27 +448,36 @@ int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter) void wlan_hdd_remain_on_chan_timeout(void *data) { hdd_adapter_t *pAdapter = (hdd_adapter_t *)data; - hdd_remain_on_chan_ctx_t *pRemainChanCtx; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_cfg80211_state_t *cfgState; - if ( NULL == pAdapter ) + hdd_context_t *pHddCtx; + + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { - hddLog( LOGE, FL("pAdapter is NULL !!!")); + hddLog( LOGE, FL("pAdapter is invalid %pK !!!"), pAdapter); return; } + pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); + mutex_lock(&pHddCtx->roc_lock); pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (NULL == pRemainChanCtx) { hddLog( LOGE, FL("No Remain on channel is pending")); + mutex_unlock(&pHddCtx->roc_lock); return; } + if ( TRUE == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress ) { + mutex_unlock(&pHddCtx->roc_lock); hddLog( LOGE, FL("Cancellation already in progress")); return; } pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; + mutex_unlock(&pHddCtx->roc_lock); INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); hddLog( LOG1,"%s: Cancel Remain on Channel on timeout", __func__); if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || @@ -424,19 +485,180 @@ void wlan_hdd_remain_on_chan_timeout(void *data) ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode ) ) { - sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter ), - pAdapter->sessionId ); + if (eHAL_STATUS_SUCCESS != + sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter), + pAdapter->sessionId )) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Cancel Remain on Channel")); + } } - else if ( ( WLAN_HDD_SOFTAP== pAdapter->device_mode ) || - ( WLAN_HDD_P2P_GO == pAdapter->device_mode ) - ) + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) { - WLANSAP_CancelRemainOnChannel( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + WLANSAP_CancelRemainOnChannel( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); } - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); } +static int wlan_hdd_p2p_start_remain_on_channel( + hdd_adapter_t *pAdapter) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_adapter_t *pAdapter_temp; + v_BOOL_t isGoPresent = VOS_FALSE; + hdd_context_t *pHddCtx; + hdd_cfg80211_state_t *cfgState; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; + rem_on_channel_request_type_t request_type; + unsigned int duration; + v_U16_t hw_value; + + int ret = 0; + + ENTER(); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); + if (NULL == cfgState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: cfgState is not valid ",__func__); + return -EINVAL; + } + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if ( pRemainChanCtx == NULL) + { + mutex_unlock(&pHddCtx->roc_lock); + hddLog( LOGE, + "%s-%d: pRemainChanCtx is NULL", + __func__, __LINE__); + return ret; + } + request_type = pRemainChanCtx->rem_on_chan_request; + /* Initialize Remain on chan timer */ + status = vos_timer_init(&pRemainChanCtx->hdd_remain_on_chan_timer, + VOS_TIMER_TYPE_SW, + wlan_hdd_remain_on_chan_timeout, + pAdapter); + if (status != VOS_STATUS_SUCCESS) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Not able to initalize remain_on_chan timer")); + cfgState->remain_on_chan_ctx = NULL; + vos_mem_free(pRemainChanCtx); + mutex_unlock(&pHddCtx->roc_lock); + return -EINVAL; + } + + duration = pRemainChanCtx->duration; + hw_value = pRemainChanCtx->chan.hw_value; + mutex_unlock(&pHddCtx->roc_lock); + + status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); + while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) + { + pAdapter_temp = pAdapterNode->pAdapter; + if (WLAN_HDD_P2P_GO == pAdapter_temp->device_mode) + { + isGoPresent = VOS_TRUE; + } + status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); + pAdapterNode = pNext; + } + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + //call sme API to start remain on channel. + if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || + ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || + ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode ) + ) + { + tANI_U8 sessionId = pAdapter->sessionId; + //call sme API to start remain on channel. + if (eHAL_STATUS_SUCCESS != sme_RemainOnChannel( + WLAN_HDD_GET_HAL_CTX(pAdapter), sessionId, + hw_value, duration, + wlan_hdd_remain_on_channel_callback, pAdapter, + (tANI_U8)(request_type == REMAIN_ON_CHANNEL_REQUEST)? TRUE:FALSE)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL(" RemainOnChannel returned fail")); + + mutex_lock(&pHddCtx->roc_lock); + cfgState->remain_on_chan_ctx = NULL; + vos_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer); + vos_mem_free (pRemainChanCtx); + mutex_unlock(&pHddCtx->roc_lock); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + return -EINVAL; + } + + if( REMAIN_ON_CHANNEL_REQUEST == request_type) + { + if( eHAL_STATUS_SUCCESS != sme_RegisterMgmtFrame( + WLAN_HDD_GET_HAL_CTX(pAdapter), + sessionId, (SIR_MAC_MGMT_FRAME << 2) | + (SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0 )) + { + hddLog(VOS_TRACE_LEVEL_ERROR, "sme_RegisterMgmtFrame returned fail"); + } + } + + } + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) + { + //call sme API to start remain on channel. + if (VOS_STATUS_SUCCESS != WLANSAP_RemainOnChannel( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, + hw_value, duration, + wlan_hdd_remain_on_channel_callback, pAdapter )) + + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: WLANSAP_RemainOnChannel returned fail", __func__); + mutex_lock(&pHddCtx->roc_lock); + cfgState->remain_on_chan_ctx = NULL; + vos_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer); + vos_mem_free (pRemainChanCtx); + mutex_unlock(&pHddCtx->roc_lock); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + return -EINVAL; + } + + + if (VOS_STATUS_SUCCESS != WLANSAP_RegisterMgmtFrame( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, + (SIR_MAC_MGMT_FRAME << 2) | ( SIR_MAC_MGMT_PROBE_REQ << 4), + NULL, 0 )) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: WLANSAP_RegisterMgmtFrame returned fail", __func__); + WLANSAP_CancelRemainOnChannel( + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + return -EINVAL; + } + + } + + pAdapter->is_roc_inprogress = TRUE; + EXIT(); + return 0; +} + + static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy, struct net_device *dev, struct ieee80211_channel *chan, @@ -449,13 +671,26 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy, hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_remain_on_chan_ctx_t *pRemainChanCtx; hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - VOS_STATUS vos_status = VOS_STATUS_E_FAILURE; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); - hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; - hdd_adapter_t *pAdapter_temp; - VOS_STATUS status; - v_BOOL_t isGoPresent = VOS_FALSE; + hdd_context_t *pHddCtx = NULL; VOS_STATUS checkReadyInd; + hdd_adapter_t *pStaAdapter; + int status = 0; + + ENTER(); + if (NULL == pAdapter) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD adapter is Null", __func__); + return -ENODEV; + } + + pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + return status; + } + hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d", __func__,pAdapter->device_mode); #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) @@ -482,29 +717,26 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy, * wlan driver is keep on receiving the remain on channel command * and which is resulting in crash. So not allowing any remain on * channel requets when Load/Unload is in progress*/ - if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(((hdd_context_t *)pAdapter->pHddCtx)) - || hdd_isConnectionInProgress((hdd_context_t *)pAdapter->pHddCtx, VOS_TRUE)) + if(hdd_isConnectionInProgress((hdd_context_t *)pAdapter->pHddCtx)) { hddLog( LOGE, - "%s: Wlan Load/Unload or Connection is in progress", __func__); + "%s: Connection is in progress", __func__); return -EBUSY; } - if (((hdd_context_t*)pAdapter->pHddCtx)->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EAGAIN; - } + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = vos_mem_malloc( sizeof(hdd_remain_on_chan_ctx_t) ); if( NULL == pRemainChanCtx ) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Not able to allocate memory for Channel context", __func__); + mutex_unlock(&pHddCtx->roc_lock); return -ENOMEM; } + vos_mem_zero(pRemainChanCtx, sizeof (hdd_remain_on_chan_ctx_t)); vos_mem_copy( &pRemainChanCtx->chan, chan, sizeof(struct ieee80211_channel) ); @@ -523,95 +755,38 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy, pRemainChanCtx->action_pkt_buff.frame_length = 0; pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = FALSE; pRemainChanCtx->is_pending_roc_cancelled = FALSE; - /* Initialize Remain on chan timer */ - vos_status = vos_timer_init(&pRemainChanCtx->hdd_remain_on_chan_timer, - VOS_TIMER_TYPE_SW, - wlan_hdd_remain_on_chan_timeout, - pAdapter); - if (vos_status != VOS_STATUS_SUCCESS) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Not able to initalize remain_on_chan timer", __func__); - } - status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); - while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) - { - pAdapter_temp = pAdapterNode->pAdapter; - if (WLAN_HDD_P2P_GO == pAdapter_temp->device_mode) - { - isGoPresent = VOS_TRUE; - } - status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); - pAdapterNode = pNext; - } - hdd_prevent_suspend(); + INIT_COMPLETION(pAdapter->rem_on_chan_ready_event); - //call sme API to start remain on channel. - if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || - ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || - ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode ) - ) + if (REMAIN_ON_CHANNEL_REQUEST == request_type) { - tANI_U8 sessionId = pAdapter->sessionId; - //call sme API to start remain on channel. - sme_RemainOnChannel( - WLAN_HDD_GET_HAL_CTX(pAdapter), sessionId, - chan->hw_value, duration, - wlan_hdd_remain_on_channel_callback, pAdapter, - (tANI_U8)(request_type == REMAIN_ON_CHANNEL_REQUEST)? TRUE:FALSE); - - if( REMAIN_ON_CHANNEL_REQUEST == request_type) + pStaAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); + if((NULL != pStaAdapter)&& + hdd_connIsConnected( WLAN_HDD_GET_STATION_CTX_PTR(pStaAdapter))) { - if( eHAL_STATUS_SUCCESS != sme_RegisterMgmtFrame( - WLAN_HDD_GET_HAL_CTX(pAdapter), - sessionId, (SIR_MAC_MGMT_FRAME << 2) | - (SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0 )) + if (pAdapter->lastRocTs !=0 && + ((vos_timer_get_system_time() - pAdapter->lastRocTs ) + < pHddCtx->cfg_ini->gP2PListenDeferInterval)) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "sme_RegisterMgmtFrame returned fail"); - } - } - - } - else if ( ( WLAN_HDD_SOFTAP== pAdapter->device_mode ) || - ( WLAN_HDD_P2P_GO == pAdapter->device_mode ) - ) - { - //call sme API to start remain on channel. - if (VOS_STATUS_SUCCESS != WLANSAP_RemainOnChannel( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - chan->hw_value, duration, - wlan_hdd_remain_on_channel_callback, pAdapter )) - - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: WLANSAP_RemainOnChannel returned fail", __func__); - cfgState->remain_on_chan_ctx = NULL; - vos_mem_free (pRemainChanCtx); - hdd_allow_suspend(); - return -EINVAL; - } + if (pRemainChanCtx->duration > HDD_P2P_MAX_ROC_DURATION) + pRemainChanCtx->duration = HDD_P2P_MAX_ROC_DURATION; + mutex_unlock(&pHddCtx->roc_lock); - if (VOS_STATUS_SUCCESS != WLANSAP_RegisterMgmtFrame( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - (SIR_MAC_MGMT_FRAME << 2) | ( SIR_MAC_MGMT_PROBE_REQ << 4), - NULL, 0 )) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: WLANSAP_RegisterMgmtFrame returned fail", __func__); - WLANSAP_CancelRemainOnChannel( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); - hdd_allow_suspend(); - return -EINVAL; + schedule_delayed_work(&pAdapter->roc_work, + msecs_to_jiffies(pHddCtx->cfg_ini->gP2PListenDeferInterval)); + hddLog(VOS_TRACE_LEVEL_INFO, "Defer interval is %hu, pAdapter %pK", + pHddCtx->cfg_ini->gP2PListenDeferInterval, pAdapter); + return 0; + } } - } - pAdapter->is_roc_inprogress = TRUE; - return 0; + mutex_unlock(&pHddCtx->roc_lock); + status = wlan_hdd_p2p_start_remain_on_channel(pAdapter); + EXIT(); + return status; } int __wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy, @@ -629,18 +804,37 @@ int __wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) struct net_device *dev = wdev->netdev; #endif - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_REMAIN_ON_CHANNEL, pAdapter->sessionId, REMAIN_ON_CHANNEL_REQUEST)); - return wlan_hdd_request_remain_on_channel(wiphy, dev, + ret = wlan_hdd_request_remain_on_channel(wiphy, dev, chan, #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) channel_type, #endif duration, cookie, REMAIN_ON_CHANNEL_REQUEST); + EXIT(); + return ret; } int wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy, @@ -679,15 +873,23 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ) { hdd_cfg80211_state_t *cfgState = NULL; hdd_remain_on_chan_ctx_t* pRemainChanCtx = NULL; + hdd_context_t *pHddCtx; VOS_STATUS status; if (NULL == pAdapter) { hddLog(LOGE, FL("pAdapter is NULL")); return; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (NULL == pHddCtx) + { + hddLog(LOGE, FL("pHddCtx is NULL")); + return; + } cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); + pAdapter->startRocTs = vos_timer_get_system_time(); + mutex_lock(&pHddCtx->roc_lock); pRemainChanCtx = cfgState->remain_on_chan_ctx; - hddLog( LOG1, "Ready on chan ind"); if( pRemainChanCtx != NULL ) { MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -724,7 +926,19 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ) // Check for cached action frame if ( pRemainChanCtx->action_pkt_buff.frame_length != 0 ) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, + pRemainChanCtx->action_pkt_buff.freq, 0, + pRemainChanCtx->action_pkt_buff.frame_ptr, + pRemainChanCtx->action_pkt_buff.frame_length, + NL80211_RXMGMT_FLAG_ANSWERED); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, + pRemainChanCtx->action_pkt_buff.freq, 0, + pRemainChanCtx->action_pkt_buff.frame_ptr, + pRemainChanCtx->action_pkt_buff.frame_length, + NL80211_RXMGMT_FLAG_ANSWERED, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) cfg80211_rx_mgmt( pAdapter->dev->ieee80211_ptr, pRemainChanCtx->action_pkt_buff.freq, 0, pRemainChanCtx->action_pkt_buff.frame_ptr, @@ -754,6 +968,7 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ) complete(&pAdapter->rem_on_chan_ready_event); if (TRUE == pRemainChanCtx->is_pending_roc_cancelled) { + mutex_unlock(&pHddCtx->roc_lock); /* since pRemainChanCtx->is_pending_roc_cancelled is * set, it means Cancel Reamain on channel command is * pending because remain on channel event was not @@ -762,9 +977,14 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ) */ wlan_hdd_cancel_existing_remain_on_channel(pAdapter); } + else + { + mutex_unlock(&pHddCtx->roc_lock); + } } else { + mutex_unlock(&pHddCtx->roc_lock); hddLog( LOGW, "%s: No Pending Remain on channel Request", __func__); } return; @@ -783,10 +1003,12 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, #endif hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - hdd_remain_on_chan_ctx_t *pRemainChanCtx = cfgState->remain_on_chan_ctx; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); int status; u64 cookie_dummy; + + ENTER(); cookie_dummy = cookie << 32; MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_CANCEL_REMAIN_ON_CHANNEL, @@ -797,8 +1019,6 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } hddLog( LOG1, "Cancel remain on channel req (cookie = %llu)", cookie); @@ -806,9 +1026,12 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, /* FIXME cancel currently running remain on chan. * Need to check cookie and cancel accordingly */ + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; if( (cfgState->remain_on_chan_ctx == NULL) || (cfgState->remain_on_chan_ctx->cookie != cookie) ) { + mutex_unlock(&pHddCtx->roc_lock); hddLog( LOGE, "%s: No Remain on channel pending with specified cookie value", __func__); @@ -816,6 +1039,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, } if (TRUE != pRemainChanCtx->is_pending_roc_cancelled) { + mutex_unlock(&pHddCtx->roc_lock); /* wait until remain on channel ready event received * for already issued remain on channel request */ status = wait_for_completion_interruptible_timeout(&pAdapter->rem_on_chan_ready_event, @@ -825,15 +1049,21 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, hddLog( LOGE, "%s: timeout waiting for remain on channel ready indication %d", __func__, status); - pRemainChanCtx->is_pending_roc_cancelled = TRUE; + mutex_lock(&pHddCtx->roc_lock); + if (cfgState->remain_on_chan_ctx) + cfgState->remain_on_chan_ctx->is_pending_roc_cancelled = TRUE; + mutex_unlock(&pHddCtx->roc_lock); + return 0; } + mutex_lock(&pHddCtx->roc_lock); } else { hddLog( LOG1, FL("Cancel ROC event is already pending, " "waiting for ready on channel indication.") ); + mutex_unlock(&pHddCtx->roc_lock); return 0; } if (NULL != cfgState->remain_on_chan_ctx) @@ -841,6 +1071,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, vos_timer_stop(&cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer); if (TRUE == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) { + mutex_unlock(&pHddCtx->roc_lock); hddLog( LOG1, FL("ROC timer cancellation in progress," " wait for completion")); @@ -858,6 +1089,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, else pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; } + mutex_unlock(&pHddCtx->roc_lock); INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); /* Issue abort remain on chan request to sme. * The remain on channel callback will make sure the remain_on_chan @@ -865,19 +1097,21 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, */ if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || - ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode ) - ) + ( WLAN_HDD_P2P_DEVICE == pAdapter->device_mode )) { tANI_U8 sessionId = pAdapter->sessionId; - sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter ), - sessionId ); + if (eHAL_STATUS_SUCCESS != + sme_CancelRemainOnChannel( WLAN_HDD_GET_HAL_CTX( pAdapter ), + sessionId )) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Cancel Remain on Channel")); + } } - else if ( (WLAN_HDD_SOFTAP== pAdapter->device_mode) || - (WLAN_HDD_P2P_GO == pAdapter->device_mode) - ) + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) { WLANSAP_CancelRemainOnChannel( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); } else { @@ -892,7 +1126,9 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, hddLog( LOGE, "%s:wait on cancel_rem_on_chan_var failed %d", __func__, status); } - hdd_allow_suspend(); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + + EXIT(); return 0; } @@ -956,7 +1192,7 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, #endif hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - hdd_remain_on_chan_ctx_t *pRemainChanCtx = cfgState->remain_on_chan_ctx; + hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); tANI_U8 type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]); tANI_U8 subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]); @@ -968,15 +1204,14 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, hdd_adapter_t *goAdapter; #endif - MTRACE(vos_trace(VOS_MODULE_ID_HDD, + ENTER(); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_ACTION, pAdapter->sessionId, pAdapter->device_mode )); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -1021,10 +1256,24 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, noack = dont_wait_for_ack; #endif + //If the wait is coming as 0 with off channel set //then set the wait to 200 ms if (offchan && !wait) + { wait = ACTION_FRAME_DEFAULT_WAIT; + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (pRemainChanCtx) + { + tANI_U32 current_time = vos_timer_get_system_time(); + int remaining_roc_time = ((int) pRemainChanCtx->duration - + (current_time - pAdapter->startRocTs)); + if ( remaining_roc_time > ACTION_FRAME_DEFAULT_WAIT) + wait = remaining_roc_time; + } + mutex_unlock(&pHddCtx->roc_lock); + } //Call sme API to send out a action frame. // OR can we send it directly through data path?? @@ -1110,12 +1359,13 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, // In case of P2P Client mode if we are already // on the same channel then send the frame directly mutex_lock(&pHddCtx->roc_lock); - if( (cfgState->remain_on_chan_ctx != NULL) && + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if( (pRemainChanCtx != NULL) && (cfgState->current_freq == chan->center_freq) ) { if ( VOS_TIMER_STATE_RUNNING == vos_timer_getCurrentState( - &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer) ) + &pRemainChanCtx->hdd_remain_on_chan_timer) ) { /* Some times FW is taking almost 500 msec for * full 15 retries, which leads to ROC expiration @@ -1137,19 +1387,21 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, actionFrmType == WLAN_HDD_INVITATION_RESP ) wait = wait + ACTION_FRAME_ACK_WAIT; vos_timer_stop( - &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer); + &pRemainChanCtx->hdd_remain_on_chan_timer); status = vos_timer_start( - &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer, + &pRemainChanCtx->hdd_remain_on_chan_timer, wait); - if ( status != VOS_STATUS_SUCCESS ) - { - hddLog( LOGE, "Remain on Channel timer start failed"); - } + + mutex_unlock(&pHddCtx->roc_lock); hddLog(VOS_TRACE_LEVEL_INFO, "action frame: extending the wait time %u", wait); - mutex_unlock(&pHddCtx->roc_lock); + + if ( status != VOS_STATUS_SUCCESS ) + { + hddLog( LOGE, "Remain on Channel timer start failed"); + } goto send_frame; } else @@ -1228,13 +1480,12 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, vos_mem_copy( cfgState->buf, buf, len); + mutex_lock(&pHddCtx->roc_lock); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) if( cfgState->remain_on_chan_ctx ) { - mutex_lock(&pHddCtx->roc_lock); cfgState->action_cookie = cfgState->remain_on_chan_ctx->cookie; *cookie = cfgState->action_cookie; - mutex_unlock(&pHddCtx->roc_lock); } else { @@ -1244,6 +1495,7 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) } #endif + mutex_unlock(&pHddCtx->roc_lock); } if ( (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || @@ -1280,9 +1532,7 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, goto err; } } - else if( ( WLAN_HDD_SOFTAP== pAdapter->device_mode ) || - ( WLAN_HDD_P2P_GO == pAdapter->device_mode ) - ) + else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) { if( VOS_STATUS_SUCCESS != WLANSAP_SendAction( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, @@ -1310,10 +1560,14 @@ int __wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, pAdapter->dev, #endif *cookie, buf, len, FALSE, GFP_KERNEL ); + EXIT(); return 0; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) +int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_mgmt_tx_params *params, u64 *cookie) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct wireless_dev *wdev, struct ieee80211_channel *chan, bool offchan, #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) @@ -1347,7 +1601,12 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, int ret; vos_ssr_protect(__func__); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ret = __wlan_hdd_mgmt_tx(wiphy, wdev, params->chan, params->offchan, + params->wait, params->buf, params->len, + params->no_cck, params->dont_wait_for_ack, + cookie); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) ret = __wlan_hdd_mgmt_tx(wiphy, wdev, chan, offchan, #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) @@ -1534,7 +1793,7 @@ int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: P2P_SET GO NoA: fail to read param " - "count=%d duration=%d interval=%d \n", + "count=%d duration=%d interval=%d ", __func__, count, start_time, duration); return -EINVAL; } @@ -1620,7 +1879,7 @@ int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command ) { VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: P2P_SET GO PS: fail to read param " - " legacy_ps=%d opp_ps=%d ctwindow=%d \n", + " legacy_ps=%d opp_ps=%d ctwindow=%d ", __func__, legacy_ps, opp_ps, ctwindow); return -EINVAL; } @@ -1777,16 +2036,13 @@ int __wlan_hdd_add_virtual_intf( struct wiphy *wiphy, char *name, hdd_context_t *pHddCtx = (hdd_context_t*) wiphy_priv(wiphy); hdd_adapter_t *pAdapter = NULL; hdd_scaninfo_t *pScanInfo = NULL; + int ret = 0; + ENTER(); - MTRACE(vos_trace(VOS_MODULE_ID_HDD, - TRACE_CODE_HDD_ADD_VIRTUAL_INTF, NO_SESSION, type)); - if (WLAN_HDD_P2P_CLIENT != wlan_hdd_get_session_type(type) && - WLAN_HDD_INFRA_STATION != wlan_hdd_get_session_type(type) && - hdd_get_adapter(pHddCtx, wlan_hdd_get_session_type(type)) != NULL) + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Interface type %d already exists. Two" - "interfaces of same type are not supported currently.",__func__, type); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) return ERR_PTR(-EINVAL); #else @@ -1794,10 +2050,14 @@ int __wlan_hdd_add_virtual_intf( struct wiphy *wiphy, char *name, #endif } - if (pHddCtx->isLogpInProgress) + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_ADD_VIRTUAL_INTF, NO_SESSION, type)); + if (WLAN_HDD_P2P_CLIENT != wlan_hdd_get_session_type(type) && + WLAN_HDD_INFRA_STATION != wlan_hdd_get_session_type(type) && + hdd_get_adapter(pHddCtx, wlan_hdd_get_session_type(type)) != NULL) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s:LOGP in Progress. Ignore!!!", __func__); + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Interface type %d already exists. Two" + "interfaces of same type are not supported currently.",__func__, type); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) return ERR_PTR(-EINVAL); #else @@ -1846,6 +2106,19 @@ int __wlan_hdd_add_virtual_intf( struct wiphy *wiphy, char *name, return -EINVAL; #endif } + + if ((type == NL80211_IFTYPE_P2P_CLIENT) || + (type == NL80211_IFTYPE_P2P_GO)) + { + /* Below function Notifies Mode change and + * If p2p session is detected then invokes functionality to + * Teardown TDLS links and disable offchannel if any. Since + * TDLS is not supported in case of concurrency. + */ + hddLog(LOG1, FL("Interface type = %d"), type); + hdd_tdls_notify_mode_change(pAdapter, pHddCtx); + } + EXIT(); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) return pAdapter->dev->ieee80211_ptr; @@ -1911,6 +2184,7 @@ int __wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev ) hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); hdd_adapter_t *pVirtAdapter = WLAN_HDD_GET_PRIV_PTR(dev); int status; + ENTER(); MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -1923,8 +2197,6 @@ int __wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev ) if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -1998,7 +2270,7 @@ void hdd_sendMgmtFrameOverMonitorIface( hdd_adapter_t *pMonAdapter, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "HDD [%d]: Insufficient headroom, " - "head[%p], data[%p], req[%d]", + "head[%pK], data[%pK], req[%d]", __LINE__, skb->head, skb->data, nFrameLength); kfree_skb(skb); return ; @@ -2020,7 +2292,9 @@ void hdd_sendMgmtFrameOverMonitorIface( hdd_adapter_t *pMonAdapter, skb->ip_summed = CHECKSUM_NONE; #ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); + vos_wake_lock_timeout_release(&pHddCtx->rx_wake_lock, + HDD_WAKE_LOCK_DURATION, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); #endif #endif rxstat = netif_rx_ni(skb); @@ -2034,12 +2308,12 @@ void hdd_sendMgmtFrameOverMonitorIface( hdd_adapter_t *pMonAdapter, return ; } -void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, +void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, tANI_U32 nFrameLength, tANI_U8* pbFrames, tANI_U8 frameType, tANI_U32 rxChan, - tANI_S8 rxRssi ) + tANI_S8 rxRssi) { tANI_U16 freq; tANI_U16 extend_time; @@ -2052,8 +2326,8 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, VOS_STATUS status; hdd_remain_on_chan_ctx_t* pRemainChanCtx = NULL; - hddLog(VOS_TRACE_LEVEL_INFO, "%s: Frame Type = %d Frame Length = %d", - __func__, frameType, nFrameLength); + hddLog(VOS_TRACE_LEVEL_INFO, FL("Frame Type = %d Frame Length = %d"), + frameType, nFrameLength); if (NULL == pAdapter) { @@ -2078,7 +2352,8 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, /* Get pAdapter from Destination mac address of the frame */ if ((type == SIR_MAC_MGMT_FRAME) && - (subType != SIR_MAC_MGMT_PROBE_REQ)) + (subType != SIR_MAC_MGMT_PROBE_REQ) && + (nFrameLength > WLAN_HDD_80211_FRM_DA_OFFSET + VOS_MAC_ADDR_SIZE)) { pAdapter = hdd_get_adapter_by_macaddr( WLAN_HDD_GET_CTX(pAdapter), &pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET]); @@ -2145,15 +2420,18 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, } cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); - pRemainChanCtx = cfgState->remain_on_chan_ctx; if ((type == SIR_MAC_MGMT_FRAME) && - (subType == SIR_MAC_MGMT_ACTION)) + (subType == SIR_MAC_MGMT_ACTION) && + (nFrameLength > WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1)) { if(pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_PUBLIC_ACTION_FRAME) { // public action frame - if((pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+1] == SIR_MAC_ACTION_VENDOR_SPECIFIC) && + if((WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + SIR_MAC_P2P_OUI_SIZE + 2 < + nFrameLength) && + (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+1] == + SIR_MAC_ACTION_VENDOR_SPECIFIC) && vos_mem_compare(&pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+2], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE)) // P2P action frames { @@ -2192,6 +2470,9 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, } } #endif + mutex_lock(&pHddCtx->roc_lock); + pRemainChanCtx = cfgState->remain_on_chan_ctx; + if (pRemainChanCtx != NULL && VOS_TIMER_STATE_RUNNING == vos_timer_getCurrentState(&pRemainChanCtx->hdd_remain_on_chan_timer)) { @@ -2242,6 +2523,7 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, "Frames are pending. dropping frame !!!", __func__); } + mutex_unlock(&pHddCtx->roc_lock); return; } } @@ -2252,24 +2534,25 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, hddLog( LOG1, "%s:" "Rcvd action frame after timer expired ", __func__); + mutex_unlock(&pHddCtx->roc_lock); + if (((actionFrmType == WLAN_HDD_PROV_DIS_RESP) && (cfgState->actionFrmState == HDD_PD_REQ_ACK_PENDING)) || ((actionFrmType == WLAN_HDD_GO_NEG_RESP) && (cfgState->actionFrmState == HDD_GO_NEG_REQ_ACK_PENDING))) { - hddLog(LOG1, "%s: ACK_PENDING and But received RESP for Action frame ", + hddLog(LOG1, "%s: ACK_PENDING and But received RESP for Action frame ", __func__); - hdd_sendActionCnf(pAdapter, TRUE); - } + hdd_sendActionCnf(pAdapter, TRUE); + } } #ifdef FEATURE_WLAN_TDLS else if(pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+1] == WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP) { u8 *mac = &pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET+6]; -#ifdef WLAN_FEATURE_TDLS_DEBUG - hddLog(VOS_TRACE_LEVEL_ERROR,"[TDLS] TDLS Discovery Response," MAC_ADDRESS_STR " RSSI[%d] <--- OTA", + hddLog(VOS_TRACE_LEVEL_INFO,"[TDLS] TDLS Discovery Response," MAC_ADDRESS_STR " RSSI[%d] <--- OTA", MAC_ADDR_ARRAY(mac),rxRssi); -#endif + wlan_hdd_tdls_set_rssi(pAdapter, mac, rxRssi); wlan_hdd_tdls_recv_discovery_resp(pAdapter, mac); } @@ -2285,22 +2568,22 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, pScanInfo->sessionId, eCSR_SCAN_ABORT_DEFAULT); } -#ifdef WLAN_FEATURE_TDLS_DEBUG + if(pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_TDLS_ACTION_FRAME) { actionFrmType = pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+1]; if(actionFrmType >= MAX_TDLS_ACTION_FRAME_TYPE) { - hddLog(VOS_TRACE_LEVEL_ERROR,"[TDLS] unknown[%d] <--- OTA", + hddLog(VOS_TRACE_LEVEL_INFO,"[TDLS] Action type[%d] <--- OTA", actionFrmType); } else { - hddLog(VOS_TRACE_LEVEL_ERROR,"[TDLS] %s <--- OTA", + hddLog(VOS_TRACE_LEVEL_INFO,"[TDLS] %s <--- OTA", tdls_action_frame_type[actionFrmType]); } } -#endif + if((pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_QOS_ACTION_FRAME)&& (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+1] == WLAN_HDD_QOS_MAP_CONFIGURE) ) { @@ -2311,8 +2594,13 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, //Indicate Frame Over Normal Interface hddLog( LOG1, FL("Indicate Frame over NL80211 Interface")); - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, + nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, + nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) cfg80211_rx_mgmt( pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, nFrameLength, GFP_ATOMIC ); @@ -2439,7 +2727,9 @@ static void hdd_wlan_tx_complete( hdd_adapter_t* pAdapter, memset( skb->cb, 0, sizeof( skb->cb ) ); #ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); + vos_wake_lock_timeout_release(&pHddCtx->rx_wake_lock, + HDD_WAKE_LOCK_DURATION, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); #endif #endif if (in_interrupt()) @@ -2448,7 +2738,23 @@ static void hdd_wlan_tx_complete( hdd_adapter_t* pAdapter, netif_rx_ni( skb ); /* Enable Queues which we have disabled earlier */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues( pAdapter->dev ); } +void __hdd_p2p_roc_work_queue(struct work_struct *work) +{ + hdd_adapter_t *pAdapter = container_of(to_delayed_work(work), hdd_adapter_t, roc_work); + hddLog( VOS_TRACE_LEVEL_INFO, FL("%s: "), __func__); + wlan_hdd_p2p_start_remain_on_channel(pAdapter); + return; +} + +void hdd_p2p_roc_work_queue(struct work_struct *work) +{ + vos_ssr_protect(__func__); + __hdd_p2p_roc_work_queue(work); + vos_ssr_unprotect(__func__); + return; +} diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_request_manager.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_request_manager.c new file mode 100644 index 000000000000..2f96e982d18f --- /dev/null +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_request_manager.c @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include "wlan_hdd_request_manager.h" +#include "wlan_hdd_main.h" +#include "wlan_hdd_dp_utils.h" +#include "vos_event.h" +#include "vos_memory.h" + +/* arbitrary value */ +#define MAX_NUM_REQUESTS 20 + +static bool is_initialized; +static hdd_list_t requests; +static spinlock_t spinlock; +static void *cookie; + +struct hdd_request { + hdd_list_node_t node; + void *cookie; + uint32_t reference_count; + struct hdd_request_params params; + vos_event_t completed; +}; + +/* must be called with spinlock held */ +static void hdd_request_unlink(struct hdd_request *request) +{ + hdd_list_remove_node(&requests, &request->node); +} + +static void hdd_request_destroy(struct hdd_request *request) +{ + struct hdd_request_params *params; + + params = &request->params; + if (params->dealloc) { + void *priv = hdd_request_priv(request); + + params->dealloc(priv); + } + vos_event_destroy(&request->completed); + vos_mem_free(request); +} + +/* must be called with spinlock held */ +static struct hdd_request *hdd_request_find(void *cookie) +{ + VOS_STATUS status; + struct hdd_request *request; + hdd_list_node_t *node; + + status = hdd_list_peek_front(&requests, &node); + while (VOS_IS_STATUS_SUCCESS(status)) { + request = container_of(node, struct hdd_request, node); + if (request->cookie == cookie) + return request; + status = hdd_list_peek_next(&requests, node, &node); + } + + return NULL; +} + +struct hdd_request *hdd_request_alloc(const struct hdd_request_params *params) +{ + size_t length; + struct hdd_request *request; + + if (!is_initialized) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("invoked when not initialized from %pS"), + (void *)_RET_IP_); + return NULL; + } + + length = sizeof(*request) + params->priv_size; + request = vos_mem_malloc(length); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("allocation failed for %pS"), + (void *)_RET_IP_); + return NULL; + } + request->reference_count = 1; + request->params = *params; + vos_event_init(&request->completed); + spin_lock_bh(&spinlock); + request->cookie = cookie++; + hdd_list_insert_back(&requests, &request->node); + spin_unlock_bh(&spinlock); + hddLog(VOS_TRACE_LEVEL_INFO, FL("request %pK, cookie %pK, caller %pS"), + request, request->cookie, (void *)_RET_IP_); + + return request; +} + +void *hdd_request_priv(struct hdd_request *request) +{ + /* private data area immediately follows the struct hdd_request */ + return request + 1; +} + +void *hdd_request_cookie(struct hdd_request *request) +{ + return request->cookie; +} + +struct hdd_request *hdd_request_get(void *cookie) +{ + struct hdd_request *request; + + if (!is_initialized) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("invoked when not initialized from %pS"), + (void *)_RET_IP_); + return NULL; + } + spin_lock_bh(&spinlock); + request = hdd_request_find(cookie); + if (request) + request->reference_count++; + spin_unlock_bh(&spinlock); + hddLog(VOS_TRACE_LEVEL_INFO, FL("cookie %pK, request %pK, caller %pS"), + cookie, request, (void *)_RET_IP_); + + return request; +} + +void hdd_request_put(struct hdd_request *request) +{ + bool unlinked = false; + + hddLog(VOS_TRACE_LEVEL_INFO, FL("request %pK, cookie %pK, caller %pS"), + request, request->cookie, (void *)_RET_IP_); + spin_lock_bh(&spinlock); + request->reference_count--; + if (0 == request->reference_count) { + hdd_request_unlink(request); + unlinked = true; + } + spin_unlock_bh(&spinlock); + if (unlinked) + hdd_request_destroy(request); +} + +int hdd_request_wait_for_response(struct hdd_request *request) +{ + return vos_wait_single_event(&request->completed, + request->params.timeout_ms); +} + +void hdd_request_complete(struct hdd_request *request) +{ + (void)vos_event_set(&request->completed); +} + +void hdd_request_manager_init(void) +{ + hddLog(VOS_TRACE_LEVEL_INFO, FL("%pS"), (void *)_RET_IP_); + if (is_initialized) + return; + + hdd_list_init(&requests, MAX_NUM_REQUESTS); + spin_lock_init(&spinlock); + is_initialized = true; +} + +/* + * hdd_request_manager_deinit implementation note: + * It is intentional that we do not destroy the list or the spinlock. + * This allows threads to still access the infrastructure even when it + * has been deinitialized. Since neither lists nor spinlocks consume + * resources this does not result in a resource leak. + */ +void hdd_request_manager_deinit(void) +{ + hddLog(VOS_TRACE_LEVEL_INFO, FL("%pS"), (void *)_RET_IP_); + is_initialized = false; +} diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c index e31c1ce542b6..73c8a1e9e478 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,9 +31,6 @@ \brief WLAN Host Device Driver implementation - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -70,7 +67,7 @@ #include #include - +#include #define WEXT_CSCAN_HEADER "CSCAN S\x01\x00\x00S\x00" #define WEXT_CSCAN_HEADER_SIZE 12 @@ -217,6 +214,7 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu int error; char custom[MAX_CUSTOM_LEN]; char *p; + tANI_U32 status; hddLog( LOG1, "hdd_IndicateScanResult " MAC_ADDRESS_STR, MAC_ADDR_ARRAY(descriptor->bssId)); @@ -345,8 +343,15 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu pDot11IEHTCaps = NULL; - dot11fUnpackBeaconIEs ((tpAniSirGlobal) + status = dot11fUnpackBeaconIEs ((tpAniSirGlobal) hHal, (tANI_U8 *) descriptor->ieFields, ie_length, &dot11BeaconIEs); + if (DOT11F_FAILED(status)) + { + hddLog(LOGE, + FL("unpack failed for Beacon IE status:(0x%08x)"), + status); + return -EINVAL; + } pDot11SSID = &dot11BeaconIEs.SSID; @@ -487,11 +492,11 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu event.u.qual.noise = descriptor->sinr; /*To keep the rssi icon of the connected AP in the scan window - *and the rssi icon of the wireless networks in sync */ - if (( eConnectionState_Associated == + *and the rssi icon of the wireless networks in sync */ + if (( eConnectionState_Associated == pAdapter->sessionCtx.station.conn_info.connState ) && - ( VOS_TRUE == vos_mem_compare(descriptor->bssId, - pAdapter->sessionCtx.station.conn_info.bssId, + ( VOS_TRUE == vos_mem_compare(descriptor->bssId, + pAdapter->sessionCtx.station.conn_info.bssId, WNI_CFG_BSSID_LEN))) { event.u.qual.level = pAdapter->rssi; @@ -500,7 +505,7 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu { event.u.qual.level = VOS_MIN ((descriptor->rssi + descriptor->sinr), 0); } - + event.u.qual.updated = IW_QUAL_ALL_UPDATED; current_event = iwe_stream_add_event(scanInfo->info,current_event, @@ -532,6 +537,64 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu return 0; } +/**--------------------------------------------------------------------------- + + \brief hdd_processSpoofMacAddrRequest() - + + The function is called from scan completion callback and from + cfg80211 vendor command + + \param - pHddCtx - Pointer to the HDD Context. + + \return - 0 for success, non zero for failure + + --------------------------------------------------------------------------*/ + +VOS_STATUS hdd_processSpoofMacAddrRequest(hdd_context_t *pHddCtx) +{ + + ENTER(); + + mutex_lock(&pHddCtx->spoofMacAddr.macSpoofingLock); + + if (pHddCtx->spoofMacAddr.isEnabled) { + if (VOS_STATUS_SUCCESS != vos_randomize_n_bytes( + (void *)(&pHddCtx->spoofMacAddr.randomMacAddr.bytes[3]), + VOS_MAC_ADDR_LAST_3_BYTES)) { + pHddCtx->spoofMacAddr.isEnabled = FALSE; + mutex_unlock(&pHddCtx->spoofMacAddr.macSpoofingLock); + hddLog(LOGE, FL("Failed to generate random Mac Addr")); + return VOS_STATUS_E_FAILURE; + } + } + + hddLog(LOG1, FL("New Mac Addr Generated "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHddCtx->spoofMacAddr.randomMacAddr.bytes)); + + if (pHddCtx->scan_info.mScanPending != TRUE) + { + pHddCtx->spoofMacAddr.isReqDeferred = FALSE; + hddLog(LOG1, FL("Processing Spoof request now")); + /* Inform SME about spoof mac addr request*/ + if ( eHAL_STATUS_SUCCESS != sme_SpoofMacAddrReq(pHddCtx->hHal, + &pHddCtx->spoofMacAddr.randomMacAddr)) + { + hddLog(LOGE, FL("Sending Spoof request failed - Disable spoofing")); + pHddCtx->spoofMacAddr.isEnabled = FALSE; + } + } else + { + hddLog(LOG1, FL("Scan in Progress. Spoofing Deferred")); + pHddCtx->spoofMacAddr.isReqDeferred = TRUE; + } + + mutex_unlock(&pHddCtx->spoofMacAddr.macSpoofingLock); + + EXIT(); + + return VOS_STATUS_SUCCESS; +} + /**--------------------------------------------------------------------------- \brief hdd_ScanRequestCallback() - @@ -556,10 +619,10 @@ static eHalStatus hdd_ScanRequestCallback(tHalHandle halHandle, void *pContext, union iwreq_data wrqu; int we_event; char *msg; - + ENTER(); - hddLog(LOGW,"%s called with halHandle = %p, pContext = %p, scanID = %d," + hddLog(LOGW,"%s called with halHandle = %pK, pContext = %pK, scanID = %d," " returned status = %d", __func__, halHandle, pContext, (int) scanId, (int) status); @@ -569,7 +632,7 @@ static eHalStatus hdd_ScanRequestCallback(tHalHandle halHandle, void *pContext, do some quick sanity before proceeding */ if (pAdapter->dev != dev) { - hddLog(LOGW, "%s: device mismatch %p vs %p", + hddLog(LOGW, "%s: device mismatch %pK vs %pK", __func__, pAdapter->dev, dev); return eHAL_STATUS_SUCCESS; } @@ -600,7 +663,7 @@ static eHalStatus hdd_ScanRequestCallback(tHalHandle halHandle, void *pContext, /**--------------------------------------------------------------------------- - \brief iw_set_scan() - + \brief __iw_set_scan() - This function process the scan request from the wpa_supplicant and set the scan request to the SME @@ -614,24 +677,46 @@ static eHalStatus hdd_ScanRequestCallback(tHalHandle halHandle, void *pContext, --------------------------------------------------------------------------*/ -int iw_set_scan(struct net_device *dev, struct iw_request_info *info, +int __iw_set_scan(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) ; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pwextBuf; tCsrScanRequest scanRequest; v_U32_t scanId = 0; eHalStatus status = eHAL_STATUS_SUCCESS; struct iw_scan_req *scanReq = (struct iw_scan_req *)extra; + int ret = 0; ENTER(); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: enter !!!",__func__); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pwextBuf) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pwextBuf is NULL",__func__); + return -EINVAL; + } #ifdef WLAN_BTAMP_FEATURE //Scan not supported when AMP traffic is on. - if( VOS_TRUE == WLANBAP_AmpSessionOn() ) + if( VOS_TRUE == WLANBAP_AmpSessionOn() ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: No scanning when AMP is on",__func__); return eHAL_STATUS_SUCCESS; @@ -643,10 +728,6 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, return eHAL_STATUS_SUCCESS; } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return eHAL_STATUS_SUCCESS; - } vos_mem_zero( &scanRequest, sizeof(scanRequest)); if (NULL != wrqu->data.pointer) @@ -667,7 +748,8 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { - if(scanReq->essid_len) { + if(scanReq->essid_len && + (scanReq->essid_len <= SIR_MAC_MAX_SSID_LENGTH)) { scanRequest.SSIDs.numOfSSIDs = 1; scanRequest.SSIDs.SSIDList =( tCsrSSIDInfo *)vos_mem_malloc(sizeof(tCsrSSIDInfo)); if(scanRequest.SSIDs.SSIDList) { @@ -681,6 +763,10 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, VOS_ASSERT(0); } } + else + { + hddLog(LOGE, FL("Invalid essid length : %d"), scanReq->essid_len); + } } /* set min and max channel time */ @@ -719,7 +805,7 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, if (0 != pwextBuf->genIE.length) { memset( &pHddCtx->scan_info.scanAddIE, 0, sizeof(pHddCtx->scan_info.scanAddIE) ); - memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata, + memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata, pwextBuf->genIE.length ); pHddCtx->scan_info.scanAddIE.length = pwextBuf->genIE.length; /* Maximum length of each IE is SIR_MAC_MAX_IE_LENGTH */ @@ -741,14 +827,14 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, } /* push addIEScan in scanRequset if exist */ - if (pHddCtx->scan_info.scanAddIE.addIEdata && + if (pHddCtx->scan_info.scanAddIE.addIEdata && pHddCtx->scan_info.scanAddIE.length) - { + { scanRequest.uIEFieldLen = pHddCtx->scan_info.scanAddIE.length; scanRequest.pIEField = pHddCtx->scan_info.scanAddIE.addIEdata; } - status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); + status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); if (!HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:sme_ScanRequest fail %d!!!",__func__, status); @@ -765,14 +851,24 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, vos_mem_free(scanRequest.SSIDs.SSIDList); EXIT(); - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: exit !!!",__func__); return status; } +int iw_set_scan(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_scan(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /**--------------------------------------------------------------------------- - \brief iw_get_scan() - + \brief __iw_get_scan() - This function returns the scan results to the wpa_supplicant @@ -785,34 +881,50 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, --------------------------------------------------------------------------*/ -int iw_get_scan(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int __iw_get_scan(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) ; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + tHalHandle hHal; tCsrScanResultInfo *pScanResult; eHalStatus status = eHAL_STATUS_SUCCESS; hdd_scan_info_t scanInfo; tScanResultHandle pResult; - int i = 0; + int i = 0, ret = 0; + ENTER(); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: enter buffer length %d!!!", __func__, (wrqu->data.length)?wrqu->data.length:IW_SCAN_MAX_DATA); - ENTER(); - if (TRUE == pHddCtx->scan_info.mScanPending) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:mScanPending is TRUE !!!",__func__); - return -EAGAIN; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return -EAGAIN; + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } + if (TRUE == pHddCtx->scan_info.mScanPending) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:mScanPending is TRUE !!!",__func__); + return -EAGAIN; + } scanInfo.dev = dev; scanInfo.start = extra; scanInfo.info = info; @@ -831,7 +943,7 @@ int iw_get_scan(struct net_device *dev, if (NULL == pResult) { // no scan results - hddLog(LOG1,"iw_get_scan: NULL Scan Result "); + hddLog(LOG1,"__iw_get_scan: NULL Scan Result "); return 0; } @@ -850,11 +962,24 @@ int iw_get_scan(struct net_device *dev, sme_ScanResultPurge(hHal, pResult); - EXIT(); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: exit total %d BSS reported !!!",__func__, i); + EXIT(); return status; } +int iw_get_scan(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_scan(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + #if 0 static eHalStatus hdd_CscanRequestCallback(tHalHandle halHandle, void *pContext, tANI_U32 scanId, eCsrScanStatus status) @@ -868,7 +993,7 @@ static eHalStatus hdd_CscanRequestCallback(tHalHandle halHandle, void *pContext, VOS_STATUS vos_status = VOS_STATUS_SUCCESS; ENTER(); - hddLog(LOG1,"%s called with halHandle = %p, pContext = %p, scanID = %d," + hddLog(LOG1,"%s called with halHandle = %pK, pContext = %pK, scanID = %d," " returned status = %d", __func__, halHandle, pContext, (int) scanId, (int) status); @@ -960,7 +1085,7 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, if(WEXT_SCAN_PENDING_GIVEUP == scanPendingOption) { pHddCtx->scan_info.waitScanResult = FALSE; - return eHAL_STATUS_SUCCESS; + return eHAL_STATUS_SUCCESS; } /* If any scan pending, wait till finish current scan, and try this scan request when previous scan finish */ @@ -972,34 +1097,34 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, WEXT_CSCAN_SCAN_DONE_WAIT_TIME)) { hddLog(LOG1,"%s: Previous SCAN does not finished on time",__func__); - return eHAL_STATUS_SUCCESS; + return eHAL_STATUS_SUCCESS; } } /* Piggyback previous scan result */ else if(WEXT_SCAN_PENDING_PIGGYBACK == scanPendingOption) { pHddCtx->scan_info.waitScanResult = TRUE; - return eHAL_STATUS_SUCCESS; + return eHAL_STATUS_SUCCESS; } } pHddCtx->scan_info.waitScanResult = FALSE; /* Check for scan IE */ - while( WEXT_CSCAN_SSID_SECTION == str_ptr[i] ) + while( WEXT_CSCAN_SSID_SECTION == str_ptr[i] ) { /* ssid_len */ - if(str_ptr[++i] != WEXT_CSCAN_CHANNEL_SECTION) + if(str_ptr[++i] != WEXT_CSCAN_CHANNEL_SECTION) { /* total number of ssid's */ num_ssid++; /* increment length filed */ i += str_ptr[i] + 1; - } + } /* i should be saved and it will be pointing to 'C' */ } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: numSsid %d !!!",__func__, num_ssid); - if( num_ssid ) + if( num_ssid ) { /* To be fixed in SME and PE: override the number of ssid with 1, * as SME and PE does not handle multiple SSID in scan request @@ -1031,9 +1156,9 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, } /* Check for Channel IE */ - if ( WEXT_CSCAN_CHANNEL_SECTION == str_ptr[i]) + if ( WEXT_CSCAN_CHANNEL_SECTION == str_ptr[i]) { - if( str_ptr[++i] == 0 ) + if( str_ptr[++i] == 0 ) { scanRequest.ChannelInfo.numOfChannels = 0; scanRequest.ChannelInfo.ChannelList = NULL; @@ -1046,7 +1171,7 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, /* store temp channel list */ /* SME expects 1 byte channel content */ scanRequest.ChannelInfo.ChannelList = vos_mem_malloc(scanRequest.ChannelInfo.numOfChannels * sizeof(v_U8_t)); - if(NULL == scanRequest.ChannelInfo.ChannelList) + if(NULL == scanRequest.ChannelInfo.ChannelList) { hddLog(LOGE, "memory alloc failed for channel list creation"); status = -ENOMEM; @@ -1070,7 +1195,7 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, /* Now i is pointing to passive dwell dwell time */ /* 'P',min dwell time, max dwell time */ /* next two offsets contain min and max channel time */ - if( WEXT_CSCAN_PASV_DWELL_SECTION == (str_ptr[i]) ) + if( WEXT_CSCAN_PASV_DWELL_SECTION == (str_ptr[i]) ) { /* No SSID specified, num_ssid == 0, then start paasive scan */ if (!num_ssid || (eSIR_PASSIVE_SCAN == pHddCtx->scan_info.scan_mode)) @@ -1083,11 +1208,11 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, else { i += 3; - } - } + } + } /* H indicates active channel time */ - if( WEXT_CSCAN_HOME_DWELL_SECTION == (str_ptr[i]) ) + if( WEXT_CSCAN_HOME_DWELL_SECTION == (str_ptr[i]) ) { if (num_ssid || (eSIR_ACTIVE_SCAN == pHddCtx->scan_info.scan_mode)) { @@ -1110,7 +1235,7 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, if(0 != pwextBuf->genIE.length) { memset( &pHddCtx->scan_info.scanAddIE, 0, sizeof(pHddCtx->scan_info.scanAddIE) ); - memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata, + memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata, pwextBuf->genIE.length ); pHddCtx->scan_info.scanAddIE.length = pwextBuf->genIE.length; if (SIR_MAC_MAX_IE_LENGTH >= pwextBuf->genIE.length) @@ -1133,15 +1258,15 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, } /* push addIEScan in scanRequset if exist */ - if (pHddCtx->scan_info.scanAddIE.addIEdata && + if (pHddCtx->scan_info.scanAddIE.addIEdata && pHddCtx->scan_info.scanAddIE.length) { scanRequest.uIEFieldLen = pHddCtx->scan_info.scanAddIE.length; scanRequest.pIEField = pHddCtx->scan_info.scanAddIE.addIEdata; } - status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, - pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); + status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, + pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); if( !HAL_STATUS_SUCCESS(status) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: SME scan fail status %d !!!",__func__, status); @@ -1161,7 +1286,7 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, exit_point: /* free ssidlist */ - if (scanRequest.SSIDs.SSIDList) + if (scanRequest.SSIDs.SSIDList) { vos_mem_free(scanRequest.SSIDs.SSIDList); } @@ -1177,9 +1302,10 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, } /* Abort any MAC scan if in progress */ -void hdd_abort_mac_scan(hdd_context_t* pHddCtx, tANI_U8 sessionId, - eCsrAbortReason reason) +tSirAbortScanStatus hdd_abort_mac_scan(hdd_context_t* pHddCtx, + tANI_U8 sessionId, + eCsrAbortReason reason) { - sme_AbortMacScan(pHddCtx->hHal, sessionId, reason); + return sme_AbortMacScan(pHddCtx->hHal, sessionId, reason); } diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c index 544860f94fff..66b27cd259f9 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c @@ -30,9 +30,6 @@ \file wlan_hdd_softap_tx_rx.c \brief Linux HDD Tx/RX APIs - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ @@ -49,6 +46,7 @@ #include //#include #include +#include #include #include #include @@ -59,7 +57,8 @@ #include #endif #include "sapInternal.h" - +#include "wlan_hdd_trace.h" +#include "vos_diag_core_event.h" /*--------------------------------------------------------------------------- Preprocessor definitions and constants -------------------------------------------------------------------------*/ @@ -74,10 +73,10 @@ #if 0 static void hdd_softap_dump_sk_buff(struct sk_buff * skb) { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: head = %p", __func__, skb->head); - //VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data = %p", __func__, skb->data); - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: tail = %p", __func__, skb->tail); - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: end = %p", __func__, skb->end); + VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: head = %pK", __func__, skb->head); + //VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data = %pK", __func__, skb->data); + VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: tail = %pK", __func__, skb->tail); + VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: end = %pK", __func__, skb->end); VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: len = %d", __func__, skb->len); VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data_len = %d", __func__, skb->data_len); VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: mac_len = %d", __func__, skb->mac_len); @@ -115,11 +114,10 @@ void hdd_softap_traffic_monitor_timeout_handler( void *pUsrData ) hdd_context_t *pHddCtx = (hdd_context_t *)pUsrData; v_TIME_t currentTS; - if (NULL == pHddCtx) + ENTER(); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Invalid user data, context", __func__); - return; + return; } currentTS = vos_timer_get_system_time(); @@ -137,6 +135,7 @@ void hdd_softap_traffic_monitor_timeout_handler( void *pUsrData ) pHddCtx->cfg_ini->trafficIdleTimeout); } + EXIT(); return; } @@ -146,12 +145,10 @@ VOS_STATUS hdd_start_trafficMonitor( hdd_adapter_t *pAdapter ) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); VOS_STATUS status = VOS_STATUS_SUCCESS; + ENTER(); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -178,6 +175,8 @@ VOS_STATUS hdd_start_trafficMonitor( hdd_adapter_t *pAdapter ) VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, "%s Traffic Monitor is not Enable in ini file", __func__); } + + EXIT(); return status; } @@ -186,12 +185,10 @@ VOS_STATUS hdd_stop_trafficMonitor( hdd_adapter_t *pAdapter ) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); VOS_STATUS status = VOS_STATUS_SUCCESS; + ENTER(); status = wlan_hdd_validate_context(pHddCtx); - if (-ENODEV == status) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is not valid", __func__); return status; } @@ -210,6 +207,7 @@ VOS_STATUS hdd_stop_trafficMonitor( hdd_adapter_t *pAdapter ) vos_lock_destroy(&pHddCtx->traffic_monitor.trafficLock); pHddCtx->traffic_monitor.isInitialized = 0; } + EXIT(); return VOS_STATUS_SUCCESS; } @@ -306,6 +304,7 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) //Extract the destination address from ethernet frame v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; int os_status = NETDEV_TX_OK; + struct sk_buff *skb1; v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; ptSapContext pSapCtx = NULL; @@ -319,6 +318,13 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) return os_status; } + if (pHddCtx == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + FL("pHddCtx is NULL")); + goto xmit_done; + } + pDestMacAddress = (v_MACADDR_t*)skb->data; ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled; @@ -342,7 +348,7 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) } else { - STAId = *(v_U8_t *)(((v_U8_t *)(skb->data)) - 1); + STAId = hdd_sta_id_find_from_mac_addr(pAdapter, pDestMacAddress); if (STAId == HDD_WLAN_INVALID_STA_ID) { VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, @@ -396,7 +402,8 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, "%s: Classified as ac %d up %d", __func__, ac, up); - if ( ( NULL != pHddCtx ) && pHddCtx->cfg_ini->enableDhcpDebug ) + if (( NULL != pHddCtx ) && + (pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_PROTO_TYPE_DHCP)) { hdd_dump_dhcp_pkt(skb, TX_PATH); } @@ -412,6 +419,8 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pSapCtx->aStaInfo[STAId].txSuspended[ac] = VOS_TRUE; netif_stop_subqueue(dev, skb_get_queue_mapping(skb)); txSuspended = VOS_TRUE; + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_STOP_NETDEV, + pAdapter->sessionId, ac)); } /* If 3/4th of the max queue size is used then enable the flag. @@ -420,8 +429,10 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { if (pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].count >= HDD_TX_QUEUE_LOW_WATER_MARK) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + if (!(pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].ratelimit_count % 0x40)) + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: TX queue for Best Effort AC is 3/4th full", __func__); + pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].ratelimit_count++; pSapCtx->aStaInfo[STAId].vosLowResource = VOS_TRUE; } else @@ -485,10 +496,20 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) spin_lock_bh(&pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].lock); status = hdd_list_remove_back( &pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac], &anchor); spin_unlock_bh(&pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].lock); + /* Free the skb only if we are able to remove it from the list. + * If we are not able to retrieve it from the list it means that + * the skb was pulled by TX Thread and is use so we should not free + * it here + */ + if (VOS_IS_STATUS_SUCCESS(status)) + { + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb1 = pktNode->skb; + kfree_skb(skb1); + } ++pAdapter->stats.tx_dropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); goto xmit_done; } } @@ -524,6 +545,7 @@ VOS_STATUS hdd_softap_sta_2_sta_xmit(struct sk_buff *skb, hdd_adapter_t *pAdapter = (hdd_adapter_t *)netdev_priv(dev); v_U8_t ac; vos_list_node_t *anchor = NULL; + struct sk_buff *skb1; v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; ptSapContext pSapCtx = NULL; @@ -623,10 +645,20 @@ VOS_STATUS hdd_softap_sta_2_sta_xmit(struct sk_buff *skb, spin_lock_bh(&pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].lock); status = hdd_list_remove_back( &pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac], &anchor); spin_unlock_bh(&pSapCtx->aStaInfo[STAId].wmm_tx_queue[ac].lock); + /* Free the skb only if we are able to remove it from the list. + * If we are not able to retrieve it from the list it means that + * the skb was pulled by TX Thread and is use so we should not free + * it here + */ + if (VOS_IS_STATUS_SUCCESS(status)) + { + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb1 = pktNode->skb; + kfree_skb(skb1); + } ++pAdapter->stats.tx_dropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); status = VOS_STATUS_E_FAILURE; goto xmit_end; } @@ -640,18 +672,19 @@ VOS_STATUS hdd_softap_sta_2_sta_xmit(struct sk_buff *skb, } /**============================================================================ - @brief hdd_softap_tx_timeout() - Function called by OS if there is any + @brief __hdd_softap_tx_timeout() - Function called by OS if there is any timeout during transmission. Since HDD simply enqueues packet and returns control to OS right away, this would never be invoked @param dev : [in] pointer to Libra network device @return : None ===========================================================================*/ -void hdd_softap_tx_timeout(struct net_device *dev) +void __hdd_softap_tx_timeout(struct net_device *dev) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); struct netdev_queue *txq; int i = 0; + int status = 0; hdd_context_t *pHddCtx; VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, @@ -666,15 +699,15 @@ void hdd_softap_tx_timeout(struct net_device *dev) } pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - if (pHddCtx->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:LOGP in Progress. Ignore!!!",__func__); + status = wlan_hdd_validate_context(pHddCtx); + if (status != 0) + { return; } ++pAdapter->hdd_stats.hddTxRxStats.txTimeoutCount; - for (i = 0; i < 8; i++) + for (i = 0; i < NUM_TX_QUEUES; i++) { txq = netdev_get_tx_queue(dev, i); VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, @@ -682,7 +715,7 @@ void hdd_softap_tx_timeout(struct net_device *dev) } VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "carrier state: %d", netif_carrier_ok(dev)); + "carrier state: %d", netif_carrier_ok(dev)); ++pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount; @@ -718,21 +751,37 @@ void hdd_softap_tx_timeout(struct net_device *dev) } +void hdd_softap_tx_timeout(struct net_device *dev) +{ + vos_ssr_protect(__func__); + __hdd_softap_tx_timeout(dev); + vos_ssr_unprotect(__func__); + return; +} /**============================================================================ - @brief hdd_softap_stats() - Function registered with the Linux OS for + @brief __hdd_softap_stats() - Function registered with the Linux OS for device TX/RX statistic @param dev : [in] pointer to Libra network device @return : pointer to net_device_stats structure ===========================================================================*/ -struct net_device_stats* hdd_softap_stats(struct net_device *dev) +struct net_device_stats* __hdd_softap_stats(struct net_device *dev) { hdd_adapter_t* priv = netdev_priv(dev); return &priv->stats; } +struct net_device_stats* hdd_softap_stats(struct net_device *dev) +{ + struct net_device_stats *priv_stats; + vos_ssr_protect(__func__); + priv_stats = __hdd_softap_stats(dev); + vos_ssr_unprotect(__func__); + + return priv_stats; +} /**============================================================================ @brief hdd_softap_init_tx_rx() - Init function to initialize Tx/RX @@ -898,8 +947,10 @@ static VOS_STATUS hdd_softap_flush_tx_queues_sta( hdd_adapter_t *pAdapter, v_U8_ VOS_STATUS hdd_softap_init_tx_rx_sta( hdd_adapter_t *pAdapter, v_U8_t STAId, v_MACADDR_t *pmacAddrSTA) { v_U8_t i = 0; + VOS_STATUS status; v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; ptSapContext pSapCtx = NULL; + pSapCtx = VOS_GET_SAP_CB(pVosContext); if(pSapCtx == NULL){ VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, @@ -927,6 +978,19 @@ VOS_STATUS hdd_softap_init_tx_rx_sta( hdd_adapter_t *pAdapter, v_U8_t STAId, v_M vos_copy_macaddr( &pSapCtx->aStaInfo[STAId].macAddrSTA, pmacAddrSTA); spin_unlock_bh( &pSapCtx->staInfo_lock ); + + status = hdd_sta_id_hash_add_entry(pAdapter, STAId, pmacAddrSTA); + if (status != VOS_STATUS_SUCCESS) { + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Not able to add staid hash %d"), STAId); + return VOS_STATUS_E_FAILURE; + } + + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, + FL("New station added sta_id %d mac:" + MAC_ADDRESS_STR), STAId, + MAC_ADDR_ARRAY(pmacAddrSTA->bytes)); + return VOS_STATUS_SUCCESS; } @@ -972,6 +1036,21 @@ VOS_STATUS hdd_softap_deinit_tx_rx_sta ( hdd_adapter_t *pAdapter, v_U8_t STAId ) pSapCtx->aStaInfo[STAId].isUsed = FALSE; pSapCtx->aStaInfo[STAId].isDeauthInProgress = FALSE; + + status = hdd_sta_id_hash_remove_entry(pAdapter, + STAId, &pSapCtx->aStaInfo[STAId].macAddrSTA); + if (status != VOS_STATUS_SUCCESS) { + spin_unlock_bh( &pSapCtx->staInfo_lock ); + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Not able to remove staid hash %d"), STAId); + return VOS_STATUS_E_FAILURE; + } + + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, + FL("station removed sta_id %d mac:" + MAC_ADDRESS_STR), STAId, + MAC_ADDR_ARRAY(pSapCtx->aStaInfo[STAId].macAddrSTA.bytes)); + /* if this STA had any of its WMM TX queues suspended, then the associated queue on the network interface was disabled. check to see if that is the case, in which case we need to re-enable @@ -1068,10 +1147,10 @@ VOS_STATUS hdd_softap_tx_complete_cbk( v_VOID_t *vosContext, //Get the Adapter context. pAdapter = (hdd_adapter_t *)netdev_priv(((struct sk_buff *)pOsPkt)->dev); - if(pAdapter == NULL) + if((pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: HDD adapter context is Null", __func__); + "%s: HDD adapter context is invalid", __func__); } else { @@ -1315,13 +1394,14 @@ VOS_STATUS hdd_softap_tx_fetch_packet_cbk( v_VOID_t *vosContext, { if (TRUE == hdd_IsEAPOLPacket( pVosPacket )) { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: VOS packet is EAPOL packet", __func__); pPktMetaInfo->ucIsEapol = 1; + wlan_hdd_log_eapol(skb, + WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED); } } - - if (pHddCtx->cfg_ini->gEnableDebugLog) + + if ((NULL != pHddCtx) && + (pHddCtx->cfg_ini->gEnableDebugLog)) { proto_type = vos_pkt_get_proto_type(skb, pHddCtx->cfg_ini->gEnableDebugLog); @@ -1335,9 +1415,15 @@ VOS_STATUS hdd_softap_tx_fetch_packet_cbk( v_VOID_t *vosContext, VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "SAP TX DHCP"); } + else if (VOS_PKT_PROTO_TYPE_ARP & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "SAP TX ARP"); + } } //xg: @@@@: temporarily disble these. will revisit later { + pPktMetaInfo->ac = ac; pPktMetaInfo->ucUP = pktNode->userPriority; pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; } @@ -1359,6 +1445,8 @@ VOS_STATUS hdd_softap_tx_fetch_packet_cbk( v_VOID_t *vosContext, "%s: TX queue re-enabled", __func__); pSapCtx->aStaInfo[STAId].txSuspended[ac] = VOS_FALSE; netif_wake_subqueue(pAdapter->dev, skb_get_queue_mapping(skb)); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_WAKE_NETDEV, + pAdapter->sessionId, ac)); } // We're giving the packet to TL so consider it transmitted from @@ -1405,10 +1493,11 @@ VOS_STATUS hdd_softap_tx_low_resource_cbk( vos_pkt_t *pVosPacket, v_U8_t STAId = WLAN_MAX_STA_COUNT; v_CONTEXT_t pVosContext = NULL; ptSapContext pSapCtx = NULL; - if(pAdapter == NULL) + + if (pAdapter == NULL || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: HDD adapter context is Null", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Invalid adapter %pK"), pAdapter); return VOS_STATUS_E_FAILURE; } pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; @@ -1549,8 +1638,7 @@ VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, } // Extract the OS packet (skb). - // Tell VOS to detach the OS packet from the VOS packet - status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_TRUE ); + status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_FALSE ); if(!VOS_IS_STATUS_SUCCESS( status )) { ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; @@ -1558,7 +1646,11 @@ VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, "%s: Failure extracting skb from vos pkt", __func__); return VOS_STATUS_E_FAILURE; } - + + if (TRUE == hdd_IsEAPOLPacket(pVosPacket)) + wlan_hdd_log_eapol(skb, WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED); + + pVosPacket->pSkb = NULL; //hdd_softap_dump_sk_buff(skb); skb->dev = pAdapter->dev; @@ -1587,6 +1679,11 @@ VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "SAP RX DHCP"); } + else if (VOS_PKT_PROTO_TYPE_ARP & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "SAP RX ARP"); + } } if (WLAN_RX_BCMC_STA_ID == pRxMetaInfo->ucDesSTAId) @@ -1619,17 +1716,19 @@ VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, { VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO_LOW, "%s: send one packet to kernel", __func__); - if ( pHddCtx->cfg_ini->enableDhcpDebug ) + if ((NULL != pHddCtx) && + (pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_PROTO_TYPE_DHCP)) { hdd_dump_dhcp_pkt(skb, RX_PATH); } skb->protocol = eth_type_trans(skb, skb->dev); skb->ip_summed = CHECKSUM_NONE; -#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif + vos_wake_lock_timeout_release(&pHddCtx->rx_wake_lock, + HDD_WAKE_LOCK_DURATION, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); + #endif rxstat = netif_rx_ni(skb); if (NET_RX_SUCCESS == rxstat) @@ -1865,10 +1964,12 @@ VOS_STATUS hdd_softap_RegisterSTA( hdd_adapter_t *pAdapter, "Turn on Monitor the carrier"); netif_carrier_on(pmonAdapter->dev); //Enable Tx queue + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues(pmonAdapter->dev); } netif_carrier_on(pAdapter->dev); //Enable Tx queue + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues(pAdapter->dev); return( vosStatus ); diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tdls.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tdls.c index b802c10e256d..27b611cba480 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tdls.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tdls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -43,6 +43,8 @@ #include #include "wlan_hdd_tdls.h" #include "wlan_hdd_cfg80211.h" +#include "wlan_hdd_assoc.h" +#include "sme_Api.h" #include "vos_sched.h" static tANI_S32 wlan_hdd_get_tdls_discovery_peer_cnt(tdlsCtx_t *pHddTdlsCtx); @@ -51,16 +53,16 @@ static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx); static void wlan_hdd_tdls_peer_timers_destroy(tdlsCtx_t *pHddTdlsCtx); int wpa_tdls_is_allowed_force_peer(tdlsCtx_t *pHddTdlsCtx, u8 *mac); #ifdef CONFIG_TDLS_IMPLICIT -static void wlan_hdd_tdls_pre_setup(struct work_struct *work); +static void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t *pHddTdlsCtx); #endif -#ifndef WLAN_FEATURE_TDLS_DEBUG -#define TDLS_LOG_LEVEL VOS_TRACE_LEVEL_INFO +static u8 wlan_hdd_tdls_hash_key ( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac #else -#define TDLS_LOG_LEVEL VOS_TRACE_LEVEL_WARN + u8 *mac #endif - -static u8 wlan_hdd_tdls_hash_key (u8 *mac) + ) { int i; u8 key = 0; @@ -71,19 +73,125 @@ static u8 wlan_hdd_tdls_hash_key (u8 *mac) return key; } -#ifdef CONFIG_TDLS_IMPLICIT -static void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t * pHddTdlsCtx, - hddTdlsPeer_t *curr_candidate) +/** + * wlan_hdd_tdls_disable_offchan_and_teardown_links - Disable offchannel + * and teardown TDLS links + * @hddCtx : pointer to hdd context + * + * Return: None + */ +void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) { - if (TDLS_CTX_MAGIC != pHddTdlsCtx->magic) - { - pHddTdlsCtx->curr_candidate = curr_candidate; - pHddTdlsCtx->magic = TDLS_CTX_MAGIC; + u16 connected_tdls_peers = 0; + u8 staIdx; + hddTdlsPeer_t *curr_peer = NULL; + hdd_adapter_t *adapter = NULL; + bool tdls_unlock = FALSE; + + if (eTDLS_SUPPORT_NOT_ENABLED == hddctx->tdls_mode) { + hddLog(LOG1, FL("TDLS mode is disabled OR not enabled in FW")); + return ; + } + + adapter = hdd_get_adapter(hddctx, WLAN_HDD_INFRA_STATION); + + if (adapter == NULL) { + hddLog(LOGE, FL("Station Adapter Not Found")); + goto done; + } + + connected_tdls_peers = wlan_hdd_tdlsConnectedPeers(adapter); + if (!connected_tdls_peers) { + hddLog(LOG1, FL("No TDLS connected peers to delete TDLS peers")); + goto done; + } + + /* TDLS is not supported in case of concurrency + * Disable TDLS Offchannel to avoid more than two concurrent channels. + */ + if (connected_tdls_peers == 1) { + tSirMacAddr peer_mac; + int32_t channel; + + mutex_lock(&hddctx->tdls_lock); + curr_peer = wlan_hdd_tdls_get_connected_peer(adapter); + if (curr_peer && (curr_peer->isOffChannelConfigured == TRUE)) { + hddLog(LOG1, FL("%s: Concurrency detected, Disable " + "TDLS channel switch"), __func__); + curr_peer->isOffChannelEstablished = FALSE; + channel = curr_peer->peerParams.channel; + vos_mem_copy(peer_mac, curr_peer->peerMac, sizeof(tSirMacAddr)); + mutex_unlock(&hddctx->tdls_lock); + + sme_SendTdlsChanSwitchReq(WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId, + peer_mac, + channel, + TDLS_OFF_CHANNEL_BW_OFFSET, + TDLS_CHANNEL_SWITCH_DISABLE); + tdls_unlock = TRUE; + } + if (tdls_unlock == FALSE) + mutex_unlock(&hddctx->tdls_lock); + } - schedule_work(&pHddTdlsCtx->implicit_setup); + /* Send Msg to PE for sending deauth and deleting all the TDLS peers */ + sme_DeleteAllTDLSPeers(hddctx->hHal, adapter->sessionId); + + /* As mentioned above TDLS is not supported in case of concurrency + * Find the connected peer and generate TDLS teardown indication to + * supplicant. + */ + for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) { + if (!hddctx->tdlsConnInfo[staIdx].staId) + continue; + + curr_peer = wlan_hdd_tdls_find_all_peer(hddctx, + hddctx->tdlsConnInfo[staIdx].peerMac.bytes); + + if (!curr_peer) + continue; + + /* Del Sta happened already as part of sme_DeleteAllTDLSPeers + * Hence clear hdd data structure. + */ + hdd_roamDeregisterTDLSSTA(adapter, + hddctx->tdlsConnInfo[staIdx].staId); + wlan_hdd_tdls_decrement_peer_count(adapter); + wlan_hdd_tdls_reset_peer(adapter, curr_peer->peerMac); + + hddctx->tdlsConnInfo[staIdx].staId = 0 ; + hddctx->tdlsConnInfo[staIdx].sessionId = 255; + vos_mem_zero(&hddctx->tdlsConnInfo[staIdx].peerMac, + sizeof(v_MACADDR_t)) ; + wlan_hdd_tdls_check_bmps(adapter); + + hddLog(LOG1, FL("indicate TDLS teardown (staId %d)"), + curr_peer->staId); + + /* Indicate teardown to supplicant */ + wlan_hdd_tdls_indicate_teardown( + curr_peer->pHddTdlsCtx->pAdapter, + curr_peer, + eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); } + +done: + wlan_hdd_tdls_set_mode(hddctx, eTDLS_SUPPORT_DISABLED, FALSE); + hddLog(LOG1, FL("TDLS Support Disabled")); +} + +/** + * hdd_tdls_notify_mode_change - Notify mode change + * @adapter: pointer to hdd adapter + * @hddCtx : pointer to hdd context + * + * Return: None + */ +void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter, hdd_context_t *hddctx) +{ + wlan_hdd_tdls_disable_offchan_and_teardown_links(hddctx); } -#endif static v_VOID_t wlan_hdd_tdls_start_peer_discover_timer(tdlsCtx_t *pHddTdlsCtx, tANI_BOOLEAN mutexLock, @@ -92,6 +200,8 @@ static v_VOID_t wlan_hdd_tdls_start_peer_discover_timer(tdlsCtx_t *pHddTdlsCtx, hdd_station_ctx_t *pHddStaCtx; hdd_context_t *pHddCtx; + ENTER(); + if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -103,8 +213,6 @@ static v_VOID_t wlan_hdd_tdls_start_peer_discover_timer(tdlsCtx_t *pHddTdlsCtx, if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } @@ -114,17 +222,14 @@ static v_VOID_t wlan_hdd_tdls_start_peer_discover_timer(tdlsCtx_t *pHddTdlsCtx, } pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pHddTdlsCtx->pAdapter); -#ifdef FEATURE_WLAN_TDLS_INTERNAL - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerDiscoverTimer, - discoveryExpiry); -#endif + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "beacon rssi: %d", pHddTdlsCtx->ap_rssi); if ( mutexLock ) mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); return; } @@ -135,39 +240,39 @@ static v_VOID_t wlan_hdd_tdls_discover_peer_cb( v_PVOID_t userData ) struct list_head *head; struct list_head *pos; hddTdlsPeer_t *curr_peer; - hdd_station_ctx_t *pHddStaCtx; hdd_context_t *pHddCtx; - tdlsCtx_t *pHddTdlsCtx = (tdlsCtx_t *)userData; + tdlsCtx_t *pHddTdlsCtx; int discover_req_sent = 0; v_U32_t discover_expiry = TDLS_SUB_DISCOVERY_PERIOD; tANI_BOOLEAN doMutexLock = eANI_BOOLEAN_TRUE; + v_CONTEXT_t pVosContext; - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) + ENTER(); + + pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL == pVosContext) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL(" pHddTdlsCtx or pAdapter points to NULL")); + FL("pVosContext points to NULL")); return; } - if (WLAN_HDD_ADAPTER_MAGIC != pHddTdlsCtx->pAdapter->magic) + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter has invalid magic")); return; } - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - if(0 != (wlan_hdd_validate_context(pHddCtx))) + mutex_lock(&pHddCtx->tdls_lock); + pHddTdlsCtx = (tdlsCtx_t *)userData; + if (0 != (wlan_hdd_validate_tdls_context(pHddCtx, pHddTdlsCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Invalid pHddTdlsCtx context")); return; } - mutex_lock(&pHddCtx->tdls_lock); - - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pHddTdlsCtx->pAdapter); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: ", __func__); if (0 == pHddTdlsCtx->discovery_peer_cnt) @@ -179,7 +284,7 @@ static v_VOID_t wlan_hdd_tdls_discover_peer_cb( v_PVOID_t userData ) list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%d " MAC_ADDRESS_STR " %d %d, %d %d %d %d", i, MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->discovery_processed, @@ -203,16 +308,17 @@ static v_VOID_t wlan_hdd_tdls_discover_peer_cb( v_PVOID_t userData ) if (curr_peer->discovery_attempt < pHddTdlsCtx->threshold_config.discovery_tries_n) { - sme_SendTdlsMgmtFrame(WLAN_HDD_GET_HAL_CTX(pHddTdlsCtx->pAdapter), - pHddTdlsCtx->pAdapter->sessionId, - curr_peer->peerMac, - WLAN_TDLS_DISCOVERY_REQUEST, - 1, 0, 0, NULL, 0, 0); + cfg80211_tdls_oper_request( + pHddTdlsCtx->pAdapter->dev, + curr_peer->peerMac, + NL80211_TDLS_DISCOVERY_REQ, + FALSE, + GFP_KERNEL); curr_peer->discovery_attempt++; } else { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: Maximum Discovery retries reached", __func__); curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; } @@ -227,7 +333,7 @@ static v_VOID_t wlan_hdd_tdls_discover_peer_cb( v_PVOID_t userData ) exit_loop: if (0 != pHddTdlsCtx->discovery_peer_cnt) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "discovery_peer_cnt is %d , Starting SUB_DISCOVERY_TIMER", pHddTdlsCtx->discovery_peer_cnt); discover_expiry = TDLS_SUB_DISCOVERY_PERIOD; @@ -255,6 +361,7 @@ static v_VOID_t wlan_hdd_tdls_discover_peer_cb( v_PVOID_t userData ) if ( !doMutexLock ) mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); return; } #endif @@ -265,45 +372,45 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) struct list_head *head; struct list_head *pos; hddTdlsPeer_t *curr_peer; - tdlsCtx_t *pHddTdlsCtx = (tdlsCtx_t *)userData; + tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) + ENTER(); + pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL == pVosContext) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL(" pHddTdlsCtx or pAdapter points to NULL")); + FL("pVosContext points to NULL")); return; } - if (WLAN_HDD_ADAPTER_MAGIC != pHddTdlsCtx->pAdapter->magic) + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter has invalid magic")); return; } - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - - if(0 != (wlan_hdd_validate_context(pHddCtx))) + mutex_lock(&pHddCtx->tdls_lock); + pHddTdlsCtx = (tdlsCtx_t *)userData; + if (0 != (wlan_hdd_validate_tdls_context(pHddCtx, pHddTdlsCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Invalid pHddTdlsCtx context")); return; } - - mutex_lock(&pHddCtx->tdls_lock); - for (i = 0; i < 256; i++) { head = &pHddTdlsCtx->peer_list[i]; list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " link_status %d" " tdls_support %d", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->link_status, curr_peer->tdls_support); if (eTDLS_CAP_SUPPORTED == curr_peer->tdls_support) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "tx %d, rx %d (thr.pkt %d/idle %d), rssi %d (thr.trig %d/hys %d/tear %d)", curr_peer->tx_pkt, curr_peer->rx_pkt, pHddTdlsCtx->threshold_config.tx_packet_n, @@ -318,7 +425,7 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) if (pHddCtx->cfg_ini->fTDLSExternalControl && (FALSE == curr_peer->isForcedPeer)) { - continue; + goto next_peer; } if (curr_peer->tx_pkt >= @@ -327,14 +434,16 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) if (HDD_MAX_NUM_TDLS_STA > wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter)) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "Tput trigger TDLS pre-setup"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "Tput trigger TDLS pre-setup"); #ifdef CONFIG_TDLS_IMPLICIT - wlan_hdd_tdls_pre_setup_init_work(pHddTdlsCtx, curr_peer); + pHddTdlsCtx->curr_candidate = curr_peer; + wlan_hdd_tdls_implicit_send_discovery_request(pHddTdlsCtx); #endif } else { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Maximum peer connected already! %d", __func__, wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter) ); } @@ -401,7 +510,7 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) if (pHddCtx->cfg_ini->fTDLSExternalControl && (FALSE == curr_peer->isForcedPeer)) { - continue; + goto next_peer; } if (!TDLS_IS_CONNECTED(curr_peer)) { if (curr_peer->tx_pkt >= @@ -413,9 +522,11 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) */ if (curr_peer->isForcedPeer || curr_peer->discovery_attempt++ < pHddTdlsCtx->threshold_config.discovery_tries_n) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "TDLS UNKNOWN discover "); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "TDLS UNKNOWN discover "); #ifdef CONFIG_TDLS_IMPLICIT - wlan_hdd_tdls_pre_setup_init_work(pHddTdlsCtx, curr_peer); + pHddTdlsCtx->curr_candidate = curr_peer; + wlan_hdd_tdls_implicit_send_discovery_request(pHddTdlsCtx); #endif } else @@ -441,62 +552,73 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) &pHddTdlsCtx->peerUpdateTimer, pHddTdlsCtx->threshold_config.tx_period_t); mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); } static v_VOID_t wlan_hdd_tdls_idle_cb( v_PVOID_t userData ) { #ifdef CONFIG_TDLS_IMPLICIT - hddTdlsPeer_t *curr_peer = (hddTdlsPeer_t *)userData; + hddTdlsPeer_t *curr_peer; tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; + + ENTER(); + pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pVosContext points to NULL")); + return; + } + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + { + return; + } + + mutex_lock(&pHddCtx->tdls_lock); + + curr_peer = (hddTdlsPeer_t *)userData; if (NULL == curr_peer) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("Invalid tdls idle timer expired")); return; } - pHddTdlsCtx = curr_peer->pHddTdlsCtx; - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) + pHddTdlsCtx = curr_peer->pHddTdlsCtx; + if (0 != (wlan_hdd_validate_tdls_context(pHddCtx, pHddTdlsCtx))) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL(" pHddTdlsCtx or pAdapter points to NULL")); - return; - } - - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - - if(0 != (wlan_hdd_validate_context(pHddCtx))) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); + FL("Invalid pHddTdlsCtx context")); return; } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Tx/Rx Idle " MAC_ADDRESS_STR " tx_pkt: %d, rx_pkt: %d, idle_packet_n: %d", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->tx_pkt, curr_peer->rx_pkt, curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n); - mutex_lock(&pHddCtx->tdls_lock); - /* Check tx/rx statistics on this tdls link for recent activities and * then decide whether to tear down the link or keep it. */ if ((curr_peer->tx_pkt >= curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n) || (curr_peer->rx_pkt >= curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n)) { /* this tdls link got back to normal, so keep it */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls link to " MAC_ADDRESS_STR " back to normal, will stay", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); } else { /* this tdls link needs to get torn down */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: trigger tdls link to " MAC_ADDRESS_STR " down", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); @@ -505,6 +627,7 @@ static v_VOID_t wlan_hdd_tdls_idle_cb( v_PVOID_t userData ) eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); } mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); #endif } @@ -516,40 +639,41 @@ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData) struct list_head *pos, *q; tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext; - pHddTdlsCtx = (tdlsCtx_t *)userData; - - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) + ENTER(); + pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL == pVosContext) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL(" pHddTdlsCtx or pAdapter points to NULL")); + FL("pVosContext points to NULL")); return; } - if (WLAN_HDD_ADAPTER_MAGIC != pHddTdlsCtx->pAdapter->magic) + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter has invalid magic")); return; } - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - if(0 != (wlan_hdd_validate_context(pHddCtx))) + mutex_lock(&pHddCtx->tdls_lock); + + pHddTdlsCtx = (tdlsCtx_t *)userData; + if (0 != (wlan_hdd_validate_tdls_context(pHddCtx, pHddTdlsCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Invalid pHddTdlsCtx context")); return; } - mutex_lock(&pHddCtx->tdls_lock); - for (i = 0; i < 256; i++) { head = &pHddTdlsCtx->peer_list[i]; list_for_each_safe (pos, q, head) { tmp = list_entry(pos, hddTdlsPeer_t, node); if (eTDLS_LINK_DISCOVERING == tmp->link_status) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " to idle state", __func__, MAC_ADDR_ARRAY(tmp->peerMac)); wlan_hdd_tdls_set_peer_link_status( @@ -566,33 +690,78 @@ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData) mutex_unlock(&pHddCtx->tdls_lock); wlan_hdd_tdls_check_bmps(pHddTdlsCtx->pAdapter); - + EXIT(); return; } -static v_VOID_t wlan_hdd_tdls_initiator_wait_cb( v_PVOID_t userData ) +v_VOID_t wlan_hdd_tdls_initiator_wait_cb( v_PVOID_t userData ) { - hddTdlsPeer_t *curr_peer = (hddTdlsPeer_t *)userData; + tdlsConnInfo_t *tdlsInfo = (tdlsConnInfo_t *) userData; tdlsCtx_t *pHddTdlsCtx; + hdd_context_t *pHddCtx = NULL; + hdd_adapter_t *pAdapter = NULL; + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + hddTdlsPeer_t *curr_peer = NULL; - if ( NULL == curr_peer ) + ENTER(); + + if (!tdlsInfo->staId) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("curr_peer is NULL")); + FL("peer (staidx %u) doesn't exists"), tdlsInfo->staId); + return; + } + if (!pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (!pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pHddCtx is NULL")); + return; + } + + pAdapter = hdd_get_adapter_by_sme_session_id(pHddCtx, tdlsInfo->sessionId); + + if (!pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pAdapter is NULL")); return; } + mutex_lock(&pHddCtx->tdls_lock); + curr_peer = wlan_hdd_tdls_find_peer(pAdapter, + (u8 *) &tdlsInfo->peerMac.bytes[0], FALSE); + if (curr_peer == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("peer doesn't exists")); + mutex_unlock(&pHddCtx->tdls_lock); + return; + } pHddTdlsCtx = curr_peer->pHddTdlsCtx; if ( NULL == pHddTdlsCtx ) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("pHddTdlsCtx is NULL")); return; } - + if (0 != (wlan_hdd_validate_context( + WLAN_HDD_GET_CTX(pHddTdlsCtx->pAdapter)))) + { + return; + } WLANTL_ResumeDataTx( (WLAN_HDD_GET_CTX(pHddTdlsCtx->pAdapter))->pvosContext, (v_U8_t *)&curr_peer->staId); + mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); } static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx) @@ -604,7 +773,7 @@ static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx) if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("pHddTdlsCtx is NULL")); return; } @@ -644,10 +813,132 @@ static void wlan_hdd_tdls_schedule_scan(struct work_struct *work) scan_ctx->scan_request); } +void wlan_hdd_tdls_btCoex_cb(void *data, int indType) +{ + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + u16 connectedTdlsPeers; + tdlsCtx_t *pHddTdlsCtx; + hddTdlsPeer_t *currPeer; + + ENTER(); + if ((NULL == data) || (indType < 0)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Invalid arguments")); + return; + } + + pHddCtx = (hdd_context_t *)data; + if (0 != (wlan_hdd_validate_context(pHddCtx))) + { + return; + } + + /* if tdls is not enabled, then continue btCoex */ + if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("tdls is not enabled")); + return; + } + + /* get pAdapter context, do we need WLAN_HDD_P2P_CLIENT */ + pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pAdapter is not valid")); + return; + } + + pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if (NULL == pHddTdlsCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pHddTdlsCtx is not valid")); + return; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: BtCoex notification type %d", __func__, indType); + /* BtCoex notification type enabled, Disable TDLS */ + if (indType == SIR_COEX_IND_TYPE_TDLS_DISABLE) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("BtCoex notification, Disable TDLS")); + + /* tdls is in progress */ + currPeer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0, TRUE); + if (NULL != currPeer) + { + wlan_hdd_tdls_set_peer_link_status (currPeer, + eTDLS_LINK_IDLE, + eTDLS_LINK_UNSPECIFIED); + } + + /* while tdls is up */ + if (eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode || + eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode) + { + connectedTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); + /* disable implicit trigger logic & tdls operatoin */ + wlan_hdd_tdls_set_mode(pHddCtx, eTDLS_SUPPORT_DISABLED, FALSE); + pHddCtx->is_tdls_btc_enabled = FALSE; + + /* teardown the peers on the btcoex */ + if (connectedTdlsPeers) + { + tANI_U8 staIdx; + hddTdlsPeer_t *curr_peer; + + for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) + { + if (pHddCtx->tdlsConnInfo[staIdx].staId) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + ("%s: indicate TDLS teardown (staId %d)"), + __func__,pHddCtx->tdlsConnInfo[staIdx].staId); + + #ifdef CONFIG_TDLS_IMPLICIT + curr_peer = wlan_hdd_tdls_find_all_peer(pHddCtx, + pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes); + if(curr_peer) { + wlan_hdd_tdls_indicate_teardown( + curr_peer->pHddTdlsCtx->pAdapter, curr_peer, + eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); + } + #endif + } + } + } + } + } + /* BtCoex notification type enabled, Enable TDLS */ + else if (indType == SIR_COEX_IND_TYPE_TDLS_ENABLE) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("BtCoex notification, Enable TDLS")); + /* if tdls was enabled before btCoex, re-enable tdls mode */ + if (eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode_last || + eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode_last) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + ("%s: revert tdls mode %d"), __func__, + pHddCtx->tdls_mode_last); + pHddCtx->is_tdls_btc_enabled = TRUE; + wlan_hdd_tdls_set_mode(pHddCtx, pHddCtx->tdls_mode_last, FALSE); + } + } + EXIT(); + return; +} + /* initialize TDLS global context */ void wlan_hdd_tdls_init(hdd_context_t *pHddCtx ) { v_U8_t staIdx; + eHalStatus status; pHddCtx->connected_peer_count = 0; @@ -663,15 +954,31 @@ void wlan_hdd_tdls_init(hdd_context_t *pHddCtx ) vos_mem_zero(&pHddCtx->tdlsConnInfo[staIdx].peerMac, sizeof(v_MACADDR_t)) ; } + pHddCtx->is_tdls_btc_enabled = TRUE; + status = sme_RegisterBtCoexTDLSCallback(pHddCtx->hHal, + wlan_hdd_tdls_btCoex_cb); + if (status != eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to register BT Coex TDLS callback")); + } - if (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) + if ((TRUE == pHddCtx->cfg_ini->fEnableTDLSSupport) && + (TRUE == sme_IsFeatureSupportedByFW(TDLS))) { - pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; - hddLog(VOS_TRACE_LEVEL_ERROR, "%s TDLS Implicit trigger not enabled!", __func__); + if (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) + { + pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; + hddLog(LOGE, FL("TDLS Implicit trigger not enabled!")); + return; + } + pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED; } else { - pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED; + hddLog(LOGE, + FL("TDLS not enabled (%d) or FW doesn't support (%d)"), + pHddCtx->cfg_ini->fEnableTDLSSupport, + sme_IsFeatureSupportedByFW(TDLS)); + pHddCtx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; } } @@ -680,37 +987,36 @@ int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); tdlsCtx_t *pHddTdlsCtx; int i; - if (NULL == pHddCtx) - return -1; + { + hddLog(VOS_TRACE_LEVEL_ERROR, "%s pHddCtx is NULL", __func__); + return -EINVAL; + } - mutex_lock(&pHddCtx->tdls_lock); + if (test_bit(TDLS_INIT_DONE, &pAdapter->event_flags)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: TDLS INIT DONE set to 1, no point in re-init", __func__); + return -EALREADY; + } if ((FALSE == pHddCtx->cfg_ini->fEnableTDLSSupport) || (FALSE == sme_IsFeatureSupportedByFW(TDLS))) { pHddCtx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; pAdapter->sessionCtx.station.pHddTdlsCtx = NULL; - hddLog(VOS_TRACE_LEVEL_ERROR, "%s TDLS not enabled (%d) or FW doesn't support (%d)!", + hddLog(VOS_TRACE_LEVEL_INFO, "%s TDLS not enabled (%d) or FW doesn't support (%d)!", __func__, pHddCtx->cfg_ini->fEnableTDLSSupport, sme_IsFeatureSupportedByFW(TDLS)); - mutex_unlock(&pHddCtx->tdls_lock); - return 0; + return -EINVAL; } /* TDLS is supported only in STA / P2P Client modes, * hence the check for TDLS support in a specific Device mode. - * Do not return a failure rather do not continue further - * with the initialization as tdls_init would be called - * during the open adapter for a p2p interface at which point - * the device mode would be a P2P_DEVICE. The point here is to - * continue initialization for STA / P2P Client modes. - * TDLS exit also check for the device mode for clean up hence - * there is no issue even if success is returned. */ if (0 == WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) { - mutex_unlock(&pHddCtx->tdls_lock); - return 0; + hddLog(VOS_TRACE_LEVEL_ERROR, "%s TDLS is not supported in mode : %d", __func__, pAdapter->device_mode); + return -EINVAL; } /* Check for the valid pHddTdlsCtx. If valid do not further * allocate the memory, rather continue with the initialization. @@ -725,8 +1031,7 @@ int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter) if (NULL == pHddTdlsCtx) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s malloc failed!", __func__); pAdapter->sessionCtx.station.pHddTdlsCtx = NULL; - mutex_unlock(&pHddCtx->tdls_lock); - return -1; + return -ENOMEM; } /* initialize TDLS pAdater context */ vos_mem_zero(pHddTdlsCtx, sizeof(tdlsCtx_t)); @@ -774,21 +1079,27 @@ int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx->threshold_config.rssi_trigger_threshold = pHddCtx->cfg_ini->fTDLSRSSITriggerThreshold; pHddTdlsCtx->threshold_config.rssi_teardown_threshold = pHddCtx->cfg_ini->fTDLSRSSITeardownThreshold; - INIT_WORK(&pHddTdlsCtx->implicit_setup, wlan_hdd_tdls_pre_setup); - INIT_DELAYED_WORK(&pHddCtx->tdls_scan_ctxt.tdls_scan_work, wlan_hdd_tdls_schedule_scan); - mutex_unlock(&pHddCtx->tdls_lock); + vos_init_delayed_work(&pHddCtx->tdls_scan_ctxt.tdls_scan_work, + wlan_hdd_tdls_schedule_scan); + set_bit(TDLS_INIT_DONE, &pAdapter->event_flags); return 0; } -void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) +void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter, tANI_BOOLEAN mutexLock) { tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx; + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return; + } + /* * NOTE: The Callers of this function should ensure to acquire the - * tdls_lock to avoid any concurrent access to the Adapter. + * tdls_lock to avoid any concurrent access to the Adapter and logp + * protection has to be ensured. */ pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); @@ -799,25 +1110,23 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) "%s: HDD context is Null", __func__); return ; } - - if (pHddCtx->isLogpInProgress) + if (!test_bit(TDLS_INIT_DONE, &pAdapter->event_flags)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: LOGP in Progress. Ignore!!!", __func__); - return ; + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS INIT DONE set to 0, no point in exit", __func__); + return; } + clear_bit(TDLS_INIT_DONE, &pAdapter->event_flags); pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddTdlsCtx is NULL")); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pHddTdlsCtx is NULL")); return; } -#ifdef WLAN_OPEN_SOURCE - cancel_work_sync(&pHddTdlsCtx->implicit_setup); - cancel_delayed_work_sync(&pHddCtx->tdls_scan_ctxt.tdls_scan_work); -#endif + + vos_flush_delayed_work(&pHddCtx->tdls_scan_ctxt.tdls_scan_work); /* must stop timer here before freeing peer list, because peerIdleTimer is part of peer list structure. */ @@ -854,12 +1163,13 @@ static void wlan_hdd_tdls_peer_timers_stop(tdlsCtx_t *pHddTdlsCtx) head = &pHddTdlsCtx->peer_list[i]; list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " -> stop idle timer", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); vos_timer_stop ( &curr_peer->peerIdleTimer ); - vos_timer_stop( &curr_peer->initiatorWaitTimeoutTimer ); + if (vos_timer_is_initialized(&curr_peer->initiatorWaitTimeoutTimer)) + vos_timer_stop( &curr_peer->initiatorWaitTimeoutTimer ); } } } @@ -896,14 +1206,17 @@ static void wlan_hdd_tdls_peer_timers_destroy(tdlsCtx_t *pHddTdlsCtx) list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " -> destroy idle timer", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); vos_timer_stop ( &curr_peer->peerIdleTimer ); vos_timer_destroy ( &curr_peer->peerIdleTimer ); - vos_timer_stop(&curr_peer->initiatorWaitTimeoutTimer); - vos_timer_destroy(&curr_peer->initiatorWaitTimeoutTimer); + if (vos_timer_is_initialized(&curr_peer->initiatorWaitTimeoutTimer)) + { + vos_timer_stop(&curr_peer->initiatorWaitTimeoutTimer); + vos_timer_destroy(&curr_peer->initiatorWaitTimeoutTimer); + } } } @@ -920,23 +1233,34 @@ static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx) if mac address doesn't exist, create a list and add, return pointer return NULL if fails to get new mac address */ -hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac) +hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif + ) { struct list_head *head; hddTdlsPeer_t *peer; u8 key; tdlsCtx_t *pHddTdlsCtx; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_context_t *pHddCtx; - if(0 != (wlan_hdd_validate_context(pHddCtx))) + + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adpater is NULL")); + return NULL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } /* if already there, just update */ - peer = wlan_hdd_tdls_find_peer(pAdapter, mac, TRUE); + peer = wlan_hdd_tdls_find_peer(pAdapter, mac, FALSE); if (peer != NULL) { return peer; @@ -949,16 +1273,13 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac) return NULL; } - mutex_lock(&pHddCtx->tdls_lock); - pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - FL("pHddTdlsCtx is NULL")); vos_mem_free(peer); - mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("pHddTdlsCtx is NULL")); return NULL; } @@ -973,34 +1294,38 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac) VOS_TIMER_TYPE_SW, wlan_hdd_tdls_idle_cb, peer); - - vos_timer_init(&peer->initiatorWaitTimeoutTimer, - VOS_TIMER_TYPE_SW, - wlan_hdd_tdls_initiator_wait_cb, - peer); - list_add_tail(&peer->node, head); - mutex_unlock(&pHddCtx->tdls_lock); return peer; } int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8* mac, +#else u8* mac, +#endif tTDLSCapType cap) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } curr_peer->tdls_support = cap; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -1043,7 +1368,11 @@ void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, } void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, - u8* mac, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tTDLSLinkStatus linkStatus, tTDLSLinkReason reason) { @@ -1088,10 +1417,12 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); hdd_context_t *pHddCtx; + ENTER(); + if ( NULL == pHddTdlsCtx ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddTdlsCtx is NULL")); + FL("pHddTdlsCtx is NULL device mode = %d"), pAdapter->device_mode); return -1; } @@ -1099,19 +1430,20 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (NULL == curr_peer) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("curr_peer is NULL")); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } + mutex_unlock(&pHddCtx->tdls_lock); if (pHddTdlsCtx->discovery_sent_cnt) pHddTdlsCtx->discovery_sent_cnt--; @@ -1126,7 +1458,7 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) vos_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); } - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Discovery(%u) Response from " MAC_ADDRESS_STR " link_status %d", pHddTdlsCtx->discovery_sent_cnt, MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->link_status); @@ -1140,7 +1472,7 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) wlan_hdd_tdls_set_peer_link_status(curr_peer, eTDLS_LINK_DISCOVERED, eTDLS_LINK_SUCCESS); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Rssi Threshold met: "MAC_ADDRESS_STR" rssi = %d threshold= %d" , MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->rssi, pHddTdlsCtx->threshold_config.rssi_trigger_threshold); @@ -1148,7 +1480,7 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) } else { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Rssi Threshold not met: "MAC_ADDRESS_STR" rssi = %d threshold = %d ", MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->rssi, pHddTdlsCtx->threshold_config.rssi_trigger_threshold); @@ -1170,22 +1502,34 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) } curr_peer->tdls_support = eTDLS_CAP_SUPPORTED; + EXIT(); return 0; } int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else u8 *mac, +#endif tCsrStaParams *StaParams, tANI_BOOLEAN isBufSta, - tANI_BOOLEAN isOffChannelSupported) + tANI_BOOLEAN isOffChannelSupported, + tANI_BOOLEAN isQosWmmSta) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } @@ -1207,20 +1551,33 @@ int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter, curr_peer->supported_oper_classes_len = StaParams->supported_oper_classes_len; - curr_peer->qos = StaParams->capability & CAPABILITIES_QOS_OFFSET; + curr_peer->qos = isQosWmmSta; + + mutex_unlock(&pHddCtx->tdls_lock); return 0; } -int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, u8 *mac, +int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tCsrTdlsLinkEstablishParams* tdlsLinkEstablishParams) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } @@ -1246,10 +1603,17 @@ int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, u8 *mac, curr_peer->supported_oper_classes_len; tdlsLinkEstablishParams->qos = curr_peer->qos; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } -int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, u8 *mac, tANI_S8 rxRssi) +int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_S8 rxRssi) { hddTdlsPeer_t *curr_peer; @@ -1266,20 +1630,33 @@ int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, u8 *mac, tANI_S8 rxRssi) return 0; } -int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, u8 *mac, tANI_U8 responder) +int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_U8 responder) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } curr_peer->is_responder = responder; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -1298,20 +1675,33 @@ int wlan_hdd_tdls_get_responder(hdd_adapter_t *pAdapter, u8 *mac) return (curr_peer->is_responder); } -int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, u8 *mac, tANI_U8 uSignature) +int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + tANI_U8 uSignature) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } curr_peer->signature = uSignature; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -1326,19 +1716,30 @@ void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac) memcpy(mac, skb->data+6, 6); } -int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, u8 *mac, u8 tx) +int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 tx) { hddTdlsPeer_t *curr_peer; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + if (eTDLS_SUPPORT_ENABLED != pHddCtx->tdls_mode) return -1; + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("curr_peer is NULL")); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } @@ -1347,6 +1748,7 @@ int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, u8 *mac, u8 tx) else curr_peer->rx_pkt++; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -1430,6 +1832,17 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *confi tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); eTDLSSupportMode req_tdls_mode; + if ((TRUE != pHddCtx->cfg_ini->fEnableTDLSSupport) && + (TRUE != sme_IsFeatureSupportedByFW(TDLS))) + { + hddLog(LOGE, + FL("TDLS not enabled (%d) or FW doesn't support (%d)"), + pHddCtx->cfg_ini->fEnableTDLSSupport, + sme_IsFeatureSupportedByFW(TDLS)); + pHddCtx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; + return -EINVAL; + } + if (NULL == pHddTdlsCtx) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("TDLS not enabled!")); @@ -1473,49 +1886,71 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *confi return 0; } -int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, u8 *mac, u8 staId) +int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 staId) { hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } curr_peer->staId = staId; + mutex_unlock(&pHddCtx->tdls_lock); return 0; } -int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, u8 *mac, +int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tANI_BOOLEAN forcePeer) { + /* NOTE: + * Hold mutex tdls_lock before calling this function + */ hddTdlsPeer_t *curr_peer; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if ((NULL == pHddCtx)) return -1; - mutex_lock(&pHddCtx->tdls_lock); - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, FALSE); if (curr_peer == NULL) goto error; curr_peer->isForcedPeer = forcePeer; - mutex_unlock(&pHddCtx->tdls_lock); return 0; error: - mutex_unlock(&pHddCtx->tdls_lock); return -1; } /* if peerMac is found, then it returns pointer to hddTdlsPeer_t otherwise, it returns NULL */ -hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, u8 *mac, +hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif tANI_BOOLEAN mutexLock) { u8 key; @@ -1527,8 +1962,6 @@ hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, u8 *mac, if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } @@ -1560,10 +1993,17 @@ hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, u8 *mac, } if ( mutexLock ) mutex_unlock(&pHddCtx->tdls_lock); + return NULL; } -hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, u8 *mac) +hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif +) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; hdd_adapter_t *pAdapter = NULL; @@ -1595,18 +2035,29 @@ hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, u8 *mac) } -int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, u8 *mac) +int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac +#else + u8 *mac +#endif +) { hdd_context_t *pHddCtx; hddTdlsPeer_t *curr_peer; pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + return -EINVAL; + + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac); if (curr_peer == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: curr_peer is NULL", __func__); + mutex_unlock(&pHddCtx->tdls_lock); return -1; } @@ -1629,6 +2080,8 @@ int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, u8 *mac) if(eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode) { vos_timer_stop( &curr_peer->peerIdleTimer ); } + + mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -1689,7 +2142,7 @@ static tANI_S32 wlan_hdd_get_tdls_discovery_peer_cnt(tdlsCtx_t *pHddTdlsCtx) head = &pHddTdlsCtx->peer_list[i]; list_for_each_safe (pos, q, head) { tmp = list_entry(pos, hddTdlsPeer_t, node); - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s, %d, " MAC_ADDRESS_STR, __func__, i, MAC_ADDR_ARRAY(tmp->peerMac)); discovery_peer_cnt++; @@ -1700,20 +2153,30 @@ static tANI_S32 wlan_hdd_get_tdls_discovery_peer_cnt(tdlsCtx_t *pHddTdlsCtx) tANI_U16 wlan_hdd_tdlsConnectedPeers(hdd_adapter_t *pAdapter) { - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_context_t *pHddCtx = NULL; - if(0 != (wlan_hdd_validate_context(pHddCtx))) + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("invalid pAdapter: %pK"), pAdapter); return 0; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); + if(0 != (wlan_hdd_validate_context(pHddCtx))) + { + return 0; + } + EXIT(); return pHddCtx->connected_peer_count; } -hddTdlsPeer_t *wlan_hdd_tdls_get_first_connected_peer(hdd_adapter_t *pAdapter) +hddTdlsPeer_t *wlan_hdd_tdls_get_connected_peer(hdd_adapter_t *pAdapter) { + /* NOTE: + * Hold mutext tdls_lock before calling this function + */ int i; struct list_head *head; struct list_head *pos; @@ -1721,17 +2184,14 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_first_connected_peer(hdd_adapter_t *pAdapter) tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return NULL; } - mutex_lock(&pHddCtx->tdls_lock); pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); if (NULL == pHddTdlsCtx) { - mutex_unlock(&pHddCtx->tdls_lock); return NULL; } for (i = 0; i < 256; i++) { @@ -1741,15 +2201,15 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_first_connected_peer(hdd_adapter_t *pAdapter) curr_peer= list_entry (pos, hddTdlsPeer_t, node); if (curr_peer && (curr_peer->link_status == eTDLS_LINK_CONNECTED)) { - mutex_unlock(&pHddCtx->tdls_lock); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR " eTDLS_LINK_CONNECTED", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); return curr_peer; } } } - mutex_unlock(&pHddCtx->tdls_lock); + + EXIT(); return NULL; } @@ -1763,10 +2223,9 @@ int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen) tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } @@ -1807,15 +2266,17 @@ int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen) } } mutex_unlock(&pHddCtx->tdls_lock); + + EXIT(); return init_len-buflen; } void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter) { - tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - if ((NULL == pHddCtx) || (NULL == pHddTdlsCtx)) + if ((NULL == pHddCtx)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, FL("pHddCtx or pHddTdlsCtx points to NULL")); @@ -1824,7 +2285,22 @@ void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter) mutex_lock(&pHddCtx->tdls_lock); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + if (0 != wlan_hdd_sta_tdls_init(pAdapter)) + { + mutex_unlock(&pHddCtx->tdls_lock); + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wlan_hdd_sta_tdls_init failed",__func__); + return; + } + + pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if ((NULL == pHddTdlsCtx)) + { + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + FL("pHddCtx or pHddTdlsCtx points to NULL device mode = %d"), pAdapter->device_mode); + return; + } + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s, update %d discover %d", __func__, pHddTdlsCtx->threshold_config.tx_period_t, pHddTdlsCtx->threshold_config.discovery_period_t); @@ -1835,11 +2311,6 @@ void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter) pHddTdlsCtx->discovery_sent_cnt = 0; wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); -#ifdef FEATURE_WLAN_TDLS_INTERNAL - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerDiscoverTimer, - pHddTdlsCtx->threshold_config.discovery_period_t); -#endif wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, &pHddTdlsCtx->peerUpdateTimer, pHddTdlsCtx->threshold_config.tx_period_t); @@ -1860,22 +2331,21 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter) return; } - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,"%s", __func__); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"%s", __func__); - mutex_lock(&pHddCtx->tdls_lock); if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("pHddTdlsCtx is NULL")); - mutex_unlock(&pHddCtx->tdls_lock); return; } + + mutex_lock(&pHddCtx->tdls_lock); + pHddTdlsCtx->discovery_sent_cnt = 0; wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); - wlan_hdd_tdls_monitor_timers_stop(pHddTdlsCtx); - wlan_hdd_tdls_peer_timers_destroy(pHddTdlsCtx); - wlan_hdd_tdls_free_list(pHddTdlsCtx); + wlan_hdd_tdls_exit(pAdapter, TRUE); mutex_unlock(&pHddCtx->tdls_lock); } @@ -1883,8 +2353,8 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter) void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, tANI_U32 statusCode) { pAdapter->mgmtTxCompletionStatus = statusCode; - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,"%s: Mgmt TX Completion %d", - __func__, statusCode); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Mgmt TX Completion %d",__func__, statusCode); complete(&pAdapter->tdls_mgmt_comp); } @@ -1892,10 +2362,9 @@ void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } @@ -1904,20 +2373,21 @@ void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter) pHddCtx->connected_peer_count++; wlan_hdd_tdls_check_power_save_prohibited(pAdapter); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: %d", + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: %d", __func__, pHddCtx->connected_peer_count); mutex_unlock(&pHddCtx->tdls_lock); + + EXIT(); } void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } @@ -1927,42 +2397,63 @@ void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) pHddCtx->connected_peer_count--; wlan_hdd_tdls_check_power_save_prohibited(pAdapter); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: %d", + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: %d", __func__, pHddCtx->connected_peer_count); mutex_unlock(&pHddCtx->tdls_lock); + EXIT(); } void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter) { - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + + tdlsCtx_t *pHddTdlsCtx = NULL; + hdd_context_t *pHddCtx = NULL; hddTdlsPeer_t *curr_peer; - if ((NULL == pHddCtx) || (NULL == pHddTdlsCtx)) + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("invalid pAdapter: %pK"), pAdapter); + return; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + if (NULL == pHddCtx) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - FL(" pHddCtx or pHddTdlsCtx points to NULL")); + FL("pHddCtx points to NULL")); return; } - curr_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0); + curr_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0, TRUE); if (NULL != curr_peer) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls in progress. Dont check for BMPS " MAC_ADDRESS_STR, __func__, MAC_ADDR_ARRAY (curr_peer->peerMac)); return; } + mutex_lock(&pHddCtx->tdls_lock); + pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if (NULL == pHddTdlsCtx) + { + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("pHddTdlsCtx points to NULL")); + return; + } if ((TDLS_CTX_MAGIC != pHddCtx->tdls_scan_ctxt.magic) && (0 == pHddCtx->connected_peer_count) && (0 == pHddTdlsCtx->discovery_sent_cnt)) { + mutex_unlock(&pHddCtx->tdls_lock); if (FALSE == sme_IsPmcBmps(WLAN_HDD_GET_HAL_CTX(pAdapter))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: No TDLS peer connected/discovery sent. Enable BMPS", __func__); hdd_enable_bmps_imps(pHddCtx); @@ -1970,9 +2461,10 @@ void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter) } else { + mutex_unlock(&pHddCtx->tdls_lock); if (TRUE == sme_IsPmcBmps(WLAN_HDD_GET_HAL_CTX(pAdapter))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: TDLS peer connected. Disable BMPS", __func__); hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); } @@ -2000,7 +2492,13 @@ u8 wlan_hdd_tdls_is_peer_progress(hdd_adapter_t *pAdapter, u8 *mac) * skip_self - if TRUE, skip this mac. otherwise, check all the peer list. if mac is NULL, this argument is ignored, and check for all the peer list. */ -static hddTdlsPeer_t *wlan_hdd_tdls_find_progress_peer(hdd_adapter_t *pAdapter, u8 *mac, u8 skip_self) +static hddTdlsPeer_t *wlan_hdd_tdls_find_progress_peer(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 skip_self) { int i; struct list_head *head; @@ -2010,7 +2508,7 @@ static hddTdlsPeer_t *wlan_hdd_tdls_find_progress_peer(hdd_adapter_t *pAdapter, if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("pHddTdlsCtx is NULL")); return NULL; } @@ -2026,7 +2524,7 @@ static hddTdlsPeer_t *wlan_hdd_tdls_find_progress_peer(hdd_adapter_t *pAdapter, { if (eTDLS_LINK_CONNECTING == curr_peer->link_status) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s:" MAC_ADDRESS_STR " eTDLS_LINK_CONNECTING", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); return curr_peer; @@ -2037,7 +2535,13 @@ static hddTdlsPeer_t *wlan_hdd_tdls_find_progress_peer(hdd_adapter_t *pAdapter, return NULL; } -hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, u8 *mac, u8 skip_self) +hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const u8 *mac, +#else + u8 *mac, +#endif + u8 skip_self, tANI_BOOLEAN mutexLock) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; hdd_adapter_t *pAdapter = NULL; @@ -2045,8 +2549,10 @@ hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, u8 *mac, u8 ski hddTdlsPeer_t *curr_peer= NULL; VOS_STATUS status = 0; - mutex_lock(&pHddCtx->tdls_lock); - + if (mutexLock) + { + mutex_lock(&pHddCtx->tdls_lock); + } status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) { @@ -2058,14 +2564,16 @@ hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, u8 *mac, u8 ski curr_peer = wlan_hdd_tdls_find_progress_peer(pAdapter, mac, skip_self); if (curr_peer) { - mutex_unlock(&pHddCtx->tdls_lock); + if (mutexLock) + mutex_unlock(&pHddCtx->tdls_lock); return curr_peer; } } status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } - mutex_unlock(&pHddCtx->tdls_lock); + if (mutexLock) + mutex_unlock(&pHddCtx->tdls_lock); return NULL; } @@ -2082,11 +2590,6 @@ static void wlan_hdd_tdls_implicit_enable(tdlsCtx_t *pHddTdlsCtx) wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); -#ifdef FEATURE_WLAN_TDLS_INTERNAL - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerDiscoverTimer, - pHddTdlsCtx->threshold_config.discovery_period_t); -#endif wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, &pHddTdlsCtx->peerUpdateTimer, pHddTdlsCtx->threshold_config.tx_period_t); @@ -2101,12 +2604,11 @@ void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter; tdlsCtx_t *pHddTdlsCtx; - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,"%s mode %d", __func__, (int)tdls_mode); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s mode %d", __func__, (int)tdls_mode); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } @@ -2114,8 +2616,9 @@ void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, if (pHddCtx->tdls_mode == tdls_mode) { - hddLog(TDLS_LOG_LEVEL, "%s already in mode %d", __func__, (int)tdls_mode); mutex_unlock(&pHddCtx->tdls_lock); + hddLog(VOS_TRACE_LEVEL_INFO, "%s already in mode %d", __func__, + (int)tdls_mode); return; } @@ -2147,42 +2650,31 @@ void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, pHddCtx->tdls_mode = tdls_mode; mutex_unlock(&pHddCtx->tdls_lock); + } -static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) +static +void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t * pHddTdlsCtx) { - tdlsCtx_t *pHddTdlsCtx = - container_of(work, tdlsCtx_t, implicit_setup); - hdd_context_t *pHddCtx; - hddTdlsPeer_t *curr_peer; - hddTdlsPeer_t *temp_peer; - int status; + hdd_context_t *pHddCtx = NULL; + hddTdlsPeer_t *curr_peer = NULL, *temp_peer = NULL; + ENTER(); if (NULL == pHddTdlsCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("pHddTdlsCtx is NULL")); return; } - if (unlikely(TDLS_CTX_MAGIC != pHddTdlsCtx->magic)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: tdls magic no missmatch %u", __func__, pHddTdlsCtx->magic); - return; - } - pHddCtx = WLAN_HDD_GET_CTX(pHddTdlsCtx->pAdapter); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } curr_peer = pHddTdlsCtx->curr_candidate; - if (NULL == curr_peer) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -2193,15 +2685,18 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) if (TRUE == sme_IsPmcBmps(WLAN_HDD_GET_HAL_CTX(pHddTdlsCtx->pAdapter))) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,"%s: Disable BMPS", __func__); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Disable BMPS", __func__); hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); } - temp_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0); + /* This function is called in mutex_lock */ + temp_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0, FALSE); if (NULL != temp_peer) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: " MAC_ADDRESS_STR " ongoing. pre_setup ignored", - __func__, MAC_ADDR_ARRAY(temp_peer->peerMac)); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: " MAC_ADDRESS_STR " ongoing. pre_setup ignored", + __func__, MAC_ADDR_ARRAY(temp_peer->peerMac)); goto done; } @@ -2210,49 +2705,31 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) eTDLS_LINK_DISCOVERING, eTDLS_LINK_SUCCESS); - status = wlan_hdd_cfg80211_send_tdls_discover_req(pHddTdlsCtx->pAdapter->wdev.wiphy, - pHddTdlsCtx->pAdapter->dev, - curr_peer->peerMac); - - if (0 != status) - { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: " MAC_ADDRESS_STR " discovery could not sent", - __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); - if (eTDLS_CAP_UNKNOWN != curr_peer->tdls_support) - wlan_hdd_tdls_set_peer_link_status(curr_peer, - eTDLS_LINK_IDLE, - eTDLS_LINK_UNSPECIFIED); - goto done; - } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Implicit TDLS, Send Discovery request event", __func__); + cfg80211_tdls_oper_request(pHddTdlsCtx->pAdapter->dev, + curr_peer->peerMac, + NL80211_TDLS_DISCOVERY_REQ, + FALSE, + GFP_KERNEL); pHddTdlsCtx->discovery_sent_cnt++; - mutex_lock(&pHddCtx->tdls_lock); - wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, &pHddTdlsCtx->peerDiscoveryTimeoutTimer, pHddTdlsCtx->threshold_config.tx_period_t - TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE); - mutex_unlock(&pHddCtx->tdls_lock); - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: discovery count %u timeout %u msec", - __func__, pHddTdlsCtx->discovery_sent_cnt, - pHddTdlsCtx->threshold_config.tx_period_t - TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: discovery count %u timeout %u msec", + __func__, pHddTdlsCtx->discovery_sent_cnt, + pHddTdlsCtx->threshold_config.tx_period_t - TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE); done: pHddTdlsCtx->curr_candidate = NULL; pHddTdlsCtx->magic = 0; - return; -} - - -static void wlan_hdd_tdls_pre_setup(struct work_struct *work) -{ - vos_ssr_protect(__func__); - __wlan_hdd_tdls_pre_setup(work); - vos_ssr_unprotect(__func__); - + EXIT(); return; } @@ -2282,8 +2759,19 @@ tANI_U32 wlan_hdd_tdls_discovery_sent_cnt(hdd_context_t *pHddCtx) void wlan_hdd_tdls_check_power_save_prohibited(hdd_adapter_t *pAdapter) { - tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + tdlsCtx_t *pHddTdlsCtx = NULL; + hdd_context_t *pHddCtx = NULL; + + + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("invalid pAdapter: %pK"), pAdapter); + return; + } + + pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if ((NULL == pHddTdlsCtx) || (NULL == pHddCtx)) { @@ -2327,10 +2815,9 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx, { tdls_scan_context_t *scan_ctx; + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } @@ -2342,6 +2829,8 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx, #endif scan_ctx->scan_request = request; + + EXIT(); return 0; } @@ -2383,23 +2872,23 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, unsigned long delay; hdd_config_t *cfg_param = pHddCtx->cfg_ini; + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return 0; } /* if tdls is not enabled, then continue scan */ - if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) + if ((eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) || + (pHddCtx->is_tdls_btc_enabled == FALSE)) return 1; - curr_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0); + curr_peer = wlan_hdd_tdls_is_progress(pHddCtx, NULL, 0, TRUE); if (NULL != curr_peer) { if (pHddCtx->tdls_scan_ctxt.reject++ >= TDLS_MAX_SCAN_REJECT) { pHddCtx->tdls_scan_ctxt.reject = 0; - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR ". scan rejected %d. force it to idle", __func__, MAC_ADDR_ARRAY (curr_peer->peerMac), pHddCtx->tdls_scan_ctxt.reject); @@ -2408,7 +2897,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, eTDLS_LINK_UNSPECIFIED); return 1; } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls in progress. scan rejected %d", __func__, pHddCtx->tdls_scan_ctxt.reject); return -EBUSY; @@ -2421,7 +2910,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, if (connectedTdlsPeers && (pHddCtx->tdls_scan_ctxt.attempt < TDLS_MAX_SCAN_SCHEDULE)) { delay = (unsigned long)(TDLS_DELAY_SCAN_PER_CONNECTION*connectedTdlsPeers); - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls disabled, but still connected_peers %d attempt %d. schedule scan %lu msec", __func__, connectedTdlsPeers, pHddCtx->tdls_scan_ctxt.attempt, delay); @@ -2435,11 +2924,26 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, return 0; } /* no connected peer or max retry reached, scan continue */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls disabled. connected_peers %d attempt %d. scan allowed", __func__, connectedTdlsPeers, pHddCtx->tdls_scan_ctxt.attempt); return 1; } + + /* if fEnableTDLSScan flag is 1 ; driverwill allow scan even if + * peer station is not buffer STA capable + * + * RX: If there is any RX activity, device will lose RX packets, + * as peer will not be aware that device is off channel. + * TX: TX is stopped whenever device initiate scan. + */ + if (pHddCtx->cfg_ini->fEnableTDLSScan == 1) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Allow SCAN in all TDLS cases")); + return 1; + } + /* while tdls is up, first time scan */ else if (eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode || eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode) @@ -2452,14 +2956,14 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, (connectedTdlsPeers == 1) ) { /* get connected peer information */ - connected_peer = wlan_hdd_tdls_get_first_connected_peer(pAdapter); + connected_peer = wlan_hdd_tdls_get_connected_peer(pAdapter); if (NULL == connected_peer) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Invalid connected_peer, Continue Scanning", __func__); /* scan should continue */ return 1; } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, ("%s: TDLS Scan Co-exist supported connectedTdlsPeers =%d buffersta =%d"), __func__,connectedTdlsPeers,connected_peer->isBufSta); @@ -2474,7 +2978,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, cfg_param->nNumStaChanCombinedConc, cfg_param->nNumP2PChanCombinedConc); } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, ("%s:%d TDLS Scan Co-exist supported splitscan_enabled =%d "), __func__, __LINE__, pHddCtx->issplitscan_enabled); return 1; @@ -2491,7 +2995,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, */ pHddCtx->isTdlsScanCoexistence = FALSE; } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, ("%s: TDLS Scan Co-exist not supported connectedTdlsPeers =%d" " TDLSScanCoexSupport param =%d TDLS_SCAN_COEXISTENCE =%d"), __func__, connectedTdlsPeers, @@ -2516,8 +3020,8 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, { if (pHddCtx->tdlsConnInfo[staIdx].staId) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - ("%s: indicate TDLS teadown (staId %d)"), __func__, pHddCtx->tdlsConnInfo[staIdx].staId) ; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + ("%s: indicate TDLS teardown (staId %d)"), __func__, pHddCtx->tdlsConnInfo[staIdx].staId) ; #ifdef CONFIG_TDLS_IMPLICIT curr_peer = wlan_hdd_tdls_find_all_peer(pHddCtx, pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes); @@ -2529,7 +3033,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, /* schedule scan */ delay = (unsigned long)(TDLS_DELAY_SCAN_PER_CONNECTION*connectedTdlsPeers); - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls enabled (mode %d), connected_peers %d. schedule scan %lu msec", __func__, pHddCtx->tdls_mode, wlan_hdd_tdlsConnectedPeers(pAdapter), delay); @@ -2544,10 +3048,11 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, return 0; } /* no connected peer, scan continue */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: tdls_mode %d, and no tdls connection. scan allowed", __func__, pHddCtx->tdls_mode); } + EXIT(); return 1; } @@ -2555,13 +3060,19 @@ void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); if(0 != (wlan_hdd_validate_context(pHddCtx))) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); return; } + /* if tdls is not enabled or BtCoex is on then don't revert tdls mode */ + if ((eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) || + (pHddCtx->is_tdls_btc_enabled == FALSE)) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to revert: Mode=%d, BTC enabled=%d"), + pHddCtx->tdls_mode, pHddCtx->is_tdls_btc_enabled); + return; + } /* free allocated memory at scan time */ wlan_hdd_tdls_free_scan_request (&pHddCtx->tdls_scan_ctxt); @@ -2570,12 +3081,14 @@ void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter) if(eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode_last || eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode_last) { - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, ("%s: revert tdls mode %d"), __func__, pHddCtx->tdls_mode_last); wlan_hdd_tdls_set_mode(pHddCtx, pHddCtx->tdls_mode_last, FALSE); } wlan_hdd_tdls_check_bmps(pAdapter); + + EXIT(); } void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter, @@ -2611,7 +3124,8 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, { hdd_context_t *pHddCtx; - if (NULL == pAdapter || NULL == curr_peer) + if ((NULL == pAdapter || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) || + (NULL == curr_peer)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("parameters passed are invalid")); @@ -2620,7 +3134,8 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - if (eTDLS_LINK_CONNECTED != curr_peer->link_status) + if ((eTDLS_LINK_CONNECTED != curr_peer->link_status) && + (eTDLS_LINK_CONNECTING != curr_peer->link_status)) return; /* Throughput Monitor shall disable the split scan when @@ -2637,6 +3152,8 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, wlan_hdd_tdls_set_peer_link_status(curr_peer, eTDLS_LINK_TEARING, eTDLS_LINK_UNSPECIFIED); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Setting NL80211_TDLS_TEARDOWN, reason %d"), reason); cfg80211_tdls_oper_request(pAdapter->dev, curr_peer->peerMac, NL80211_TDLS_TEARDOWN, @@ -2649,6 +3166,9 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer, cfg80211_exttdls_callback callback) { + /* NOTE: + * Hold mutex tdls_lock before calling this function + */ hdd_context_t *pHddCtx; hdd_adapter_t *pAdapter; @@ -2659,14 +3179,9 @@ int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer, pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if ((NULL == pHddCtx)) return -1; - mutex_lock(&pHddCtx->tdls_lock); - curr_peer->state_change_notification = callback; - mutex_unlock(&pHddCtx->tdls_lock); return 0; - - } void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, @@ -2686,7 +3201,14 @@ void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, *state = WIFI_TDLS_TRYING; break; case eTDLS_LINK_CONNECTED: - *state = WIFI_TDLS_ESTABLISHED; + if (TRUE == curr_peer->isOffChannelEstablished) + { + *state = WIFI_TDLS_ESTABLISHED_OFF_CHANNEL; + } + else + { + *state = WIFI_TDLS_ESTABLISHED; + } break; case eTDLS_LINK_TEARING: *state = WIFI_TDLS_DROPPED; @@ -2696,7 +3218,11 @@ void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, } int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8* mac, +#else tANI_U8* mac, +#endif tANI_S32 *state, tANI_S32 *reason) { @@ -2730,5 +3256,152 @@ int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter, return (0); } +int hdd_set_tdls_scan_type(hdd_adapter_t *pAdapter, + tANI_U8 *ptr) +{ + int tdls_scan_type; + hdd_context_t *pHddCtx; + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pAdapter is NULL", __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + tdls_scan_type = ptr[9] - '0'; + + if (tdls_scan_type <= 2) + { + pHddCtx->cfg_ini->fEnableTDLSScan = tdls_scan_type; + return 0; + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + " Wrong value is given for tdls_scan_type " + " Making fEnableTDLSScan as 0 "); + pHddCtx->cfg_ini->fEnableTDLSScan = 0; + return -EINVAL; + } +} +int wlan_hdd_validate_tdls_context(hdd_context_t *pHddCtx, + tdlsCtx_t *pHddTdlsCtx) +{ + VOS_STATUS status; + int found = 0; + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_adapter_t *pAdapter; + + if (NULL == pHddTdlsCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("TDLS context is NULL")); + return -EINVAL; + } + status = hdd_get_front_adapter(pHddCtx, &pAdapterNode); + while (NULL != pAdapterNode && VOS_STATUS_SUCCESS == status) + { + pAdapter = pAdapterNode->pAdapter; + if (NULL != pAdapter) + { + if (pHddTdlsCtx == pAdapter->sessionCtx.station.pHddTdlsCtx && + (NULL != pHddTdlsCtx->pAdapter) && + (WLAN_HDD_ADAPTER_MAGIC == pHddTdlsCtx->pAdapter->magic)) + { + found = 1; + break; + } + } + status = hdd_get_next_adapter (pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + if (found == 1) + { + return 0; + } + else + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("TDLS context doesnot belongs to valid adapter")); + return -EINVAL; + } +} + + +void wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(hdd_adapter_t *pAdapter, + u8 *mac, v_S7_t rssiAvg) +{ + hddTdlsPeer_t *curr_peer; + hdd_context_t *pHddCtx = NULL; + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + mutex_lock(&pHddCtx->tdls_lock); + curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, FALSE); + if ((NULL != curr_peer) && + (eTDLS_LINK_CONNECTED == curr_peer->link_status)) + { + curr_peer->rx_pkt++; + curr_peer->rssi = rssiAvg; + } + mutex_unlock(&pHddCtx->tdls_lock); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "mac : " MAC_ADDRESS_STR "rssi is %d", + MAC_ADDR_ARRAY(mac), rssiAvg); +} + +tdlsConnInfo_t *wlan_hdd_get_conn_info(hdd_context_t *pHddCtx, + tANI_U8 idx) +{ + tANI_U8 staIdx; + + /* check if there is available index for this new TDLS STA */ + for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) + { + if (idx == pHddCtx->tdlsConnInfo[staIdx].staId ) + { + hddLog(LOG1, FL("tdls peer with staIdx %u exists"), idx ); + return (&pHddCtx->tdlsConnInfo[staIdx]); + } + } + hddLog(LOGE, FL("tdls peer with staIdx %u not exists"), idx ); + return NULL; +} + +/** + * wlan_hdd_tdls_reenable() - Re-Enable TDLS + * @hddctx: pointer to hdd context + * + * Function re-enable's TDLS which might be disabled during concurrency + * + * Return: None + */ +void wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx) +{ + if ((TRUE != pHddCtx->cfg_ini->fEnableTDLSSupport) || + (TRUE != sme_IsFeatureSupportedByFW(TDLS))) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("tdls support not enabled")); + return; + } + + /* if tdls is not enabled or BtCoex is on then don't revert tdls mode */ + if ((eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) || + (pHddCtx->is_tdls_btc_enabled == FALSE)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("btc disable tdls so no need to enable: Mode=%d, BTC enabled=%d"), + pHddCtx->tdls_mode, pHddCtx->is_tdls_btc_enabled); + return; + } + + if (eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode_last || + eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == + pHddCtx->tdls_mode_last) { + /* Enable TDLS support Once P2P session ends since + * upond detection of concurrency TDLS might be disabled + */ + hddLog(LOG1, FL("TDLS mode set to %d"), pHddCtx->tdls_mode_last); + wlan_hdd_tdls_set_mode(pHddCtx, pHddCtx->tdls_mode_last, + FALSE); + } +} /*EXT TDLS*/ diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_trace.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_trace.c index fb7095b76359..0713e1c6b22c 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_trace.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -74,6 +74,15 @@ static tANI_U8* hddTraceGetEventString(tANI_U32 code) CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_WIPHY_PARAMS); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_TXPOWER); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_GET_TXPOWER); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCAN); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_CHANNEL); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_ADD_BEACON); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_BEACON); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_CHANGE_IFACE); + CASE_RETURN_STRING(TRACE_CODE_HDD_CHANGE_STATION); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_UPDATE_BSS); CASE_RETURN_STRING(TRACE_CODE_HDD_REMAIN_ON_CHANNEL); CASE_RETURN_STRING(TRACE_CODE_HDD_REMAINCHANREADYHANDLER); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_CANCEL_REMAIN_ON_CHANNEL); @@ -84,11 +93,22 @@ static tANI_U8* hddTraceGetEventString(tANI_U32 code) CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_DEL_STA); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_ADD_STA); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_PMKSA); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_DEL_PMKSA); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES); CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_TDLS_MGMT); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_TDLS_OPER); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_RESUME_WLAN); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_MAC_ACL); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_TESTMODE); + CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_DUMP_SURVEY); CASE_RETURN_STRING(TRACE_CODE_HDD_UNSUPPORTED_IOCTL); CASE_RETURN_STRING(TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL); CASE_RETURN_STRING(TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL); + CASE_RETURN_STRING(TRACE_CODE_HDD_STOP_NETDEV); + CASE_RETURN_STRING(TRACE_CODE_HDD_WAKE_NETDEV); + CASE_RETURN_STRING(TRACE_CODE_HDD_FLUSH_TX_QUEUES); default: return ("UNKNOWN"); break; @@ -97,9 +117,18 @@ static tANI_U8* hddTraceGetEventString(tANI_U32 code) void hddTraceDump(void *pMac, tpvosTraceRecord pRecord, tANI_U16 recIndex) { - hddLog(LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", - recIndex, pRecord->time, pRecord->session, - "HDD Event:", hddTraceGetEventString(pRecord->code), pRecord->data); + if (TRACE_CODE_HDD_RX_SME_MSG == pRecord->code) + { + hddLog(LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "RX SME MSG:", + get_eRoamCmdStatus_str(pRecord->data), pRecord->data); + } + else + { + hddLog(LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "HDD Event:", + hddTraceGetEventString(pRecord->code), pRecord->data); + } } void hddTraceInit() diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tx_rx.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tx_rx.c index c608f510bb72..e3e1aae142fb 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -30,9 +30,6 @@ \file wlan_hdd_tx_rx.c \brief Linux HDD Tx/RX APIs - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==========================================================================*/ @@ -63,10 +60,11 @@ #include "wlan_hdd_tdls.h" #endif -#ifdef DEBUG_ROAM_DELAY +#include "vos_diag_core_event.h" #include "vos_utils.h" -#endif #include "sapInternal.h" +#include "wlan_hdd_trace.h" +#include "wlan_qct_wda.h" /*--------------------------------------------------------------------------- Preprocessor definitions and constants -------------------------------------------------------------------------*/ @@ -84,12 +82,50 @@ const v_U8_t hdd_QdiscAcToTlAC[] = { WLANTL_AC_VI, WLANTL_AC_BE, WLANTL_AC_BK, + WLANTL_AC_HIGH_PRIO, }; #define HDD_TX_TIMEOUT_RATELIMIT_INTERVAL 20*HZ #define HDD_TX_TIMEOUT_RATELIMIT_BURST 1 #define HDD_TX_STALL_SSR_THRESHOLD 5 +#define HDD_TX_STALL_SSR_THRESHOLD_HIGH 13 #define HDD_TX_STALL_RECOVERY_THRESHOLD HDD_TX_STALL_SSR_THRESHOLD - 2 +#define HDD_TX_STALL_KICKDXE_THRESHOLD HDD_TX_STALL_SSR_THRESHOLD - 4 +#define HDD_TX_STALL_FATAL_EVENT_THRESHOLD 2 +#define EAPOL_MASK 0x8013 +#define EAPOL_M1_BIT_MASK 0x8000 +#define EAPOL_M2_BIT_MASK 0x0001 +#define EAPOL_M3_BIT_MASK 0x8013 +#define EAPOL_M4_BIT_MASK 0x0003 + +int gRatefromIdx[] = { + 10,20,55,100, + 10,20,55,110, + 60,90,120,180,240,360,480,540, + 65,130,195,260,390,520,585,650, + 72,144,217,289,434,578,650,722, + 65,130,195,260,390,520,585,650, + 135,270,405,540,810,1080,1215,1350, + 150,300,450,600,900,1200,1350,1500, + 135,270,405,540,810,1080,1215,1350, + 1350,1350,65,130,195,260,390, 520, + 585,650,780,1350,1350,1350,1350,1350, + 1350,1350,1350,1350,655,722,866,1350, + 1350,1350,135,270,405,540,810,1080, + 1215,1350,1350,1620,1800,1350,1350,1350, + 1350,1350,1350,1200,1350,1500,1350,1800, + 2000,1350, 292,585,877,1170,1755,2340, + 2632,2925,1350,3510,3900,1350,1350,1350, + 1350,1350,1350,1350,2925,3250,1350,3900, + 4333 + }; +#ifdef FEATURE_WLAN_DIAG_SUPPORT +#define HDD_EAPOL_PACKET_TYPE_OFFSET (15) +#define HDD_EAPOL_KEY_INFO_OFFSET (19) +#define HDD_EAPOL_DEST_MAC_OFFSET (0) +#define HDD_EAPOL_SRC_MAC_OFFSET (6) +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + static DEFINE_RATELIMIT_STATE(hdd_tx_timeout_rs, \ HDD_TX_TIMEOUT_RATELIMIT_INTERVAL, \ @@ -109,10 +145,10 @@ static struct sk_buff* hdd_mon_tx_fetch_pkt(hdd_adapter_t* pAdapter); //Utility function to dump an sk_buff static void dump_sk_buff(struct sk_buff * skb) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: head = %p", __func__, skb->head); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data = %p", __func__, skb->data); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: tail = %p", __func__, skb->tail); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: end = %p", __func__, skb->end); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: head = %pK", __func__, skb->head); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data = %pK", __func__, skb->data); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: tail = %pK", __func__, skb->tail); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: end = %pK", __func__, skb->end); VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: len = %d", __func__, skb->len); VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: data_len = %d", __func__, skb->data_len); VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: mac_len = %d", __func__, skb->mac_len); @@ -204,6 +240,9 @@ static VOS_STATUS hdd_flush_tx_queues( hdd_adapter_t *pAdapter ) pAdapter->isVosLowResource = VOS_FALSE; + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_FLUSH_TX_QUEUES, + pAdapter->sessionId, 0)); + while (++i != NUM_TX_QUEUES) { //Free up any packets in the Tx queue @@ -244,69 +283,33 @@ static VOS_STATUS hdd_flush_tx_queues( hdd_adapter_t *pAdapter ) void hdd_flush_ibss_tx_queues( hdd_adapter_t *pAdapter, v_U8_t STAId) { v_U8_t i; - v_SIZE_t size = 0; - v_U8_t skbStaIdx; + hdd_list_node_t *anchor = NULL; skb_list_node_t *pktNode = NULL; - hdd_list_node_t *tmp = NULL, *next = NULL; - struct netdev_queue *txq; struct sk_buff *skb = NULL; + hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; + hdd_ibss_peer_info_t *pPeerInfo = &pHddStaCtx->ibss_peer_info; - if (NULL == pAdapter) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter is NULL %u"), STAId); - VOS_ASSERT(0); - return; - } - - for (i = 0; i < NUM_TX_QUEUES; i++) + for (i = 0; i < NUM_TX_QUEUES; i ++) { - spin_lock_bh(&pAdapter->wmm_tx_queue[i].lock); - - if ( list_empty( &pAdapter->wmm_tx_queue[i].anchor ) ) + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i].lock); + while (true) { - spin_unlock_bh(&pAdapter->wmm_tx_queue[i].lock); - continue; - } - - /* Iterate through the queue and identify the data for STAId */ - list_for_each_safe(tmp, next, &pAdapter->wmm_tx_queue[i].anchor) - { - pktNode = list_entry(tmp, skb_list_node_t, anchor); - if (pktNode != NULL) + if (VOS_STATUS_E_EMPTY != + hdd_list_remove_front(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i], + &anchor)) { + //If success then we got a valid packet from some AC + pktNode = list_entry(anchor, skb_list_node_t, anchor); skb = pktNode->skb; - - /* Get the STAId from data */ - skbStaIdx = *(v_U8_t *)(((v_U8_t *)(skb->data)) - 1); - if (skbStaIdx == STAId) - { - /* Data for STAId is freed along with the queue node */ - list_del(tmp); - kfree_skb(skb); - - ++pAdapter->hdd_stats.hddTxRxStats.txFlushed; - ++pAdapter->hdd_stats.hddTxRxStats.txFlushedAC[i]; - pAdapter->wmm_tx_queue[i].count--; - } + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txFlushed; + ++pAdapter->hdd_stats.hddTxRxStats.txFlushedAC[i]; + kfree_skb(skb); + continue; } + break; } - - /* Restart the queue only-if suspend and the queue was flushed */ - hdd_list_size( &pAdapter->wmm_tx_queue[i], &size ); - txq = netdev_get_tx_queue(pAdapter->dev, i); - - if (VOS_TRUE == pAdapter->isTxSuspended[i] && - size <= HDD_TX_QUEUE_LOW_WATER_MARK && - netif_tx_queue_stopped(txq) ) - { - netif_tx_start_queue(txq); - pAdapter->isTxSuspended[i] = VOS_FALSE; - ++pAdapter->hdd_stats.hddTxRxStats.txDequeDePressured; - ++pAdapter->hdd_stats.hddTxRxStats.txDequeDePressuredAC[i]; - } - - spin_unlock_bh(&pAdapter->wmm_tx_queue[i].lock); + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i].lock); } } @@ -364,6 +367,7 @@ static struct sk_buff* hdd_mon_tx_fetch_pkt(hdd_adapter_t* pAdapter) "%s: TX queue[%d] re-enabled", __func__, ac); pAdapter->isTxSuspended[ac] = VOS_FALSE; /* Enable Queues which we have disabled earlier */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Enabling queues")); netif_tx_start_all_queues( pAdapter->dev ); } @@ -376,7 +380,10 @@ void hdd_mon_tx_mgmt_pkt(hdd_adapter_t* pAdapter) struct sk_buff* skb; hdd_adapter_t* pMonAdapter = NULL; struct ieee80211_hdr *hdr; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); if (pAdapter == NULL) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, @@ -384,7 +391,12 @@ void hdd_mon_tx_mgmt_pkt(hdd_adapter_t* pAdapter) VOS_ASSERT(0); return; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return; + } pMonAdapter = hdd_get_adapter( pAdapter->pHddCtx, WLAN_HDD_MONITOR ); if (pMonAdapter == NULL) { @@ -434,7 +446,8 @@ void hdd_mon_tx_mgmt_pkt(hdd_adapter_t* pAdapter) { struct tagCsrDelStaParams delStaParams; - WLANSAP_PopulateDelStaParams(hdr->addr1, eCsrForcedDeauthSta, + WLANSAP_PopulateDelStaParams(hdr->addr1, + eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, (SIR_MAC_MGMT_DEAUTH >> 4), &delStaParams); hdd_softap_sta_deauth(pAdapter, &delStaParams); @@ -458,9 +471,11 @@ void hdd_mon_tx_mgmt_pkt(hdd_adapter_t* pAdapter) "%s: WLANSAP_SendAction returned fail", __func__); hdd_sendActionCnf( pAdapter, FALSE ); } + EXIT(); return; mgmt_handled: + EXIT(); hdd_sendActionCnf( pAdapter, TRUE ); return; fail: @@ -469,165 +484,24 @@ void hdd_mon_tx_mgmt_pkt(hdd_adapter_t* pAdapter) return; } -void hdd_mon_tx_work_queue(struct work_struct *work) +void __hdd_mon_tx_work_queue(struct work_struct *work) { hdd_adapter_t* pAdapter = container_of(work, hdd_adapter_t, monTxWorkQueue); hdd_mon_tx_mgmt_pkt(pAdapter); } -int hdd_mon_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +void hdd_mon_tx_work_queue(struct work_struct *work) { - v_U16_t rt_hdr_len; - struct ieee80211_hdr *hdr; - hdd_adapter_t *pPgBkAdapter, *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - struct ieee80211_radiotap_header *rtap_hdr = - (struct ieee80211_radiotap_header *)skb->data; - - /*Supplicant sends the EAPOL packet on monitor interface*/ - pPgBkAdapter = pAdapter->sessionCtx.monitor.pAdapterForTx; - if(pPgBkAdapter == NULL) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, - "%s: No Adapter to piggy back. Dropping the pkt on monitor inf", - __func__); - goto fail; /* too short to be possibly valid */ - } - - /* check if toal skb length is greater then radio tab header length of not */ - if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) - goto fail; /* too short to be possibly valid */ - - /* check if radio tap header version is correct or not */ - if (unlikely(rtap_hdr->it_version)) - goto fail; /* only version 0 is supported */ - - /*Strip off the radio tap header*/ - rt_hdr_len = ieee80211_get_radiotap_len(skb->data); - - /* check if skb length if greator then total radio tap header length ot not*/ - if (unlikely(skb->len < rt_hdr_len)) - goto fail; - - /* Update the trans_start for this netdev */ - dev->trans_start = jiffies; - /* - * fix up the pointers accounting for the radiotap - * header still being in there. - */ - skb_set_mac_header(skb, rt_hdr_len); - skb_set_network_header(skb, rt_hdr_len); - skb_set_transport_header(skb, rt_hdr_len); - - /* Pull rtap header out of the skb */ - skb_pull(skb, rt_hdr_len); - - /*Supplicant adds: radiotap Hdr + radiotap data + 80211 Header. So after - * radio tap header and 802.11 header starts - */ - hdr = (struct ieee80211_hdr *)skb->data; - - /* Send data frames through the normal Data path. In this path we will - * conver rcvd 802.11 packet to 802.3 packet */ - if ( (hdr->frame_control & HDD_FRAME_TYPE_MASK) == HDD_FRAME_TYPE_DATA) - { - v_U8_t da[6]; - v_U8_t sa[6]; - - memcpy (da, hdr->addr1, VOS_MAC_ADDR_SIZE); - memcpy (sa, hdr->addr2, VOS_MAC_ADDR_SIZE); - - /* Pull 802.11 MAC header */ - skb_pull(skb, HDD_80211_HEADER_LEN); - - if ( HDD_FRAME_SUBTYPE_QOSDATA == - (hdr->frame_control & HDD_FRAME_SUBTYPE_MASK)) - { - skb_pull(skb, HDD_80211_HEADER_QOS_CTL); - } - - /* Pull LLC header */ - skb_pull(skb, HDD_LLC_HDR_LEN); - - /* Create space for Ethernet header */ - skb_push(skb, HDD_MAC_HDR_SIZE*2); - memcpy(&skb->data[0], da, HDD_MAC_HDR_SIZE); - memcpy(&skb->data[HDD_DEST_ADDR_OFFSET], sa, HDD_MAC_HDR_SIZE); - - /* Only EAPOL Data packets are allowed through monitor interface */ - if (vos_be16_to_cpu( - (*(unsigned short*)&skb->data[HDD_ETHERTYPE_802_1_X_FRAME_OFFSET]) ) - != HDD_ETHERTYPE_802_1_X) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, - "%s: Not a Eapol packet. Drop this frame", __func__); - //If not EAPOL frames, drop them. - kfree_skb(skb); - return NETDEV_TX_OK; - } - - skb->protocol = htons(HDD_ETHERTYPE_802_1_X); - - hdd_hostapd_select_queue(pPgBkAdapter->dev, skb); - return hdd_softap_hard_start_xmit( skb, pPgBkAdapter->dev ); - } - else - { - VOS_STATUS status; - WLANTL_ACEnumType ac = 0; - skb_list_node_t *pktNode = NULL; - v_SIZE_t pktListSize = 0; - - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - //If we have already reached the max queue size, disable the TX queue - if ( pAdapter->wmm_tx_queue[ac].count == pAdapter->wmm_tx_queue[ac].max_size) - { - /* We want to process one packet at a time, so lets disable all TX queues - * and re-enable the queues once we get TX feedback for this packet */ - netif_tx_stop_all_queues(pAdapter->dev); - pAdapter->isTxSuspended[ac] = VOS_TRUE; - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - return NETDEV_TX_BUSY; - } - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - - //Use the skb->cb field to hold the list node information - pktNode = (skb_list_node_t *)&skb->cb; - - //Stick the OS packet inside this node. - pktNode->skb = skb; - - INIT_LIST_HEAD(&pktNode->anchor); - - //Insert the OS packet into the appropriate AC queue - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - status = hdd_list_insert_back_size( &pAdapter->wmm_tx_queue[ac], - &pktNode->anchor, &pktListSize ); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s:Insert Tx queue failed. Pkt dropped", __func__); - kfree_skb(skb); - return NETDEV_TX_OK; - } + vos_ssr_protect(__func__); + __hdd_mon_tx_work_queue(work); + vos_ssr_unprotect(__func__); +} - if ( pktListSize == 1 ) - { - /* In this context we cannot acquire any mutex etc. And to transmit - * this packet we need to call SME API. So to take care of this we will - * schedule a workqueue - */ - schedule_work(&pPgBkAdapter->monTxWorkQueue); - } - return NETDEV_TX_OK; - } - -fail: - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, - "%s: Packet Rcvd at Monitor interface is not proper," - " Dropping the packet", - __func__); +int hdd_mon_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Packet Rcvd at Monitor interface," + " Dropping the packet",__func__); kfree_skb(skb); return NETDEV_TX_OK; } @@ -728,6 +602,195 @@ void hdd_dump_dhcp_pkt(struct sk_buff *skb, int path) } } +/**============================================================================ + @brief hdd_ibss_hard_start_xmit() - Function registered with the Linux OS for + transmitting packets in case of IBSS. There are 2 versions of this function. + One that uses locked queue and other that uses lockless queues. Both have been + retained to do some performance testing + + @param skb : [in] pointer to OS packet (sk_buff) + @param dev : [in] pointer to network device + + @return : NET_XMIT_DROP if packets are dropped + : NET_XMIT_SUCCESS if packet is enqueued succesfully + ===========================================================================*/ + int hdd_ibss_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) + { + VOS_STATUS status; + WLANTL_ACEnumType ac; + sme_QosWmmUpType up; + skb_list_node_t *pktNode = NULL; + hdd_list_node_t *anchor = NULL; + v_SIZE_t pktListSize = 0; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_ibss_peer_info_t * pPeerInfo; + v_U8_t STAId = WLAN_MAX_STA_COUNT; + v_BOOL_t txSuspended = VOS_FALSE; + struct sk_buff *skb1; + v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; + + if (NULL == pHddCtx || NULL == pHddStaCtx) { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s HDD context is NULL", __func__); + return NETDEV_TX_BUSY; + } + pPeerInfo = &pHddStaCtx->ibss_peer_info; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled; + + //Get TL AC corresponding to Qdisc queue index/AC. + ac = hdd_QdiscAcToTlAC[skb->queue_mapping]; + + if (eConnectionState_IbssDisconnected == pHddStaCtx->conn_info.connState) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: Tx frame in disconnected state in IBSS mode", __func__); + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + kfree_skb(skb); + return NETDEV_TX_OK; + } + + STAId = hdd_sta_id_find_from_mac_addr(pAdapter, pDestMacAddress); + if ((STAId == HDD_WLAN_INVALID_STA_ID) && + (vos_is_macaddr_broadcast( pDestMacAddress ) || + vos_is_macaddr_group(pDestMacAddress))) + { + STAId = IBSS_BROADCAST_STAID; + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_LOW, + "%s: BC/MC packet", __func__); + } + else if (STAId >= HDD_MAX_NUM_IBSS_STA) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: Received Unicast frame with invalid staID", __func__); + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + kfree_skb(skb); + return NETDEV_TX_OK; + } + + //user priority from IP header, which is already extracted and set from + //select_queue call back function + up = skb->priority; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac]; + + VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, + "%s: Classified as ac %d up %d", __func__, ac, up); + + if ( pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_PROTO_TYPE_DHCP ) + { + hdd_dump_dhcp_pkt(skb, TX_PATH); + } + + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + hdd_list_size(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac], &pktListSize); + if(pktListSize >= pAdapter->aTxQueueLimit[ac]) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s: station %d ac %d queue over limit %d", __func__, STAId, ac, pktListSize); + pPeerInfo->ibssStaInfo[STAId].txSuspended[ac] = VOS_TRUE; + netif_stop_subqueue(dev, skb_get_queue_mapping(skb)); + txSuspended = VOS_TRUE; + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s: TX queue full for AC=%d Disable OS TX queue", + __func__, ac ); + return NETDEV_TX_BUSY; + } + + /* If 3/4th of the max queue size is used then enable the flag. + * This flag indicates to place the DHCP packets in VOICE AC queue.*/ + if (WLANTL_AC_BE == ac) + { + if (pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].count >= HDD_TX_QUEUE_LOW_WATER_MARK) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s: TX queue for Best Effort AC is 3/4th full", __func__); + pAdapter->isVosLowResource = VOS_TRUE; + } + else + { + pAdapter->isVosLowResource = VOS_FALSE; + } + } + + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + + //Use the skb->cb field to hold the list node information + pktNode = (skb_list_node_t *)&skb->cb; + + //Stick the OS packet inside this node. + pktNode->skb = skb; + + //Stick the User Priority inside this node + pktNode->userPriority = up; + + INIT_LIST_HEAD(&pktNode->anchor); + + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + status = hdd_list_insert_back_size( &pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac], + &pktNode->anchor, &pktListSize ); + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + if ( !VOS_IS_STATUS_SUCCESS( status ) ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s:Insert Tx queue failed. Pkt dropped", __func__); + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + ++pAdapter->stats.tx_dropped; + kfree_skb(skb); + return NETDEV_TX_OK; + } + + ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueued; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueuedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count; + + if (1 == pktListSize) + { + //Let TL know we have a packet to send for this AC + status = WLANTL_STAPktPending( pHddCtx->pvosContext, STAId, ac ); + + if ( !VOS_IS_STATUS_SUCCESS( status ) ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s: Failed to signal TL for AC=%d STAId =%d", + __func__, ac, STAId ); + + /* Remove the packet from queue. It must be at the back of the queue, as TX thread + * cannot preempt us in the middle as we are in a soft irq context. + * Also it must be the same packet that we just allocated. + */ + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + status = hdd_list_remove_back( &pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac], &anchor); + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + /* Free the skb only if we are able to remove it from the list. + * If we are not able to retrieve it from the list it means that + * the skb was pulled by TX Thread and is use so we should not free + * it here + */ + if (VOS_IS_STATUS_SUCCESS(status)) + { + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb1 = pktNode->skb; + kfree_skb(skb1); + } + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + return NETDEV_TX_OK; + } + } + + dev->trans_start = jiffies; + + return NETDEV_TX_OK; + } + /**============================================================================ @brief hdd_hard_start_xmit() - Function registered with the Linux OS for transmitting packets. There are 2 versions of this function. One that uses @@ -743,7 +806,7 @@ void hdd_dump_dhcp_pkt(struct sk_buff *skb, int path) int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { VOS_STATUS status; - WLANTL_ACEnumType ac; + WLANTL_ACEnumType qid, ac; sme_QosWmmUpType up; skb_list_node_t *pktNode = NULL; hdd_list_node_t *anchor = NULL; @@ -754,6 +817,13 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); v_BOOL_t txSuspended = VOS_FALSE; + struct sk_buff *skb1; + + if (NULL == pHddCtx) { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s HDD context is NULL", __func__); + return NETDEV_TX_BUSY; + } ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled; @@ -764,84 +834,60 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_BUSY; } - //Get TL AC corresponding to Qdisc queue index/AC. - ac = hdd_QdiscAcToTlAC[skb->queue_mapping]; + //Get TL Q index corresponding to Qdisc queue index/AC. + qid = hdd_QdiscAcToTlAC[skb->queue_mapping]; + ac = qid; - if (WLAN_HDD_IBSS == pAdapter->device_mode) + if (qid == WLANTL_AC_HIGH_PRIO) { - v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; - - if (eConnectionState_IbssDisconnected == pHddStaCtx->conn_info.connState) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Tx frame in disconnected state in IBSS mode", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - return NETDEV_TX_OK; - } - - STAId = *(v_U8_t *)(((v_U8_t *)(skb->data)) - 1); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s It must be a Eapol/Wapi/DHCP packet device_mode:%d", + __func__, pAdapter->device_mode); + ac = hddWmmUpToAcMap[skb->priority]; + } - if ((STAId == HDD_WLAN_INVALID_STA_ID) && - (vos_is_macaddr_broadcast( pDestMacAddress ) || - vos_is_macaddr_group(pDestMacAddress))) - { - STAId = IBSS_BROADCAST_STAID; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_LOW, - "%s: BC/MC packet", __func__); - } - else if (STAId == HDD_WLAN_INVALID_STA_ID) + if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Received Unicast frame with invalid staID", __func__); + FL("Tx frame in not associated state in %d context"), + pAdapter->device_mode); ++pAdapter->stats.tx_dropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[qid]; kfree_skb(skb); return NETDEV_TX_OK; } - } - else - { STAId = pHddStaCtx->conn_info.staId[0]; - } //user priority from IP header, which is already extracted and set from //select_queue call back function up = skb->priority; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[qid]; #ifdef HDD_WMM_DEBUG VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, "%s: Classified as ac %d up %d", __func__, ac, up); #endif // HDD_WMM_DEBUG -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_FIRST_XMIT_TIME, (void *)skb, 0); - //Should we check below global to avoid function call each time ?? -/* - if(gRoamDelayMetaInfo.hdd_monitor_tx) + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) { + vos_record_roam_event(e_HDD_FIRST_XMIT_TIME, (void *)skb, 0); } - */ -#endif - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); + spin_lock(&pAdapter->wmm_tx_queue[qid].lock); /*CR 463598,384996*/ /*For every increment of 10 pkts in the queue, we inform TL about pending pkts. *We check for +1 in the logic,to take care of Zero count which *occurs very frequently in low traffic cases */ - if((pAdapter->wmm_tx_queue[ac].count + 1) % 10 == 0) + if((pAdapter->wmm_tx_queue[qid].count + 1) % 10 == 0) { /* Use the following debug statement during Engineering Debugging.There are chance that this will lead to a Watchdog Bark * if it is in the mainline code and if the log level is enabled by someone for debugging VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,"%s:Queue is Filling up.Inform TL again about pending packets", __func__);*/ status = WLANTL_STAPktPending( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - STAId, ac + STAId, qid ); if ( !VOS_IS_STATUS_SUCCESS( status ) ) { @@ -850,27 +896,30 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) __func__, status); ++pAdapter->stats.tx_dropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[qid]; kfree_skb(skb); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); + spin_unlock(&pAdapter->wmm_tx_queue[qid].lock); return NETDEV_TX_OK; } } //If we have already reached the max queue size, disable the TX queue - if ( pAdapter->wmm_tx_queue[ac].count == pAdapter->wmm_tx_queue[ac].max_size) + if ( pAdapter->wmm_tx_queue[qid].count == pAdapter->wmm_tx_queue[qid].max_size) { ++pAdapter->hdd_stats.hddTxRxStats.txXmitBackPressured; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitBackPressuredAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitBackPressuredAC[qid]; + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queue for QId %d"), qid); netif_tx_stop_queue(netdev_get_tx_queue(dev, skb_get_queue_mapping(skb))); - pAdapter->isTxSuspended[ac] = VOS_TRUE; + pAdapter->isTxSuspended[qid] = VOS_TRUE; txSuspended = VOS_TRUE; + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_STOP_NETDEV, + pAdapter->sessionId, qid)); } /* If 3/4th of the max queue size is used then enable the flag. * This flag indicates to place the DHCP packets in VOICE AC queue.*/ - if (WLANTL_AC_BE == ac) + if (WLANTL_AC_BE == qid) { - if (pAdapter->wmm_tx_queue[ac].count >= HDD_TX_QUEUE_LOW_WATER_MARK) + if (pAdapter->wmm_tx_queue[qid].count >= HDD_TX_QUEUE_LOW_WATER_MARK) { pAdapter->isVosLowResource = VOS_TRUE; } @@ -880,9 +929,10 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) } } - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); + spin_unlock(&pAdapter->wmm_tx_queue[qid].lock); - if ( ( NULL != pHddCtx ) && pHddCtx->cfg_ini->enableDhcpDebug ) + if (( NULL != pHddCtx ) && + (pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_PROTO_TYPE_DHCP)) { hdd_dump_dhcp_pkt(skb, TX_PATH); } @@ -890,8 +940,8 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if (VOS_TRUE == txSuspended) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: TX queue full for AC=%d Disable OS TX queue", - __func__, ac ); + "%s: TX queue full for QId=%d Disable OS TX queue", + __func__, qid ); return NETDEV_TX_BUSY; } @@ -908,22 +958,22 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) INIT_LIST_HEAD(&pktNode->anchor); //Insert the OS packet into the appropriate AC queue - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - status = hdd_list_insert_back_size( &pAdapter->wmm_tx_queue[ac], &pktNode->anchor, &pktListSize ); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); + spin_lock(&pAdapter->wmm_tx_queue[qid].lock); + status = hdd_list_insert_back_size( &pAdapter->wmm_tx_queue[qid], &pktNode->anchor, &pktListSize ); + spin_unlock(&pAdapter->wmm_tx_queue[qid].lock); if ( !VOS_IS_STATUS_SUCCESS( status ) ) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN,"%s:Insert Tx queue failed. Pkt dropped", __func__); ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[qid]; ++pAdapter->stats.tx_dropped; kfree_skb(skb); return NETDEV_TX_OK; } ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueued; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueuedAC[ac]; + ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueuedAC[qid]; ++pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count; if (HDD_PSB_CHANGED == pAdapter->psbChanged) @@ -946,26 +996,39 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) status = hdd_wmm_acquire_access( pAdapter, ac, &granted ); pAdapter->psbChanged |= (1 << ac); } - if ( granted && ( pktListSize == 1 )) + + if ( (granted && ( pktListSize == 1 )) || + (qid == WLANTL_AC_HIGH_PRIO)) { //Let TL know we have a packet to send for this AC //VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s:Indicating Packet to TL", __func__); status = WLANTL_STAPktPending( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - STAId, ac ); + STAId, qid ); if ( !VOS_IS_STATUS_SUCCESS( status ) ) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, "%s: Failed to signal TL for AC=%d", __func__, ac ); + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, + "%s: Failed to signal TL for QId=%d", __func__, qid ); //Remove the packet from queue. It must be at the back of the queue, as TX thread cannot preempt us in the middle //as we are in a soft irq context. Also it must be the same packet that we just allocated. - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - status = hdd_list_remove_back( &pAdapter->wmm_tx_queue[ac], &anchor ); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); + spin_lock(&pAdapter->wmm_tx_queue[qid].lock); + status = hdd_list_remove_back( &pAdapter->wmm_tx_queue[qid], &anchor ); + spin_unlock(&pAdapter->wmm_tx_queue[qid].lock); + /* Free the skb only if we are able to remove it from the list. + * If we are not able to retrieve it from the list it means that + * the skb was pulled by TX Thread and is use so we should not free + * it here + */ + if (VOS_IS_STATUS_SUCCESS(status)) + { + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb1 = pktNode->skb; + kfree_skb(skb1); + } ++pAdapter->stats.tx_dropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[qid]; return NETDEV_TX_OK; } } @@ -1010,12 +1073,17 @@ VOS_STATUS hdd_Ibss_GetStaId(hdd_station_ctx_t *pHddStaCtx, v_MACADDR_t *pMacAdd void __hdd_tx_timeout(struct net_device *dev) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx; struct netdev_queue *txq; + hdd_remain_on_chan_ctx_t *pRemainChanCtx; int i = 0; + int status = 0; v_ULONG_t diff_in_jiffies = 0; + hdd_station_ctx_t *pHddStaCtx = NULL; VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Transmission timeout occurred", __func__); + "%s: Transmission timeout occurred jiffies %lu dev->trans_start %lu", + __func__,jiffies,dev->trans_start); if ( NULL == pAdapter ) { @@ -1025,6 +1093,21 @@ void __hdd_tx_timeout(struct net_device *dev) return; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (status !=0 ) + { + return; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if ( NULL == pHddStaCtx ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("pHddStaCtx is NULL")); + return; + } + ++pAdapter->hdd_stats.hddTxRxStats.txTimeoutCount; //Getting here implies we disabled the TX queues for too long. Queues are @@ -1046,11 +1129,12 @@ void __hdd_tx_timeout(struct net_device *dev) pAdapter->isTxSuspended[2], pAdapter->isTxSuspended[3]); - for (i = 0; i < 8; i++) + for (i = 0; i < dev->num_tx_queues; i++) { txq = netdev_get_tx_queue(dev, i); VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "Queue%d status: %d", i, netif_tx_queue_stopped(txq)); + "Queue%d status: %d txq->trans_start %lu", + i, netif_tx_queue_stopped(txq),txq->trans_start); } VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, @@ -1084,6 +1168,19 @@ void __hdd_tx_timeout(struct net_device *dev) //update last jiffies after the check pAdapter->hdd_stats.hddTxRxStats.jiffiesLastTxTimeOut = jiffies; + if (!pHddStaCtx->conn_info.uIsAuthenticated) { + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + FL("TL is not in authenticated state so skipping SSR")); + pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount = 0; + goto print_log; + } + if (pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount == + HDD_TX_STALL_KICKDXE_THRESHOLD) + { + VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Request Kick DXE for recovery",__func__); + WLANTL_TLDebugMessage(WLANTL_DEBUG_KICKDXE); + } if (pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount == HDD_TX_STALL_RECOVERY_THRESHOLD) { @@ -1091,18 +1188,51 @@ void __hdd_tx_timeout(struct net_device *dev) "%s: Request firmware for recovery",__func__); WLANTL_TLDebugMessage(WLANTL_DEBUG_FW_CLEANUP); } - - if (pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount > - HDD_TX_STALL_SSR_THRESHOLD) + /* + * This function is getting called in softirq context, So don't hold + * any mutex. + * There is no harm here in not holding the mutex as long as we are + * not accessing the pRemainChanCtx contents. + */ + pRemainChanCtx = hdd_get_remain_on_channel_ctx(pHddCtx); + if (!pRemainChanCtx) { - // Driver could not recover, issue SSR - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Cannot recover from Data stall Issue SSR", - __func__); - WLANTL_FatalError(); - return; + if (pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount > + HDD_TX_STALL_SSR_THRESHOLD) + { + // Driver could not recover, issue SSR + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Cannot recover from Data stall Issue SSR", + __func__); + WLANTL_FatalError(); + return; + } + } + else + { + mutex_unlock(&pHddCtx->roc_lock); + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "Remain on channel in progress"); + /* The supplicant can retry "P2P Invitation Request" for 120 times + * and so there is a possbility that we can remain off channel for + * the entire duration of these retries(which can be max 60sec). + * If we encounter such a case, let us not trigger SSR after 30sec + * but wait for 60sec to let the device go on home channel and start + * tx. If tx does not start within 70sec we will issue SSR. + */ + if (pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount > + HDD_TX_STALL_SSR_THRESHOLD_HIGH) + { + // Driver could not recover, issue SSR + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Cannot recover from Data stall Issue SSR", + __func__); + WLANTL_FatalError(); + return; + } } +print_log: /* If Tx stalled for a long time then *hdd_tx_timeout* is called * every 5sec. The TL debug spits out a lot of information on the * serial console, if it is called every time *hdd_tx_timeout* is @@ -1133,14 +1263,14 @@ void hdd_tx_timeout(struct net_device *dev) } /**============================================================================ - @brief hdd_stats() - Function registered with the Linux OS for + @brief __hdd_stats() - Function registered with the Linux OS for device TX/RX statistic @param dev : [in] pointer to Libra network device @return : pointer to net_device_stats structure ===========================================================================*/ -struct net_device_stats* hdd_stats(struct net_device *dev) +struct net_device_stats* __hdd_stats(struct net_device *dev) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1155,73 +1285,182 @@ struct net_device_stats* hdd_stats(struct net_device *dev) return &pAdapter->stats; } +struct net_device_stats* hdd_stats(struct net_device *dev) +{ + struct net_device_stats* dev_stats; + + vos_ssr_protect(__func__); + dev_stats = __hdd_stats(dev); + vos_ssr_unprotect(__func__); + + return dev_stats; +} /**============================================================================ - @brief hdd_init_tx_rx() - Init function to initialize Tx/RX + @brief hdd_ibss_init_tx_rx() - Init function to initialize Tx/RX modules in HDD - @param pAdapter : [in] pointer to adapter context - @return : VOS_STATUS_E_FAILURE if any errors encountered + @param pAdapter : [in] pointer to adapter context + @return : VOS_STATUS_E_FAILURE if any errors encountered : VOS_STATUS_SUCCESS otherwise ===========================================================================*/ -VOS_STATUS hdd_init_tx_rx( hdd_adapter_t *pAdapter ) +void hdd_ibss_init_tx_rx( hdd_adapter_t *pAdapter ) { - VOS_STATUS status = VOS_STATUS_SUCCESS; - v_SINT_t i = -1; - - if ( NULL == pAdapter ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter is NULL")); - VOS_ASSERT(0); - return VOS_STATUS_E_FAILURE; - } + v_U8_t i; + v_U8_t STAId = 0; + hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; + hdd_ibss_peer_info_t *pPeerInfo = &pHddStaCtx->ibss_peer_info; + v_U8_t pACWeights[] = { + HDD_SOFTAP_BK_WEIGHT_DEFAULT, + HDD_SOFTAP_BE_WEIGHT_DEFAULT, + HDD_SOFTAP_VI_WEIGHT_DEFAULT, + HDD_SOFTAP_VO_WEIGHT_DEFAULT + }; pAdapter->isVosOutOfResource = VOS_FALSE; pAdapter->isVosLowResource = VOS_FALSE; - //vos_mem_zero(&pAdapter->stats, sizeof(struct net_device_stats)); - //Will be zeroed out during alloc + // Since SAP model is used for IBSS also. Using same queue length as in SAP. + pAdapter->aTxQueueLimit[WLANTL_AC_BK] = HDD_SOFTAP_TX_BK_QUEUE_MAX_LEN; + pAdapter->aTxQueueLimit[WLANTL_AC_BE] = HDD_SOFTAP_TX_BE_QUEUE_MAX_LEN; + pAdapter->aTxQueueLimit[WLANTL_AC_VI] = HDD_SOFTAP_TX_VI_QUEUE_MAX_LEN; + pAdapter->aTxQueueLimit[WLANTL_AC_VO] = HDD_SOFTAP_TX_VO_QUEUE_MAX_LEN; - while (++i != NUM_TX_QUEUES) - { - pAdapter->isTxSuspended[i] = VOS_FALSE; - hdd_list_init( &pAdapter->wmm_tx_queue[i], HDD_TX_QUEUE_MAX_LEN); + for (STAId = 0; STAId < HDD_MAX_NUM_IBSS_STA; STAId++) + { + vos_mem_zero(&pPeerInfo->ibssStaInfo[STAId], sizeof(hdd_ibss_station_info_t)); + for (i = 0; i < NUM_TX_QUEUES; i ++) + { + hdd_list_init(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i], HDD_TX_QUEUE_MAX_LEN); + } } - return status; + /* Update the AC weights suitable for SoftAP mode of operation */ + WLANTL_SetACWeights((WLAN_HDD_GET_CTX(pAdapter))->pvosContext, pACWeights); } - /**============================================================================ - @brief hdd_deinit_tx_rx() - Deinit function to clean up Tx/RX + @brief hdd_ibss_deinit_tx_rx() - Deinit function to clean up Tx/RX modules in HDD - @param pAdapter : [in] pointer to adapter context - @return : VOS_STATUS_E_FAILURE if any errors encountered + @param pAdapter : [in] pointer to adapter context.. + @return : VOS_STATUS_E_FAILURE if any errors encountered. : VOS_STATUS_SUCCESS otherwise ===========================================================================*/ -VOS_STATUS hdd_deinit_tx_rx( hdd_adapter_t *pAdapter ) +VOS_STATUS hdd_ibss_deinit_tx_rx( hdd_adapter_t *pAdapter ) { VOS_STATUS status = VOS_STATUS_SUCCESS; + v_U8_t STAId = 0; + hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; + hdd_ibss_peer_info_t * pPeerInfo = &pHddStaCtx->ibss_peer_info; + hdd_list_node_t *anchor = NULL; + skb_list_node_t *pktNode = NULL; + struct sk_buff *skb = NULL; v_SINT_t i = -1; - if ( NULL == pAdapter ) + for (STAId = 0; STAId < HDD_MAX_NUM_IBSS_STA; STAId++) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter is NULL")); - VOS_ASSERT(0); - return VOS_STATUS_E_FAILURE; - } - - status = hdd_flush_tx_queues(pAdapter); - if (VOS_STATUS_SUCCESS != status) - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, - FL("failed to flush tx queues")); + if (VOS_FALSE == pPeerInfo->ibssStaInfo[STAId].isUsed) + { + continue; + } + for (i = 0; i < NUM_TX_QUEUES; i ++) + { + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i].lock); + while (true) + { + status = hdd_list_remove_front ( &pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i], &anchor); - while (++i != NUM_TX_QUEUES) - { - //Free up actual list elements in the Tx queue + if (VOS_STATUS_E_EMPTY != status) + { + //If success then we got a valid packet from some AC + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb = pktNode->skb; + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txFlushed; + ++pAdapter->hdd_stats.hddTxRxStats.txFlushedAC[i]; + kfree_skb(skb); + continue; + } + + //current list is empty + break; + } + pPeerInfo->ibssStaInfo[STAId].txSuspended[i] = VOS_FALSE; + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[i].lock); + } + } + pAdapter->isVosLowResource = VOS_FALSE; + + return status; +} + +/**============================================================================ + @brief hdd_init_tx_rx() - Init function to initialize Tx/RX + modules in HDD + + @param pAdapter : [in] pointer to adapter context + @return : VOS_STATUS_E_FAILURE if any errors encountered + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +VOS_STATUS hdd_init_tx_rx( hdd_adapter_t *pAdapter ) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + v_SINT_t i = -1; + + if ( NULL == pAdapter ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("pAdapter is NULL")); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + pAdapter->isVosOutOfResource = VOS_FALSE; + pAdapter->isVosLowResource = VOS_FALSE; + + //vos_mem_zero(&pAdapter->stats, sizeof(struct net_device_stats)); + //Will be zeroed out during alloc + + while (++i != NUM_TX_QUEUES) + { + pAdapter->isTxSuspended[i] = VOS_FALSE; + hdd_list_init( &pAdapter->wmm_tx_queue[i], HDD_TX_QUEUE_MAX_LEN); + } + + return status; +} + + +/**============================================================================ + @brief hdd_deinit_tx_rx() - Deinit function to clean up Tx/RX + modules in HDD + + @param pAdapter : [in] pointer to adapter context + @return : VOS_STATUS_E_FAILURE if any errors encountered + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +VOS_STATUS hdd_deinit_tx_rx( hdd_adapter_t *pAdapter ) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + v_SINT_t i = -1; + + if ( NULL == pAdapter ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("pAdapter is NULL")); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + status = hdd_flush_tx_queues(pAdapter); + if (VOS_STATUS_SUCCESS != status) + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, + FL("failed to flush tx queues")); + + while (++i != NUM_TX_QUEUES) + { + //Free up actual list elements in the Tx queue hdd_list_destroy( &pAdapter->wmm_tx_queue[i] ); } @@ -1377,10 +1616,10 @@ VOS_STATUS hdd_tx_complete_cbk( v_VOID_t *vosContext, pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext ); //Get the Adapter context. pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_INFRA_STATION); - if (pAdapter == NULL) + if (pAdapter == NULL || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: HDD adapter context is Null", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: Invalid adapter %pK", __func__, pAdapter); } else { @@ -1400,6 +1639,249 @@ VOS_STATUS hdd_tx_complete_cbk( v_VOID_t *vosContext, return status; } +/**============================================================================ + @brief hdd_ibss_tx_fetch_packet_cbk() - Callback function invoked by TL to + fetch a packet for transmission. + + @param vosContext : [in] pointer to VOS context + @param staId : [in] Station for which TL is requesting a pkt + @param ac : [in] access category requested by TL + @param pVosPacket : [out] pointer to VOS packet packet pointer + @param pPktMetaInfo : [out] pointer to meta info for the pkt + + @return : VOS_STATUS_E_EMPTY if no packets to transmit + : VOS_STATUS_E_FAILURE if any errors encountered + : VOS_STATUS_SUCCESS otherwise + ===========================================================================*/ +VOS_STATUS hdd_ibss_tx_fetch_packet_cbk( v_VOID_t *vosContext, + v_U8_t *pStaId, + WLANTL_ACEnumType ac, + vos_pkt_t **ppVosPacket, + WLANTL_MetaInfoType *pPktMetaInfo ) +{ + VOS_STATUS status = VOS_STATUS_E_FAILURE; + hdd_adapter_t *pAdapter = NULL; + hdd_list_node_t *anchor = NULL; + skb_list_node_t *pktNode = NULL; + struct sk_buff *skb = NULL; + vos_pkt_t *pVosPacket = NULL; + v_MACADDR_t* pDestMacAddress = NULL; + v_TIME_t timestamp; + v_SIZE_t size = 0; + v_U8_t STAId = WLAN_MAX_STA_COUNT; + hdd_context_t *pHddCtx = NULL; + hdd_station_ctx_t *pHddStaCtx = NULL; + hdd_ibss_peer_info_t *pPeerInfo = NULL; + v_U8_t proto_type = 0; + v_U16_t packet_size; + + //Sanity check on inputs + if ( ( NULL == vosContext ) || + ( NULL == pStaId ) || + ( NULL == ppVosPacket ) || + ( NULL == pPktMetaInfo ) ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Null Params being passed", __func__); + return VOS_STATUS_E_FAILURE; + } + + //Get the HDD context. + pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext ); + if ( NULL == pHddCtx ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: HDD adapter context is Null", __func__); + return VOS_STATUS_E_FAILURE; + } + + STAId = *pStaId; + pAdapter = pHddCtx->sta_to_adapter[STAId]; + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) + { + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + pHddStaCtx = &pAdapter->sessionCtx.station; + pPeerInfo = &pHddStaCtx->ibss_peer_info; + + if (FALSE == pPeerInfo->ibssStaInfo[STAId].isUsed ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Unregistered STAId %d passed by TL", __func__, STAId); + return VOS_STATUS_E_FAILURE; + } + + ++pAdapter->hdd_stats.hddTxRxStats.txFetched; + + *ppVosPacket = NULL; + + //Make sure the AC being asked for is sane + if( ac > WLANTL_MAX_AC || ac < 0) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid AC %d passed by TL", __func__, ac); + return VOS_STATUS_E_FAILURE; + } + + ++pAdapter->hdd_stats.hddTxRxStats.txFetchedAC[ac]; + + //Get the vos packet before so that we are prepare for VOS low reseurce condition + //This simplifies the locking and unlocking of Tx queue + status = vos_pkt_wrap_data_packet( &pVosPacket, + VOS_PKT_TYPE_TX_802_3_DATA, + NULL, //OS Pkt is not being passed + hdd_tx_low_resource_cbk, + pAdapter ); + + if ((status == VOS_STATUS_E_ALREADY) || (status == VOS_STATUS_E_RESOURCES)) + { + //Remember VOS is in a low resource situation + pAdapter->isVosOutOfResource = VOS_TRUE; + ++pAdapter->hdd_stats.hddTxRxStats.txFetchLowResources; + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, + "%s: VOSS in Low Resource scenario", __func__); + //TL needs to handle this case. VOS_STATUS_E_EMPTY is returned when the queue is empty. + return VOS_STATUS_E_FAILURE; + } + + /* Only fetch this station and this AC. Return VOS_STATUS_E_EMPTY if nothing there. + Do not get next AC as the other branch does. + */ + spin_lock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + hdd_list_size(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac], &size); + + if (0 == size) + { + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + vos_pkt_return_packet(pVosPacket); + return VOS_STATUS_E_EMPTY; + } + + status = hdd_list_remove_front( &pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac], &anchor ); + spin_unlock_bh(&pPeerInfo->ibssStaInfo[STAId].wmm_tx_queue[ac].lock); + + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: AC %d has packets pending", __func__, ac); + + if(VOS_STATUS_SUCCESS == status) + { + //If success then we got a valid packet from some AC + pktNode = list_entry(anchor, skb_list_node_t, anchor); + skb = pktNode->skb; + } + else + { + ++pAdapter->hdd_stats.hddTxRxStats.txFetchDequeueError; + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Error in de-queuing skb from Tx queue status = %d", + __func__, status ); + vos_pkt_return_packet(pVosPacket); + return VOS_STATUS_E_FAILURE; + } + + //Attach skb to VOS packet. + status = vos_pkt_set_os_packet( pVosPacket, skb ); + if (status != VOS_STATUS_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Error attaching skb", __func__); + vos_pkt_return_packet(pVosPacket); + ++pAdapter->stats.tx_dropped; + ++pAdapter->hdd_stats.hddTxRxStats.txFetchDequeueError; + kfree_skb(skb); + return VOS_STATUS_E_FAILURE; + } + + //Return VOS packet to TL; + *ppVosPacket = pVosPacket; + + //Fill out the meta information needed by TL + vos_pkt_get_timestamp( pVosPacket, ×tamp ); + pPktMetaInfo->usTimeStamp = (v_U16_t)timestamp; + if ( 1 < size ) + { + pPktMetaInfo->bMorePackets = 1; //HDD has more packets to send + } + else + { + pPktMetaInfo->bMorePackets = 0; + } + + if(pAdapter->sessionCtx.station.conn_info.uIsAuthenticated == VOS_TRUE) + pPktMetaInfo->ucIsEapol = 0; + else + pPktMetaInfo->ucIsEapol = hdd_IsEAPOLPacket( pVosPacket ) ? 1 : 0; + + if ((NULL != pHddCtx) && + (pHddCtx->cfg_ini->gEnableDebugLog)) + { + proto_type = vos_pkt_get_proto_type(skb, + pHddCtx->cfg_ini->gEnableDebugLog); + if (VOS_PKT_PROTO_TYPE_EAPOL & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "IBSS STA TX EAPOL"); + } + else if (VOS_PKT_PROTO_TYPE_DHCP & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "IBSS STA TX DHCP"); + } + else if (VOS_PKT_PROTO_TYPE_ARP & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "IBSS STA TX ARP"); + } + } + + vos_pkt_get_packet_length( pVosPacket,&packet_size ); + if ( HDD_ETHERTYPE_ARP_SIZE == packet_size ) + pPktMetaInfo->ucIsArp = hdd_IsARP( pVosPacket ) ? 1 : 0; + + pPktMetaInfo->ucUP = pktNode->userPriority; + pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; + pPktMetaInfo->ucType = 0; + + //Extract the destination address from ethernet frame + pDestMacAddress = (v_MACADDR_t*)skb->data; + + // we need 802.3 to 802.11 frame translation + // (note that Bcast/Mcast will be translated in SW, unicast in HW) + pPktMetaInfo->ucDisableFrmXtl = 0; + pPktMetaInfo->ucBcast = vos_is_macaddr_broadcast( pDestMacAddress ) ? 1 : 0; + pPktMetaInfo->ucMcast = vos_is_macaddr_group( pDestMacAddress ) ? 1 : 0; + + if ( (pPeerInfo->ibssStaInfo[STAId].txSuspended[ac]) && + (size <= ((pAdapter->aTxQueueLimit[ac]*3)/4) )) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: TX queue re-enabled", __func__); + pPeerInfo->ibssStaInfo[STAId].txSuspended[ac] = VOS_FALSE; + netif_wake_subqueue(pAdapter->dev, skb_get_queue_mapping(skb)); + } + + // We're giving the packet to TL so consider it transmitted from + // a statistics perspective. We account for it here instead of + // when the packet is returned for two reasons. First, TL will + // manipulate the skb to the point where the len field is not + // accurate, leading to inaccurate byte counts if we account for + // it later. Second, TL does not provide any feedback as to + // whether or not the packet was successfully sent over the air, + // so the packet counts will be the same regardless of where we + // account for them + pAdapter->stats.tx_bytes += skb->len; + ++pAdapter->stats.tx_packets; + ++pAdapter->hdd_stats.hddTxRxStats.txFetchDequeued; + ++pAdapter->hdd_stats.hddTxRxStats.txFetchDequeuedAC[ac]; + pAdapter->hdd_stats.hddTxRxStats.continuousTxTimeoutCount = 0; + + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "%s: Valid VOS PKT returned to TL", __func__); + + return status; +} /**============================================================================ @brief hdd_tx_fetch_packet_cbk() - Callback function invoked by TL to @@ -1435,6 +1917,7 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, v_U16_t packet_size; tANI_U8 acAdmitted, i; v_U8_t proto_type = 0; + WLANTL_ACEnumType actualAC; //Sanity check on inputs if ( ( NULL == vosContext ) || @@ -1459,7 +1942,7 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("pAdapter is NULL %u"), *pStaId); + FL("invalid adapter:%pK for staId:%u"), pAdapter, *pStaId); VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; } @@ -1469,10 +1952,10 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, *ppVosPacket = NULL; //Make sure the AC being asked for is sane - if( ac >= WLANTL_MAX_AC || ac < 0) + if (ac > WLANTL_AC_HIGH_PRIO || ac < 0) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Invalid AC %d passed by TL", __func__, ac); + "%s: Invalid QId %d passed by TL", __func__, ac); return VOS_STATUS_E_FAILURE; } @@ -1483,23 +1966,6 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, "%s: AC %d passed by TL", __func__, ac); #endif // HDD_WMM_DEBUG - // We find an AC with packets - // or we determine we have no more packets to send - // HDD is not allowed to change AC. - - // has this AC been admitted? or - // To allow EAPOL packets when not authenticated - if (unlikely((0==pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed) && - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.uIsAuthenticated)) - { - ++pAdapter->hdd_stats.hddTxRxStats.txFetchEmpty; -#ifdef HDD_WMM_DEBUG - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, - "%s: no packets pending", __func__); -#endif // HDD_WMM_DEBUG - return VOS_STATUS_E_FAILURE; - } - // do we have any packets pending in this AC? hdd_list_size( &pAdapter->wmm_tx_queue[ac], &size ); if( size > 0 ) @@ -1520,6 +1986,30 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, return VOS_STATUS_E_FAILURE; } + // Note here that we are not checking "wmmAcAccessAllowed" for packets + // in new queue since there is no one AC associated to the new queue. + // Since there will be either eapol or dhcp pkts in new queue overlooking + // this should be okay from implicit QoS perspective. + if (ac != WLANTL_AC_HIGH_PRIO) + { + // We find an AC with packets + // or we determine we have no more packets to send + // HDD is not allowed to change AC. + + // has this AC been admitted? or + // To allow EAPOL packets when not authenticated + if (unlikely((0==pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed) && + (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.uIsAuthenticated)) + { + ++pAdapter->hdd_stats.hddTxRxStats.txFetchEmpty; +#ifdef HDD_WMM_DEBUG + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, + "%s: no packets pending", __func__); +#endif // HDD_WMM_DEBUG + return VOS_STATUS_E_FAILURE; + } + } + //Get the vos packet. I don't want to dequeue and enqueue again if we are out of VOS resources //This simplifies the locking and unlocking of Tx queue status = vos_pkt_wrap_data_packet( &pVosPacket, @@ -1548,6 +2038,14 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, //If success then we got a valid packet from some AC pktNode = list_entry(anchor, skb_list_node_t, anchor); skb = pktNode->skb; + actualAC = hddWmmUpToAcMap[pktNode->userPriority]; + if (actualAC >= WLANTL_MAX_AC) + { + /* To fix klocwork */ + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, + "%s: Invalid AC for packet:%d", __func__, actualAC); + actualAC = WLANTL_AC_BE; + } } else { @@ -1557,7 +2055,6 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, vos_pkt_return_packet(pVosPacket); return VOS_STATUS_E_FAILURE; } - //Attach skb to VOS packet. status = vos_pkt_set_os_packet( pVosPacket, skb ); if (status != VOS_STATUS_SUCCESS) @@ -1581,15 +2078,9 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, } #ifdef WLAN_FEATURE_LINK_LAYER_STATS + if (vos_is_macaddr_multicast((v_MACADDR_t*)skb->data)) { - v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; - /* vos_is_macaddr_group expects data in v_MACADDR_t format - */ - if (vos_is_macaddr_group(pDestMacAddress)) - { - pAdapter->hdd_stats.hddTxRxStats.txMcast[ac]++; - } - + pAdapter->hdd_stats.hddTxRxStats.txMcast[actualAC]++; } #endif @@ -1629,23 +2120,31 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, if(pAdapter->sessionCtx.station.conn_info.uIsAuthenticated == VOS_TRUE) pPktMetaInfo->ucIsEapol = 0; - else + else pPktMetaInfo->ucIsEapol = hdd_IsEAPOLPacket( pVosPacket ) ? 1 : 0; - if (pHddCtx->cfg_ini->gEnableDebugLog) + if (pPktMetaInfo->ucIsEapol) + wlan_hdd_log_eapol(skb, WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED); + if ((NULL != pHddCtx) && + (pHddCtx->cfg_ini->gEnableDebugLog)) { proto_type = vos_pkt_get_proto_type(skb, pHddCtx->cfg_ini->gEnableDebugLog); if (VOS_PKT_PROTO_TYPE_EAPOL & proto_type) { - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "STA TX EAPOL"); } else if (VOS_PKT_PROTO_TYPE_DHCP & proto_type) { - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "STA TX DHCP"); } + else if (VOS_PKT_PROTO_TYPE_ARP & proto_type) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "STA TX ARP"); + } } vos_pkt_get_packet_length( pVosPacket,&packet_size ); @@ -1654,57 +2153,53 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, #ifdef FEATURE_WLAN_WAPI // Override usIsEapol value when its zero for WAPI case - pPktMetaInfo->ucIsWai = hdd_IsWAIPacket( pVosPacket ) ? 1 : 0; + pPktMetaInfo->ucIsWai = hdd_IsWAIPacket( pVosPacket ) ? 1 : 0; #endif /* FEATURE_WLAN_WAPI */ - if ((HDD_WMM_USER_MODE_NO_QOS == pHddCtx->cfg_ini->WmmMode) || - (!pAdapter->hddWmmStatus.wmmQap)) + /* 1. Check if ACM is set for this AC + * 2. If set, check if this AC had already admitted + * 3. If not already admitted, downgrade the UP to next best UP + * 4. Allow only when medium time is non zero when Addts accepted + * else downgrade traffic. we opted downgrading over Delts when + * medium time is zero because while doing downgradig driver is not + * clearing the wmm context so consider in subsequent roaming + * if AP (new or same AP) accept the Addts with valid medium time + * no application support is required where if we have opted + * delts Applications have to again do Addts or STA will never + * go for Addts. + */ + pPktMetaInfo->ac = actualAC; + if(!pAdapter->hddWmmStatus.wmmAcStatus[actualAC].wmmAcAccessRequired || + (pAdapter->hddWmmStatus.wmmAcStatus[actualAC].wmmAcTspecValid && + pAdapter->hddWmmStatus.wmmAcStatus[actualAC].wmmAcTspecInfo.medium_time)) { - // either we don't want QoS or the AP doesn't support QoS - pPktMetaInfo->ucUP = 0; - pPktMetaInfo->ucTID = 0; + pPktMetaInfo->ucUP = pktNode->userPriority; + pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; } else { - /* 1. Check if ACM is set for this AC - * 2. If set, check if this AC had already admitted - * 3. If not already admitted, downgrade the UP to next best UP - * 4. Allow only when medium time is non zero when Addts accepted else downgrade traffic. - we opted downgrading over Delts when medium time is zero because while doing downgradig - driver is not clearing the wmm context so consider in subsequent roaming if AP (new or - same AP) accept the Addts with valid medium time no application support is required - where if we have opted delts Applications have to again do Addts or STA will never - go for Addts.*/ - - if(!pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessRequired || - (pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcTspecValid && - pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcTspecInfo.medium_time)) - { - pPktMetaInfo->ucUP = pktNode->userPriority; - pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; - } - else + //Downgrade the UP + acAdmitted = pAdapter->hddWmmStatus.wmmAcStatus[actualAC].wmmAcTspecValid; + newAc = WLANTL_AC_BK; + for (i=actualAC-1; i>0; i--) { - //Downgrade the UP - acAdmitted = pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcTspecValid; - newAc = WLANTL_AC_BK; - for (i=ac-1; i>0; i--) - { - if (pAdapter->hddWmmStatus.wmmAcStatus[i].wmmAcAccessRequired == 0) - { - newAc = i; - break; - } - } - pPktMetaInfo->ucUP = hddWmmAcToHighestUp[newAc]; - pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_LOW,"Downgrading UP %d to UP %d ", pktNode->userPriority, pPktMetaInfo->ucUP); + if (pAdapter->hddWmmStatus.wmmAcStatus[i].wmmAcAccessRequired == 0) + { + newAc = i; + break; + } } + pPktMetaInfo->ucUP = hddWmmAcToHighestUp[newAc]; + pPktMetaInfo->ucTID = pPktMetaInfo->ucUP; + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_LOW, + "Downgrading UP %d to UP %d ", + pktNode->userPriority, pPktMetaInfo->ucUP); } -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_TL_FIRST_XMIT_TIME, NULL, 0); -#endif + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_TL_FIRST_XMIT_TIME, NULL, 0); + } pPktMetaInfo->ucType = 0; //FIXME Don't know what this is pPktMetaInfo->ucDisableFrmXtl = 0; //802.3 frame so we need to xlate @@ -1735,6 +2230,8 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, pAdapter->isTxSuspended[ac] = VOS_FALSE; netif_tx_wake_queue(netdev_get_tx_queue(pAdapter->dev, skb_get_queue_mapping(skb) )); + MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_WAKE_NETDEV, + pAdapter->sessionId, ac)); } @@ -1776,6 +2273,7 @@ VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, { /* During TX open duration, TX frame count is larger than threshold * Block TX during Sleep time */ + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_stop_all_queues(pAdapter->dev); pHddCtx->tmInfo.qBlocked = VOS_TRUE; pHddCtx->tmInfo.lastblockTs = timestamp; @@ -1830,10 +2328,10 @@ VOS_STATUS hdd_tx_low_resource_cbk( vos_pkt_t *pVosPacket, v_SIZE_t size = 0; hdd_adapter_t* pAdapter = (hdd_adapter_t *)userData; - if (NULL == pAdapter) + if (NULL == pAdapter || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: pAdapter is Null", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Invalid adapter %pK"), pAdapter); return VOS_STATUS_E_FAILURE; } @@ -1865,6 +2363,166 @@ VOS_STATUS hdd_tx_low_resource_cbk( vos_pkt_t *pVosPacket, return VOS_STATUS_SUCCESS; } +static void hdd_mon_add_rx_radiotap_hdr (struct sk_buff *skb, + int rtap_len, v_PVOID_t pRxPacket, hdd_mon_ctx_t *pMonCtx) +{ + u8 rtap_temp[20] = {0}; + struct ieee80211_radiotap_header *rthdr; + unsigned char *pos; + u16 rx_flags = 0; + u16 rateIdx; + s8 currentRSSI, currentRSSI0, currentRSSI1; + + rateIdx = WDA_GET_RX_MAC_RATE_IDX(pRxPacket); + if( rateIdx >= 210 && rateIdx <= 217) + rateIdx-=202; + if( rateIdx >= 218 && rateIdx <= 225 ) + rateIdx-=210; + + if(rateIdx >= (sizeof(gRatefromIdx)/ sizeof(int))) { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: invalid rateIdx %d make it 0", __func__, rateIdx); + rateIdx = 0; + } + currentRSSI0 = WDA_GETRSSI0(pRxPacket) - 100; + currentRSSI1 = WDA_GETRSSI1(pRxPacket) - 100; + currentRSSI = (currentRSSI0 > currentRSSI1) ? currentRSSI0 : currentRSSI1; + + rthdr = (struct ieee80211_radiotap_header *)(&rtap_temp[0]); + + /* radiotap header, set always present flags */ + rthdr->it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) | + (1 << IEEE80211_RADIOTAP_CHANNEL) | + (1 << IEEE80211_RADIOTAP_RX_FLAGS)); + rthdr->it_len = cpu_to_le16(rtap_len); + + pos = (unsigned char *) (rthdr + 1); + + /* IEEE80211_RADIOTAP_FLAGS */ + *pos = 0; + pos++; + + /* IEEE80211_RADIOTAP_RATE */ + rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE); + *pos = gRatefromIdx[rateIdx]/5; + + pos++; + + /* IEEE80211_RADIOTAP_CHANNEL */ + put_unaligned_le16(pMonCtx->ChannelNo, pos); + pos += 4; + + /* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */ + *pos = currentRSSI; + rthdr->it_present |=cpu_to_le32(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL); + pos++; + + if ((pos - (u8 *)rthdr) & 1) + pos++; + put_unaligned_le16(rx_flags, pos); + pos += 2; + + memcpy(skb_push(skb, rtap_len), &rtap_temp[0], rtap_len); +} + + +VOS_STATUS hdd_rx_packet_monitor_cbk(v_VOID_t *vosContext,vos_pkt_t *pVosPacket, int conversion) +{ + struct sk_buff *skb = NULL; + VOS_STATUS status = VOS_STATUS_E_FAILURE; + hdd_adapter_t *pAdapter = NULL; + hdd_context_t *pHddCtx = NULL; + hdd_mon_ctx_t *pMonCtx = NULL; + v_PVOID_t pvBDHeader = NULL; + int rxstat; + int needed_headroom = 0; + + + //Sanity check on inputs + if ( ( NULL == vosContext ) || + ( NULL == pVosPacket ) ) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Null params being passed", __func__); + return VOS_STATUS_E_FAILURE; + } + + pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext ); + + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Failed to get pHddCtx from vosContext")); + vos_pkt_return_packet( pVosPacket ); + return VOS_STATUS_E_FAILURE; + } + + pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_MONITOR); + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) ) + { + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Invalid adapter %pK for MONITOR MODE"), pAdapter); + vos_pkt_return_packet( pVosPacket ); + return VOS_STATUS_E_FAILURE; + } + + status = WDA_DS_PeekRxPacketInfo( pVosPacket, (v_PVOID_t)&pvBDHeader, 1/*Swap BD*/ ); + if ( NULL == pvBDHeader ) + { + VOS_TRACE( VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, + "Cannot extract BD header"); + /* Drop packet */ + vos_pkt_return_packet(pVosPacket); + return VOS_STATUS_E_FAILURE; + } + + ++pAdapter->hdd_stats.hddTxRxStats.rxChains; + status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_TRUE ); + if(!VOS_IS_STATUS_SUCCESS( status )) + { + ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + "%s: Failure extracting skb from vos pkt", __func__); + vos_pkt_return_packet( pVosPacket ); + return VOS_STATUS_E_FAILURE; + } + + if(!conversion) + { + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + needed_headroom = sizeof(struct ieee80211_radiotap_header) + 10; + hdd_mon_add_rx_radiotap_hdr( skb, needed_headroom, pvBDHeader, pMonCtx ); + } + + skb_reset_mac_header( skb ); + skb->dev = pAdapter->dev; + skb->pkt_type = PACKET_OTHERHOST; + skb->protocol = htons(ETH_P_802_2); + skb->ip_summed = CHECKSUM_NONE; + ++pAdapter->hdd_stats.hddTxRxStats.rxPackets; + ++pAdapter->stats.rx_packets; + pAdapter->stats.rx_bytes += skb->len; + + rxstat = netif_rx_ni(skb); + if (NET_RX_SUCCESS == rxstat) + { + ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered; + ++pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count; + } + else + { + ++pAdapter->hdd_stats.hddTxRxStats.rxRefused; + } + + status = vos_pkt_return_packet( pVosPacket ); + if(!VOS_IS_STATUS_SUCCESS( status )) + { + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: Failure returning vos pkt", __func__); + } + pAdapter->dev->last_rx = jiffies; + +return status; +} /**============================================================================ @brief hdd_rx_packet_cbk() - Receive callback registered with TL. @@ -1912,11 +2570,10 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, } pAdapter = pHddCtx->sta_to_adapter[staId]; - if( (NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) ) + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) ) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: pAdapter is Null or adapter has invalid magic for staId %u", - __func__, staId); + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, + FL("Invalid adapter %pK for staId %u"), pAdapter, staId); return VOS_STATUS_E_FAILURE; } @@ -1940,8 +2597,7 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, } // Extract the OS packet (skb). - // Tell VOS to detach the OS packet from the VOS packet - status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_TRUE ); + status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_FALSE ); if(!VOS_IS_STATUS_SUCCESS( status )) { ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; @@ -1950,6 +2606,11 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, return VOS_STATUS_E_FAILURE; } + if (TRUE == hdd_IsEAPOLPacket( pVosPacket )) + wlan_hdd_log_eapol(skb, WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED); + + pVosPacket->pSkb = NULL; + if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, @@ -1964,58 +2625,48 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; u8 mac[6]; - wlan_hdd_tdls_extract_sa(skb, mac); + memcpy(mac, skb->data+6, 6); if (vos_is_macaddr_group((v_MACADDR_t *)mac)) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, "rx broadcast packet, not adding to peer list"); - } else if (memcmp(pHddStaCtx->conn_info.bssId, - mac, 6) != 0) { - hddTdlsPeer_t *curr_peer; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx extract mac:" MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(mac) ); - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, TRUE); - if ((NULL != curr_peer) && (eTDLS_LINK_CONNECTED == curr_peer->link_status) - && (TRUE == pRxMetaInfo->isStaTdls)) - { - wlan_hdd_tdls_increment_pkt_count(pAdapter, mac, 0); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,"rssi is %d", pRxMetaInfo->rssiAvg); - wlan_hdd_tdls_set_rssi (pAdapter, mac, pRxMetaInfo->rssiAvg); - } + } else if ((memcmp(pHddStaCtx->conn_info.bssId, + mac, 6) != 0) && (pRxMetaInfo->isStaTdls)) { + wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(pAdapter, mac, + pRxMetaInfo->rssiAvg); } else { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, "rx packet sa is bssid, not adding to peer list"); } } #endif - if (pHddCtx->cfg_ini->gEnableDebugLog) { proto_type = vos_pkt_get_proto_type(skb, pHddCtx->cfg_ini->gEnableDebugLog); if (VOS_PKT_PROTO_TYPE_EAPOL & proto_type) { - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "STA RX EAPOL"); } else if (VOS_PKT_PROTO_TYPE_DHCP & proto_type) { - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "STA RX DHCP"); } - } - -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_HDD_RX_PKT_CBK_TIME, (void *)skb, 0); - //Should we check below global to avoid function call each time ?? - /* - if(gRoamDelayMetaInfo.hdd_monitor_rx) + else if (VOS_PKT_PROTO_TYPE_ARP & proto_type) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "STA RX ARP"); } - */ -#endif - if ( pHddCtx->cfg_ini->enableDhcpDebug ) + } + + if (pHddCtx->cfg_ini->gEnableRoamDelayStats) + { + vos_record_roam_event(e_HDD_RX_PKT_CBK_TIME, (void *)skb, 0); + } + if (( NULL != pHddCtx ) && + (pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_PROTO_TYPE_DHCP)) { hdd_dump_dhcp_pkt(skb, RX_PATH); } @@ -2026,10 +2677,10 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, ++pAdapter->hdd_stats.hddTxRxStats.rxPackets; ++pAdapter->stats.rx_packets; pAdapter->stats.rx_bytes += skb->len; -#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif + vos_wake_lock_timeout_release(&pHddCtx->rx_wake_lock, + HDD_WAKE_LOCK_DURATION, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); #endif rxstat = netif_rx_ni(skb); if (NET_RX_SUCCESS == rxstat) @@ -2074,14 +2725,11 @@ void hdd_tx_rx_pkt_cnt_stat_timer_handler( void *phddctx) v_U8_t staId = 0; v_U8_t fconnected = 0; - if (NULL == phddctx) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("phddctx is NULL")); - VOS_ASSERT(0); - return; - } - + ENTER(); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + { + return; + } if (!cfg_param->dynSplitscan) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, @@ -2095,7 +2743,7 @@ void hdd_tx_rx_pkt_cnt_stat_timer_handler( void *phddctx) { pAdapter = pAdapterNode->pAdapter; - if ( pAdapter ) + if ((NULL != pAdapter) && (WLAN_HDD_ADAPTER_MAGIC == pAdapter->magic)) { VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, "%s: Adapter with device mode %d exists", @@ -2193,6 +2841,106 @@ void hdd_tx_rx_pkt_cnt_stat_timer_handler( void *phddctx) SME_DISABLE_SPLIT_SCAN, SME_DISABLE_SPLIT_SCAN); } + EXIT(); return; } +#ifdef FEATURE_WLAN_DIAG_SUPPORT +/* + * wlan_hdd_get_eapol_params() - Function to extract EAPOL params + * @skb: skb data + * @eapol_params: Pointer to hold the parsed EAPOL params + * @event_type: Event type to indicate Tx/Rx + * + * This function parses the input skb data to get the EAPOL params,if the + * packet is EAPOL and store it in the pointer passed as input + * + */ +void wlan_hdd_get_eapol_params(struct sk_buff *skb, + struct vos_event_wlan_eapol *eapol_params, + uint8_t event_type) +{ + uint8_t packet_type=0; + + packet_type = (uint8_t)(*(uint8_t *) + (skb->data + HDD_EAPOL_PACKET_TYPE_OFFSET)); + + /* EAPOL msg type i.e. whether EAPOL-Start or + * EAPOL-Key etc. messages Present at 15 offset. + */ + eapol_params->eapol_packet_type = packet_type; + + /* This tells if its a M1/M2/M3/M4 packet. + * Present at 19th offset in EAPOL frame. + */ + eapol_params->eapol_key_info = (uint16_t)(*(uint16_t *) + (skb->data + HDD_EAPOL_KEY_INFO_OFFSET)); + /* This tells if EAPOL packet is in RX or TX + * direction. + */ + eapol_params->event_sub_type = event_type; + + /* This tells the rate at which EAPOL packet + * is send or received. + */ + //TODO fill data rate for rx packet. + eapol_params->eapol_rate = 0;/* As of now, zero */ + + vos_mem_copy(eapol_params->dest_addr, + (skb->data + HDD_EAPOL_DEST_MAC_OFFSET), + sizeof(eapol_params->dest_addr)); + vos_mem_copy(eapol_params->src_addr, + (skb->data + HDD_EAPOL_SRC_MAC_OFFSET), + sizeof(eapol_params->src_addr)); + return; +} +/* + * wlan_hdd_event_eapol_log() - Function to log EAPOL events + * @eapol_params: Structure containing EAPOL params + * + * This function logs the parsed EAPOL params + * + * Return: None + * + */ + +static void wlan_hdd_event_eapol_log(struct vos_event_wlan_eapol eapol_params) +{ + WLAN_VOS_DIAG_EVENT_DEF(wlan_diag_event, struct vos_event_wlan_eapol); + + wlan_diag_event.event_sub_type = eapol_params.event_sub_type; + wlan_diag_event.eapol_packet_type = eapol_params.eapol_packet_type; + wlan_diag_event.eapol_key_info = eapol_params.eapol_key_info; + wlan_diag_event.eapol_rate = eapol_params.eapol_rate; + vos_mem_copy(wlan_diag_event.dest_addr, + eapol_params.dest_addr, + sizeof (wlan_diag_event.dest_addr)); + vos_mem_copy(wlan_diag_event.src_addr, + eapol_params.src_addr, + sizeof (wlan_diag_event.src_addr)); + WLAN_VOS_DIAG_EVENT_REPORT(&wlan_diag_event, EVENT_WLAN_EAPOL); +} + +/* + * wlan_hdd_log_eapol() - Function to check and extract EAPOL params + * @skb: skb data + * @event_type: One of enum wifi_connectivity_events to indicate Tx/Rx + * + * This function parses the input skb data to get the EAPOL params,if the + * packet is EAPOL and store it in the pointer passed as input + * + * Return: None + * + */ +void wlan_hdd_log_eapol(struct sk_buff *skb, + uint8_t event_type) +{ + struct vos_event_wlan_eapol eapol_params; + + wlan_hdd_get_eapol_params(skb, &eapol_params, event_type); + wlan_hdd_event_eapol_log(eapol_params); + VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, + "Eapol subtype is %d and key info is %d\n", + eapol_params.event_sub_type,eapol_params.eapol_key_info); +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c index b2e9a2b54232..4864dfef5d53 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -103,10 +103,9 @@ #include "vos_trace.h" #include "wlan_hdd_assoc.h" -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif #include "sapInternal.h" +#include "wlan_hdd_request_manager.h" #ifdef CONFIG_HAS_EARLYSUSPEND extern void hdd_suspend_wlan(struct early_suspend *wlan_suspend); @@ -168,7 +167,13 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #endif #define WE_SET_SCAN_BAND_PREFERENCE 17 #define WE_SET_MIRACAST_VENDOR_CONFIG 18 - +#define WE_GET_FRAME_LOG 19 +#ifdef FEATURE_WLAN_TDLS +#define WE_SET_TDLS_2040_BSS_COEXISTENCE 20 +#endif +#define WE_SET_RTS_CTS_HTVHT 21 +#define WE_SET_MONITOR_STATE 22 +#define WE_SET_PROXIMITY_ENABLE 23 /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) @@ -235,11 +240,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_SET_REASSOC_TRIGGER 8 #define WE_DISPLAY_DATAPATH_SNAP_SHOT 9 #define WE_STOP_OBSS_SCAN 11 - -#ifdef DEBUG_ROAM_DELAY #define WE_DUMP_ROAM_TIMER_LOG 12 #define WE_RESET_ROAM_TIMER_LOG 13 -#endif +#define WE_GET_FW_LOGS 14 /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) @@ -256,6 +259,8 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_MTRACE_DUMP_CMD 8 #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 +#define WE_CONFIGURE_MONITOR_MODE 10 +#define WE_SET_MONITOR_MODE_FILTER 11 #ifdef FEATURE_WLAN_TDLS #undef MAX_VAR_ARGS @@ -363,12 +368,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WLAN_ADAPTER 0 #define P2P_ADAPTER 1 -#define HDD_IOCTL_RATELIMIT_INTERVAL 20*HZ -#define HDD_IOCTL_RATELIMIT_BURST 1 - -static DEFINE_RATELIMIT_STATE(hdd_ioctl_timeout_rs, \ - HDD_IOCTL_RATELIMIT_INTERVAL, \ - HDD_IOCTL_RATELIMIT_BURST); +#define TX_PWR_MIN 6 +#define TX_PWR_MAX 22 +#define TX_PWR_DEF 50 /* * When supplicant sends SETBAND ioctl it queries for channels from @@ -507,6 +509,8 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, VOS_STATUS status; tSirVersionString wcnss_SW_version; tSirVersionString wcnss_HW_version; + tSirVersionString iris_name; + char *pIRISversion; char *pSWversion; char *pHWversion; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -533,27 +537,51 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, pHWversion = "Unknown"; } + status = wcnss_get_iris_name(iris_name); + + if (!status) { + pIRISversion = iris_name; + } else { + pIRISversion = "Unknown"; + } + wrqu->data.length = scnprintf(extra, WE_MAX_STR_LEN, - "Host SW:%s, FW:%s, HW:%s", + "Host SW:%s, FW:%s, HW:%s, IRIS_HW:%s", QWLAN_VERSIONSTR, pSWversion, - pHWversion); + pHWversion, pIRISversion); return; } int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu) { - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - v_U32_t threshold = 0,status = 0; + tHalHandle hHal; + hdd_context_t *pHddCtx; + v_U32_t threshold = 0; + int ret = 0; ENTER(); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - "%s:LOGP in Progress. Ignore!!!",__func__); - return status; + return ret; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } if ( eHAL_STATUS_SUCCESS != @@ -575,16 +603,32 @@ int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu) int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu) { - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - v_U32_t threshold = 0,status = 0; + tHalHandle hHal; + hdd_context_t *pHddCtx; + v_U32_t threshold = 0, status = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:LOGP in Progress. Ignore!!!",__func__); - return status; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + return status; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } if ( ccmCfgGetInt(hHal, WNI_CFG_FRAGMENTATION_THRESHOLD, &threshold) @@ -685,129 +729,77 @@ hdd_IsAuthTypeRSN( tHalHandle halHandle, eCsrAuthType authType) return rsnType; } -static void hdd_GetRssiCB( v_S7_t rssi, tANI_U32 staId, void *pContext ) -{ - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - - if (ioctl_debug) - { - pr_info("%s: rssi [%d] STA [%d] pContext [%p]\n", - __func__, (int)rssi, (int)staId, pContext); - } - - if (NULL == pContext) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pContext [%p]", - __func__, pContext); - return; - } - - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); - - if ((NULL == pAdapter) || (RSSI_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - if (ioctl_debug) - { - pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n", - __func__, pAdapter, pStatsContext->magic); - } - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* copy over the rssi */ - pAdapter->rssi = rssi; - - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); -} +struct snr_priv { + int8_t snr; +}; -static void hdd_GetSnrCB(tANI_S8 snr, tANI_U32 staId, void *pContext) +/** + * hdd_get_snr_cb() - "Get SNR" callback function + * @snr: Current SNR of the station + * @sta_id: ID of the station + * @context: opaque context originally passed to SME. HDD always passes + * a cookie for the request context + * + * Return: None + */ +static void hdd_get_snr_cb(tANI_S8 snr, tANI_U32 staId, void *context) { - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - - if (ioctl_debug) - { - pr_info("%s: snr [%d] STA [%d] pContext [%p]\n", - __func__, (int)snr, (int)staId, pContext); - } - - if (NULL == pContext) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pContext [%p]", - __func__, pContext); - return; - } + struct hdd_request *request; + struct snr_priv *priv; - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); + /* propagate response back to requesting thread */ + priv = hdd_request_priv(request); + priv->snr = snr; + hdd_request_complete(request); + hdd_request_put(request); +} - if ((NULL == pAdapter) || (SNR_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - if (ioctl_debug) - { - pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n", - __func__, pAdapter, pStatsContext->magic); - } - return; - } +struct rssi_priv { + v_S7_t rssi; +}; - /* context is valid so caller is still waiting */ +static void hdd_get_rssi_cb( v_S7_t rssi, tANI_U32 staId, void *context ) +{ + struct hdd_request *request; + struct rssi_priv *priv; - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; + if (ioctl_debug) { + pr_info("%s: rssi [%d] STA [%d] context [%pK]\n", + __func__, (int)rssi, (int)staId, context); + } - /* copy over the snr */ - pAdapter->snr = snr; + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* notify the caller */ - complete(&pStatsContext->completion); + priv = hdd_request_priv(request); + priv->rssi = rssi; - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } VOS_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) { - struct statsContext context; hdd_context_t *pHddCtx; hdd_station_ctx_t *pHddStaCtx; eHalStatus hstatus; - long lrc; + int ret; + void *cookie; + struct hdd_request *request; + struct rssi_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { @@ -826,14 +818,33 @@ VOS_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) pHddCtx = WLAN_HDD_GET_CTX(pAdapter); pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = RSSI_CONTEXT_MAGIC; + if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s:Not associated, rssi on Disconnect : %d", + __func__, pAdapter->rssi_on_disconnect); + *rssi_value = pAdapter->rssi_on_disconnect; + return VOS_STATUS_SUCCESS; + } + + if (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Roaming in progress, hence return last cached RSSI", __func__); + *rssi_value = pAdapter->rssi; + return VOS_STATUS_SUCCESS; + } + + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); - hstatus = sme_GetRssi(pHddCtx->hHal, hdd_GetRssiCB, + hstatus = sme_GetRssi(pHddCtx->hHal, hdd_get_rssi_cb, pHddStaCtx->conn_info.staId[ 0 ], pHddStaCtx->conn_info.bssId, - &context, pHddCtx->pvosContext); + cookie, pHddCtx->pvosContext); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Unable to retrieve RSSI", @@ -843,44 +854,113 @@ VOS_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) else { /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: SME %s while retrieving RSSI", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("SME timeout while retrieving RSSI")); /* we'll now returned a cached value below */ } + else + { + priv = hdd_request_priv(request); + pAdapter->rssi = priv->rssi; + /* + * copy over the rssi.FW will return RSSI as -100 if + * there are no samples to calculate the averag RSSI + */ + if (priv->rssi != -100) + pAdapter->rssi = priv->rssi; + + if (pAdapter->rssi > 0) + pAdapter->rssi = 0; + } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); - *rssi_value = pAdapter->rssi; + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); + + return VOS_STATUS_SUCCESS; +} +/**--------------------------------------------------------------------------- + + \brief wlan_hdd_get_frame_logs() - + + This function use to get Frames log. + + \param - pAdapter Pointer to the adapter. + flag - Specify type of request. Clear and Send request are + supported. + + \return - none + + --------------------------------------------------------------------------*/ +VOS_STATUS wlan_hdd_get_frame_logs(hdd_adapter_t *pAdapter, v_U8_t flag) +{ + hdd_context_t *pHddCtx; + eHalStatus hstatus; + + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_WARN, + "%s: Invalid context, pAdapter", __func__); + return VOS_STATUS_E_FAULT; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + if (!pHddCtx->mgmt_frame_logging) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Frame Logging not init!", __func__); + return VOS_STATUS_E_AGAIN; + } + + if ((flag != WLAN_HDD_GET_FRAME_LOG_CMD_CLEAR) && + (flag != WLAN_HDD_GET_FRAME_LOG_CMD_SEND_AND_CLEAR) && + (flag != WLAN_HDD_GET_FRAME_LOG_CMD_BMU_TRACING)) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Incorrect getFrame params!", __func__); + return VOS_STATUS_E_INVAL; + } + + if ((flag == WLAN_HDD_GET_FRAME_LOG_CMD_BMU_TRACING) && + (!pHddCtx->cfg_ini->enableBMUHWtracing)) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: BMUHW Tracing not enabled!", __func__); + return VOS_STATUS_E_INVAL; + } + + hstatus = sme_GetFramesLog(pHddCtx->hHal, flag); + if (eHAL_STATUS_SUCCESS != hstatus) + { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Unable to get Frame Logs", __func__); + return VOS_STATUS_E_FAILURE; + } + return VOS_STATUS_SUCCESS; } + VOS_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, v_S7_t *snr) { - struct statsContext context; hdd_context_t *pHddCtx; hdd_station_ctx_t *pHddStaCtx; eHalStatus hstatus; - long lrc; - int valid; + int ret; + void *cookie; + struct hdd_request *request; + struct snr_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; + + ENTER(); if (NULL == pAdapter) { @@ -891,10 +971,9 @@ VOS_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, v_S7_t *snr) pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - valid = wlan_hdd_validate_context(pHddCtx); - if (0 != valid) + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); return VOS_STATUS_E_FAULT; } @@ -905,14 +984,17 @@ VOS_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, v_S7_t *snr) return VOS_STATUS_E_FAULT; } - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = SNR_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_FAULT; + } + cookie = hdd_request_cookie(request); - hstatus = sme_GetSnr(pHddCtx->hHal, hdd_GetSnrCB, + hstatus = sme_GetSnr(pHddCtx->hHal, hdd_get_snr_cb, pHddStaCtx->conn_info.staId[ 0 ], pHddStaCtx->conn_info.bssId, - &context); + cookie); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Unable to retrieve RSSI", @@ -922,103 +1004,46 @@ VOS_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, v_S7_t *snr) else { /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) - { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: SME %s while retrieving SNR", - __func__, (0 == lrc) ? "timeout" : "interrupt"); - /* we'll now returned a cached value below */ - } + ret = hdd_request_wait_for_response(request); + if (ret) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("SME timed out while retrieving SNR")); + /* we'll now returned a cached value below */ + } else { + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + pAdapter->snr = priv->snr; + } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. + */ + hdd_request_put(request); *snr = pAdapter->snr; + EXIT(); return VOS_STATUS_SUCCESS; } -#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) - -static void hdd_GetRoamRssiCB( v_S7_t rssi, tANI_U32 staId, void *pContext ) -{ - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - if (ioctl_debug) - { - pr_info("%s: rssi [%d] STA [%d] pContext [%p]\n", - __func__, (int)rssi, (int)staId, pContext); - } - - if (NULL == pContext) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pContext [%p]", - __func__, pContext); - return; - } - - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); - - if ((NULL == pAdapter) || (RSSI_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - if (ioctl_debug) - { - pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n", - __func__, pAdapter, pStatsContext->magic); - } - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* copy over the rssi */ - pAdapter->rssi = rssi; - - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); -} - +#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) VOS_STATUS wlan_hdd_get_roam_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) { - struct statsContext context; hdd_context_t *pHddCtx = NULL; hdd_station_ctx_t *pHddStaCtx = NULL; eHalStatus hstatus; - long lrc; + int ret; + void *cookie; + struct hdd_request *request; + struct rssi_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { @@ -1053,14 +1078,17 @@ VOS_STATUS wlan_hdd_get_roam_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) return VOS_STATUS_SUCCESS; } - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = RSSI_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); - hstatus = sme_GetRoamRssi(pHddCtx->hHal, hdd_GetRoamRssiCB, + hstatus = sme_GetRoamRssi(pHddCtx->hHal, hdd_get_rssi_cb, pHddStaCtx->conn_info.staId[ 0 ], pHddStaCtx->conn_info.bssId, - &context, pHddCtx->pvosContext); + cookie, pHddCtx->pvosContext); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Unable to retrieve RSSI", @@ -1069,31 +1097,27 @@ VOS_STATUS wlan_hdd_get_roam_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) } else { + ret = hdd_request_wait_for_response(request); + if(ret) /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: SME %s while retrieving RSSI", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + hddLog(VOS_TRACE_LEVEL_ERROR, + FL(" SME timeout while retrieving RSSI")); /* we'll now returned a cached value below */ } + else + { + priv = hdd_request_priv(request); + pAdapter->rssi = priv->rssi; + } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); *rssi_value = pAdapter->rssi; @@ -1219,7 +1243,7 @@ void hdd_clearRoamProfileIe( hdd_adapter_t *pAdapter) pWextState->roamProfile.bWPSAssociation = VOS_FALSE; pWextState->roamProfile.bOSENAssociation = VOS_FALSE; pWextState->roamProfile.nAddIEScanLength = 0; - memset(pWextState->roamProfile.addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH+2); + memset(pWextState->roamProfile.addIEScan, 0 , SIR_MAC_MAX_ADD_IE_LENGTH+2); pWextState->roamProfile.pAddIEAssoc = (tANI_U8 *)NULL; pWextState->roamProfile.nAddIEAssocLength = 0; @@ -1258,10 +1282,10 @@ void wlan_hdd_ula_done_cb(v_VOID_t *callbackContext) { hdd_adapter_t *pAdapter = (hdd_adapter_t*)callbackContext; - if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) + if ( (pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Invalid pAdapter magic", __func__); + "%s: Invalid pAdapter magic/ pAdapter is NULL", __func__); } else { @@ -1330,7 +1354,7 @@ v_U8_t* wlan_hdd_get_vendor_oui_ie_ptr(v_U8_t *oui, v_U8_t oui_size, v_U8_t *ie, eid,elem_len,left); return NULL; } - if (elem_id == eid) + if ((elem_id == eid) && (elem_len >= oui_size)) { if(memcmp( &ptr[2], oui, oui_size)==0) return ptr; @@ -1342,196 +1366,82 @@ v_U8_t* wlan_hdd_get_vendor_oui_ie_ptr(v_U8_t *oui, v_U8_t oui_size, v_U8_t *ie, return NULL; } -static int iw_set_commit(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - hddLog( LOG1, "In %s", __func__); - /* Do nothing for now */ - return 0; -} - -static int iw_get_name(struct net_device *dev, - struct iw_request_info *info, - char *wrqu, char *extra) -{ - - ENTER(); - strlcpy(wrqu, "Qcom:802.11n", IFNAMSIZ); - EXIT(); - return 0; -} - -static int __iw_set_mode(struct net_device *dev, - struct iw_request_info *info, +static int __iw_set_commit(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - tCsrRoamProfile *pRoamProfile; - eCsrRoamBssType LastBSSType; - eMib_dot11DesiredBssType connectedBssType; - hdd_config_t *pConfig; - struct wireless_dev *wdev; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter", __func__); - return 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 0; - } - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - if (pWextState == NULL) - { - hddLog(LOGE, "%s ERROR: Data Storage Corruption", __func__); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pAdapter is NULL\n", __func__); return -EINVAL; } - - wdev = dev->ieee80211_ptr; - pRoamProfile = &pWextState->roamProfile; - LastBSSType = pRoamProfile->BSSType; - - hddLog(LOG1, "%s Old Bss type = %d", __func__, LastBSSType); - - switch (wrqu->mode) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - case IW_MODE_ADHOC: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_ADHOC", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_START_IBSS; - // Set the phymode correctly for IBSS. - pConfig = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini; - pWextState->roamProfile.phyMode = hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode); - pAdapter->device_mode = WLAN_HDD_IBSS; - wdev->iftype = NL80211_IFTYPE_ADHOC; - break; - case IW_MODE_INFRA: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_INFRA", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; - wdev->iftype = NL80211_IFTYPE_STATION; - break; - case IW_MODE_AUTO: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_AUTO", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_ANY; - break; - default: - hddLog(LOGE, "%s Unknown AP Mode value %d ", __func__, wrqu->mode); - return -EOPNOTSUPP; + return ret; } - if ( LastBSSType != pRoamProfile->BSSType ) - { - //the BSS mode changed - // We need to issue disconnect if connected or in IBSS disconnect state - if ( hdd_connGetConnectedBssType( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), &connectedBssType ) || - ( eCSR_BSS_TYPE_START_IBSS == LastBSSType ) ) - { - VOS_STATUS vosStatus; - // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); - vosStatus = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, - eCSR_DISCONNECT_REASON_IBSS_LEAVE ); - if(VOS_STATUS_SUCCESS == vosStatus) - { - long ret; - ret = wait_for_completion_interruptible_timeout( - &pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - if (ret <= 0) - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("failed wait on disconnect_comp_var %ld"), ret); - } - } - } + /* Do nothing for now */ EXIT(); - return 0; + return ret; } -static int iw_set_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +static int iw_set_commit(struct net_device *dev, struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; vos_ssr_protect(__func__); - ret = __iw_set_mode(dev, info, wrqu, extra); + ret = __iw_set_commit(dev, info, wrqu, extra); vos_ssr_unprotect(__func__); return ret; } -static int __iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) +static int __iw_get_name(struct net_device *dev, + struct iw_request_info *info, + char *wrqu, char *extra) { + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - - hddLog(LOG1, "In %s", __func__); - + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter", __func__); - return 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 0; - } - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - if (pWextState == NULL) - { - hddLog(LOGE, "%s ERROR: Data Storage Corruption", __func__); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pAdapter is NULL\n", __func__); return -EINVAL; } - - switch (pWextState->roamProfile.BSSType) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - case eCSR_BSS_TYPE_INFRASTRUCTURE: - hddLog(LOG1, "%s returns IW_MODE_INFRA", __func__); - wrqu->mode = IW_MODE_INFRA; - break; - case eCSR_BSS_TYPE_IBSS: - case eCSR_BSS_TYPE_START_IBSS: - hddLog(LOG1, "%s returns IW_MODE_ADHOC", __func__); - wrqu->mode = IW_MODE_ADHOC; - break; - case eCSR_BSS_TYPE_ANY: - hddLog(LOG1, "%s returns IW_MODE_AUTO", __func__); - wrqu->mode = IW_MODE_AUTO; - break; - default: - hddLog(LOG1, "%s returns APMODE_UNKNOWN", __func__); - break; + return ret; } - - return 0; + strlcpy(wrqu, "Qcom:802.11n", IFNAMSIZ); + EXIT(); + return ret; } -static int iw_get_mode(struct net_device *dev, +static int iw_get_name(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) + char *wrqu, char *extra) { int ret; vos_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); + ret = __iw_get_name(dev, info, wrqu, extra); vos_ssr_unprotect(__func__); return ret; @@ -1547,18 +1457,52 @@ static int __iw_set_freq(struct net_device *dev, v_U32_t status = 0; hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + tHalHandle hHal; + hdd_station_ctx_t *pHddStaCtx; tCsrRoamProfile * pRoamProfile; + ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s:Invalid Adapter",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { return status; } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s:STA context is NULL",__func__); + return -EINVAL; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } pRoamProfile = &pWextState->roamProfile; @@ -1655,22 +1599,50 @@ static int __iw_get_freq(struct net_device *dev, struct iw_freq *fwrq, char *extra) { v_U32_t status = FALSE, channel = 0, freq = 0; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; tHalHandle hHal; hdd_wext_state_t *pWextState; tCsrRoamProfile * pRoamProfile; - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return status; + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL", __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HddStaCtx is NULL", __func__); + return -EINVAL; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } pRoamProfile = &pWextState->roamProfile; if( pHddStaCtx->conn_info.connState== eConnectionState_Associated ) @@ -1702,7 +1674,9 @@ static int __iw_get_freq(struct net_device *dev, fwrq->m = 0; fwrq->e = MHZ; } - return 0; + + EXIT(); + return ret; } static int iw_get_freq(struct net_device *dev, @@ -1723,15 +1697,33 @@ static int __iw_get_tx_power(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_station_ctx_t *pHddStaCtx; + int ret = 0; + + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } - if (pHddCtx->isLogpInProgress) + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; } if(eConnectionState_Associated != pHddStaCtx->conn_info.connState) @@ -1742,6 +1734,7 @@ static int __iw_get_tx_power(struct net_device *dev, wlan_hdd_get_classAstats(pAdapter); wrqu->txpower.value = pAdapter->hdd_stats.ClassA_stat.max_pwr; + EXIT(); return 0; } @@ -1762,17 +1755,34 @@ static int __iw_set_tx_power(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; + int ret = 0; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } - ENTER(); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } if ( ccmCfgSetInt(hHal, WNI_CFG_CURRENT_TX_POWER_LEVEL, wrqu->txpower.value, ccmCfgSetCallback, eANI_BOOLEAN_TRUE) != eHAL_STATUS_SUCCESS ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -1805,20 +1815,41 @@ static int __iw_get_bitrate(struct net_device *dev, VOS_STATUS vos_status = VOS_STATUS_SUCCESS; eHalStatus status = eHAL_STATUS_SUCCESS; hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_station_ctx_t *pHddStaCtx; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return status; + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; } - if(eConnectionState_Associated != pHddStaCtx->conn_info.connState) { + if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { wrqu->bitrate.value = 0; } - else { + else + { status = sme_GetStatistics( WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_HDD, SME_SUMMARY_STATS | SME_GLOBAL_CLASSA_STATS | @@ -1838,6 +1869,12 @@ static int __iw_get_bitrate(struct net_device *dev, } pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } vos_status = vos_wait_single_event(&pWextState->vosevent, WLAN_WAIT_TIME_STATS); @@ -1878,23 +1915,50 @@ static int __iw_set_bitrate(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; hdd_wext_state_t *pWextState; - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - v_U8_t supp_rates[WNI_CFG_SUPPORTED_RATES_11A_LEN]; + hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; + v_U8_t supp_rates[WNI_CFG_SUPPORTED_RATES_11A_LEN + + WNI_CFG_SUPPORTED_RATES_11B_LEN]; v_U32_t a_len = WNI_CFG_SUPPORTED_RATES_11A_LEN; v_U32_t b_len = WNI_CFG_SUPPORTED_RATES_11B_LEN; v_U32_t i, rate; v_U32_t valid_rate = FALSE, active_phy_mode = 0; + int ret = 0; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } + + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { @@ -1919,7 +1983,7 @@ static int __iw_set_bitrate(struct net_device *dev, supp_rates, &a_len) == eHAL_STATUS_SUCCESS) && (ccmCfgGetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), WNI_CFG_SUPPORTED_RATES_11B, - supp_rates, &b_len) == eHAL_STATUS_SUCCESS)) + supp_rates + a_len, &b_len) == eHAL_STATUS_SUCCESS)) { for (i = 0; i < (b_len + a_len); ++i) { @@ -1946,6 +2010,8 @@ static int __iw_set_bitrate(struct net_device *dev, FL("failed to set ini parameter, WNI_CFG_FIXED_RATE")); return -EIO; } + + EXIT(); return 0; } @@ -1968,45 +2034,64 @@ static int __iw_set_genie(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - u_int8_t *genie = NULL; - u_int8_t *base_genie = NULL; - v_U16_t remLen; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pWextState; + u_int8_t *genie = NULL; + u_int8_t *base_genie = NULL; + v_U16_t remLen; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return 0; - } + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if (!wrqu->data.length) { - hdd_clearRoamProfileIe(pAdapter); - EXIT(); - return 0; - } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } - base_genie = mem_alloc_copy_from_user_helper(wrqu->data.pointer, - wrqu->data.length); - if (NULL == base_genie) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "mem_alloc_copy_from_user_helper fail"); - return -ENOMEM; - } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + + if (!wrqu->data.length) { + hdd_clearRoamProfileIe(pAdapter); + EXIT(); + return 0; + } + + base_genie = mem_alloc_copy_from_user_helper(wrqu->data.pointer, + wrqu->data.length); + if (NULL == base_genie) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "mem_alloc_copy_from_user_helper fail"); + return -ENOMEM; + } - genie = base_genie; + genie = base_genie; - remLen = wrqu->data.length; + remLen = wrqu->data.length; - hddLog(LOG1,"iw_set_genie ioctl IE[0x%X], LEN[%d]", genie[0], genie[1]); + hddLog(LOG1,"iw_set_genie ioctl IE[0x%X], LEN[%d]", genie[0], genie[1]); - /* clear any previous genIE before this call */ - memset( &pWextState->genIE, 0, sizeof(pWextState->genIE) ); + /* clear any previous genIE before this call */ + memset( &pWextState->genIE, 0, sizeof(pWextState->genIE) ); - while (remLen >= 2) + while (remLen >= 2) { v_U16_t eLen = 0; v_U8_t elementId; @@ -2017,13 +2102,20 @@ static int __iw_set_genie(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_INFO, "%s: IE[0x%X], LEN[%d]", __func__, elementId, eLen); + if (remLen < eLen) { + hddLog(LOGE, "Remaining len: %u less than ie len: %u", + remLen, eLen); + ret = -EINVAL; + goto exit; + } + switch ( elementId ) { case IE_EID_VENDOR: if ((IE_LEN_SIZE+IE_EID_SIZE+IE_VENDOR_OUI_SIZE) > eLen) /* should have at least OUI */ { - kfree(base_genie); - return -EINVAL; + ret = -EINVAL; + goto exit; } if (0 == memcmp(&genie[0], "\x00\x50\xf2\x04", 4)) @@ -2037,8 +2129,8 @@ static int __iw_set_genie(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate genIE. " "Need bigger buffer space"); VOS_ASSERT(0); - kfree(base_genie); - return -ENOMEM; + ret = -EINVAL; + goto exit; } // save to Additional IE ; it should be accumulated to handle WPS IE + other IE memcpy( pWextState->genIE.addIEdata + curGenIELen, genie - 2, eLen + 2); @@ -2047,6 +2139,14 @@ static int __iw_set_genie(struct net_device *dev, else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) { hddLog (VOS_TRACE_LEVEL_INFO, "%s Set WPA IE (len %d)",__func__, eLen + 2); + if ((eLen + 2) > (sizeof(pWextState->WPARSNIE))) + { + hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate genIE. " + "Need bigger buffer space"); + ret = -EINVAL; + VOS_ASSERT(0); + goto exit; + } memset( pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN ); memcpy( pWextState->WPARSNIE, genie - 2, (eLen + 2)); pWextState->roamProfile.pWPAReqIE = pWextState->WPARSNIE; @@ -2063,8 +2163,8 @@ static int __iw_set_genie(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate genIE. " "Need bigger buffer space"); VOS_ASSERT(0); - kfree(base_genie); - return -ENOMEM; + ret = -ENOMEM; + goto exit; } // save to Additional IE ; it should be accumulated to handle WPS IE + other IE memcpy( pWextState->genIE.addIEdata + curGenIELen, genie - 2, eLen + 2); @@ -2073,6 +2173,14 @@ static int __iw_set_genie(struct net_device *dev, break; case DOT11F_EID_RSN: hddLog (LOG1, "%s Set RSN IE (len %d)",__func__, eLen+2); + if ((eLen + 2) > (sizeof(pWextState->WPARSNIE))) + { + hddLog(VOS_TRACE_LEVEL_FATAL, "Cannot accommodate genIE. " + "Need bigger buffer space"); + ret = -EINVAL; + VOS_ASSERT(0); + goto exit; + } memset( pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN ); memcpy( pWextState->WPARSNIE, genie - 2, (eLen + 2)); pWextState->roamProfile.pRSNReqIE = pWextState->WPARSNIE; @@ -2081,15 +2189,19 @@ static int __iw_set_genie(struct net_device *dev, default: hddLog (LOGE, "%s Set UNKNOWN IE %X",__func__, elementId); - kfree(base_genie); - return 0; + goto exit; } - genie += eLen; remLen -= eLen; + + /* Move genie only if next element is present */ + if (remLen >= 2) + genie += eLen; } + +exit: EXIT(); kfree(base_genie); - return 0; + return ret; } static int iw_set_genie(struct net_device *dev, @@ -2112,23 +2224,44 @@ static int __iw_get_genie(struct net_device *dev, char *extra) { hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_context_t *pHddCtx; + hdd_adapter_t *pAdapter; + hdd_station_ctx_t *pHddStaCtx; eHalStatus status; v_U32_t length = DOT11F_IE_RSN_MAX_LEN; v_U8_t genIeBytes[DOT11F_IE_RSN_MAX_LEN]; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + return status; } - - - hddLog(LOG1,"getGEN_IE ioctl"); pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } if( pHddStaCtx->conn_info.connState == eConnectionState_NotConnected) { @@ -2147,16 +2280,21 @@ static int __iw_get_genie(struct net_device *dev, pAdapter->sessionId, &length, genIeBytes); - length = VOS_MIN((u_int16_t) length, DOT11F_IE_RSN_MAX_LEN); - if (wrqu->data.length < length) - { - hddLog(LOG1, "%s: failed to copy data to user buffer", __func__); + if (eHAL_STATUS_SUCCESS != status) { + hddLog(LOGE, FL("failed to get WPA-RSN IE data")); return -EFAULT; } - vos_mem_copy( extra, (v_VOID_t*)genIeBytes, length); + wrqu->data.length = length; + if (length > DOT11F_IE_RSN_MAX_LEN) { + hddLog(LOGE, + FL("invalid buffer length length:%d"), length); + return -E2BIG; + } + + vos_mem_copy( extra, (v_VOID_t*)genIeBytes, length); - hddLog(LOG1,"%s: RSN IE of %d bytes returned", __func__, wrqu->data.length ); + hddLog(LOG1, FL("RSN IE of %d bytes returned"), wrqu->data.length ); EXIT(); @@ -2182,20 +2320,37 @@ static int __iw_get_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile); - int keyId; + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_wext_state_t *pWextState; + tCsrRoamProfile *pRoamProfile; + int keyId, i, ret = 0; eCsrAuthType authType = eCSR_AUTH_TYPE_NONE; - int i; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; } + pRoamProfile = &(pWextState->roamProfile); keyId = pRoamProfile->Keys.defaultIndex; if(keyId < 0 || keyId >= MAX_WEP_KEYS) @@ -2299,17 +2454,36 @@ static int __iw_set_rts_threshold(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + tHalHandle hHal; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EAGAIN; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } + if ( wrqu->rts.value < WNI_CFG_RTS_THRESHOLD_STAMIN || wrqu->rts.value > WNI_CFG_RTS_THRESHOLD_STAMAX ) { return -EINVAL; @@ -2369,17 +2543,35 @@ static int __iw_set_frag_threshold(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + tHalHandle hHal; + int ret = 0; ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; - } + return ret; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + if ( wrqu->frag.value < WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN || wrqu->frag.value > WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX ) { return -EINVAL; @@ -2410,28 +2602,93 @@ static int iw_set_frag_threshold(struct net_device *dev, return ret; } -static int iw_get_power_mode(struct net_device *dev, +static int __iw_get_power_mode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + EXIT(); return -EOPNOTSUPP; } -static int iw_set_power_mode(struct net_device *dev, +static int iw_get_power_mode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_power_mode(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} +static int __iw_set_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + EXIT(); return -EOPNOTSUPP; } +static int iw_set_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_power_mode(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + static int __iw_get_range(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; + int ret = 0; struct iw_range *range = (struct iw_range *) extra; v_U8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN]; @@ -2445,15 +2702,28 @@ static int __iw_get_range(struct net_device *dev, ENTER(); - wrqu->data.length = sizeof(struct iw_range); - memset(range, 0, sizeof(struct iw_range)); - - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pAdapter is NULL", __func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pAdapter is NULL", __func__); + return -EINVAL; } + wrqu->data.length = sizeof(struct iw_range); + memset(range, 0, sizeof(struct iw_range)); /*Get the phy mode*/ if (ccmCfgGetInt(hHal, @@ -2590,55 +2860,6 @@ static int iw_get_range(struct net_device *dev, return ret; } -/* Callback function registered with PMC to know status of PMC request */ -static void iw_power_callback_fn (void *pContext, eHalStatus status) -{ - struct statsContext *pStatsContext; - - if (NULL == pContext) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pContext [%p]", - __func__, pContext); - return; - } - - pStatsContext = (struct statsContext *)pContext; - - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); - - if (POWER_CONTEXT_MAGIC != pStatsContext->magic) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, magic [%08x]", - __func__, pStatsContext->magic); - - if (ioctl_debug) - { - pr_info("%s: Invalid context, magic [%08x]\n", - __func__, pStatsContext->magic); - } - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); -} - /* Callback function for tx per hit */ void hdd_tx_per_hit_cb (void *pCallbackContext) { @@ -2656,72 +2877,51 @@ void hdd_tx_per_hit_cb (void *pCallbackContext) wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, tx_fail); } -void hdd_GetClassA_statisticsCB(void *pStats, void *pContext) +void hdd_get_class_a_statistics_cb(void *stats, void *context) { - struct statsContext *pStatsContext; - tCsrGlobalClassAStatsInfo *pClassAStats; - hdd_adapter_t *pAdapter; - - if (ioctl_debug) - { - pr_info("%s: pStats [%p] pContext [%p]\n", - __func__, pStats, pContext); - } - - if ((NULL == pStats) || (NULL == pContext)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pStats [%p] pContext [%p]", - __func__, pStats, pContext); - return; - } - - pClassAStats = pStats; - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); + struct hdd_request *request; + struct stats_class_a_ctx *priv; - if ((NULL == pAdapter) || (STATS_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - if (ioctl_debug) - { - pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n", - __func__, pAdapter, pStatsContext->magic); - } - return; - } + if (ioctl_debug) { + pr_info("%s: stats [%pK] context [%pK]\n", + __func__, stats, context); + } - /* context is valid so caller is still waiting */ + if (NULL == stats) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Bad param, stats [%pK]", + __func__, stats); + return; + } - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* copy over the stats. do so as a struct copy */ - pAdapter->hdd_stats.ClassA_stat = *pClassAStats; + priv = hdd_request_priv(request); - /* notify the caller */ - complete(&pStatsContext->completion); + /* copy over the stats. do so as a struct copy */ + priv->class_a_stats = *(tCsrGlobalClassAStatsInfo *)stats; - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } VOS_STATUS wlan_hdd_get_classAstats(hdd_adapter_t *pAdapter) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); eHalStatus hstatus; - long lrc; - struct statsContext context; + int ret; + void *cookie; + struct hdd_request *request; + struct stats_class_a_ctx *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; + if (NULL == pAdapter) { @@ -2734,20 +2934,22 @@ VOS_STATUS wlan_hdd_get_classAstats(hdd_adapter_t *pAdapter) return VOS_STATUS_SUCCESS; } - /* we are connected - prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); + /* query only for Class A statistics (which include link speed) */ hstatus = sme_GetStatistics( WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_HDD, SME_GLOBAL_CLASSA_STATS, - hdd_GetClassA_statisticsCB, + hdd_get_class_a_statistics_cb, 0, // not periodic FALSE, //non-cached results pHddStaCtx->conn_info.staId[0], - &context); + cookie); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -2757,104 +2959,86 @@ VOS_STATUS wlan_hdd_get_classAstats(hdd_adapter_t *pAdapter) } else { - /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (lrc <= 0) - { + /* request was sent -- wait for the response */ + ret = hdd_request_wait_for_response(request); + if (ret) + { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while retrieving Class A statistics", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + FL("SME timeout while retrieving Class A statistics")); + } + else + { + priv = hdd_request_priv(request); + pAdapter->hdd_stats.ClassA_stat = priv->class_a_stats; + } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); /* either callback updated pAdapter stats or it has cached data */ return VOS_STATUS_SUCCESS; } -static void hdd_get_station_statisticsCB(void *pStats, void *pContext) -{ - struct statsContext *pStatsContext; - tCsrSummaryStatsInfo *pSummaryStats; - tCsrGlobalClassAStatsInfo *pClassAStats; - hdd_adapter_t *pAdapter; - - if (ioctl_debug) - { - pr_info("%s: pStats [%p] pContext [%p]\n", - __func__, pStats, pContext); - } - - if ((NULL == pStats) || (NULL == pContext)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Bad param, pStats [%p] pContext [%p]", - __func__, pStats, pContext); - return; - } +struct stats_ctx { + tCsrSummaryStatsInfo summary_stats; + tCsrGlobalClassAStatsInfo class_a_stats; +}; - /* there is a race condition that exists between this callback - function and the caller since the caller could time out either - before or while this code is executing. we use a spinlock to - serialize these actions */ - spin_lock(&hdd_context_lock); +static void hdd_get_station_statistics_cb(void *stats, void *context) +{ + tCsrSummaryStatsInfo *summary_stats; + tCsrGlobalClassAStatsInfo *class_a_stats; + struct hdd_request *request; + struct stats_ctx *priv; - pSummaryStats = (tCsrSummaryStatsInfo *)pStats; - pClassAStats = (tCsrGlobalClassAStatsInfo *)( pSummaryStats + 1 ); - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - if ((NULL == pAdapter) || (STATS_CONTEXT_MAGIC != pStatsContext->magic)) - { - /* the caller presumably timed out so there is nothing we can do */ - spin_unlock(&hdd_context_lock); - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter [%p] magic [%08x]", - __func__, pAdapter, pStatsContext->magic); - if (ioctl_debug) - { - pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n", - __func__, pAdapter, pStatsContext->magic); - } - return; - } + if (ioctl_debug) { + pr_info("%s: stats [%pK] context [%pK]\n", + __func__, stats, context); + } - /* context is valid so caller is still waiting */ + if (NULL == stats) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Bad param, stats [%pK]", + __func__, stats); + return; + } - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } - /* copy over the stats. do so as a struct copy */ - pAdapter->hdd_stats.summary_stat = *pSummaryStats; - pAdapter->hdd_stats.ClassA_stat = *pClassAStats; + summary_stats = (tCsrSummaryStatsInfo *)stats; + class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); + priv = hdd_request_priv(request); - /* notify the caller */ - complete(&pStatsContext->completion); + /* copy over the stats. do so as a struct copy */ + priv->summary_stats = *summary_stats; + priv->class_a_stats = *class_a_stats; - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } VOS_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); eHalStatus hstatus; - long lrc; - struct statsContext context; + int ret; + void *cookie; + struct hdd_request *request; + struct stats_ctx *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { @@ -2862,22 +3046,23 @@ VOS_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter) return VOS_STATUS_SUCCESS; } - /* we are connected - prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); /* query only for Summary & Class A statistics */ hstatus = sme_GetStatistics(WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_HDD, SME_SUMMARY_STATS | SME_GLOBAL_CLASSA_STATS, - hdd_get_station_statisticsCB, + hdd_get_station_statistics_cb, 0, // not periodic FALSE, //non-cached results pHddStaCtx->conn_info.staId[0], - &context); + cookie); if (eHAL_STATUS_SUCCESS != hstatus) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -2888,37 +3073,31 @@ VOS_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter) else { /* request was sent -- wait for the response */ - lrc = wait_for_completion_interruptible_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while retrieving statistics", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + FL("SME timeout while retrieving statistics")); + } + else + { + priv = hdd_request_priv(request); + pAdapter->hdd_stats.summary_stat = priv->summary_stats; + pAdapter->hdd_stats.ClassA_stat = priv->class_a_stats; } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); /* either callback updated pAdapter stats or it has cached data */ return VOS_STATUS_SUCCESS; } - /* * Support for the LINKSPEED private command * Per the WiFi framework the response must be of the form @@ -2928,25 +3107,37 @@ static int iw_get_linkspeed(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); + hdd_adapter_t *pAdapter; hdd_context_t *pHddCtx; char *pLinkSpeed = (char*)extra; int len = sizeof(v_U32_t) + 1; v_U32_t link_speed; - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_station_ctx_t *pHddStaCtx; VOS_STATUS status; - int rc, valid; + int rc, valid = 0; - pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); valid = wlan_hdd_validate_context(pHddCtx); - if (0 != valid) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); return valid; } - + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { /* we are not connected so we don't have a classAstats */ @@ -2991,6 +3182,7 @@ static int iw_get_linkspeed(struct net_device *dev, return -EIO; } + EXIT(); /* a value is being successfully returned */ return rc; } @@ -3061,6 +3253,7 @@ static int iw_get_rssi(struct net_device *dev, (note that it is not NUL-terminated) */ memcpy(cmd, pHddStaCtx->conn_info.SSID.SSID.ssId, ssidlen ); + wlan_hdd_get_station_stats(pAdapter); vosStatus = wlan_hdd_get_rssi(pAdapter, &s7Rssi); if (VOS_STATUS_SUCCESS == vosStatus) @@ -3148,6 +3341,8 @@ static void parse_Bufferforpkt(tSirpkt80211 *pkt, u8 *pBuffer, u16 len) uint8 byte = 0; char *temp = pBuffer; uint16 fragNum = 0; + char *pHeader; + tSir80211Header header; macHeader = &pkt->macHeader; @@ -3182,6 +3377,17 @@ static void parse_Bufferforpkt(tSirpkt80211 *pkt, u8 *pBuffer, u16 len) } length = getByte(&temp); + if (length > sizeof(tSir80211Header)) + length = sizeof(tSir80211Header); + + pHeader = temp; + vos_mem_zero(&header, sizeof(tSir80211Header)); + for (i = 0; i < length; i++) { + *((uint8 *)&header + i) = getByte(&pHeader); + } + + print_hex_dump(KERN_INFO, "Header : ", DUMP_PREFIX_NONE, 16, 1, + (char *)&header, length, 0); byte = getByte(&temp); @@ -3269,14 +3475,14 @@ static void parse_Bufferforpkt(tSirpkt80211 *pkt, u8 *pBuffer, u16 len) macHeader->usQosCtrl += getByte(&temp) << 8; } - print_hex_dump(KERN_INFO, "Header : ", DUMP_PREFIX_NONE, 16, 1, - (char *)&pkt->macHeader, sizeof(tSir80211Header), 0); - //parse payload length = getByte(&temp); length += getByte(&temp) << 8; hddLog(VOS_TRACE_LEVEL_INFO,"Payload length : %d", length); + if (length >= WLAN_DISA_MAX_PAYLOAD_SIZE) + length = WLAN_DISA_MAX_PAYLOAD_SIZE; + pkt->data.length = length; for (i = 0; i< length; i++) { @@ -3314,11 +3520,39 @@ hdd_encrypt_msg_cb(v_VOID_t *pUserData, v_VOID_t *pEncInfoRsp) pEncryptedDataRsp->encryptedPayload.length, 0); } +/** + * iw_power_callback_func() - Callback function registered with PMC + * @context: cookie originally registered with PMC + * @status: status code indicated by PMC state machine + * + * Return: None + */ +static void iw_power_callback_func(void *context, eHalStatus status) +{ + struct hdd_request *request = hdd_request_get(context); + + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Obsolete request", __func__); + return; + } + + hdd_request_complete(request); + hdd_request_put(request); +} + VOS_STATUS wlan_hdd_enter_bmps(hdd_adapter_t *pAdapter, int mode) { - struct statsContext context; eHalStatus status; hdd_context_t *pHddCtx; + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { @@ -3334,37 +3568,53 @@ VOS_STATUS wlan_hdd_enter_bmps(hdd_adapter_t *pAdapter, int mode) return VOS_STATUS_E_FAILURE; } - init_completion(&context.completion); + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); - context.pAdapter = pAdapter; - context.magic = POWER_CONTEXT_MAGIC; if (DRIVER_POWER_MODE_ACTIVE == mode) { hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s:Wlan driver Entering " "Full Power", __func__); status = sme_RequestFullPower(WLAN_HDD_GET_HAL_CTX(pAdapter), - iw_power_callback_fn, &context, + iw_power_callback_func, cookie, eSME_FULL_PWR_NEEDED_BY_HDD); // Enter Full power command received from GUI this means we are disconnected // Set PMC remainInPowerActiveTillDHCP flag to disable auto BMPS entry by PMC sme_SetDHCPTillPowerActiveFlag(pHddCtx->hHal, TRUE); if (eHAL_STATUS_PMC_PENDING == status) { - /* request was sent -- wait for the response */ - int lrc = wait_for_completion_interruptible_timeout( - &context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_POWER)); - - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: SME %s while requesting fullpower ", - __func__, (0 == lrc) ? "timeout" : "interrupt"); + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("SME timeout while requesting fullpower")); } } } else if (DRIVER_POWER_MODE_AUTO == mode) { + /* If this is called by hdd_suspend_wlan or hdd_resume_wlan, driver + * was already in BMPS state and thus either STA or P2P-CLI is in + * associated state and authenticated, so even if STA connState is + * not associated it can be assumed that P2P-CLI is associated and + * authenticated. Thus driver can enter BMPS. And even if we try to enter + * BMPS with no adaptor in associated state, pmcRequestBmps will check + * if all condition are satisfied for entering BMPS. + */ + if ((eConnectionState_Associated == pHddStaCtx->conn_info.connState) && + (VOS_FALSE == pHddStaCtx->conn_info.uIsAuthenticated)) + { + hddLog(LOGE, + FL("Station is associated but, still not Authenticated ignore " + "power save mode")); + return VOS_STATUS_E_AGAIN; + } + if (pHddCtx->cfg_ini->fIsBmpsEnabled) { hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s:Wlan driver Entering Bmps ", @@ -3374,19 +3624,16 @@ VOS_STATUS wlan_hdd_enter_bmps(hdd_adapter_t *pAdapter, int mode) sme_SetDHCPTillPowerActiveFlag(WLAN_HDD_GET_HAL_CTX(pAdapter), FALSE); status = sme_RequestBmps(WLAN_HDD_GET_HAL_CTX(pAdapter), - iw_power_callback_fn, &context); + iw_power_callback_func, cookie); if (eHAL_STATUS_PMC_PENDING == status) { /* request was sent -- wait for the response */ - int lrc = wait_for_completion_interruptible_timeout( - &context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_POWER)); - if (lrc <= 0) + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while requesting BMPS", - __func__, (0 == lrc) ? "timeout" : "interrupt"); - } + FL("SME timeout while requesting bmps")); + } } } else @@ -3396,20 +3643,12 @@ VOS_STATUS wlan_hdd_enter_bmps(hdd_adapter_t *pAdapter, int mode) } } - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + /* + * either we never sent a request, we sent a request and received a + * response or we sent a request and timed out. Regardless we are + * done with the request. + */ + hdd_request_put(request); return VOS_STATUS_SUCCESS; } @@ -3501,16 +3740,30 @@ static int __iw_set_priv(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); + hdd_adapter_t *pAdapter; char *cmd = NULL; int cmd_len = wrqu->data.length; - int ret = 0; - int rc = 0; + int rc = 0, ret = 0; VOS_STATUS vos_status = VOS_STATUS_SUCCESS; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_context_t *pHddCtx; ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "mem_alloc_copy_from_user_helper fail"); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + rc = wlan_hdd_validate_context(pHddCtx); + if (0 != rc) + { + return rc; + } + cmd = mem_alloc_copy_from_user_helper(wrqu->data.pointer, wrqu->data.length); if (NULL == cmd) @@ -3528,18 +3781,6 @@ static int __iw_set_priv(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_INFO_MED, "%s: ***Received %s cmd from Wi-Fi GUI***", __func__, cmd); - if (pHddCtx->isLogpInProgress) { - if (ioctl_debug) - { - pr_info("%s: RESTART in progress\n", __func__); - } - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - kfree(cmd); - return -EBUSY; - } - if (strncmp(cmd, "CSCAN", 5) == 0 ) { if (eHAL_STATUS_SUCCESS != iw_set_cscan(dev, info, wrqu, cmd)) { @@ -3590,15 +3831,15 @@ static int __iw_set_priv(struct net_device *dev, } else if (strcasecmp(cmd, "scan-active") == 0) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("making default scan to active")); + hddLog(LOG1, + FL("making default scan to active")); pHddCtx->scan_info.scan_mode = eSIR_ACTIVE_SCAN; ret = snprintf(cmd, cmd_len, "OK"); } else if (strcasecmp(cmd, "scan-passive") == 0) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("making default scan to passive")); + hddLog(LOG1, + FL("making default scan to passive")); pHddCtx->scan_info.scan_mode = eSIR_PASSIVE_SCAN; ret = snprintf(cmd, cmd_len, "OK"); } @@ -3610,41 +3851,6 @@ static int __iw_set_priv(struct net_device *dev, { ret = iw_get_linkspeed(dev, info, wrqu, cmd); } - else if( strncasecmp(cmd, "COUNTRY", 7) == 0 ) { - char *country_code; - long lrc; - eHalStatus eHal_status; - - country_code = cmd + 8; - - init_completion(&pAdapter->change_country_code); - - eHal_status = sme_ChangeCountryCode(pHddCtx->hHal, - (void *)(tSmeChangeCountryCallback)wlan_hdd_change_country_code_callback, - country_code, - pAdapter, - pHddCtx->pvosContext, - eSIR_TRUE, - eSIR_TRUE); - - /* Wait for completion */ - lrc = wait_for_completion_interruptible_timeout(&pAdapter->change_country_code, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - - if (lrc <= 0) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: SME %s while setting country code ", - __func__, "Timed out"); - } - - if (eHAL_STATUS_SUCCESS != eHal_status) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: SME Change Country code fail", __func__); - kfree(cmd); - return -EIO; - } - } else if( strncasecmp(cmd, "rssi", 4) == 0 ) { ret = iw_get_rssi(dev, info, wrqu, cmd); @@ -3841,6 +4047,7 @@ static int __iw_set_priv(struct net_device *dev, __func__, cmd, wrqu->data.length, rc); } kfree(cmd); + EXIT(); return rc; } @@ -3856,36 +4063,115 @@ static int iw_set_priv(struct net_device *dev, return ret; } -static int iw_set_nick(struct net_device *dev, +static int __iw_set_nick(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + EXIT(); return 0; } -static int iw_get_nick(struct net_device *dev, +static int iw_set_nick(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_set_nick(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + +static int __iw_get_nick(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + EXIT(); return 0; } -static struct iw_statistics *get_wireless_stats(struct net_device *dev) +static int iw_get_nick(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_nick(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + +static struct iw_statistics * __get_wireless_stats(struct net_device *dev) { ENTER(); return NULL; } +static struct iw_statistics *get_wireless_stats(struct net_device *dev) +{ + + struct iw_statistics *stats; + + vos_ssr_protect(__func__); + stats = __get_wireless_stats(dev); + vos_ssr_unprotect(__func__); + + return stats; +} + static int __iw_set_encode(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); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_station_ctx_t *pHddStaCtx; + hdd_wext_state_t *pWextState; + hdd_context_t *pHddCtx; struct iw_point *encoderq = &(wrqu->encoding); v_U32_t keyId; v_U8_t key_length; @@ -3896,14 +4182,34 @@ static int __iw_set_encode(struct net_device *dev, ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + return status; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL ",__func__); + return -EINVAL; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; } - keyId = encoderq->flags & IW_ENCODE_INDEX; @@ -4032,7 +4338,7 @@ static int __iw_set_encode(struct net_device *dev, return status; } } - + EXIT(); return 0; } @@ -4054,22 +4360,38 @@ static int __iw_get_encodeext(struct net_device *dev, struct iw_point *dwrq, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile); + hdd_adapter_t *pAdapter; + hdd_wext_state_t *pWextState; + tCsrRoamProfile *pRoamProfile; int keyId; eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE; eCsrAuthType authType = eCSR_AUTH_TYPE_NONE; - int i; + int i, ret = 0; + hdd_context_t *pHddCtx; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; } + pRoamProfile = &(pWextState->roamProfile); keyId = pRoamProfile->Keys.defaultIndex; @@ -4151,12 +4473,13 @@ static int __iw_set_encodeext(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); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - eHalStatus halStatus= eHAL_STATUS_SUCCESS; + hdd_adapter_t *pAdapter; + hdd_station_ctx_t *pHddStaCtx; + hdd_wext_state_t *pWextState; + hdd_context_t *pHddCtx; + eHalStatus halStatus = eHAL_STATUS_SUCCESS; - tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile; + tCsrRoamProfile *pRoamProfile; v_U32_t status = 0; struct iw_encode_ext *ext = (struct iw_encode_ext*)extra; @@ -4170,14 +4493,34 @@ static int __iw_set_encodeext(struct net_device *dev, VOS_STATUS vos_status; ENTER(); - - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + return status; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + pRoamProfile = &pWextState->roamProfile; key_index = encoding->flags & IW_ENCODE_INDEX; if(key_index > 0) { @@ -4344,8 +4687,8 @@ static int __iw_set_encodeext(struct net_device *dev, pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; } - - return halStatus; + EXIT(); + return halStatus; } static int iw_set_encodeext(struct net_device *dev, @@ -4365,16 +4708,34 @@ static int __iw_set_retry(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } if(wrqu->retry.value < WNI_CFG_LONG_RETRY_LIMIT_STAMIN || @@ -4436,17 +4797,35 @@ static int __iw_get_retry(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + tHalHandle hHal; v_U32_t retry = 0; + int ret = 0; ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } if((wrqu->retry.flags & IW_RETRY_LONG)) @@ -4504,18 +4883,33 @@ static int __iw_set_mlme(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + hdd_station_ctx_t *pHddStaCtx; struct iw_mlme *mlme = (struct iw_mlme *)extra; eHalStatus status = eHAL_STATUS_SUCCESS; + int ret = 0; ENTER(); - - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!",__func__); - return 0; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s:Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s:STA context is NULL",__func__); + return -EINVAL; } //reason_code is unused. By default it is set to eCSR_DISCONNECT_REASON_UNSPECIFIED @@ -4550,6 +4944,7 @@ static int __iw_set_mlme(struct net_device *dev, /* Resetting authKeyMgmt */ (WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->authKeyMgmt = 0; + hddLog(VOS_TRACE_LEVEL_INFO, FL("Disabling queues")); netif_tx_disable(dev); netif_carrier_off(dev); @@ -4589,9 +4984,11 @@ static int __iw_setint_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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_wext_state_t *pWextState; + hdd_context_t *pHddCtx; + hdd_mon_ctx_t *pMonCtx = NULL; int *value = (int *)extra; int sub_cmd = value[0]; int set_value = value[1]; @@ -4600,15 +4997,44 @@ static int __iw_setint_getnone(struct net_device *dev, #ifdef CONFIG_HAS_EARLYSUSPEND v_U8_t nEnableSuspendOld; #endif - INIT_COMPLETION(pWextState->completion_var); + void *cookie; + struct hdd_request *request; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } + if ( VOS_MONITOR_MODE != hdd_get_conparam()) + { + /* In monitor mode hHal is NULL */ + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } + + INIT_COMPLETION(pWextState->completion_var); + } switch(sub_cmd) { case WE_SET_11D_STATE: @@ -4661,43 +5087,41 @@ static int __iw_setint_getnone(struct net_device *dev, { case 0: //Full Power { - struct statsContext context; - eHalStatus status; + eHalStatus status = eHAL_STATUS_FAILURE; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = WLAN_WAIT_TIME_POWER, + }; - init_completion(&context.completion); + if (NULL == hHal) + return -EINVAL; - context.pAdapter = pAdapter; - context.magic = POWER_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); status = sme_RequestFullPower(WLAN_HDD_GET_HAL_CTX(pAdapter), - iw_power_callback_fn, &context, + iw_power_callback_func, cookie, eSME_FULL_PWR_NEEDED_BY_HDD); if (eHAL_STATUS_PMC_PENDING == status) { - int lrc = wait_for_completion_interruptible_timeout( - &context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_POWER)); - - if (lrc <= 0) - { + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while requesting fullpower", - __func__, (0 == lrc) ? - "timeout" : "interrupt"); + FL("SME timeout while requesting bmps")); } } - /* either we have a response or we timed out. if we timed - out there is a race condition such that the callback - function could be executing at the same time we are. of - primary concern is if the callback function had already - verified the "magic" but had not yet set the completion - variable when a timeout occurred. we serialize these - activities by invalidating the magic while holding a - shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * Regardless we are done with the request. + */ + hdd_request_put(request); hddLog(LOGE, "iwpriv Full Power completed"); break; @@ -4710,42 +5134,40 @@ static int __iw_setint_getnone(struct net_device *dev, break; case 3: //Request Bmps { - struct statsContext context; - eHalStatus status; + eHalStatus status = eHAL_STATUS_FAILURE; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = WLAN_WAIT_TIME_POWER, + }; - init_completion(&context.completion); + if (NULL == hHal) + return -EINVAL; - context.pAdapter = pAdapter; - context.magic = POWER_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Request allocation failure")); + return VOS_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); status = sme_RequestBmps(WLAN_HDD_GET_HAL_CTX(pAdapter), - iw_power_callback_fn, &context); + iw_power_callback_func, cookie); if (eHAL_STATUS_PMC_PENDING == status) { - int lrc = wait_for_completion_interruptible_timeout( - &context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_POWER)); - if (lrc <= 0) - { + ret = hdd_request_wait_for_response(request); + if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME %s while requesting BMPS", - __func__, (0 == lrc) ? "timeout" : - "interrupt"); + FL("SME timeout while requesting fullpower")); } } - /* either we have a response or we timed out. if we - timed out there is a race condition such that the - callback function could be executing at the same - time we are. of primary concern is if the callback - function had already verified the "magic" but had - not yet set the completion variable when a timeout - occurred. we serialize these activities by - invalidating the magic while holding a shared - spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * Regardless we are done with the request. + */ + hdd_request_put(request); hddLog(LOGE, "iwpriv Request BMPS completed"); break; @@ -4871,10 +5293,13 @@ static int __iw_setint_getnone(struct net_device *dev, } case WE_SET_MAX_TX_POWER_2_4: { + if (NULL == hHal) + return -EINVAL; + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Setting maximum tx power %d dBm for 2.4 GHz band", __func__, set_value); - if (sme_SetMaxTxPowerPerBand(eCSR_BAND_24, set_value) != + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_24, set_value, hHal) != eHAL_STATUS_SUCCESS) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -4887,10 +5312,13 @@ static int __iw_setint_getnone(struct net_device *dev, } case WE_SET_MAX_TX_POWER_5_0: { + if (NULL == hHal) + return -EINVAL; + hddLog(VOS_TRACE_LEVEL_INFO, "%s: Setting maximum tx power %d dBm for 5.0 GHz band", __func__, set_value); - if (sme_SetMaxTxPowerPerBand(eCSR_BAND_5G, set_value) != + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_5G, set_value, hHal) != eHAL_STATUS_SUCCESS) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -5052,7 +5480,177 @@ static int __iw_setint_getnone(struct net_device *dev, FL("Invalid value %d in WE_SET_MIRACAST_VENDOR_CONFIG IOCTL"), set_value); ret = -EINVAL; } + break; + } + + case WE_GET_FRAME_LOG: + { + if (wlan_hdd_get_frame_logs(pAdapter, set_value) + != VOS_STATUS_SUCCESS) + { + ret = -EINVAL; + } + break; + } + + case WE_SET_TDLS_2040_BSS_COEXISTENCE: + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: TDLS_2040_BSS_COEXISTENCE %d", __func__, set_value); + if (set_value == 0 || set_value == 1) + { + sme_SetTdls2040BSSCoexistence(WLAN_HDD_GET_HAL_CTX(pAdapter), + set_value); + } + else + ret = -EINVAL; + + break; + } + /* Bit mask value to enable RTS/CTS for different modes + * for 2.4 GHz, HT20 - 0x0001, for 2.4 GHz, HT40 - 0x0002 + * for 2.4 GHz, VHT20 - 0x0004, for 2.4 GHz, VHT40 - 0x0008 + * for 5 GHz, HT20 - 0x0100, for 5 GHz, HT40 - 0x0200 + * for 5 GHz, VHT20 - 0x0400, for 5 GHz, VHT40 - 0x0800 + * for 5 GHz, VHT80 - 0x1000 + */ + case WE_SET_RTS_CTS_HTVHT: + { + + hddLog( LOG1, FL("WE_SET_RTS_CTS_HTVHT set value %d"), set_value); + + if (eHAL_STATUS_SUCCESS != + sme_SetRtsCtsHtVht( pHddCtx->hHal, set_value)) + { + hddLog( LOGE, FL("set WE_SET_RTS_CTS_HTVHT failed")); + ret = -EINVAL; + } + break; + } + case WE_SET_MONITOR_STATE: + { + tVOS_CON_MODE mode = hdd_get_conparam(); + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; + + if( VOS_MONITOR_MODE != mode) + { + hddLog(LOGE, "invalid mode %d", mode); + ret = -EIO; + } + + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + if( pMonCtx == NULL ) + { + hddLog(LOGE, "Monitor Context NULL"); + ret = -EIO; + } + if (pMonCtx->state == set_value) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("already in same mode curr_mode:%d req_mode: %d"), + pMonCtx->state, set_value); + break; + } + pMonCtx->state = set_value; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + ret = -ENOMEM; + break; + } + cookie = hdd_request_cookie(request); + + if (VOS_STATUS_SUCCESS != + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to post MON MODE REQ")); + pMonCtx->state = (pMonCtx->state==MON_MODE_START)? + MON_MODE_STOP : MON_MODE_START; + ret = -EIO; + } else { + ret = hdd_request_wait_for_response(request); + if (ret) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); + } + } + hdd_request_put(request); + break; + } + case WE_SET_PROXIMITY_ENABLE: + { + sHwCalValues hwCalValues; + uint16 hwCalTxPower; + uint8 txPwr = TX_PWR_DEF; + + hddLog(LOG1, FL("WE_SET_PROXIMITY_ENABLE: %d"), set_value); + + if (TRUE == set_value) { + if(vos_nv_read( VNV_HW_CAL_VALUES, &hwCalValues, + NULL, sizeof(sHwCalValues) ) + != VOS_STATUS_SUCCESS) { + ret = -EINVAL; + break; + } + hwCalTxPower = (uint16)(hwCalValues.calData.hwParam7 >> 16); + + hddLog(LOG1, FL("hwCalTxPower:%x nv_data:%x"), + hwCalTxPower, hwCalValues.calData.hwParam7); + + txPwr = (int8)(hwCalTxPower & 0x00FF); + txPwr = txPwr/10; + if (txPwr < TX_PWR_MIN) + txPwr = TX_PWR_MIN; + if (txPwr > TX_PWR_MAX) + txPwr = TX_PWR_MAX; + + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_24, txPwr, hHal) != + eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Setting tx power failed for 2.4GHz band %d"), txPwr); + ret = -EIO; + } + + txPwr = (int8)((hwCalTxPower >> 8) & 0x00FF); + txPwr /= 10; + if (txPwr < TX_PWR_MIN) + txPwr = TX_PWR_MIN; + if (txPwr > TX_PWR_MAX) + txPwr = TX_PWR_MAX; + + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_5G, txPwr, hHal) != + eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("setting tx power failed for 5GHz band %d"), txPwr); + ret = -EIO; + } + } + else if(FALSE == set_value) { + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_24, txPwr, hHal) != + eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Setting tx power failed for 2.4GHz band %d"), txPwr); + ret = -EIO; + } + if (sme_SetMaxTxPowerPerBand(eCSR_BAND_5G, txPwr, hHal) != + eHAL_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("setting tx power failed for 5GHz band %d"), txPwr); + ret = -EIO; + } + } + else { + ret = -EINVAL; + } break; } default: @@ -5062,7 +5660,7 @@ static int __iw_setint_getnone(struct net_device *dev, break; } } - + EXIT(); return ret; } @@ -5087,21 +5685,40 @@ static int __iw_setchar_getnone(struct net_device *dev, int sub_cmd; int ret = 0; /* success */ char *pBuffer = NULL; - hdd_adapter_t *pAdapter = (netdev_priv(dev)); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; #ifdef WLAN_FEATURE_VOWIFI - hdd_config_t *pConfig = pHddCtx->cfg_ini; + hdd_config_t *pConfig; #endif /* WLAN_FEATURE_VOWIFI */ struct iw_point s_priv_data; tSirpkt80211 *pkt; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + + if (!capable(CAP_NET_ADMIN)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pAdapter = (netdev_priv(dev)); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } +#ifdef WLAN_FEATURE_VOWIFI + pConfig = pHddCtx->cfg_ini; +#endif /* helper function to get iwreq_data with compat handling. */ if (hdd_priv_get_data(&s_priv_data, wrqu)) { @@ -5187,7 +5804,8 @@ static int __iw_setchar_getnone(struct net_device *dev, { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: vos_mem_alloc failed", __func__); - return -ENOMEM; + ret = -ENOMEM; + break; } memset(pkt, 0, sizeof(tSirpkt80211)); @@ -5221,6 +5839,8 @@ static int __iw_setchar_getnone(struct net_device *dev, } } kfree(pBuffer); + + EXIT(); return ret; } @@ -5242,20 +5862,34 @@ static int __iw_setnone_getint(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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; int *value = (int *)extra; int ret = 0; /* success */ tSmeConfigParams smeConfig; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - if (__ratelimit(&hdd_ioctl_timeout_rs)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - } - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } switch (value[0]) @@ -5365,7 +5999,7 @@ static int __iw_setnone_getint(struct net_device *dev, break; } } - + EXIT(); return ret; } @@ -5387,18 +6021,34 @@ int __iw_set_three_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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int *value = (int *)extra; int sub_cmd = value[0]; int ret = 0; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + + if (!capable(CAP_NET_ADMIN)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; } + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } switch(sub_cmd) { case WE_SET_WLAN_DBG: @@ -5423,6 +6073,7 @@ int __iw_set_three_ints_getnone(struct net_device *dev, break; } } + EXIT(); return ret; } @@ -5443,36 +6094,37 @@ static int __iw_get_char_setnone(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); + hdd_adapter_t *pAdapter; int sub_cmd = wrqu->data.flags; + hdd_context_t *pHddCtx; + int ret = 0; #ifdef WLAN_FEATURE_11W hdd_wext_state_t *pWextState; #endif + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (pAdapter == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: pAdapter is NULL!", __func__); return -EINVAL; } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } #ifdef WLAN_FEATURE_11W pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); -#endif - - if (NULL == WLAN_HDD_GET_CTX(pAdapter)) + if (NULL == pWextState) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD Context is NULL!", __func__); - + "%s: pWextState is NULL",__func__); return -EINVAL; } - - 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; - } +#endif switch(sub_cmd) { @@ -5732,7 +6384,7 @@ static int __iw_get_char_setnone(struct net_device *dev, len += buf; /*printing the PE Sme and Mlm states for valid lim sessions*/ - while ( check < 3 && count < 255) + while ( check < 3 && count < pMac->lim.maxBssId) { if ( pMac->lim.gpSession[count].valid ) { @@ -5767,6 +6419,7 @@ static int __iw_get_char_setnone(struct net_device *dev, case WE_GET_RSSI: { v_S7_t s7Rssi = 0; + wlan_hdd_get_station_stats(pAdapter); wlan_hdd_get_rssi(pAdapter, &s7Rssi); snprintf(extra, WE_MAX_STR_LEN, "rssi=%d",s7Rssi); wrqu->data.length = strlen(extra)+1; @@ -5901,7 +6554,6 @@ static int __iw_get_char_setnone(struct net_device *dev, status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { - hddLog(LOGE, "%s: getSNR: HDD context is not valid", __func__); return status; } @@ -5931,7 +6583,7 @@ static int __iw_get_char_setnone(struct net_device *dev, break; } } - + EXIT(); return 0; } @@ -5953,18 +6605,27 @@ static int __iw_setnone_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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int sub_cmd; int ret = 0; /* success */ struct iw_point s_priv_data; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } - /* helper function to get iwreq_data with compat handling. */ if (hdd_priv_get_data(&s_priv_data, wrqu)) { @@ -6025,7 +6686,7 @@ static int __iw_setnone_getnone(struct net_device *dev, /*Make sure that pAdapter cleaned properly*/ hdd_stop_adapter( pHddCtx, pAdapter_to_stop, VOS_TRUE ); - hdd_deinit_adapter( pHddCtx, pAdapter_to_stop ); + hdd_deinit_adapter( pHddCtx, pAdapter_to_stop, TRUE); memset(&pAdapter_to_stop->sessionCtx, 0, sizeof(pAdapter_to_stop->sessionCtx)); wlan_hdd_release_intf_addr(WLAN_HDD_GET_CTX(pAdapter), @@ -6134,7 +6795,6 @@ static int __iw_setnone_getnone(struct net_device *dev, sme_HT40StopOBSSScan(pMac, pAdapter->sessionId); } break; -#ifdef DEBUG_ROAM_DELAY case WE_DUMP_ROAM_TIMER_LOG: { vos_dump_roam_time_log_service(); @@ -6146,14 +6806,21 @@ static int __iw_setnone_getnone(struct net_device *dev, vos_reset_roam_timer_log(); break; } -#endif + case WE_GET_FW_LOGS: + { + vos_fatal_event_logs_req(WLAN_LOG_TYPE_NON_FATAL, + WLAN_LOG_INDICATOR_IOCTL, + WLAN_LOG_REASON_CODE_UNUSED, + TRUE); + break; + } default: { hddLog(LOGE, "%s: unknown ioctl %d", __func__, sub_cmd); break; } } - + EXIT(); return ret; } @@ -6181,22 +6848,31 @@ void hdd_wmm_tx_snapshot(hdd_adapter_t *pAdapter) int i = 0, j = 0; v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; ptSapContext pSapCtx = VOS_GET_SAP_CB(pVosContext); + hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_ibss_peer_info_t *pPeerInfo; + v_SIZE_t tx_queue_count[NUM_TX_QUEUES]; for ( i=0; i< NUM_TX_QUEUES; i++) { spin_lock_bh(&pAdapter->wmm_tx_queue[i].lock); - - hddLog(LOGE, "HDD WMM TxQueue Info For AC: %d Count: %d PrevAdress:%p, NextAddress:%p", - i, pAdapter->wmm_tx_queue[i].count, - pAdapter->wmm_tx_queue[i].anchor.prev, pAdapter->wmm_tx_queue[i].anchor.next); + tx_queue_count[i] = pAdapter->wmm_tx_queue[i].count; spin_unlock_bh(&pAdapter->wmm_tx_queue[i].lock); } + + for ( i=0; i< NUM_TX_QUEUES; i++) { + if (tx_queue_count[i]) { + hddLog(LOGE, "HDD WMM TxQueue Info For AC: %d Count: %d", + i, tx_queue_count[i]); + } + } + if(pSapCtx == NULL){ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("psapCtx is NULL")); return; } + spin_lock_bh(&pSapCtx->staInfo_lock); for(i =0; iaStaInfo[i].isUsed) @@ -6204,51 +6880,102 @@ void hdd_wmm_tx_snapshot(hdd_adapter_t *pAdapter) hddLog(LOGE, "******STAIndex: %d*********", i); for ( j=0; j< NUM_TX_QUEUES; j++) { - spin_lock_bh(&pSapCtx->aStaInfo[i].wmm_tx_queue[j].lock); - hddLog(LOGE, "HDD TxQueue Info For AC: %d Count: %d PrevAdress:%p, NextAddress:%p", - j, pSapCtx->aStaInfo[i].wmm_tx_queue[j].count, - pSapCtx->aStaInfo[i].wmm_tx_queue[j].anchor.prev, - pSapCtx->aStaInfo[i].wmm_tx_queue[j].anchor.next); - spin_unlock_bh(&pSapCtx->aStaInfo[i].wmm_tx_queue[j].lock); + if( pSapCtx->aStaInfo[i].wmm_tx_queue[j].count ) + { + spin_lock_bh(&pSapCtx->aStaInfo[i].wmm_tx_queue[j].lock); + hddLog(LOGE, "HDD TxQueue Info For AC: %d Count: %d", + j, pSapCtx->aStaInfo[i].wmm_tx_queue[j].count); + spin_unlock_bh(&pSapCtx->aStaInfo[i].wmm_tx_queue[j].lock); + } + } + } + } + spin_unlock_bh(&pSapCtx->staInfo_lock); + + if(pHddStaCtx == NULL){ + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("pHddStaCtx is NULL")); + return; + } + + pPeerInfo = &pHddStaCtx->ibss_peer_info; + if(pPeerInfo == NULL){ + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("ppeerinfo is NULL")); + return; + } + + for(i =0; i< HDD_MAX_NUM_IBSS_STA; i++) + { + if(pPeerInfo->ibssStaInfo[i].isUsed) + { + hddLog(LOGE, "******IBSS STAIndex: %d*********", i); + for ( j=0; j< NUM_TX_QUEUES; j++) + { + spin_lock_bh(&pPeerInfo->ibssStaInfo[i].wmm_tx_queue[j].lock); + hddLog(LOGE, "HDD TxQueue Info For AC: %d Count: %d PrevAdress:%pK, NextAddress:%pK", + j, pPeerInfo->ibssStaInfo[i].wmm_tx_queue[j].count, + pPeerInfo->ibssStaInfo[i].wmm_tx_queue[j].anchor.prev, + pPeerInfo->ibssStaInfo[i].wmm_tx_queue[j].anchor.next); + spin_unlock_bh(&pPeerInfo->ibssStaInfo[i].wmm_tx_queue[j].lock); } } } + } static int __iw_set_var_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); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; int sub_cmd; int *apps_args = (int *) extra; hdd_station_ctx_t *pStaCtx = NULL ; + hdd_mon_ctx_t *pMonCtx = NULL; hdd_context_t *pHddCtx = NULL; hdd_ap_ctx_t *pAPCtx = NULL; + v_CONTEXT_t pVosContext; int cmd = 0; int staId = 0; int ret = 0; + ENTER(); if (extra == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: NULL extra buffer pointer", __func__); return -EINVAL; } - - sub_cmd = wrqu->data.flags; - - hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length); - + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is Null", __func__); return ret; } + if( VOS_MONITOR_MODE != hdd_get_conparam()) + { + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + } + sub_cmd = wrqu->data.flags; + + hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length); + if(( sub_cmd == WE_MCC_CONFIG_CREDENTIAL ) || (sub_cmd == WE_MCC_CONFIG_PARAMS )) @@ -6276,14 +7003,18 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, { case WE_LOG_DUMP_CMD: { - vos_ssr_protect(__func__); + if (apps_args[0] == 26) { + if (!pHddCtx->cfg_ini->crash_inject_enabled) { + hddLog(LOGE, "Crash Inject ini disabled, Ignore Crash Inject"); + return 0; + } + } hddLog(LOG1, "%s: LOG_DUMP %d arg1 %d arg2 %d arg3 %d arg4 %d", __func__, apps_args[0], apps_args[1], apps_args[2], apps_args[3], apps_args[4]); logPrintf(hHal, apps_args[0], apps_args[1], apps_args[2], apps_args[3], apps_args[4]); - vos_ssr_unprotect(__func__); } break; @@ -6292,6 +7023,13 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, { p2p_app_setP2pPs_t p2pNoA; + if (pAdapter->device_mode != WLAN_HDD_P2P_GO) { + hddLog(LOGE, + FL("Setting NoA is not allowed in Device mode:%d"), + pAdapter->device_mode); + return -EINVAL; + } + p2pNoA.opp_ps = apps_args[0]; p2pNoA.ctWindow = apps_args[1]; p2pNoA.duration = apps_args[2]; @@ -6374,6 +7112,122 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, } break; #endif + case WE_CONFIGURE_MONITOR_MODE: + { + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; + + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + if( pMonCtx == NULL ) + { + hddLog(LOGE, "Monitor Context NULL"); + break; + } + hddLog(LOG1, "%s: Monitor MOde Configuration: ChNo=%d ChBW=%d CRCCheck=%d type=%d ConversionBit=%d", + __func__, apps_args[0], apps_args[1], apps_args[2], + apps_args[3], apps_args[4]); + /* Input Validation part of FW */ + pMonCtx->ChannelNo = apps_args[0]; + pMonCtx->ChannelBW = apps_args[1]; + pMonCtx->crcCheckEnabled = apps_args[2]; + wlan_hdd_mon_set_typesubtype( pMonCtx,apps_args[3]); + pMonCtx->is80211to803ConReq = apps_args[4]; + WLANTL_SetIsConversionReq(pVosContext,apps_args[4]); + if( pMonCtx->is80211to803ConReq ) + pAdapter->dev->type = ARPHRD_ETHER; + else + pAdapter->dev->type = ARPHRD_IEEE80211_RADIOTAP; + if( (apps_args[3]!= 100 && apps_args[3]!= 0) && apps_args[4] ) + { + hddLog(LOGE, "%s: Filtering data packets as management and control" + " cannot be converted to 802.3 ",__func__); + pMonCtx->typeSubtypeBitmap = 0xFFFF00000000; + } + if (MON_MODE_START == pMonCtx->state) { + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); + + if (VOS_STATUS_SUCCESS != + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to post MON MODE REQ")); + ret = -EIO; + } else { + ret = hdd_request_wait_for_response(request); + if (ret) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); + } + hdd_request_put(request); + } + } + break; + + case WE_SET_MONITOR_MODE_FILTER: + { + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; + + pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); + if( pMonCtx == NULL ) + { + hddLog(LOGE, "Monitor Context NULL"); + break; + } + /* Input Validation Part of FW */ + pMonCtx->numOfMacFilters=1; + pMonCtx->mmFilters[0].macAddr.bytes[0]=apps_args[0]; + pMonCtx->mmFilters[0].macAddr.bytes[1]=apps_args[1]; + pMonCtx->mmFilters[0].macAddr.bytes[2]=apps_args[2]; + pMonCtx->mmFilters[0].macAddr.bytes[3]=apps_args[3]; + pMonCtx->mmFilters[0].macAddr.bytes[4]=apps_args[4]; + pMonCtx->mmFilters[0].macAddr.bytes[5]=apps_args[5]; + pMonCtx->mmFilters[0].isA1filter = apps_args[6]; + pMonCtx->mmFilters[0].isA2filter = apps_args[7]; + pMonCtx->mmFilters[0].isA3filter = apps_args[8]; + hddLog(LOG1, "%s: Monitor Filter: %pM A1=%d A2=%d A3=%d ", + __func__, pMonCtx->mmFilters[0].macAddr.bytes, + apps_args[6], apps_args[7], apps_args[8]); + + if (MON_MODE_START == pMonCtx->state) { + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); + + if (VOS_STATUS_SUCCESS == + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { + ret = hdd_request_wait_for_response(request); + if (ret) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); + } + hdd_request_put(request); + + } + } + break; + default: { hddLog(LOGE, "%s: Invalid IOCTL command %d", @@ -6381,8 +7235,8 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, } break; } - - return 0; + EXIT(); + return ret; } static int iw_hdd_set_var_ints_getnone(struct net_device *dev, @@ -6394,6 +7248,13 @@ static int iw_hdd_set_var_ints_getnone(struct net_device *dev, int apps_args[MAX_VAR_ARGS] = {0}; int num_args; + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + /* helper function to get iwreq_data with compat handling. */ if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) { @@ -6445,14 +7306,37 @@ static int __iw_add_tspec(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); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *)extra; int params[HDD_WLAN_WMM_PARAM_COUNT]; sme_QosWmmTspecInfo tSpec; v_U32_t handle; struct iw_point s_priv_data; + int ret = 0; + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; + } // make sure the application is sufficiently priviledged // note that the kernel will do this for "set" ioctls, but since // this ioctl wants to return status to user space it must be @@ -6461,14 +7345,6 @@ static int __iw_add_tspec(struct net_device *dev, { return -EPERM; } - - 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; - } - // we must be associated in order to add a tspec if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { @@ -6602,6 +7478,8 @@ static int __iw_add_tspec(struct net_device *dev, } *pStatus = hdd_wmm_addts(pAdapter, handle, &tSpec); + + EXIT(); return 0; } @@ -6623,11 +7501,29 @@ static int __iw_del_tspec(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int *params = (int *)extra; hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *)extra; v_U32_t handle; + int ret = 0; + + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } // make sure the application is sufficiently priviledged // note that the kernel will do this for "set" ioctls, but since // this ioctl wants to return status to user space it must be @@ -6636,14 +7532,6 @@ static int __iw_del_tspec(struct net_device *dev, { return -EPERM; } - - 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; - } - // although we are defined to be a "get" ioctl, the params we require // will fit in the iwreq_data, therefore unlike iw_add_tspec() there // is no need to copy the params from user space @@ -6658,6 +7546,8 @@ static int __iw_del_tspec(struct net_device *dev, } *pStatus = hdd_wmm_delts(pAdapter, handle); + + EXIT(); return 0; } @@ -6679,15 +7569,32 @@ static int __iw_get_tspec(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; int *params = (int *)extra; hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *)extra; v_U32_t handle; + int ret = 0; + + ENTER(); // although we are defined to be a "get" ioctl, the params we require // will fit in the iwreq_data, therefore unlike iw_add_tspec() there // is no need to copy the params from user space + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } // validate the handle handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; if (HDD_WMM_HANDLE_IMPLICIT == handle) @@ -6697,14 +7604,8 @@ static int __iw_get_tspec(struct net_device *dev, return 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; - } - *pStatus = hdd_wmm_checkts(pAdapter, handle); + EXIT(); return 0; } @@ -6732,15 +7633,32 @@ static int __iw_set_fties(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); - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_adapter_t *pAdapter; + hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *pHddCtx; + int ret = 0; //v_CONTEXT_t pVosContext; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (NULL == pHddStaCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: STA Context is NULL",__func__); + return -EINVAL; } if (!wrqu->data.length) { @@ -6769,6 +7687,7 @@ static int __iw_set_fties(struct net_device *dev, sme_SetFTIEs( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, extra, wrqu->data.length); + EXIT(); return 0; } @@ -6790,22 +7709,37 @@ static int __iw_set_dynamic_mcbc_filter(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); + hdd_adapter_t *pAdapter; tpRcvFltMcAddrList pRequest = (tpRcvFltMcAddrList)extra; - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_context_t *pHddCtx; tpSirWlanSetRxpFilters wlanRxpFilterParam; - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + tHalHandle hHal; tpSirRcvFltMcAddrList mc_addr_list_ptr; int idx; eHalStatus ret_val; - if (pHddCtx->isLogpInProgress) + ENTER(); + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret_val = wlan_hdd_validate_context(pHddCtx); + if (0 != ret_val) + { + return ret_val; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; } - if (HDD_MULTICAST_FILTER_LIST == pRequest->mcastBcastFilterSetting) { #ifdef WLAN_FEATURE_PACKET_FILTERING @@ -6898,6 +7832,7 @@ static int __iw_set_dynamic_mcbc_filter(struct net_device *dev, } } + EXIT(); return 0; } @@ -6918,11 +7853,34 @@ static int __iw_clear_dynamic_mcbc_filter(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); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; tpSirWlanSetRxpFilters wlanRxpFilterParam; - hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s: ", __func__); + int ret = 0; + + ENTER(); + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } //Reset the filter to INI value as we have to clear the dynamic filter pHddCtx->configuredMcastBcastFilter = pHddCtx->cfg_ini->mcastBcastFilterSetting; @@ -6963,6 +7921,7 @@ static int __iw_clear_dynamic_mcbc_filter(struct net_device *dev, } } + EXIT(); return 0; } @@ -6984,16 +7943,28 @@ static int __iw_set_host_offload(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; tpHostOffloadRequest pRequest = (tpHostOffloadRequest) extra; tSirHostOffloadReq offloadRequest; + int ret = 0; + + ENTER(); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } + /* Debug display of request components. */ switch (pRequest->offloadType) { @@ -7036,11 +8007,14 @@ static int __iw_set_host_offload(struct net_device *dev, } } - /* Execute offload request. The reason that we can copy the request information - from the ioctl structure to the SME structure is that they are laid out - exactly the same. Otherwise, each piece of information would have to be - copied individually. */ - memcpy(&offloadRequest, pRequest, wrqu->data.length); + vos_mem_zero(&offloadRequest, sizeof(offloadRequest)); + offloadRequest.offloadType = pRequest->offloadType; + offloadRequest.enableOrDisable = pRequest->enableOrDisable; + vos_mem_copy(&offloadRequest.params, &pRequest->params, + sizeof(pRequest->params)); + vos_mem_copy(&offloadRequest.bssId, &pRequest->bssId.bytes, + VOS_MAC_ADDRESS_LEN); + if (eHAL_STATUS_SUCCESS != sme_SetHostOffload(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &offloadRequest)) { @@ -7049,6 +8023,7 @@ static int __iw_set_host_offload(struct net_device *dev, return -EINVAL; } + EXIT(); return 0; } @@ -7069,17 +8044,26 @@ static int __iw_set_keepalive_params(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; tpKeepAliveRequest pRequest = (tpKeepAliveRequest) extra; tSirKeepAliveReq keepaliveRequest; + int ret = 0; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return 0; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; } - /* Debug display of request components. */ hddLog(VOS_TRACE_LEVEL_INFO, "%s: Set Keep Alive Request : TimePeriod %d size %zu", @@ -7127,7 +8111,7 @@ static int __iw_set_keepalive_params(struct net_device *dev, __func__); return -EINVAL; } - + EXIT(); return 0; } @@ -7157,12 +8141,6 @@ int wlan_hdd_set_filter(hdd_context_t *pHddCtx, tpPacketFilterCfg pRequest, __func__ ); return 0; } - if (pHddCtx->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; - } /* Debug display of request components. */ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Packet Filter Request : FA %d params %d", __func__, pRequest->filterAction, pRequest->numParams); @@ -7518,11 +8496,34 @@ static int __iw_set_packet_filter_params(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; tpPacketFilterCfg pRequest = NULL; - int ret; + int ret = 0; struct iw_point s_priv_data; + ENTER(); + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } if (hdd_priv_get_data(&s_priv_data, wrqu)) { return -EINVAL; @@ -7546,6 +8547,7 @@ static int __iw_set_packet_filter_params(struct net_device *dev, ret = wlan_hdd_set_filter(WLAN_HDD_GET_CTX(pAdapter), pRequest, pAdapter->sessionId); kfree(pRequest); + EXIT(); return ret; } @@ -7570,22 +8572,33 @@ static int __iw_get_statistics(struct net_device *dev, VOS_STATUS vos_status = VOS_STATUS_SUCCESS; eHalStatus status = eHAL_STATUS_SUCCESS; hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; char *p = extra; - int tlen = 0; - tCsrSummaryStatsInfo *pStats = &(pAdapter->hdd_stats.summary_stat); + int tlen = 0, ret = 0; + tCsrSummaryStatsInfo *pStats; - tCsrGlobalClassAStatsInfo *aStats = &(pAdapter->hdd_stats.ClassA_stat); - tCsrGlobalClassDStatsInfo *dStats = &(pAdapter->hdd_stats.ClassD_stat); + tCsrGlobalClassAStatsInfo *aStats; + tCsrGlobalClassDStatsInfo *dStats; ENTER(); - if (pHddCtx->isLogpInProgress) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!",__func__); - return -EINVAL; + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; } - + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } + pStats = &(pAdapter->hdd_stats.summary_stat); + aStats = &(pAdapter->hdd_stats.ClassA_stat); + dStats = &(pAdapter->hdd_stats.ClassD_stat); if (eConnectionState_Associated != (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState) { wrqu->txpower.value = 0; @@ -7610,6 +8623,12 @@ static int __iw_get_statistics(struct net_device *dev, } pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); + if (NULL == pWextState) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: pWextState is NULL",__func__); + return -EINVAL; + } vos_status = vos_wait_single_event(&pWextState->vosevent, WLAN_WAIT_TIME_STATS); if (!VOS_IS_STATUS_SUCCESS(vos_status)) @@ -7926,7 +8945,7 @@ VOS_STATUS iw_set_pno(struct net_device *dev, struct iw_request_info *info, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "PNO ssid length input is not valid %s",ptr); - return VOS_STATUS_E_FAILURE; + goto error; } if (( 0 == pnoRequest.aNetworks[i].ssId.length ) || @@ -7982,7 +9001,7 @@ VOS_STATUS iw_set_pno(struct net_device *dev, struct iw_request_info *info, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "Incorrect number of channels"); - return VOS_STATUS_E_FAILURE; + goto error; } if ( 0 != pnoRequest.aNetworks[i].ucChannelCount) @@ -7994,7 +9013,7 @@ VOS_STATUS iw_set_pno(struct net_device *dev, struct iw_request_info *info, &nOffset)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "PNO network channel input is not valid %s",ptr); - return VOS_STATUS_E_FAILURE; + goto error; } /*Advance to next channel number*/ ptr += nOffset; @@ -8167,18 +9186,35 @@ static int __iw_set_pno_priv(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); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; + int ret = 0; + VOS_STATUS status; - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "Set PNO Private"); + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + return ret; } - return iw_set_pno(dev,info,wrqu,extra,0); + + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "Set PNO Private"); + + status = iw_set_pno(dev,info,wrqu,extra,0); + + EXIT(); + return status; } static int iw_set_pno_priv(struct net_device *dev, @@ -8198,15 +9234,39 @@ static int iw_set_pno_priv(struct net_device *dev, //Common function to SetBand int hdd_setBand(struct net_device *dev, u8 ui_band) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapter; + tHalHandle hHal; + hdd_context_t *pHddCtx; hdd_scaninfo_t *pScanInfo = NULL; eCsrBand band; + int wait_result; eCsrBand currBand = eCSR_BAND_MAX; eCsrBand connectedBand; - v_U8_t ret = SEND_CHANNEL_CHANGE_EVENT; - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tpAniSirGlobal pMac; + int retval = SEND_CHANNEL_CHANGE_EVENT; + + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + retval = wlan_hdd_validate_context(pHddCtx); + if (0 != retval) + { + return retval; + } + hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Hal Context is NULL",__func__); + return -EINVAL; + } + pMac = PMAC_STRUCT(hHal); switch(ui_band) { @@ -8237,8 +9297,7 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) } if ( (band == eCSR_BAND_24 && pHddCtx->cfg_ini->nBandCapability==2) || - (band == eCSR_BAND_5G && pHddCtx->cfg_ini->nBandCapability==1) || - (band == eCSR_BAND_ALL && pHddCtx->cfg_ini->nBandCapability!=0)) + (band == eCSR_BAND_5G && pHddCtx->cfg_ini->nBandCapability==1) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: band value %u violate INI settings %u", __func__, @@ -8246,6 +9305,14 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) return -EIO; } + if (band == eCSR_BAND_ALL) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("Auto Band " + "received. Setting band same as ini value %d"), + pHddCtx->cfg_ini->nBandCapability); + band = pHddCtx->cfg_ini->nBandCapability; + } + if (eHAL_STATUS_SUCCESS != sme_GetFreqBand(hHal, &currBand)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, @@ -8256,14 +9323,17 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) if (currBand != band) { - /* Return failure if current country code is world regulatory domain*/ - if( (pMac->scan.countryCodeCurrent[0] == '0' && - pMac->scan.countryCodeCurrent[1] == '0') ) + if ( band == eCSR_BAND_5G ) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: failed to set the band value to %u as country code is 00", + /* Return failure if current country code is world regulatory domain*/ + if( (pMac->scan.countryCodeCurrent[0] == '0' && + pMac->scan.countryCodeCurrent[1] == '0') ) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: failed to set the band value to %u as country code is 00", __func__, band); - return -EAGAIN; + return -EAGAIN; + } } /* Change band request received. @@ -8287,30 +9357,74 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) } if(currBand == eCSR_BAND_24 || currBand == eCSR_BAND_5G) { - v_COUNTRYCODE_t curr_country; + tANI_U8 curr_country[WNI_CFG_COUNTRY_CODE_LEN]; curr_country[0]=pMac->scan.countryCodeCurrent[0]; curr_country[1]=pMac->scan.countryCodeCurrent[1]; - + INIT_COMPLETION(pHddCtx->linux_reg_req); /* As currunt band is already set to 2.4Ghz/5Ghz we dont have all channel * information available in NV so to get the channel information from kernel * we need to send regulatory hint for the currunt country * And to set the same country again we need to set the dummy country * first and then the actual country. */ - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) regulatory_hint_user("00", NL80211_USER_REG_HINT_USER); #else regulatory_hint_user("00"); #endif + wait_result = wait_for_completion_interruptible_timeout( + &pHddCtx->linux_reg_req, + msecs_to_jiffies(LINUX_REG_WAIT_TIME)); + + /* if the country information does not exist with the kernel, + then the driver callback would not be called */ + + if (wait_result >= 0) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "runtime country code is found in kernel db"); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, + "runtime country code is not found" + " in kernel db"); + } pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_TRUE; + + /* + * Update 11dcountry and current country here as the hint + * with 00 results in 11d and current country with 00 + */ + vos_mem_copy(pMac->scan.countryCode11d, curr_country, + WNI_CFG_COUNTRY_CODE_LEN); + vos_mem_copy(pMac->scan.countryCodeCurrent, curr_country, + WNI_CFG_COUNTRY_CODE_LEN); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) regulatory_hint_user(curr_country, NL80211_USER_REG_HINT_USER); #else regulatory_hint_user(curr_country); #endif - ret = DO_NOT_SEND_CHANNEL_CHANGE_EVENT; + wait_result = wait_for_completion_interruptible_timeout( + &pHddCtx->linux_reg_req, + msecs_to_jiffies(LINUX_REG_WAIT_TIME)); + + /* if the country information does not exist with the kernel, + then the driver callback would not be called */ + if (wait_result >= 0) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "runtime country code is found in kernel db"); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, + "runtime country code is not found" + " in kernel db"); + } + + retval = DO_NOT_SEND_CHANNEL_CHANGE_EVENT; } else { @@ -8370,7 +9484,11 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) } } } - return ret; + EXIT(); + if (TRUE == pHddCtx->isSetBandByNL) + return 0; + else + return retval; } int hdd_setBand_helper(struct net_device *dev, const char *command) @@ -8388,16 +9506,15 @@ static int __iw_set_band_config(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; VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: ", __func__); - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) + if (!capable(CAP_NET_ADMIN)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s:LOGP in Progress. Ignore!!!", __func__); - return -EBUSY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; } return hdd_setBand(dev, value[0]); @@ -8422,8 +9539,17 @@ static int __iw_set_power_params_priv(struct net_device *dev, { int ret; char *ptr; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Set power params Private"); + + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + /* ODD number is used for set, copy data using copy_from_user */ ptr = mem_alloc_copy_from_user_helper(wrqu->data.pointer, wrqu->data.length); @@ -8456,25 +9582,34 @@ static int iw_set_power_params_priv(struct net_device *dev, VOS_STATUS iw_set_power_params(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra, int nOffset) { - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_adapter_t *pAdapter; + hdd_context_t *pHddCtx; tSirSetPowerParamsReq powerRequest; char *ptr; v_U8_t ucType; v_U32_t uTotalSize, uValue; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + int ret = 0; + + ENTER(); + pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Adapter is NULL",__func__); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + return ret; + } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Power Params data len %d data %s", wrqu->data.length, extra); - 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; - } - if (wrqu->data.length <= nOffset ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "set power param input is not correct"); @@ -8589,6 +9724,7 @@ VOS_STATUS iw_set_power_params(struct net_device *dev, struct iw_request_info *i /* put the device back to power save*/ wlan_hdd_enter_bmps(pAdapter, DRIVER_POWER_MODE_AUTO); + EXIT(); return VOS_STATUS_SUCCESS; }/*iw_set_power_params*/ @@ -8616,7 +9752,7 @@ int iw_set_tdlssecoffchanneloffset(hdd_context_t *pHddCtx, int offchanoffset) { if (offchanoffset == 0) { - tdlsOffChBwOffset = 0; + tdlsOffChBwOffset = 1; VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: change tdls secondary off channel offset to %u", __func__, tdlsOffChBwOffset); @@ -8626,7 +9762,7 @@ int iw_set_tdlssecoffchanneloffset(hdd_context_t *pHddCtx, int offchanoffset) if ( offchanoffset == 40 ) { - tdlsOffChBwOffset = 1; + tdlsOffChBwOffset = 2; VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: change tdls secondary off channel offset to %u", __func__, tdlsOffChBwOffset); @@ -8642,6 +9778,18 @@ int iw_set_tdlssecoffchanneloffset(hdd_context_t *pHddCtx, int offchanoffset) return 0; } + + if ((offchanoffset == 80) && + (TRUE == sme_IsFeatureSupportedByFW(DOT11AC)) && + (TRUE == sme_IsFeatureSupportedByDriver(DOT11AC))) + { + tdlsOffChBwOffset = 4; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: change tdls secondary off channel offset to %u", + __func__, tdlsOffChBwOffset); + + return 0; + } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Invalid tdls secondary off channel offset %d", __func__, offchanoffset); return -1; @@ -8673,12 +9821,15 @@ int iw_set_tdlsoffchannelmode(hdd_adapter_t *pAdapter, int offchanmode) eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode) { /* Send TDLS Channel Switch Request to connected peer */ - connPeer = wlan_hdd_tdls_get_first_connected_peer(pAdapter); + mutex_lock(&pHddCtx->tdls_lock); + connPeer = wlan_hdd_tdls_get_connected_peer(pAdapter); if (NULL == connPeer) { + mutex_unlock(&pHddCtx->tdls_lock); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: No TDLS Connected Peer", __func__); return -1; } + mutex_unlock(&pHddCtx->tdls_lock); } else { @@ -8758,8 +9909,8 @@ static const iw_handler we_handler[] = (iw_handler) NULL, /* SIOCGIWNWID */ (iw_handler) iw_set_freq, /* SIOCSIWFREQ */ (iw_handler) iw_get_freq, /* SIOCGIWFREQ */ - (iw_handler) iw_set_mode, /* SIOCSIWMODE */ - (iw_handler) iw_get_mode, /* SIOCGIWMODE */ + (iw_handler) NULL, /* SIOCSIWMODE */ + (iw_handler) NULL, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ @@ -8851,6 +10002,10 @@ static const iw_handler we_private[] = { /*Maximum command length can be only 15 */ static const struct iw_priv_args we_private_args[] = { + { WE_SET_MONITOR_STATE, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, "monitor" }, + /* handlers for main ioctl */ { WLAN_PRIV_SET_INT_GET_NONE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, @@ -8953,11 +10108,30 @@ static const struct iw_priv_args we_private_args[] = { { WE_SET_SCAN_BAND_PREFERENCE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_scan_pref" }, + { + WE_GET_FRAME_LOG, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, + "getFrameLogs" }, { WE_SET_MIRACAST_VENDOR_CONFIG, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setMiracstConf" }, +#ifdef FEATURE_WLAN_TDLS + { + WE_SET_TDLS_2040_BSS_COEXISTENCE, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, + "tdls_2040bsscox" }, +#endif + { WE_SET_RTS_CTS_HTVHT, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, "setRtsCtsHtVht" }, + + { WE_SET_PROXIMITY_ENABLE, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, "setProximity" }, /* handlers for main ioctl */ { WLAN_PRIV_SET_NONE_GET_INT, 0, @@ -9186,7 +10360,6 @@ static const struct iw_priv_args we_private_args[] = { 0, 0, "stopOBSSScan" }, -#ifdef DEBUG_ROAM_DELAY { WE_DUMP_ROAM_TIMER_LOG, 0, @@ -9197,13 +10370,19 @@ static const struct iw_priv_args we_private_args[] = { 0, 0, "resetRoamDelay" }, -#endif + { + WE_GET_FW_LOGS, + 0, + 0, + "getFwLogs" }, /* handlers for main ioctl */ { WLAN_PRIV_SET_VAR_INT_GET_NONE, IW_PRIV_TYPE_INT | MAX_VAR_ARGS, 0, "" }, + + /* handlers for sub-ioctl */ { WE_LOG_DUMP_CMD, IW_PRIV_TYPE_INT | MAX_VAR_ARGS, @@ -9244,6 +10423,18 @@ static const struct iw_priv_args we_private_args[] = { "setTdlsConfig" }, #endif + { + WE_CONFIGURE_MONITOR_MODE, + IW_PRIV_TYPE_INT | MAX_VAR_ARGS, + 0, + "MonitorModeConf" }, + + { + WE_SET_MONITOR_MODE_FILTER, + IW_PRIV_TYPE_INT | MAX_VAR_ARGS, + 0, + "MonitorFilter" }, + /* handlers for main ioctl */ { WLAN_PRIV_ADD_TSPEC, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, @@ -9335,6 +10526,10 @@ static const struct iw_priv_args we_private_args[] = { WLAN_GET_LINK_SPEED, IW_PRIV_TYPE_CHAR | 18, IW_PRIV_TYPE_CHAR | 5, "getLinkSpeed" }, + { + WLAN_PRIV_SET_FTIES, + IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, + 0, "set_ft_ies"}, }; @@ -9612,27 +10807,13 @@ int hdd_register_wext(struct net_device *dev) int hdd_UnregisterWext(struct net_device *dev) { -#if 0 - hdd_wext_state_t *wextBuf; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - - ENTER(); - // Set up the pointer to the Wireless Extensions state structure - wextBuf = pAdapter->pWextState; - - // De-allocate the Wireless Extensions state structure - kfree(wextBuf); - - // Clear out the pointer to the Wireless Extensions state structure - pAdapter->pWextState = NULL; - - EXIT(); -#endif - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"In %s", __func__); - rtnl_lock(); - dev->wireless_handlers = NULL; - rtnl_unlock(); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"In %s %pK", __func__, dev); + if (dev != NULL) + { + rtnl_lock(); + dev->wireless_handlers = NULL; + rtnl_unlock(); + } return 0; } diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c index 077e8cb26487..f9b158658e9a 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -47,9 +47,6 @@ The remaining functions are utility functions for information hiding. - Copyright (c) 2008-9 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /*--------------------------------------------------------------------------- @@ -87,9 +84,6 @@ #define WMM_TRACE_LEVEL_INFO_LOW VOS_TRACE_LEVEL_INFO_LOW #endif - -#define WLAN_HDD_MAX_DSCP 0x3f - // DHCP Port number #define DHCP_SOURCE_PORT 0x4400 #define DHCP_DESTINATION_PORT 0x4300 @@ -133,13 +127,21 @@ static void hdd_wmm_enable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) { hdd_adapter_t* pAdapter = pQosContext->pAdapter; WLANTL_ACEnumType acType = pQosContext->acType; - hdd_wmm_ac_status_t *pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; + hdd_wmm_ac_status_t *pAc = NULL; VOS_STATUS status; v_U32_t service_interval; v_U32_t suspension_interval; sme_QosWmmDirType direction; v_BOOL_t psb; + if (acType >= WLANTL_MAX_AC) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid AC: %d", __func__, acType); + return; + } + + pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; // The TSPEC must be valid if (pAc->wmmAcTspecValid == VOS_FALSE) @@ -253,13 +255,22 @@ static void hdd_wmm_disable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) { hdd_adapter_t* pAdapter = pQosContext->pAdapter; WLANTL_ACEnumType acType = pQosContext->acType; - hdd_wmm_ac_status_t *pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; + hdd_wmm_ac_status_t *pAc = NULL; VOS_STATUS status; v_U32_t service_interval; v_U32_t suspension_interval; v_U8_t uapsd_mask; v_U8_t ActiveTspec = INVALID_TSPEC; + if (acType >= WLANTL_MAX_AC) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid AC: %d", __func__, acType); + return; + } + + pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; + // have we previously enabled UAPSD? if (pAc->wmmAcUapsdInfoValid == VOS_TRUE) { @@ -296,6 +307,10 @@ static void hdd_wmm_disable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) service_interval = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBkSrvIntv; suspension_interval = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBkSuspIntv; break; + default: + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid AC %d", __func__, acType ); + return; } status = WLANTL_EnableUAPSDForAC((WLAN_HDD_GET_CTX(pAdapter))->pvosContext, @@ -338,25 +353,39 @@ static void hdd_wmm_disable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) */ static void hdd_wmm_free_context (hdd_wmm_qos_context_t* pQosContext) { - hdd_adapter_t* pAdapter; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: Entered, context %p", + "%s: Entered, context %pK", __func__, pQosContext); + // take the wmmLock since we're manipulating the context list + mutex_lock(&pHddCtx->wmmLock); + if (unlikely((NULL == pQosContext) || (HDD_WMM_CTX_MAGIC != pQosContext->magic))) { // must have been freed in another thread + mutex_unlock(&pHddCtx->wmmLock); return; } - // get pointer to the adapter context - pAdapter = pQosContext->pAdapter; - - // take the wmmLock since we're manipulating the context list - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); - // make sure nobody thinks this is a valid context pQosContext->magic = 0; @@ -364,7 +393,7 @@ static void hdd_wmm_free_context (hdd_wmm_qos_context_t* pQosContext) list_del(&pQosContext->node); // done manipulating the list - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); // reclaim memory kfree(pQosContext); @@ -387,20 +416,41 @@ static void hdd_wmm_notify_app (hdd_wmm_qos_context_t* pQosContext) hdd_adapter_t* pAdapter; union iwreq_data wrqu; char buf[MAX_NOTIFY_LEN+1]; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: Entered, context %p", + "%s: Entered, context %pK", __func__, pQosContext); + mutex_lock(&pHddCtx->wmmLock); if (unlikely((NULL == pQosContext) || (HDD_WMM_CTX_MAGIC != pQosContext->magic))) { + mutex_unlock(&pHddCtx->wmmLock); VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, "%s: Invalid QoS Context", __func__); return; } - + // get pointer to the adapter + pAdapter = pQosContext->pAdapter; + mutex_unlock(&pHddCtx->wmmLock); // create the event memset(&wrqu, 0, sizeof(wrqu)); @@ -413,8 +463,7 @@ static void hdd_wmm_notify_app (hdd_wmm_qos_context_t* pQosContext) wrqu.data.pointer = buf; wrqu.data.length = strlen(buf); - // get pointer to the adapter - pAdapter = pQosContext->pAdapter; + // send the event VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO, @@ -496,9 +545,45 @@ void hdd_wmm_inactivity_timer_cb( v_PVOID_t pUserData ) hdd_wlan_wmm_status_e status; VOS_STATUS vos_status; v_U32_t currentTrafficCnt = 0; - WLANTL_ACEnumType acType = pQosContext->acType; + WLANTL_ACEnumType acType = 0; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + ENTER(); + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid VOS Context", __func__); + return; + } + + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (0 != (wlan_hdd_validate_context(pHddCtx))) + { + return; + } + + mutex_lock(&pHddCtx->wmmLock); + if (unlikely((NULL == pQosContext) || + (HDD_WMM_CTX_MAGIC != pQosContext->magic))) + { + mutex_unlock(&pHddCtx->wmmLock); + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid QoS Context", + __func__); + return; + } + mutex_unlock(&pHddCtx->wmmLock); + acType = pQosContext->acType; pAdapter = pQosContext->pAdapter; + if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("invalid pAdapter: %pK"), pAdapter); + return; + } + pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; // Get the Tx stats for this AC. @@ -535,6 +620,7 @@ void hdd_wmm_inactivity_timer_cb( v_PVOID_t pUserData ) } } + EXIT(); return; } @@ -644,26 +730,47 @@ static eHalStatus hdd_wmm_sme_callback (tHalHandle hHal, WLANTL_ACEnumType acType; hdd_wmm_ac_status_t *pAc; VOS_STATUS status; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return eHAL_STATUS_FAILURE; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return eHAL_STATUS_FAILURE; + } + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: Entered, context %p", + "%s: Entered, context %pK", __func__, pQosContext); + mutex_lock(&pHddCtx->wmmLock); if (unlikely((NULL == pQosContext) || (HDD_WMM_CTX_MAGIC != pQosContext->magic))) { + mutex_unlock(&pHddCtx->wmmLock); VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, "%s: Invalid QoS Context", __func__); return eHAL_STATUS_FAILURE; } + mutex_unlock(&pHddCtx->wmmLock); pAdapter = pQosContext->pAdapter; acType = pQosContext->acType; pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: status %d flowid %d info %p", + "%s: status %d flowid %d info %pK", __func__, smeStatus, qosFlowId, pCurrentQosInfo); switch (smeStatus) @@ -1306,7 +1413,7 @@ int hdd_wmmps_helper(hdd_adapter_t *pAdapter, tANI_U8 *ptr) @return : void ===========================================================================*/ -static void hdd_wmm_do_implicit_qos(struct work_struct *work) +static void __hdd_wmm_do_implicit_qos(struct work_struct *work) { hdd_wmm_qos_context_t* pQosContext = container_of(work, hdd_wmm_qos_context_t, wmmAcSetupImplicitQos); @@ -1318,25 +1425,47 @@ static void hdd_wmm_do_implicit_qos(struct work_struct *work) sme_QosStatusType smeStatus; #endif sme_QosWmmTspecInfo qosInfo; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + int ret = 0; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + { + hddLog(LOGE, FL("HDD context is invalid")); + return; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: Entered, context %p", + "%s: Entered, context %pK", __func__, pQosContext); + mutex_lock(&pHddCtx->wmmLock); if (unlikely(HDD_WMM_CTX_MAGIC != pQosContext->magic)) { + mutex_unlock(&pHddCtx->wmmLock); VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, "%s: Invalid QoS Context", __func__); return; } + mutex_unlock(&pHddCtx->wmmLock); pAdapter = pQosContext->pAdapter; acType = pQosContext->acType; pAc = &pAdapter->hddWmmStatus.wmmAcStatus[acType]; VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: pAdapter %p acType %d", + "%s: pAdapter %pK acType %d", __func__, pAdapter, acType); if (!pAc->wmmAcAccessNeeded) @@ -1392,7 +1521,6 @@ static void hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.surplus_bw_allowance = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraSbaAcVi; qosInfo.suspension_interval = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdViSuspIntv; break; - default: case WLANTL_AC_BE: qosInfo.ts_info.up = SME_QOS_WMM_UP_BE; /* Check if there is any valid configuration from framework */ @@ -1427,6 +1555,10 @@ static void hdd_wmm_do_implicit_qos(struct work_struct *work) qosInfo.surplus_bw_allowance = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraSbaAcBk; qosInfo.suspension_interval = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBkSuspIntv; break; + default: + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + "%s: Invalid AC %d", __func__, acType ); + return; } #ifdef FEATURE_WLAN_ESE qosInfo.inactivity_interval = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraInactivityInterval; @@ -1456,9 +1588,9 @@ static void hdd_wmm_do_implicit_qos(struct work_struct *work) } } - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); + mutex_lock(&pHddCtx->wmmLock); list_add(&pQosContext->node, &pAdapter->hddWmmStatus.wmmContextList); - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); #ifndef WLAN_MDM_CODE_REDUCTION_OPT smeStatus = sme_QosSetupReq(WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -1535,6 +1667,13 @@ static void hdd_wmm_do_implicit_qos(struct work_struct *work) } +static void hdd_wmm_do_implicit_qos(struct work_struct *work) +{ + vos_ssr_protect(__func__); + __hdd_wmm_do_implicit_qos( work ); + vos_ssr_unprotect(__func__); +} + /**============================================================================ @brief hdd_wmm_init() - Function which will initialize the WMM configuation and status to an initial state. The configuration can later be overwritten @@ -1555,7 +1694,7 @@ VOS_STATUS hdd_wmm_init ( hdd_adapter_t *pAdapter ) "%s: Entered", __func__); // DSCP to User Priority Lookup Table - for (dscp = 0; dscp <= WLAN_HDD_MAX_DSCP; dscp++) + for (dscp = 0; dscp <= WLAN_MAX_DSCP; dscp++) { hddWmmDscpToUpMap[dscp] = SME_QOS_WMM_UP_BE; } @@ -1590,7 +1729,6 @@ VOS_STATUS hdd_wmm_adapter_init( hdd_adapter_t *pAdapter ) pAdapter->hddWmmStatus.wmmQap = VOS_FALSE; INIT_LIST_HEAD(&pAdapter->hddWmmStatus.wmmContextList); - mutex_init(&pAdapter->hddWmmStatus.wmmLock); for (acType = 0; acType < WLANTL_MAX_AC; acType++) { @@ -1654,6 +1792,23 @@ VOS_STATUS hdd_wmm_adapter_clear( hdd_adapter_t *pAdapter ) VOS_STATUS hdd_wmm_adapter_close ( hdd_adapter_t* pAdapter ) { hdd_wmm_qos_context_t* pQosContext; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return VOS_STATUS_E_FAILURE; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return VOS_STATUS_E_FAILURE; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, "%s: Entered", __func__); @@ -1666,14 +1821,15 @@ VOS_STATUS hdd_wmm_adapter_close ( hdd_adapter_t* pAdapter ) #ifdef FEATURE_WLAN_ESE hdd_wmm_disable_inactivity_timer(pQosContext); #endif -#ifdef WLAN_OPEN_SOURCE + mutex_lock(&pHddCtx->wmmLock); if (pQosContext->handle == HDD_WMM_HANDLE_IMPLICIT && pQosContext->magic == HDD_WMM_CTX_MAGIC) { - cancel_work_sync(&pQosContext->wmmAcSetupImplicitQos); + vos_flush_work(&pQosContext->wmmAcSetupImplicitQos); } -#endif + mutex_unlock(&pHddCtx->wmmLock); + hdd_wmm_free_context(pQosContext); } @@ -1681,14 +1837,14 @@ VOS_STATUS hdd_wmm_adapter_close ( hdd_adapter_t* pAdapter ) } /**============================================================================ - @brief is_dhcp_packet() - Function which will check OS packet for + @brief hdd_is_dhcp_packet() - Function which will check OS packet for DHCP packet @param skb : [in] pointer to OS packet (sk_buff) @return : VOS_TRUE if the OS packet is DHCP packet : otherwise VOS_FALSE ===========================================================================*/ -v_BOOL_t is_dhcp_packet(struct sk_buff *skb) +v_BOOL_t hdd_is_dhcp_packet(struct sk_buff *skb) { if (*((u16*)((u8*)skb->data+34)) == DHCP_SOURCE_PORT || *((u16*)((u8*)skb->data+34)) == DHCP_DESTINATION_PORT) @@ -1697,6 +1853,28 @@ v_BOOL_t is_dhcp_packet(struct sk_buff *skb) return VOS_FALSE; } +/**============================================================================ + @brief hdd_skb_is_eapol_or_wai_packet() - Function which will check OS packet + for Eapol/Wapi packet + + @param skb : [in] pointer to OS packet (sk_buff) + @return : VOS_TRUE if the OS packet is an Eapol or a Wapi packet + : otherwise VOS_FALSE + ===========================================================================*/ +v_BOOL_t hdd_skb_is_eapol_or_wai_packet(struct sk_buff *skb) +{ + if ((*((u16*)((u8*)skb->data+HDD_ETHERTYPE_802_1_X_FRAME_OFFSET)) + == vos_cpu_to_be16(HDD_ETHERTYPE_802_1_X)) +#ifdef FEATURE_WLAN_WAPI + || (*((u16*)((u8*)skb->data+HDD_ETHERTYPE_802_1_X_FRAME_OFFSET)) + == vos_cpu_to_be16(HDD_ETHERTYPE_WAI)) +#endif + ) + return VOS_TRUE; + + return VOS_FALSE; +} + /**============================================================================ @brief hdd_wmm_classify_pkt() - Function which will classify an OS packet into a WMM AC based on either 802.1Q or DSCP @@ -1809,6 +1987,8 @@ v_VOID_t hdd_wmm_classify_pkt ( hdd_adapter_t* pAdapter, } else { + v_BOOL_t toggleArpBDRates = + (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->toggleArpBDRates; // default #ifdef HDD_WMM_DEBUG VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_WARN, @@ -1818,6 +1998,11 @@ v_VOID_t hdd_wmm_classify_pkt ( hdd_adapter_t* pAdapter, //Give the highest priority to 802.1x packet if (pHdr->eth_II.h_proto == htons(HDD_ETHERTYPE_802_1_X)) tos = 0xC0; + else if (toggleArpBDRates && + pHdr->eth_II.h_proto == htons(HDD_ETHERTYPE_ARP)) + { + tos = TID3; + } else tos = 0; } @@ -1894,7 +2079,14 @@ v_VOID_t hdd_wmm_classify_pkt ( hdd_adapter_t* pAdapter, @return : Qdisc queue index ===========================================================================*/ -v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) +v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + , void *accel_priv +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + , select_queue_fallback_t fallbac +#endif +) { WLANTL_ACEnumType ac; sme_QosWmmUpType up = SME_QOS_WMM_UP_BE; @@ -1903,23 +2095,32 @@ v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) hdd_adapter_t *pAdapter = (hdd_adapter_t *)netdev_priv(dev); hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); v_U8_t STAId; - v_U8_t *pSTAId = (v_U8_t *)(((v_U8_t *)(skb->data)) - 1); v_CONTEXT_t pVosContext = ( WLAN_HDD_GET_CTX(pAdapter))->pvosContext; ptSapContext pSapCtx = NULL; + int status = 0; + + status = wlan_hdd_validate_context(pHddCtx); + if (status !=0 ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("called during WDReset/unload")); + skb->priority = SME_QOS_WMM_UP_BE; + return HDD_LINUX_AC_BE; + } + pSapCtx = VOS_GET_SAP_CB(pVosContext); if(pSapCtx == NULL){ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("psapCtx is NULL")); - *pSTAId = HDD_WLAN_INVALID_STA_ID; + STAId = HDD_WLAN_INVALID_STA_ID; goto done; } /*Get the Station ID*/ - if (VOS_STATUS_SUCCESS != hdd_softap_GetStaId(pAdapter, pDestMacAddress, &STAId)) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_INFO, - "%s: Failed to find right station", __func__); - *pSTAId = HDD_WLAN_INVALID_STA_ID; - goto done; + STAId = hdd_sta_id_find_from_mac_addr(pAdapter, pDestMacAddress); + if (STAId == HDD_WLAN_INVALID_STA_ID || STAId >= WLAN_MAX_STA_COUNT) { + VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_INFO, + "%s: Failed to find right station", __func__); + goto done; } spin_lock_bh( &pSapCtx->staInfo_lock ); @@ -1928,7 +2129,7 @@ v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_INFO, "%s: Station MAC address does not matching", __func__); - *pSTAId = HDD_WLAN_INVALID_STA_ID; + STAId = HDD_WLAN_INVALID_STA_ID; goto release_lock; } if (pSapCtx->aStaInfo[STAId].isUsed && pSapCtx->aStaInfo[STAId].isQosEnabled && (HDD_WMM_USER_MODE_NO_QOS != pHddCtx->cfg_ini->WmmMode)) @@ -1936,7 +2137,7 @@ v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) /* Get the user priority from IP header & corresponding AC */ hdd_wmm_classify_pkt (pAdapter, skb, &ac, &up); //If 3/4th of Tx queue is used then place the DHCP packet in VOICE AC queue - if (pSapCtx->aStaInfo[STAId].vosLowResource && is_dhcp_packet(skb)) + if (pSapCtx->aStaInfo[STAId].vosLowResource && hdd_is_dhcp_packet(skb)) { VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_WARN, "%s: Making priority of DHCP packet as VOICE", __func__); @@ -1944,7 +2145,6 @@ v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) ac = hddWmmUpToAcMap[up]; } } - *pSTAId = STAId; release_lock: spin_unlock_bh( &pSapCtx->staInfo_lock ); @@ -1978,10 +2178,11 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb) sme_QosWmmUpType up = SME_QOS_WMM_UP_BE; v_USHORT_t queueIndex; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + int status = 0; - if (isWDresetInProgress()) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - FL("called during WDReset")); + status = wlan_hdd_validate_context(pHddCtx); + if (status !=0) { skb->priority = SME_QOS_WMM_UP_BE; return HDD_LINUX_AC_BE; } @@ -1989,40 +2190,40 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb) /*Get the Station ID*/ if (WLAN_HDD_IBSS == pAdapter->device_mode) { - v_U8_t *pSTAId = (v_U8_t *)(((v_U8_t *)(skb->data)) - 1); v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; + v_U8_t STAId; - if ( VOS_STATUS_SUCCESS != - hdd_Ibss_GetStaId(&pAdapter->sessionCtx.station, - pDestMacAddress, pSTAId)) + STAId = hdd_sta_id_find_from_mac_addr(pAdapter, pDestMacAddress); + if ((STAId == HDD_WLAN_INVALID_STA_ID) && + !vos_is_macaddr_broadcast( pDestMacAddress ) && + !vos_is_macaddr_group(pDestMacAddress)) { - *pSTAId = HDD_WLAN_INVALID_STA_ID; - if ( !vos_is_macaddr_broadcast( pDestMacAddress ) && - !vos_is_macaddr_group(pDestMacAddress)) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Failed to find right station pDestMacAddress: " MAC_ADDRESS_STR , __func__, MAC_ADDR_ARRAY(pDestMacAddress->bytes)); - goto done; - } + goto done; } } - // if we don't want QoS or the AP doesn't support Qos - // All traffic will get equal opportuniy to transmit data frames. - if( hdd_wmm_is_active(pAdapter) ) { - /* Get the user priority from IP header & corresponding AC */ - hdd_wmm_classify_pkt (pAdapter, skb, &ac, &up); - //If 3/4th of BE AC Tx queue is full, then place the DHCP packet in VOICE AC queue - if (pAdapter->isVosLowResource && is_dhcp_packet(skb)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_WARN, - "%s: BestEffort Tx Queue is 3/4th full" - " Make DHCP packet's pri as VO", __func__); - up = SME_QOS_WMM_UP_VO; - ac = hddWmmUpToAcMap[up]; - } + /* All traffic will get equal opportuniy to transmit data frames. */ + /* Get the user priority from IP header & corresponding AC */ + hdd_wmm_classify_pkt (pAdapter, skb, &ac, &up); + + /* If 3/4th of BE AC Tx queue is full, + * then place the DHCP packet in VOICE AC queue. + * Doing this for IBSS alone, since for STA interface + * types, these packets will be queued to the new queue. + */ + if ((WLAN_HDD_IBSS == pAdapter->device_mode) && + pAdapter->isVosLowResource && hdd_is_dhcp_packet(skb)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_WARN, + "%s: BestEffort Tx Queue is 3/4th full" + " Make DHCP packet's pri as VO", __func__); + up = SME_QOS_WMM_UP_VO; + ac = hddWmmUpToAcMap[up]; } + done: skb->priority = up; if(skb->priority < SME_QOS_WMM_UP_MAX) @@ -2034,6 +2235,19 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb) queueIndex = hddLinuxUpToAcMap[SME_QOS_WMM_UP_BE]; } + if ((WLAN_HDD_IBSS != pAdapter->device_mode) && + (hdd_is_dhcp_packet(skb) || + hdd_skb_is_eapol_or_wai_packet(skb))) + { + /* If the packet is a DHCP packet or a Eapol packet or + * a Wapi packet, then queue it to the new queue for + * STA interfaces alone. + */ + queueIndex = WLANTL_AC_HIGH_PRIO; + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, + "%s: up=%d QIndex:%d", __func__, up, queueIndex); + } + return queueIndex; } @@ -2139,7 +2353,7 @@ VOS_STATUS hdd_wmm_acquire_access( hdd_adapter_t* pAdapter, // we need to establish implicit QoS VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO, - "%s: Need to schedule implicit QoS for TL AC %d, pAdapter is %p", + "%s: Need to schedule implicit QoS for TL AC %d, pAdapter is %pK", __func__, acType, pAdapter); pAdapter->hddWmmStatus.wmmAcStatus[acType].wmmAcAccessNeeded = VOS_TRUE; @@ -2160,11 +2374,11 @@ VOS_STATUS hdd_wmm_acquire_access( hdd_adapter_t* pAdapter, pQosContext->qosFlowId = 0; pQosContext->handle = HDD_WMM_HANDLE_IMPLICIT; pQosContext->magic = HDD_WMM_CTX_MAGIC; - INIT_WORK(&pQosContext->wmmAcSetupImplicitQos, + vos_init_work(&pQosContext->wmmAcSetupImplicitQos, hdd_wmm_do_implicit_qos); VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO, - "%s: Scheduling work for AC %d, context %p", + "%s: Scheduling work for AC %d, context %pK", __func__, acType, pQosContext); schedule_work(&pQosContext->wmmAcSetupImplicitQos); @@ -2360,7 +2574,14 @@ VOS_STATUS hdd_wmm_connect( hdd_adapter_t* pAdapter, // admission is required pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessRequired = VOS_TRUE; - pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed = VOS_FALSE; + //Mark wmmAcAccessAllowed as True if implicit Qos is disabled as there + //is no need to hold packets in queue during hdd_tx_fetch_packet_cbk + if (!(WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->bImplicitQosEnabled) + pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed = + VOS_TRUE; + else + pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed = + VOS_FALSE; pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessGranted = VOS_FALSE; /* Making TSPEC invalid here so downgrading can be happen while roaming @@ -2513,12 +2734,29 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter, sme_QosStatusType smeStatus; #endif v_BOOL_t found = VOS_FALSE; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return HDD_WLAN_WMM_STATUS_SETUP_FAILED; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return HDD_WLAN_WMM_STATUS_SETUP_FAILED; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, "%s: Entered with handle 0x%x", __func__, handle); // see if a context already exists with the given handle - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); + mutex_lock(&pHddCtx->wmmLock); list_for_each_entry(pQosContext, &pAdapter->hddWmmStatus.wmmContextList, node) @@ -2529,7 +2767,7 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter, break; } } - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); if (found) { // record with that handle already exists @@ -2571,8 +2809,12 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter, return HDD_WLAN_WMM_STATUS_MODIFY_FAILED; } - // we were successful, save the status - pQosContext->lastStatus = status; + mutex_lock(&pHddCtx->wmmLock); + if (pQosContext->magic == HDD_WMM_CTX_MAGIC) + { + pQosContext->lastStatus = status; + } + mutex_unlock(&pHddCtx->wmmLock); return status; } @@ -2598,17 +2840,18 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter, HDD_WMM_UP_TO_AC_MAP_SIZE - 1, hddWmmUpToAcMap[0]); pQosContext->acType = hddWmmUpToAcMap[0]; } + pQosContext->pAdapter = pAdapter; pQosContext->qosFlowId = 0; - pQosContext->magic = HDD_WMM_CTX_MAGIC; VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO, - "%s: Setting up QoS, context %p", + "%s: Setting up QoS, context %pK", __func__, pQosContext); - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); + mutex_lock(&pHddCtx->wmmLock); + pQosContext->magic = HDD_WMM_CTX_MAGIC; list_add(&pQosContext->node, &pAdapter->hddWmmStatus.wmmContextList); - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); #ifndef WLAN_MDM_CODE_REDUCTION_OPT smeStatus = sme_QosSetupReq(WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -2660,7 +2903,12 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter, #endif // we were successful, save the status - pQosContext->lastStatus = status; + mutex_lock(&pHddCtx->wmmLock); + if (pQosContext->magic == HDD_WMM_CTX_MAGIC) + { + pQosContext->lastStatus = status; + } + mutex_unlock(&pHddCtx->wmmLock); return status; } @@ -2685,12 +2933,29 @@ hdd_wlan_wmm_status_e hdd_wmm_delts( hdd_adapter_t* pAdapter, #ifndef WLAN_MDM_CODE_REDUCTION_OPT sme_QosStatusType smeStatus; #endif + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return HDD_WLAN_WMM_STATUS_RELEASE_FAILED; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return HDD_WLAN_WMM_STATUS_RELEASE_FAILED; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, "%s: Entered with handle 0x%x", __func__, handle); // locate the context with the given handle - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); + mutex_lock(&pHddCtx->wmmLock); list_for_each_entry(pQosContext, &pAdapter->hddWmmStatus.wmmContextList, node) @@ -2703,7 +2968,7 @@ hdd_wlan_wmm_status_e hdd_wmm_delts( hdd_adapter_t* pAdapter, break; } } - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); if (VOS_FALSE == found) { @@ -2715,7 +2980,7 @@ hdd_wlan_wmm_status_e hdd_wmm_delts( hdd_adapter_t* pAdapter, VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: found handle 0x%x, flow %d, AC %d, context %p", + "%s: found handle 0x%x, flow %d, AC %d, context %pK", __func__, handle, qosFlowId, acType, pQosContext); #ifndef WLAN_MDM_CODE_REDUCTION_OPT @@ -2770,7 +3035,12 @@ hdd_wlan_wmm_status_e hdd_wmm_delts( hdd_adapter_t* pAdapter, } #endif - pQosContext->lastStatus = status; + mutex_lock(&pHddCtx->wmmLock); + if (pQosContext->magic == HDD_WMM_CTX_MAGIC) + { + pQosContext->lastStatus = status; + } + mutex_unlock(&pHddCtx->wmmLock); return status; } @@ -2788,12 +3058,29 @@ hdd_wlan_wmm_status_e hdd_wmm_checkts( hdd_adapter_t* pAdapter, { hdd_wmm_qos_context_t *pQosContext; hdd_wlan_wmm_status_e status = HDD_WLAN_WMM_STATUS_LOST; + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); + hdd_context_t *pHddCtx; + + if (NULL == pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("pVosContext is NULL")); + return HDD_WLAN_WMM_STATUS_LOST; + } + + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_ERROR, + FL("HddCtx is NULL")); + return HDD_WLAN_WMM_STATUS_LOST; + } VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, "%s: Entered with handle 0x%x", __func__, handle); // locate the context with the given handle - mutex_lock(&pAdapter->hddWmmStatus.wmmLock); + mutex_lock(&pHddCtx->wmmLock); list_for_each_entry(pQosContext, &pAdapter->hddWmmStatus.wmmContextList, node) @@ -2801,13 +3088,13 @@ hdd_wlan_wmm_status_e hdd_wmm_checkts( hdd_adapter_t* pAdapter, if (pQosContext->handle == handle) { VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO_LOW, - "%s: found handle 0x%x, context %p", + "%s: found handle 0x%x, context %pK", __func__, handle, pQosContext); status = pQosContext->lastStatus; break; } } - mutex_unlock(&pAdapter->hddWmmStatus.wmmLock); + mutex_unlock(&pHddCtx->wmmLock); return status; } diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wowl.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wowl.c index 4b82ba87c524..ad3f5fa1a9bf 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wowl.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wowl.c @@ -28,9 +28,6 @@ /*============================================================================ * @file wlan_hdd_wowl.c * - * Copyright (c) 2009 QUALCOMM Incorporated. - * All Rights Reserved. - * Qualcomm Confidential and Proprietary * * ==========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/inc/aniGlobal.h b/drivers/staging/prima/CORE/MAC/inc/aniGlobal.h index 5f3e1f1f6589..be90e1fdd3fc 100644 --- a/drivers/staging/prima/CORE/MAC/inc/aniGlobal.h +++ b/drivers/staging/prima/CORE/MAC/inc/aniGlobal.h @@ -231,15 +231,10 @@ typedef struct sLimTimers #ifdef FEATURE_WLAN_ESE TX_TIMER gLimEseTsmTimer; #endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL - TX_TIMER gLimTdlsDisRspWaitTimer; - TX_TIMER gLimTdlsLinkSetupRspTimeouTimer; - TX_TIMER gLimTdlsLinkSetupCnfTimeoutTimer; -#endif - TX_TIMER gLimPeriodicJoinProbeReqTimer; TX_TIMER gLimDisassocAckTimer; TX_TIMER gLimDeauthAckTimer; + TX_TIMER gLimPeriodicAuthRetryTimer; // This timer is started when single shot NOA insert msg is sent to FW for scan in P2P GO mode TX_TIMER gLimP2pSingleShotNoaInsertTimer; /* This timer is used to convert active channel to @@ -374,6 +369,8 @@ typedef struct sAniSirLim ////////////////////////////////////// SCAN/LEARN RELATED START /////////////////////////////////////////// tSirMacAddr gSelfMacAddr; //added for BT-AMP Support + tSirMacAddr spoofMacAddr; //added for Mac Addr Spoofing support + tANI_U8 isSpoofingEnabled; ////////////////////////////////////////// BSS RELATED END /////////////////////////////////////////// // Place holder for StartBssReq message @@ -423,6 +420,7 @@ typedef struct sAniSirLim /// Definition for storing IBSS peers BSS description tLimIbssPeerNode *gLimIbssPeerList; tANI_U32 gLimNumIbssPeers; + tANI_U32 gLimIbssRetryCnt; // ibss info - params for which ibss to join while coalescing tAniSirLimIbss ibssInfo; @@ -860,22 +858,6 @@ typedef struct sAniSirLim //////////////////////////////// HT RELATED ////////////////////////////////////////// -#ifdef FEATURE_WLAN_TDLS_INTERNAL - //////////////////////////////// TDLS RELATED ////////////////////////////////////////// - - tSirTdlsDisReq gLimTdlsDisReq ; - //tLimDisResultList *gTdlsDisResultList ; - tLimDisResultList *gLimTdlsDisResultList ; - tANI_U8 gLimTdlsDisStaCount ; - tANI_U8 gAddStaDisRspWait ; - - tLimTdlsLinkSetupInfo gLimTdlsLinkSetupInfo; - - /* to track if direct link is b/g/n, this can be independent of AP link */ -#ifdef FEATURE_WLAN_TDLS_NEGATIVE - tANI_U32 gLimTdlsNegativeBehavior; -#endif -#endif #ifdef FEATURE_WLAN_TDLS tANI_U8 gLimAddStaTdls ; tANI_U8 gLimTdlsLinkMode ; @@ -922,6 +904,8 @@ tLimMlmOemDataRsp *gpLimMlmOemDataRsp; * debug marker frame. */ tANI_U32 remOnChnSeqNum; + tANI_U32 txBdToken; + tANI_U32 EnableTdls2040BSSCoexIE; } tAniSirLim, *tpAniSirLim; typedef struct sLimMgmtFrameRegistration @@ -992,6 +976,13 @@ typedef struct sHalMacStartParameters } tHalMacStartParameters; +typedef enum +{ + LIM_AUTH_ACK_NOT_RCD, + LIM_AUTH_ACK_RCD_SUCCESS, + LIM_AUTH_ACK_RCD_FAILURE, +} tAuthAckStatus; + // ------------------------------------------------------------------- /// MAC Sirius parameter structure typedef struct sAniSirGlobal @@ -1028,9 +1019,6 @@ typedef struct sAniSirGlobal #ifdef FEATURE_OEM_DATA_SUPPORT tOemDataStruct oemData; -#endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL - tCsrTdlsCtxStruct tdlsCtx ; #endif tPmcInfo pmc; tSmeBtcInfo btc; @@ -1074,7 +1062,12 @@ typedef struct sAniSirGlobal v_BOOL_t isCoexScoIndSet; v_U8_t miracast_mode; + v_U8_t fBtcEnableIndTimerVal; + v_U8_t roamDelayStatsEnabled; tANI_BOOLEAN miracastVendorConfig; + v_BOOL_t fActiveScanOnDFSChannels; + tAuthAckStatus authAckStatus; + sir_mgmt_frame_ind_callback mgmt_frame_ind_cb; } tAniSirGlobal; #ifdef FEATURE_WLAN_TDLS diff --git a/drivers/staging/prima/CORE/MAC/inc/aniSystemDefs.h b/drivers/staging/prima/CORE/MAC/inc/aniSystemDefs.h index 7c0aded8a777..0eb1cce4205b 100644 --- a/drivers/staging/prima/CORE/MAC/inc/aniSystemDefs.h +++ b/drivers/staging/prima/CORE/MAC/inc/aniSystemDefs.h @@ -159,7 +159,7 @@ typedef struct sSirRSNie typedef struct sSirAddie { tANI_U16 length; - tANI_U8 addIEdata[SIR_MAC_MAX_IE_LENGTH+2]; + tANI_U8 addIEdata[SIR_MAC_MAX_ADD_IE_LENGTH+2]; } tSirAddie, *tpSirAddie; #ifdef FEATURE_WLAN_ESE @@ -222,6 +222,18 @@ typedef struct sSirMicFailureInfo } tSirMicFailureInfo, *tpSirMicFailureInfo; +typedef struct sSirLostLinkParamsInfo +{ + tANI_U8 bssIdx; + tANI_U8 rssi; + tSirMacAddr selfMacAddr; + tANI_U32 linkFlCnt; + tANI_U32 linkFlTx; + tANI_U32 lastDataRate; + tANI_U32 rsvd1; + tANI_U32 rsvd2; +}tSirLostLinkParamsInfo, *tpSirLostLinkParamsInfo; + // Boa command. Used mainly for radar info persistance typedef struct sBoaCommand { diff --git a/drivers/staging/prima/CORE/MAC/inc/macTrace.h b/drivers/staging/prima/CORE/MAC/inc/macTrace.h index 70e29367ac60..2ee4c7fc02cb 100644 --- a/drivers/staging/prima/CORE/MAC/inc/macTrace.h +++ b/drivers/staging/prima/CORE/MAC/inc/macTrace.h @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h b/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h index 1e0b536e015e..f21d131c8f79 100644 --- a/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h +++ b/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -37,18 +37,15 @@ BRIEF DESCRIPTION: Build number automaticly updated by build scripts. - Copyright (c) 2008-2011 QUALCOMM Incorporated. - All Right Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ #define QWLAN_VERSION_MAJOR 3 -#define QWLAN_VERSION_MINOR 8 -#define QWLAN_VERSION_PATCH 20 +#define QWLAN_VERSION_MINOR 0 +#define QWLAN_VERSION_PATCH 10 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 24 +#define QWLAN_VERSION_BUILD 85 -#define QWLAN_VERSIONSTR "3.8.20.24" +#define QWLAN_VERSIONSTR "3.0.10.085" #endif /* QWLAN_VERSION_H */ diff --git a/drivers/staging/prima/CORE/MAC/inc/sirApi.h b/drivers/staging/prima/CORE/MAC/inc/sirApi.h index 0d924383aa8f..51d442b0c961 100644 --- a/drivers/staging/prima/CORE/MAC/inc/sirApi.h +++ b/drivers/staging/prima/CORE/MAC/inc/sirApi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -176,6 +176,7 @@ enum eSirHostMsgTypes enum { SIR_BOOT_MODULE_ID = 1, SIR_HAL_MODULE_ID = 0x10, + SIR_HAL_EXT_MODULE_ID = 0x11, SIR_CFG_MODULE_ID = 0x12, SIR_LIM_MODULE_ID, SIR_ARQ_MODULE_ID, @@ -340,6 +341,7 @@ typedef enum eSirResultCodes eSIR_SME_BMPS_REQ_FAILED, eSIR_SME_BMPS_REQ_REJECT, eSIR_SME_UAPSD_REQ_FAILED, + eSIR_SME_UAPSD_REQ_INVALID, eSIR_SME_WOWL_ENTER_REQ_FAILED, eSIR_SME_WOWL_EXIT_REQ_FAILED, #if defined WLAN_FEATURE_VOWIFI_11R @@ -679,6 +681,9 @@ typedef struct sSirSmeStartBssReq tANI_BOOLEAN pmfRequired; #endif +#ifdef WLAN_FEATURE_AP_HT40_24G + tANI_BOOLEAN apHT40_24GEnabled; +#endif } tSirSmeStartBssReq, *tpSirSmeStartBssReq; #define GET_IE_LEN_IN_BSS(lenInBss) ( lenInBss + sizeof(lenInBss) - \ @@ -1035,6 +1040,7 @@ typedef struct sSirSmeJoinReq tSirBssType bsstype; // add new type for BT -AMP STA and AP Modules tANI_U8 dot11mode; // to support BT-AMP tVOS_CON_MODE staPersona; //Persona + tANI_BOOLEAN bOSENAssociation; //HS2.0 ePhyChanBondState cbMode; // Pass CB mode value in Join. /*This contains the UAPSD Flag for all 4 AC @@ -1047,6 +1053,7 @@ typedef struct sSirSmeJoinReq tSirMacRateSet operationalRateSet;// Has 11a or 11b rates tSirMacRateSet extendedRateSet; // Has 11g rates + tANI_U16 rateBitMap; tSirRSNie rsnIE; // RSN IE to be sent in // (Re) Association Request #ifdef FEATURE_WLAN_ESE @@ -1185,6 +1192,9 @@ typedef struct sSirSmeAssocInd tSirMacPowerCapInfo powerCap; tSirSupChnl supportedChannels; tAniBool wmmEnabledSta; /* if present - STA is WMM enabled */ +#ifdef WLAN_FEATURE_AP_HT40_24G + tAniBool HT40MHzIntoEnabledSta; /* if present - STA Enable 40 MHz Intolerant */ +#endif tAniBool reassocReq; // Required for indicating the frames to upper layer tANI_U32 beaconLength; @@ -1745,6 +1755,15 @@ typedef struct sSirSmeMicFailureInd tSirMicFailureInfo info; } tSirSmeMicFailureInd, *tpSirSmeMicFailureInd; +typedef struct sSirSmeLostLinkParamsInd +{ + tANI_U16 messageType; + tANI_U16 length; + tANI_U8 sessionId; + tSirLostLinkParamsInfo info; +} tSirSmeLostLinkParamsInd, *tpSirSmeLostLinkParamsInd; + + typedef struct sSirSmeMissedBeaconInd { tANI_U16 messageType; // eWNI_SME_MISSED_BEACON_IND @@ -3418,6 +3437,28 @@ typedef struct sSirChangeBIParams tANI_U8 sessionId; // Session ID } tSirChangeBIParams, *tpSirChangeBIParams; +#ifdef WLAN_FEATURE_AP_HT40_24G +typedef struct sSirSetHT2040Mode +{ + tANI_U16 messageType; + tANI_U16 length; + tANI_U8 cbMode; + tSirMacAddr bssId; + tANI_U8 sessionId; // Session ID +} tSirSetHT2040Mode, *tpSirSetHT2040Mode; + +typedef struct sSirHT2040CoexInfoInd +{ + tANI_U16 messageType; // eWNI_SME_2040_COEX_IND + tANI_U16 length; + tANI_U8 sessionId; + tANI_U8 HT40MHzIntolerant; + tANI_U8 HT20MHzBssWidthReq; + tANI_U8 channel_num; + tANI_U8 HT2040BssIntoChanReport [1]; //variable +}tSirHT2040CoexInfoInd, *tpSirHT2040CoexInfoInd; +#endif + typedef struct sSirOBSSHT40Param { tANI_U16 OBSSScanPassiveDwellTime; @@ -3601,6 +3642,13 @@ typedef struct sSirSmeDelStaSelfRsp tSirMacAddr selfMacAddr; }tSirSmeDelStaSelfRsp, *tpSirSmeDelStaSelfRsp; +typedef enum DFSChanScanType +{ + DFS_CHNL_SCAN_DISABLED, + DFS_CHNL_SCAN_ENABLED_NORMAL, + DFS_CHNL_SCAN_ENABLED_ACTIVE +}eDFSChanScanType; + /* Coex Indication defines - should match WLAN_COEX_IND_DATA_SIZE should match WLAN_COEX_IND_TYPE_DISABLE_HB_MONITOR @@ -3615,6 +3663,8 @@ typedef struct sSirSmeDelStaSelfRsp #define SIR_COEX_IND_TYPE_ENABLE_UAPSD (6) #define SIR_COEX_IND_TYPE_DISABLE_UAPSD (7) #define SIR_COEX_IND_TYPE_CXM_FEATURES_NOTIFICATION (8) +#define SIR_COEX_IND_TYPE_TDLS_ENABLE (6) +#define SIR_COEX_IND_TYPE_TDLS_DISABLE (7) typedef struct sSirSmeCoexInd { @@ -3626,8 +3676,7 @@ typedef struct sSirSmeCoexInd typedef struct sSirSmeMgmtFrameInd { - tANI_U16 mesgType; - tANI_U16 mesgLen; + tANI_U16 frameLen; tANI_U32 rxChan; tANI_U8 sessionId; tANI_U8 frameType; @@ -3680,6 +3729,48 @@ typedef struct sSirWlanSetRxpFilters tANI_U8 setMcstBcstFilter; }tSirWlanSetRxpFilters,*tpSirWlanSetRxpFilters; +typedef void(*FWLoggingInitReqCb)(void *fwlogInitCbContext, VOS_STATUS status); +typedef void ( *tGetFrameLogCallback) (void *pContext); + +typedef struct sAniGetFrameLogReq +{ + tANI_U16 msgType; + tANI_U16 msgLen; + tANI_U8 getFrameLogCmdFlag; +} tAniGetFrameLogReq, *tpAniGetFrameLogReq; + +/** + * struct s_ani_set_tx_max_pwr - Req params to set max tx power + * @bssid: bssid to set the power cap for + * @self_mac_addr:self mac address + * @power: power to set in dB + */ +struct s_ani_set_tx_max_pwr +{ + tSirMacAddr bssid; + tSirMacAddr self_sta_mac_addr; + tPowerdBm power; +}; + + + +typedef struct sSirFWLoggingInitParam +{ + tANI_U8 enableFlag; + tANI_U8 frameType; + tANI_U8 frameSize; + tANI_U8 bufferMode; + tANI_U8 continuousFrameLogging; + tANI_U8 minLogBufferSize; + tANI_U8 maxLogBufferSize; + FWLoggingInitReqCb fwlogInitCallback; + void *fwlogInitCbContext; +}tSirFWLoggingInitParam,*tpSirFWLoggingInitParam; + +typedef struct sSirFatalEventLogsReqParam +{ + tANI_U32 reason_code; +}tSirFatalEventLogsReqParam, *tpSirFatalEventLogsReqParam; #ifdef FEATURE_WLAN_SCAN_PNO // @@ -4237,167 +4328,6 @@ typedef struct }tSirTdlsChanSwitchReqRsp, *tpSirTdlsChanSwitchReqRsp; #endif /* FEATURE_WLAN_TDLS */ -#ifdef FEATURE_WLAN_TDLS_INTERNAL -typedef enum tdlsListType -{ - TDLS_DIS_LIST, - TDLS_SETUP_LIST -}eTdlsListType ; - -typedef enum tdlsStates -{ - TDLS_LINK_IDLE_STATE, - TDLS_LINK_DIS_INIT_STATE, - TDLS_LINK_DIS_RSP_WAIT_STATE, - TDLS_DIS_REQ_PROCESS_STATE, - TDLS_DIS_RSP_SENT_WAIT_STATE, - TDLS_DIS_RSP_SENT_DONE_STATE, - TDLS_LINK_DIS_DONE_STATE, - TDLS_LINK_SETUP_START_STATE, - TDLS_LINK_SETUP_WAIT_STATE, - TDLS_LINK_SETUP_RSP_WAIT_STATE, - TDLS_LINK_SETUP_DONE_STATE, - TDLS_LINK_TEARDOWN_START_STATE, - TDLS_LINK_TEARDOWN_DONE_STATE, - TDLS_LINK_SETUP_STATE -}eSirTdlsStates ; - -typedef struct sSirTdlsPeerInfo -{ - tSirMacAddr peerMac; - tANI_U8 sessionId; - tANI_U8 dialog ; - tSirMacCapabilityInfo capabilityInfo ; - tSirMacRateSet tdlsPeerSuppRates ; - tSirMacRateSet tdlsPeerExtRates ; - //tDot11fIEHTCaps tdlsPeerHtCaps ; - tSirMacHTCapabilityInfo tdlsPeerHtCaps ; - tSirMacHTParametersInfo tdlsPeerHtParams ; - tSirMacExtendedHTCapabilityInfo tdlsPeerHtExtCaps ; - tANI_U8 supportedMCSSet[SIZE_OF_SUPPORTED_MCS_SET]; - - //tDot11fIEExtCapability tdlsPeerExtenCaps ; - tSirMacRsnInfo tdlsPeerRsn ; - tANI_U16 tdlsPeerFtIe ; - tANI_U16 tdlsPeerTimeoutIntvl ; - tANI_U16 tdlsPeerSuppChan ; - tANI_U16 tdlsPeerSuppReguClass ; - tANI_S8 tdlsPeerRssi ; - tANI_U16 tdlsPeerState ; - /* flags to indicate optional IE's are in */ - tANI_U8 ExtRatesPresent ; - tANI_U8 rsnIePresent ; - tANI_U8 htCapPresent ; - tANI_U8 delStaNeeded ; - -} tSirTdlsPeerInfo, *tpSirSmeTdlsPeerInfo ; - -/* TDLS Request struct SME-->PE */ -typedef struct sSirTdlsDiscoveryReq -{ - tANI_U16 messageType; // eWNI_SME_TDLS_DISCOVERY_START_REQ - tANI_U16 length; - tANI_U8 sessionId; // Session ID - tANI_U16 transactionId; // Transaction ID for cmd - tANI_U8 reqType; - tANI_U8 dialog; - tSirMacAddr bssid; // For multi-session, for PE to locate peSession ID - tSirMacAddr peerMac; -} tSirTdlsDisReq, *tpSirSmeTdlsDisReq ; - -typedef struct sSirTdlsLinkSetupReq -{ - tANI_U16 messageType; // eWNI_SME_TDLS_LINK_START_REQ - tANI_U16 length; - tANI_U8 sessionId; // Session ID - tANI_U16 transactionId; // Transaction ID for cmd - tANI_U8 dialog; - tSirMacAddr bssid; // For multi-session, for PE to locate peSession ID - tSirMacAddr peerMac; -} tSirTdlsSetupReq, *tpSirSmeTdlsSetupReq ; - -typedef struct sSirTdlsTeardownReq -{ - tANI_U16 messageType; // eWNI_SME_TDLS_TEARDOWN_REQ - tANI_U16 length; - tANI_U8 sessionId; // Session ID - tANI_U16 transactionId; // Transaction ID for cmd - tSirMacAddr bssid; // For multi-session, for PE to locate peSession ID - tSirMacAddr peerMac; -} tSirTdlsTeardownReq, *tpSirSmeTdlsTeardownReq ; - - -/* TDLS response struct PE-->SME */ -typedef struct sSirTdlsDiscoveryRsp -{ - tANI_U16 messageType; - tANI_U16 length; - tSirResultCodes statusCode; - tANI_U16 numDisSta ; - tSirTdlsPeerInfo tdlsDisPeerInfo[0]; -} tSirTdlsDisRsp, *tpSirSmeTdlsDiscoveryRsp; - -typedef struct sSirTdlsLinkSetupRsp -{ - tANI_U16 messageType; - tANI_U16 length; - tSirResultCodes statusCode; - tSirMacAddr peerMac; -} tSirTdlsLinksetupRsp ; - -typedef struct sSirTdlsLinkSetupInd -{ - tANI_U16 messageType; - tANI_U16 length; - tSirResultCodes statusCode; - tSirMacAddr peerMac; -} tSirTdlsLinkSetupInd ; - - -typedef struct sSirTdlsTeardownRsp -{ - tANI_U16 messageType; - tANI_U16 length; - tSirResultCodes statusCode; - tSirMacAddr peerMac; -} tSirTdlsTeardownRsp ; - -typedef struct sSirTdlsPeerInd -{ - tANI_U16 messageType; - tANI_U16 length; - tSirMacAddr peerMac; - tANI_U8 sessionId; // Session ID - tANI_U16 staId ; - tANI_U16 staType ; - tANI_U8 ucastSig; - tANI_U8 bcastSig; -} tSirTdlsPeerInd ; - -typedef struct sSirTdlsLinkEstablishInd -{ - tANI_U16 messageType; - tANI_U16 length; - tANI_U8 bIsResponder; /* if this is 1, self is initiator and peer is reponder */ - tANI_U8 linkIdenOffset; /* offset of LinkIdentifierIE.bssid[0] from ptiTemplateBuf */ - tANI_U8 ptiBufStatusOffset; /* offset of BufferStatus from ptiTemplateBuf */ - tANI_U8 ptiTemplateLen; - tANI_U8 ptiTemplateBuf[64]; - tANI_U8 extCapability[8]; -/* This will be part of PTI template when sent by PE - tANI_U8 linkIdentifier[20]; -*/ -} tSirTdlsLinkEstablishInd, *tpSirTdlsLinkEstablishInd; - -typedef struct sSirTdlsLinkTeardownInd -{ - tANI_U16 messageType; - tANI_U16 length; - tANI_U16 staId; -} tSirTdlsLinkTeardownInd, *tpSirTdlsLinkTeardownInd; - -#endif /* FEATURE_WLAN_TDLS_INTERNAL */ - typedef struct sSirActiveModeSetBcnFilterReq { tANI_U16 messageType; @@ -4544,6 +4474,7 @@ typedef struct sSirUpdateChanParam typedef struct sSirUpdateChan { + tANI_U8 regId; tANI_U8 numChan; tSirUpdateChanParam chanParam[1]; } tSirUpdateChanList, *tpSirUpdateChanList; @@ -4764,7 +4695,7 @@ typedef PACKED_PRE struct PACKED_POST #endif // FEATURE_WLAN_BATCH_SCAN #ifdef FEATURE_WLAN_CH_AVOID -#define SIR_CH_AVOID_MAX_RANGE 4 +#define SIR_CH_AVOID_MAX_RANGE 15 typedef struct sSirChAvoidFreqType { @@ -4781,6 +4712,24 @@ typedef struct sSirChAvoidIndType typedef void (*pGetBcnMissRateCB)( tANI_S32 bcnMissRate, VOS_STATUS status, void *data); +typedef void (*tSirFWStatsCallback)(VOS_STATUS status, + tSirFwStatsResult *fwStatsRsp, void *pContext); +typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind); + + +/** + * struct sir_sme_mgmt_frame_cb_req - Register a + * management frame callback req + * @message_type: message id + * @length: msg length + * @callback: callback for management frame indication + */ +struct sir_sme_mgmt_frame_cb_req +{ + tANI_U16 message_type; + tANI_U16 length; + sir_mgmt_frame_ind_callback callback; +}; typedef PACKED_PRE struct PACKED_POST { @@ -4821,6 +4770,19 @@ typedef struct u8 stopReq; }tSirLLStatsClearReq, *tpSirLLStatsClearReq; +typedef PACKED_PRE struct PACKED_POST +{ + u32 stats; + tSirFWStatsCallback callback; + void *data; +}tSirFWStatsGetReq; + +typedef PACKED_PRE struct PACKED_POST +{ + tSirFWStatsCallback callback; + void *data; +}tSirFWStatsInfo; + /*--------------------------------------------------------------------------- WLAN_HAL_LL_NOTIFY_STATS ---------------------------------------------------------------------------*/ @@ -5163,6 +5125,8 @@ typedef PACKED_PRE struct PACKED_POST #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ + + #ifdef WLAN_FEATURE_EXTSCAN typedef enum @@ -5621,4 +5585,56 @@ typedef struct tANI_U16 mesgLen; tSetEncryptedDataRspParams encryptedDataRsp; } tSirEncryptedDataRspParams, *tpSirEncryptedDataRspParams; + +typedef enum eSirAbortScanStatus +{ + eSIR_ABORT_ACTIVE_SCAN_LIST_EMPTY, + eSIR_ABORT_ACTIVE_SCAN_LIST_NOT_EMPTY, + eSIR_ABORT_SCAN_FAILURE +}tSirAbortScanStatus; + +/* Max number of rates allowed in Supported Rates IE */ +#define MAX_NUM_SUPPORTED_RATES (8) + +typedef struct sSirSmeUpdateMaxRateParams +{ + tANI_U32 maxRateFlag; + tANI_U8 smeSessionId; +}tSirSmeUpdateMaxRateParams, *tpSirSmeUpdateMaxRateParams; + +typedef struct +{ + tANI_U32 event_data_len; + tANI_U8 event_data[1]; +} tSirNanEvent, *tpSirNanEvent; + +typedef struct +{ + tANI_U32 txCompleteStatus; + tANI_U32 txBdToken; +}tSirTxBdStatus, *tpSirTxBdStatus; + +/* enable or disable 20_40 BSS Coexistence IE in TDLS frames*/ +typedef struct +{ + // Common for all types are requests + tANI_U16 msgType; // message type is same as the request type + tANI_U16 msgLen; // length of the entire request + tANI_U8 SetTdls2040BSSCoex; //enabled or disabled +} tAniSetTdls2040BSSCoex, *tpAniSetTdls2040BSSCoex; + +typedef struct +{ + tANI_U16 mesgType; + tANI_U16 mesgLen; + tSirMacAddr bssid; +}tSirDelAllTdlsPeers, *ptSirDelAllTdlsPeers; + +typedef void (*tSirMonModeCb)(void *context); +typedef struct +{ + void *data; + void *context; + tSirMonModeCb callback; +}tSirMonModeReq, *ptSirMonModeReq; #endif /* __SIR_API_H */ diff --git a/drivers/staging/prima/CORE/MAC/inc/sirMacPropExts.h b/drivers/staging/prima/CORE/MAC/inc/sirMacPropExts.h index 6c06f12ba82d..f36257566e60 100644 --- a/drivers/staging/prima/CORE/MAC/inc/sirMacPropExts.h +++ b/drivers/staging/prima/CORE/MAC/inc/sirMacPropExts.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -158,6 +158,11 @@ #define IS_DOT11_MODE_11B(dot11Mode) \ ((dot11Mode == WNI_CFG_DOT11_MODE_11B) ? TRUE : FALSE) +#define IS_BSS_VHT_CAPABLE(vhtCaps) \ + ((vhtCaps).present && \ + ((vhtCaps).rxMCSMap != 0xFFFF) && \ + ((vhtCaps).txMCSMap != 0xFFFF)) + /// ANI proprietary Status Codes enum /// (present in Management response frames) typedef enum eSirMacPropStatusCodes diff --git a/drivers/staging/prima/CORE/MAC/inc/sirMacProtDef.h b/drivers/staging/prima/CORE/MAC/inc/sirMacProtDef.h index 4d94072f5a86..c4d1477f8a95 100644 --- a/drivers/staging/prima/CORE/MAC/inc/sirMacProtDef.h +++ b/drivers/staging/prima/CORE/MAC/inc/sirMacProtDef.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -43,7 +43,7 @@ #include "palTypes.h" #include "sirTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniCompiler.h" @@ -173,9 +173,10 @@ #define SIR_MAC_ACTION_UNPROT_WNM 11 #define SIR_MAC_ACTION_TDLS 12 #define SIR_MAC_ACITON_MESH 13 -#define SIR_MAC_ACTION_MULTIHOP 14 +#define SIR_MAC_ACTION_MHF 14 #define SIR_MAC_SELF_PROTECTED 15 #define SIR_MAC_ACTION_WME 17 +#define SIR_MAC_ACTION_FST 18 #define SIR_MAC_ACTION_VHT 21 @@ -252,6 +253,12 @@ #define SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY 0x7F #define SIR_MAC_ACTION_P2P_SUBTYPE_PRESENCE_RSP 2 +// Public Action for 20/40 BSS Coexistence +#ifdef WLAN_FEATURE_AP_HT40_24G +#define SIR_MAC_ACTION_2040_BSS_COEXISTENCE 0 +#endif + + #ifdef WLAN_FEATURE_11W //11w SA query request/response action frame category code #define SIR_MAC_SA_QUERY_REQ 0 @@ -411,6 +418,7 @@ #define SIR_MAC_HT_INFO_EID_MIN 0 #define SIR_MAC_HT_INFO_EID_MAX 255 #define SIR_MAC_OBSS_SCAN_PARAMETERS_EID 74 +#define SIR_MAC_EXTENDED_CAPABILITIES_EID 127 #ifdef WLAN_FEATURE_11AC #define SIR_MAC_VHT_CAPABILITIES_EID 191 @@ -425,6 +433,7 @@ #define SIR_MAC_ANI_WORKAROUND_EID_MIN 0 #define SIR_MAC_ANI_WORKAROUND_EID_MAX 255 +#define SIR_MAC_MAX_ADD_IE_LENGTH 500 /// Maximum length of each IE #define SIR_MAC_MAX_IE_LENGTH 255 @@ -587,9 +596,14 @@ #define SIR_MAC_MAX_NUMBER_OF_RATES 12 #define SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS 4 #define SIR_MAC_KEY_LENGTH 13 // WEP Maximum key length size -#define SIR_MAC_AUTH_CHALLENGE_LENGTH 128 +#define SIR_MAC_AUTH_CHALLENGE_LENGTH 253 +#define SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH 128 #define SIR_MAC_WEP_IV_LENGTH 4 #define SIR_MAC_WEP_ICV_LENGTH 4 +#define SIR_MAC_CHALLENGE_ID_LEN 2 + +/* 2 bytes each for auth algo number, transaction number and status code */ +#define SIR_MAC_AUTH_FRAME_INFO_LEN 6 /// MAX key length when ULA is used #define SIR_MAC_MAX_KEY_LENGTH 32 @@ -1291,7 +1305,6 @@ typedef __ani_attr_pre_packed struct sSirMacEdcaParamSetIE tSirMacEdcaParamRecord acvo; // voice } __ani_attr_packed tSirMacEdcaParamSetIE; -#if 1 typedef __ani_attr_pre_packed struct sSirMacQoSParams { tANI_U8 count; @@ -1299,7 +1312,6 @@ typedef __ani_attr_pre_packed struct sSirMacQoSParams tANI_U8 CWmin[8]; tANI_U8 AIFS[8]; } __ani_attr_packed tSirMacQoSParams; -#endif typedef __ani_attr_pre_packed struct sSirMacQbssLoadIE { @@ -2773,6 +2785,18 @@ typedef __ani_attr_pre_packed struct sSirMacQoSDelBARsp #define SIR_MAC_RATE_216 1006 #define SIR_MAC_RATE_240 1007 +#define SIR_MAC_RATE_1_BITMAP (1<<0) +#define SIR_MAC_RATE_2_BITMAP (1<<1) +#define SIR_MAC_RATE_5_5_BITMAP (1<<2) +#define SIR_MAC_RATE_11_BITMAP (1<<3) +#define SIR_MAC_RATE_6_BITMAP (1<<4) +#define SIR_MAC_RATE_9_BITMAP (1<<5) +#define SIR_MAC_RATE_12_BITMAP (1<<6) +#define SIR_MAC_RATE_18_BITMAP (1<<7) +#define SIR_MAC_RATE_24_BITMAP (1<<8) +#define SIR_MAC_RATE_36_BITMAP (1<<9) +#define SIR_MAC_RATE_48_BITMAP (1<<10) +#define SIR_MAC_RATE_54_BITMAP (1<<11) #define sirIsArate(x) ((((tANI_U8)x)==SIR_MAC_RATE_6) || \ (((tANI_U8)x)==SIR_MAC_RATE_9) || \ diff --git a/drivers/staging/prima/CORE/MAC/inc/sirTypes.h b/drivers/staging/prima/CORE/MAC/inc/sirTypes.h index a6cc129a84de..6854cbafd9b9 100644 --- a/drivers/staging/prima/CORE/MAC/inc/sirTypes.h +++ b/drivers/staging/prima/CORE/MAC/inc/sirTypes.h @@ -166,6 +166,7 @@ typedef enum eSirRetStatus eSIR_PMM_STA_NOT_ASSOCIATED, eSIR_PMM_HEART_BEAT_TMOUT, eSIR_PMM_NTH_BEACON_DELIVERY, + eSIR_PMM_INVALID_REQ, // ARQ Return Codes eSIR_ARQ_ERROR_BASE=0x2500, @@ -184,4 +185,26 @@ typedef enum eSirRetStatus } tSirRetStatus; +typedef enum +{ + FW_UBSP_STATS = 1, + FW_STATS_MAX, +}tSirFwStatsType; + + +typedef struct +{ + v_U32_t ubsp_enter_cnt; + v_U32_t ubsp_jump_ddr_cnt; +}tSirUbspFwStats; + +typedef struct +{ + tSirFwStatsType type; + /*data*/ + union{ + tSirUbspFwStats ubspStats; + }fwStatsData; +}tSirFwStatsResult; + # endif // __SIR_TYPES_H diff --git a/drivers/staging/prima/CORE/MAC/inc/wniApi.h b/drivers/staging/prima/CORE/MAC/inc/wniApi.h index 288b67d09fe2..97d127c793c5 100644 --- a/drivers/staging/prima/CORE/MAC/inc/wniApi.h +++ b/drivers/staging/prima/CORE/MAC/inc/wniApi.h @@ -94,8 +94,7 @@ #define AGN1223AR_02 8 #define AGN_EEP_PRODUCT_ID_MAX 8 - - +#define SIR_SME_MODULE_ID 0x16 /// Start of Sirius/Host message types #define WNI_HOST_MSG_START 0x1500 @@ -226,7 +225,6 @@ enum eWniMsgTypes eWNI_SME_REMAIN_ON_CHANNEL_REQ, eWNI_SME_REMAIN_ON_CHN_IND, eWNI_SME_REMAIN_ON_CHN_RSP, - eWNI_SME_MGMT_FRM_IND, eWNI_SME_REMAIN_ON_CHN_RDY_IND, eWNI_SME_SEND_ACTION_FRAME_IND, eWNI_SME_ACTION_FRAME_SEND_CNF, @@ -235,6 +233,7 @@ enum eWniMsgTypes eWNI_SME_CLEAR_DFS_CHANNEL_LIST, eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER, eWNI_SME_GET_SNR_REQ, + eWNI_SME_LOST_LINK_PARAMS_IND, //General Power Save Messages eWNI_PMC_MSG_TYPES_BEGIN, eWNI_PMC_PWR_SAVE_CFG, @@ -345,20 +344,6 @@ enum eWniMsgTypes //SIR_LIM_MSG_TYPES_BEGIN+0xB0 = 12B0 (which means max of 176 messages and //eWNI_SME_TDLS_DEL_STA_RSP = 175. //Should fix above issue to enable TDLS_INTERNAL -#ifdef FEATURE_WLAN_TDLS_INTERNAL -#error ERROR_TDLS_INTERNAL - eWNI_SME_TDLS_DISCOVERY_START_REQ, - eWNI_SME_TDLS_DISCOVERY_START_RSP, - eWNI_SME_TDLS_DISCOVERY_START_IND, - eWNI_SME_TDLS_LINK_START_REQ, - eWNI_SME_TDLS_LINK_START_RSP, - eWNI_SME_TDLS_LINK_START_IND, - eWNI_SME_TDLS_TEARDOWN_REQ, - eWNI_SME_TDLS_TEARDOWN_RSP, - eWNI_SME_TDLS_TEARDOWN_IND, - eWNI_SME_ADD_TDLS_PEER_IND, - eWNI_SME_DELETE_TDLS_PEER_IND, -#endif eWNI_SME_SET_BCN_FILTER_REQ, eWNI_SME_RESET_AP_CAPS_CHANGED, #ifdef WLAN_FEATURE_11W @@ -383,8 +368,17 @@ enum eWniMsgTypes #endif /* FEATURE_WLAN_CH_AVOID */ eWNI_SME_HT40_OBSS_SCAN_IND, /* START and UPDATE OBSS SCAN Indication*/ eWNI_SME_HT40_STOP_OBSS_SCAN_IND, /* STOP OBSS SCAN indication */ +#ifdef WLAN_FEATURE_AP_HT40_24G + eWNI_SME_SET_HT_2040_MODE, /* HT 20/40 indication in SAP case for 2.4GHz*/ + eWNI_SME_2040_COEX_IND, /* HT20/40 Coex indication in SAP case for 2.4GHz*/ +#endif eWNI_SME_MAC_SPOOF_ADDR_IND, eWNI_SME_ENCRYPT_MSG_RSP, + eWNI_SME_UPDATE_MAX_RATE_IND, + eWNI_SME_NAN_EVENT, + eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ, + eWNI_SME_DEL_ALL_TDLS_PEERS, + eWNI_SME_REGISTER_MGMT_FRAME_CB, eWNI_SME_MSG_TYPES_END }; diff --git a/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h b/drivers/staging/prima/CORE/MAC/inc/wniCfg.h similarity index 78% rename from drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h rename to drivers/staging/prima/CORE/MAC/inc/wniCfg.h index 8785e3f2a1b8..340401dc7594 100644 --- a/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h +++ b/drivers/staging/prima/CORE/MAC/inc/wniCfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -25,364 +25,372 @@ * to the Linux Foundation. */ -/* - * DO NOT EDIT - This file is generated automatically - */ - -/* - * IMPORTANT: This file is for system that supports STA mode ONLY. - */ - -#ifndef __WNICFGSTA_H -#define __WNICFGSTA_H +#ifndef __WNICFG_H +#define __WNICFG_H /* * Configuration Parameter ID for STA */ -#define WNI_CFG_STA_ID 0 -#define WNI_CFG_CFP_PERIOD 2 -#define WNI_CFG_CFP_MAX_DURATION 3 -#define WNI_CFG_SSID 4 -#define WNI_CFG_BEACON_INTERVAL 5 -#define WNI_CFG_DTIM_PERIOD 6 -#define WNI_CFG_WEP_KEY_LENGTH 7 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE 8 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE_ROW 4 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE_COL 1 -#define WNI_CFG_WEP_DEFAULT_KEY_1 8 -#define WNI_CFG_WEP_DEFAULT_KEY_2 9 -#define WNI_CFG_WEP_DEFAULT_KEY_3 10 -#define WNI_CFG_WEP_DEFAULT_KEY_4 11 -#define WNI_CFG_WEP_DEFAULT_KEYID 12 -#define WNI_CFG_EXCLUDE_UNENCRYPTED 13 -#define WNI_CFG_RTS_THRESHOLD 14 -#define WNI_CFG_SHORT_RETRY_LIMIT 15 -#define WNI_CFG_LONG_RETRY_LIMIT 16 -#define WNI_CFG_FRAGMENTATION_THRESHOLD 17 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME 18 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME 19 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME 20 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME 21 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT 22 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT 23 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT 24 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT 25 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT 26 -#define WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS 27 -#define WNI_CFG_PS_ENABLE_BCN_FILTER 28 -#define WNI_CFG_PS_ENABLE_HEART_BEAT 29 -#define WNI_CFG_PS_ENABLE_RSSI_MONITOR 30 -#define WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT 31 -#define WNI_CFG_RF_SETTLING_TIME_CLK 32 -#define WNI_CFG_SUPPORTED_RATES_11B 33 -#define WNI_CFG_SUPPORTED_RATES_11A 34 -#define WNI_CFG_PHY_MODE 35 -#define WNI_CFG_DOT11_MODE 36 -#define WNI_CFG_OPERATIONAL_RATE_SET 37 -#define WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET 38 -#define WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET 39 -#define WNI_CFG_BSSID 40 -#define WNI_CFG_LISTEN_INTERVAL 41 -#define WNI_CFG_VALID_CHANNEL_LIST 42 -#define WNI_CFG_CURRENT_CHANNEL 43 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ 44 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ 45 -#define WNI_CFG_RATE_ADAPTATION_TYPE 46 -#define WNI_CFG_FIXED_RATE 47 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ 48 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ 49 -#define WNI_CFG_RETRYRATE_POLICY 50 -#define WNI_CFG_RETRYRATE_SECONDARY 51 -#define WNI_CFG_RETRYRATE_TERTIARY 52 -#define WNI_CFG_APSD_ENABLED 53 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE 54 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE 55 -#define WNI_CFG_AUTHENTICATION_TYPE 56 -#define WNI_CFG_PRIVACY_ENABLED 58 -#define WNI_CFG_SHORT_PREAMBLE 59 -#define WNI_CFG_SHORT_SLOT_TIME 60 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY 61 -#define WNI_CFG_QOS_ENABLED 62 -#define WNI_CFG_HCF_ENABLED 63 -#define WNI_CFG_RSN_ENABLED 64 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD 65 -#define WNI_CFG_MAX_NUM_PRE_AUTH 66 -#define WNI_CFG_HEART_BEAT_THRESHOLD 69 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT 70 -#define WNI_CFG_MANUFACTURER_OUI 71 -#define WNI_CFG_MANUFACTURER_NAME 72 -#define WNI_CFG_MODEL_NUMBER 73 -#define WNI_CFG_MODEL_NAME 74 -#define WNI_CFG_MANUFACTURER_PRODUCT_NAME 75 -#define WNI_CFG_MANUFACTURER_PRODUCT_VERSION 76 -#define WNI_CFG_11D_ENABLED 77 -#define WNI_CFG_MAX_TX_POWER_2_4 78 -#define WNI_CFG_MAX_TX_POWER_5 79 -#define WNI_CFG_NETWORK_DENSITY 80 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM 81 -#define WNI_CFG_CURRENT_TX_ANTENNA 82 -#define WNI_CFG_CURRENT_RX_ANTENNA 83 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL 84 -#define WNI_CFG_POWER_STATE_PER_CHAIN 85 -#define WNI_CFG_NEW_BSS_FOUND_IND 86 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED 87 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED 88 -#define WNI_CFG_COUNTRY_CODE 90 -#define WNI_CFG_11H_ENABLED 91 -#define WNI_CFG_WT_CNF_TIMEOUT 92 -#define WNI_CFG_KEEPALIVE_TIMEOUT 93 -#define WNI_CFG_PROXIMITY 94 -#define WNI_CFG_LOG_LEVEL 95 -#define WNI_CFG_OLBC_DETECT_TIMEOUT 96 -#define WNI_CFG_PROTECTION_ENABLED 97 -#define WNI_CFG_11G_PROTECTION_ALWAYS 98 -#define WNI_CFG_FORCE_POLICY_PROTECTION 99 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED 100 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED 101 -#define WNI_CFG_CAL_PERIOD 102 -#define WNI_CFG_STATS_PERIOD 103 -#define WNI_CFG_CAL_CONTROL 104 -#define WNI_CFG_11G_ONLY_POLICY 105 -#define WNI_CFG_PACKET_CLASSIFICATION 106 -#define WNI_CFG_WME_ENABLED 107 -#define WNI_CFG_ADDTS_RSP_TIMEOUT 108 -#define WNI_CFG_MAX_SP_LENGTH 109 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS 111 -#define WNI_CFG_WSM_ENABLED 112 -#define WNI_CFG_PROP_CAPABILITY 113 -#define WNI_CFG_EDCA_PROFILE 114 -#define WNI_CFG_EDCA_ANI_ACBK_LOCAL 115 -#define WNI_CFG_EDCA_ANI_ACBE_LOCAL 116 -#define WNI_CFG_EDCA_ANI_ACVI_LOCAL 117 -#define WNI_CFG_EDCA_ANI_ACVO_LOCAL 118 -#define WNI_CFG_EDCA_ANI_ACBK 119 -#define WNI_CFG_EDCA_ANI_ACBE 120 -#define WNI_CFG_EDCA_ANI_ACVI 121 -#define WNI_CFG_EDCA_ANI_ACVO 122 -#define WNI_CFG_EDCA_WME_ACBK_LOCAL 123 -#define WNI_CFG_EDCA_WME_ACBE_LOCAL 124 -#define WNI_CFG_EDCA_WME_ACVI_LOCAL 125 -#define WNI_CFG_EDCA_WME_ACVO_LOCAL 126 -#define WNI_CFG_EDCA_WME_ACBK 127 -#define WNI_CFG_EDCA_WME_ACBE 128 -#define WNI_CFG_EDCA_WME_ACVI 129 -#define WNI_CFG_EDCA_WME_ACVO 130 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK_LOCAL 131 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE_LOCAL 132 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI_LOCAL 133 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO_LOCAL 134 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK 135 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE 136 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI 137 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO 138 -#define WNI_CFG_RDET_FLAG 139 -#define WNI_CFG_RADAR_CHANNEL_LIST 140 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT 141 -#define WNI_CFG_ADMIT_POLICY 142 -#define WNI_CFG_ADMIT_BWFACTOR 143 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE 144 -#define WNI_CFG_CHANNEL_BONDING_MODE 145 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE 146 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO 147 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE 148 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO 149 -#define WNI_CFG_TRIG_STA_BK_SCAN 150 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING 151 -#define WNI_CFG_SCAN_CONTROL_LIST 152 -#define WNI_CFG_MIMO_ENABLED 153 -#define WNI_CFG_BLOCK_ACK_ENABLED 154 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT 155 -#define WNI_CFG_HT_RX_STBC 156 -#define WNI_CFG_HT_CAP_INFO 157 -#define WNI_CFG_HT_AMPDU_PARAMS 158 -#define WNI_CFG_SUPPORTED_MCS_SET 159 -#define WNI_CFG_EXT_HT_CAP_INFO 160 -#define WNI_CFG_TX_BF_CAP 161 -#define WNI_CFG_AS_CAP 162 -#define WNI_CFG_HT_INFO_FIELD1 163 -#define WNI_CFG_HT_INFO_FIELD2 164 -#define WNI_CFG_HT_INFO_FIELD3 165 -#define WNI_CFG_BASIC_MCS_SET 166 -#define WNI_CFG_CURRENT_MCS_SET 167 -#define WNI_CFG_GREENFIELD_CAPABILITY 168 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH 169 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET 170 -#define WNI_CFG_VHT_LDPC_CODING_CAP 171 -#define WNI_CFG_VHT_SHORT_GI_80MHZ 172 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ 173 -#define WNI_CFG_VHT_TXSTBC 174 -#define WNI_CFG_VHT_RXSTBC 175 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP 176 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP 177 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED 178 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS 179 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP 180 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP 181 -#define WNI_CFG_VHT_TXOP_PS 182 -#define WNI_CFG_VHT_HTC_VHTC_CAP 183 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT 184 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP 185 -#define WNI_CFG_VHT_RX_ANT_PATTERN 186 -#define WNI_CFG_VHT_TX_ANT_PATTERN 187 -#define WNI_CFG_VHT_RX_MCS_MAP 188 -#define WNI_CFG_VHT_TX_MCS_MAP 189 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE 190 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE 191 -#define WNI_CFG_VHT_CHANNEL_WIDTH 192 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1 193 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2 194 -#define WNI_CFG_VHT_BASIC_MCS_SET 195 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT 196 -#define WNI_CFG_VHT_SS_UNDER_UTIL 197 -#define WNI_CFG_VHT_40MHZ_UTILIZATION 198 -#define WNI_CFG_VHT_80MHZ_UTILIZATION 199 -#define WNI_CFG_VHT_160MHZ_UTILIZATION 200 -#define WNI_CFG_MAX_AMSDU_LENGTH 201 -#define WNI_CFG_MPDU_DENSITY 202 -#define WNI_CFG_NUM_BUFF_ADVERT 203 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR 204 -#define WNI_CFG_SHORT_GI_20MHZ 205 -#define WNI_CFG_SHORT_GI_40MHZ 206 -#define WNI_CFG_RIFS_ENABLED 207 -#define WNI_CFG_MAX_PS_POLL 208 -#define WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE 209 -#define WNI_CFG_RSSI_FILTER_PERIOD 210 -#define WNI_CFG_MIN_RSSI_THRESHOLD 211 -#define WNI_CFG_NTH_BEACON_FILTER 212 -#define WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE 213 -#define WNI_CFG_SCAN_IN_POWERSAVE 214 -#define WNI_CFG_IGNORE_DTIM 215 -#define WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE 216 -#define WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE 217 -#define WNI_CFG_WOWLAN_DEAUTH_ENABLE 218 -#define WNI_CFG_WOWLAN_DISASSOC_ENABLE 219 -#define WNI_CFG_WOWLAN_MAX_MISSED_BEACON 220 -#define WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD 221 -#define WNI_CFG_BA_TIMEOUT 222 -#define WNI_CFG_BA_THRESHOLD_HIGH 223 -#define WNI_CFG_MAX_BA_BUFFERS 224 -#define WNI_CFG_MAX_BA_SESSIONS 225 -#define WNI_CFG_BA_AUTO_SETUP 226 -#define WNI_CFG_ADDBA_REQ_DECLINE 227 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC 228 -#define WNI_CFG_BG_SCAN_CHANNEL_LIST 229 -#define WNI_CFG_MAX_MEDIUM_TIME 230 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU 231 -#define WNI_CFG_IBSS_AUTO_BSSID 232 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG 233 -#define WNI_CFG_PROBE_REQ_ADDNIE_DATA 234 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG 235 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA1 236 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA2 237 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA3 238 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG 239 -#define WNI_CFG_ASSOC_RSP_ADDNIE_DATA 240 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG 241 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_DATA 242 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG 243 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA 244 -#define WNI_CFG_WPS_ENABLE 245 -#define WNI_CFG_WPS_STATE 246 -#define WNI_CFG_WPS_PROBE_REQ_FLAG 247 -#define WNI_CFG_WPS_VERSION 248 -#define WNI_CFG_WPS_REQUEST_TYPE 249 -#define WNI_CFG_WPS_CFG_METHOD 250 -#define WNI_CFG_WPS_UUID 251 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY 252 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI 253 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY 254 -#define WNI_CFG_WPS_ASSOCIATION_STATE 255 -#define WNI_CFG_WPS_CONFIGURATION_ERROR 256 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID 257 -#define WNI_CFG_WPS_ASSOC_METHOD 258 -#define WNI_CFG_LOW_GAIN_OVERRIDE 259 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE 260 -#define WNI_CFG_RPE_POLLING_THRESHOLD 261 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG 262 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG 263 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG 264 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG 265 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS 266 -#define WNI_CFG_SINGLE_TID_RC 267 -#define WNI_CFG_RRM_ENABLED 268 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX 269 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX 270 -#define WNI_CFG_TX_PWR_CTRL_ENABLE 271 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING 272 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK 273 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE 274 -#define WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT 275 -#define WNI_CFG_TELE_BCN_WAKEUP_EN 276 -#define WNI_CFG_TELE_BCN_TRANS_LI 277 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS 278 -#define WNI_CFG_TELE_BCN_MAX_LI 279 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS 280 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS 281 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD 282 -#define WNI_CFG_ASSOC_STA_LIMIT 283 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL 284 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL 285 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND 286 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD 287 -#define WNI_CFG_ENABLE_CLOSE_LOOP 288 -#define WNI_CFG_ENABLE_LTE_COEX 289 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT 290 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT 291 -#define WNI_CFG_ENABLE_MC_ADDR_LIST 292 -#define WNI_CFG_ENABLE_UC_FILTER 293 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION 294 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED 295 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP 296 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT 297 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK 298 -#define WNI_CFG_TDLS_BUF_STA_ENABLED 299 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME 300 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD 301 -#define WNI_CFG_ENABLE_ADAPT_RX_DRAIN 302 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR 303 -#define WNI_CFG_ANTENNA_DIVESITY 304 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT 305 -#define WNI_CFG_ATH_DISABLE 306 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN 307 -#define WNI_CFG_BTC_ACTIVE_BT_LEN 308 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN 309 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN 310 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY 311 -#define WNI_CFG_ASD_PROBE_INTERVAL 312 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD 313 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD 314 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL 315 -#define WNI_CFG_BTC_CTS2S_DURING_SCO 316 -#define WNI_CFG_CHANNEL_BONDING_24G 317 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME 318 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME 319 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL 320 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL 321 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL 322 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR 323 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD 324 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED 325 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES 326 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL 327 -#define WNI_CFG_RA_FILTER_ENABLE 328 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL 329 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE 330 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE 331 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD 332 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD 333 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED 334 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP 335 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT 336 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT 337 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW 338 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW 339 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE 340 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS 341 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS 342 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE 343 -#define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE 344 +enum { + WNI_CFG_STA_ID, + WNI_CFG_CF_POLLABLE, + WNI_CFG_CFP_PERIOD, + WNI_CFG_CFP_MAX_DURATION, + WNI_CFG_SSID, + WNI_CFG_BEACON_INTERVAL, + WNI_CFG_DTIM_PERIOD, + WNI_CFG_WEP_KEY_LENGTH, + WNI_CFG_WEP_DEFAULT_KEY_1, + WNI_CFG_WEP_DEFAULT_KEY_2, + WNI_CFG_WEP_DEFAULT_KEY_3, + WNI_CFG_WEP_DEFAULT_KEY_4, + WNI_CFG_WEP_DEFAULT_KEYID, + WNI_CFG_EXCLUDE_UNENCRYPTED, + WNI_CFG_RTS_THRESHOLD, + WNI_CFG_SHORT_RETRY_LIMIT, + WNI_CFG_LONG_RETRY_LIMIT, + WNI_CFG_FRAGMENTATION_THRESHOLD, + WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME, + WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME, + WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME, + WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME, + WNI_CFG_JOIN_FAILURE_TIMEOUT, + WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, + WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, + WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, + WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, + WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS, + WNI_CFG_PS_ENABLE_BCN_FILTER, + WNI_CFG_PS_ENABLE_HEART_BEAT, + WNI_CFG_PS_ENABLE_RSSI_MONITOR, + WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, + WNI_CFG_RF_SETTLING_TIME_CLK, + WNI_CFG_SUPPORTED_RATES_11B, + WNI_CFG_SUPPORTED_RATES_11A, + WNI_CFG_PHY_MODE, + WNI_CFG_DOT11_MODE, + WNI_CFG_OPERATIONAL_RATE_SET, + WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET, + WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET, + WNI_CFG_BSSID, + WNI_CFG_LISTEN_INTERVAL, + WNI_CFG_VALID_CHANNEL_LIST, + WNI_CFG_CURRENT_CHANNEL, + WNI_CFG_DEFAULT_RATE_INDEX_5GHZ, + WNI_CFG_DEFAULT_RATE_INDEX_24GHZ, + WNI_CFG_RATE_ADAPTATION_TYPE, + WNI_CFG_FIXED_RATE, + WNI_CFG_FIXED_RATE_MULTICAST_24GHZ, + WNI_CFG_FIXED_RATE_MULTICAST_5GHZ, + WNI_CFG_RETRYRATE_POLICY, + WNI_CFG_RETRYRATE_SECONDARY, + WNI_CFG_RETRYRATE_TERTIARY, + WNI_CFG_APSD_ENABLED, + WNI_CFG_SHARED_KEY_AUTH_ENABLE, + WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE, + WNI_CFG_AUTHENTICATION_TYPE, + WNI_CFG_CF_POLL_REQUEST, + WNI_CFG_PRIVACY_ENABLED, + WNI_CFG_SHORT_PREAMBLE, + WNI_CFG_SHORT_SLOT_TIME, + WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, + WNI_CFG_QOS_ENABLED, + WNI_CFG_HCF_ENABLED, + WNI_CFG_RSN_ENABLED, + WNI_CFG_BACKGROUND_SCAN_PERIOD, + WNI_CFG_MAX_NUM_PRE_AUTH, + WNI_CFG_PREAUTH_CLNUP_TIMEOUT, + WNI_CFG_RELEASE_AID_TIMEOUT, + WNI_CFG_HEART_BEAT_THRESHOLD, + WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, + WNI_CFG_MANUFACTURER_OUI, + WNI_CFG_MANUFACTURER_NAME, + WNI_CFG_MODEL_NUMBER, + WNI_CFG_MODEL_NAME, + WNI_CFG_MANUFACTURER_PRODUCT_NAME, + WNI_CFG_MANUFACTURER_PRODUCT_VERSION, + WNI_CFG_11D_ENABLED, + WNI_CFG_MAX_TX_POWER_2_4, + WNI_CFG_MAX_TX_POWER_5, + WNI_CFG_NETWORK_DENSITY, + WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM, + WNI_CFG_CURRENT_TX_ANTENNA, + WNI_CFG_CURRENT_RX_ANTENNA, + WNI_CFG_CURRENT_TX_POWER_LEVEL, + WNI_CFG_POWER_STATE_PER_CHAIN, + WNI_CFG_NEW_BSS_FOUND_IND, + WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, + WNI_CFG_PROPRIETARY_RATES_ENABLED, + WNI_CFG_AP_NODE_NAME, + WNI_CFG_COUNTRY_CODE, + WNI_CFG_11H_ENABLED, + WNI_CFG_WT_CNF_TIMEOUT, + WNI_CFG_KEEPALIVE_TIMEOUT, + WNI_CFG_PROXIMITY, + WNI_CFG_LOG_LEVEL, + WNI_CFG_OLBC_DETECT_TIMEOUT, + WNI_CFG_PROTECTION_ENABLED, + WNI_CFG_11G_PROTECTION_ALWAYS, + WNI_CFG_FORCE_POLICY_PROTECTION, + WNI_CFG_11G_SHORT_PREAMBLE_ENABLED, + WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, + WNI_CFG_CAL_PERIOD, + WNI_CFG_STATS_PERIOD, + WNI_CFG_CAL_CONTROL, + WNI_CFG_11G_ONLY_POLICY, + WNI_CFG_PACKET_CLASSIFICATION, + WNI_CFG_WME_ENABLED, + WNI_CFG_ADDTS_RSP_TIMEOUT, + WNI_CFG_MAX_SP_LENGTH, + WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD, + WNI_CFG_SEND_SINGLE_SSID_ALWAYS, + WNI_CFG_WSM_ENABLED, + WNI_CFG_PROP_CAPABILITY, + WNI_CFG_EDCA_PROFILE, + WNI_CFG_EDCA_ANI_ACBK_LOCAL, + WNI_CFG_EDCA_ANI_ACBE_LOCAL, + WNI_CFG_EDCA_ANI_ACVI_LOCAL, + WNI_CFG_EDCA_ANI_ACVO_LOCAL, + WNI_CFG_EDCA_ANI_ACBK, + WNI_CFG_EDCA_ANI_ACBE, + WNI_CFG_EDCA_ANI_ACVI, + WNI_CFG_EDCA_ANI_ACVO, + WNI_CFG_EDCA_WME_ACBK_LOCAL, + WNI_CFG_EDCA_WME_ACBE_LOCAL, + WNI_CFG_EDCA_WME_ACVI_LOCAL, + WNI_CFG_EDCA_WME_ACVO_LOCAL, + WNI_CFG_EDCA_WME_ACBK, + WNI_CFG_EDCA_WME_ACBE, + WNI_CFG_EDCA_WME_ACVI, + WNI_CFG_EDCA_WME_ACVO, + WNI_CFG_EDCA_TIT_DEMO_ACBK_LOCAL, + WNI_CFG_EDCA_TIT_DEMO_ACBE_LOCAL, + WNI_CFG_EDCA_TIT_DEMO_ACVI_LOCAL, + WNI_CFG_EDCA_TIT_DEMO_ACVO_LOCAL, + WNI_CFG_EDCA_TIT_DEMO_ACBK, + WNI_CFG_EDCA_TIT_DEMO_ACBE, + WNI_CFG_EDCA_TIT_DEMO_ACVI, + WNI_CFG_EDCA_TIT_DEMO_ACVO, + WNI_CFG_RDET_FLAG, + WNI_CFG_RADAR_CHANNEL_LIST, + WNI_CFG_LOCAL_POWER_CONSTRAINT, + WNI_CFG_ADMIT_POLICY, + WNI_CFG_ADMIT_BWFACTOR, + WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE, + WNI_CFG_CHANNEL_BONDING_MODE, + WNI_CFG_CB_SECONDARY_CHANNEL_STATE, + WNI_CFG_DYNAMIC_THRESHOLD_ZERO, + WNI_CFG_DYNAMIC_THRESHOLD_ONE, + WNI_CFG_DYNAMIC_THRESHOLD_TWO, + WNI_CFG_TRIG_STA_BK_SCAN, + WNI_CFG_DYNAMIC_PROFILE_SWITCHING, + WNI_CFG_SCAN_CONTROL_LIST, + WNI_CFG_MIMO_ENABLED, + WNI_CFG_BLOCK_ACK_ENABLED, + WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT, + WNI_CFG_HT_RX_STBC, + WNI_CFG_HT_CAP_INFO, + WNI_CFG_HT_AMPDU_PARAMS, + WNI_CFG_SUPPORTED_MCS_SET, + WNI_CFG_EXT_HT_CAP_INFO, + WNI_CFG_TX_BF_CAP, + WNI_CFG_AS_CAP, + WNI_CFG_HT_INFO_FIELD1, + WNI_CFG_HT_INFO_FIELD2, + WNI_CFG_HT_INFO_FIELD3, + WNI_CFG_BASIC_MCS_SET, + WNI_CFG_CURRENT_MCS_SET, + WNI_CFG_GREENFIELD_CAPABILITY, + WNI_CFG_VHT_MAX_MPDU_LENGTH, + WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, + WNI_CFG_VHT_LDPC_CODING_CAP, + WNI_CFG_VHT_SHORT_GI_80MHZ, + WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, + WNI_CFG_VHT_TXSTBC, + WNI_CFG_VHT_RXSTBC, + WNI_CFG_VHT_SU_BEAMFORMER_CAP, + WNI_CFG_VHT_SU_BEAMFORMEE_CAP, + WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, + WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, + WNI_CFG_VHT_MU_BEAMFORMER_CAP, + WNI_CFG_VHT_MU_BEAMFORMEE_CAP, + WNI_CFG_VHT_TXOP_PS, + WNI_CFG_VHT_HTC_VHTC_CAP, + WNI_CFG_VHT_AMPDU_LEN_EXPONENT, + WNI_CFG_VHT_LINK_ADAPTATION_CAP, + WNI_CFG_VHT_RX_ANT_PATTERN, + WNI_CFG_VHT_TX_ANT_PATTERN, + WNI_CFG_VHT_RX_MCS_MAP, + WNI_CFG_VHT_TX_MCS_MAP, + WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE, + WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE, + WNI_CFG_VHT_CHANNEL_WIDTH, + WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1, + WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2, + WNI_CFG_VHT_BASIC_MCS_SET, + WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT, + WNI_CFG_VHT_SS_UNDER_UTIL, + WNI_CFG_VHT_40MHZ_UTILIZATION, + WNI_CFG_VHT_80MHZ_UTILIZATION, + WNI_CFG_VHT_160MHZ_UTILIZATION, + WNI_CFG_MAX_AMSDU_LENGTH, + WNI_CFG_MPDU_DENSITY, + WNI_CFG_NUM_BUFF_ADVERT, + WNI_CFG_MAX_RX_AMPDU_FACTOR, + WNI_CFG_SHORT_GI_20MHZ, + WNI_CFG_SHORT_GI_40MHZ, + WNI_CFG_RIFS_ENABLED, + WNI_CFG_MAX_PS_POLL, + WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE, + WNI_CFG_RSSI_FILTER_PERIOD, + WNI_CFG_MIN_RSSI_THRESHOLD, + WNI_CFG_NTH_BEACON_FILTER, + WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE, + WNI_CFG_SCAN_IN_POWERSAVE, + WNI_CFG_IGNORE_DTIM, + WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE, + WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE, + WNI_CFG_WOWLAN_DEAUTH_ENABLE, + WNI_CFG_WOWLAN_DISASSOC_ENABLE, + WNI_CFG_WOWLAN_MAX_MISSED_BEACON, + WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD, + WNI_CFG_BA_TIMEOUT, + WNI_CFG_BA_THRESHOLD_HIGH, + WNI_CFG_MAX_BA_BUFFERS, + WNI_CFG_MAX_BA_SESSIONS, + WNI_CFG_BA_AUTO_SETUP, + WNI_CFG_ADDBA_REQ_DECLINE, + WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, + WNI_CFG_BG_SCAN_CHANNEL_LIST, + WNI_CFG_MAX_MEDIUM_TIME, + WNI_CFG_MAX_MPDUS_IN_AMPDU, + WNI_CFG_IBSS_AUTO_BSSID, + WNI_CFG_PROBE_REQ_ADDNIE_FLAG, + WNI_CFG_PROBE_REQ_ADDNIE_DATA, + WNI_CFG_PROBE_RSP_ADDNIE_FLAG, + WNI_CFG_PROBE_RSP_ADDNIE_DATA1, + WNI_CFG_PROBE_RSP_ADDNIE_DATA2, + WNI_CFG_PROBE_RSP_ADDNIE_DATA3, + WNI_CFG_ASSOC_RSP_ADDNIE_FLAG, + WNI_CFG_ASSOC_RSP_ADDNIE_DATA, + WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG, + WNI_CFG_PROBE_REQ_ADDNP2PIE_DATA, + WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG, + WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA, + WNI_CFG_WPS_ENABLE, + WNI_CFG_WPS_STATE, + WNI_CFG_WPS_PROBE_REQ_FLAG, + WNI_CFG_WPS_VERSION, + WNI_CFG_WPS_REQUEST_TYPE, + WNI_CFG_WPS_CFG_METHOD, + WNI_CFG_WPS_UUID, + WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, + WNI_CFG_WPS_PIMARY_DEVICE_OUI, + WNI_CFG_WPS_DEVICE_SUB_CATEGORY, + WNI_CFG_WPS_ASSOCIATION_STATE, + WNI_CFG_WPS_CONFIGURATION_ERROR, + WNI_CFG_WPS_DEVICE_PASSWORD_ID, + WNI_CFG_WPS_ASSOC_METHOD, + WNI_CFG_LOW_GAIN_OVERRIDE, + WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE, + WNI_CFG_RPE_POLLING_THRESHOLD, + WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG, + WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG, + WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG, + WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG, + WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS, + WNI_CFG_SINGLE_TID_RC, + WNI_CFG_RRM_ENABLED, + WNI_CFG_RRM_OPERATING_CHAN_MAX, + WNI_CFG_RRM_NON_OPERATING_CHAN_MAX, + WNI_CFG_TX_PWR_CTRL_ENABLE, + WNI_CFG_MCAST_BCAST_FILTER_SETTING, + WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK, + WNI_CFG_DYNAMIC_PS_POLL_VALUE, + WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT, + WNI_CFG_TELE_BCN_WAKEUP_EN, + WNI_CFG_TELE_BCN_TRANS_LI, + WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS, + WNI_CFG_TELE_BCN_MAX_LI, + WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS, + WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS, + WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, + WNI_CFG_ASSOC_STA_LIMIT, + WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, + WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, + WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND, + WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, + WNI_CFG_ENABLE_CLOSE_LOOP, + WNI_CFG_ENABLE_LTE_COEX, + WNI_CFG_AP_KEEP_ALIVE_TIMEOUT, + WNI_CFG_GO_KEEP_ALIVE_TIMEOUT, + WNI_CFG_ENABLE_MC_ADDR_LIST, + WNI_CFG_ENABLE_UC_FILTER, + WNI_CFG_ENABLE_LPWR_IMG_TRANSITION, + WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, + WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP, + WNI_CFG_AP_LINK_MONITOR_TIMEOUT, + WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK, + WNI_CFG_TDLS_BUF_STA_ENABLED, + WNI_CFG_TDLS_PUAPSD_INACT_TIME, + WNI_CFG_TDLS_RX_FRAME_THRESHOLD, + WNI_CFG_ENABLE_ADAPT_RX_DRAIN, + WNI_CFG_FLEX_CONNECT_POWER_FACTOR, + WNI_CFG_ANTENNA_DIVESITY, + WNI_CFG_GO_LINK_MONITOR_TIMEOUT, + WNI_CFG_ATH_DISABLE, + WNI_CFG_BTC_ACTIVE_WLAN_LEN, + WNI_CFG_BTC_ACTIVE_BT_LEN, + WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN, + WNI_CFG_BTC_SAP_ACTIVE_BT_LEN, + WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY, + WNI_CFG_ASD_PROBE_INTERVAL, + WNI_CFG_ASD_TRIGGER_THRESHOLD, + WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD, + WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL, + WNI_CFG_BTC_CTS2S_DURING_SCO, + WNI_CFG_CHANNEL_BONDING_24G, + WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME, + WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME, + WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, + WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL, + WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL, + WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR, + WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD, + WNI_CFG_TDLS_OFF_CHANNEL_ENABLED, + WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, + WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, + WNI_CFG_RA_FILTER_ENABLE, + WNI_CFG_RA_RATE_LIMIT_INTERVAL, + WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE, + WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE, + WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD, + WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD, + WNI_CFG_TDLS_WMM_MODE_ENABLED, + WNI_CFG_MAX_UAPSD_CONSEC_SP, + WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT, + WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT, + WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW, + WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW, + WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE, + WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS, + WNI_CFG_ENABLE_DYNAMIC_WMMPS, + WNI_CFG_BURST_MODE_BE_TXOP_VALUE, + WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE, + WNI_CFG_BTC_FAST_WLAN_CONN_PREF, + WNI_CFG_ENABLE_RTSCTS_HTVHT, + WNI_CFG_TOGGLE_ARP_BDRATES, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, + WNI_CFG_LINK_FAIL_TIMEOUT, + WNI_CFG_LINK_FAIL_TX_CNT, + WNI_CFG_OPTIMIZE_CA_EVENT, + WNI_CFG_ENABLE_MAC_ADDR_SPOOFING, + WNI_CFG_SAR_BOFFSET_SET_CORRECTION, + WNI_CFG_DISABLE_BAR_WAKE_UP_HOST +}; /* * String parameter lengths @@ -400,6 +408,7 @@ #define WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN 8 #define WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET_LEN 4 #define WNI_CFG_BSSID_LEN 6 +#define WNI_CFG_MACADDR_LEN 6 #define WNI_CFG_VALID_CHANNEL_LIST_LEN 100 #define WNI_CFG_MANUFACTURER_OUI_LEN 3 #define WNI_CFG_MANUFACTURER_NAME_LEN 65 @@ -409,6 +418,7 @@ #define WNI_CFG_MANUFACTURER_PRODUCT_VERSION_LEN 33 #define WNI_CFG_MAX_TX_POWER_2_4_LEN 128 #define WNI_CFG_MAX_TX_POWER_5_LEN 128 +#define WNI_CFG_AP_NODE_NAME_LEN 32 #define WNI_CFG_COUNTRY_CODE_LEN 3 #define WNI_CFG_EDCA_ANI_ACBK_LOCAL_LEN 20 #define WNI_CFG_EDCA_ANI_ACBE_LOCAL_LEN 20 @@ -1048,7 +1058,7 @@ #define WNI_CFG_BLOCK_ACK_ENABLED_STAMIN 0 #define WNI_CFG_BLOCK_ACK_ENABLED_STAMAX 3 -#define WNI_CFG_BLOCK_ACK_ENABLED_STADEF 2 +#define WNI_CFG_BLOCK_ACK_ENABLED_STADEF 0 #define WNI_CFG_BLOCK_ACK_ENABLED_DELAYED 0 #define WNI_CFG_BLOCK_ACK_ENABLED_IMMEDIATE 1 @@ -1188,7 +1198,7 @@ #define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMIN 0 #define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMAX 1 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STADEF 0 +#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STADEF 1 #define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN 0 #define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX 4 @@ -1713,17 +1723,17 @@ #define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STAMAX 4294967295 #define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STADEF 300 -#define WNI_CFG_ASD_PROBE_INTERVAL_STAMIN 10 -#define WNI_CFG_ASD_PROBE_INTERVAL_STAMAX 100 +#define WNI_CFG_ASD_PROBE_INTERVAL_STAMIN 1 +#define WNI_CFG_ASD_PROBE_INTERVAL_STAMAX 500 #define WNI_CFG_ASD_PROBE_INTERVAL_STADEF 50 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMIN -120 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMAX 0 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STADEF -75 +#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMIN -100 +#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMAX -10 +#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STADEF -60 #define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMIN 0 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMAX 100 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STADEF 0 +#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMAX 5 +#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STADEF 3 #define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMIN 0 #define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMAX 1 @@ -1845,11 +1855,60 @@ #define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_STAMAX 1 #define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_STADEF 0 +#define WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STAMIN 0 +#define WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STAMAX 5 +#define WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STADEF 1 + +/* Bit mask value to enable RTS/CTS for different modes + * for 2.4 GHz, HT20 - 0x0001, for 2.4 GHz, HT40 - 0x0002 + * for 2.4 GHz, VHT20 - 0x0004, for 2.4 GHz, VHT40 - 0x0008 + * for 5 GHz, HT20 - 0x0100, for 5 GHz, HT40 - 0x0200 + * for 5 GHz, VHT20 - 0x0400, for 5 GHz, VHT40 - 0x0800 + * for 5 GHz, VHT80 - 0x1000 + */ +#define WNI_CFG_ENABLE_RTSCTS_HTVHT_MIN 0x0000 +#define WNI_CFG_ENABLE_RTSCTS_HTVHT_MAX 0x1f0f +#define WNI_CFG_ENABLE_RTSCTS_HTVHT_DEF 0x0000 + +#define WNI_CFG_TOGGLE_ARP_BDRATES_MIN 0 +#define WNI_CFG_TOGGLE_ARP_BDRATES_MAX 2 +#define WNI_CFG_TOGGLE_ARP_BDRATES_DEF 0 + +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MIN 0 +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MAX 250000 +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_DEF 40000 + +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MIN 0 +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MAX 250000 +#define WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_DEF 40000 + +#define WNI_CFG_LINK_FAIL_TIMEOUT_MIN 1000 +#define WNI_CFG_LINK_FAIL_TIMEOUT_MAX 60000 +#define WNI_CFG_LINK_FAIL_TIMEOUT_DEF 6000 + +#define WNI_CFG_LINK_FAIL_TX_CNT_MIN 50 +#define WNI_CFG_LINK_FAIL_TX_CNT_MAX 1000 +#define WNI_CFG_LINK_FAIL_TX_CNT_DEF 200 + +#define WNI_CFG_OPTIMIZE_CA_EVENT_DISABLE 0 +#define WNI_CFG_OPTIMIZE_CA_EVENT_ENABLE 1 +#define WNI_CFG_OPTIMIZE_CA_EVENT_DEFAULT 0 + +#define WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_MIN 0 +#define WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_MAX 2 +#define WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_DEF 1 + +#define WNI_CFG_SAR_BOFFSET_SET_CORRECTION_MIN 0 +#define WNI_CFG_SAR_BOFFSET_SET_CORRECTION_MAX 1 +#define WNI_CFG_SAR_BOFFSET_SET_CORRECTION_DEFAULT 0 + +#define WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_MIN 0 +#define WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_MAX 1 +#define WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_DEF 0 -#define CFG_PARAM_MAX_NUM 345 -#define CFG_STA_IBUF_MAX_SIZE 279 +#define CFG_PARAM_MAX_NUM 356 +#define CFG_STA_IBUF_MAX_SIZE 290 #define CFG_STA_SBUF_MAX_SIZE 3389 -#define CFG_SEM_MAX_NUM 19 #define CFG_STA_MAGIC_DWORD 0xbeefbeef diff --git a/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h b/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h deleted file mode 100644 index f9cbb3e6e3f8..000000000000 --- a/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h +++ /dev/null @@ -1,2911 +0,0 @@ -/* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* - * DO NOT EDIT - This file is generated automatically - */ - -/* - * IMPORTANT: This file is for system that supports both STA and AP mode. - */ - - -#ifndef __WNICFGAP_H -#define __WNICFGAP_H - -/* - * Configuration Parameter ID for STA and AP - */ - -#define WNI_CFG_STA_ID 0 -#define WNI_CFG_CF_POLLABLE 1 -#define WNI_CFG_CFP_PERIOD 2 -#define WNI_CFG_CFP_MAX_DURATION 3 -#define WNI_CFG_SSID 4 -#define WNI_CFG_BEACON_INTERVAL 5 -#define WNI_CFG_DTIM_PERIOD 6 -#define WNI_CFG_WEP_KEY_LENGTH 7 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE 8 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE_ROW 4 -#define WNI_CFG_WEP_DEFAULT_KEY_TABLE_COL 1 -#define WNI_CFG_WEP_DEFAULT_KEY_1 8 -#define WNI_CFG_WEP_DEFAULT_KEY_2 9 -#define WNI_CFG_WEP_DEFAULT_KEY_3 10 -#define WNI_CFG_WEP_DEFAULT_KEY_4 11 -#define WNI_CFG_WEP_DEFAULT_KEYID 12 -#define WNI_CFG_EXCLUDE_UNENCRYPTED 13 -#define WNI_CFG_RTS_THRESHOLD 14 -#define WNI_CFG_SHORT_RETRY_LIMIT 15 -#define WNI_CFG_LONG_RETRY_LIMIT 16 -#define WNI_CFG_FRAGMENTATION_THRESHOLD 17 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME 18 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME 19 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME 20 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME 21 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT 22 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT 23 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT 24 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT 25 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT 26 -#define WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS 27 -#define WNI_CFG_PS_ENABLE_BCN_FILTER 28 -#define WNI_CFG_PS_ENABLE_HEART_BEAT 29 -#define WNI_CFG_PS_ENABLE_RSSI_MONITOR 30 -#define WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT 31 -#define WNI_CFG_RF_SETTLING_TIME_CLK 32 -#define WNI_CFG_SUPPORTED_RATES_11B 33 -#define WNI_CFG_SUPPORTED_RATES_11A 34 -#define WNI_CFG_PHY_MODE 35 -#define WNI_CFG_DOT11_MODE 36 -#define WNI_CFG_OPERATIONAL_RATE_SET 37 -#define WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET 38 -#define WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET 39 -#define WNI_CFG_BSSID 40 -#define WNI_CFG_LISTEN_INTERVAL 41 -#define WNI_CFG_VALID_CHANNEL_LIST 42 -#define WNI_CFG_CURRENT_CHANNEL 43 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ 44 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ 45 -#define WNI_CFG_RATE_ADAPTATION_TYPE 46 -#define WNI_CFG_FIXED_RATE 47 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ 48 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ 49 -#define WNI_CFG_RETRYRATE_POLICY 50 -#define WNI_CFG_RETRYRATE_SECONDARY 51 -#define WNI_CFG_RETRYRATE_TERTIARY 52 -#define WNI_CFG_APSD_ENABLED 53 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE 54 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE 55 -#define WNI_CFG_AUTHENTICATION_TYPE 56 -#define WNI_CFG_CF_POLL_REQUEST 57 -#define WNI_CFG_PRIVACY_ENABLED 58 -#define WNI_CFG_SHORT_PREAMBLE 59 -#define WNI_CFG_SHORT_SLOT_TIME 60 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY 61 -#define WNI_CFG_QOS_ENABLED 62 -#define WNI_CFG_HCF_ENABLED 63 -#define WNI_CFG_RSN_ENABLED 64 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD 65 -#define WNI_CFG_MAX_NUM_PRE_AUTH 66 -#define WNI_CFG_PREAUTH_CLNUP_TIMEOUT 67 -#define WNI_CFG_RELEASE_AID_TIMEOUT 68 -#define WNI_CFG_HEART_BEAT_THRESHOLD 69 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT 70 -#define WNI_CFG_MANUFACTURER_OUI 71 -#define WNI_CFG_MANUFACTURER_NAME 72 -#define WNI_CFG_MODEL_NUMBER 73 -#define WNI_CFG_MODEL_NAME 74 -#define WNI_CFG_MANUFACTURER_PRODUCT_NAME 75 -#define WNI_CFG_MANUFACTURER_PRODUCT_VERSION 76 -#define WNI_CFG_11D_ENABLED 77 -#define WNI_CFG_MAX_TX_POWER_2_4 78 -#define WNI_CFG_MAX_TX_POWER_5 79 -#define WNI_CFG_NETWORK_DENSITY 80 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM 81 -#define WNI_CFG_CURRENT_TX_ANTENNA 82 -#define WNI_CFG_CURRENT_RX_ANTENNA 83 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL 84 -#define WNI_CFG_POWER_STATE_PER_CHAIN 85 -#define WNI_CFG_NEW_BSS_FOUND_IND 86 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED 87 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED 88 -#define WNI_CFG_AP_NODE_NAME 89 -#define WNI_CFG_COUNTRY_CODE 90 -#define WNI_CFG_11H_ENABLED 91 -#define WNI_CFG_WT_CNF_TIMEOUT 92 -#define WNI_CFG_KEEPALIVE_TIMEOUT 93 -#define WNI_CFG_PROXIMITY 94 -#define WNI_CFG_LOG_LEVEL 95 -#define WNI_CFG_OLBC_DETECT_TIMEOUT 96 -#define WNI_CFG_PROTECTION_ENABLED 97 -#define WNI_CFG_11G_PROTECTION_ALWAYS 98 -#define WNI_CFG_FORCE_POLICY_PROTECTION 99 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED 100 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED 101 -#define WNI_CFG_CAL_PERIOD 102 -#define WNI_CFG_STATS_PERIOD 103 -#define WNI_CFG_CAL_CONTROL 104 -#define WNI_CFG_11G_ONLY_POLICY 105 -#define WNI_CFG_PACKET_CLASSIFICATION 106 -#define WNI_CFG_WME_ENABLED 107 -#define WNI_CFG_ADDTS_RSP_TIMEOUT 108 -#define WNI_CFG_MAX_SP_LENGTH 109 -#define WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD 110 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS 111 -#define WNI_CFG_WSM_ENABLED 112 -#define WNI_CFG_PROP_CAPABILITY 113 -#define WNI_CFG_EDCA_PROFILE 114 -#define WNI_CFG_EDCA_ANI_ACBK_LOCAL 115 -#define WNI_CFG_EDCA_ANI_ACBE_LOCAL 116 -#define WNI_CFG_EDCA_ANI_ACVI_LOCAL 117 -#define WNI_CFG_EDCA_ANI_ACVO_LOCAL 118 -#define WNI_CFG_EDCA_ANI_ACBK 119 -#define WNI_CFG_EDCA_ANI_ACBE 120 -#define WNI_CFG_EDCA_ANI_ACVI 121 -#define WNI_CFG_EDCA_ANI_ACVO 122 -#define WNI_CFG_EDCA_WME_ACBK_LOCAL 123 -#define WNI_CFG_EDCA_WME_ACBE_LOCAL 124 -#define WNI_CFG_EDCA_WME_ACVI_LOCAL 125 -#define WNI_CFG_EDCA_WME_ACVO_LOCAL 126 -#define WNI_CFG_EDCA_WME_ACBK 127 -#define WNI_CFG_EDCA_WME_ACBE 128 -#define WNI_CFG_EDCA_WME_ACVI 129 -#define WNI_CFG_EDCA_WME_ACVO 130 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK_LOCAL 131 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE_LOCAL 132 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI_LOCAL 133 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO_LOCAL 134 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK 135 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE 136 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI 137 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO 138 -#define WNI_CFG_RDET_FLAG 139 -#define WNI_CFG_RADAR_CHANNEL_LIST 140 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT 141 -#define WNI_CFG_ADMIT_POLICY 142 -#define WNI_CFG_ADMIT_BWFACTOR 143 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE 144 -#define WNI_CFG_CHANNEL_BONDING_MODE 145 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE 146 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO 147 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE 148 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO 149 -#define WNI_CFG_TRIG_STA_BK_SCAN 150 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING 151 -#define WNI_CFG_SCAN_CONTROL_LIST 152 -#define WNI_CFG_MIMO_ENABLED 153 -#define WNI_CFG_BLOCK_ACK_ENABLED 154 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT 155 -#define WNI_CFG_HT_RX_STBC 156 -#define WNI_CFG_HT_CAP_INFO 157 -#define WNI_CFG_HT_AMPDU_PARAMS 158 -#define WNI_CFG_SUPPORTED_MCS_SET 159 -#define WNI_CFG_EXT_HT_CAP_INFO 160 -#define WNI_CFG_TX_BF_CAP 161 -#define WNI_CFG_AS_CAP 162 -#define WNI_CFG_HT_INFO_FIELD1 163 -#define WNI_CFG_HT_INFO_FIELD2 164 -#define WNI_CFG_HT_INFO_FIELD3 165 -#define WNI_CFG_BASIC_MCS_SET 166 -#define WNI_CFG_CURRENT_MCS_SET 167 -#define WNI_CFG_GREENFIELD_CAPABILITY 168 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH 169 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET 170 -#define WNI_CFG_VHT_LDPC_CODING_CAP 171 -#define WNI_CFG_VHT_SHORT_GI_80MHZ 172 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ 173 -#define WNI_CFG_VHT_TXSTBC 174 -#define WNI_CFG_VHT_RXSTBC 175 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP 176 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP 177 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED 178 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS 179 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP 180 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP 181 -#define WNI_CFG_VHT_TXOP_PS 182 -#define WNI_CFG_VHT_HTC_VHTC_CAP 183 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT 184 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP 185 -#define WNI_CFG_VHT_RX_ANT_PATTERN 186 -#define WNI_CFG_VHT_TX_ANT_PATTERN 187 -#define WNI_CFG_VHT_RX_MCS_MAP 188 -#define WNI_CFG_VHT_TX_MCS_MAP 189 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE 190 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE 191 -#define WNI_CFG_VHT_CHANNEL_WIDTH 192 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1 193 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2 194 -#define WNI_CFG_VHT_BASIC_MCS_SET 195 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT 196 -#define WNI_CFG_VHT_SS_UNDER_UTIL 197 -#define WNI_CFG_VHT_40MHZ_UTILIZATION 198 -#define WNI_CFG_VHT_80MHZ_UTILIZATION 199 -#define WNI_CFG_VHT_160MHZ_UTILIZATION 200 -#define WNI_CFG_MAX_AMSDU_LENGTH 201 -#define WNI_CFG_MPDU_DENSITY 202 -#define WNI_CFG_NUM_BUFF_ADVERT 203 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR 204 -#define WNI_CFG_SHORT_GI_20MHZ 205 -#define WNI_CFG_SHORT_GI_40MHZ 206 -#define WNI_CFG_RIFS_ENABLED 207 -#define WNI_CFG_MAX_PS_POLL 208 -#define WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE 209 -#define WNI_CFG_RSSI_FILTER_PERIOD 210 -#define WNI_CFG_MIN_RSSI_THRESHOLD 211 -#define WNI_CFG_NTH_BEACON_FILTER 212 -#define WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE 213 -#define WNI_CFG_SCAN_IN_POWERSAVE 214 -#define WNI_CFG_IGNORE_DTIM 215 -#define WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE 216 -#define WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE 217 -#define WNI_CFG_WOWLAN_DEAUTH_ENABLE 218 -#define WNI_CFG_WOWLAN_DISASSOC_ENABLE 219 -#define WNI_CFG_WOWLAN_MAX_MISSED_BEACON 220 -#define WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD 221 -#define WNI_CFG_BA_TIMEOUT 222 -#define WNI_CFG_BA_THRESHOLD_HIGH 223 -#define WNI_CFG_MAX_BA_BUFFERS 224 -#define WNI_CFG_MAX_BA_SESSIONS 225 -#define WNI_CFG_BA_AUTO_SETUP 226 -#define WNI_CFG_ADDBA_REQ_DECLINE 227 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC 228 -#define WNI_CFG_BG_SCAN_CHANNEL_LIST 229 -#define WNI_CFG_MAX_MEDIUM_TIME 230 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU 231 -#define WNI_CFG_IBSS_AUTO_BSSID 232 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG 233 -#define WNI_CFG_PROBE_REQ_ADDNIE_DATA 234 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG 235 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA1 236 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA2 237 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA3 238 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG 239 -#define WNI_CFG_ASSOC_RSP_ADDNIE_DATA 240 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG 241 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_DATA 242 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG 243 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA 244 -#define WNI_CFG_WPS_ENABLE 245 -#define WNI_CFG_WPS_STATE 246 -#define WNI_CFG_WPS_PROBE_REQ_FLAG 247 -#define WNI_CFG_WPS_VERSION 248 -#define WNI_CFG_WPS_REQUEST_TYPE 249 -#define WNI_CFG_WPS_CFG_METHOD 250 -#define WNI_CFG_WPS_UUID 251 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY 252 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI 253 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY 254 -#define WNI_CFG_WPS_ASSOCIATION_STATE 255 -#define WNI_CFG_WPS_CONFIGURATION_ERROR 256 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID 257 -#define WNI_CFG_WPS_ASSOC_METHOD 258 -#define WNI_CFG_LOW_GAIN_OVERRIDE 259 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE 260 -#define WNI_CFG_RPE_POLLING_THRESHOLD 261 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG 262 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG 263 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG 264 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG 265 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS 266 -#define WNI_CFG_SINGLE_TID_RC 267 -#define WNI_CFG_RRM_ENABLED 268 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX 269 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX 270 -#define WNI_CFG_TX_PWR_CTRL_ENABLE 271 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING 272 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK 273 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE 274 -#define WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT 275 -#define WNI_CFG_TELE_BCN_WAKEUP_EN 276 -#define WNI_CFG_TELE_BCN_TRANS_LI 277 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS 278 -#define WNI_CFG_TELE_BCN_MAX_LI 279 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS 280 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS 281 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD 282 -#define WNI_CFG_ASSOC_STA_LIMIT 283 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL 284 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL 285 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND 286 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD 287 -#define WNI_CFG_ENABLE_CLOSE_LOOP 288 -#define WNI_CFG_ENABLE_LTE_COEX 289 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT 290 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT 291 -#define WNI_CFG_ENABLE_MC_ADDR_LIST 292 -#define WNI_CFG_ENABLE_UC_FILTER 293 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION 294 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED 295 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP 296 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT 297 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK 298 -#define WNI_CFG_TDLS_BUF_STA_ENABLED 299 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME 300 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD 301 -#define WNI_CFG_ENABLE_ADAPT_RX_DRAIN 302 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR 303 -#define WNI_CFG_ANTENNA_DIVESITY 304 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT 305 -#define WNI_CFG_ATH_DISABLE 306 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN 307 -#define WNI_CFG_BTC_ACTIVE_BT_LEN 308 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN 309 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN 310 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY 311 -#define WNI_CFG_ASD_PROBE_INTERVAL 312 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD 313 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD 314 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL 315 -#define WNI_CFG_BTC_CTS2S_DURING_SCO 316 -#define WNI_CFG_CHANNEL_BONDING_24G 317 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME 318 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME 319 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL 320 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL 321 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL 322 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR 323 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD 324 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED 325 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES 326 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL 327 -#define WNI_CFG_RA_FILTER_ENABLE 328 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL 329 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE 330 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE 331 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD 332 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD 333 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED 334 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP 335 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT 336 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT 337 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW 338 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW 339 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE 340 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS 341 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS 342 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE 343 -#define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE 344 - -/* - * String parameter lengths - */ - -#define WNI_CFG_STA_ID_LEN 6 -#define WNI_CFG_SSID_LEN 32 -#define WNI_CFG_WEP_DEFAULT_KEY_1_LEN 13 -#define WNI_CFG_WEP_DEFAULT_KEY_2_LEN 13 -#define WNI_CFG_WEP_DEFAULT_KEY_3_LEN 13 -#define WNI_CFG_WEP_DEFAULT_KEY_4_LEN 13 -#define WNI_CFG_SUPPORTED_RATES_11B_LEN 4 -#define WNI_CFG_SUPPORTED_RATES_11A_LEN 8 -#define WNI_CFG_OPERATIONAL_RATE_SET_LEN 12 -#define WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN 8 -#define WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET_LEN 4 -#define WNI_CFG_BSSID_LEN 6 -#define WNI_CFG_VALID_CHANNEL_LIST_LEN 100 -#define WNI_CFG_MANUFACTURER_OUI_LEN 3 -#define WNI_CFG_MANUFACTURER_NAME_LEN 65 -#define WNI_CFG_MODEL_NUMBER_LEN 33 -#define WNI_CFG_MODEL_NAME_LEN 33 -#define WNI_CFG_MANUFACTURER_PRODUCT_NAME_LEN 33 -#define WNI_CFG_MANUFACTURER_PRODUCT_VERSION_LEN 33 -#define WNI_CFG_MAX_TX_POWER_2_4_LEN 128 -#define WNI_CFG_MAX_TX_POWER_5_LEN 128 -#define WNI_CFG_AP_NODE_NAME_LEN 32 -#define WNI_CFG_COUNTRY_CODE_LEN 3 -#define WNI_CFG_EDCA_ANI_ACBK_LOCAL_LEN 20 -#define WNI_CFG_EDCA_ANI_ACBE_LOCAL_LEN 20 -#define WNI_CFG_EDCA_ANI_ACVI_LOCAL_LEN 20 -#define WNI_CFG_EDCA_ANI_ACVO_LOCAL_LEN 20 -#define WNI_CFG_EDCA_ANI_ACBK_LEN 20 -#define WNI_CFG_EDCA_ANI_ACBE_LEN 20 -#define WNI_CFG_EDCA_ANI_ACVI_LEN 20 -#define WNI_CFG_EDCA_ANI_ACVO_LEN 20 -#define WNI_CFG_EDCA_WME_ACBK_LOCAL_LEN 20 -#define WNI_CFG_EDCA_WME_ACBE_LOCAL_LEN 20 -#define WNI_CFG_EDCA_WME_ACVI_LOCAL_LEN 20 -#define WNI_CFG_EDCA_WME_ACVO_LOCAL_LEN 20 -#define WNI_CFG_EDCA_WME_ACBK_LEN 20 -#define WNI_CFG_EDCA_WME_ACBE_LEN 20 -#define WNI_CFG_EDCA_WME_ACVI_LEN 20 -#define WNI_CFG_EDCA_WME_ACVO_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK_LOCAL_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE_LOCAL_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI_LOCAL_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO_LOCAL_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACBK_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACBE_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACVI_LEN 20 -#define WNI_CFG_EDCA_TIT_DEMO_ACVO_LEN 20 -#define WNI_CFG_RADAR_CHANNEL_LIST_LEN 20 -#define WNI_CFG_SCAN_CONTROL_LIST_LEN 128 -#define WNI_CFG_SUPPORTED_MCS_SET_LEN 16 -#define WNI_CFG_BASIC_MCS_SET_LEN 16 -#define WNI_CFG_CURRENT_MCS_SET_LEN 16 -#define WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN 100 -#define WNI_CFG_PROBE_REQ_ADDNIE_DATA_LEN 255 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN 255 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA2_LEN 255 -#define WNI_CFG_PROBE_RSP_ADDNIE_DATA3_LEN 255 -#define WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN 255 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_DATA_LEN 255 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN 255 -#define WNI_CFG_WPS_UUID_LEN 16 - -/* - * Integer parameter min/max/default values - */ - -#define WNI_CFG_CF_POLLABLE_APMIN 0 -#define WNI_CFG_CF_POLLABLE_APMAX 1 -#define WNI_CFG_CF_POLLABLE_APDEF 0 - -#define WNI_CFG_CFP_PERIOD_STAMIN 0 -#define WNI_CFG_CFP_PERIOD_STAMAX 255 -#define WNI_CFG_CFP_PERIOD_STADEF 1 - -#define WNI_CFG_CFP_PERIOD_APMIN 0 -#define WNI_CFG_CFP_PERIOD_APMAX 255 -#define WNI_CFG_CFP_PERIOD_APDEF 1 - -#define WNI_CFG_CFP_MAX_DURATION_STAMIN 0 -#define WNI_CFG_CFP_MAX_DURATION_STAMAX 65535 -#define WNI_CFG_CFP_MAX_DURATION_STADEF 30000 - -#define WNI_CFG_CFP_MAX_DURATION_APMIN 0 -#define WNI_CFG_CFP_MAX_DURATION_APMAX 65535 -#define WNI_CFG_CFP_MAX_DURATION_APDEF 30000 - -#define WNI_CFG_BEACON_INTERVAL_STAMIN 0 -#define WNI_CFG_BEACON_INTERVAL_STAMAX 65535 -#define WNI_CFG_BEACON_INTERVAL_STADEF 100 - -#define WNI_CFG_BEACON_INTERVAL_APMIN 0 -#define WNI_CFG_BEACON_INTERVAL_APMAX 65535 -#define WNI_CFG_BEACON_INTERVAL_APDEF 100 - -#define WNI_CFG_DTIM_PERIOD_STAMIN 0 -#define WNI_CFG_DTIM_PERIOD_STAMAX 65535 -#define WNI_CFG_DTIM_PERIOD_STADEF 1 - -#define WNI_CFG_DTIM_PERIOD_APMIN 0 -#define WNI_CFG_DTIM_PERIOD_APMAX 65535 -#define WNI_CFG_DTIM_PERIOD_APDEF 1 - -#define WNI_CFG_WEP_KEY_LENGTH_STAMIN 5 -#define WNI_CFG_WEP_KEY_LENGTH_STAMAX 13 -#define WNI_CFG_WEP_KEY_LENGTH_STADEF 5 - -#define WNI_CFG_WEP_KEY_LENGTH_APMIN 5 -#define WNI_CFG_WEP_KEY_LENGTH_APMAX 13 -#define WNI_CFG_WEP_KEY_LENGTH_APDEF 5 - -#define WNI_CFG_WEP_KEY_LENGTH_5 5 -#define WNI_CFG_WEP_KEY_LENGTH_13 13 - -#define WNI_CFG_WEP_DEFAULT_KEYID_STAMIN 0 -#define WNI_CFG_WEP_DEFAULT_KEYID_STAMAX 3 -#define WNI_CFG_WEP_DEFAULT_KEYID_STADEF 0 - -#define WNI_CFG_WEP_DEFAULT_KEYID_APMIN 0 -#define WNI_CFG_WEP_DEFAULT_KEYID_APMAX 3 -#define WNI_CFG_WEP_DEFAULT_KEYID_APDEF 0 - -#define WNI_CFG_WEP_DEFAULT_KEYID_0 0 -#define WNI_CFG_WEP_DEFAULT_KEYID_1 1 -#define WNI_CFG_WEP_DEFAULT_KEYID_2 2 -#define WNI_CFG_WEP_DEFAULT_KEYID_3 3 - -#define WNI_CFG_EXCLUDE_UNENCRYPTED_STAMIN 0 -#define WNI_CFG_EXCLUDE_UNENCRYPTED_STAMAX 1 -#define WNI_CFG_EXCLUDE_UNENCRYPTED_STADEF 0 - -#define WNI_CFG_EXCLUDE_UNENCRYPTED_APMIN 0 -#define WNI_CFG_EXCLUDE_UNENCRYPTED_APMAX 1 -#define WNI_CFG_EXCLUDE_UNENCRYPTED_APDEF 0 - -#define WNI_CFG_RTS_THRESHOLD_STAMIN 0 -#define WNI_CFG_RTS_THRESHOLD_STAMAX 2347 -#define WNI_CFG_RTS_THRESHOLD_STADEF 2347 - -#define WNI_CFG_RTS_THRESHOLD_APMIN 0 -#define WNI_CFG_RTS_THRESHOLD_APMAX 2347 -#define WNI_CFG_RTS_THRESHOLD_APDEF 2347 - -#define WNI_CFG_SHORT_RETRY_LIMIT_STAMIN 0 -#define WNI_CFG_SHORT_RETRY_LIMIT_STAMAX 255 -#define WNI_CFG_SHORT_RETRY_LIMIT_STADEF 6 - -#define WNI_CFG_SHORT_RETRY_LIMIT_APMIN 0 -#define WNI_CFG_SHORT_RETRY_LIMIT_APMAX 255 -#define WNI_CFG_SHORT_RETRY_LIMIT_APDEF 6 - -#define WNI_CFG_LONG_RETRY_LIMIT_STAMIN 0 -#define WNI_CFG_LONG_RETRY_LIMIT_STAMAX 255 -#define WNI_CFG_LONG_RETRY_LIMIT_STADEF 6 - -#define WNI_CFG_LONG_RETRY_LIMIT_APMIN 0 -#define WNI_CFG_LONG_RETRY_LIMIT_APMAX 255 -#define WNI_CFG_LONG_RETRY_LIMIT_APDEF 6 - -#define WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN 256 -#define WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX 8000 -#define WNI_CFG_FRAGMENTATION_THRESHOLD_STADEF 8000 - -#define WNI_CFG_FRAGMENTATION_THRESHOLD_APMIN 256 -#define WNI_CFG_FRAGMENTATION_THRESHOLD_APMAX 8000 -#define WNI_CFG_FRAGMENTATION_THRESHOLD_APDEF 8000 - -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STAMIN 0 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STAMAX 65535 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STADEF 20 - -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_APMIN 0 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_APMAX 65535 -#define WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_APDEF 20 - -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STAMIN 0 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STAMAX 65535 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STADEF 40 - -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_APMIN 0 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_APMAX 65535 -#define WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_APDEF 40 - -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STAMIN 0 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STAMAX 65535 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STADEF 60 - -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_APMIN 0 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_APMAX 65535 -#define WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_APDEF 60 - -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMIN 0 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMAX 65535 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF 110 - -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_APMIN 0 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_APMAX 65535 -#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_APDEF 110 - -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMIN 0 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMAX 65535 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STADEF 3000 - -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_APMIN 0 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_APMAX 65535 -#define WNI_CFG_JOIN_FAILURE_TIMEOUT_APDEF 3000 - -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMIN 0 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMAX 65535 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STADEF 1000 - -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_APMIN 0 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_APMAX 65535 -#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_APDEF 1000 - -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STAMIN 0 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STAMAX 65535 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STADEF 1000 - -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_APMIN 0 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_APMAX 65535 -#define WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_APDEF 1000 - -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STAMIN 0 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STAMAX 65535 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STADEF 2000 - -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_APMIN 0 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_APMAX 65535 -#define WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_APDEF 3000 - -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STAMIN 0 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STAMAX 65535 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STADEF 1000 - -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_APMIN 0 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_APMAX 65535 -#define WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_APDEF 3000 - -#define WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STAMIN 0 -#define WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STAMAX 65535 -#define WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STADEF 1000 - -#define WNI_CFG_PS_ENABLE_BCN_FILTER_STAMIN 0 -#define WNI_CFG_PS_ENABLE_BCN_FILTER_STAMAX 1 -#define WNI_CFG_PS_ENABLE_BCN_FILTER_STADEF 1 - -#define WNI_CFG_PS_ENABLE_HEART_BEAT_STAMIN 0 -#define WNI_CFG_PS_ENABLE_HEART_BEAT_STAMAX 1 -#define WNI_CFG_PS_ENABLE_HEART_BEAT_STADEF 1 - -#define WNI_CFG_PS_ENABLE_RSSI_MONITOR_STAMIN 0 -#define WNI_CFG_PS_ENABLE_RSSI_MONITOR_STAMAX 1 -#define WNI_CFG_PS_ENABLE_RSSI_MONITOR_STADEF 0 - -#define WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STAMIN 1 -#define WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STAMAX 255 -#define WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STADEF 20 - -#define WNI_CFG_RF_SETTLING_TIME_CLK_STAMIN 0 -#define WNI_CFG_RF_SETTLING_TIME_CLK_STAMAX 60000 -#define WNI_CFG_RF_SETTLING_TIME_CLK_STADEF 1500 - -#define WNI_CFG_PHY_MODE_STAMIN 0 -#define WNI_CFG_PHY_MODE_STAMAX 3 -#define WNI_CFG_PHY_MODE_STADEF 0 - -#define WNI_CFG_PHY_MODE_APMIN 0 -#define WNI_CFG_PHY_MODE_APMAX 3 -#define WNI_CFG_PHY_MODE_APDEF 0 - -#define WNI_CFG_PHY_MODE_11A 0 -#define WNI_CFG_PHY_MODE_11B 1 -#define WNI_CFG_PHY_MODE_11G 2 -#define WNI_CFG_PHY_MODE_NONE 3 - -#define WNI_CFG_DOT11_MODE_STAMIN 0 -#define WNI_CFG_DOT11_MODE_STAMAX 11 -#define WNI_CFG_DOT11_MODE_STADEF 0 - -#define WNI_CFG_DOT11_MODE_APMIN 0 -#define WNI_CFG_DOT11_MODE_APMAX 11 -#define WNI_CFG_DOT11_MODE_APDEF 0 - -#define WNI_CFG_DOT11_MODE_ALL 0 -#define WNI_CFG_DOT11_MODE_11A 1 -#define WNI_CFG_DOT11_MODE_11B 2 -#define WNI_CFG_DOT11_MODE_11G 3 -#define WNI_CFG_DOT11_MODE_11N 4 -#define WNI_CFG_DOT11_MODE_POLARIS 5 -#define WNI_CFG_DOT11_MODE_TITAN 6 -#define WNI_CFG_DOT11_MODE_TAURUS 7 -#define WNI_CFG_DOT11_MODE_11G_ONLY 8 -#define WNI_CFG_DOT11_MODE_11N_ONLY 9 -#define WNI_CFG_DOT11_MODE_11AC 10 -#define WNI_CFG_DOT11_MODE_11AC_ONLY 11 - -#define WNI_CFG_LISTEN_INTERVAL_STAMIN 0 -#define WNI_CFG_LISTEN_INTERVAL_STAMAX 65535 -#define WNI_CFG_LISTEN_INTERVAL_STADEF 1 - -#define WNI_CFG_LISTEN_INTERVAL_APMIN 0 -#define WNI_CFG_LISTEN_INTERVAL_APMAX 65535 -#define WNI_CFG_LISTEN_INTERVAL_APDEF 1 - -#define WNI_CFG_CURRENT_CHANNEL_STAMIN 0 -#define WNI_CFG_CURRENT_CHANNEL_STAMAX 165 -#define WNI_CFG_CURRENT_CHANNEL_STADEF 1 - -#define WNI_CFG_CURRENT_CHANNEL_APMIN 0 -#define WNI_CFG_CURRENT_CHANNEL_APMAX 165 -#define WNI_CFG_CURRENT_CHANNEL_APDEF 1 - -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STAMIN 0 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STAMAX 11 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STADEF 5 - -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_APMIN 0 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_APMAX 11 -#define WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_APDEF 5 - -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STAMIN 0 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STAMAX 31 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STADEF 1 - -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_APMIN 0 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_APMAX 31 -#define WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_APDEF 1 - -#define WNI_CFG_RATE_ADAPTATION_TYPE_STAMIN 0 -#define WNI_CFG_RATE_ADAPTATION_TYPE_STAMAX 2 -#define WNI_CFG_RATE_ADAPTATION_TYPE_STADEF 1 - -#define WNI_CFG_RATE_ADAPTATION_TYPE_APMIN 0 -#define WNI_CFG_RATE_ADAPTATION_TYPE_APMAX 2 -#define WNI_CFG_RATE_ADAPTATION_TYPE_APDEF 1 - -#define WNI_CFG_RATE_ADAPTATION_TYPE_FIXED 0 -#define WNI_CFG_RATE_ADAPTATION_TYPE_AUTO 1 -#define WNI_CFG_RATE_ADAPTATION_TYPE_SNR_BASED 2 - -#define WNI_CFG_FIXED_RATE_STAMIN 0 -#define WNI_CFG_FIXED_RATE_STAMAX 44 -#define WNI_CFG_FIXED_RATE_STADEF 0 - -#define WNI_CFG_FIXED_RATE_APMIN 0 -#define WNI_CFG_FIXED_RATE_APMAX 44 -#define WNI_CFG_FIXED_RATE_APDEF 0 - -#define WNI_CFG_FIXED_RATE_AUTO 0 -#define WNI_CFG_FIXED_RATE_1MBPS 1 -#define WNI_CFG_FIXED_RATE_2MBPS 2 -#define WNI_CFG_FIXED_RATE_5_5MBPS 3 -#define WNI_CFG_FIXED_RATE_11MBPS 4 -#define WNI_CFG_FIXED_RATE_6MBPS 5 -#define WNI_CFG_FIXED_RATE_9MBPS 6 -#define WNI_CFG_FIXED_RATE_12MBPS 7 -#define WNI_CFG_FIXED_RATE_18MBPS 8 -#define WNI_CFG_FIXED_RATE_24MBPS 9 -#define WNI_CFG_FIXED_RATE_36MBPS 10 -#define WNI_CFG_FIXED_RATE_48MBPS 11 -#define WNI_CFG_FIXED_RATE_54MBPS 12 -#define WNI_CFG_FIXED_RATE_6_5MBPS_MCS0_20MHZ_SIMO 13 -#define WNI_CFG_FIXED_RATE_13MBPS_MCS1_20MHZ_SIMO 14 -#define WNI_CFG_FIXED_RATE_19_5MBPS_MCS2_20MHZ_SIMO 15 -#define WNI_CFG_FIXED_RATE_26MBPS_MCS3_20MHZ_SIMO 16 -#define WNI_CFG_FIXED_RATE_39MBPS_MCS4_20MHZ_SIMO 17 -#define WNI_CFG_FIXED_RATE_52MBPS_MCS5_20MHZ_SIMO 18 -#define WNI_CFG_FIXED_RATE_58_5MBPS_MCS6_20MHZ_SIMO 19 -#define WNI_CFG_FIXED_RATE_65MBPS_MCS7_20MHZ_SIMO 20 -#define WNI_CFG_FIXED_RATE_7_2MBPS_MCS0_20MHZ_SIMO_SGI 21 -#define WNI_CFG_FIXED_RATE_14_4MBPS_MCS1_20MHZ_SIMO_SGI 22 -#define WNI_CFG_FIXED_RATE_21_7MBPS_MCS2_20MHZ_SIMO_SGI 23 -#define WNI_CFG_FIXED_RATE_28_9MBPS_MCS3_20MHZ_SIMO_SGI 24 -#define WNI_CFG_FIXED_RATE_43_3MBPS_MCS4_20MHZ_SIMO_SGI 25 -#define WNI_CFG_FIXED_RATE_57_8MBPS_MCS5_20MHZ_SIMO_SGI 26 -#define WNI_CFG_FIXED_RATE_65MBPS_MCS6_20MHZ_SIMO_SGI 27 -#define WNI_CFG_FIXED_RATE_72_2MBPS_MCS7_20MHZ_SIMO_SGI 28 -#define WNI_CFG_FIXED_RATE_0_25MBPS_SLR_20MHZ_SIMO 29 -#define WNI_CFG_FIXED_RATE_0_5MBPS_SLR_20MHZ_SIMO 30 -#define WNI_CFG_FIXED_RATE_68_25MBPS_QC_PROP_20MHZ_SIMO 31 -#define WNI_CFG_FIXED_RATE_54MBPS_MCS3_40MHZ_SIMO 32 -#define WNI_CFG_FIXED_RATE_81MBPS_MCS4_40MHZ_SIMO 33 -#define WNI_CFG_FIXED_RATE_108MBPS_MCS5_40MHZ_SIMO 34 -#define WNI_CFG_FIXED_RATE_121_5MBPS_MCS6_40MHZ_SIMO 35 -#define WNI_CFG_FIXED_RATE_135MBPS_MCS7_40MHZ_SIMO 36 -#define WNI_CFG_FIXED_RATE_15MBPS_MCS0_40MHZ_SIMO_SGI 37 -#define WNI_CFG_FIXED_RATE_30MBPS_MCS1_40MHZ_SIMO_SGI 38 -#define WNI_CFG_FIXED_RATE_45MBPS_MCS2_40MHZ_SIMO_SGI 39 -#define WNI_CFG_FIXED_RATE_60MBPS_MCS3_40MHZ_SIMO_SGI 40 -#define WNI_CFG_FIXED_RATE_90MBPS_MCS4_40MHZ_SIMO_SGI 41 -#define WNI_CFG_FIXED_RATE_120MBPS_MCS5_40MHZ_SIMO_SGI 42 -#define WNI_CFG_FIXED_RATE_135MBPS_MCS6_40MHZ_SIMO_SGI 43 -#define WNI_CFG_FIXED_RATE_150MBPS_MCS7_40MHZ_SIMO_SGI 44 - -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STAMIN 0 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STAMAX 31 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STADEF 1 - -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_APMIN 0 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_APMAX 31 -#define WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_APDEF 1 - -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STAMIN 0 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STAMAX 31 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STADEF 5 - -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_APMIN 0 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_APMAX 31 -#define WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_APDEF 5 - -#define WNI_CFG_RETRYRATE_POLICY_STAMIN 0 -#define WNI_CFG_RETRYRATE_POLICY_STAMAX 255 -#define WNI_CFG_RETRYRATE_POLICY_STADEF 4 - -#define WNI_CFG_RETRYRATE_POLICY_APMIN 0 -#define WNI_CFG_RETRYRATE_POLICY_APMAX 255 -#define WNI_CFG_RETRYRATE_POLICY_APDEF 4 - -#define WNI_CFG_RETRYRATE_POLICY_MIN_SUPPORTED 0 -#define WNI_CFG_RETRYRATE_POLICY_PRIMARY 1 -#define WNI_CFG_RETRYRATE_POLICY_RESERVED 2 -#define WNI_CFG_RETRYRATE_POLICY_CLOSEST 3 -#define WNI_CFG_RETRYRATE_POLICY_AUTOSELECT 4 -#define WNI_CFG_RETRYRATE_POLICY_MAX 5 - -#define WNI_CFG_RETRYRATE_SECONDARY_STAMIN 0 -#define WNI_CFG_RETRYRATE_SECONDARY_STAMAX 255 -#define WNI_CFG_RETRYRATE_SECONDARY_STADEF 0 - -#define WNI_CFG_RETRYRATE_SECONDARY_APMIN 0 -#define WNI_CFG_RETRYRATE_SECONDARY_APMAX 255 -#define WNI_CFG_RETRYRATE_SECONDARY_APDEF 0 - -#define WNI_CFG_RETRYRATE_TERTIARY_STAMIN 0 -#define WNI_CFG_RETRYRATE_TERTIARY_STAMAX 255 -#define WNI_CFG_RETRYRATE_TERTIARY_STADEF 0 - -#define WNI_CFG_RETRYRATE_TERTIARY_APMIN 0 -#define WNI_CFG_RETRYRATE_TERTIARY_APMAX 255 -#define WNI_CFG_RETRYRATE_TERTIARY_APDEF 0 - -#define WNI_CFG_APSD_ENABLED_STAMIN 0 -#define WNI_CFG_APSD_ENABLED_STAMAX 1 -#define WNI_CFG_APSD_ENABLED_STADEF 0 - -#define WNI_CFG_APSD_ENABLED_APMIN 0 -#define WNI_CFG_APSD_ENABLED_APMAX 1 -#define WNI_CFG_APSD_ENABLED_APDEF 0 - -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_STAMIN 0 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_STAMAX 1 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_STADEF 1 - -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_APMIN 0 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_APMAX 1 -#define WNI_CFG_SHARED_KEY_AUTH_ENABLE_APDEF 1 - -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STAMIN 0 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STAMAX 1 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STADEF 1 - -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_APMIN 0 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_APMAX 1 -#define WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_APDEF 1 - -#define WNI_CFG_AUTHENTICATION_TYPE_STAMIN 0 -#define WNI_CFG_AUTHENTICATION_TYPE_STAMAX 65535 -#define WNI_CFG_AUTHENTICATION_TYPE_STADEF 0 - -#define WNI_CFG_AUTHENTICATION_TYPE_APMIN 0 -#define WNI_CFG_AUTHENTICATION_TYPE_APMAX 65535 -#define WNI_CFG_AUTHENTICATION_TYPE_APDEF 0 - -#define WNI_CFG_CF_POLL_REQUEST_APMIN 0 -#define WNI_CFG_CF_POLL_REQUEST_APMAX 1 -#define WNI_CFG_CF_POLL_REQUEST_APDEF 0 - -#define WNI_CFG_PRIVACY_ENABLED_STAMIN 0 -#define WNI_CFG_PRIVACY_ENABLED_STAMAX 1 -#define WNI_CFG_PRIVACY_ENABLED_STADEF 0 - -#define WNI_CFG_PRIVACY_ENABLED_APMIN 0 -#define WNI_CFG_PRIVACY_ENABLED_APMAX 1 -#define WNI_CFG_PRIVACY_ENABLED_APDEF 0 - -#define WNI_CFG_SHORT_PREAMBLE_STAMIN 0 -#define WNI_CFG_SHORT_PREAMBLE_STAMAX 1 -#define WNI_CFG_SHORT_PREAMBLE_STADEF 1 - -#define WNI_CFG_SHORT_PREAMBLE_APMIN 0 -#define WNI_CFG_SHORT_PREAMBLE_APMAX 1 -#define WNI_CFG_SHORT_PREAMBLE_APDEF 1 - -#define WNI_CFG_SHORT_SLOT_TIME_STAMIN 0 -#define WNI_CFG_SHORT_SLOT_TIME_STAMAX 1 -#define WNI_CFG_SHORT_SLOT_TIME_STADEF 1 - -#define WNI_CFG_SHORT_SLOT_TIME_APMIN 0 -#define WNI_CFG_SHORT_SLOT_TIME_APMAX 1 -#define WNI_CFG_SHORT_SLOT_TIME_APDEF 0 - -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMIN 0 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMAX 1 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STADEF 0 - -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_APMIN 0 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_APMAX 1 -#define WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_APDEF 0 - -#define WNI_CFG_QOS_ENABLED_STAMIN 0 -#define WNI_CFG_QOS_ENABLED_STAMAX 1 -#define WNI_CFG_QOS_ENABLED_STADEF 0 - -#define WNI_CFG_QOS_ENABLED_APMIN 0 -#define WNI_CFG_QOS_ENABLED_APMAX 1 -#define WNI_CFG_QOS_ENABLED_APDEF 0 - -#define WNI_CFG_HCF_ENABLED_STAMIN 0 -#define WNI_CFG_HCF_ENABLED_STAMAX 1 -#define WNI_CFG_HCF_ENABLED_STADEF 0 - -#define WNI_CFG_HCF_ENABLED_APMIN 0 -#define WNI_CFG_HCF_ENABLED_APMAX 1 -#define WNI_CFG_HCF_ENABLED_APDEF 0 - -#define WNI_CFG_RSN_ENABLED_STAMIN 0 -#define WNI_CFG_RSN_ENABLED_STAMAX 1 -#define WNI_CFG_RSN_ENABLED_STADEF 0 - -#define WNI_CFG_RSN_ENABLED_APMIN 0 -#define WNI_CFG_RSN_ENABLED_APMAX 1 -#define WNI_CFG_RSN_ENABLED_APDEF 0 - -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_STAMIN 0 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_STAMAX 180000 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_STADEF 5000 - -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_APMIN 0 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_APMAX 18000 -#define WNI_CFG_BACKGROUND_SCAN_PERIOD_APDEF 5000 - -#define WNI_CFG_MAX_NUM_PRE_AUTH_STAMIN 0 -#define WNI_CFG_MAX_NUM_PRE_AUTH_STAMAX 256 -#define WNI_CFG_MAX_NUM_PRE_AUTH_STADEF 64 - -#define WNI_CFG_MAX_NUM_PRE_AUTH_APMIN 0 -#define WNI_CFG_MAX_NUM_PRE_AUTH_APMAX 256 -#define WNI_CFG_MAX_NUM_PRE_AUTH_APDEF 64 - -#define WNI_CFG_PREAUTH_CLNUP_TIMEOUT_APMIN 0 -#define WNI_CFG_PREAUTH_CLNUP_TIMEOUT_APMAX 120000 -#define WNI_CFG_PREAUTH_CLNUP_TIMEOUT_APDEF 30000 - -#define WNI_CFG_RELEASE_AID_TIMEOUT_APMIN 0 -#define WNI_CFG_RELEASE_AID_TIMEOUT_APMAX 100000 -#define WNI_CFG_RELEASE_AID_TIMEOUT_APDEF 1000 - -#define WNI_CFG_HEART_BEAT_THRESHOLD_STAMIN 0 -#define WNI_CFG_HEART_BEAT_THRESHOLD_STAMAX 65535 -#define WNI_CFG_HEART_BEAT_THRESHOLD_STADEF 40 - -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STAMIN 10 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STAMAX 10000 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STADEF 40 - -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_APMIN 10 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_APMAX 10000 -#define WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_APDEF 40 - -#define WNI_CFG_11D_ENABLED_STAMIN 0 -#define WNI_CFG_11D_ENABLED_STAMAX 1 -#define WNI_CFG_11D_ENABLED_STADEF 1 - -#define WNI_CFG_11D_ENABLED_APMIN 0 -#define WNI_CFG_11D_ENABLED_APMAX 1 -#define WNI_CFG_11D_ENABLED_APDEF 0 - -#define WNI_CFG_NETWORK_DENSITY_STAMIN 0 -#define WNI_CFG_NETWORK_DENSITY_STAMAX 3 -#define WNI_CFG_NETWORK_DENSITY_STADEF 3 - -#define WNI_CFG_NETWORK_DENSITY_APMIN 0 -#define WNI_CFG_NETWORK_DENSITY_APMAX 3 -#define WNI_CFG_NETWORK_DENSITY_APDEF 0 - -#define WNI_CFG_NETWORK_DENSITY_LOW 0 -#define WNI_CFG_NETWORK_DENSITY_MEDIUM 1 -#define WNI_CFG_NETWORK_DENSITY_HIGH 2 -#define WNI_CFG_NETWORK_DENSITY_ADAPTIVE 3 - -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STAMIN 1 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STAMAX 2 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STADEF 2 - -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_APMIN 1 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_APMAX 2 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_APDEF 2 - -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_CARRIER 1 -#define WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_CORRELATION 2 - -#define WNI_CFG_CURRENT_TX_ANTENNA_STAMIN 1 -#define WNI_CFG_CURRENT_TX_ANTENNA_STAMAX 1 -#define WNI_CFG_CURRENT_TX_ANTENNA_STADEF 1 - -#define WNI_CFG_CURRENT_TX_ANTENNA_APMIN 1 -#define WNI_CFG_CURRENT_TX_ANTENNA_APMAX 2 -#define WNI_CFG_CURRENT_TX_ANTENNA_APDEF 2 - -#define WNI_CFG_CURRENT_RX_ANTENNA_STAMIN 1 -#define WNI_CFG_CURRENT_RX_ANTENNA_STAMAX 2 -#define WNI_CFG_CURRENT_RX_ANTENNA_STADEF 2 - -#define WNI_CFG_CURRENT_RX_ANTENNA_APMIN 1 -#define WNI_CFG_CURRENT_RX_ANTENNA_APMAX 3 -#define WNI_CFG_CURRENT_RX_ANTENNA_APDEF 3 - -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMIN 0 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX 128 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_STADEF 27 - -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_APMIN 0 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_APMAX 128 -#define WNI_CFG_CURRENT_TX_POWER_LEVEL_APDEF 27 - -#define WNI_CFG_POWER_STATE_PER_CHAIN_STAMIN 0 -#define WNI_CFG_POWER_STATE_PER_CHAIN_STAMAX 65535 -#define WNI_CFG_POWER_STATE_PER_CHAIN_STADEF 785 - -#define WNI_CFG_POWER_STATE_PER_CHAIN_APMIN 0 -#define WNI_CFG_POWER_STATE_PER_CHAIN_APMAX 65535 -#define WNI_CFG_POWER_STATE_PER_CHAIN_APDEF 785 - -#define WNI_CFG_POWER_STATE_PER_CHAIN_OFF 0 -#define WNI_CFG_POWER_STATE_PER_CHAIN_ON 1 -#define WNI_CFG_POWER_STATE_PER_CHAIN_TX 2 -#define WNI_CFG_POWER_STATE_PER_CHAIN_RX 3 -#define WNI_CFG_POWER_STATE_PER_CHAIN_MASK 15 -#define WNI_CFG_POWER_STATE_PER_CHAIN_CHAIN_0_OFFSET 0 -#define WNI_CFG_POWER_STATE_PER_CHAIN_CHAIN_1_OFFSET 4 -#define WNI_CFG_POWER_STATE_PER_CHAIN_CHAIN_2_OFFSET 8 - -#define WNI_CFG_NEW_BSS_FOUND_IND_STAMIN 0 -#define WNI_CFG_NEW_BSS_FOUND_IND_STAMAX 1 -#define WNI_CFG_NEW_BSS_FOUND_IND_STADEF 0 - -#define WNI_CFG_NEW_BSS_FOUND_IND_APMIN 0 -#define WNI_CFG_NEW_BSS_FOUND_IND_APMAX 1 -#define WNI_CFG_NEW_BSS_FOUND_IND_APDEF 0 - -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STAMIN 0 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STAMAX 1 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STADEF 0 - -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_APMIN 0 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_APMAX 1 -#define WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_APDEF 0 - -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_STAMIN 0 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_STAMAX 1 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_STADEF 0 - -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_APMIN 0 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_APMAX 1 -#define WNI_CFG_PROPRIETARY_RATES_ENABLED_APDEF 0 - -#define WNI_CFG_11H_ENABLED_STAMIN 0 -#define WNI_CFG_11H_ENABLED_STAMAX 1 -#define WNI_CFG_11H_ENABLED_STADEF 1 - -#define WNI_CFG_11H_ENABLED_APMIN 0 -#define WNI_CFG_11H_ENABLED_APMAX 1 -#define WNI_CFG_11H_ENABLED_APDEF 1 - -#define WNI_CFG_WT_CNF_TIMEOUT_STAMIN 10 -#define WNI_CFG_WT_CNF_TIMEOUT_STAMAX 3000 -#define WNI_CFG_WT_CNF_TIMEOUT_STADEF 1000 - -#define WNI_CFG_WT_CNF_TIMEOUT_APMIN 10 -#define WNI_CFG_WT_CNF_TIMEOUT_APMAX 3000 -#define WNI_CFG_WT_CNF_TIMEOUT_APDEF 1000 - -#define WNI_CFG_KEEPALIVE_TIMEOUT_STAMIN 0 -#define WNI_CFG_KEEPALIVE_TIMEOUT_STAMAX 3600000 -#define WNI_CFG_KEEPALIVE_TIMEOUT_STADEF 0 - -#define WNI_CFG_KEEPALIVE_TIMEOUT_APMIN 0 -#define WNI_CFG_KEEPALIVE_TIMEOUT_APMAX 3600000 -#define WNI_CFG_KEEPALIVE_TIMEOUT_APDEF 3000 - -#define WNI_CFG_PROXIMITY_STAMIN 0 -#define WNI_CFG_PROXIMITY_STAMAX 1 -#define WNI_CFG_PROXIMITY_STADEF 0 - -#define WNI_CFG_PROXIMITY_APMIN 0 -#define WNI_CFG_PROXIMITY_APMAX 1 -#define WNI_CFG_PROXIMITY_APDEF 0 - -#define WNI_CFG_PROXIMITY_OFF 0 -#define WNI_CFG_PROXIMITY_ON 1 - -#define WNI_CFG_LOG_LEVEL_STAMIN 0 -#define WNI_CFG_LOG_LEVEL_STAMAX 7 -#define WNI_CFG_LOG_LEVEL_STADEF 4 - -#define WNI_CFG_LOG_LEVEL_APMIN 0 -#define WNI_CFG_LOG_LEVEL_APMAX 7 -#define WNI_CFG_LOG_LEVEL_APDEF 4 - -#define WNI_CFG_OLBC_DETECT_TIMEOUT_STAMIN 1000 -#define WNI_CFG_OLBC_DETECT_TIMEOUT_STAMAX 30000 -#define WNI_CFG_OLBC_DETECT_TIMEOUT_STADEF 10000 - -#define WNI_CFG_OLBC_DETECT_TIMEOUT_APMIN 1000 -#define WNI_CFG_OLBC_DETECT_TIMEOUT_APMAX 30000 -#define WNI_CFG_OLBC_DETECT_TIMEOUT_APDEF 10000 - -#define WNI_CFG_PROTECTION_ENABLED_STAMIN 0 -#define WNI_CFG_PROTECTION_ENABLED_STAMAX 65535 -#define WNI_CFG_PROTECTION_ENABLED_STADEF 65535 - -#define WNI_CFG_PROTECTION_ENABLED_APMIN 0 -#define WNI_CFG_PROTECTION_ENABLED_APMAX 65535 -#define WNI_CFG_PROTECTION_ENABLED_APDEF 65535 - -#define WNI_CFG_PROTECTION_ENABLED_FROM_llA 0 -#define WNI_CFG_PROTECTION_ENABLED_FROM_llB 1 -#define WNI_CFG_PROTECTION_ENABLED_FROM_llG 2 -#define WNI_CFG_PROTECTION_ENABLED_HT_20 3 -#define WNI_CFG_PROTECTION_ENABLED_NON_GF 4 -#define WNI_CFG_PROTECTION_ENABLED_LSIG_TXOP 5 -#define WNI_CFG_PROTECTION_ENABLED_RIFS 6 -#define WNI_CFG_PROTECTION_ENABLED_OBSS 7 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llA 8 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llB 9 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llG 10 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_HT20 11 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_NON_GF 12 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_LSIG_TXOP 13 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_RIFS 14 -#define WNI_CFG_PROTECTION_ENABLED_OLBC_OBSS 15 - -#define WNI_CFG_11G_PROTECTION_ALWAYS_STAMIN 0 -#define WNI_CFG_11G_PROTECTION_ALWAYS_STAMAX 1 -#define WNI_CFG_11G_PROTECTION_ALWAYS_STADEF 0 - -#define WNI_CFG_11G_PROTECTION_ALWAYS_APMIN 0 -#define WNI_CFG_11G_PROTECTION_ALWAYS_APMAX 1 -#define WNI_CFG_11G_PROTECTION_ALWAYS_APDEF 0 - -#define WNI_CFG_FORCE_POLICY_PROTECTION_STAMIN 0 -#define WNI_CFG_FORCE_POLICY_PROTECTION_STAMAX 5 -#define WNI_CFG_FORCE_POLICY_PROTECTION_STADEF 5 - -#define WNI_CFG_FORCE_POLICY_PROTECTION_APMIN 0 -#define WNI_CFG_FORCE_POLICY_PROTECTION_APMAX 5 -#define WNI_CFG_FORCE_POLICY_PROTECTION_APDEF 5 - -#define WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE 0 -#define WNI_CFG_FORCE_POLICY_PROTECTION_CTS 1 -#define WNI_CFG_FORCE_POLICY_PROTECTION_RTS 2 -#define WNI_CFG_FORCE_POLICY_PROTECTION_DUAL_CTS 3 -#define WNI_CFG_FORCE_POLICY_PROTECTION_RTS_ALWAYS 4 -#define WNI_CFG_FORCE_POLICY_PROTECTION_AUTO 5 - -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STAMIN 0 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STAMAX 1 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STADEF 0 - -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_APMIN 0 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_APMAX 1 -#define WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_APDEF 0 - -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STAMIN 0 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STAMAX 1 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STADEF 1 - -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_APMIN 0 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_APMAX 1 -#define WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_APDEF 1 - -#define WNI_CFG_CAL_PERIOD_STAMIN 2 -#define WNI_CFG_CAL_PERIOD_STAMAX 10 -#define WNI_CFG_CAL_PERIOD_STADEF 5 - -#define WNI_CFG_CAL_PERIOD_APMIN 2 -#define WNI_CFG_CAL_PERIOD_APMAX 10 -#define WNI_CFG_CAL_PERIOD_APDEF 5 - -#define WNI_CFG_STATS_PERIOD_STAMIN 1 -#define WNI_CFG_STATS_PERIOD_STAMAX 10 -#define WNI_CFG_STATS_PERIOD_STADEF 10 - -#define WNI_CFG_STATS_PERIOD_APMIN 1 -#define WNI_CFG_STATS_PERIOD_APMAX 10 -#define WNI_CFG_STATS_PERIOD_APDEF 10 - -#define WNI_CFG_CAL_CONTROL_STAMIN 0 -#define WNI_CFG_CAL_CONTROL_STAMAX 1 -#define WNI_CFG_CAL_CONTROL_STADEF 0 - -#define WNI_CFG_CAL_CONTROL_APMIN 0 -#define WNI_CFG_CAL_CONTROL_APMAX 1 -#define WNI_CFG_CAL_CONTROL_APDEF 0 - -#define WNI_CFG_CAL_CONTROL_CAL_ON 0 -#define WNI_CFG_CAL_CONTROL_CAL_OFF 1 - -#define WNI_CFG_11G_ONLY_POLICY_STAMIN 0 -#define WNI_CFG_11G_ONLY_POLICY_STAMAX 1 -#define WNI_CFG_11G_ONLY_POLICY_STADEF 0 - -#define WNI_CFG_11G_ONLY_POLICY_APMIN 0 -#define WNI_CFG_11G_ONLY_POLICY_APMAX 1 -#define WNI_CFG_11G_ONLY_POLICY_APDEF 0 - -#define WNI_CFG_PACKET_CLASSIFICATION_STAMIN 0 -#define WNI_CFG_PACKET_CLASSIFICATION_STAMAX 3 -#define WNI_CFG_PACKET_CLASSIFICATION_STADEF 0 - -#define WNI_CFG_PACKET_CLASSIFICATION_APMIN 0 -#define WNI_CFG_PACKET_CLASSIFICATION_APMAX 3 -#define WNI_CFG_PACKET_CLASSIFICATION_APDEF 0 - -#define WNI_CFG_PACKET_CLASSIFICATION_DISABLED 0 -#define WNI_CFG_PACKET_CLASSIFICATION_DSCP 1 -#define WNI_CFG_PACKET_CLASSIFICATION_8021P 2 -#define WNI_CFG_PACKET_CLASSIFICATION_ALL 3 - -#define WNI_CFG_WME_ENABLED_STAMIN 0 -#define WNI_CFG_WME_ENABLED_STAMAX 1 -#define WNI_CFG_WME_ENABLED_STADEF 1 - -#define WNI_CFG_WME_ENABLED_APMIN 0 -#define WNI_CFG_WME_ENABLED_APMAX 1 -#define WNI_CFG_WME_ENABLED_APDEF 1 - -#define WNI_CFG_ADDTS_RSP_TIMEOUT_STAMIN 0 -#define WNI_CFG_ADDTS_RSP_TIMEOUT_STAMAX 65535 -#define WNI_CFG_ADDTS_RSP_TIMEOUT_STADEF 1000 - -#define WNI_CFG_ADDTS_RSP_TIMEOUT_APMIN 0 -#define WNI_CFG_ADDTS_RSP_TIMEOUT_APMAX 65535 -#define WNI_CFG_ADDTS_RSP_TIMEOUT_APDEF 1000 - -#define WNI_CFG_MAX_SP_LENGTH_STAMIN 0 -#define WNI_CFG_MAX_SP_LENGTH_STAMAX 3 -#define WNI_CFG_MAX_SP_LENGTH_STADEF 0 - -#define WNI_CFG_MAX_SP_LENGTH_APMIN 0 -#define WNI_CFG_MAX_SP_LENGTH_APMAX 3 -#define WNI_CFG_MAX_SP_LENGTH_APDEF 0 - -#define WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD_APMIN 0 -#define WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD_APMAX 32 -#define WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD_APDEF 0 - -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STAMIN 0 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STAMAX 1 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STADEF 0 - -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_APMIN 0 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_APMAX 1 -#define WNI_CFG_SEND_SINGLE_SSID_ALWAYS_APDEF 0 - -#define WNI_CFG_WSM_ENABLED_STAMIN 0 -#define WNI_CFG_WSM_ENABLED_STAMAX 1 -#define WNI_CFG_WSM_ENABLED_STADEF 0 - -#define WNI_CFG_WSM_ENABLED_APMIN 0 -#define WNI_CFG_WSM_ENABLED_APMAX 1 -#define WNI_CFG_WSM_ENABLED_APDEF 0 - -#define WNI_CFG_PROP_CAPABILITY_STAMIN 0 -#define WNI_CFG_PROP_CAPABILITY_STAMAX 65535 -#define WNI_CFG_PROP_CAPABILITY_STADEF 57535 - -#define WNI_CFG_PROP_CAPABILITY_APMIN 0 -#define WNI_CFG_PROP_CAPABILITY_APMAX 65535 -#define WNI_CFG_PROP_CAPABILITY_APDEF 49321 - -#define WNI_CFG_PROP_CAPABILITY_HCF 0 -#define WNI_CFG_PROP_CAPABILITY_11EQOS 1 -#define WNI_CFG_PROP_CAPABILITY_WME 2 -#define WNI_CFG_PROP_CAPABILITY_WSM 3 -#define WNI_CFG_PROP_CAPABILITY_EXTRATES 4 -#define WNI_CFG_PROP_CAPABILITY_EXTRATE_STOP 5 -#define WNI_CFG_PROP_CAPABILITY_TITAN 6 -#define WNI_CFG_PROP_CAPABILITY_TAURUS 7 -#define WNI_CFG_PROP_CAPABILITY_EDCAPARAMS 13 -#define WNI_CFG_PROP_CAPABILITY_LOADINFO 14 -#define WNI_CFG_PROP_CAPABILITY_VERSION 15 -#define WNI_CFG_PROP_CAPABILITY_MAXBITOFFSET 15 - -#define WNI_CFG_EDCA_PROFILE_STAMIN 0 -#define WNI_CFG_EDCA_PROFILE_STAMAX 255 -#define WNI_CFG_EDCA_PROFILE_STADEF 1 - -#define WNI_CFG_EDCA_PROFILE_APMIN 0 -#define WNI_CFG_EDCA_PROFILE_APMAX 255 -#define WNI_CFG_EDCA_PROFILE_APDEF 1 - -#define WNI_CFG_EDCA_PROFILE_ANI 0 -#define WNI_CFG_EDCA_PROFILE_WMM 1 -#define WNI_CFG_EDCA_PROFILE_TIT_DEMO 2 -#define WNI_CFG_EDCA_PROFILE_MAX 3 -#define WNI_CFG_EDCA_PROFILE_ACM_IDX 0 -#define WNI_CFG_EDCA_PROFILE_AIFSN_IDX 1 -#define WNI_CFG_EDCA_PROFILE_CWMINA_IDX 2 -#define WNI_CFG_EDCA_PROFILE_CWMAXA_IDX 4 -#define WNI_CFG_EDCA_PROFILE_TXOPA_IDX 6 -#define WNI_CFG_EDCA_PROFILE_CWMINB_IDX 7 -#define WNI_CFG_EDCA_PROFILE_CWMAXB_IDX 9 -#define WNI_CFG_EDCA_PROFILE_TXOPB_IDX 11 -#define WNI_CFG_EDCA_PROFILE_CWMING_IDX 12 -#define WNI_CFG_EDCA_PROFILE_CWMAXG_IDX 14 -#define WNI_CFG_EDCA_PROFILE_TXOPG_IDX 16 - -#define WNI_CFG_RDET_FLAG_STAMIN 0 -#define WNI_CFG_RDET_FLAG_STAMAX 1 -#define WNI_CFG_RDET_FLAG_STADEF 0 - -#define WNI_CFG_RDET_FLAG_APMIN 0 -#define WNI_CFG_RDET_FLAG_APMAX 1 -#define WNI_CFG_RDET_FLAG_APDEF 0 - -#define WNI_CFG_RDET_FLAG_ENABLE 1 -#define WNI_CFG_RDET_FLAG_DISABLE 0 - -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_STAMIN 0 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_STAMAX 255 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_STADEF 0 - -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_APMIN 0 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_APMAX 255 -#define WNI_CFG_LOCAL_POWER_CONSTRAINT_APDEF 0 - -#define WNI_CFG_ADMIT_POLICY_STAMIN 0 -#define WNI_CFG_ADMIT_POLICY_STAMAX 2 -#define WNI_CFG_ADMIT_POLICY_STADEF 0 - -#define WNI_CFG_ADMIT_POLICY_APMIN 0 -#define WNI_CFG_ADMIT_POLICY_APMAX 2 -#define WNI_CFG_ADMIT_POLICY_APDEF 0 - -#define WNI_CFG_ADMIT_POLICY_ADMIT_ALL 0 -#define WNI_CFG_ADMIT_POLICY_REJECT_ALL 1 -#define WNI_CFG_ADMIT_POLICY_BW_FACTOR 2 - -#define WNI_CFG_ADMIT_BWFACTOR_STAMIN 0 -#define WNI_CFG_ADMIT_BWFACTOR_STAMAX 100 -#define WNI_CFG_ADMIT_BWFACTOR_STADEF 20 - -#define WNI_CFG_ADMIT_BWFACTOR_APMIN 0 -#define WNI_CFG_ADMIT_BWFACTOR_APMAX 100 -#define WNI_CFG_ADMIT_BWFACTOR_APDEF 20 - -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STAMIN 0 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STAMAX 256 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STADEF 60 - -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_APMIN 0 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_APMAX 256 -#define WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_APDEF 60 - -#define WNI_CFG_CHANNEL_BONDING_MODE_STAMIN 0 -#define WNI_CFG_CHANNEL_BONDING_MODE_STAMAX 10 -#define WNI_CFG_CHANNEL_BONDING_MODE_STADEF 0 - -#define WNI_CFG_CHANNEL_BONDING_MODE_APMIN 0 -#define WNI_CFG_CHANNEL_BONDING_MODE_APMAX 10 -#define WNI_CFG_CHANNEL_BONDING_MODE_APDEF 0 - -#define WNI_CFG_CHANNEL_BONDING_MODE_DISABLE 0 -#define WNI_CFG_CHANNEL_BONDING_MODE_ENABLE 1 -#define WNI_CFG_CHANNEL_BONDING_MODE_IF_NO_LEGACY_BSS 2 -#define WNI_CFG_CHANNEL_BONDING_MODE_IF_NO_LEGACY_ALL 3 -#define WNI_CFG_CHANNEL_BONDING_MODE_INTELLIGENT 4 - -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STAMIN 0 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STAMAX 10 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STADEF 0 - -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_APMIN 0 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_APMAX 10 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_APDEF 0 - -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_NONE 0 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_LOWER 1 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_HIGHER 2 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_LOW_40MHZ_CENTERED 3 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_CENTERED_40MHZ_CENTERED 4 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_HIGH_40MHZ_CENTERED 5 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_LOW_40MHZ_LOW 6 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_HIGH_40MHZ_LOW 7 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_LOW_40MHZ_HIGH 8 -#define WNI_CFG_CB_SECONDARY_CHANNEL_STATE_11AC_20MHZ_HIGH_40MHZ_HIGH 9 - -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STAMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STAMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STADEF 2 - -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_APMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_APMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_ZERO_APDEF 2 - -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_STAMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_STAMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_STADEF 4 - -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_APMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_APMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_ONE_APDEF 4 - -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_STAMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_STAMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_STADEF 6 - -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_APMIN 0 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_APMAX 255 -#define WNI_CFG_DYNAMIC_THRESHOLD_TWO_APDEF 6 - -#define WNI_CFG_TRIG_STA_BK_SCAN_STAMIN 0 -#define WNI_CFG_TRIG_STA_BK_SCAN_STAMAX 1 -#define WNI_CFG_TRIG_STA_BK_SCAN_STADEF 0 - -#define WNI_CFG_TRIG_STA_BK_SCAN_APMIN 0 -#define WNI_CFG_TRIG_STA_BK_SCAN_APMAX 1 -#define WNI_CFG_TRIG_STA_BK_SCAN_APDEF 1 - -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STAMIN 0 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STAMAX 255 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STADEF 255 - -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_APMIN 0 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_APMAX 255 -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_APDEF 1 - -#define WNI_CFG_DYNAMIC_PROFILE_SWITCHING_UNUSED 255 - -#define WNI_CFG_MIMO_ENABLED_STAMIN 0 -#define WNI_CFG_MIMO_ENABLED_STAMAX 1 -#define WNI_CFG_MIMO_ENABLED_STADEF 1 - -#define WNI_CFG_MIMO_ENABLED_APMIN 0 -#define WNI_CFG_MIMO_ENABLED_APMAX 1 -#define WNI_CFG_MIMO_ENABLED_APDEF 1 - -#define WNI_CFG_MIMO_ENABLED_ENABLE 1 -#define WNI_CFG_MIMO_ENABLED_DISABLE 0 - -#define WNI_CFG_BLOCK_ACK_ENABLED_STAMIN 0 -#define WNI_CFG_BLOCK_ACK_ENABLED_STAMAX 3 -#define WNI_CFG_BLOCK_ACK_ENABLED_STADEF 2 - -#define WNI_CFG_BLOCK_ACK_ENABLED_APMIN 0 -#define WNI_CFG_BLOCK_ACK_ENABLED_APMAX 3 -#define WNI_CFG_BLOCK_ACK_ENABLED_APDEF 2 - -#define WNI_CFG_BLOCK_ACK_ENABLED_DELAYED 0 -#define WNI_CFG_BLOCK_ACK_ENABLED_IMMEDIATE 1 - -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STAMIN 0 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STAMAX 65535 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STADEF 1000 - -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_APMIN 0 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_APMAX 65535 -#define WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_APDEF 1000 - -#define WNI_CFG_HT_RX_STBC_STAMIN 0 -#define WNI_CFG_HT_RX_STBC_STAMAX 3 -#define WNI_CFG_HT_RX_STBC_STADEF 1 - -#define WNI_CFG_HT_RX_STBC_APMIN 0 -#define WNI_CFG_HT_RX_STBC_APMAX 3 -#define WNI_CFG_HT_RX_STBC_APDEF 1 - -#define WNI_CFG_HT_CAP_INFO_STAMIN 0 -#define WNI_CFG_HT_CAP_INFO_STAMAX 65535 -#define WNI_CFG_HT_CAP_INFO_STADEF 364 - -#define WNI_CFG_HT_CAP_INFO_APMIN 0 -#define WNI_CFG_HT_CAP_INFO_APMAX 65535 -#define WNI_CFG_HT_CAP_INFO_APDEF 4206 - -#define WNI_CFG_HT_CAP_INFO_ADVANCE_CODING 0 -#define WNI_CFG_HT_CAP_INFO_SUPPORTED_CHAN_WIDTH_SET 1 -#define WNI_CFG_HT_CAP_INFO_SM_POWER_SAVE 2 -#define WNI_CFG_HT_CAP_INFO_GREEN_FIELD 4 -#define WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ 5 -#define WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ 6 -#define WNI_CFG_HT_CAP_INFO_TX_STBC 7 -#define WNI_CFG_HT_CAP_INFO_RX_STBC 8 -#define WNI_CFG_HT_CAP_INFO_DELAYED_BA 10 -#define WNI_CFG_HT_CAP_INFO_MAX_AMSDU_SIZE 11 -#define WNI_CFG_HT_CAP_INFO_DSSS_CCK_MODE_40MHZ 12 -#define WNI_CFG_HT_CAP_INFO_PSMP 13 -#define WNI_CFG_HT_CAP_INFO_STBC_CONTROL_FRAME 14 -#define WNI_CFG_HT_CAP_INFO_LSIG_TXOP_PROTECTION 15 - -#define WNI_CFG_HT_AMPDU_PARAMS_STAMIN 0 -#define WNI_CFG_HT_AMPDU_PARAMS_STAMAX 255 -#define WNI_CFG_HT_AMPDU_PARAMS_STADEF 0 - -#define WNI_CFG_HT_AMPDU_PARAMS_APMIN 0 -#define WNI_CFG_HT_AMPDU_PARAMS_APMAX 255 -#define WNI_CFG_HT_AMPDU_PARAMS_APDEF 2 - -#define WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR 0 -#define WNI_CFG_HT_AMPDU_PARAMS_MPDU_DENSITY 2 -#define WNI_CFG_HT_AMPDU_PARAMS_RESERVED 5 - -#define WNI_CFG_EXT_HT_CAP_INFO_STAMIN 0 -#define WNI_CFG_EXT_HT_CAP_INFO_STAMAX 65535 -#define WNI_CFG_EXT_HT_CAP_INFO_STADEF 1024 - -#define WNI_CFG_EXT_HT_CAP_INFO_APMIN 0 -#define WNI_CFG_EXT_HT_CAP_INFO_APMAX 65535 -#define WNI_CFG_EXT_HT_CAP_INFO_APDEF 1024 - -#define WNI_CFG_EXT_HT_CAP_INFO_PCO 0 -#define WNI_CFG_EXT_HT_CAP_INFO_TRANSITION_TIME 1 -#define WNI_CFG_EXT_HT_CAP_INFO_RESERVED1 3 -#define WNI_CFG_EXT_HT_CAP_INFO_MCS_FEEDBACK 8 -#define WNI_CFG_EXT_HT_CAP_INFO_HTC_SUPPORT 10 -#define WNI_CFG_EXT_HT_CAP_INFO_RD_RESPONDER 11 -#define WNI_CFG_EXT_HT_CAP_INFO_RESERVED2 12 - -#define WNI_CFG_TX_BF_CAP_STAMIN 0 -#define WNI_CFG_TX_BF_CAP_STAMAX 4294967295 -#define WNI_CFG_TX_BF_CAP_STADEF 0 - -#define WNI_CFG_TX_BF_CAP_APMIN 0 -#define WNI_CFG_TX_BF_CAP_APMAX 4294967295 -#define WNI_CFG_TX_BF_CAP_APDEF 0 - -#define WNI_CFG_AS_CAP_STAMIN 0 -#define WNI_CFG_AS_CAP_STAMAX 255 -#define WNI_CFG_AS_CAP_STADEF 0 - -#define WNI_CFG_AS_CAP_APMIN 0 -#define WNI_CFG_AS_CAP_APMAX 255 -#define WNI_CFG_AS_CAP_APDEF 0 - -#define WNI_CFG_AS_CAP_ANTENNA_SELECTION 0 -#define WNI_CFG_AS_CAP_EXPLICIT_CSI_FEEDBACK_TX 1 -#define WNI_CFG_AS_CAP_ANTENNA_INDICES_FEEDBACK_TX 2 -#define WNI_CFG_AS_CAP_EXPLICIT_CSI_FEEDBACK 3 -#define WNI_CFG_AS_CAP_ANTENNA_INDICES_FEEDBACK 4 -#define WNI_CFG_AS_CAP_RX_AS 5 -#define WNI_CFG_AS_CAP_TX_SOUNDING_PPDUS 6 -#define WNI_CFG_AS_CAP_RESERVED 7 - -#define WNI_CFG_HT_INFO_FIELD1_STAMIN 0 -#define WNI_CFG_HT_INFO_FIELD1_STAMAX 255 -#define WNI_CFG_HT_INFO_FIELD1_STADEF 15 - -#define WNI_CFG_HT_INFO_FIELD1_APMIN 0 -#define WNI_CFG_HT_INFO_FIELD1_APMAX 255 -#define WNI_CFG_HT_INFO_FIELD1_APDEF 15 - -#define WNI_CFG_HT_INFO_FIELD1_SECONDARY_CHANNEL_OFFSET 0 -#define WNI_CFG_HT_INFO_FIELD1_RECOMMENDED_CHANNEL_WIDTH 2 -#define WNI_CFG_HT_INFO_FIELD1_RIFS_MODE 3 -#define WNI_CFG_HT_INFO_FIELD1_PSMP_ACCESS_ONLY 4 -#define WNI_CFG_HT_INFO_FIELD1_SERVICE_INTERVAL_GRANULARITY 5 - -#define WNI_CFG_HT_INFO_FIELD2_STAMIN 0 -#define WNI_CFG_HT_INFO_FIELD2_STAMAX 65535 -#define WNI_CFG_HT_INFO_FIELD2_STADEF 0 - -#define WNI_CFG_HT_INFO_FIELD2_APMIN 0 -#define WNI_CFG_HT_INFO_FIELD2_APMAX 65535 -#define WNI_CFG_HT_INFO_FIELD2_APDEF 0 - -#define WNI_CFG_HT_INFO_FIELD2_OP_MODE 0 -#define WNI_CFG_HT_INFO_FIELD2_NON_GF_DEVICES_PRESENT 2 -#define WNI_CFG_HT_INFO_FIELD2_RESERVED 3 - -#define WNI_CFG_HT_INFO_FIELD3_STAMIN 0 -#define WNI_CFG_HT_INFO_FIELD3_STAMAX 65535 -#define WNI_CFG_HT_INFO_FIELD3_STADEF 0 - -#define WNI_CFG_HT_INFO_FIELD3_APMIN 0 -#define WNI_CFG_HT_INFO_FIELD3_APMAX 65535 -#define WNI_CFG_HT_INFO_FIELD3_APDEF 0 - -#define WNI_CFG_HT_INFO_FIELD3_BASIC_STBC_MCS 0 -#define WNI_CFG_HT_INFO_FIELD3_DUAL_STBC_PROTECTION 7 -#define WNI_CFG_HT_INFO_FIELD3_SECONDARY_BEACON 8 -#define WNI_CFG_HT_INFO_FIELD3_LSIG_TXOP_PROTECTION_FULL_SUPPORT 9 -#define WNI_CFG_HT_INFO_FIELD3_PCO_ACTIVE 10 -#define WNI_CFG_HT_INFO_FIELD3_PCO_PHASE 11 -#define WNI_CFG_HT_INFO_FIELD3_RESERVED 12 - -#define WNI_CFG_GREENFIELD_CAPABILITY_STAMIN 0 -#define WNI_CFG_GREENFIELD_CAPABILITY_STAMAX 1 -#define WNI_CFG_GREENFIELD_CAPABILITY_STADEF 0 - -#define WNI_CFG_GREENFIELD_CAPABILITY_APMIN 0 -#define WNI_CFG_GREENFIELD_CAPABILITY_APMAX 1 -#define WNI_CFG_GREENFIELD_CAPABILITY_APDEF 0 - -#define WNI_CFG_GREENFIELD_CAPABILITY_ENABLE 1 -#define WNI_CFG_GREENFIELD_CAPABILITY_DISABLE 0 - -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_STAMIN 0 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_STAMAX 2 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_STADEF 0 - -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_APMIN 0 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_APMAX 2 -#define WNI_CFG_VHT_MAX_MPDU_LENGTH_APDEF 0 - -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMIN 0 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMAX 0 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STADEF 0 - -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_APMIN 0 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_APMAX 0 -#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_APDEF 0 - -#define WNI_CFG_VHT_LDPC_CODING_CAP_STAMIN 0 -#define WNI_CFG_VHT_LDPC_CODING_CAP_STAMAX 1 -#define WNI_CFG_VHT_LDPC_CODING_CAP_STADEF 0 - -#define WNI_CFG_VHT_LDPC_CODING_CAP_APMIN 0 -#define WNI_CFG_VHT_LDPC_CODING_CAP_APMAX 1 -#define WNI_CFG_VHT_LDPC_CODING_CAP_APDEF 0 - -#define WNI_CFG_VHT_SHORT_GI_80MHZ_STAMIN 0 -#define WNI_CFG_VHT_SHORT_GI_80MHZ_STAMAX 1 -#define WNI_CFG_VHT_SHORT_GI_80MHZ_STADEF 1 - -#define WNI_CFG_VHT_SHORT_GI_80MHZ_APMIN 0 -#define WNI_CFG_VHT_SHORT_GI_80MHZ_APMAX 1 -#define WNI_CFG_VHT_SHORT_GI_80MHZ_APDEF 1 - -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMIN 0 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMAX 1 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STADEF 0 - -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_APMIN 0 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_APMAX 1 -#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_APDEF 0 - -#define WNI_CFG_VHT_TXSTBC_STAMIN 0 -#define WNI_CFG_VHT_TXSTBC_STAMAX 1 -#define WNI_CFG_VHT_TXSTBC_STADEF 0 - -#define WNI_CFG_VHT_TXSTBC_APMIN 0 -#define WNI_CFG_VHT_TXSTBC_APMAX 1 -#define WNI_CFG_VHT_TXSTBC_APDEF 0 - -#define WNI_CFG_VHT_RXSTBC_STAMIN 0 -#define WNI_CFG_VHT_RXSTBC_STAMAX 1 -#define WNI_CFG_VHT_RXSTBC_STADEF 1 - -#define WNI_CFG_VHT_RXSTBC_APMIN 0 -#define WNI_CFG_VHT_RXSTBC_APMAX 1 -#define WNI_CFG_VHT_RXSTBC_APDEF 1 - -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_STAMIN 0 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_STAMAX 1 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_STADEF 0 - -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_APMIN 0 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_APMAX 1 -#define WNI_CFG_VHT_SU_BEAMFORMER_CAP_APDEF 0 - -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMIN 0 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMAX 1 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STADEF 0 - -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_APMIN 0 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_APMAX 1 -#define WNI_CFG_VHT_SU_BEAMFORMEE_CAP_APDEF 0 - -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN 0 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX 4 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STADEF 0 - -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_APMIN 0 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_APMAX 4 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_APDEF 0 - -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STAMIN 0 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STAMAX 3 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STADEF 0 - -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_APMIN 0 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_APMAX 3 -#define WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_APDEF 0 - -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_STAMIN 0 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_STAMAX 1 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_STADEF 0 - -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_APMIN 0 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_APMAX 1 -#define WNI_CFG_VHT_MU_BEAMFORMER_CAP_APDEF 0 - -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STAMIN 0 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STAMAX 1 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STADEF 0 - -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_APMIN 0 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_APMAX 1 -#define WNI_CFG_VHT_MU_BEAMFORMEE_CAP_APDEF 0 - -#define WNI_CFG_VHT_TXOP_PS_STAMIN 0 -#define WNI_CFG_VHT_TXOP_PS_STAMAX 1 -#define WNI_CFG_VHT_TXOP_PS_STADEF 0 - -#define WNI_CFG_VHT_TXOP_PS_APMIN 0 -#define WNI_CFG_VHT_TXOP_PS_APMAX 1 -#define WNI_CFG_VHT_TXOP_PS_APDEF 0 - -#define WNI_CFG_VHT_HTC_VHTC_CAP_STAMIN 0 -#define WNI_CFG_VHT_HTC_VHTC_CAP_STAMAX 1 -#define WNI_CFG_VHT_HTC_VHTC_CAP_STADEF 0 - -#define WNI_CFG_VHT_HTC_VHTC_CAP_APMIN 0 -#define WNI_CFG_VHT_HTC_VHTC_CAP_APMAX 1 -#define WNI_CFG_VHT_HTC_VHTC_CAP_APDEF 0 - -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STAMIN 0 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STAMAX 7 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STADEF 3 - -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_APMIN 0 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_APMAX 7 -#define WNI_CFG_VHT_AMPDU_LEN_EXPONENT_APDEF 3 - -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_STAMIN 0 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_STAMAX 3 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_STADEF 0 - -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_APMIN 0 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_APMAX 3 -#define WNI_CFG_VHT_LINK_ADAPTATION_CAP_APDEF 0 - -#define WNI_CFG_VHT_RX_ANT_PATTERN_STAMIN 0 -#define WNI_CFG_VHT_RX_ANT_PATTERN_STAMAX 1 -#define WNI_CFG_VHT_RX_ANT_PATTERN_STADEF 1 - -#define WNI_CFG_VHT_RX_ANT_PATTERN_APMIN 0 -#define WNI_CFG_VHT_RX_ANT_PATTERN_APMAX 1 -#define WNI_CFG_VHT_RX_ANT_PATTERN_APDEF 1 - -#define WNI_CFG_VHT_TX_ANT_PATTERN_STAMIN 0 -#define WNI_CFG_VHT_TX_ANT_PATTERN_STAMAX 1 -#define WNI_CFG_VHT_TX_ANT_PATTERN_STADEF 1 - -#define WNI_CFG_VHT_TX_ANT_PATTERN_APMIN 0 -#define WNI_CFG_VHT_TX_ANT_PATTERN_APMAX 1 -#define WNI_CFG_VHT_TX_ANT_PATTERN_APDEF 1 - -#define WNI_CFG_VHT_RX_MCS_MAP_STAMIN 0 -#define WNI_CFG_VHT_RX_MCS_MAP_STAMAX 65535 -#define WNI_CFG_VHT_RX_MCS_MAP_STADEF 65534 - -#define WNI_CFG_VHT_RX_MCS_MAP_APMIN 0 -#define WNI_CFG_VHT_RX_MCS_MAP_APMAX 65535 -#define WNI_CFG_VHT_RX_MCS_MAP_APDEF 65534 - -#define WNI_CFG_VHT_TX_MCS_MAP_STAMIN 0 -#define WNI_CFG_VHT_TX_MCS_MAP_STAMAX 65535 -#define WNI_CFG_VHT_TX_MCS_MAP_STADEF 65534 - -#define WNI_CFG_VHT_TX_MCS_MAP_APMIN 0 -#define WNI_CFG_VHT_TX_MCS_MAP_APMAX 65535 -#define WNI_CFG_VHT_TX_MCS_MAP_APDEF 65534 - -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STAMIN 0 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STAMAX 390 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STADEF 0 - -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_APMIN 0 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_APMAX 390 -#define WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_APDEF 0 - -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STAMIN 0 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STAMAX 390 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STADEF 0 - -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_APMIN 0 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_APMAX 390 -#define WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_APDEF 0 - -#define WNI_CFG_VHT_CHANNEL_WIDTH_STAMIN 0 -#define WNI_CFG_VHT_CHANNEL_WIDTH_STAMAX 3 -#define WNI_CFG_VHT_CHANNEL_WIDTH_STADEF 0 - -#define WNI_CFG_VHT_CHANNEL_WIDTH_APMIN 0 -#define WNI_CFG_VHT_CHANNEL_WIDTH_APMAX 3 -#define WNI_CFG_VHT_CHANNEL_WIDTH_APDEF 0 - -#define WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ 0 -#define WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ 1 -#define WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ 2 -#define WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ 3 - -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STAMIN 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STAMAX 256 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STADEF 0 - -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_APMIN 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_APMAX 256 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_APDEF 0 - -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STAMIN 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STAMAX 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STADEF 0 - -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_APMIN 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_APMAX 0 -#define WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_APDEF 0 - -#define WNI_CFG_VHT_BASIC_MCS_SET_STAMIN 0 -#define WNI_CFG_VHT_BASIC_MCS_SET_STAMAX 65535 -#define WNI_CFG_VHT_BASIC_MCS_SET_STADEF 65534 - -#define WNI_CFG_VHT_BASIC_MCS_SET_APMIN 0 -#define WNI_CFG_VHT_BASIC_MCS_SET_APMAX 65535 -#define WNI_CFG_VHT_BASIC_MCS_SET_APDEF 65534 - -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STAMIN 0 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STAMAX 4 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STADEF 0 - -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_APMIN 0 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_APMAX 4 -#define WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_APDEF 0 - -#define WNI_CFG_VHT_SS_UNDER_UTIL_STAMIN 0 -#define WNI_CFG_VHT_SS_UNDER_UTIL_STAMAX 0 -#define WNI_CFG_VHT_SS_UNDER_UTIL_STADEF 0 - -#define WNI_CFG_VHT_SS_UNDER_UTIL_APMIN 0 -#define WNI_CFG_VHT_SS_UNDER_UTIL_APMAX 0 -#define WNI_CFG_VHT_SS_UNDER_UTIL_APDEF 0 - -#define WNI_CFG_VHT_40MHZ_UTILIZATION_STAMIN 0 -#define WNI_CFG_VHT_40MHZ_UTILIZATION_STAMAX 0 -#define WNI_CFG_VHT_40MHZ_UTILIZATION_STADEF 0 - -#define WNI_CFG_VHT_40MHZ_UTILIZATION_APMIN 0 -#define WNI_CFG_VHT_40MHZ_UTILIZATION_APMAX 0 -#define WNI_CFG_VHT_40MHZ_UTILIZATION_APDEF 0 - -#define WNI_CFG_VHT_80MHZ_UTILIZATION_STAMIN 0 -#define WNI_CFG_VHT_80MHZ_UTILIZATION_STAMAX 0 -#define WNI_CFG_VHT_80MHZ_UTILIZATION_STADEF 0 - -#define WNI_CFG_VHT_80MHZ_UTILIZATION_APMIN 0 -#define WNI_CFG_VHT_80MHZ_UTILIZATION_APMAX 0 -#define WNI_CFG_VHT_80MHZ_UTILIZATION_APDEF 0 - -#define WNI_CFG_VHT_160MHZ_UTILIZATION_STAMIN 0 -#define WNI_CFG_VHT_160MHZ_UTILIZATION_STAMAX 0 -#define WNI_CFG_VHT_160MHZ_UTILIZATION_STADEF 0 - -#define WNI_CFG_VHT_160MHZ_UTILIZATION_APMIN 0 -#define WNI_CFG_VHT_160MHZ_UTILIZATION_APMAX 0 -#define WNI_CFG_VHT_160MHZ_UTILIZATION_APDEF 0 - -#define WNI_CFG_MAX_AMSDU_LENGTH_STAMIN 0 -#define WNI_CFG_MAX_AMSDU_LENGTH_STAMAX 1 -#define WNI_CFG_MAX_AMSDU_LENGTH_STADEF 0 - -#define WNI_CFG_MAX_AMSDU_LENGTH_APMIN 0 -#define WNI_CFG_MAX_AMSDU_LENGTH_APMAX 1 -#define WNI_CFG_MAX_AMSDU_LENGTH_APDEF 0 - -#define WNI_CFG_MAX_AMSDU_LENGTH_SHORT_3839_BYTES 0 -#define WNI_CFG_MAX_AMSDU_LENGTH_LONG_7935__BYTES 1 - -#define WNI_CFG_MPDU_DENSITY_STAMIN 0 -#define WNI_CFG_MPDU_DENSITY_STAMAX 7 -#define WNI_CFG_MPDU_DENSITY_STADEF 0 - -#define WNI_CFG_MPDU_DENSITY_APMIN 0 -#define WNI_CFG_MPDU_DENSITY_APMAX 7 -#define WNI_CFG_MPDU_DENSITY_APDEF 0 - -#define WNI_CFG_NUM_BUFF_ADVERT_STAMIN 0 -#define WNI_CFG_NUM_BUFF_ADVERT_STAMAX 128 -#define WNI_CFG_NUM_BUFF_ADVERT_STADEF 64 - -#define WNI_CFG_NUM_BUFF_ADVERT_APMIN 0 -#define WNI_CFG_NUM_BUFF_ADVERT_APMAX 128 -#define WNI_CFG_NUM_BUFF_ADVERT_APDEF 64 - -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN 0 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX 3 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_STADEF 3 - -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_APMIN 0 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_APMAX 3 -#define WNI_CFG_MAX_RX_AMPDU_FACTOR_APDEF 3 - -#define WNI_CFG_SHORT_GI_20MHZ_STAMIN 0 -#define WNI_CFG_SHORT_GI_20MHZ_STAMAX 1 -#define WNI_CFG_SHORT_GI_20MHZ_STADEF 1 - -#define WNI_CFG_SHORT_GI_20MHZ_APMIN 0 -#define WNI_CFG_SHORT_GI_20MHZ_APMAX 1 -#define WNI_CFG_SHORT_GI_20MHZ_APDEF 1 - -#define WNI_CFG_SHORT_GI_20MHZ_ENABLE 1 -#define WNI_CFG_SHORT_GI_20MHZ_DISABLE 0 - -#define WNI_CFG_SHORT_GI_40MHZ_STAMIN 0 -#define WNI_CFG_SHORT_GI_40MHZ_STAMAX 1 -#define WNI_CFG_SHORT_GI_40MHZ_STADEF 0 - -#define WNI_CFG_SHORT_GI_40MHZ_APMIN 0 -#define WNI_CFG_SHORT_GI_40MHZ_APMAX 1 -#define WNI_CFG_SHORT_GI_40MHZ_APDEF 1 - -#define WNI_CFG_SHORT_GI_40MHZ_ENABLE 1 -#define WNI_CFG_SHORT_GI_40MHZ_DISABLE 0 - -#define WNI_CFG_RIFS_ENABLED_STAMIN 0 -#define WNI_CFG_RIFS_ENABLED_STAMAX 1 -#define WNI_CFG_RIFS_ENABLED_STADEF 1 - -#define WNI_CFG_RIFS_ENABLED_APMIN 0 -#define WNI_CFG_RIFS_ENABLED_APMAX 1 -#define WNI_CFG_RIFS_ENABLED_APDEF 1 - -#define WNI_CFG_RIFS_ENABLED_ENABLE 1 -#define WNI_CFG_RIFS_ENABLED_DISABLE 0 - -#define WNI_CFG_MAX_PS_POLL_STAMIN 0 -#define WNI_CFG_MAX_PS_POLL_STAMAX 255 -#define WNI_CFG_MAX_PS_POLL_STADEF 0 - -#define WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STAMIN 1 -#define WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STAMAX 20 -#define WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STADEF 20 - -#define WNI_CFG_RSSI_FILTER_PERIOD_STAMIN 0 -#define WNI_CFG_RSSI_FILTER_PERIOD_STAMAX 255 -#define WNI_CFG_RSSI_FILTER_PERIOD_STADEF 5 - -#define WNI_CFG_MIN_RSSI_THRESHOLD_STAMIN 0 -#define WNI_CFG_MIN_RSSI_THRESHOLD_STAMAX 10 -#define WNI_CFG_MIN_RSSI_THRESHOLD_STADEF 10 - -#define WNI_CFG_NTH_BEACON_FILTER_STAMIN 0 -#define WNI_CFG_NTH_BEACON_FILTER_STAMAX 255 -#define WNI_CFG_NTH_BEACON_FILTER_STADEF 10 - -#define WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STAMIN 0 -#define WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STAMAX 1 -#define WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STADEF 0 - -#define WNI_CFG_SCAN_IN_POWERSAVE_STAMIN 0 -#define WNI_CFG_SCAN_IN_POWERSAVE_STAMAX 1 -#define WNI_CFG_SCAN_IN_POWERSAVE_STADEF 1 - -#define WNI_CFG_SCAN_IN_POWERSAVE_APMIN 0 -#define WNI_CFG_SCAN_IN_POWERSAVE_APMAX 1 -#define WNI_CFG_SCAN_IN_POWERSAVE_APDEF 1 - -#define WNI_CFG_IGNORE_DTIM_STAMIN 0 -#define WNI_CFG_IGNORE_DTIM_STAMAX 1 -#define WNI_CFG_IGNORE_DTIM_STADEF 0 - -#define WNI_CFG_IGNORE_DTIM_APMIN 0 -#define WNI_CFG_IGNORE_DTIM_APMAX 1 -#define WNI_CFG_IGNORE_DTIM_APDEF 0 - -#define WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STAMIN 0 -#define WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STAMAX 1 -#define WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STADEF 1 - -#define WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STAMIN 0 -#define WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STAMAX 1 -#define WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STADEF 1 - -#define WNI_CFG_WOWLAN_DEAUTH_ENABLE_STAMIN 0 -#define WNI_CFG_WOWLAN_DEAUTH_ENABLE_STAMAX 1 -#define WNI_CFG_WOWLAN_DEAUTH_ENABLE_STADEF 1 - -#define WNI_CFG_WOWLAN_DISASSOC_ENABLE_STAMIN 0 -#define WNI_CFG_WOWLAN_DISASSOC_ENABLE_STAMAX 1 -#define WNI_CFG_WOWLAN_DISASSOC_ENABLE_STADEF 1 - -#define WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STAMIN 0 -#define WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STAMAX 65535 -#define WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STADEF 40 - -#define WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STAMIN 0 -#define WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STAMAX 65535 -#define WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STADEF 65535 - -#define WNI_CFG_BA_TIMEOUT_STAMIN 0 -#define WNI_CFG_BA_TIMEOUT_STAMAX 65535 -#define WNI_CFG_BA_TIMEOUT_STADEF 0 - -#define WNI_CFG_BA_TIMEOUT_APMIN 0 -#define WNI_CFG_BA_TIMEOUT_APMAX 65535 -#define WNI_CFG_BA_TIMEOUT_APDEF 0 - -#define WNI_CFG_BA_THRESHOLD_HIGH_STAMIN 0 -#define WNI_CFG_BA_THRESHOLD_HIGH_STAMAX 65535 -#define WNI_CFG_BA_THRESHOLD_HIGH_STADEF 128 - -#define WNI_CFG_BA_THRESHOLD_HIGH_APMIN 0 -#define WNI_CFG_BA_THRESHOLD_HIGH_APMAX 65535 -#define WNI_CFG_BA_THRESHOLD_HIGH_APDEF 128 - -#define WNI_CFG_MAX_BA_BUFFERS_STAMIN 0 -#define WNI_CFG_MAX_BA_BUFFERS_STAMAX 2560 -#define WNI_CFG_MAX_BA_BUFFERS_STADEF 2560 - -#define WNI_CFG_MAX_BA_BUFFERS_APMIN 0 -#define WNI_CFG_MAX_BA_BUFFERS_APMAX 2560 -#define WNI_CFG_MAX_BA_BUFFERS_APDEF 2560 - -#define WNI_CFG_MAX_BA_SESSIONS_STAMIN 0 -#define WNI_CFG_MAX_BA_SESSIONS_STAMAX 64 -#define WNI_CFG_MAX_BA_SESSIONS_STADEF 40 - -#define WNI_CFG_MAX_BA_SESSIONS_APMIN 0 -#define WNI_CFG_MAX_BA_SESSIONS_APMAX 64 -#define WNI_CFG_MAX_BA_SESSIONS_APDEF 40 - -#define WNI_CFG_BA_AUTO_SETUP_STAMIN 0 -#define WNI_CFG_BA_AUTO_SETUP_STAMAX 1 -#define WNI_CFG_BA_AUTO_SETUP_STADEF 1 - -#define WNI_CFG_BA_AUTO_SETUP_APMIN 0 -#define WNI_CFG_BA_AUTO_SETUP_APMAX 1 -#define WNI_CFG_BA_AUTO_SETUP_APDEF 1 - -#define WNI_CFG_BA_AUTO_SETUP_ENABLE 1 -#define WNI_CFG_BA_AUTO_SETUP_DISABLE 0 - -#define WNI_CFG_ADDBA_REQ_DECLINE_STAMIN 0 -#define WNI_CFG_ADDBA_REQ_DECLINE_STAMAX 255 -#define WNI_CFG_ADDBA_REQ_DECLINE_STADEF 0 - -#define WNI_CFG_ADDBA_REQ_DECLINE_APMIN 0 -#define WNI_CFG_ADDBA_REQ_DECLINE_APMAX 255 -#define WNI_CFG_ADDBA_REQ_DECLINE_APDEF 0 - -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STAMIN 0 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STAMAX 1 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STADEF 0 - -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_APMIN 0 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_APMAX 1 -#define WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_APDEF 0 - -#define WNI_CFG_MAX_MEDIUM_TIME_STAMIN 0 -#define WNI_CFG_MAX_MEDIUM_TIME_STAMAX 65535 -#define WNI_CFG_MAX_MEDIUM_TIME_STADEF 2048 - -#define WNI_CFG_MAX_MEDIUM_TIME_APMIN 0 -#define WNI_CFG_MAX_MEDIUM_TIME_APMAX 65535 -#define WNI_CFG_MAX_MEDIUM_TIME_APDEF 2048 - -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_STAMIN 0 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_STAMAX 65535 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_STADEF 64 - -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_APMIN 0 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_APMAX 65535 -#define WNI_CFG_MAX_MPDUS_IN_AMPDU_APDEF 64 - -#define WNI_CFG_IBSS_AUTO_BSSID_STAMIN 0 -#define WNI_CFG_IBSS_AUTO_BSSID_STAMAX 1 -#define WNI_CFG_IBSS_AUTO_BSSID_STADEF 1 - -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STAMIN 0 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STAMAX 1 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STADEF 0 - -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_APMIN 0 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_APMAX 1 -#define WNI_CFG_PROBE_REQ_ADDNIE_FLAG_APDEF 0 - -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STAMIN 0 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STAMAX 1 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STADEF 0 - -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_APMIN 0 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_APMAX 1 -#define WNI_CFG_PROBE_RSP_ADDNIE_FLAG_APDEF 0 - -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STAMIN 0 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STAMAX 1 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STADEF 0 - -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_APMIN 0 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_APMAX 1 -#define WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_APDEF 0 - -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STAMIN 0 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STAMAX 1 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STADEF 0 - -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_APMIN 0 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_APMAX 1 -#define WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_APDEF 0 - -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STAMIN 0 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STAMAX 1 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STADEF 0 - -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_APMIN 0 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_APMAX 1 -#define WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_APDEF 0 - -#define WNI_CFG_WPS_ENABLE_STAMIN 0 -#define WNI_CFG_WPS_ENABLE_STAMAX 255 -#define WNI_CFG_WPS_ENABLE_STADEF 0 - -#define WNI_CFG_WPS_ENABLE_APMIN 0 -#define WNI_CFG_WPS_ENABLE_APMAX 255 -#define WNI_CFG_WPS_ENABLE_APDEF 0 - -#define WNI_CFG_WPS_ENABLE_AP 1 -#define WNI_CFG_WPS_ENABLE_STA 2 - -#define WNI_CFG_WPS_STATE_STAMIN 0 -#define WNI_CFG_WPS_STATE_STAMAX 255 -#define WNI_CFG_WPS_STATE_STADEF 1 - -#define WNI_CFG_WPS_STATE_APMIN 0 -#define WNI_CFG_WPS_STATE_APMAX 255 -#define WNI_CFG_WPS_STATE_APDEF 1 - -#define WNI_CFG_WPS_PROBE_REQ_FLAG_STAMIN 0 -#define WNI_CFG_WPS_PROBE_REQ_FLAG_STAMAX 1 -#define WNI_CFG_WPS_PROBE_REQ_FLAG_STADEF 0 - -#define WNI_CFG_WPS_PROBE_REQ_FLAG_APMIN 0 -#define WNI_CFG_WPS_PROBE_REQ_FLAG_APMAX 1 -#define WNI_CFG_WPS_PROBE_REQ_FLAG_APDEF 0 - -#define WNI_CFG_WPS_VERSION_STAMIN 0 -#define WNI_CFG_WPS_VERSION_STAMAX 255 -#define WNI_CFG_WPS_VERSION_STADEF 16 - -#define WNI_CFG_WPS_VERSION_APMIN 0 -#define WNI_CFG_WPS_VERSION_APMAX 255 -#define WNI_CFG_WPS_VERSION_APDEF 16 - -#define WNI_CFG_WPS_REQUEST_TYPE_STAMIN 0 -#define WNI_CFG_WPS_REQUEST_TYPE_STAMAX 255 -#define WNI_CFG_WPS_REQUEST_TYPE_STADEF 0 - -#define WNI_CFG_WPS_REQUEST_TYPE_APMIN 0 -#define WNI_CFG_WPS_REQUEST_TYPE_APMAX 255 -#define WNI_CFG_WPS_REQUEST_TYPE_APDEF 3 - -#define WNI_CFG_WPS_CFG_METHOD_STAMIN 0 -#define WNI_CFG_WPS_CFG_METHOD_STAMAX 4294967295 -#define WNI_CFG_WPS_CFG_METHOD_STADEF 8 - -#define WNI_CFG_WPS_CFG_METHOD_APMIN 0 -#define WNI_CFG_WPS_CFG_METHOD_APMAX 4294967295 -#define WNI_CFG_WPS_CFG_METHOD_APDEF 25952654 - -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STAMIN 0 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STAMAX 65535 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STADEF 1 - -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_APMIN 0 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_APMAX 65535 -#define WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_APDEF 6 - -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_STAMIN 0 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_STAMAX 4294967295 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_STADEF 5304836 - -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_APMIN 0 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_APMAX 4294967295 -#define WNI_CFG_WPS_PIMARY_DEVICE_OUI_APDEF 5304836 - -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STAMIN 0 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STAMAX 65535 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STADEF 1 - -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_APMIN 0 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_APMAX 65535 -#define WNI_CFG_WPS_DEVICE_SUB_CATEGORY_APDEF 1 - -#define WNI_CFG_WPS_ASSOCIATION_STATE_STAMIN 0 -#define WNI_CFG_WPS_ASSOCIATION_STATE_STAMAX 65535 -#define WNI_CFG_WPS_ASSOCIATION_STATE_STADEF 0 - -#define WNI_CFG_WPS_ASSOCIATION_STATE_APMIN 0 -#define WNI_CFG_WPS_ASSOCIATION_STATE_APMAX 65535 -#define WNI_CFG_WPS_ASSOCIATION_STATE_APDEF 0 - -#define WNI_CFG_WPS_CONFIGURATION_ERROR_STAMIN 0 -#define WNI_CFG_WPS_CONFIGURATION_ERROR_STAMAX 65535 -#define WNI_CFG_WPS_CONFIGURATION_ERROR_STADEF 0 - -#define WNI_CFG_WPS_CONFIGURATION_ERROR_APMIN 0 -#define WNI_CFG_WPS_CONFIGURATION_ERROR_APMAX 65535 -#define WNI_CFG_WPS_CONFIGURATION_ERROR_APDEF 0 - -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_STAMIN 0 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_STAMAX 4294967295 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_STADEF 0 - -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_APMIN 0 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_APMAX 4294967295 -#define WNI_CFG_WPS_DEVICE_PASSWORD_ID_APDEF 0 - -#define WNI_CFG_WPS_ASSOC_METHOD_STAMIN 0 -#define WNI_CFG_WPS_ASSOC_METHOD_STAMAX 65535 -#define WNI_CFG_WPS_ASSOC_METHOD_STADEF 0 - -#define WNI_CFG_WPS_ASSOC_METHOD_APMIN 0 -#define WNI_CFG_WPS_ASSOC_METHOD_APMAX 65535 -#define WNI_CFG_WPS_ASSOC_METHOD_APDEF 0 - -#define WNI_CFG_LOW_GAIN_OVERRIDE_STAMIN 0 -#define WNI_CFG_LOW_GAIN_OVERRIDE_STAMAX 1 -#define WNI_CFG_LOW_GAIN_OVERRIDE_STADEF 0 - -#define WNI_CFG_LOW_GAIN_OVERRIDE_APMIN 0 -#define WNI_CFG_LOW_GAIN_OVERRIDE_APMAX 1 -#define WNI_CFG_LOW_GAIN_OVERRIDE_APDEF 0 - -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STAMIN 0 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STAMAX 128 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STADEF 128 - -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_APMIN 0 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_APMAX 128 -#define WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_APDEF 128 - -#define WNI_CFG_RPE_POLLING_THRESHOLD_STAMIN 0 -#define WNI_CFG_RPE_POLLING_THRESHOLD_STAMAX 65535 -#define WNI_CFG_RPE_POLLING_THRESHOLD_STADEF 10 - -#define WNI_CFG_RPE_POLLING_THRESHOLD_APMIN 0 -#define WNI_CFG_RPE_POLLING_THRESHOLD_APMAX 65535 -#define WNI_CFG_RPE_POLLING_THRESHOLD_APDEF 10 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STAMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STAMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STADEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_APMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_APMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_APDEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STAMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STAMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STADEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_APMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_APMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_APDEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STAMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STAMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STADEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_APMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_APMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_APDEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STAMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STAMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STADEF 30 - -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_APMIN 0 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_APMAX 65535 -#define WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_APDEF 30 - -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STAMIN 0 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STAMAX 2 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STADEF 1 - -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_APMIN 0 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_APMAX 2 -#define WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_APDEF 1 - -#define WNI_CFG_SINGLE_TID_RC_STAMIN 0 -#define WNI_CFG_SINGLE_TID_RC_STAMAX 1 -#define WNI_CFG_SINGLE_TID_RC_STADEF 1 - -#define WNI_CFG_SINGLE_TID_RC_APMIN 0 -#define WNI_CFG_SINGLE_TID_RC_APMAX 1 -#define WNI_CFG_SINGLE_TID_RC_APDEF 1 - -#define WNI_CFG_RRM_ENABLED_STAMIN 0 -#define WNI_CFG_RRM_ENABLED_STAMAX 1 -#define WNI_CFG_RRM_ENABLED_STADEF 0 - -#define WNI_CFG_RRM_ENABLED_APMIN 0 -#define WNI_CFG_RRM_ENABLED_APMAX 1 -#define WNI_CFG_RRM_ENABLED_APDEF 0 - -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_STAMIN 0 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_STAMAX 8 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_STADEF 0 - -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_APMIN 0 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_APMAX 8 -#define WNI_CFG_RRM_OPERATING_CHAN_MAX_APDEF 0 - -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STAMIN 0 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STAMAX 8 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STADEF 0 - -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_APMIN 0 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_APMAX 8 -#define WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_APDEF 0 - -#define WNI_CFG_TX_PWR_CTRL_ENABLE_STAMIN 0 -#define WNI_CFG_TX_PWR_CTRL_ENABLE_STAMAX 1 -#define WNI_CFG_TX_PWR_CTRL_ENABLE_STADEF 1 - -#define WNI_CFG_TX_PWR_CTRL_ENABLE_APMIN 0 -#define WNI_CFG_TX_PWR_CTRL_ENABLE_APMAX 1 -#define WNI_CFG_TX_PWR_CTRL_ENABLE_APDEF 1 - -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_STAMIN 0 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_STAMAX 3 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_STADEF 0 - -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_APMIN 0 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_APMAX 3 -#define WNI_CFG_MCAST_BCAST_FILTER_SETTING_APDEF 0 - -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STAMIN 0 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STAMAX 255 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STADEF 0 - -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_APMIN 0 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_APMAX 255 -#define WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_APDEF 0 - -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_STAMIN 0 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_STAMAX 255 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_STADEF 0 - -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_APMIN 0 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_APMAX 255 -#define WNI_CFG_DYNAMIC_PS_POLL_VALUE_APDEF 0 - -#define WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMIN 0 -#define WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMAX 80 -#define WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STADEF 0 - -#define WNI_CFG_TELE_BCN_WAKEUP_EN_STAMIN 0 -#define WNI_CFG_TELE_BCN_WAKEUP_EN_STAMAX 1 -#define WNI_CFG_TELE_BCN_WAKEUP_EN_STADEF 0 - -#define WNI_CFG_TELE_BCN_WAKEUP_EN_APMIN 0 -#define WNI_CFG_TELE_BCN_WAKEUP_EN_APMAX 1 -#define WNI_CFG_TELE_BCN_WAKEUP_EN_APDEF 0 - -#define WNI_CFG_TELE_BCN_TRANS_LI_STAMIN 0 -#define WNI_CFG_TELE_BCN_TRANS_LI_STAMAX 7 -#define WNI_CFG_TELE_BCN_TRANS_LI_STADEF 3 - -#define WNI_CFG_TELE_BCN_TRANS_LI_APMIN 0 -#define WNI_CFG_TELE_BCN_TRANS_LI_APMAX 7 -#define WNI_CFG_TELE_BCN_TRANS_LI_APDEF 3 - -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STAMIN 5 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STAMAX 255 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STADEF 10 - -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_APMIN 5 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_APMAX 255 -#define WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_APDEF 10 - -#define WNI_CFG_TELE_BCN_MAX_LI_STAMIN 0 -#define WNI_CFG_TELE_BCN_MAX_LI_STAMAX 7 -#define WNI_CFG_TELE_BCN_MAX_LI_STADEF 5 - -#define WNI_CFG_TELE_BCN_MAX_LI_APMIN 0 -#define WNI_CFG_TELE_BCN_MAX_LI_APMAX 7 -#define WNI_CFG_TELE_BCN_MAX_LI_APDEF 5 - -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STAMIN 5 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STAMAX 255 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STADEF 15 - -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_APMIN 5 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_APMAX 255 -#define WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_APDEF 15 - -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STAMIN 0 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STAMAX 255 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STADEF 7 - -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_APMIN 0 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_APMAX 255 -#define WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_APDEF 7 - -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMIN 0 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX 65535 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STADEF 0 - -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_APMIN 0 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_APMAX 65535 -#define WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_APDEF 0 - -#define WNI_CFG_ASSOC_STA_LIMIT_STAMIN 1 -#define WNI_CFG_ASSOC_STA_LIMIT_STAMAX 32 -#define WNI_CFG_ASSOC_STA_LIMIT_STADEF 10 - -#define WNI_CFG_ASSOC_STA_LIMIT_APMIN 1 -#define WNI_CFG_ASSOC_STA_LIMIT_APMAX 32 -#define WNI_CFG_ASSOC_STA_LIMIT_APDEF 10 - -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMIN 1 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMAX 252 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STADEF 1 - -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_APMIN 1 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_APMAX 252 -#define WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_APDEF 1 - -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMIN 1 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMAX 252 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STADEF 11 - -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_APMIN 1 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_APMAX 252 -#define WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_APDEF 11 - -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMIN 0 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMAX 5 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STADEF 0 - -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_APMIN 0 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_APMAX 5 -#define WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_APDEF 0 - -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMIN 0 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMAX 65535 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STADEF 5 - -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_APMIN 0 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_APMAX 65535 -#define WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_APDEF 5 - -#define WNI_CFG_ENABLE_CLOSE_LOOP_STAMIN 0 -#define WNI_CFG_ENABLE_CLOSE_LOOP_STAMAX 1 -#define WNI_CFG_ENABLE_CLOSE_LOOP_STADEF 0 - -#define WNI_CFG_ENABLE_CLOSE_LOOP_APMIN 0 -#define WNI_CFG_ENABLE_CLOSE_LOOP_APMAX 1 -#define WNI_CFG_ENABLE_CLOSE_LOOP_APDEF 0 - -#define WNI_CFG_ENABLE_LTE_COEX_STAMIN 0 -#define WNI_CFG_ENABLE_LTE_COEX_STAMAX 1 -#define WNI_CFG_ENABLE_LTE_COEX_STADEF 0 - -#define WNI_CFG_ENABLE_LTE_COEX_APMIN 0 -#define WNI_CFG_ENABLE_LTE_COEX_APMAX 1 -#define WNI_CFG_ENABLE_LTE_COEX_APDEF 0 - -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMIN 1 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMAX 255 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STADEF 20 - -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_APMIN 1 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_APMAX 255 -#define WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_APDEF 20 - -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMIN 1 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMAX 255 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STADEF 20 - -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_APMIN 1 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_APMAX 255 -#define WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_APDEF 20 - -#define WNI_CFG_ENABLE_MC_ADDR_LIST_STAMIN 0 -#define WNI_CFG_ENABLE_MC_ADDR_LIST_STAMAX 1 -#define WNI_CFG_ENABLE_MC_ADDR_LIST_STADEF 0 - -#define WNI_CFG_ENABLE_MC_ADDR_LIST_APMIN 0 -#define WNI_CFG_ENABLE_MC_ADDR_LIST_APMAX 1 -#define WNI_CFG_ENABLE_MC_ADDR_LIST_APDEF 0 - -#define WNI_CFG_ENABLE_UC_FILTER_STAMIN 0 -#define WNI_CFG_ENABLE_UC_FILTER_STAMAX 1 -#define WNI_CFG_ENABLE_UC_FILTER_STADEF 0 - -#define WNI_CFG_ENABLE_UC_FILTER_APMIN 0 -#define WNI_CFG_ENABLE_UC_FILTER_APMAX 1 -#define WNI_CFG_ENABLE_UC_FILTER_APDEF 0 - -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STAMIN 0 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STAMAX 1 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STADEF 0 - -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_APMIN 0 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_APMAX 1 -#define WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_APDEF 0 - -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMIN 0 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMAX 1 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STADEF 0 - -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_APMIN 0 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_APMAX 1 -#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_APDEF 0 - -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STAMIN 0 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STAMAX 1 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STADEF 0 - -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_APMIN 0 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_APMAX 1 -#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_APDEF 0 - -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STAMIN 1 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STAMAX 255 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STADEF 3 - -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_APMIN 1 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_APMAX 255 -#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_APDEF 3 - -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STAMIN 0 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STAMAX 15 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STADEF 0 - -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_APMIN 0 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_APMAX 15 -#define WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_APDEF 0 - -#define WNI_CFG_TDLS_BUF_STA_ENABLED_STAMIN 0 -#define WNI_CFG_TDLS_BUF_STA_ENABLED_STAMAX 1 -#define WNI_CFG_TDLS_BUF_STA_ENABLED_STADEF 0 - -#define WNI_CFG_TDLS_BUF_STA_ENABLED_APMIN 0 -#define WNI_CFG_TDLS_BUF_STA_ENABLED_APMAX 1 -#define WNI_CFG_TDLS_BUF_STA_ENABLED_APDEF 0 - -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_STAMIN 0 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_STAMAX 10 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_STADEF 0 - -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_APMIN 0 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_APMAX 10 -#define WNI_CFG_TDLS_PUAPSD_INACT_TIME_APDEF 0 - -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STAMIN 10 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STAMAX 20 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STADEF 10 - -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_APMIN 10 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_APMAX 20 -#define WNI_CFG_TDLS_RX_FRAME_THRESHOLD_APDEF 10 - -#define WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMIN 0 -#define WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMAX 1 -#define WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STADEF 1 - -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STAMIN 0 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STAMAX 9 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STADEF 0 - -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_APMIN 0 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_APMAX 9 -#define WNI_CFG_FLEX_CONNECT_POWER_FACTOR_APDEF 0 - -#define WNI_CFG_ANTENNA_DIVESITY_STAMIN 0 -#define WNI_CFG_ANTENNA_DIVESITY_STAMAX 3 -#define WNI_CFG_ANTENNA_DIVESITY_STADEF 0 - -#define WNI_CFG_ANTENNA_DIVESITY_APMIN 0 -#define WNI_CFG_ANTENNA_DIVESITY_APMAX 3 -#define WNI_CFG_ANTENNA_DIVESITY_APDEF 0 - -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STAMIN 3 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STAMAX 50 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STADEF 10 - -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_APMIN 3 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_APMAX 50 -#define WNI_CFG_GO_LINK_MONITOR_TIMEOUT_APDEF 10 - -#define WNI_CFG_ATH_DISABLE_STAMIN 0 -#define WNI_CFG_ATH_DISABLE_STAMAX 1 -#define WNI_CFG_ATH_DISABLE_STADEF 0 - -#define WNI_CFG_ATH_DISABLE_APMIN 0 -#define WNI_CFG_ATH_DISABLE_APMAX 1 -#define WNI_CFG_ATH_DISABLE_APDEF 0 - -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_STAMIN 0 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_STAMAX 250000 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_STADEF 60000 - -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_APMIN 0 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_APMAX 250000 -#define WNI_CFG_BTC_ACTIVE_WLAN_LEN_APDEF 60000 - -#define WNI_CFG_BTC_ACTIVE_BT_LEN_STAMIN 0 -#define WNI_CFG_BTC_ACTIVE_BT_LEN_STAMAX 250000 -#define WNI_CFG_BTC_ACTIVE_BT_LEN_STADEF 90000 - -#define WNI_CFG_BTC_ACTIVE_BT_LEN_APMIN 0 -#define WNI_CFG_BTC_ACTIVE_BT_LEN_APMAX 250000 -#define WNI_CFG_BTC_ACTIVE_BT_LEN_APDEF 90000 - -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STAMIN 0 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STAMAX 250000 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STADEF 30000 - -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_APMIN 0 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_APMAX 250000 -#define WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_APDEF 30000 - -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STAMIN 0 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STAMAX 250000 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STADEF 30000 - -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_APMIN 0 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_APMAX 250000 -#define WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_APDEF 30000 - -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STAMIN 0 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STAMAX 4294967295 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STADEF 300 - -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_APMIN 0 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_APMAX 4294967295 -#define WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_APDEF 300 - -#define WNI_CFG_ASD_PROBE_INTERVAL_STAMIN 10 -#define WNI_CFG_ASD_PROBE_INTERVAL_STAMAX 100 -#define WNI_CFG_ASD_PROBE_INTERVAL_STADEF 50 - -#define WNI_CFG_ASD_PROBE_INTERVAL_APMIN 10 -#define WNI_CFG_ASD_PROBE_INTERVAL_APMAX 100 -#define WNI_CFG_ASD_PROBE_INTERVAL_APDEF 50 - -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMIN -120 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMAX 0 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_STADEF -75 - -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_APMIN -120 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_APMAX 0 -#define WNI_CFG_ASD_TRIGGER_THRESHOLD_APDEF -75 - -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMIN 0 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMAX 100 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STADEF 0 - -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_APMIN 0 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_APMAX 100 -#define WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_APDEF 0 - -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMIN 0 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMAX 1 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STADEF 0 - -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_APMIN 0 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_APMAX 1 -#define WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_APDEF 0 - -#define WNI_CFG_BTC_CTS2S_DURING_SCO_STAMIN 0 -#define WNI_CFG_BTC_CTS2S_DURING_SCO_STAMAX 1 -#define WNI_CFG_BTC_CTS2S_DURING_SCO_STADEF 0 - -#define WNI_CFG_BTC_CTS2S_DURING_SCO_APMIN 0 -#define WNI_CFG_BTC_CTS2S_DURING_SCO_APMAX 1 -#define WNI_CFG_BTC_CTS2S_DURING_SCO_APDEF 0 - -#define WNI_CFG_CHANNEL_BONDING_24G_STAMIN 0 -#define WNI_CFG_CHANNEL_BONDING_24G_STAMAX 1 -#define WNI_CFG_CHANNEL_BONDING_24G_STADEF 0 - -#define WNI_CFG_CHANNEL_BONDING_24G_APMIN 0 -#define WNI_CFG_CHANNEL_BONDING_24G_APMAX 1 -#define WNI_CFG_CHANNEL_BONDING_24G_APDEF 0 - -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMIN 5 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMAX 1000 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STADEF 20 - -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_APMIN 5 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_APMAX 1000 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_APDEF 20 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMIN 10 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMAX 1000 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STADEF 10 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_APMIN 10 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_APMAX 1000 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_APDEF 10 - -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMIN 10 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMAX 900 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STADEF 200 - -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_APMIN 10 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_APMAX 900 -#define WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_APDEF 200 - -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMIN 200 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMAX 10000 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STADEF 200 - -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_APMIN 200 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_APMAX 10000 -#define WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_APDEF 200 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMIN 20 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMAX 10000 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STADEF 20 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_APMIN 20 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_APMAX 10000 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_APDEF 20 - -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMIN 5 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMAX 100 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STADEF 5 - -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_APMIN 5 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_APMAX 100 -#define WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_APDEF 5 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMIN 0 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMAX 100 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STADEF 25 - -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_APMIN 0 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_APMAX 100 -#define WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_APDEF 25 - -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STAMIN 0 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STAMAX 1 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STADEF 0 - -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_APMIN 0 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_APMAX 1 -#define WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_APDEF 0 - -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STAMIN 0 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STAMAX 20 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STADEF 5 - -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_APMIN 0 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_APMAX 20 -#define WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_APDEF 5 - -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMIN 10 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMAX 2000 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STADEF 200 - -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APMIN 10 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APMAX 2000 -#define WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APDEF 200 - -#define WNI_CFG_RA_FILTER_ENABLE_STAMIN 0 -#define WNI_CFG_RA_FILTER_ENABLE_STAMAX 1 -#define WNI_CFG_RA_FILTER_ENABLE_STADEF 0 - -#define WNI_CFG_RA_FILTER_ENABLE_APMIN 0 -#define WNI_CFG_RA_FILTER_ENABLE_APMAX 1 -#define WNI_CFG_RA_FILTER_ENABLE_APDEF 0 - -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMIN 0 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMAX 60 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STADEF 60 - -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APMIN 0 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APMAX 60 -#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APDEF 60 - -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STAMIN 0 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STAMAX 2 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STADEF 2 - -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_APMIN 0 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_APMAX 2 -#define WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_APDEF 2 - -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STAMIN 0 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STAMAX 1 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STADEF 1 - -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_APMIN 0 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_APMAX 1 -#define WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_APDEF 1 - -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STAMIN 0 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STAMAX 1 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STADEF 0 - -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_APMIN 0 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_APMAX 1 -#define WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_APDEF 0 - -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STAMIN 0 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STAMAX 3 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STADEF 1 - -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_APMIN 0 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_APMAX 3 -#define WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_APDEF 1 - -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_STAMIN 0 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_STAMAX 1 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_STADEF 0 - -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_APMIN 0 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_APMAX 1 -#define WNI_CFG_TDLS_WMM_MODE_ENABLED_APDEF 0 - -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_STAMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_STAMAX 500 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_STADEF 10 - -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_APMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_APMAX 500 -#define WNI_CFG_MAX_UAPSD_CONSEC_SP_APDEF 10 - -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STAMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STAMAX 5000 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STADEF 50 - -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_APMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_APMAX 5000 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_APDEF 50 - -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STAMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STAMAX 5000 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STADEF 50 - -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_APMIN 0 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_APMAX 5000 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_APDEF 50 - -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STAMIN 50 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STAMAX 50000 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STADEF 500 - -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_APMIN 50 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_APMAX 50000 -#define WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_APDEF 500 - -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STAMIN 50 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STAMAX 50000 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STADEF 500 - -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_APMIN 50 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_APMAX 50000 -#define WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_APDEF 500 - -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STAMIN 0 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STAMAX 255 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STADEF 0 - -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_APMIN 0 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_APMAX 255 -#define WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_APDEF 0 - -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STAMIN 1 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STAMAX 255 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STADEF 10 - -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_APMIN 1 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_APMAX 255 -#define WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_APDEF 10 - -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_STAMIN 0 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_STAMAX 1 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_STADEF 1 - -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_APMIN 0 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_APMAX 1 -#define WNI_CFG_ENABLE_DYNAMIC_WMMPS_APDEF 1 - -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STAMIN 0 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STAMAX 12288 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STADEF 0 - -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_APMIN 0 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_APMAX 12288 -#define WNI_CFG_BURST_MODE_BE_TXOP_VALUE_APDEF 0 - -#define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_APMIN 0 -#define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_APMAX 1 -#define WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_APDEF 0 - -#define CFG_PARAM_MAX_NUM 345 -#define CFG_AP_IBUF_MAX_SIZE 283 -#define CFG_AP_SBUF_MAX_SIZE 3422 -#define CFG_STA_IBUF_MAX_SIZE 279 -#define CFG_STA_SBUF_MAX_SIZE 3389 -#define CFG_SEM_MAX_NUM 19 - -#define CFG_STA_MAGIC_DWORD 0xbeefbeef - -#define CFG_AP_MAGIC_DWORD 0xdeaddead - - -#endif diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgApi.c b/drivers/staging/prima/CORE/MAC/src/cfg/cfgApi.c index 4fa4bc578e61..cd7652232836 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgApi.c +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -50,8 +50,6 @@ static tANI_U32 __gCfgIBufMax[CFG_STA_IBUF_MAX_SIZE] ; static tANI_U32 __gCfgIBuf[CFG_STA_IBUF_MAX_SIZE] ; static tANI_U8 __gCfgSBuf[CFG_STA_SBUF_MAX_SIZE] ; static tANI_U8 __gSBuffer[CFG_MAX_STR_LEN] ; -static tANI_U32 __gParamList[WNI_CFG_MAX_PARAM_NUM + - WNI_CFG_GET_PER_STA_STAT_RSP_NUM]; static void Notify(tpAniSirGlobal, tANI_U16, tANI_U32); @@ -142,7 +140,6 @@ tSirRetStatus cfgInit(tpAniSirGlobal pMac) pMac->cfg.gCfgSBuf = __gCfgSBuf; pMac->cfg.gSBuffer = __gSBuffer; pMac->cfg.gCfgEntry = __gCfgEntry; - pMac->cfg.gParamList = __gParamList; for(i=0; icfg.gCfgSBuf = NULL; pMac->cfg.gSBuffer = NULL; pMac->cfg.gCfgEntry = NULL; - pMac->cfg.gParamList = NULL; } // --------------------------------------------------------------------- @@ -229,7 +225,7 @@ cfgSetInt(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U32 value) // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else if ((pMac->cfg.gCfgIBufMin[index] < pMac->cfg.gCfgIBufMax[index]) && @@ -371,7 +367,7 @@ wlan_cfgGetInt(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U32 *pValue) // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else { @@ -433,7 +429,7 @@ cfgIncrementInt(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U32 value) // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else @@ -646,7 +642,7 @@ wlan_cfgGetStr(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U8 *pBuf, tANI_U32 *pLe // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else @@ -727,7 +723,7 @@ wlan_cfgGetStrMaxLen(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U32 *pLength) // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else @@ -793,7 +789,7 @@ wlan_cfgGetStrLen(tpAniSirGlobal pMac, tANI_U16 cfgId, tANI_U32 *pLength) // Check if parameter is valid if ((control & CFG_CTL_VALID) == 0) { - PELOGE(cfgLog(pMac, LOGE, FL("Not valid cfg id %d"), cfgId);) + PELOGE(cfgLog(pMac, LOG3, FL("Not valid cfg id %d"), cfgId);) retVal = eSIR_CFG_INVALID_ID; } else diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgDebug.c b/drivers/staging/prima/CORE/MAC/src/cfg/cfgDebug.c index 820c2b368373..43982f54355c 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgDebug.c +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgDebug.c @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgDef.h b/drivers/staging/prima/CORE/MAC/src/cfg/cfgDef.h index eb44e8358491..0b40d30bffcb 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgDef.h +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgDef.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -68,8 +68,6 @@ #define CFG_CTL_NTF_HW (CFG_CTL_NTF_MAC | CFG_CTL_NTF_PHY) #define CFG_BUF_INDX_MASK 0x00000fff -#define CFG_SEM_INDX_MASK 0x0000f000 -#define CFG_SEM_INDX_SHIFT 12 #endif /* __CFGDEF_H */ diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgPriv.h b/drivers/staging/prima/CORE/MAC/src/cfg/cfgPriv.h index 0d1100c915bd..acfa786930ad 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgPriv.h +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgPriv.h @@ -50,7 +50,7 @@ #include #include "cfgDef.h" - #include + #include /*--------------------------------------------------------------------*/ /* CFG miscellaneous definition */ diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgProcMsg.c b/drivers/staging/prima/CORE/MAC/src/cfg/cfgProcMsg.c index 3ef72e67bae4..5ac80c822aa4 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgProcMsg.c +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgProcMsg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,1620 +41,1657 @@ #include "cfgDebug.h" #include "wlan_qct_wda.h" -#define SEM_0 0x00000000 -#define SEM_1 0x00001000 -#define SEM_2 0x00002000 -#define SEM_3 0x00003000 -#define SEM_4 0x00004000 -#define SEM_5 0x00005000 -#define SEM_6 0x00006000 -#define SEM_7 0x00007000 -#define SEM_8 0x00008000 -#define SEM_9 0x00009000 -#define SEM_10 0x0000a000 -#define SEM_11 0x0000b000 -#define SEM_12 0x0000c000 -#define SEM_13 0x0000d000 -#define SEM_14 0x0000e000 -#define SEM_15 0x0000f000 - tAniSirCgStatic cfgStatic[CFG_PARAM_MAX_NUM] = { {WNI_CFG_STA_ID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RELOAD | CFG_CTL_NTF_HAL | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RELOAD | CFG_CTL_NTF_HAL, 0, 255, 1}, {WNI_CFG_CF_POLLABLE, - CFG_CTL_RE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_1, + CFG_CTL_RE | CFG_CTL_INT | CFG_CTL_RESTART, 0, 255, 1}, {WNI_CFG_CFP_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT, WNI_CFG_CFP_PERIOD_STAMIN, WNI_CFG_CFP_PERIOD_STAMAX, WNI_CFG_CFP_PERIOD_STADEF}, {WNI_CFG_CFP_MAX_DURATION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT, WNI_CFG_CFP_MAX_DURATION_STAMIN, WNI_CFG_CFP_MAX_DURATION_STAMAX, WNI_CFG_CFP_MAX_DURATION_STADEF}, {WNI_CFG_SSID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 255, 6}, {WNI_CFG_BEACON_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH, WNI_CFG_BEACON_INTERVAL_STAMIN, WNI_CFG_BEACON_INTERVAL_STAMAX, WNI_CFG_BEACON_INTERVAL_STADEF}, {WNI_CFG_DTIM_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT, WNI_CFG_DTIM_PERIOD_STAMIN, WNI_CFG_DTIM_PERIOD_STAMAX, WNI_CFG_DTIM_PERIOD_STADEF}, {WNI_CFG_WEP_KEY_LENGTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_WEP_KEY_LENGTH_STAMIN, WNI_CFG_WEP_KEY_LENGTH_STAMAX, WNI_CFG_WEP_KEY_LENGTH_STADEF}, {WNI_CFG_WEP_DEFAULT_KEY_1, - CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART | SEM_4, + CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART, 0, 65535, 0}, {WNI_CFG_WEP_DEFAULT_KEY_2, - CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART | SEM_4, + CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART, 1, 1, 1}, {WNI_CFG_WEP_DEFAULT_KEY_3, - CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART | SEM_4, + CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART, 0, 5, 5}, {WNI_CFG_WEP_DEFAULT_KEY_4, - CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART | SEM_4, + CFG_CTL_VALID | CFG_CTL_WE | CFG_CTL_RESTART, 0, 1, 0}, {WNI_CFG_WEP_DEFAULT_KEYID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WEP_DEFAULT_KEYID_STAMIN, WNI_CFG_WEP_DEFAULT_KEYID_STAMAX, WNI_CFG_WEP_DEFAULT_KEYID_STADEF}, {WNI_CFG_EXCLUDE_UNENCRYPTED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_EXCLUDE_UNENCRYPTED_STAMIN, WNI_CFG_EXCLUDE_UNENCRYPTED_STAMAX, WNI_CFG_EXCLUDE_UNENCRYPTED_STADEF}, {WNI_CFG_RTS_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_6, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RTS_THRESHOLD_STAMIN, WNI_CFG_RTS_THRESHOLD_STAMAX, WNI_CFG_RTS_THRESHOLD_STADEF}, {WNI_CFG_SHORT_RETRY_LIMIT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_6, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_SHORT_RETRY_LIMIT_STAMIN, WNI_CFG_SHORT_RETRY_LIMIT_STAMAX, WNI_CFG_SHORT_RETRY_LIMIT_STADEF}, {WNI_CFG_LONG_RETRY_LIMIT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_6, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_LONG_RETRY_LIMIT_STAMIN, WNI_CFG_LONG_RETRY_LIMIT_STAMAX, WNI_CFG_LONG_RETRY_LIMIT_STADEF}, {WNI_CFG_FRAGMENTATION_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_6, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN, WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX, WNI_CFG_FRAGMENTATION_THRESHOLD_STADEF}, {WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STAMIN, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STAMAX, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME_STADEF}, {WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STAMIN, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STAMAX, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME_STADEF}, {WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STAMIN, WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STAMAX, WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME_STADEF}, {WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMIN, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMAX, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF}, {WNI_CFG_JOIN_FAILURE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMIN, WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMAX, WNI_CFG_JOIN_FAILURE_TIMEOUT_STADEF}, {WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMIN, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMAX, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STADEF}, {WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STAMIN, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STAMAX, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT_STADEF}, {WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STAMIN, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STAMAX, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT_STADEF}, {WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STAMIN, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STAMAX, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT_STADEF}, {WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STAMIN, WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STAMAX, WNI_CFG_RA_PERIODICITY_TIMEOUT_IN_PS_STADEF}, {WNI_CFG_PS_ENABLE_BCN_FILTER, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PS_ENABLE_BCN_FILTER_STAMIN, WNI_CFG_PS_ENABLE_BCN_FILTER_STAMAX, WNI_CFG_PS_ENABLE_BCN_FILTER_STADEF}, {WNI_CFG_PS_ENABLE_HEART_BEAT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PS_ENABLE_HEART_BEAT_STAMIN, WNI_CFG_PS_ENABLE_HEART_BEAT_STAMAX, WNI_CFG_PS_ENABLE_HEART_BEAT_STADEF}, {WNI_CFG_PS_ENABLE_RSSI_MONITOR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PS_ENABLE_RSSI_MONITOR_STAMIN, WNI_CFG_PS_ENABLE_RSSI_MONITOR_STAMAX, WNI_CFG_PS_ENABLE_RSSI_MONITOR_STADEF}, {WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STAMIN, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STAMAX, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT_STADEF}, {WNI_CFG_RF_SETTLING_TIME_CLK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RF_SETTLING_TIME_CLK_STAMIN, WNI_CFG_RF_SETTLING_TIME_CLK_STAMAX, WNI_CFG_RF_SETTLING_TIME_CLK_STADEF}, {WNI_CFG_SUPPORTED_RATES_11B, - CFG_CTL_VALID | CFG_CTL_RE | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE, 0, 3, 1}, - {WNI_CFG_SUPPORTED_RATES_11A, CFG_CTL_VALID | CFG_CTL_RE | SEM_7, + {WNI_CFG_SUPPORTED_RATES_11A, CFG_CTL_VALID | CFG_CTL_RE, 0, 255, 15}, {WNI_CFG_PHY_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PHY_MODE_STAMIN, WNI_CFG_PHY_MODE_STAMAX, WNI_CFG_PHY_MODE_STADEF}, {WNI_CFG_DOT11_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_DOT11_MODE_STAMIN, WNI_CFG_DOT11_MODE_STAMAX, WNI_CFG_DOT11_MODE_STADEF}, {WNI_CFG_OPERATIONAL_RATE_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 1, 1}, {WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 65535, 65534}, {WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_BSSID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0,0,0}, {WNI_CFG_LISTEN_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_LISTEN_INTERVAL_STAMIN, WNI_CFG_LISTEN_INTERVAL_STAMAX, WNI_CFG_LISTEN_INTERVAL_STADEF}, {WNI_CFG_VALID_CHANNEL_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 1, 1}, {WNI_CFG_CURRENT_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT, WNI_CFG_CURRENT_CHANNEL_STAMIN, WNI_CFG_CURRENT_CHANNEL_STAMAX, WNI_CFG_CURRENT_CHANNEL_STADEF}, {WNI_CFG_DEFAULT_RATE_INDEX_5GHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STAMIN, WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STAMAX, WNI_CFG_DEFAULT_RATE_INDEX_5GHZ_STADEF}, {WNI_CFG_DEFAULT_RATE_INDEX_24GHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STAMIN, WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STAMAX, WNI_CFG_DEFAULT_RATE_INDEX_24GHZ_STADEF}, {WNI_CFG_RATE_ADAPTATION_TYPE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH, WNI_CFG_RATE_ADAPTATION_TYPE_STAMIN, WNI_CFG_RATE_ADAPTATION_TYPE_STAMAX, WNI_CFG_RATE_ADAPTATION_TYPE_STADEF}, {WNI_CFG_FIXED_RATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_FIXED_RATE_STAMIN, WNI_CFG_FIXED_RATE_STAMAX, WNI_CFG_FIXED_RATE_STADEF}, {WNI_CFG_FIXED_RATE_MULTICAST_24GHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STAMIN, WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STAMAX, WNI_CFG_FIXED_RATE_MULTICAST_24GHZ_STADEF}, {WNI_CFG_FIXED_RATE_MULTICAST_5GHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STAMIN, WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STAMAX, WNI_CFG_FIXED_RATE_MULTICAST_5GHZ_STADEF}, {WNI_CFG_RETRYRATE_POLICY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RETRYRATE_POLICY_STAMIN, WNI_CFG_RETRYRATE_POLICY_STAMAX, WNI_CFG_RETRYRATE_POLICY_STADEF}, {WNI_CFG_RETRYRATE_SECONDARY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RETRYRATE_SECONDARY_STAMIN, WNI_CFG_RETRYRATE_SECONDARY_STAMAX, WNI_CFG_RETRYRATE_SECONDARY_STADEF}, {WNI_CFG_RETRYRATE_TERTIARY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RETRYRATE_TERTIARY_STAMIN, WNI_CFG_RETRYRATE_TERTIARY_STAMAX, WNI_CFG_RETRYRATE_TERTIARY_STADEF}, {WNI_CFG_APSD_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_APSD_ENABLED_STAMIN, WNI_CFG_APSD_ENABLED_STAMAX, WNI_CFG_APSD_ENABLED_STADEF}, {WNI_CFG_SHARED_KEY_AUTH_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SHARED_KEY_AUTH_ENABLE_STAMIN, WNI_CFG_SHARED_KEY_AUTH_ENABLE_STAMAX, WNI_CFG_SHARED_KEY_AUTH_ENABLE_STADEF}, {WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STAMIN, WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STAMAX, WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE_STADEF}, {WNI_CFG_AUTHENTICATION_TYPE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_AUTHENTICATION_TYPE_STAMIN, WNI_CFG_AUTHENTICATION_TYPE_STAMAX, WNI_CFG_AUTHENTICATION_TYPE_STADEF}, {WNI_CFG_CF_POLL_REQUEST, - CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, 0, 255, 1}, {WNI_CFG_PRIVACY_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PRIVACY_ENABLED_STAMIN, WNI_CFG_PRIVACY_ENABLED_STAMAX, WNI_CFG_PRIVACY_ENABLED_STADEF}, {WNI_CFG_SHORT_PREAMBLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_SHORT_PREAMBLE_STAMIN, WNI_CFG_SHORT_PREAMBLE_STAMAX, WNI_CFG_SHORT_PREAMBLE_STADEF}, {WNI_CFG_SHORT_SLOT_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SHORT_SLOT_TIME_STAMIN, WNI_CFG_SHORT_SLOT_TIME_STAMAX, WNI_CFG_SHORT_SLOT_TIME_STADEF}, {WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMIN, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMAX, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STADEF}, {WNI_CFG_QOS_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_QOS_ENABLED_STAMIN, WNI_CFG_QOS_ENABLED_STAMAX, WNI_CFG_QOS_ENABLED_STADEF}, {WNI_CFG_HCF_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_HCF_ENABLED_STAMIN, WNI_CFG_HCF_ENABLED_STAMAX, WNI_CFG_HCF_ENABLED_STADEF}, {WNI_CFG_RSN_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_RSN_ENABLED_STAMIN, WNI_CFG_RSN_ENABLED_STAMAX, WNI_CFG_RSN_ENABLED_STADEF}, {WNI_CFG_BACKGROUND_SCAN_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_BACKGROUND_SCAN_PERIOD_STAMIN, WNI_CFG_BACKGROUND_SCAN_PERIOD_STAMAX, WNI_CFG_BACKGROUND_SCAN_PERIOD_STADEF}, {WNI_CFG_MAX_NUM_PRE_AUTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_MAX_NUM_PRE_AUTH_STAMIN, WNI_CFG_MAX_NUM_PRE_AUTH_STAMAX, WNI_CFG_MAX_NUM_PRE_AUTH_STADEF}, {WNI_CFG_PREAUTH_CLNUP_TIMEOUT, - CFG_CTL_INT | SEM_8, + CFG_CTL_INT, 0, 255, 1}, {WNI_CFG_RELEASE_AID_TIMEOUT, - CFG_CTL_INT | SEM_8, + CFG_CTL_INT, 0, 255, 1}, {WNI_CFG_HEART_BEAT_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_HEART_BEAT_THRESHOLD_STAMIN, WNI_CFG_HEART_BEAT_THRESHOLD_STAMAX, WNI_CFG_HEART_BEAT_THRESHOLD_STADEF}, {WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STAMIN, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STAMAX, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT_STADEF}, {WNI_CFG_MANUFACTURER_OUI, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_MANUFACTURER_NAME, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_MODEL_NUMBER, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_MODEL_NAME, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_MANUFACTURER_PRODUCT_NAME, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_MANUFACTURER_PRODUCT_VERSION, - CFG_CTL_VALID | CFG_CTL_RE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE, 0, 0, 0}, {WNI_CFG_11D_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_11D_ENABLED_STAMIN, WNI_CFG_11D_ENABLED_STAMAX, WNI_CFG_11D_ENABLED_STADEF}, {WNI_CFG_MAX_TX_POWER_2_4, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_MAX_TX_POWER_5, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_NETWORK_DENSITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_NETWORK_DENSITY_STAMIN, WNI_CFG_NETWORK_DENSITY_STAMAX, WNI_CFG_NETWORK_DENSITY_STADEF}, {WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STAMIN, WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STAMAX, WNI_CFG_ADAPTIVE_THRESHOLD_ALGORITHM_STADEF}, {WNI_CFG_CURRENT_TX_ANTENNA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_CURRENT_TX_ANTENNA_STAMIN, WNI_CFG_CURRENT_TX_ANTENNA_STAMAX, WNI_CFG_CURRENT_TX_ANTENNA_STADEF}, {WNI_CFG_CURRENT_RX_ANTENNA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_CURRENT_RX_ANTENNA_STAMIN, WNI_CFG_CURRENT_RX_ANTENNA_STAMAX, WNI_CFG_CURRENT_RX_ANTENNA_STADEF}, {WNI_CFG_CURRENT_TX_POWER_LEVEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT, WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMIN, WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX, WNI_CFG_CURRENT_TX_POWER_LEVEL_STADEF}, {WNI_CFG_POWER_STATE_PER_CHAIN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_POWER_STATE_PER_CHAIN_STAMIN, WNI_CFG_POWER_STATE_PER_CHAIN_STAMAX, WNI_CFG_POWER_STATE_PER_CHAIN_STADEF}, {WNI_CFG_NEW_BSS_FOUND_IND, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_NEW_BSS_FOUND_IND_STAMIN, WNI_CFG_NEW_BSS_FOUND_IND_STAMAX, WNI_CFG_NEW_BSS_FOUND_IND_STADEF}, {WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STAMIN, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STAMAX, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED_STADEF}, {WNI_CFG_PROPRIETARY_RATES_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PROPRIETARY_RATES_ENABLED_STAMIN, WNI_CFG_PROPRIETARY_RATES_ENABLED_STAMAX, WNI_CFG_PROPRIETARY_RATES_ENABLED_STADEF}, {WNI_CFG_AP_NODE_NAME, - CFG_CTL_RE | SEM_8, + CFG_CTL_RE, 0, 255, 1}, {WNI_CFG_COUNTRY_CODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_11H_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_11H_ENABLED_STAMIN, WNI_CFG_11H_ENABLED_STAMAX, WNI_CFG_11H_ENABLED_STADEF}, {WNI_CFG_WT_CNF_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WT_CNF_TIMEOUT_STAMIN, WNI_CFG_WT_CNF_TIMEOUT_STAMAX, WNI_CFG_WT_CNF_TIMEOUT_STADEF}, {WNI_CFG_KEEPALIVE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_KEEPALIVE_TIMEOUT_STAMIN, WNI_CFG_KEEPALIVE_TIMEOUT_STAMAX, WNI_CFG_KEEPALIVE_TIMEOUT_STADEF}, {WNI_CFG_PROXIMITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PROXIMITY_STAMIN, WNI_CFG_PROXIMITY_STAMAX, WNI_CFG_PROXIMITY_STADEF}, {WNI_CFG_LOG_LEVEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_LOG_LEVEL_STAMIN, WNI_CFG_LOG_LEVEL_STAMAX, WNI_CFG_LOG_LEVEL_STADEF}, {WNI_CFG_OLBC_DETECT_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OLBC_DETECT_TIMEOUT_STAMIN, WNI_CFG_OLBC_DETECT_TIMEOUT_STAMAX, WNI_CFG_OLBC_DETECT_TIMEOUT_STADEF}, {WNI_CFG_PROTECTION_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_PROTECTION_ENABLED_STAMIN, WNI_CFG_PROTECTION_ENABLED_STAMAX, WNI_CFG_PROTECTION_ENABLED_STADEF}, {WNI_CFG_11G_PROTECTION_ALWAYS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_11G_PROTECTION_ALWAYS_STAMIN, WNI_CFG_11G_PROTECTION_ALWAYS_STAMAX, WNI_CFG_11G_PROTECTION_ALWAYS_STADEF}, {WNI_CFG_FORCE_POLICY_PROTECTION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_FORCE_POLICY_PROTECTION_STAMIN, WNI_CFG_FORCE_POLICY_PROTECTION_STAMAX, WNI_CFG_FORCE_POLICY_PROTECTION_STADEF}, {WNI_CFG_11G_SHORT_PREAMBLE_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STAMIN, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STAMAX, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED_STADEF}, {WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STAMIN, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STAMAX, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED_STADEF}, {WNI_CFG_CAL_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_CAL_PERIOD_STAMIN, WNI_CFG_CAL_PERIOD_STAMAX, WNI_CFG_CAL_PERIOD_STADEF}, {WNI_CFG_STATS_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_STATS_PERIOD_STAMIN, WNI_CFG_STATS_PERIOD_STAMAX, WNI_CFG_STATS_PERIOD_STADEF}, {WNI_CFG_CAL_CONTROL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_CAL_CONTROL_STAMIN, WNI_CFG_CAL_CONTROL_STAMAX, WNI_CFG_CAL_CONTROL_STADEF}, {WNI_CFG_11G_ONLY_POLICY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_11G_ONLY_POLICY_STAMIN, WNI_CFG_11G_ONLY_POLICY_STAMAX, WNI_CFG_11G_ONLY_POLICY_STADEF}, {WNI_CFG_PACKET_CLASSIFICATION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PACKET_CLASSIFICATION_STAMIN, WNI_CFG_PACKET_CLASSIFICATION_STAMAX, WNI_CFG_PACKET_CLASSIFICATION_STADEF}, {WNI_CFG_WME_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_WME_ENABLED_STAMIN, WNI_CFG_WME_ENABLED_STAMAX, WNI_CFG_WME_ENABLED_STADEF}, {WNI_CFG_ADDTS_RSP_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ADDTS_RSP_TIMEOUT_STAMIN, WNI_CFG_ADDTS_RSP_TIMEOUT_STAMAX, WNI_CFG_ADDTS_RSP_TIMEOUT_STADEF}, {WNI_CFG_MAX_SP_LENGTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_MAX_SP_LENGTH_STAMIN, WNI_CFG_MAX_SP_LENGTH_STAMAX, WNI_CFG_MAX_SP_LENGTH_STADEF}, {WNI_CFG_KEEP_ALIVE_STA_LIMIT_THRESHOLD, - CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, 0, 255, 1}, {WNI_CFG_SEND_SINGLE_SSID_ALWAYS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STAMIN, WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STAMAX, WNI_CFG_SEND_SINGLE_SSID_ALWAYS_STADEF}, {WNI_CFG_WSM_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WSM_ENABLED_STAMIN, WNI_CFG_WSM_ENABLED_STAMAX, WNI_CFG_WSM_ENABLED_STADEF}, {WNI_CFG_PROP_CAPABILITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PROP_CAPABILITY_STAMIN, WNI_CFG_PROP_CAPABILITY_STAMAX, WNI_CFG_PROP_CAPABILITY_STADEF}, {WNI_CFG_EDCA_PROFILE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_SCH, WNI_CFG_EDCA_PROFILE_STAMIN, WNI_CFG_EDCA_PROFILE_STAMAX, WNI_CFG_EDCA_PROFILE_STADEF}, {WNI_CFG_EDCA_ANI_ACBK_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACBE_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACVI_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACVO_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACBK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACBE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACVI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_ANI_ACVO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACBK_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACBE_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACVI_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACVO_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACBK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACBE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACVI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_WME_ACVO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACBK_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACBE_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACVI_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACVO_LOCAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACBK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACBE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACVI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_EDCA_TIT_DEMO_ACVO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_RDET_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_RDET_FLAG_STAMIN, WNI_CFG_RDET_FLAG_STAMAX, WNI_CFG_RDET_FLAG_STADEF}, {WNI_CFG_RADAR_CHANNEL_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART, 0, 0, 0}, {WNI_CFG_LOCAL_POWER_CONSTRAINT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_LOCAL_POWER_CONSTRAINT_STAMIN, WNI_CFG_LOCAL_POWER_CONSTRAINT_STAMAX, WNI_CFG_LOCAL_POWER_CONSTRAINT_STADEF}, {WNI_CFG_ADMIT_POLICY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_ADMIT_POLICY_STAMIN, WNI_CFG_ADMIT_POLICY_STAMAX, WNI_CFG_ADMIT_POLICY_STADEF}, {WNI_CFG_ADMIT_BWFACTOR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_ADMIT_BWFACTOR_STAMIN, WNI_CFG_ADMIT_BWFACTOR_STAMAX, WNI_CFG_ADMIT_BWFACTOR_STADEF}, {WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STAMIN, WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STAMAX, WNI_CFG_MAX_CONSECUTIVE_BACKGROUND_SCAN_FAILURE_STADEF}, {WNI_CFG_CHANNEL_BONDING_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_CHANNEL_BONDING_MODE_STAMIN, WNI_CFG_CHANNEL_BONDING_MODE_STAMAX, WNI_CFG_CHANNEL_BONDING_MODE_STADEF}, {WNI_CFG_CB_SECONDARY_CHANNEL_STATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STAMIN, WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STAMAX, WNI_CFG_CB_SECONDARY_CHANNEL_STATE_STADEF}, {WNI_CFG_DYNAMIC_THRESHOLD_ZERO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STAMIN, WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STAMAX, WNI_CFG_DYNAMIC_THRESHOLD_ZERO_STADEF}, {WNI_CFG_DYNAMIC_THRESHOLD_ONE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_DYNAMIC_THRESHOLD_ONE_STAMIN, WNI_CFG_DYNAMIC_THRESHOLD_ONE_STAMAX, WNI_CFG_DYNAMIC_THRESHOLD_ONE_STADEF}, {WNI_CFG_DYNAMIC_THRESHOLD_TWO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_DYNAMIC_THRESHOLD_TWO_STAMIN, WNI_CFG_DYNAMIC_THRESHOLD_TWO_STAMAX, WNI_CFG_DYNAMIC_THRESHOLD_TWO_STADEF}, {WNI_CFG_TRIG_STA_BK_SCAN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TRIG_STA_BK_SCAN_STAMIN, WNI_CFG_TRIG_STA_BK_SCAN_STAMAX, WNI_CFG_TRIG_STA_BK_SCAN_STADEF}, {WNI_CFG_DYNAMIC_PROFILE_SWITCHING, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STAMIN, WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STAMAX, WNI_CFG_DYNAMIC_PROFILE_SWITCHING_STADEF}, {WNI_CFG_SCAN_CONTROL_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_MIMO_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RELOAD | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RELOAD, WNI_CFG_MIMO_ENABLED_STAMIN, WNI_CFG_MIMO_ENABLED_STAMAX, WNI_CFG_MIMO_ENABLED_STADEF}, {WNI_CFG_BLOCK_ACK_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_BLOCK_ACK_ENABLED_STAMIN, WNI_CFG_BLOCK_ACK_ENABLED_STAMAX, WNI_CFG_BLOCK_ACK_ENABLED_STADEF}, {WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STAMIN, WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STAMAX, WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT_STADEF}, {WNI_CFG_HT_RX_STBC, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_HT_RX_STBC_STAMIN, WNI_CFG_HT_RX_STBC_STAMAX, WNI_CFG_HT_RX_STBC_STADEF}, {WNI_CFG_HT_CAP_INFO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_10, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_HT_CAP_INFO_STAMIN, WNI_CFG_HT_CAP_INFO_STAMAX, WNI_CFG_HT_CAP_INFO_STADEF}, {WNI_CFG_HT_AMPDU_PARAMS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_HT_AMPDU_PARAMS_STAMIN, WNI_CFG_HT_AMPDU_PARAMS_STAMAX, WNI_CFG_HT_AMPDU_PARAMS_STADEF}, {WNI_CFG_SUPPORTED_MCS_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_EXT_HT_CAP_INFO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_10, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_EXT_HT_CAP_INFO_STAMIN, WNI_CFG_EXT_HT_CAP_INFO_STAMAX, WNI_CFG_EXT_HT_CAP_INFO_STADEF}, {WNI_CFG_TX_BF_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_TX_BF_CAP_STAMIN, 4294967295u, WNI_CFG_TX_BF_CAP_STADEF}, {WNI_CFG_AS_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_AS_CAP_STAMIN, WNI_CFG_AS_CAP_STAMAX, WNI_CFG_AS_CAP_STADEF}, {WNI_CFG_HT_INFO_FIELD1, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_10, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_HT_INFO_FIELD1_STAMIN, WNI_CFG_HT_INFO_FIELD1_STAMAX, WNI_CFG_HT_INFO_FIELD1_STADEF}, {WNI_CFG_HT_INFO_FIELD2, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_NTF_LIM | SEM_10, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_NTF_LIM, WNI_CFG_HT_INFO_FIELD2_STAMIN, WNI_CFG_HT_INFO_FIELD2_STAMAX, WNI_CFG_HT_INFO_FIELD2_STADEF}, {WNI_CFG_HT_INFO_FIELD3, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_NTF_LIM | SEM_10, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_SAVE | CFG_CTL_NTF_LIM, WNI_CFG_HT_INFO_FIELD3_STAMIN, WNI_CFG_HT_INFO_FIELD3_STAMAX, WNI_CFG_HT_INFO_FIELD3_STADEF}, {WNI_CFG_BASIC_MCS_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_CURRENT_MCS_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_GREENFIELD_CAPABILITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_GREENFIELD_CAPABILITY_STAMIN, WNI_CFG_GREENFIELD_CAPABILITY_STAMAX, WNI_CFG_GREENFIELD_CAPABILITY_STADEF}, {WNI_CFG_VHT_MAX_MPDU_LENGTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_MAX_MPDU_LENGTH_STAMIN, WNI_CFG_VHT_MAX_MPDU_LENGTH_STAMAX, WNI_CFG_VHT_MAX_MPDU_LENGTH_STADEF}, {WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMIN, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMAX, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STADEF}, {WNI_CFG_VHT_LDPC_CODING_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_LDPC_CODING_CAP_STAMIN, WNI_CFG_VHT_LDPC_CODING_CAP_STAMAX, WNI_CFG_VHT_LDPC_CODING_CAP_STADEF}, {WNI_CFG_VHT_SHORT_GI_80MHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SHORT_GI_80MHZ_STAMIN, WNI_CFG_VHT_SHORT_GI_80MHZ_STAMAX, WNI_CFG_VHT_SHORT_GI_80MHZ_STADEF}, {WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMIN, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMAX, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STADEF}, {WNI_CFG_VHT_TXSTBC, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_TXSTBC_STAMIN, WNI_CFG_VHT_TXSTBC_STAMAX, WNI_CFG_VHT_TXSTBC_STADEF}, {WNI_CFG_VHT_RXSTBC, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_RXSTBC_STAMIN, WNI_CFG_VHT_RXSTBC_STAMAX, WNI_CFG_VHT_RXSTBC_STADEF}, {WNI_CFG_VHT_SU_BEAMFORMER_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SU_BEAMFORMER_CAP_STAMIN, WNI_CFG_VHT_SU_BEAMFORMER_CAP_STAMAX, WNI_CFG_VHT_SU_BEAMFORMER_CAP_STADEF}, {WNI_CFG_VHT_SU_BEAMFORMEE_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMIN, WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMAX, WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STADEF}, {WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STADEF}, {WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STAMIN, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STAMAX, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS_STADEF}, {WNI_CFG_VHT_MU_BEAMFORMER_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_MU_BEAMFORMER_CAP_STAMIN, WNI_CFG_VHT_MU_BEAMFORMER_CAP_STAMAX, WNI_CFG_VHT_MU_BEAMFORMER_CAP_STADEF}, {WNI_CFG_VHT_MU_BEAMFORMEE_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STAMIN, WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STAMAX, WNI_CFG_VHT_MU_BEAMFORMEE_CAP_STADEF}, {WNI_CFG_VHT_TXOP_PS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_TXOP_PS_STAMIN, WNI_CFG_VHT_TXOP_PS_STAMAX, WNI_CFG_VHT_TXOP_PS_STADEF}, {WNI_CFG_VHT_HTC_VHTC_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_HTC_VHTC_CAP_STAMIN, WNI_CFG_VHT_HTC_VHTC_CAP_STAMAX, WNI_CFG_VHT_HTC_VHTC_CAP_STADEF}, {WNI_CFG_VHT_AMPDU_LEN_EXPONENT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STAMIN, WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STAMAX, WNI_CFG_VHT_AMPDU_LEN_EXPONENT_STADEF}, {WNI_CFG_VHT_LINK_ADAPTATION_CAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_LINK_ADAPTATION_CAP_STAMIN, WNI_CFG_VHT_LINK_ADAPTATION_CAP_STAMAX, WNI_CFG_VHT_LINK_ADAPTATION_CAP_STADEF}, {WNI_CFG_VHT_RX_ANT_PATTERN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_RX_ANT_PATTERN_STAMIN, WNI_CFG_VHT_RX_ANT_PATTERN_STAMAX, WNI_CFG_VHT_RX_ANT_PATTERN_STADEF}, {WNI_CFG_VHT_TX_ANT_PATTERN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_TX_ANT_PATTERN_STAMIN, WNI_CFG_VHT_TX_ANT_PATTERN_STAMAX, WNI_CFG_VHT_TX_ANT_PATTERN_STADEF}, {WNI_CFG_VHT_RX_MCS_MAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_RX_MCS_MAP_STAMIN, WNI_CFG_VHT_RX_MCS_MAP_STAMAX, WNI_CFG_VHT_RX_MCS_MAP_STADEF}, {WNI_CFG_VHT_TX_MCS_MAP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_TX_MCS_MAP_STAMIN, WNI_CFG_VHT_TX_MCS_MAP_STAMAX, WNI_CFG_VHT_TX_MCS_MAP_STADEF}, {WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STAMIN, WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STAMAX, WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_STADEF}, {WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STAMIN, WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STAMAX, WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_STADEF}, {WNI_CFG_VHT_CHANNEL_WIDTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_CHANNEL_WIDTH_STAMIN, WNI_CFG_VHT_CHANNEL_WIDTH_STAMAX, WNI_CFG_VHT_CHANNEL_WIDTH_STADEF}, {WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STAMIN, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STAMAX, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1_STADEF}, {WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STAMIN, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STAMAX, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2_STADEF}, {WNI_CFG_VHT_BASIC_MCS_SET, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_BASIC_MCS_SET_STAMIN, WNI_CFG_VHT_BASIC_MCS_SET_STAMAX, WNI_CFG_VHT_BASIC_MCS_SET_STADEF}, {WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STAMIN, WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STAMAX, WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT_STADEF}, {WNI_CFG_VHT_SS_UNDER_UTIL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_SS_UNDER_UTIL_STAMIN, WNI_CFG_VHT_SS_UNDER_UTIL_STAMAX, WNI_CFG_VHT_SS_UNDER_UTIL_STADEF}, {WNI_CFG_VHT_40MHZ_UTILIZATION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_40MHZ_UTILIZATION_STAMIN, WNI_CFG_VHT_40MHZ_UTILIZATION_STAMAX, WNI_CFG_VHT_40MHZ_UTILIZATION_STADEF}, {WNI_CFG_VHT_80MHZ_UTILIZATION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_80MHZ_UTILIZATION_STAMIN, WNI_CFG_VHT_80MHZ_UTILIZATION_STAMAX, WNI_CFG_VHT_80MHZ_UTILIZATION_STADEF}, {WNI_CFG_VHT_160MHZ_UTILIZATION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_3, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_VHT_80MHZ_UTILIZATION_STADEF, WNI_CFG_VHT_160MHZ_UTILIZATION_STAMAX, WNI_CFG_VHT_160MHZ_UTILIZATION_STADEF}, {WNI_CFG_MAX_AMSDU_LENGTH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_MAX_AMSDU_LENGTH_STAMIN, WNI_CFG_MAX_AMSDU_LENGTH_STAMAX, WNI_CFG_MAX_AMSDU_LENGTH_STADEF}, {WNI_CFG_MPDU_DENSITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_MPDU_DENSITY_STAMIN, WNI_CFG_MPDU_DENSITY_STAMAX, WNI_CFG_MPDU_DENSITY_STADEF}, {WNI_CFG_NUM_BUFF_ADVERT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_NUM_BUFF_ADVERT_STAMIN, WNI_CFG_NUM_BUFF_ADVERT_STAMAX, WNI_CFG_NUM_BUFF_ADVERT_STADEF}, {WNI_CFG_MAX_RX_AMPDU_FACTOR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN, WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX, WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX}, {WNI_CFG_SHORT_GI_20MHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_SHORT_GI_20MHZ_STAMIN, WNI_CFG_SHORT_GI_20MHZ_STAMAX, WNI_CFG_SHORT_GI_20MHZ_STADEF}, {WNI_CFG_SHORT_GI_40MHZ, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_SHORT_GI_40MHZ_STAMIN, WNI_CFG_SHORT_GI_40MHZ_STAMAX, WNI_CFG_SHORT_GI_40MHZ_STADEF}, {WNI_CFG_RIFS_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_RIFS_ENABLED_STAMIN, WNI_CFG_RIFS_ENABLED_STAMAX, WNI_CFG_RIFS_ENABLED_STADEF}, {WNI_CFG_MAX_PS_POLL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_MAX_PS_POLL_STAMIN, WNI_CFG_MAX_PS_POLL_STAMAX, WNI_CFG_MAX_PS_POLL_STADEF}, {WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STAMIN, WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STAMAX, WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STADEF}, {WNI_CFG_RSSI_FILTER_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_RSSI_FILTER_PERIOD_STAMIN, WNI_CFG_RSSI_FILTER_PERIOD_STAMAX, WNI_CFG_RSSI_FILTER_PERIOD_STADEF}, {WNI_CFG_MIN_RSSI_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_MIN_RSSI_THRESHOLD_STAMIN, WNI_CFG_MIN_RSSI_THRESHOLD_STAMAX, WNI_CFG_MIN_RSSI_THRESHOLD_STADEF}, {WNI_CFG_NTH_BEACON_FILTER, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_NTH_BEACON_FILTER_STAMIN, WNI_CFG_NTH_BEACON_FILTER_STAMAX, WNI_CFG_NTH_BEACON_FILTER_STADEF}, {WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STAMIN, WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STAMAX, WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE_STADEF}, {WNI_CFG_SCAN_IN_POWERSAVE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_SCAN_IN_POWERSAVE_STAMIN, WNI_CFG_SCAN_IN_POWERSAVE_STAMAX, WNI_CFG_SCAN_IN_POWERSAVE_STADEF}, {WNI_CFG_IGNORE_DTIM, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_IGNORE_DTIM_STAMIN, WNI_CFG_IGNORE_DTIM_STAMAX, WNI_CFG_IGNORE_DTIM_STADEF}, {WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STAMIN, WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STAMAX, WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE_STADEF}, {WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STAMIN, WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STAMAX, WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE_STADEF}, {WNI_CFG_WOWLAN_DEAUTH_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_DEAUTH_ENABLE_STAMIN, WNI_CFG_WOWLAN_DEAUTH_ENABLE_STAMAX, WNI_CFG_WOWLAN_DEAUTH_ENABLE_STADEF}, {WNI_CFG_WOWLAN_DISASSOC_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_DISASSOC_ENABLE_STAMIN, WNI_CFG_WOWLAN_DISASSOC_ENABLE_STAMAX, WNI_CFG_WOWLAN_DISASSOC_ENABLE_STADEF}, {WNI_CFG_WOWLAN_MAX_MISSED_BEACON, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STAMIN, WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STAMAX, WNI_CFG_WOWLAN_MAX_MISSED_BEACON_STADEF}, {WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_5, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STAMIN, WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STAMAX, WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD_STADEF}, {WNI_CFG_BA_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_BA_TIMEOUT_STAMIN, WNI_CFG_BA_TIMEOUT_STAMAX, WNI_CFG_BA_TIMEOUT_STADEF}, {WNI_CFG_BA_THRESHOLD_HIGH, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_BA_THRESHOLD_HIGH_STAMIN, WNI_CFG_BA_THRESHOLD_HIGH_STAMAX, WNI_CFG_BA_THRESHOLD_HIGH_STADEF}, {WNI_CFG_MAX_BA_BUFFERS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_MAX_BA_BUFFERS_STAMIN, WNI_CFG_MAX_BA_BUFFERS_STAMAX, WNI_CFG_MAX_BA_BUFFERS_STADEF}, {WNI_CFG_MAX_BA_SESSIONS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_MAX_BA_SESSIONS_STAMIN, WNI_CFG_MAX_BA_SESSIONS_STAMAX, WNI_CFG_MAX_BA_SESSIONS_STADEF}, {WNI_CFG_BA_AUTO_SETUP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_HAL, WNI_CFG_BA_AUTO_SETUP_STAMIN, WNI_CFG_BA_AUTO_SETUP_STAMAX, WNI_CFG_BA_AUTO_SETUP_STADEF}, {WNI_CFG_ADDBA_REQ_DECLINE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_ADDBA_REQ_DECLINE_STAMIN, WNI_CFG_ADDBA_REQ_DECLINE_STAMAX, WNI_CFG_ADDBA_REQ_DECLINE_STADEF}, {WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STAMIN, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STAMAX, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC_STADEF}, {WNI_CFG_BG_SCAN_CHANNEL_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_MAX_MEDIUM_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_MEDIUM_TIME_STAMIN, WNI_CFG_MAX_MEDIUM_TIME_STAMAX, WNI_CFG_MAX_MEDIUM_TIME_STADEF}, {WNI_CFG_MAX_MPDUS_IN_AMPDU, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_MPDUS_IN_AMPDU_STAMIN, WNI_CFG_MAX_MPDUS_IN_AMPDU_STAMAX, WNI_CFG_MAX_MPDUS_IN_AMPDU_STADEF}, {WNI_CFG_IBSS_AUTO_BSSID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_IBSS_AUTO_BSSID_STAMIN, WNI_CFG_IBSS_AUTO_BSSID_STAMAX, WNI_CFG_IBSS_AUTO_BSSID_STADEF}, {WNI_CFG_PROBE_REQ_ADDNIE_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STAMIN, WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STAMAX, WNI_CFG_PROBE_REQ_ADDNIE_FLAG_STADEF}, {WNI_CFG_PROBE_REQ_ADDNIE_DATA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_PROBE_RSP_ADDNIE_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STAMIN, WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STAMAX, WNI_CFG_PROBE_RSP_ADDNIE_FLAG_STADEF}, {WNI_CFG_PROBE_RSP_ADDNIE_DATA1, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_PROBE_RSP_ADDNIE_DATA2, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_PROBE_RSP_ADDNIE_DATA3, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_ASSOC_RSP_ADDNIE_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STAMIN, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STAMAX, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG_STADEF}, {WNI_CFG_ASSOC_RSP_ADDNIE_DATA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STAMIN, WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STAMAX, WNI_CFG_PROBE_REQ_ADDNP2PIE_FLAG_STADEF}, {WNI_CFG_PROBE_REQ_ADDNP2PIE_DATA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, {WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STAMIN, WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STAMAX, WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG_STADEF}, {WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_WPS_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_ENABLE_STAMIN, WNI_CFG_WPS_ENABLE_STAMAX, WNI_CFG_WPS_ENABLE_STADEF}, {WNI_CFG_WPS_STATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_STATE_STAMIN, WNI_CFG_WPS_STATE_STAMAX, WNI_CFG_WPS_STATE_STADEF}, {WNI_CFG_WPS_PROBE_REQ_FLAG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_PROBE_REQ_FLAG_STAMIN, WNI_CFG_WPS_PROBE_REQ_FLAG_STAMAX, WNI_CFG_WPS_PROBE_REQ_FLAG_STADEF}, {WNI_CFG_WPS_VERSION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_VERSION_STAMIN, WNI_CFG_WPS_VERSION_STAMAX, WNI_CFG_WPS_VERSION_STADEF}, {WNI_CFG_WPS_REQUEST_TYPE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_REQUEST_TYPE_STAMIN, WNI_CFG_WPS_REQUEST_TYPE_STAMAX, WNI_CFG_WPS_REQUEST_TYPE_STADEF}, {WNI_CFG_WPS_CFG_METHOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_CFG_METHOD_STAMIN, 4294967295u, WNI_CFG_WPS_CFG_METHOD_STADEF}, {WNI_CFG_WPS_UUID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM, 0, 0, 0}, {WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STAMIN, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STAMAX, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY_STADEF}, {WNI_CFG_WPS_PIMARY_DEVICE_OUI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_PIMARY_DEVICE_OUI_STAMIN, 4294967295u, WNI_CFG_WPS_PIMARY_DEVICE_OUI_STADEF}, {WNI_CFG_WPS_DEVICE_SUB_CATEGORY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STAMIN, WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STAMAX, WNI_CFG_WPS_DEVICE_SUB_CATEGORY_STADEF}, {WNI_CFG_WPS_ASSOCIATION_STATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_ASSOCIATION_STATE_STAMIN, WNI_CFG_WPS_ASSOCIATION_STATE_STAMAX, WNI_CFG_WPS_ASSOCIATION_STATE_STADEF}, {WNI_CFG_WPS_CONFIGURATION_ERROR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_CONFIGURATION_ERROR_STAMIN, WNI_CFG_WPS_CONFIGURATION_ERROR_STAMAX, WNI_CFG_WPS_CONFIGURATION_ERROR_STADEF}, {WNI_CFG_WPS_DEVICE_PASSWORD_ID, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_DEVICE_PASSWORD_ID_STAMIN, 4294967295u, WNI_CFG_WPS_DEVICE_PASSWORD_ID_STADEF}, {WNI_CFG_WPS_ASSOC_METHOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_WPS_ASSOC_METHOD_STAMIN, WNI_CFG_WPS_ASSOC_METHOD_STAMAX, WNI_CFG_WPS_ASSOC_METHOD_STADEF}, {WNI_CFG_LOW_GAIN_OVERRIDE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_LOW_GAIN_OVERRIDE_STAMIN, WNI_CFG_LOW_GAIN_OVERRIDE_STAMAX, WNI_CFG_LOW_GAIN_OVERRIDE_STADEF}, {WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STAMIN, WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STAMAX, WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE_STADEF}, {WNI_CFG_RPE_POLLING_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RPE_POLLING_THRESHOLD_STAMIN, WNI_CFG_RPE_POLLING_THRESHOLD_STAMAX, WNI_CFG_RPE_POLLING_THRESHOLD_STADEF}, {WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STAMIN, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STAMAX, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG_STADEF}, {WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STAMIN, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STAMAX, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG_STADEF}, {WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STAMIN, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STAMAX, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG_STADEF}, {WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STAMIN, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STAMAX, WNI_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG_STADEF}, {WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_2, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STAMIN, WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STAMAX, WNI_CFG_NO_OF_ONCHIP_REORDER_SESSIONS_STADEF}, {WNI_CFG_SINGLE_TID_RC, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SINGLE_TID_RC_STAMIN, WNI_CFG_SINGLE_TID_RC_STAMAX, WNI_CFG_SINGLE_TID_RC_STADEF}, {WNI_CFG_RRM_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_RRM_ENABLED_STAMIN, WNI_CFG_RRM_ENABLED_STAMAX, WNI_CFG_RRM_ENABLED_STADEF}, {WNI_CFG_RRM_OPERATING_CHAN_MAX, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_RRM_OPERATING_CHAN_MAX_STAMIN, WNI_CFG_RRM_OPERATING_CHAN_MAX_STAMAX, WNI_CFG_RRM_OPERATING_CHAN_MAX_STADEF}, {WNI_CFG_RRM_NON_OPERATING_CHAN_MAX, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STAMIN, WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STAMAX, WNI_CFG_RRM_NON_OPERATING_CHAN_MAX_STADEF}, {WNI_CFG_TX_PWR_CTRL_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_TX_PWR_CTRL_ENABLE_STAMIN, WNI_CFG_TX_PWR_CTRL_ENABLE_STAMAX, WNI_CFG_TX_PWR_CTRL_ENABLE_STADEF}, {WNI_CFG_MCAST_BCAST_FILTER_SETTING, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MCAST_BCAST_FILTER_SETTING_STAMIN, WNI_CFG_MCAST_BCAST_FILTER_SETTING_STAMAX, WNI_CFG_MCAST_BCAST_FILTER_SETTING_STADEF}, {WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STAMIN, WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STAMAX, WNI_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK_STADEF}, {WNI_CFG_DYNAMIC_PS_POLL_VALUE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_DYNAMIC_PS_POLL_VALUE_STAMIN, WNI_CFG_DYNAMIC_PS_POLL_VALUE_STAMAX, WNI_CFG_DYNAMIC_PS_POLL_VALUE_STADEF}, {WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMIN, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMAX, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STADEF}, {WNI_CFG_TELE_BCN_WAKEUP_EN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_TELE_BCN_WAKEUP_EN_STAMIN, WNI_CFG_TELE_BCN_WAKEUP_EN_STAMAX, WNI_CFG_TELE_BCN_WAKEUP_EN_STADEF}, {WNI_CFG_TELE_BCN_TRANS_LI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_TELE_BCN_TRANS_LI_STAMIN, WNI_CFG_TELE_BCN_TRANS_LI_STAMAX, WNI_CFG_TELE_BCN_TRANS_LI_STADEF}, {WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STAMIN, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STAMAX, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS_STADEF}, {WNI_CFG_TELE_BCN_MAX_LI, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_TELE_BCN_MAX_LI_STAMIN, WNI_CFG_TELE_BCN_MAX_LI_STAMAX, WNI_CFG_TELE_BCN_MAX_LI_STADEF}, {WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STAMIN, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STAMAX, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS_STADEF}, {WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STAMIN, WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STAMAX, WNI_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS_STADEF}, {WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMIN, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STADEF}, {WNI_CFG_ASSOC_STA_LIMIT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_ASSOC_STA_LIMIT_STAMIN, WNI_CFG_ASSOC_STA_LIMIT_STAMAX, WNI_CFG_ASSOC_STA_LIMIT_STADEF}, {WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMIN, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMAX, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STADEF}, {WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMIN, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMAX, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STADEF}, {WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMIN, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMAX, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STADEF}, {WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_8, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMIN, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMAX, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STADEF}, {WNI_CFG_ENABLE_CLOSE_LOOP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ENABLE_CLOSE_LOOP_STAMIN, WNI_CFG_ENABLE_CLOSE_LOOP_STAMAX, WNI_CFG_ENABLE_CLOSE_LOOP_STADEF}, {WNI_CFG_ENABLE_LTE_COEX, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ENABLE_LTE_COEX_STAMIN, WNI_CFG_ENABLE_LTE_COEX_STAMAX, WNI_CFG_ENABLE_LTE_COEX_STADEF}, {WNI_CFG_AP_KEEP_ALIVE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMIN, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMAX, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STADEF}, {WNI_CFG_GO_KEEP_ALIVE_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMIN, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMAX, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STADEF}, {WNI_CFG_ENABLE_MC_ADDR_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_MC_ADDR_LIST_STAMIN, WNI_CFG_ENABLE_MC_ADDR_LIST_STAMAX, WNI_CFG_ENABLE_MC_ADDR_LIST_STADEF}, {WNI_CFG_ENABLE_UC_FILTER, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_UC_FILTER_STAMIN, WNI_CFG_ENABLE_UC_FILTER_STAMAX, WNI_CFG_ENABLE_UC_FILTER_STADEF}, {WNI_CFG_ENABLE_LPWR_IMG_TRANSITION, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STAMIN, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STAMAX, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION_STADEF}, {WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMIN, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMAX, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STADEF}, {WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STAMIN, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STAMAX, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP_STADEF}, {WNI_CFG_AP_LINK_MONITOR_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STAMIN, WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STAMAX, WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STADEF}, {WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STAMIN, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STAMAX, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK_STADEF}, {WNI_CFG_TDLS_BUF_STA_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_BUF_STA_ENABLED_STAMIN, WNI_CFG_TDLS_BUF_STA_ENABLED_STAMAX, WNI_CFG_TDLS_BUF_STA_ENABLED_STADEF}, {WNI_CFG_TDLS_PUAPSD_INACT_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_PUAPSD_INACT_TIME_STAMIN, WNI_CFG_TDLS_PUAPSD_INACT_TIME_STAMAX, WNI_CFG_TDLS_PUAPSD_INACT_TIME_STADEF}, {WNI_CFG_TDLS_RX_FRAME_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STAMIN, WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STAMAX, WNI_CFG_TDLS_RX_FRAME_THRESHOLD_STADEF}, {WNI_CFG_ENABLE_ADAPT_RX_DRAIN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMIN, WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMAX, WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STADEF}, {WNI_CFG_FLEX_CONNECT_POWER_FACTOR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_0, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STAMIN, WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STAMAX, WNI_CFG_FLEX_CONNECT_POWER_FACTOR_STADEF}, {WNI_CFG_ANTENNA_DIVESITY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ANTENNA_DIVESITY_STAMIN, WNI_CFG_ANTENNA_DIVESITY_STAMAX, WNI_CFG_ANTENNA_DIVESITY_STADEF}, {WNI_CFG_GO_LINK_MONITOR_TIMEOUT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STAMIN, WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STAMAX, WNI_CFG_GO_LINK_MONITOR_TIMEOUT_STADEF}, {WNI_CFG_ATH_DISABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_ATH_DISABLE_STAMIN, WNI_CFG_ATH_DISABLE_STAMAX, WNI_CFG_ATH_DISABLE_STADEF}, {WNI_CFG_BTC_ACTIVE_WLAN_LEN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_ACTIVE_WLAN_LEN_STAMIN, WNI_CFG_BTC_ACTIVE_WLAN_LEN_STAMAX, WNI_CFG_BTC_ACTIVE_WLAN_LEN_STADEF}, {WNI_CFG_BTC_ACTIVE_BT_LEN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_ACTIVE_BT_LEN_STAMIN, WNI_CFG_BTC_ACTIVE_BT_LEN_STAMAX, WNI_CFG_BTC_ACTIVE_BT_LEN_STADEF}, {WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STAMIN, WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STAMAX, WNI_CFG_BTC_SAP_ACTIVE_WLAN_LEN_STADEF}, {WNI_CFG_BTC_SAP_ACTIVE_BT_LEN, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STAMIN, WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STAMAX, WNI_CFG_BTC_SAP_ACTIVE_BT_LEN_STADEF}, {WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STAMIN, 4294967295u, WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY_STADEF}, {WNI_CFG_ASD_PROBE_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ASD_PROBE_INTERVAL_STAMIN, WNI_CFG_ASD_PROBE_INTERVAL_STAMAX, WNI_CFG_ASD_PROBE_INTERVAL_STADEF}, {WNI_CFG_ASD_TRIGGER_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMIN, WNI_CFG_ASD_TRIGGER_THRESHOLD_STAMAX, WNI_CFG_ASD_TRIGGER_THRESHOLD_STADEF}, {WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMIN, WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STAMAX, WNI_CFG_ASD_RTT_RSSI_HYST_THRESHOLD_STADEF}, {WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMIN, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STAMAX, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_STADEF}, {WNI_CFG_BTC_CTS2S_DURING_SCO, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_CTS2S_DURING_SCO_STAMIN, WNI_CFG_BTC_CTS2S_DURING_SCO_STAMAX, WNI_CFG_BTC_CTS2S_DURING_SCO_STADEF}, {WNI_CFG_CHANNEL_BONDING_24G, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM | SEM_12, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, WNI_CFG_CHANNEL_BONDING_24G_STAMIN, WNI_CFG_CHANNEL_BONDING_24G_STAMAX, WNI_CFG_CHANNEL_BONDING_24G_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMIN, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMAX, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMIN, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMAX, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMIN, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMAX, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMIN, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMAX, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMIN, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMAX, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STADEF}, {WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMIN, WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMAX, WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STADEF}, {WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | SEM_9, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMIN, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMAX, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STADEF}, {WNI_CFG_TDLS_OFF_CHANNEL_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STAMIN, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STAMAX, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED_STADEF}, {WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STAMIN, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STAMAX, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES_STADEF}, {WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | SEM_1, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMIN, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMAX, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STADEF}, {WNI_CFG_RA_FILTER_ENABLE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RA_FILTER_ENABLE_STAMIN, WNI_CFG_RA_FILTER_ENABLE_STAMAX, WNI_CFG_RA_FILTER_ENABLE_STADEF}, {WNI_CFG_RA_RATE_LIMIT_INTERVAL, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMIN, WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMAX, WNI_CFG_RA_RATE_LIMIT_INTERVAL_STADEF}, {WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STAMIN, WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STAMAX, WNI_CFG_BTC_FATAL_HID_NSNIFF_BLK_GUIDANCE_STADEF}, {WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STAMIN, WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STAMAX, WNI_CFG_BTC_CRITICAL_HID_NSNIFF_BLK_GUIDANCE_STADEF}, {WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STAMIN, WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STAMAX, WNI_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD_STADEF}, {WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STAMIN, WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STAMAX, WNI_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD_STADEF}, {WNI_CFG_TDLS_WMM_MODE_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, WNI_CFG_TDLS_WMM_MODE_ENABLED_STAMIN, WNI_CFG_TDLS_WMM_MODE_ENABLED_STAMAX, WNI_CFG_TDLS_WMM_MODE_ENABLED_STADEF}, {WNI_CFG_MAX_UAPSD_CONSEC_SP, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_CONSEC_SP_STAMIN, WNI_CFG_MAX_UAPSD_CONSEC_SP_STAMAX, WNI_CFG_MAX_UAPSD_CONSEC_SP_STADEF}, {WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STAMIN, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STAMAX, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_STADEF}, {WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STAMIN, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STAMAX, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_STADEF}, {WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STAMIN, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STAMAX, WNI_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW_STADEF}, {WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STAMIN, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STAMAX, WNI_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW_STADEF}, {WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STAMIN, WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STAMAX, WNI_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE_STADEF}, {WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STAMIN, WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STAMAX, WNI_CFG_MAX_UAPSD_INACTIVITY_INTERVALS_STADEF}, {WNI_CFG_ENABLE_DYNAMIC_WMMPS, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_DYNAMIC_WMMPS_STAMIN, WNI_CFG_ENABLE_DYNAMIC_WMMPS_STAMAX, WNI_CFG_ENABLE_DYNAMIC_WMMPS_STADEF}, {WNI_CFG_BURST_MODE_BE_TXOP_VALUE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STAMIN, WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STAMAX, WNI_CFG_BURST_MODE_BE_TXOP_VALUE_STADEF}, {WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL | SEM_7, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_STAMIN, WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_STAMAX, WNI_CFG_ENABLE_DYNAMIC_RA_START_RATE_STADEF}, - + {WNI_CFG_BTC_FAST_WLAN_CONN_PREF, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STAMIN, + WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STAMAX, + WNI_CFG_BTC_FAST_WLAN_CONN_PREF_STADEF}, + {WNI_CFG_ENABLE_RTSCTS_HTVHT, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_ENABLE_RTSCTS_HTVHT_MIN, + WNI_CFG_ENABLE_RTSCTS_HTVHT_MAX, + WNI_CFG_ENABLE_RTSCTS_HTVHT_DEF}, + {WNI_CFG_TOGGLE_ARP_BDRATES, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_TOGGLE_ARP_BDRATES_MIN, + WNI_CFG_TOGGLE_ARP_BDRATES_MAX, + WNI_CFG_TOGGLE_ARP_BDRATES_DEF}, + {WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MIN, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MAX, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_DEF}, + {WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MIN, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MAX, + WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_DEF}, + {WNI_CFG_LINK_FAIL_TIMEOUT, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_LINK_FAIL_TIMEOUT_MIN, + WNI_CFG_LINK_FAIL_TIMEOUT_MAX, + WNI_CFG_LINK_FAIL_TIMEOUT_DEF}, + {WNI_CFG_LINK_FAIL_TX_CNT, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_LINK_FAIL_TX_CNT_MIN, + WNI_CFG_LINK_FAIL_TX_CNT_MAX, + WNI_CFG_LINK_FAIL_TX_CNT_DEF}, + {WNI_CFG_OPTIMIZE_CA_EVENT, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_OPTIMIZE_CA_EVENT_DISABLE, + WNI_CFG_OPTIMIZE_CA_EVENT_ENABLE, + WNI_CFG_OPTIMIZE_CA_EVENT_DEFAULT}, + {WNI_CFG_ENABLE_MAC_ADDR_SPOOFING, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_MIN, + WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_MAX, + WNI_CFG_ENABLE_MAC_ADDR_SPOOFING_DEF}, + {WNI_CFG_SAR_BOFFSET_SET_CORRECTION, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_SAR_BOFFSET_SET_CORRECTION_MIN, + WNI_CFG_SAR_BOFFSET_SET_CORRECTION_MAX, + WNI_CFG_SAR_BOFFSET_SET_CORRECTION_DEFAULT}, + {WNI_CFG_DISABLE_BAR_WAKE_UP_HOST, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_HAL, + WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_MIN, + WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_MAX, + WNI_CFG_DISABLE_BAR_WAKE_UP_HOST_DEF}, }; tAniSirCfgStaticString cfgStaticString[CFG_MAX_STATIC_STRING] = @@ -2019,6 +2056,7 @@ ProcDnldRsp(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam) tpCfgBinHdr pHdr; tANI_U32 logLevel; tSirMsgQ mmhMsg; + tANI_U32 paramList[WNI_CFG_DNLD_CNF_NUM]; // First Dword must contain the AP or STA magic dword PELOGW(cfgLog(pMac, LOGW, FL("CFG size %d bytes MAGIC dword is 0x%x"), @@ -2201,9 +2239,9 @@ ProcDnldRsp(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam) pMac->cfg.gCfgStatus = CFG_FAILURE; // Send response message to host - pMac->cfg.gParamList[WNI_CFG_DNLD_CNF_RES] = retVal; + paramList[WNI_CFG_DNLD_CNF_RES] = retVal; cfgSendHostMsg(pMac, WNI_CFG_DNLD_CNF, WNI_CFG_DNLD_CNF_LEN, - WNI_CFG_DNLD_CNF_NUM, pMac->cfg.gParamList, 0, 0); + WNI_CFG_DNLD_CNF_NUM, paramList, 0, 0); // Notify WDA that the config has downloaded mmhMsg.type = SIR_CFG_DOWNLOAD_COMPLETE_IND; @@ -2245,6 +2283,7 @@ ProcGetReq(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam) tANI_U16 cfgId, i; tANI_U32 value, valueLen, result; tANI_U32 *pValue; + tANI_U32 paramList[WNI_CFG_GET_RSP_NUM]; PELOG1(cfgLog(pMac, LOG1, FL("Rcvd cfg get request %d bytes"), length);) for (i=0; icfg.gParamList[WNI_CFG_GET_RSP_RES] = WNI_CFG_NOT_READY; - pMac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId; - pMac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = 0; + paramList[WNI_CFG_GET_RSP_RES] = WNI_CFG_NOT_READY; + paramList[WNI_CFG_GET_RSP_PID] = cfgId; + paramList[WNI_CFG_GET_RSP_PLEN] = 0; cfgSendHostMsg(pMac, WNI_CFG_GET_RSP, WNI_CFG_GET_RSP_PARTIAL_LEN, - WNI_CFG_GET_RSP_NUM, pMac->cfg.gParamList, 0, 0); + WNI_CFG_GET_RSP_NUM, paramList, 0, 0); } else { @@ -2299,15 +2338,15 @@ ProcGetReq(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam) } // Send response message to host - pMac->cfg.gParamList[WNI_CFG_GET_RSP_RES] = result; - pMac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId; - pMac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = valueLen; + paramList[WNI_CFG_GET_RSP_RES] = result; + paramList[WNI_CFG_GET_RSP_PID] = cfgId; + paramList[WNI_CFG_GET_RSP_PLEN] = valueLen; // We need to round up buffer length to word-increment valueLen = (((valueLen + 3) >> 2) << 2); cfgSendHostMsg(pMac, WNI_CFG_GET_RSP, WNI_CFG_GET_RSP_PARTIAL_LEN + valueLen, - WNI_CFG_GET_RSP_NUM, pMac->cfg.gParamList, valueLen, pValue); + WNI_CFG_GET_RSP_NUM, paramList, valueLen, pValue); // Decrement length length -= sizeof(tANI_U32); @@ -2346,6 +2385,7 @@ ProcSetReqInternal(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam, tANI_ { tANI_U16 cfgId, valueLen, valueLenRoundedUp4; tANI_U32 value, result; + tANI_U32 paramList[WNI_CFG_SET_CNF_NUM]; PELOG1(cfgLog(pMac, LOG1, FL("Rcvd cfg set request %d bytes"), length);) //for (i=0; icfg.gCfgStatus) { cfgId = (tANI_U16)sirReadU32N((tANI_U8*)pParam); - PELOG1(cfgLog(pMac, LOGW, FL("CFG not ready, param %d"), cfgId);) - pMac->cfg.gParamList[WNI_CFG_SET_CNF_RES] = WNI_CFG_NOT_READY; - pMac->cfg.gParamList[WNI_CFG_SET_CNF_PID] = cfgId; - if( fRsp ) + cfgLog(pMac, LOGW, FL("CFG not ready, param %d"), cfgId); + if (fRsp) { + paramList[WNI_CFG_SET_CNF_RES] = WNI_CFG_NOT_READY; + paramList[WNI_CFG_SET_CNF_PID] = cfgId; cfgSendHostMsg(pMac, WNI_CFG_SET_CNF, WNI_CFG_SET_CNF_LEN, - WNI_CFG_SET_CNF_NUM, pMac->cfg.gParamList, 0, 0); + WNI_CFG_SET_CNF_NUM, paramList, 0, 0); } } else @@ -2412,7 +2452,8 @@ ProcSetReqInternal(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam, tANI_ // Process string parameter else { - if (valueLenRoundedUp4 > length) + if ((valueLenRoundedUp4 > length) || + (valueLen > CFG_MAX_STR_LEN)) { PELOGE(cfgLog(pMac, LOGE, FL("Invalid string length %d" "in set param %d (tot %d)"), valueLen, @@ -2447,13 +2488,13 @@ ProcSetReqInternal(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam, tANI_ result = WNI_CFG_INVALID_LEN; } - // Send confirm message to host - pMac->cfg.gParamList[WNI_CFG_SET_CNF_RES] = result; - pMac->cfg.gParamList[WNI_CFG_SET_CNF_PID] = cfgId; - if( fRsp ) + if (fRsp) { + /* Send confirm message to host */ + paramList[WNI_CFG_SET_CNF_RES] = result; + paramList[WNI_CFG_SET_CNF_PID] = cfgId; cfgSendHostMsg(pMac, WNI_CFG_SET_CNF, WNI_CFG_SET_CNF_LEN, - WNI_CFG_SET_CNF_NUM, pMac->cfg.gParamList, 0, 0); + WNI_CFG_SET_CNF_NUM, paramList, 0, 0); } else { @@ -2703,9 +2744,6 @@ processCfgDownloadReq(tpAniSirGlobal pMac) retVal = WNI_CFG_SUCCESS; PELOG1(cfgLog(pMac, LOG1, " Completed successfully");) - - pMac->cfg.gParamList[WNI_CFG_DNLD_CNF_RES] = retVal; - } /*** end ProcessDownloadReq() ***/ diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt index 5968d30f70f9..87aba505831d 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt @@ -2449,10 +2449,10 @@ NIM WNI_CFG_BLOCK_ACK_ENABLED I 4 8 V RW NP RESTART LIM -0 3 2 +0 3 0 V RW NP RESTART LIM -0 3 2 +0 3 0 #ENUM DELAYED 0 #ENUM IMMEDIATE 1 diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/dot11f.frms b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/dot11f.frms index 87bbc6564f2d..93e9dd24d3c8 100644 --- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/dot11f.frms +++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/dot11f.frms @@ -2673,63 +2673,7 @@ IE WiderBWChanSwitchAnn (EID_WIDER_BW_CHANNEL_SWITCH_ANN) IE ExtCap (EID_EXT_CAP) { - { - bssCoexistMgmtSupport: 1; - reserved1: 1; - extChanSwitch: 1; - reserved2: 1; - psmpCap: 1; - reserved3: 1; - spsmpCap: 1; - event: 1; - diagnostics: 1; - multiDiagnostics: 1; - locTracking: 1; - FMS: 1; - proxyARPService: 1; - coLocIntfReporting: 1; - civicLoc: 1; - geospatialLoc: 1; - TFS: 1; - wnmSleepMode: 1; - timBroadcast: 1; - bssTransition: 1; - qosTrafficCap: 1; - acStaCnt: 1; - multiBSSID: 1; - timingMeas: 1; - chanUsage: 1; - ssidList: 1; - DMS: 1; - UTCTSFOffset: 1; - TDLSPeerUAPSDBufferSTA: 1; - TDLSPeerPSMSupp: 1; - TDLSChannelSwitching: 1; - interworkingService: 1; - } - { - qosMap: 1; - EBR: 1; - sspnInterface: 1; - reserved4: 1; - msgCFCap: 1; - TDLSSupport: 1; - TDLSProhibited: 1; - TDLSChanSwitProhibited: 1; - rejectUnadmittedTraffic: 1; - serviceIntervalGranularity: 3; - identifierLoc: 1; - uapsdCoexistence: 1; - wnmNotification: 1; - reserved5: 1; - } - { - UTF8SSID: 1; - reserved6: 12; - TDLSWiderBW: 1; - operModeNotification: 1; - reserved7: 1; - } + bytes[1..9]; } IE HTCaps (EID_HT_CAPABILITIES) diff --git a/drivers/staging/prima/CORE/MAC/src/dph/dphHashTable.c b/drivers/staging/prima/CORE/MAC/src/dph/dphHashTable.c index 8cfddfa9fd01..f73bcb8a0be9 100644 --- a/drivers/staging/prima/CORE/MAC/src/dph/dphHashTable.c +++ b/drivers/staging/prima/CORE/MAC/src/dph/dphHashTable.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -134,6 +134,12 @@ tpDphHashNode dphLookupHashEntry(tpAniSirGlobal pMac, tANI_U8 staAddr[], tANI_U1 tpDphHashNode ptr = NULL; tANI_U16 index = hashFunction(pMac, staAddr, pDphHashTable->size); + if (!pDphHashTable->pHashTable) + { + limLog(pMac, LOGE, FL(" pHashTable is NULL ")); + return ptr; + } + for (ptr = pDphHashTable->pHashTable[index]; ptr; ptr = ptr->next) { if (dphCompareMacAddr(staAddr, ptr->staAddr)) @@ -285,6 +291,11 @@ tpDphHashNode dphInitStaState(tpAniSirGlobal pMac, tSirMacAddr staAddr, pStaDs->apsdMaxSpLen = 0; pStaDs->acMode[0] = pStaDs->acMode[1] = pStaDs->acMode[2] = pStaDs->acMode[3] = 0; #endif /* WMM_APSD */ + pStaDs->isDisassocDeauthInProgress = 0; +#ifdef WLAN_FEATURE_11W + pStaDs->last_assoc_received_time = 0; +#endif + pStaDs->sta_deletion_in_progress = false; pStaDs->valid = 1; return pStaDs; } @@ -312,9 +323,9 @@ tpDphHashNode dphAddHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 tpDphHashNode ptr, node; tANI_U16 index = hashFunction(pMac, staAddr, pDphHashTable->size); - PELOG1(limLog(pMac, LOG1, FL("assocId %d index %d STA addr"), + limLog(pMac, LOG1, FL("assocId %d index %d STA addr"), assocId, index); - dphPrintMacAddr(pMac, staAddr, LOG1);) + dphPrintMacAddr(pMac, staAddr, LOG1); if (assocId >= pDphHashTable->size) { @@ -389,9 +400,9 @@ tSirRetStatus dphDeleteHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_ tANI_U16 index = hashFunction(pMac, staAddr, pDphHashTable->size); - PELOG1(limLog(pMac, LOG1, FL("assocId %d index %d STA addr"), + limLog(pMac, LOG1, FL("assocId %d index %d STA addr"), assocId, index); - dphPrintMacAddr(pMac, staAddr, LOG1);) + dphPrintMacAddr(pMac, staAddr, LOG1); if (assocId >= pDphHashTable->size) { @@ -429,6 +440,11 @@ tSirRetStatus dphDeleteHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_ else prev->next = ptr->next; ptr->added = 0; + ptr->isDisassocDeauthInProgress = 0; +#ifdef WLAN_FEATURE_11W + ptr->last_assoc_received_time = 0; +#endif + ptr->sta_deletion_in_progress = false; ptr->next = 0; } else @@ -462,7 +478,7 @@ tSirRetStatus dphDeleteHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_ void dphPrintMacAddr(tpAniSirGlobal pMac, tANI_U8 addr[], tANI_U32 level) { - limLog(pMac, (tANI_U16) level, FL("MAC ADDR = %d:%d:%d:%d:%d:%d"), + limLog(pMac, (tANI_U16) level, FL("MAC ADDR = %02x:%02x:%02x:%02x:%02x:%02x"), addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } diff --git a/drivers/staging/prima/CORE/MAC/src/include/cfgGlobal.h b/drivers/staging/prima/CORE/MAC/src/include/cfgGlobal.h index 63a9ff091a02..742c50fe9d55 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/cfgGlobal.h +++ b/drivers/staging/prima/CORE/MAC/src/include/cfgGlobal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -40,8 +40,8 @@ #include "sirCommon.h" #include "sirTypes.h" -#include "wniCfgSta.h" -#include "wniCfgAp.h" +#include "wniCfg.h" + #define CFG_MAX_NUM_STA SIR_MAX_NUM_STA_IN_IBSS #define CFG_MAX_STATIC_STRING 70 @@ -89,9 +89,6 @@ typedef struct sAniSirCfg // Static buffer for string parameter (must be word-aligned) tANI_U8 *gSBuffer; - - // Message parameter list buffer (enough for largest possible response) - tANI_U32 *gParamList; } tAniSirCfg, *tpAniSirCfg; #endif diff --git a/drivers/staging/prima/CORE/MAC/src/include/dot11f.h b/drivers/staging/prima/CORE/MAC/src/include/dot11f.h index 021e3b026ce0..6d9fa691be01 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/dot11f.h +++ b/drivers/staging/prima/CORE/MAC/src/include/dot11f.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -19,12 +19,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/** - * Copyright (c) 2012 - 2014 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - */ - #ifndef DOT11F_H #define DOT11F_H /** @@ -32,11 +26,8 @@ * * \brief Structures, function prototypes & definitions * for working with 802.11 Frames - * - * - * * This file was automatically generated by 'framesc' - * Mon Nov 10 19:49:53 2014 from the following file(s): + * Mon Dec 3 16:47:12 2018 from the following file(s): * * dot11f.frms * @@ -55,6 +46,10 @@ typedef tANI_U32 tDOT11F_U64[2]; # pragma warning (disable: 4214) /* nonstandard extension used */ #endif /* Microsoft C/C++ bit field types other than int */ +#if !defined unlikely +#define unlikely(x) (x) +#endif + /* * Frames Return Codes: * @@ -90,8 +85,8 @@ typedef tANI_U32 tDOT11F_U64[2]; #define DOT11F_BUFFER_OVERFLOW ( 0x10000005 ) #define DOT11F_MANDATORY_TLV_MISSING ( 0x00001000 ) #define DOT11F_FAILED(code) ( (code) & 0x10000000 ) -#define DOT11F_WARNED(code) ( ( ( 0 == (code) ) & 0x10000000 ) && code) #define DOT11F_SUCCEEDED(code) ( (code) == 0 ) +#define DOT11F_WARNED(code) (!DOT11F_SUCCEEDED(code) && !DOT11F_FAILED(code)) /********************************************************************* * Fixed Fields * @@ -3516,65 +3511,16 @@ tANI_U32 dot11fGetPackedIEESEVersion(tpAniSirGlobal, tDot11fIEESEVersion*, tANI_ // EID 127 (0x7f) typedef struct sDot11fIEExtCap { tANI_U8 present; - tANI_U32 bssCoexistMgmtSupport: 1; - tANI_U32 reserved1: 1; - tANI_U32 extChanSwitch: 1; - tANI_U32 reserved2: 1; - tANI_U32 psmpCap: 1; - tANI_U32 reserved3: 1; - tANI_U32 spsmpCap: 1; - tANI_U32 event: 1; - tANI_U32 diagnostics: 1; - tANI_U32 multiDiagnostics: 1; - tANI_U32 locTracking: 1; - tANI_U32 FMS: 1; - tANI_U32 proxyARPService: 1; - tANI_U32 coLocIntfReporting: 1; - tANI_U32 civicLoc: 1; - tANI_U32 geospatialLoc: 1; - tANI_U32 TFS: 1; - tANI_U32 wnmSleepMode: 1; - tANI_U32 timBroadcast: 1; - tANI_U32 bssTransition: 1; - tANI_U32 qosTrafficCap: 1; - tANI_U32 acStaCnt: 1; - tANI_U32 multiBSSID: 1; - tANI_U32 timingMeas: 1; - tANI_U32 chanUsage: 1; - tANI_U32 ssidList: 1; - tANI_U32 DMS: 1; - tANI_U32 UTCTSFOffset: 1; - tANI_U32 TDLSPeerUAPSDBufferSTA: 1; - tANI_U32 TDLSPeerPSMSupp: 1; - tANI_U32 TDLSChannelSwitching: 1; - tANI_U32 interworkingService: 1; - tANI_U16 qosMap: 1; - tANI_U16 EBR: 1; - tANI_U16 sspnInterface: 1; - tANI_U16 reserved4: 1; - tANI_U16 msgCFCap: 1; - tANI_U16 TDLSSupport: 1; - tANI_U16 TDLSProhibited: 1; - tANI_U16 TDLSChanSwitProhibited: 1; - tANI_U16 rejectUnadmittedTraffic: 1; - tANI_U16 serviceIntervalGranularity: 3; - tANI_U16 identifierLoc: 1; - tANI_U16 uapsdCoexistence: 1; - tANI_U16 wnmNotification: 1; - tANI_U16 reserved5: 1; - tANI_U16 UTF8SSID: 1; - tANI_U16 reserved6: 12; - tANI_U16 TDLSWiderBW: 1; - tANI_U16 operModeNotification: 1; - tANI_U16 reserved7: 1; + tANI_U8 num_bytes; + tANI_U8 bytes[9]; } tDot11fIEExtCap; #define DOT11F_EID_EXTCAP ( 127 ) // N.B. These #defines do *not* include the EID & length -#define DOT11F_IE_EXTCAP_MIN_LEN ( 8 ) +#define DOT11F_IE_EXTCAP_MIN_LEN ( 1 ) -#define DOT11F_IE_EXTCAP_MAX_LEN ( 8 ) +#define DOT11F_IE_EXTCAP_MAX_LEN ( 9 ) #ifdef __cplusplus extern "C" { @@ -5173,7 +5119,7 @@ typedef struct sDot11fIERSN { // N.B. These #defines do *not* include the EID & length #define DOT11F_IE_RSN_MIN_LEN ( 6 ) -#define DOT11F_IE_RSN_MAX_LEN ( 114 ) +#define DOT11F_IE_RSN_MAX_LEN ( 255 ) #ifdef __cplusplus extern "C" { @@ -5315,7 +5261,7 @@ typedef struct sDot11fIESuppRates { ((_x) == 48) || \ ((_x) == 72) || \ ((_x) == 96) || \ - ((_x) == 108)) + ((_x) == 108)) #ifdef __cplusplus extern "C" { @@ -5802,7 +5748,7 @@ tANI_U32 dot11fGetPackedIEWMMParams(tpAniSirGlobal, tDot11fIEWMMParams*, tANI_U3 typedef struct sDot11fIEWPA { tANI_U8 present; tANI_U16 version /* Must be 1! */; - tANI_U8 multicast_cipher_present; //field added to fix the bug in dot11fPackIEWPA + tANI_U8 multicast_cipher_present; //field added to fix the bug in dot11fPackIEWPA tANI_U8 multicast_cipher[4]; tANI_U16 unicast_cipher_count; tANI_U8 unicast_ciphers[4][4]; diff --git a/drivers/staging/prima/CORE/MAC/src/include/dphGlobal.h b/drivers/staging/prima/CORE/MAC/src/include/dphGlobal.h index 2c9c95955560..3dac65ae0c14 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/dphGlobal.h +++ b/drivers/staging/prima/CORE/MAC/src/include/dphGlobal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2013, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -619,6 +619,9 @@ typedef struct sDphHashNode tANI_U16 pmfSaQueryCurrentTransId; tANI_U16 pmfSaQueryStartTransId; TX_TIMER pmfSaQueryTimer; + v_TIME_t last_unprot_deauth_disassoc; + tANI_U8 proct_deauh_disassoc_cnt; + v_TIME_t last_assoc_received_time; #endif tANI_U8 htLdpcCapable; @@ -634,7 +637,8 @@ typedef struct sDphHashNode * end of the structure. */ - + tANI_U8 isDisassocDeauthInProgress; + bool sta_deletion_in_progress; struct sDphHashNode *next; diff --git a/drivers/staging/prima/CORE/MAC/src/include/parserApi.h b/drivers/staging/prima/CORE/MAC/src/include/parserApi.h index 08d500589c73..d9037497985f 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/parserApi.h +++ b/drivers/staging/prima/CORE/MAC/src/include/parserApi.h @@ -141,6 +141,7 @@ typedef struct sSirProbeRespBeacon tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; tDot11fIEVHTExtBssLoad VHTExtBssLoad; + tDot11fIEExtCap ExtCap; tDot11fIEOperatingMode OperatingMode; tANI_U8 WiderBWChanSwitchAnnPresent; tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; @@ -297,6 +298,79 @@ typedef struct sSirEseBcnReportMandatoryIe } tSirEseBcnReportMandatoryIe, *tpSirEseBcnReportMandatoryIe; #endif /* FEATURE_WLAN_ESE_UPLOAD */ +struct s_ext_cap { + uint8_t bssCoexistMgmtSupport: 1; + uint8_t reserved1: 1; + uint8_t extChanSwitch: 1; + uint8_t reserved2: 1; + uint8_t psmpCap: 1; + uint8_t reserved3: 1; + uint8_t spsmpCap: 1; + uint8_t event: 1; + uint8_t diagnostics: 1; + uint8_t multiDiagnostics: 1; + uint8_t locTracking: 1; + uint8_t FMS: 1; + uint8_t proxyARPService: 1; + uint8_t coLocIntfReporting: 1; + uint8_t civicLoc: 1; + uint8_t geospatialLoc: 1; + uint8_t TFS: 1; + uint8_t wnmSleepMode: 1; + uint8_t timBroadcast: 1; + uint8_t bssTransition: 1; + uint8_t qosTrafficCap: 1; + uint8_t acStaCnt: 1; + uint8_t multiBSSID: 1; + uint8_t timingMeas: 1; + uint8_t chanUsage: 1; + uint8_t ssidList: 1; + uint8_t DMS: 1; + uint8_t UTCTSFOffset: 1; + uint8_t TDLSPeerUAPSDBufferSTA: 1; + uint8_t TDLSPeerPSMSupp: 1; + uint8_t TDLSChannelSwitching: 1; + uint8_t interworkingService: 1; + uint8_t qosMap: 1; + uint8_t EBR: 1; + uint8_t sspnInterface: 1; + uint8_t reserved4: 1; + uint8_t msgCFCap: 1; + uint8_t TDLSSupport: 1; + uint8_t TDLSProhibited: 1; + uint8_t TDLSChanSwitProhibited: 1; + uint8_t rejectUnadmittedTraffic: 1; + uint8_t serviceIntervalGranularity: 3; + uint8_t identifierLoc: 1; + uint8_t uapsdCoexistence: 1; + uint8_t wnmNotification: 1; + uint8_t QABcapbility: 1; + uint8_t UTF8SSID: 1; + uint8_t QMFActivated: 1; + uint8_t QMFreconAct: 1; + uint8_t RobustAVStreaming: 1; + uint8_t AdvancedGCR: 1; + uint8_t MeshGCR: 1; + uint8_t SCS: 1; + uint8_t QLoadReport: 1; + uint8_t AlternateEDCA: 1; + uint8_t UnprotTXOPneg: 1; + uint8_t ProtTXOPneg: 1; + uint8_t reserved6: 1; + uint8_t ProtQLoadReport: 1; + uint8_t TDLSWiderBW: 1; + uint8_t operModeNotification: 1; + uint8_t maxNumOfMSDU_bit1: 1; + uint8_t maxNumOfMSDU_bit2: 1; + uint8_t ChanSchMgmt: 1; + uint8_t GeoDBInbandEnSignal: 1; + uint8_t NwChanControl: 1; + uint8_t WhiteSpaceMap: 1; + uint8_t ChanAvailQuery: 1; + uint8_t fineTimingMeas: 1; + uint8_t reserved7: 1; +}; + tANI_U8 sirIsPropCapabilityEnabled(struct sAniSirGlobal *pMac, tANI_U32 bitnum); @@ -577,6 +651,13 @@ PopulateDot11fHTInfo(tpAniSirGlobal pMac, tDot11fIEHTInfo *pDot11f, tpPESession psessionEntry); +#ifdef WLAN_FEATURE_AP_HT40_24G +tSirRetStatus +PopulateDot11fOBSSScanParameters(tpAniSirGlobal pMac, + tDot11fIEOBSSScanParameters *pDot11f, + tpPESession psessionEntry); +#endif + void PopulateDot11fIBSSParams(tpAniSirGlobal pMac, tDot11fIEIBSSParams *pDot11f, tpPESession psessionEntry); @@ -723,6 +804,11 @@ PopulateDot11fSuppRates(tpAniSirGlobal pMac, tANI_U8 nChannelNum, tDot11fIESuppRates *pDot11f,tpPESession); +tSirRetStatus +PopulateDot11fRatesTdls(tpAniSirGlobal p_mac, + tDot11fIESuppRates *p_supp_rates, + tDot11fIEExtSuppRates *p_ext_supp_rates, + tANI_U8 curr_oper_channel); tSirRetStatus PopulateDot11fTPCReport(tpAniSirGlobal pMac, tDot11fIETPCReport *pDot11f, @@ -876,10 +962,12 @@ int FindIELocation( tpAniSirGlobal pMac, #ifdef WLAN_FEATURE_11AC tSirRetStatus -PopulateDot11fVHTCaps(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pDot11f, tAniBool isProbeRspAssocRspBeacon ); +PopulateDot11fVHTCaps(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pDot11f, + tANI_U8 nChannelNum, tAniBool isProbeRspAssocRspBeacon); tSirRetStatus -PopulateDot11fVHTOperation(tpAniSirGlobal pMac, tDot11fIEVHTOperation *pDot11f); +PopulateDot11fVHTOperation(tpAniSirGlobal pMac, + tDot11fIEVHTOperation *pDot11f, tANI_U8 nChannelNum); tSirRetStatus PopulateDot11fVHTExtBssLoad(tpAniSirGlobal pMac, tDot11fIEVHTExtBssLoad *pDot11f); diff --git a/drivers/staging/prima/CORE/MAC/src/include/sirParams.h b/drivers/staging/prima/CORE/MAC/src/include/sirParams.h index 8835daea2691..9fd60148ce6c 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/sirParams.h +++ b/drivers/staging/prima/CORE/MAC/src/include/sirParams.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -104,9 +104,7 @@ typedef enum { UPDATE_CHANNEL_LIST = 35, WLAN_MCADDR_FLT = 36, WLAN_CH144 = 37, -#ifdef WLAN_FEATURE_NAN NAN = 38, -#endif #ifdef FEATURE_WLAN_TDLS TDLS_SCAN_COEXISTENCE = 39, #endif @@ -120,13 +118,18 @@ typedef enum { #endif DYNAMIC_WMM_PS = 43, - MAC_SPOOFED_SCAN = 44, BMU_ERROR_GENERIC_RECOVERY = 45, DISA = 46, FW_STATS = 47, WPS_PRBRSP_TMPL = 48, BCN_IE_FLT_DELTA = 49, +#ifdef FEATURE_WLAN_TDLS + TDLS_OFF_CHANNEL = 51, +#endif + MGMT_FRAME_LOGGING = 53, + ENHANCED_TXBD_COMPLETION = 54, + LOGGING_ENHANCEMENT = 55, //MAX_FEATURE_SUPPORTED = 128 } placeHolderInCapBitmap; @@ -330,6 +333,7 @@ typedef struct sSirMbMsgP2p // HAL message types #define SIR_HAL_MSG_TYPES_BEGIN (SIR_HAL_MODULE_ID << 8) +#define SIR_HAL_EXT_MSG_TYPES_BEGIN (SIR_HAL_EXT_MODULE_ID << 8) #define SIR_HAL_ITC_MSG_TYPES_BEGIN (SIR_HAL_MSG_TYPES_BEGIN+0x20) #define SIR_HAL_RADAR_DETECTED_IND SIR_HAL_ITC_MSG_TYPES_BEGIN #define SIR_HAL_WDT_KAM_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 1) @@ -621,7 +625,6 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_DHCP_STOP_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 205) #define SIR_HAL_IBSS_PEER_INACTIVITY_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 206) -#define SIR_HAL_LPHB_CONF_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 206) #define SIR_HAL_LPHB_WAIT_EXPIRE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 207) #define SIR_HAL_ADD_PERIODIC_TX_PTRN_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 208) @@ -693,9 +696,26 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_TDLS_CHAN_SWITCH_REQ_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 259) #endif #define SIR_HAL_SPOOF_MAC_ADDR_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 260) +#define SIR_HAL_SPOOF_MAC_ADDR_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 261) + +#define SIR_HAL_FW_STATS_GET_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 262) -#define SIR_HAL_ENCRYPT_MSG_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 261) -#define SIR_HAL_ENCRYPT_MSG_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 262) +#define SIR_HAL_ENCRYPT_MSG_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 263) +#define SIR_HAL_ENCRYPT_MSG_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 264) + +#define SIR_HAL_MGMT_LOGGING_INIT_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 265) +#define SIR_HAL_GET_FRAME_LOG_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 266) + +#define SIR_HAL_NAN_REQUEST (SIR_HAL_ITC_MSG_TYPES_BEGIN + 267) + +#define SIR_HAL_SET_RTS_CTS_HTVHT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 268) +#define SIR_HAL_MON_START_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 269) +#define SIR_HAL_MON_STOP_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 270) +#define SIR_HAL_FATAL_EVENT_LOGS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 271) +#define SIR_HAL_LPHB_CONF_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 272) +#define SIR_HAL_LOST_LINK_PARAMS_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 273) +#define SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 274) +#define SIR_HAL_SEND_LOG_DONE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 275) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) // CFG message types @@ -791,12 +811,9 @@ typedef struct sSirMbMsgP2p #define SIR_LIM_DEAUTH_ACK_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x27) #define SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x28) -#ifdef FEATURE_WLAN_TDLS_INTERNAL -#define SIR_LIM_TDLS_DISCOVERY_RSP_WAIT (SIR_LIM_TIMEOUT_MSG_START + 0x29) -#define SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x2A) -#define SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x2B) -#endif #define SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE (SIR_LIM_TIMEOUT_MSG_START + 0x2C) +#define SIR_LIM_AUTH_RETRY_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x2D) + #define SIR_LIM_MSG_TYPES_END (SIR_LIM_MSG_TYPES_BEGIN+0xFF) // SCH message types diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/limApi.h b/drivers/staging/prima/CORE/MAC/src/pe/include/limApi.h index 4063d575ccee..5b869d3f0642 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/limApi.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/limApi.h @@ -97,6 +97,7 @@ typedef enum eMgmtFrmDropReason eMGMT_DROP_SCAN_MODE_FRAME, eMGMT_DROP_NON_SCAN_MODE_FRAME, eMGMT_DROP_INVALID_SIZE, + eMGMT_DROP_SPURIOUS_FRAME, }tMgmtFrmDropReason; @@ -126,6 +127,8 @@ void limDumpInit(tpAniSirGlobal pMac); extern void limCleanup(tpAniSirGlobal); /// Function to post messages to LIM thread extern tANI_U32 limPostMsgApi(tpAniSirGlobal, tSirMsgQ *); +tANI_U32 limPostMsgApiHighPri(tpAniSirGlobal, tSirMsgQ *); + /** * Function to process messages posted to LIM thread * and dispatch to various sub modules within LIM module. @@ -190,7 +193,18 @@ void limHandleLowRssiInd(tpAniSirGlobal pMac); void limHandleBmpsStatusInd(tpAniSirGlobal pMac); void limHandleMissedBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg); tMgmtFrmDropReason limIsPktCandidateForDrop(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U32 subType); +boolean limIsDeauthDiassocForDrop(tpAniSirGlobal pMac, + tANI_U8 *pRxPacketInfo); +#ifdef WLAN_FEATURE_11W +bool lim_is_assoc_req_for_drop(tpAniSirGlobal mac, uint8_t *rx_pkt_info); +#endif void limMicFailureInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg); + +void limProcessLostLinkParamsInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg); +void limUpdateLostLinkParams(tpAniSirGlobal pMac, + tpPESession psessionEntry, tANI_U8 *pRxPacketInfo); + + /* ----------------------------------------------------------------------- */ // These used to be in DPH extern void limSetBssid(tpAniSirGlobal pMac, tANI_U8 *bssId); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/limGlobal.h b/drivers/staging/prima/CORE/MAC/src/pe/include/limGlobal.h index 8be34bb681f4..449697b30405 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/limGlobal.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/limGlobal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,7 +45,7 @@ #include "sirMacPropExts.h" #include "sirCommon.h" #include "sirDebug.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "csrApi.h" #include "sapApi.h" #include "dot11f.h" @@ -357,6 +357,8 @@ typedef struct tLimPreAuthNode tANI_U8 fFree:1; tANI_U8 rsvd:5; TX_TIMER timer; + tANI_U16 seqNo; + v_TIME_t timestamp; }tLimPreAuthNode, *tpLimPreAuthNode; // Pre-authentication table definition @@ -669,14 +671,6 @@ typedef struct sLimSpecMgmtInfo tANI_BOOLEAN fRadarIntrConfigured; /* Whether radar interrupt has been configured */ }tLimSpecMgmtInfo, *tpLimSpecMgmtInfo; -#ifdef FEATURE_WLAN_TDLS_INTERNAL -typedef struct sLimDisResultList -{ - struct sLimDisResultList *next ; - tSirTdlsPeerInfo tdlsDisPeerInfo ; -}tLimDisResultList ; -#endif - #ifdef FEATURE_WLAN_TDLS /* * Peer info needed for TDLS setup.. diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h b/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h index 8238f4807dc3..f5ded353250c 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -91,6 +91,7 @@ typedef struct sPESession // Added to Support BT-AMP tANI_U8 operMode; // AP - 0; STA - 1 ; tSirNwType nwType; tpSirSmeStartBssReq pLimStartBssReq; //handle to smestart bss req + tANI_BOOLEAN bOSENAssociation; //handle to OSEN assoc req tpSirSmeJoinReq pLimJoinReq; // handle to sme join req tpSirSmeJoinReq pLimReAssocReq; //handle to sme reassoc req tpLimMlmJoinReq pLimMlmJoinReq; //handle to MLM join Req @@ -356,6 +357,9 @@ typedef struct sPESession // Added to Support BT-AMP /* DSCP to UP mapping for HS 2.0 */ tSirQosMapSet QosMapSet; tANI_U8 isKeyInstalled; + tANI_BOOLEAN is11Gonly; + tANI_BOOLEAN addBssfailed; + tDot11fIEExtCap ExtCap; }tPESession, *tpPESession; #define LIM_MAX_ACTIVE_SESSIONS 4 diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/limTrace.h b/drivers/staging/prima/CORE/MAC/src/pe/include/limTrace.h index e669df520a92..13f1e26e2eac 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/limTrace.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/limTrace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ * \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/rrmGlobal.h b/drivers/staging/prima/CORE/MAC/src/pe/include/rrmGlobal.h index 6edcaebea24d..ab2b30d30a7e 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/rrmGlobal.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/rrmGlobal.h @@ -36,9 +36,6 @@ \brief Definitions for SME APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAIDmgmt.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAIDmgmt.c index bdae1f0377cd..f90598aff439 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAIDmgmt.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAIDmgmt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,7 +36,7 @@ */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" #include "sirParams.h" diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAdmitControl.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAdmitControl.c index bc1fb1b7dfb4..afcf20362de1 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAdmitControl.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAdmitControl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -554,7 +554,7 @@ void limTspecDelete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo) return; //pierre limLog(pMac, ADMIT_CONTROL_LOGLEVEL, FL("tspec entry = %d"), pInfo->idx); - limLog(pMac, ADMIT_CONTROL_LOGLEVEL, FL("delete tspec %p"), pInfo); + limLog(pMac, ADMIT_CONTROL_LOGLEVEL, FL("delete tspec %pK"), pInfo); pInfo->inuse = 0; // clear the hcca/parameterized queue indicator @@ -1216,7 +1216,7 @@ void limProcessHalAddTsRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) if(pAddTsRspMsg->status == eHAL_STATUS_SUCCESS) { - PELOG1(limLog(pMac, LOG1, FL("Received successful ADDTS response from HAL "));) + limLog(pMac, LOG1, FL("Received successful ADDTS response from HAL ")); // Use the smesessionId and smetransactionId from the PE session context limSendSmeAddtsRsp(pMac, rspReqd, eSIR_SME_SUCCESS, psessionEntry, pAddTsRspMsg->tspec, psessionEntry->smeSessionId, psessionEntry->transactionId); @@ -1224,7 +1224,7 @@ void limProcessHalAddTsRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) } else { - PELOG1(limLog(pMac, LOG1, FL("Received failure ADDTS response from HAL "));) + limLog(pMac, LOG1, FL("Received failure ADDTS response from HAL ")); // Send DELTS action frame to AP // 090803: Get peer MAC addr from session diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limApi.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limApi.c index 51172baae584..344773409e4b 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limApi.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -40,7 +40,7 @@ * */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "wniApi.h" #include "sirCommon.h" #include "sirDebug.h" @@ -351,6 +351,9 @@ static void __limInitVars(tpAniSirGlobal pMac) pMac->lim.gScanInPowersave = 0; pMac->lim.probeCounter = 0; pMac->lim.maxProbe = 0; + pMac->lim.txBdToken = 0; + + pMac->lim.EnableTdls2040BSSCoexIE = 1; } static void __limInitAssocVars(tpAniSirGlobal pMac) @@ -664,7 +667,7 @@ tSirRetStatus limStart(tpAniSirGlobal pMac) { tSirResultCodes retCode = eSIR_SUCCESS; - PELOG1(limLog(pMac, LOG1, FL(" enter"));) + limLog(pMac, LOG1, FL(" enter")); if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) { @@ -857,7 +860,7 @@ limCleanup(tpAniSirGlobal pMac) // free up preAuth table if (pMac->lim.gLimPreAuthTimerTable.pTable != NULL) { - vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable); + vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable); pMac->lim.gLimPreAuthTimerTable.pTable = NULL; pMac->lim.gLimPreAuthTimerTable.numEntry = 0; } @@ -999,50 +1002,29 @@ tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) return eSIR_FAILURE; } - pMac->lim.limTimers.gpLimCnfWaitTimer = vos_mem_malloc(sizeof(TX_TIMER) * pMac->lim.maxStation); + pMac->lim.limTimers.gpLimCnfWaitTimer = vos_mem_vmalloc(sizeof(TX_TIMER) * pMac->lim.maxStation); if (NULL == pMac->lim.limTimers.gpLimCnfWaitTimer) { PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) return eSIR_FAILURE; } -#if 0 - pMac->lim.gpLimAIDpool = vos_mem_malloc(sizeof(*pMac->lim.gpLimAIDpool) * (WNI_CFG_ASSOC_STA_LIMIT_STAMAX+1)); - if (NULL == pMac->lim.gpLimAIDpool) - { - PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) - return eSIR_FAILURE; - } -#endif - pMac->lim.gpSession = vos_mem_malloc(sizeof(tPESession)* pMac->lim.maxBssId); + pMac->lim.gpSession = vos_mem_vmalloc(sizeof(tPESession)* pMac->lim.maxBssId); if (NULL == pMac->lim.gpSession) { limLog(pMac, LOGE, FL("memory allocate failed!")); + vos_mem_vfree(pMac->lim.limTimers.gpLimCnfWaitTimer); return eSIR_FAILURE; } vos_mem_set(pMac->lim.gpSession, sizeof(tPESession)*pMac->lim.maxBssId, 0); - - /* - pMac->dph.dphHashTable.pHashTable = vos_mem_malloc(sizeof(tpDphHashNode)*pMac->lim.maxStation); - if (NULL == pMac->dph.dphHashTable.pHashTable) - { - PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) - return eSIR_FAILURE; - } - - pMac->dph.dphHashTable.pDphNodeArray = vos_mem_malloc(sizeof(tDphHashNode)*pMac->lim.maxStation); - if (NULL == pMac->dph.dphHashTable.pDphNodeArray) - { - PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) - return eSIR_FAILURE; - } - */ pMac->pmm.gPmmTim.pTim = vos_mem_malloc(sizeof(tANI_U8)*pMac->lim.maxStation); if (NULL == pMac->pmm.gPmmTim.pTim) { PELOGE(limLog(pMac, LOGE, FL("memory allocate failed for pTim!"));) + vos_mem_vfree(pMac->lim.limTimers.gpLimCnfWaitTimer); + vos_mem_vfree(pMac->lim.gpSession); return eSIR_FAILURE; } vos_mem_set(pMac->pmm.gPmmTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation, 0); @@ -1053,9 +1035,9 @@ tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->lim.lkPeGlobalLock ) ) ) { PELOGE(limLog(pMac, LOGE, FL("pe lock init failed!"));) - vos_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer); + vos_mem_vfree(pMac->lim.limTimers.gpLimCnfWaitTimer); pMac->lim.limTimers.gpLimCnfWaitTimer = NULL; - vos_mem_free(pMac->lim.gpSession); + vos_mem_vfree(pMac->lim.gpSession); pMac->lim.gpSession = NULL; vos_mem_free(pMac->pmm.gPmmTim.pTim); pMac->pmm.gPmmTim.pTim = NULL; @@ -1063,6 +1045,7 @@ tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) } pMac->lim.deauthMsgCnt = 0; pMac->lim.retryPacketCnt = 0; + pMac->lim.gLimIbssRetryCnt = 0; /* * peOpen is successful by now, so it is right time to initialize @@ -1098,21 +1081,11 @@ tSirRetStatus peClose(tpAniSirGlobal pMac) peDeleteSession(pMac,&pMac->lim.gpSession[i]); } } - vos_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer); + vos_mem_vfree(pMac->lim.limTimers.gpLimCnfWaitTimer); pMac->lim.limTimers.gpLimCnfWaitTimer = NULL; -#if 0 - vos_mem_free(pMac->lim.gpLimAIDpool); - pMac->lim.gpLimAIDpool = NULL; -#endif - - vos_mem_free(pMac->lim.gpSession); + vos_mem_vfree(pMac->lim.gpSession); pMac->lim.gpSession = NULL; - /* - vos_mem_free(pMac->dph.dphHashTable.pHashTable); - pMac->dph.dphHashTable.pHashTable = NULL; - vos_mem_free(pMac->dph.dphHashTable.pDphNodeArray); - pMac->dph.dphHashTable.pDphNodeArray = NULL; - */ + vos_mem_free(pMac->pmm.gPmmTim.pTim); pMac->pmm.gPmmTim.pTim = NULL; if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->lim.lkPeGlobalLock ) ) ) @@ -1244,6 +1217,7 @@ tANI_U8 limIsTimerAllowedInPowerSaveState(tpAniSirGlobal pMac, tSirMsgQ *pMsg) case SIR_LIM_ASSOC_FAIL_TIMEOUT: case SIR_LIM_AUTH_FAIL_TIMEOUT: case SIR_LIM_ADDTS_RSP_TIMEOUT: + case SIR_LIM_AUTH_RETRY_TIMEOUT: retStatus = TRUE; break; @@ -1289,6 +1263,35 @@ limPostMsgApi(tpAniSirGlobal pMac, tSirMsgQ *pMsg) return vos_mq_post_message(VOS_MQ_ID_PE, (vos_msg_t *) pMsg); +} /*** end limPostMsgApi() ***/ + +/** + * limPostMsgApiHighPri() + * + * FUNCTION: + * This function is called from other thread while posting a + * message to LIM message Queue gSirLimMsgQ. + * + * LOGIC: + * NA + * + * ASSUMPTIONS: + * NA + * + * NOTE: + * NA + * + * @param pMac - Pointer to Global MAC structure + * @param pMsg - Pointer to the message structure + * @return None + */ + +tANI_U32 +limPostMsgApiHighPri(tpAniSirGlobal pMac, tSirMsgQ *pMsg) +{ + return vos_mq_post_message_high_pri(VOS_MQ_ID_PE, (vos_msg_t *) pMsg); + + } /*** end limPostMsgApi() ***/ @@ -1370,6 +1373,7 @@ VOS_STATUS peHandleMgmtFrame( v_PVOID_t pvosGCtx, v_PVOID_t vosBuff) vos_pkt_t *pVosPkt; VOS_STATUS vosStatus; v_U8_t *pRxPacketInfo; + tANI_U16 frameLen; pVosPkt = (vos_pkt_t *)vosBuff; if (NULL == pVosPkt) @@ -1393,6 +1397,12 @@ VOS_STATUS peHandleMgmtFrame( v_PVOID_t pvosGCtx, v_PVOID_t vosBuff) return VOS_STATUS_E_FAILURE; } + frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + if (frameLen > WDA_MAX_MGMT_MPDU_LEN) { + PELOG1(limLog(pMac, LOG1, FL("Dropping frame of len %d"), frameLen)); + vos_pkt_return_packet(pVosPkt); + return VOS_STATUS_E_FAILURE; + } // // The MPDU header is now present at a certain "offset" in @@ -1402,12 +1412,18 @@ VOS_STATUS peHandleMgmtFrame( v_PVOID_t pvosGCtx, v_PVOID_t vosBuff) if(mHdr->fc.type == SIR_MAC_MGMT_FRAME) { PELOG1(limLog( pMac, LOG1, - FL ( "RxBd=%p mHdr=%p Type: %d Subtype: %d Sizes:FC%d Mgmt%d"), + FL ( "RxBd=%pK mHdr=%pK Type: %d Subtype: %d Sizes:FC%d Mgmt%d"), pRxPacketInfo, mHdr, mHdr->fc.type, mHdr->fc.subType, sizeof(tSirMacFrameCtl), sizeof(tSirMacMgmtHdr) );) - MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT, NO_SESSION, - LIM_TRACE_MAKE_RXMGMT(mHdr->fc.subType, - (tANI_U16) (((tANI_U16) (mHdr->seqControl.seqNumHi << 4)) | mHdr->seqControl.seqNumLo)));) +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo)) + limLog(pMac, LOG1, FL("roamCandidateInd %d"), + WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo)); + + if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) + limLog(pMac, LOG1, FL("offloadScanLearn %d"), + WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)); +#endif } @@ -1760,7 +1776,7 @@ limHandleIBSScoalescing( ieLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); tsfLater = WDA_GET_RX_TSF_LATER(pRxPacketInfo); pIEs = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); - PELOG3(limLog(pMac, LOG3, FL("BEFORE Coalescing tsfLater val :%d"), tsfLater);) + limLog(pMac, LOG1, FL("BEFORE Coalescing tsfLater val :%d"), tsfLater); retCode = limIbssCoalesce(pMac, pHdr, pBeacon, pIEs, ieLen, tsfLater,psessionEntry); } return retCode; @@ -1817,6 +1833,19 @@ tAniBool limEncTypeMatched(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon, (pSession->encryptType == eSIR_ED_AES_128_CMAC))) return eSIR_TRUE; + /* For HS2.0, RSN ie is not present + * in beacon. Therefore no need to + * check for security type in case + * OSEN session. + */ + /*TODO: AP capability mismatch + * is not checked here because + * no logic for beacon parsing + * is avilable for HS2.0. + */ + if (pSession->bOSENAssociation) + return eSIR_TRUE; + return eSIR_FALSE; } @@ -1875,10 +1904,7 @@ limDetectChangeInApCapabilities(tpAniSirGlobal pMac, (eSIR_FALSE == securityCapsMatched) ) ) ) { - /* No need to send probe request if security - * capability doesnt match, Disconnect directly.*/ - if( (false == psessionEntry->fWaitForProbeRsp) && - (eSIR_TRUE == securityCapsMatched)) + if ( false == psessionEntry->fWaitForProbeRsp ) { /* If Beacon capabilities is not matching with the current capability, * then send unicast probe request to AP and take decision after @@ -2038,7 +2064,7 @@ tSirRetStatus limUpdateShortSlot(tpAniSirGlobal pMac, tpSirProbeRespBeacon pBeac if (nShortSlot != psessionEntry->shortSlotTimeSupported) { // Short slot time capability of AP has changed. Adopt to it. - PELOG1(limLog(pMac, LOG1, FL("Shortslot capability of AP changed: %d"), nShortSlot);) + limLog(pMac, LOG1, FL("Shortslot capability of AP changed: %d"), nShortSlot); ((tpSirMacCapabilityInfo)&psessionEntry->limCurrentBssCaps)->shortSlotTime = (tANI_U16)nShortSlot; psessionEntry->shortSlotTimeSupported = nShortSlot; pBeaconParams->fShortSlotTime = (tANI_U8) nShortSlot; @@ -2112,7 +2138,7 @@ void limHandleBmpsStatusInd(tpAniSirGlobal pMac) case ePMM_STATE_UAPSD_SLEEP: case ePMM_STATE_UAPSD_WT_WAKEUP_RSP: case ePMM_STATE_WOWLAN: - PELOG1(limLog(pMac, LOG1, FL("Sending EXIT_BMPS_IND to SME "));) + limLog(pMac, LOG1, FL("Sending EXIT_BMPS_IND to SME ")); limSendExitBmpsInd(pMac, eSME_BMPS_STATUS_IND_RCVD); break; @@ -2151,6 +2177,12 @@ void limHandleMissedBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) return; } #endif + if (pMac->pmm.inMissedBeaconScenario == TRUE) { + limLog(pMac, LOGW, + FL("beacon miss handling is already going on for BSSIdx:%d"), + pSirMissedBeaconInd->bssIdx); + return; + } if ( (pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) || (pMac->pmm.gPmmState == ePMM_STATE_UAPSD_SLEEP)|| (pMac->pmm.gPmmState == ePMM_STATE_WOWLAN) ) @@ -2180,6 +2212,112 @@ void limHandleMissedBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) return; } + +void limUpdateLostLinkParams(tpAniSirGlobal pMac, + tpPESession psessionEntry, tANI_U8 *pRxPacketInfo) +{ + tpSirSmeLostLinkParamsInd pSmeLostLinkParams; + tSirMsgQ mmhMsg; + if (NULL == pRxPacketInfo) + { + return; + } + pSmeLostLinkParams = + (tpSirSmeLostLinkParamsInd)vos_mem_malloc(sizeof(tSirSmeLostLinkParamsInd)); + + if (pSmeLostLinkParams == NULL) + { + limLog(pMac, LOGE, + FL("pSmeLostLinkParams is NULL")); + return; + } + vos_mem_set(pSmeLostLinkParams, sizeof(tSirSmeLostLinkParamsInd), 0); + pSmeLostLinkParams->messageType = eWNI_SME_LOST_LINK_PARAMS_IND; + pSmeLostLinkParams->length = sizeof(tSirSmeLostLinkParamsInd); + pSmeLostLinkParams->sessionId = psessionEntry->smeSessionId; + pSmeLostLinkParams->info.bssIdx = psessionEntry->bssIdx; + + /* + * Since FW adds 100 to RSSI, here also we are adding 100 so that + * HDD has common logic to subtract 100 from RSSI received + */ + pSmeLostLinkParams->info.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo) + 100; + vos_mem_copy(pSmeLostLinkParams->info.selfMacAddr, + psessionEntry->selfMacAddr, + sizeof(tSirMacAddr)); + pSmeLostLinkParams->info.lastDataRate = 0; + pSmeLostLinkParams->info.linkFlCnt = 0; + pSmeLostLinkParams->info.linkFlTx = 0; + pSmeLostLinkParams->info.rsvd1 = 0; + pSmeLostLinkParams->info.rsvd2 = 0; + + mmhMsg.type = eWNI_SME_LOST_LINK_PARAMS_IND; + mmhMsg.bodyptr = pSmeLostLinkParams; + mmhMsg.bodyval = 0; + limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); +} + +/** ----------------------------------------------------------------- + \brief limProcessLostLinkParamsInd() - handles lost link params indication + + This function process the SIR_HAL_LOST_LINK_PARAMS_IND message from HAL, + + \param pMac - global mac structure + \return - none + \sa + ----------------------------------------------------------------- */ + +void limProcessLostLinkParamsInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) +{ + tpSirSmeLostLinkParamsInd pSmeLostLinkParamsInd; + tpSirSmeLostLinkParamsInd pLostLInkParamsInd = (tpSirSmeLostLinkParamsInd)pMsg->bodyptr; + tpPESession psessionEntry ; + tSirMsgQ mmhMsg; + + if (NULL == pLostLInkParamsInd) + { + limLog(pMac, LOGE, + FL("pLostLInkParamsInd is NULL")); + return; + } + + psessionEntry = peFindSessionByBssIdx(pMac,pLostLInkParamsInd->info.bssIdx); + if (psessionEntry == NULL) + { + limLog(pMac, LOGE, + FL("session does not exist for bdssIdx : %d"), + pLostLInkParamsInd->info.bssIdx); + + return; + } + pSmeLostLinkParamsInd = vos_mem_malloc(sizeof(tSirSmeLostLinkParamsInd)); + if (pSmeLostLinkParamsInd == NULL) + { + limLog(pMac, LOGP, + FL("memory allocate failed for eWNI_SME_LOST_LINK_PARAMD_IND")); + return; + } + pSmeLostLinkParamsInd->messageType = eWNI_SME_LOST_LINK_PARAMS_IND; + pSmeLostLinkParamsInd->length = sizeof(tSirSmeLostLinkParamsInd); + pSmeLostLinkParamsInd->sessionId = psessionEntry->smeSessionId; + pSmeLostLinkParamsInd->info.bssIdx = pLostLInkParamsInd->info.bssIdx; + pSmeLostLinkParamsInd->info.rssi = pLostLInkParamsInd->info.rssi; + vos_mem_copy(pSmeLostLinkParamsInd->info.selfMacAddr, + pLostLInkParamsInd->info.selfMacAddr, + sizeof(tSirMacAddr)); + pSmeLostLinkParamsInd->info.linkFlCnt = pLostLInkParamsInd->info.linkFlCnt; + pSmeLostLinkParamsInd->info.linkFlTx = pLostLInkParamsInd->info.linkFlTx; + pSmeLostLinkParamsInd->info.lastDataRate = pLostLInkParamsInd->info.lastDataRate; + pSmeLostLinkParamsInd->info.rsvd1 = pLostLInkParamsInd->info.rsvd1; + pSmeLostLinkParamsInd->info.rsvd2 = pLostLInkParamsInd->info.rsvd2; + + mmhMsg.type = eWNI_SME_LOST_LINK_PARAMS_IND; + mmhMsg.bodyptr = pSmeLostLinkParamsInd; + mmhMsg.bodyval = 0; + limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); + return; +} + /** ----------------------------------------------------------------- \brief limMicFailureInd() - handles mic failure indication @@ -2252,12 +2390,158 @@ void limMicFailureInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) mmhMsg.type = eWNI_SME_MIC_FAILURE_IND; mmhMsg.bodyptr = pSirSmeMicFailureInd; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; } +#ifdef WLAN_FEATURE_11W +/** -------------------------------------------------------------------- + * lim_is_assoc_req_for_drop()- function to decides to drop assoc\reassoc + * frames. + * @mac: pointer to global mac structure + * @rx_pkt_info: rx packet meta information + * + * This function is called before enqueuing the frame to PE queue to + * drop flooded assoc/reassoc frames getting into PE Queue. + * + * Return: true for dropping the frame otherwise false +----------------------------------------------------------------------*/ + +bool lim_is_assoc_req_for_drop(tpAniSirGlobal pMac, uint8_t *rx_pkt_info) +{ + tANI_U8 session_id; + tANI_U16 aid; + tpPESession session_entry; + tpSirMacMgmtHdr pMacHdr; + tpDphHashNode sta_ds; + + pMacHdr = WDA_GET_RX_MAC_HEADER(rx_pkt_info); + session_entry = peFindSessionByBssid(pMac, pMacHdr->bssId, &session_id); + if (!session_entry) + { + PELOG1(limLog(pMac, LOG1, + FL("session does not exist for given STA [%pM]"), + pMacHdr->sa);); + return false; + } + sta_ds = dphLookupHashEntry(pMac, pMacHdr->sa, &aid, + &session_entry->dph.dphHashTable); + if (!sta_ds) + { + PELOG1(limLog(pMac, LOG1, FL("pStaDs is NULL"));); + return false; + } + if (!sta_ds->rmfEnabled) + return false; + + if (sta_ds->pmfSaQueryState == DPH_SA_QUERY_IN_PROGRESS) + return true; + + if (sta_ds->last_assoc_received_time && + ((vos_timer_get_system_time() - + sta_ds->last_assoc_received_time) < 1000)) + return true; + + sta_ds->last_assoc_received_time = vos_timer_get_system_time(); + return false; +} +#endif + +/** ---------------------------------------------------------------------- + *\brief limIsDeauthDiassocForDrop()..decides to drop deauth\diassoc frames. + *This function is called before enqueuing the frame to PE queue. + *This prevents deauth/diassoc frames getting into PE Queue. + +------------------------------------------------------------------------ */ + + +boolean limIsDeauthDiassocForDrop(tpAniSirGlobal pMac, + tANI_U8 *pRxPacketInfo) +{ + tANI_U8 sessionId; + tANI_U16 aid; + tpPESession psessionEntry; + tpSirMacMgmtHdr pMacHdr; + tpDphHashNode pStaDs; + eHalStatus lock_status = eHAL_STATUS_SUCCESS; + boolean ret = FALSE; + + pMacHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); + psessionEntry = peFindSessionByBssid(pMac,pMacHdr->bssId,&sessionId); + if (!psessionEntry) + { + PELOG1(sysLog(pMac, LOG1, + FL("session does not exist for given STA [%pM]"), + pMacHdr->sa);); + return TRUE; + } + + lock_status = pe_AcquireGlobalLock(&pMac->lim); + if (lock_status != eHAL_STATUS_SUCCESS) + { + limLog(pMac, LOGE, FL("pe_AcquireGlobalLock error")); + return TRUE; + } + + pStaDs = dphLookupHashEntry(pMac, pMacHdr->sa, &aid, + &psessionEntry->dph.dphHashTable); + if (!pStaDs) + { + PELOG1(sysLog(pMac, LOG1,FL("pStaDs is NULL"));); + ret = TRUE; + goto end; + } +#ifdef WLAN_FEATURE_11W + if (psessionEntry->limRmfEnabled) + { + if ((WDA_GET_RX_DPU_FEEDBACK(pRxPacketInfo) & + DPU_FEEDBACK_UNPROTECTED_ERROR)) + { + /* It may be possible that deauth/diassoc frames from a spoofy + * AP is received. So if all further deauth/diassoc frmaes are + * dropped, then it may result in lossing deauth/diassoc frames + * from genuine AP. So process all deauth/diassoc frames with + * a time difference of 1 sec. + */ + if (vos_timer_get_system_time() - pStaDs->last_unprot_deauth_disassoc < 1000) + { + ret = TRUE; + goto end; + } + pStaDs->last_unprot_deauth_disassoc = + vos_timer_get_system_time(); + } +/* PMF enabed, Management frames are protected */ + else + { + if (pStaDs->proct_deauh_disassoc_cnt) + { + ret = TRUE; + goto end; + } + else + pStaDs->proct_deauh_disassoc_cnt++; + } + } + else +#endif +/* PMF disabled */ + { + if (pStaDs->isDisassocDeauthInProgress) + { + ret = TRUE; + goto end; + } + else + pStaDs->isDisassocDeauthInProgress++; + } + +end: + pe_ReleaseGlobalLock(&pMac->lim); + return ret; +} /** ----------------------------------------------------------------- \brief limIsPktCandidateForDrop() - decides whether to drop the frame or not @@ -2333,6 +2617,12 @@ tMgmtFrmDropReason limIsPktCandidateForDrop(tpAniSirGlobal pMac, tANI_U8 *pRxPac return eMGMT_DROP_NO_DROP; #endif +#ifdef WLAN_FEATURE_11W + if ((subType == SIR_MAC_MGMT_ASSOC_REQ || + subType == SIR_MAC_MGMT_REASSOC_REQ) && + lim_is_assoc_req_for_drop(pMac, pRxPacketInfo)) + return eMGMT_DROP_SPURIOUS_FRAME; +#endif //Drop INFRA Beacons and Probe Responses in IBSS Mode if( (subType == SIR_MAC_MGMT_BEACON) || (subType == SIR_MAC_MGMT_PROBE_RSP)) diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAssocUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAssocUtils.c index 2e9be9085d66..787d1b1a9e75 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limAssocUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limAssocUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,7 +42,7 @@ #include "wniApi.h" #include "sirCommon.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "pmmApi.h" #include "cfgApi.h" @@ -436,8 +436,8 @@ limCheckMCSSet(tpAniSirGlobal pMac, tANI_U8* supportedMCSSet) * * @param rxRSNIe - received RSN IE in (Re)Assco req * - * @return status - true if ALL BSS basic rates are present in the - * received rateset else false. + * @return status - true if ALL supported cipher suites are present in the + * received rsn IE else false. */ tANI_U8 @@ -563,8 +563,8 @@ limCheckRxRSNIeMatch(tpAniSirGlobal pMac, tDot11fIERSN rxRSNIe,tpPESession pSess * * @param rxWPAIe - Received WPA IE in (Re)Assco req * - * @return status - true if ALL BSS basic rates are present in the - * received rateset else false. + * @return status - true if ALL supported cipher suites are present in the + * received wpa IE else false. */ tANI_U8 @@ -666,7 +666,10 @@ limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionE tSirRetStatus retCode = eSIR_SUCCESS; - limLog( pMac, LOG1, FL("**Initiate cleanup")); + limLog( pMac, LOG1, FL("Cleanup Rx Path for AID : %d" + "psessionEntry->limSmeState : %d, mlmState : %d"), + pStaDs->assocId, psessionEntry->limSmeState, + pStaDs->mlmStaContext.mlmState); limAbortBackgroundScan( pMac ); psessionEntry->isCiscoVendorAP = FALSE; @@ -687,13 +690,13 @@ limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionE * There is no context at Polaris to delete. * Release our assigned AID back to the free pool */ - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || + if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + { + limDelSta(pMac, pStaDs, false, psessionEntry); limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); } limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); - return retCode; } } @@ -740,12 +743,15 @@ limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionE pMac->lim.gLimNumRxCleanup++; #endif - if (psessionEntry->limSmeState == eLIM_SME_JOIN_FAILURE_STATE) { - retCode = limDelBss( pMac, pStaDs, psessionEntry->bssIdx, psessionEntry); + /* Do DEL BSS or DEL STA only if ADD BSS was success */ + if (!psessionEntry->addBssfailed) + { + if (psessionEntry->limSmeState == eLIM_SME_JOIN_FAILURE_STATE) + retCode = limDelBss( pMac, pStaDs, + psessionEntry->bssIdx, psessionEntry); + else + retCode = limDelSta( pMac, pStaDs, true, psessionEntry); } - else - retCode = limDelSta( pMac, pStaDs, true, psessionEntry); - return retCode; } /*** end limCleanupRxPath() ***/ @@ -785,7 +791,7 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, tLimMlmDeauthCnf mlmDeauthCnf; tLimMlmPurgeStaInd mlmPurgeStaInd; - limLog(pMac, LOG1, FL("Sessionid: %d staDsAssocId: %d Trigger: %X " + limLog(pMac, LOG1, FL("Sessionid: %d staDsAssocId: %d Trigger: %d " "statusCode: %d staDsAddr: "MAC_ADDRESS_STR),psessionEntry->peSessionId, staDsAssocId, mlmStaContext.cleanupTrigger, statusCode, MAC_ADDR_ARRAY(staDsAddr)); @@ -831,7 +837,8 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, * Host or LMM driven Disassociation. * Issue Disassoc Confirm to SME. */ - limLog( pMac, LOGW, FL("Lim Posting DISASSOC_CNF to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger); + limLog( pMac, LOGW, FL("Lim Posting DISASSOC_CNF to Sme.Trigger: %d"), + mlmStaContext.cleanupTrigger); vos_mem_copy((tANI_U8 *) &mlmDisassocCnf.peerMacAddr, @@ -856,7 +863,8 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, * Host or LMM driven Deauthentication. * Issue Deauth Confirm to SME. */ - limLog( pMac, LOGW, FL("Lim Posting DEAUTH_CNF to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger); + limLog( pMac, LOGW, FL("Lim Posting DEAUTH_CNF to Sme.Trigger: %d"), + mlmStaContext.cleanupTrigger); vos_mem_copy((tANI_U8 *) &mlmDeauthCnf.peerMacAddr, (tANI_U8 *) staDsAddr, sizeof(tSirMacAddr)); @@ -879,7 +887,8 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, * Received Disassociation/Deauthentication from peer. * Issue Purge Ind to SME. */ - limLog( pMac, LOGW, FL("Lim Posting PURGE_STA_IND to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger) ; + limLog( pMac, LOGW, FL("Lim Posting PURGE_STA_IND to Sme.Trigger: %d"), + mlmStaContext.cleanupTrigger) ; vos_mem_copy((tANI_U8 *) &mlmPurgeStaInd.peerMacAddr, (tANI_U8 *) staDsAddr, sizeof(tSirMacAddr)); @@ -917,28 +926,39 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, && tempLimSmeState == eLIM_SME_WT_REASSOC_STATE) ) { + limLog( pMac, LOG1, FL("Lim Posting eWNI_SME_REASSOC_RSP to SME" + "resultCode: %d, statusCode: %d," + "sessionId: %d"), + mlmStaContext.resultCode, + mlmStaContext.protStatusCode, + psessionEntry->peSessionId); if(mlmStaContext.resultCode != eSIR_SME_SUCCESS ) { peDeleteSession(pMac, psessionEntry); psessionEntry = NULL; - } - + } limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, mlmStaContext.resultCode, mlmStaContext.protStatusCode, psessionEntry, smesessionId, smetransactionId); } else { - vos_mem_free(psessionEntry->pLimJoinReq); - psessionEntry->pLimJoinReq = NULL; + vos_mem_free(psessionEntry->pLimJoinReq); + psessionEntry->pLimJoinReq = NULL; + + limLog( pMac, LOG1, FL("Lim Posting eWNI_SME_JOIN_RSP to SME." + "resultCode: %d,statusCode: %d," + "sessionId: %d"), + mlmStaContext.resultCode, + mlmStaContext.protStatusCode, + psessionEntry->peSessionId); + if(mlmStaContext.resultCode != eSIR_SME_SUCCESS) + { + peDeleteSession(pMac,psessionEntry); + psessionEntry = NULL; + } - if(mlmStaContext.resultCode != eSIR_SME_SUCCESS) - { - peDeleteSession(pMac,psessionEntry); - psessionEntry = NULL; - } - - limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, mlmStaContext.resultCode, mlmStaContext.protStatusCode, + limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, mlmStaContext.resultCode, mlmStaContext.protStatusCode, psessionEntry, smesessionId, smetransactionId); } @@ -1014,6 +1034,7 @@ limRejectAssociation(tpAniSirGlobal pMac, tSirMacAddr peerAddr, tANI_U8 subType, pAuthNode->fTimerStarted = 0; pAuthNode->mlmState = eLIM_MLM_AUTHENTICATED_STATE; pAuthNode->authType = (tAniAuthType) authType; + pAuthNode->timestamp = vos_timer_get_system_ticks(); limAddPreAuthNode(pMac, pAuthNode); } } @@ -1830,9 +1851,9 @@ limPopulateOwnRateSet(tpAniSirGlobal pMac, } - PELOG2(limLog(pMac, LOG2, FL("MCS Rate Set Bitmap: "));) + limLog(pMac, LOG1, FL("MCS Rate Set Bitmap: ")); for(i=0; isupportedMCSSet[i]);) + limLog(pMac, LOG2,FL("%x ") , pRates->supportedMCSSet[i]); } #ifdef WLAN_FEATURE_11AC @@ -1982,9 +2003,9 @@ limPopulatePeerRateSet(tpAniSirGlobal pMac, for(i=0; isupportedMCSSet[i] &= pSupportedMCSSet[i]; } - PELOG2(limLog(pMac, LOG2, FL("MCS Rate Set Bitmap: "));) + limLog(pMac, LOG1, FL("MCS Rate Set Bitmap: ")); for(i=0; isupportedMCSSet[i]);) + limLog(pMac, LOG2,FL("%x ") , pRates->supportedMCSSet[i]); } #ifdef WLAN_FEATURE_11AC limPopulateVhtMcsSet(pMac, pRates , pVHTCaps,psessionEntry); @@ -2149,7 +2170,7 @@ limPopulateMatchingRateSet(tpAniSirGlobal pMac, { if((tempRateSet.numRates + pExtRateSet->numRates) > 12 ) { - limLog( pMac, LOG2, + limLog( pMac, LOG1, "Sum of SUPPORTED and EXTENDED Rate Set (%1d) exceeds 12!", tempRateSet.numRates + pExtRateSet->numRates ); @@ -2182,7 +2203,7 @@ limPopulateMatchingRateSet(tpAniSirGlobal pMac, } } else - limLog( pMac, LOG2, + limLog( pMac, LOG1, "Relying only on the SUPPORTED Rate Set IE..." ); } else @@ -2259,10 +2280,11 @@ limPopulateMatchingRateSet(tpAniSirGlobal pMac, for(i=0; isupportedRates.supportedMCSSet[i] = mcsSet[i] & pSupportedMCSSet[i]; - PELOG2(limLog(pMac, LOG2, FL("limPopulateMatchingRateSet: MCS Rate Set Bitmap from CFG and DPH : "));) + limLog(pMac, LOG1, FL(" MCS Rate Set Bitmap from CFG and DPH : ")); for(i=0; isupportedRates.supportedMCSSet[i]);) + limLog(pMac, LOG1,FL("%x %x "), mcsSet[i], + pStaDs->supportedRates.supportedMCSSet[i]); } } @@ -2382,7 +2404,7 @@ limAddSta( pStaDs->valid = 0; pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; - limLog(pMac, LOG2, FL(" Assoc ID: %d wmmEnabled = %d listenInterval = %d" + limLog(pMac, LOG1, FL(" Assoc ID: %d wmmEnabled = %d listenInterval = %d" " shortPreambleSupported: %d "), pAddStaParams->assocId, pAddStaParams->wmmEnabled, pAddStaParams->listenInterval, pAddStaParams->shortPreambleSupported); @@ -2395,7 +2417,9 @@ limAddSta( */ if((STA_ENTRY_TDLS_PEER == pStaDs->staType) && (true == updateEntry)) + { pAddStaParams->staIdx = pStaDs->staIndex; + } else #endif pAddStaParams->staIdx = HAL_STA_INVALID_IDX; @@ -2433,9 +2457,9 @@ limAddSta( } #ifdef WLAN_FEATURE_11AC - limLog(pMac, LOG2, FL("vhtCapable: %d "),pAddStaParams->vhtCapable); + limLog(pMac, LOG1, FL("vhtCapable: %d "), pAddStaParams->vhtCapable); #endif - limLog(pMac, LOG2, FL(" StaIdx: %d updateSta = %d htcapable = %d "), + limLog(pMac, LOG1, FL(" StaIdx: %d updateSta = %d htcapable = %d "), pAddStaParams->staIdx,pAddStaParams->updateSta, pAddStaParams->htCapable); @@ -2450,15 +2474,15 @@ limAddSta( pAddStaParams->txChannelWidthSet = pStaDs->htSupportedChannelWidthSet; pAddStaParams->mimoPS = pStaDs->htMIMOPSState; - limLog(pMac, LOG2, FL(" greenFieldCapable: %d maxAmpduDensity = %d " + limLog(pMac, LOG1, FL(" greenFieldCapable: %d maxAmpduDensity = %d " "maxAmpduDensity = %d"), pAddStaParams->greenFieldCapable, pAddStaParams->maxAmpduDensity, pAddStaParams->maxAmpduSize); - limLog(pMac, LOG2, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " + limLog(pMac, LOG1, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " "fShortGI40Mhz: %d"), pAddStaParams->fDsssCckMode40Mhz, pAddStaParams->fShortGI20Mhz, pAddStaParams->fShortGI40Mhz); - limLog(pMac, LOG2, FL("lsigTxopProtection: %d maxAmsduSize: %d " + limLog(pMac, LOG1, FL("lsigTxopProtection: %d maxAmsduSize: %d " "txChannelWidthSet: %d mimoPS: %d "), pAddStaParams->lsigTxopProtection, pAddStaParams->maxAmsduSize,pAddStaParams->txChannelWidthSet, pAddStaParams->mimoPS); @@ -2475,7 +2499,7 @@ limAddSta( ( STA_ENTRY_PEER == pStaDs->staType ) ? pStaDs->vhtBeamFormerCapable : psessionEntry->txBFIniFeatureEnabled ; #endif - limLog(pMac, LOG2, FL("vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), + limLog(pMac, LOG1, FL("vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), pAddStaParams->vhtTxChannelWidthSet,pAddStaParams->vhtTxBFCapable); } #endif @@ -2560,7 +2584,7 @@ limAddSta( limLog( pMac, LOG1, FL( "PMF enabled %d"), pAddStaParams->rmfEnabled); #endif - limLog(pMac, LOG2, FL("htLdpcCapable: %d vhtLdpcCapable: %d " + limLog(pMac, LOG1, FL("htLdpcCapable: %d vhtLdpcCapable: %d " "p2pCapableSta: %d"), pAddStaParams->htLdpcCapable, pAddStaParams->vhtLdpcCapable, pAddStaParams->p2pCapableSta); @@ -2800,6 +2824,7 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio tANI_U32 listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF; tANI_U32 shortGi20MhzSupport; tANI_U32 shortGi40MhzSupport; + tANI_U32 val; /*This self Sta dot 11 mode comes from the cfg and the expectation here is * that cfg carries the systemwide capability that device under * consideration can support. This capability gets plumbed into the cfg @@ -2852,7 +2877,12 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio pAddStaParams->staIdx = staIdx; pAddStaParams->updateSta = updateSta; - pAddStaParams->shortPreambleSupported = psessionEntry->beaconParams.fShortPreamble; + if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) + { + limLog(pMac, LOGP, FL("Get short preamble failed. Set Default value")); + pAddStaParams->shortPreambleSupported = 1; + } + pAddStaParams->shortPreambleSupported = val; #ifdef WLAN_FEATURE_11AC limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry,NULL); @@ -2947,16 +2977,16 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio "CFG,setting value to default"));) pAddStaParams->fShortGI40Mhz = WNI_CFG_SHORT_GI_40MHZ_STADEF; } - limLog(pMac, LOG2, FL(" greenFieldCapable: %d maxAmpduDensity = %d " + limLog(pMac, LOG1, FL(" greenFieldCapable: %d maxAmpduDensity = %d " "maxAmpduSize = %d"), pAddStaParams->greenFieldCapable, pAddStaParams->maxAmpduDensity, pAddStaParams->maxAmpduSize); - limLog(pMac, LOG2, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " + limLog(pMac, LOG1, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " "fShortGI40Mhz: %d lsigTxopProtection: %d"), pAddStaParams->fDsssCckMode40Mhz, pAddStaParams->fShortGI20Mhz, pAddStaParams->fShortGI40Mhz, pAddStaParams->lsigTxopProtection); - limLog(pMac, LOG2, FL(" maxAmsduSize: %d txChannelWidthSet: %d " + limLog(pMac, LOG1, FL(" maxAmsduSize: %d txChannelWidthSet: %d " "mimoPS: %d rifsMode %d delBASupport %d"), pAddStaParams->maxAmsduSize, pAddStaParams->txChannelWidthSet, pAddStaParams->mimoPS, @@ -2970,7 +3000,7 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio limLog( pMac, LOG1, FL("VHT WIDTH SET %d"),pAddStaParams->vhtTxChannelWidthSet); } pAddStaParams->vhtTxBFCapable = psessionEntry->txBFIniFeatureEnabled; - limLog(pMac, LOG2, FL("vhtCapable: %d vhtTxBFCapable %d "), + limLog(pMac, LOG1, FL("vhtCapable: %d vhtTxBFCapable %d "), pAddStaParams->vhtCapable, pAddStaParams->vhtTxBFCapable); #endif @@ -2992,16 +3022,16 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio //limFillSupportedRatesInfo(pMac, NULL, &pAddStaParams->supportedRates,psessionEntry); pAddStaParams->supportedRates.opRateMode = limGetStaRateMode((tANI_U8)selfStaDot11Mode); - limLog(pMac, LOG2, FL(" StaIdx: %d updateSta = %d htcapable = %d "), + limLog(pMac, LOG1, FL(" StaIdx: %d updateSta = %d htcapable = %d "), pAddStaParams->staIdx,pAddStaParams->updateSta, pAddStaParams->htCapable); - limLog(pMac, LOG2, FL("htLdpcCapable: %d vhtLdpcCapable: %d " + limLog(pMac, LOG1, FL("htLdpcCapable: %d vhtLdpcCapable: %d " "p2pCapableSta: %d"), pAddStaParams->htLdpcCapable,pAddStaParams->vhtLdpcCapable, pAddStaParams->p2pCapableSta); - limLog(pMac, LOG2, FL(" sessionid: %d Assoc ID: %d listenInterval = %d" + limLog(pMac, LOG1, FL(" sessionid: %d Assoc ID: %d listenInterval = %d" " shortPreambleSupported: %d "), psessionEntry->smeSessionId, pAddStaParams->assocId, pAddStaParams->listenInterval, pAddStaParams->shortPreambleSupported); @@ -3264,7 +3294,7 @@ limCheckAndAnnounceJoinSuccess(tpAniSirGlobal pMac, * Received SSID does not match with the one we've. * Ignore received Beacon frame */ - PELOG1(limLog(pMac, LOG1, FL("SSID received in Beacon does not match"));) + limLog(pMac, LOG1, FL("SSID received in Beacon does not match")); #ifdef WLAN_DEBUG pMac->lim.gLimBcnSSIDMismatchCnt++; #endif @@ -3579,17 +3609,17 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, pAddBssParams->llgCoexist = (tANI_U8) psessionEntry->beaconParams.llgCoexist; pAddBssParams->ht20Coexist = (tANI_U8) psessionEntry->beaconParams.ht20Coexist; - limLog(pMac, LOG2, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " + limLog(pMac, LOG1, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " "cfpCount: %d"),pAddBssParams->bssType, pAddBssParams->beaconInterval, pAddBssParams->dtimPeriod, pAddBssParams->cfParamSet.cfpCount); - limLog(pMac, LOG2, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" + limLog(pMac, LOG1, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" " %d numRates: %d "),pAddBssParams->cfParamSet.cfpPeriod, pAddBssParams->cfParamSet.cfpMaxDuration, pAddBssParams->cfParamSet.cfpDurRemaining, pAddBssParams->rateSet.numRates); - limLog(pMac, LOG2, FL("nwType:%d shortSlotTimeSupported: %d" + limLog(pMac, LOG1, FL("nwType:%d shortSlotTimeSupported: %d" "llaCoexist: %d llbCoexist: %d llgCoexist: %d ht20Coexist: %d"), pAddBssParams->nwType, pAddBssParams->shortSlotTimeSupported, pAddBssParams->llaCoexist, pAddBssParams->llbCoexist, @@ -3601,7 +3631,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pAssocRsp->HTCaps.present )) { pAddBssParams->htCapable = pAssocRsp->HTCaps.present; - limLog(pMac, LOG2, FL("htCapable: %d"),pAddBssParams->htCapable); + limLog(pMac, LOG1, FL("htCapable: %d"),pAddBssParams->htCapable); if ( pBeaconStruct->HTInfo.present ) { pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pAssocRsp->HTInfo.opMode; @@ -3622,12 +3652,12 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pAssocRsp->HTInfo.lsigTXOPProtectionFullSupport; pAddBssParams->fRIFSMode = pAssocRsp->HTInfo.rifsMode; - limLog(pMac, LOG2, FL("htOperMode: %d dualCTSProtection: %d " + limLog(pMac, LOG1, FL("htOperMode: %d dualCTSProtection: %d " "txChannelWidthSet: %d currentExtChannel: %d "), pAddBssParams->htOperMode, pAddBssParams->dualCTSProtection, pAddBssParams->txChannelWidthSet,pAddBssParams->currentExtChannel); - limLog(pMac, LOG2, FL("llnNonGFCoexist: %d " + limLog(pMac, LOG1, FL("llnNonGFCoexist: %d " "fLsigTXOPProtectionFullSupport: %d fRIFSMode %d"), pAddBssParams->llnNonGFCoexist, pAddBssParams->fLsigTXOPProtectionFullSupport, @@ -3636,7 +3666,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, } pAddBssParams->currentOperChannel = bssDescription->channelId; - limLog(pMac, LOG2, FL("currentOperChannel %d"), + limLog(pMac, LOG1, FL("currentOperChannel %d"), pAddBssParams->currentOperChannel); #ifdef WLAN_FEATURE_11AC if (psessionEntry->vhtCapability && ( pAssocRsp->VHTCaps.present )) @@ -3653,7 +3683,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, { pAddBssParams->vhtCapable = 0; } - limLog(pMac, LOG2, FL("vhtCapable %d vhtTxChannelWidthSet %d " + limLog(pMac, LOG1, FL("vhtCapable %d vhtTxChannelWidthSet %d " "currentExtChannel %d"),pAddBssParams->vhtCapable, pAddBssParams->vhtTxChannelWidthSet, pAddBssParams->currentExtChannel); @@ -3682,10 +3712,11 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, } pAddBssParams->staContext.uAPSD = 0; pAddBssParams->staContext.maxSPLen = 0; - pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble; + pAddBssParams->staContext.shortPreambleSupported = + psessionEntry->beaconParams.fShortPreamble; pAddBssParams->staContext.updateSta = updateEntry; - limLog(pMac, LOG2, FL("StaContext: "MAC_ADDRESS_STR + limLog(pMac, LOG1, FL("StaContext: "MAC_ADDRESS_STR " shortPreambleSupported: %d"), MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac), pAddBssParams->staContext.shortPreambleSupported); @@ -3696,12 +3727,13 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, pAddBssParams->staContext.htCapable = 1; pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 )pAssocRsp->HTCaps.greenField; pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 )pAssocRsp->HTCaps.lsigTXOPProtection; - limLog(pMac, LOG2,FL("StaContext htCapable: %d greenFieldCapable: %d " + limLog(pMac, LOG1,FL("StaContext htCapable: %d greenFieldCapable: %d " "lsigTxopProtection: %d"), pAddBssParams->staContext.htCapable, pAddBssParams->staContext.greenFieldCapable, pAddBssParams->staContext.lsigTxopProtection); #ifdef WLAN_FEATURE_11AC - if (psessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) + if (psessionEntry->vhtCapability && + IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)) { pAddBssParams->staContext.vhtCapable = 1; if ((pAssocRsp->VHTCaps.suBeamFormerCap || @@ -3731,7 +3763,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, { pAddBssParams->staContext.vhtTxChannelWidthSet = pAssocRsp->VHTOperation.chanWidth; //pMac->lim.apChanWidth; } - limLog(pMac, LOG2,FL("StaContext vhtCapable %d " + limLog(pMac, LOG1,FL("StaContext vhtCapable %d " "vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), pAddBssParams->staContext.vhtCapable, pAddBssParams->staContext.vhtTxChannelWidthSet, @@ -3812,19 +3844,19 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, if( pBeaconStruct->HTInfo.present ) pAddBssParams->staContext.rifsMode = pAssocRsp->HTInfo.rifsMode; - limLog(pMac, LOG2, FL("StaContext txChannelWidthSet: %d mimoPS: %d" + limLog(pMac, LOG1, FL("StaContext txChannelWidthSet: %d mimoPS: %d" " delBASupport: %d maxAmsduSize: %d"), pAddBssParams->staContext.txChannelWidthSet, pAddBssParams->staContext.mimoPS, pAddBssParams->staContext.delBASupport, pAddBssParams->staContext.maxAmsduSize); - limLog(pMac, LOG2, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " + limLog(pMac, LOG1, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " "fShortGI20Mhz: %d "),pAddBssParams->staContext.maxAmpduDensity, pAddBssParams->staContext.fDsssCckMode40Mhz, pAddBssParams->staContext.fShortGI20Mhz); - limLog(pMac, LOG2, FL("fShortGI40Mh: %d maxAmpduSize: %d " + limLog(pMac, LOG1, FL("fShortGI40Mh: %d maxAmpduSize: %d " "htLdpcCapable: %d vhtLdpcCapable: %d"), pAddBssParams->staContext.fShortGI40Mhz, pAddBssParams->staContext.maxAmpduSize, @@ -3867,7 +3899,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, #if defined WLAN_FEATURE_VOWIFI pAddBssParams->maxTxPower = psessionEntry->maxTxPower; - limLog(pMac, LOG2,FL("maxTxPower: %d"), + limLog(pMac, LOG1,FL("maxTxPower: %d"), pAddBssParams->maxTxPower); #endif // FIXME_GEN4 - Any other value that can be used for initialization? @@ -3885,7 +3917,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, #if defined WLAN_FEATURE_VOWIFI_11R pAddBssParams->extSetStaKeyParamValid = 0; - limLog(pMac, LOG2,FL("extSetStaKeyParamValid: %d"), + limLog(pMac, LOG1,FL("extSetStaKeyParamValid: %d"), pAddBssParams->extSetStaKeyParamValid); #endif @@ -3904,12 +3936,12 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); - limLog(pMac, LOG2, FL("staContext wmmEnabled: %d encryptType: %d " + limLog(pMac, LOG1, FL("staContext wmmEnabled: %d encryptType: %d " "p2pCapableSta: %d"),pAddBssParams->staContext.wmmEnabled, pAddBssParams->staContext.encryptType, pAddBssParams->staContext.p2pCapableSta); - limLog(pMac, LOG2, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " + limLog(pMac, LOG1, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " "LimMlm state to %d"), pAddBssParams->bSpectrumMgtEnabled, pAddBssParams->halPersona, psessionEntry->limMlmState); @@ -4031,17 +4063,17 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry pAddBssParams->llgCoexist = (tANI_U8) psessionEntry->beaconParams.llgCoexist; pAddBssParams->ht20Coexist = (tANI_U8) psessionEntry->beaconParams.ht20Coexist; - limLog(pMac, LOG2, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " + limLog(pMac, LOG1, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " "cfpCount: %d"),pAddBssParams->bssType, pAddBssParams->beaconInterval, pAddBssParams->dtimPeriod, pAddBssParams->cfParamSet.cfpCount); - limLog(pMac, LOG2, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" + limLog(pMac, LOG1, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" " %d numRates: %d "),pAddBssParams->cfParamSet.cfpPeriod, pAddBssParams->cfParamSet.cfpMaxDuration, pAddBssParams->cfParamSet.cfpDurRemaining, pAddBssParams->rateSet.numRates); - limLog(pMac, LOG2, FL("nwType:%d shortSlotTimeSupported: %d" + limLog(pMac, LOG1, FL("nwType:%d shortSlotTimeSupported: %d" "llaCoexist: %d llbCoexist: %d llgCoexist: %d ht20Coexist: %d"), pAddBssParams->nwType, pAddBssParams->shortSlotTimeSupported, pAddBssParams->llaCoexist, pAddBssParams->llbCoexist, @@ -4050,7 +4082,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) { pAddBssParams->htCapable = pBeaconStruct->HTCaps.present; - limLog(pMac, LOG2, FL("htCapable: %d"),pAddBssParams->htCapable); + limLog(pMac, LOG1, FL("htCapable: %d"),pAddBssParams->htCapable); if ( pBeaconStruct->HTInfo.present ) { pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pBeaconStruct->HTInfo.opMode; @@ -4072,12 +4104,12 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pBeaconStruct->HTInfo.lsigTXOPProtectionFullSupport; pAddBssParams->fRIFSMode = pBeaconStruct->HTInfo.rifsMode; - limLog(pMac, LOG2, FL("htOperMode: %d dualCTSProtection: %d " + limLog(pMac, LOG1, FL("htOperMode: %d dualCTSProtection: %d " "txChannelWidthSet: %d currentExtChannel: %d "), pAddBssParams->htOperMode, pAddBssParams->dualCTSProtection, pAddBssParams->txChannelWidthSet,pAddBssParams->currentExtChannel); - limLog(pMac, LOG2, FL("llnNonGFCoexist: %d " + limLog(pMac, LOG1, FL("llnNonGFCoexist: %d " "fLsigTXOPProtectionFullSupport: %d fRIFSMode %d"), pAddBssParams->llnNonGFCoexist, pAddBssParams->fLsigTXOPProtectionFullSupport, @@ -4086,10 +4118,11 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry } pAddBssParams->currentOperChannel = bssDescription->channelId; - limLog(pMac, LOG2, FL("currentOperChannel %d"), + limLog(pMac, LOG1, FL("currentOperChannel %d"), pAddBssParams->currentOperChannel); #ifdef WLAN_FEATURE_11AC - if (psessionEntry->vhtCapability && ( pBeaconStruct->VHTCaps.present )) + if (psessionEntry->vhtCapability && + IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)) { pAddBssParams->vhtCapable = pBeaconStruct->VHTCaps.present; pAddBssParams->vhtTxChannelWidthSet = pBeaconStruct->VHTOperation.chanWidth; @@ -4103,7 +4136,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry { pAddBssParams->vhtCapable = 0; } - limLog(pMac, LOG2, FL("vhtCapable %d vhtTxChannelWidthSet %d " + limLog(pMac, LOG1, FL("vhtCapable %d vhtTxChannelWidthSet %d " "currentExtChannel %d"),pAddBssParams->vhtCapable, pAddBssParams->vhtTxChannelWidthSet, pAddBssParams->currentExtChannel); @@ -4125,7 +4158,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; pAddBssParams->staContext.updateSta = updateEntry; - limLog(pMac, LOG2, FL("StaContext: "MAC_ADDRESS_STR + limLog(pMac, LOG1, FL("StaContext: "MAC_ADDRESS_STR " shortPreambleSupported: %d"), MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac), pAddBssParams->staContext.shortPreambleSupported); @@ -4136,13 +4169,14 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry pAddBssParams->staContext.htCapable = 1; pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; - limLog(pMac, LOG2, FL("StaContext htCapable: %d " + limLog(pMac, LOG1, FL("StaContext htCapable: %d " "greenFieldCapable: %d lsigTxopProtection: %d"), pAddBssParams->staContext.htCapable, pAddBssParams->staContext.greenFieldCapable, pAddBssParams->staContext.lsigTxopProtection); #ifdef WLAN_FEATURE_11AC - if (psessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) + if (psessionEntry->vhtCapability && + IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)) { pAddBssParams->staContext.vhtCapable = 1; if ((pBeaconStruct->VHTCaps.suBeamFormerCap || @@ -4174,7 +4208,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry pAddBssParams->staContext.vhtTxChannelWidthSet = pBeaconStruct->VHTOperation.chanWidth; } - limLog(pMac, LOG2,FL("StaContext vhtCapable %d " + limLog(pMac, LOG1,FL("StaContext vhtCapable %d " "vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), pAddBssParams->staContext.vhtCapable, pAddBssParams->staContext.vhtTxChannelWidthSet, @@ -4254,19 +4288,19 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry if( pBeaconStruct->HTInfo.present ) pAddBssParams->staContext.rifsMode = pBeaconStruct->HTInfo.rifsMode; - limLog(pMac, LOG2, FL("StaContext txChannelWidthSet: %d mimoPS: %d" + limLog(pMac, LOG1, FL("StaContext txChannelWidthSet: %d mimoPS: %d" " delBASupport: %d maxAmsduSize: %d"), pAddBssParams->staContext.txChannelWidthSet, pAddBssParams->staContext.mimoPS, pAddBssParams->staContext.delBASupport, pAddBssParams->staContext.maxAmsduSize); - limLog(pMac, LOG2, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " + limLog(pMac, LOG1, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " "fShortGI20Mhz: %d "),pAddBssParams->staContext.maxAmpduDensity, pAddBssParams->staContext.fDsssCckMode40Mhz, pAddBssParams->staContext.fShortGI20Mhz); - limLog(pMac, LOG2, FL("fShortGI40Mh: %d maxAmpduSize: %d " + limLog(pMac, LOG1, FL("fShortGI40Mh: %d maxAmpduSize: %d " "htLdpcCapable: %d vhtLdpcCapable: %d"), pAddBssParams->staContext.fShortGI40Mhz, pAddBssParams->staContext.maxAmpduSize, @@ -4308,7 +4342,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry #if defined WLAN_FEATURE_VOWIFI pAddBssParams->maxTxPower = psessionEntry->maxTxPower; - limLog(pMac, LOG2,FL("maxTxPower: %d"), + limLog(pMac, LOG1,FL("maxTxPower: %d"), pAddBssParams->maxTxPower); #endif @@ -4324,7 +4358,7 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry #if defined WLAN_FEATURE_VOWIFI_11R pAddBssParams->extSetStaKeyParamValid = 0; - limLog(pMac, LOG2,FL("extSetStaKeyParamValid: %d"), + limLog(pMac, LOG1,FL("extSetStaKeyParamValid: %d"), pAddBssParams->extSetStaKeyParamValid); #endif @@ -4343,12 +4377,12 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); - limLog(pMac, LOG2, FL("staContext wmmEnabled: %d encryptType: %d " + limLog(pMac, LOG1, FL("staContext wmmEnabled: %d encryptType: %d " "p2pCapableSta: %d"),pAddBssParams->staContext.wmmEnabled, pAddBssParams->staContext.encryptType, pAddBssParams->staContext.p2pCapableSta); - limLog(pMac, LOG2, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " + limLog(pMac, LOG1, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " "LimMlm state to %d"), pAddBssParams->bSpectrumMgtEnabled, pAddBssParams->halPersona, psessionEntry->limMlmState); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limDebug.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limDebug.c index 7a6445dea1f8..4d2dcc5530ad 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limDebug.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limDebug.c @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limFT.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limFT.c index 7bddc4d1ec68..550448ea3456 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limFT.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limFT.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -48,10 +48,7 @@ #include #include #include "wmmApsd.h" - -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif #define LIM_FT_RIC_BA_SSN 1 #define LIM_FT_RIC_BA_DIALOG_TOKEN_TID_0 248 @@ -75,7 +72,7 @@ void limFTCleanup(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.pFTPreAuthReq) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p", + PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %pK", __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) #endif if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) @@ -92,7 +89,7 @@ void limFTCleanup(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.psavedsessionEntry) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", + PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %pK to NULL", __func__, pMac->ft.ftPEContext.psavedsessionEntry);) #endif pMac->ft.ftPEContext.psavedsessionEntry = NULL; @@ -108,11 +105,11 @@ void limFTCleanup(tpAniSirGlobal pMac) PELOGE(limLog( pMac, LOGE, "%s: Deleting Preauth Session %d", __func__, ((tpPESession)pMac->ft.ftPEContext.pftSessionEntry)->peSessionId);) peDeleteSession(pMac, pMac->ft.ftPEContext.pftSessionEntry); } - pMac->ft.ftPEContext.pftSessionEntry = NULL; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", - __func__, pMac->ft.ftPEContext.psavedsessionEntry);) + PELOGE(limLog( pMac, LOGE, "%s: Setting pftSessionEntry= %pK to NULL", + __func__, pMac->ft.ftPEContext.pftSessionEntry);) #endif + pMac->ft.ftPEContext.pftSessionEntry = NULL; } if (pMac->ft.ftPEContext.pAddBssReq) @@ -128,8 +125,7 @@ void limFTCleanup(tpAniSirGlobal pMac) pMac->ft.ftPEContext.pAddStaReq = NULL; } - pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_SUCCESS; - + vos_mem_zero(&pMac->ft.ftPEContext, sizeof(tftPEContext)); } /*-------------------------------------------------------------------------- @@ -140,7 +136,7 @@ void limFTInit(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.pFTPreAuthReq) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p", + PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %pK", __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) #endif if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) @@ -158,7 +154,7 @@ void limFTInit(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.psavedsessionEntry) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", + PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %pK to NULL", __func__, pMac->ft.ftPEContext.psavedsessionEntry);) #endif pMac->ft.ftPEContext.psavedsessionEntry = NULL; @@ -170,7 +166,7 @@ void limFTInit(tpAniSirGlobal pMac) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Deleting session = %p ", + PELOGE(limLog( pMac, LOGE, "%s: Deleting session = %pK ", __func__, pMac->ft.ftPEContext.pftSessionEntry);) #endif /* Delete the previous valid preauth pesession if it is still in @@ -195,7 +191,7 @@ void limFTInit(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.pAddBssReq) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Freeing AddBssReq = %p ", + PELOGE(limLog( pMac, LOGE, "%s: Freeing AddBssReq = %pK ", __func__, pMac->ft.ftPEContext.pAddBssReq);) #endif vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); @@ -206,7 +202,7 @@ void limFTInit(tpAniSirGlobal pMac) if (pMac->ft.ftPEContext.pAddStaReq) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: Freeing AddStaReq = %p ", + PELOGE(limLog( pMac, LOGE, "%s: Freeing AddStaReq = %pK ", __func__, pMac->ft.ftPEContext.pAddStaReq);) #endif vos_mem_free(pMac->ft.ftPEContext.pAddStaReq); @@ -275,18 +271,11 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) // Can set it only after sending auth pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_FAILURE; - if( pMac->ft.ftPEContext.pFTPreAuthReq && - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; - } - // We need information from the Pre-Auth Req. Lets save that pMac->ft.ftPEContext.pFTPreAuthReq = (tpSirFTPreAuthReq)pMsg->bodyptr; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: PE Auth ft_ies_length=%02x%02x%02x", __func__, + PELOGE(limLog( pMac, LOG1, "%s: PRE Auth ft_ies_length=%02x%02x%02x", __func__, pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[0], pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[1], pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[2]);) @@ -302,13 +291,11 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) limPrintMacAddr( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, LOGE ); // Post the FT Pre Auth Response to SME limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, NULL); - if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; - } - pMac->ft.ftPEContext.pFTPreAuthReq = NULL; - return TRUE; + + /* return FALSE, since the Pre-Auth Req will be freed in + * limPostFTPreAuthRsp on failure + */ + return bufConsumed; } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, psessionEntry, 0, 0); @@ -318,15 +305,15 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) if (psessionEntry->currentOperChannel != pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) { // Need to suspend link only if the channels are different - PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on different" - " channel (session %p)", __func__, psessionEntry);) + limLog(pMac, LOG1, FL(" Performing pre-auth on different" + " channel (session %pK)"), psessionEntry); limSuspendLink(pMac, eSIR_CHECK_ROAMING_SCAN, FTPreAuthSuspendLinkHandler, (tANI_U32 *)psessionEntry); } else { - PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on same" - " channel (session %p)", __func__, psessionEntry);) + limLog(pMac, LOG1, FL(" Performing pre-auth on same" + " channel (session %pK)"), psessionEntry); // We are in the same channel. Perform pre-auth limPerformFTPreAuth(pMac, eHAL_STATUS_SUCCESS, NULL, psessionEntry); } @@ -364,9 +351,9 @@ void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, pMac->ft.ftPEContext.psavedsessionEntry = psessionEntry; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOG2(limLog(pMac,LOG2,"Entered wait auth2 state for FT" - " (old session %p)", - pMac->ft.ftPEContext.psavedsessionEntry);) + limLog(pMac, LOG1, FL("Entered wait auth2 state for FT" + " (old session %pK)"), + pMac->ft.ftPEContext.psavedsessionEntry); #endif @@ -394,6 +381,8 @@ void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog( pMac, LOGE, "%s: FT Auth Rsp Timer Start Failed", __func__);) #endif + pMac->ft.ftPEContext.psavedsessionEntry = NULL; + goto preauth_fail; } MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_FT_PREAUTH_RSP_TIMER)); @@ -403,7 +392,7 @@ MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLI limSendAuthMgmtFrame(pMac, &authFrame, pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, - LIM_NO_WEP_IN_FC, psessionEntry); + LIM_NO_WEP_IN_FC, psessionEntry, eSIR_FALSE); return; preauth_fail: @@ -576,7 +565,8 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; } #ifdef WLAN_FEATURE_11AC - if (pftSessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) + if (pftSessionEntry->vhtCapability && + IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)) { pAddBssParams->staContext.vhtCapable = 1; if ((pBeaconStruct->VHTCaps.suBeamFormerCap || @@ -585,6 +575,12 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, { pAddBssParams->staContext.vhtTxBFCapable = 1; } + if (pBeaconStruct->VHTCaps.muBeamformerCap && + pftSessionEntry->txMuBformee ) + { + pAddBssParams->staContext.vhtTxMUBformeeCapable = 1; + limLog(pMac, LOG1, FL("Enabling MUBformee for peer")); + } } #endif if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && @@ -754,17 +750,62 @@ tpPESession limFillFTSession(tpAniSirGlobal pMac, pftSessionEntry->ssId.length); wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &selfDot11Mode); + limLog(pMac, LOG1, FL("selfDot11Mode %d"),selfDot11Mode ); pftSessionEntry->dot11mode = selfDot11Mode; - pftSessionEntry->vhtCapability = (IS_DOT11_MODE_VHT(pftSessionEntry->dot11mode) - && pBeaconStruct->VHTCaps.present); + pftSessionEntry->vhtCapability = + (IS_DOT11_MODE_VHT(pftSessionEntry->dot11mode) + && IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)); pftSessionEntry->htCapability = (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && pBeaconStruct->HTCaps.present); #ifdef WLAN_FEATURE_11AC - if ( pBeaconStruct->VHTCaps.present && pBeaconStruct->VHTOperation.present) + if (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) + && pBeaconStruct->VHTOperation.present) { pftSessionEntry->vhtCapabilityPresentInBeacon = 1; pftSessionEntry->apCenterChan = pBeaconStruct->VHTOperation.chanCenterFreqSeg1; pftSessionEntry->apChanWidth = pBeaconStruct->VHTOperation.chanWidth; + + pftSessionEntry->txBFIniFeatureEnabled = + pMac->roam.configParam.txBFEnable; + + limLog(pMac, LOG1, FL("txBFIniFeatureEnabled=%d"), + pftSessionEntry->txBFIniFeatureEnabled); + + if (pftSessionEntry->txBFIniFeatureEnabled) + { + if (cfgSetInt(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, + pftSessionEntry->txBFIniFeatureEnabled) + != eSIR_SUCCESS) + { + limLog(pMac, LOGE, FL("could not set " + "WNI_CFG_VHT_SU_BEAMFORMEE_CAP at CFG")); + } + limLog(pMac, LOG1, FL("txBFCsnValue=%d"), + pMac->roam.configParam.txBFCsnValue); + + if (cfgSetInt(pMac, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, + pMac->roam.configParam.txBFCsnValue) + != eSIR_SUCCESS) + { + limLog(pMac, LOGE, FL("could not set " + "WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED at CFG")); + } + + if (IS_MUMIMO_BFORMEE_CAPABLE) + pftSessionEntry->txMuBformee = + pMac->roam.configParam.txMuBformee; + } + + limLog(pMac, LOG1, FL("txMuBformee = %d"), + pftSessionEntry->txMuBformee); + + if (cfgSetInt(pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, + pftSessionEntry->txMuBformee) + != eSIR_SUCCESS) + { + limLog(pMac, LOGE, FL("could not set " + "WNI_CFG_VHT_MU_BEAMFORMEE_CAP at CFG")); + } } else { @@ -1053,12 +1094,12 @@ void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, VOS_ASSERT(pFTPreAuthRsp != NULL); return; } - vos_mem_zero( pFTPreAuthRsp, rspLen); + #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, FL("Auth Rsp = %p"), pFTPreAuthRsp);) + PELOGE(limLog( pMac, LOG1, FL("Auth Rsp = %pK"), pFTPreAuthRsp);) #endif - - vos_mem_set((tANI_U8*)pFTPreAuthRsp, rspLen, 0); + + vos_mem_zero(pFTPreAuthRsp, rspLen); pFTPreAuthRsp->messageType = eWNI_SME_FT_PRE_AUTH_RSP; pFTPreAuthRsp->length = (tANI_U16) rspLen; pFTPreAuthRsp->status = status; @@ -1093,7 +1134,16 @@ void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, */ } #endif - + + if (status != eSIR_SUCCESS) + { + /* Ensure that on Pre-Auth failure the cached Pre-Auth Req and + * other allocated memory is freed up before returning. + */ + limLog(pMac, LOG1, "Pre-Auth Failed, Cleanup!"); + limFTCleanup(pMac); + } + mmhMsg.type = pFTPreAuthRsp->messageType; mmhMsg.bodyptr = pFTPreAuthRsp; mmhMsg.bodyval = 0; @@ -1151,7 +1201,9 @@ void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, &sessionId, pMac->lim.maxStation)) == NULL) { limLog(pMac, LOGE, FL("Session Can not be created for pre-auth 11R AP")); - return; + status = eSIR_FAILURE; + pMac->ft.ftPEContext.ftPreAuthStatus = status; + goto out; } pftSessionEntry->peSessionId = sessionId; sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); @@ -1173,14 +1225,14 @@ void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; - PELOGE(limLog(pMac, LOG1,"%s:created session (%p) with id = %d", + PELOGE(limLog(pMac, LOG1,"%s:created session (%pK) with id = %d", __func__, pftSessionEntry, pftSessionEntry->peSessionId);) /* Update the ReAssoc BSSID of the current session */ sirCopyMacAddr(psessionEntry->limReAssocbssId, pbssDescription->bssId); limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); } - +out: if (psessionEntry->currentOperChannel != pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) { @@ -1340,9 +1392,10 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, } // Dont need this anymore pMac->ft.ftPEContext.pAddBssReq = NULL; -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_LIM_ADD_BS_REQ, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_LIM_ADD_BS_REQ, NULL, 0); + } return; } @@ -1369,11 +1422,20 @@ void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) /* To handle the race condition where we recieve preauth rsp after * timer has expired. */ + + if (pMac->ft.ftPEContext.pFTPreAuthReq == NULL) + { + limLog(pMac, LOGE, FL("Auth Rsp might already be posted to SME" + " and ftcleanup done! sessionId:%d"), + pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId); + return; + } + if (eANI_BOOLEAN_TRUE == pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed) { limLog(pMac,LOGE,FL("Auth rsp already posted to SME" - " (session %p)"), psessionEntry); + " (session %pK)"), psessionEntry); return; } else @@ -1386,7 +1448,7 @@ void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) * limProcessAuthFrameNoSession. */ limLog(pMac,LOG1,FL("Auth rsp not yet posted to SME" - " (session %p)"), psessionEntry); + " (session %pK)"), psessionEntry); pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = eANI_BOOLEAN_TRUE; } @@ -1433,37 +1495,14 @@ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) } pAddBssParams->extSetStaKeyParam.singleTidRc = val; - PELOG1(limLog(pMac, LOG1, FL("Key valid %d"), + limLog(pMac, LOG1, FL("Key valid %d key len = %d"), pAddBssParams->extSetStaKeyParamValid, - pAddBssParams->extSetStaKeyParam.key[0].keyLength);) + pAddBssParams->extSetStaKeyParam.key[0].keyLength); pAddBssParams->extSetStaKeyParam.staIdx = 0; - PELOG1(limLog(pMac, LOG1, - FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId));) - - if(pAddBssParams->extSetStaKeyParam.key[0].keyLength == 16) - { - PELOG1(limLog(pMac, LOG1, - FL("BSS key = %02X-%02X-%02X-%02X-%02X-%02X-%02X- " - "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X"), - pAddBssParams->extSetStaKeyParam.key[0].key[0], - pAddBssParams->extSetStaKeyParam.key[0].key[1], - pAddBssParams->extSetStaKeyParam.key[0].key[2], - pAddBssParams->extSetStaKeyParam.key[0].key[3], - pAddBssParams->extSetStaKeyParam.key[0].key[4], - pAddBssParams->extSetStaKeyParam.key[0].key[5], - pAddBssParams->extSetStaKeyParam.key[0].key[6], - pAddBssParams->extSetStaKeyParam.key[0].key[7], - pAddBssParams->extSetStaKeyParam.key[0].key[8], - pAddBssParams->extSetStaKeyParam.key[0].key[9], - pAddBssParams->extSetStaKeyParam.key[0].key[10], - pAddBssParams->extSetStaKeyParam.key[0].key[11], - pAddBssParams->extSetStaKeyParam.key[0].key[12], - pAddBssParams->extSetStaKeyParam.key[0].key[13], - pAddBssParams->extSetStaKeyParam.key[0].key[14], - pAddBssParams->extSetStaKeyParam.key[0].key[15]);) - } + limLog(pMac, LOG1, + FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId)); return TRUE; } @@ -1649,7 +1688,7 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) tpPESession psessionEntry = NULL; int i = 0; - PELOG1(limLog(pMac, LOG1, FL(" Received AGGR_QOS_RSP from HAL"));) + limLog(pMac, LOG1, FL(" Received AGGR_QOS_RSP from HAL")); /* Need to process all the deferred messages enqueued since sending the SIR_HAL_AGGR_ADD_TS_REQ */ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c index 2a3477d7d634..f8f66fc4cec6 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -40,7 +40,7 @@ #include "palTypes.h" #include "aniGlobal.h" #include "sirCommon.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "limUtils.h" #include "limAssocUtils.h" #include "limStaHashApi.h" @@ -205,7 +205,7 @@ ibss_peer_collect( /* Collect peer VHT capabilities based on the received beacon from the peer */ #ifdef WLAN_FEATURE_11AC - if ( pBeacon->VHTCaps.present ) + if (IS_BSS_VHT_CAPABLE(pBeacon->VHTCaps)) { pPeer->vhtSupportedChannelWidthSet = pBeacon->VHTOperation.chanWidth; pPeer->vhtCapable = pBeacon->VHTCaps.present; @@ -259,6 +259,7 @@ ibss_sta_caps_update( { pStaDs->htGreenfield = pPeerNode->htGreenfield; pStaDs->htSupportedChannelWidthSet = pPeerNode->htSupportedChannelWidthSet; + pStaDs->htSecondaryChannelOffset = pPeerNode->htSecondaryChannelOffset; pStaDs->htMIMOPSState = pPeerNode->htMIMOPSState; pStaDs->htMaxAmsduLength = pPeerNode->htMaxAmsduLength; pStaDs->htAMpduDensity = pPeerNode->htAMpduDensity; @@ -656,7 +657,7 @@ ibss_bss_add( (tANI_U8 *) &psessionEntry->pLimStartBssReq->ssId, psessionEntry->pLimStartBssReq->ssId.length + 1); - PELOG1(limLog(pMac, LOG1, FL("invoking ADD_BSS as part of coalescing!"));) + limLog(pMac, LOG1, FL("invoking ADD_BSS as part of coalescing!")); if (limMlmAddBss(pMac, &mlmStartReq,psessionEntry) != eSIR_SME_SUCCESS) { PELOGE(limLog(pMac, LOGE, FL("AddBss failure"));) @@ -905,7 +906,7 @@ limIbssSetProtection(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams p if(!pMac->lim.cfgProtection.fromllb) { - PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) + limLog(pMac, LOG1, FL("protection from 11b is disabled")); return; } @@ -946,21 +947,21 @@ limIbssUpdateProtectionParams(tpAniSirGlobal pMac, { tANI_U32 i; - PELOG1(limLog(pMac,LOG1, FL("A STA is associated:")); + limLog(pMac,LOG1, FL("A STA is associated:")); limLog(pMac,LOG1, FL("Addr : ")); - limPrintMacAddr(pMac, peerMacAddr, LOG1);) + limPrintMacAddr(pMac, peerMacAddr, LOG1); for (i=0; ilim.protStaCache[i].active) { - PELOG1(limLog(pMac, LOG1, FL("Addr: "));) - PELOG1(limPrintMacAddr(pMac, pMac->lim.protStaCache[i].addr, LOG1);) + limLog(pMac, LOG1, FL("Addr: ")); + limPrintMacAddr(pMac, pMac->lim.protStaCache[i].addr, LOG1); if (vos_mem_compare(pMac->lim.protStaCache[i].addr, peerMacAddr, sizeof(tSirMacAddr))) { - PELOG1(limLog(pMac, LOG1, FL("matching cache entry at %d already active."), i);) + limLog(pMac, LOG1, FL("matching cache entry at %d already active."), i); return; } } @@ -1460,7 +1461,7 @@ limIbssCoalesce( tSirMacAddr currentBssId; tLimIbssPeerNode *pPeerNode; tpDphHashNode pStaDs; - tUpdateBeaconParams beaconParams; + tUpdateBeaconParams beaconParams; vos_mem_set((tANI_U8 *)&beaconParams, sizeof(tUpdateBeaconParams), 0); @@ -1533,8 +1534,12 @@ limIbssCoalesce( * pMac->lim.gLimIbssStaLimit */ if ((pMac->lim.gLimNumIbssPeers+1) >= pMac->lim.gLimIbssStaLimit) - { - PELOGE(limLog(pMac, LOGE, FL("**** MAX STA LIMIT HAS REACHED ****"));) + { /*Print every 100th time */ + if (pMac->lim.gLimIbssRetryCnt % 100 == 0) + { + limLog(pMac, LOG1, FL("**** MAX STA LIMIT HAS REACHED ****")); + } + pMac->lim.gLimIbssRetryCnt++; return eSIR_LIM_MAX_STA_REACHED_ERROR; } PELOGW(limLog(pMac, LOGW, FL("IBSS Peer node does not exist, adding it***"));) @@ -1568,8 +1573,8 @@ limIbssCoalesce( if (pStaDs != NULL) { /// DPH node already exists for the peer - PELOGW(limLog(pMac, LOGW, FL("DPH Node present for just learned peer"));) - PELOG1(limPrintMacAddr(pMac, pPeerNode->peerMacAddr, LOG1);) + limLog(pMac, LOG1, FL("DPH Node present for just learned peer")); + limPrintMacAddr(pMac, pPeerNode->peerMacAddr, LOG1); ibss_sta_info_update(pMac, pStaDs, pPeerNode,psessionEntry); return eSIR_SUCCESS; } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c index acd75232c791..25fc44bdbac8 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" @@ -144,8 +144,8 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg) if((eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) || (eLIM_AP_ROLE == psessionEntry->limSystemRole)) { - PELOG1(limLog(pMac, LOG1, FL("SAP:lim Delete Station Context (staId: %d, assocId: %d) "), - pMsg->staId, pMsg->assocId);) + limLog(pMac, LOG1, FL("SAP:lim Delete Station Context (staId: %d, assocId: %d) "), + pMsg->staId, pMsg->assocId); /* * Check if Deauth/Disassoc is triggered from Host. * If mlmState is in some transient state then @@ -222,17 +222,18 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg) sirCopyMacAddr(pMac->lim.gLimHeartBeatApMac[apCount],pStaDs->staAddr); } - pStaDs->mlmStaContext.disassocReason = eSIR_MAC_UNSPEC_FAILURE_REASON; + pStaDs->mlmStaContext.disassocReason = + eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON; pStaDs->mlmStaContext.cleanupTrigger = eLIM_LINK_MONITORING_DEAUTH; - /** Set state to mlm State to eLIM_MLM_WT_DEL_STA_RSP_STATE - * This is to address the issue of race condition between - * disconnect request from the HDD and deauth from - * Tx inactivity timer by FWR. This will make sure that we will not - * process disassoc if deauth is in progress for the station - * and thus mlmStaContext.cleanupTrigger will not be overwritten. - */ - pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; + if (pStaDs->isDisassocDeauthInProgress) + { + limLog(pMac, LOGE, FL("No need to cleanup as already" + "disassoc or deauth in progress")); + return; + } + else + pStaDs->isDisassocDeauthInProgress++; // Issue Deauth Indication to SME. vos_mem_copy((tANI_U8 *) &mlmDeauthInd.peerMacAddr, @@ -299,6 +300,17 @@ limTriggerSTAdeletion(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession pse PELOGW(limLog(pMac, LOGW, FL("Skip STA deletion (invalid STA)"));) return; } + + if (pStaDs->sta_deletion_in_progress) { + /* Already in the process of deleting context for the peer */ + limLog(pMac, LOG1, + FL("Deletion is in progress (%d) for peer:%pK in mlmState %d"), + pStaDs->sta_deletion_in_progress, pStaDs->staAddr, + pStaDs->mlmStaContext.mlmState); + return; + } + pStaDs->sta_deletion_in_progress = true; + /** * MAC based Authentication was used. Trigger * Deauthentication frame to peer since it will @@ -345,7 +357,8 @@ limTriggerSTAdeletion(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession pse msgLength += sizeof(tSirMacAddr); //reasonCode - limCopyU16((tANI_U8*)pBuf, (tANI_U16)eLIM_LINK_MONITORING_DISASSOC); + limCopyU16((tANI_U8*)pBuf, + (tANI_U16)eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON); pBuf += sizeof(tANI_U16); msgLength += sizeof(tANI_U16); @@ -566,8 +579,8 @@ void limHandleHeartBeatFailure(tpAniSirGlobal pMac,tpPESession psessionEntry) * or in states other than link-established state. * Log error. */ - PELOG1(limLog(pMac, LOG1, FL("received heartbeat timeout in state %d"), - psessionEntry->limMlmState);) + limLog(pMac, LOG1, FL("received heartbeat timeout in state %d"), + psessionEntry->limMlmState); limPrintMlmState(pMac, LOG1, psessionEntry->limMlmState); pMac->lim.gLimHBfailureCntInOtherStates++; limReactivateHeartBeatTimer(pMac, psessionEntry); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limLogDump.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limLogDump.c index a43afa0a7d26..51f5572ff0ab 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limLogDump.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limLogDump.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2016-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ limLogDump.c Implements the dump commands specific to the lim module. -Copyright (c) 2007 QUALCOMM Incorporated. -All Rights Reserved. -Qualcomm Confidential and Proprietary ============================================================================*/ #include "vos_types.h" @@ -724,6 +721,8 @@ void limSetEdcaBcastACMFlag(tpAniSirGlobal pMac, tANI_U32 ac, tANI_U32 acmFlag) { tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry????? + if (ac >= MAX_NUM_AC) + return; psessionEntry->gLimEdcaParamsBC[ac].aci.acm = (tANI_U8)acmFlag; psessionEntry->gLimEdcaParamSetCount++; schSetFixedBeaconFields(pMac,psessionEntry); @@ -2139,7 +2138,7 @@ dump_lim_ft_event( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 a p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x\n", __func__, psessionEntry->bssId[0], psessionEntry->bssId[1], psessionEntry->bssId[2]); - p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %p\n", __func__, + p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %pK\n", __func__, pftPreAuthReq->currbssId[0], pftPreAuthReq->currbssId[1], pftPreAuthReq->currbssId[2], pftPreAuthReq); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limP2P.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limP2P.c index f31f324fcbc0..8679a31fd008 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limP2P.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limP2P.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ This software unit holds the implementation of the WLAN Protocol Engine for P2P. - Copyright (c) 2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -89,7 +86,7 @@ extern tSirRetStatus limSetLinkState( tpSetLinkStateCallback callback, void *callbackArg); static tSirRetStatus limCreateSessionForRemainOnChn(tpAniSirGlobal pMac, tPESession **ppP2pSession); -eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess); +eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, void *pData); /*---------------------------------------------------------------------------- * @@ -673,6 +670,8 @@ void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) tANI_U8 sessionId; tSirRemainOnChnReq *MsgRemainonChannel = pMac->lim.gpLimRemainOnChanReq; tSirMacAddr nullBssid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + tANI_U32 txStatus = 0; + tSirTxBdStatus txBdStatus = {0}; if ( NULL == MsgRemainonChannel ) { @@ -687,9 +686,6 @@ void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) //Cleanup Everything if(eHAL_STATUS_FAILURE == status) { - //Deactivate Remain on Channel Timer - limDeactivateAndChangeTimer(pMac, eLIM_REMAIN_CHN_TIMER); - //Set the Link State to Idle /* get the previous valid LINK state */ if (limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, nullBssid, @@ -700,6 +696,7 @@ void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) pMac->lim.gLimSystemInScanLearnMode = 0; pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; + SET_LIM_PROCESS_DEFD_MESGS(pMac, true); } /* delete the session */ @@ -725,9 +722,13 @@ void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) * indicaiton confirmation with status failure */ if (pMac->lim.mgmtFrameSessionId != 0xff) { - limLog(pMac, LOGE, - FL("Remain on channel expired, Action frame status failure")); - limP2PActionCnf(pMac, 0); + limLog(pMac, LOGE, + FL("Remain on channel expired, Action frame status failure")); + + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + limP2PActionCnf(pMac, &txBdStatus); + else + limP2PActionCnf(pMac, &txStatus); } return; @@ -744,7 +745,6 @@ void limSendSmeMgmtFrameInd( tANI_U8 *pRxPacketInfo, tpPESession psessionEntry, tANI_S8 rxRssi) { - tSirMsgQ mmhMsg; tpSirSmeMgmtFrameInd pSirSmeMgmtFrame = NULL; tANI_U16 length; tANI_U8 frameType; @@ -769,8 +769,7 @@ void limSendSmeMgmtFrameInd( } vos_mem_set((void*)pSirSmeMgmtFrame, length, 0); - pSirSmeMgmtFrame->mesgType = eWNI_SME_MGMT_FRM_IND; - pSirSmeMgmtFrame->mesgLen = length; + pSirSmeMgmtFrame->frameLen = frameLen; pSirSmeMgmtFrame->sessionId = sessionId; pSirSmeMgmtFrame->frameType = frameType; pSirSmeMgmtFrame->rxRssi = rxRssi; @@ -830,20 +829,49 @@ void limSendSmeMgmtFrameInd( vos_mem_zero(pSirSmeMgmtFrame->frameBuf, frameLen); vos_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen); - mmhMsg.type = eWNI_SME_MGMT_FRM_IND; - mmhMsg.bodyptr = pSirSmeMgmtFrame; - mmhMsg.bodyval = 0; - - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); + if (pMac->mgmt_frame_ind_cb) + pMac->mgmt_frame_ind_cb(pSirSmeMgmtFrame); + else + { + limLog(pMac, LOGW, + FL("Management indication callback not registered!!")); + } + vos_mem_free(pSirSmeMgmtFrame); return; } /*** end limSendSmeListenRsp() ***/ -eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) +eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, void *pData) { - limLog(pMac, LOG1, - FL(" %s txCompleteSuccess %d, Session Id %d"), - __func__, txCompleteSuccess, pMac->lim.mgmtFrameSessionId); + tANI_U32 txCompleteSuccess; + tpSirTxBdStatus pTxBdStatus; + + if (!pData) + { + limLog(pMac, LOG1, + FL(" pData is NULL")); + return eHAL_STATUS_FAILURE; + } + + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + pTxBdStatus = (tpSirTxBdStatus) pData; + txCompleteSuccess = pTxBdStatus->txCompleteStatus; + + limLog(pMac, LOG1, + FL("txCompleteSuccess %d, Token %u, Session Id %d"), + txCompleteSuccess, pTxBdStatus->txBdToken, + pMac->lim.mgmtFrameSessionId); + } + else + { + txCompleteSuccess = *((tANI_U32*) pData); + + limLog(pMac, LOG1, + FL(" %s txCompleteSuccess %d, Session Id %d"), + __func__, txCompleteSuccess, pMac->lim.mgmtFrameSessionId); + } + if (pMac->lim.mgmtFrameSessionId != 0xff) { /* The session entry might be invalid(0xff) action confirmation received after @@ -864,9 +892,10 @@ void limSetHtCaps(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U8 *pIeSt tDot11fIEHTCaps dot11HtCap; PopulateDot11fHTCaps(pMac, psessionEntry, &dot11HtCap); + pIe = limGetIEPtr(pMac,pIeStartPtr, nBytes, DOT11F_EID_HTCAPS,ONE_BYTE); - limLog( pMac, LOG2, FL("pIe %p dot11HtCap.supportedMCSSet[0]=0x%x"), + limLog( pMac, LOG2, FL("pIe %pK dot11HtCap.supportedMCSSet[0]=0x%x"), pIe, dot11HtCap.supportedMCSSet[0]); if(pIe) { @@ -1080,7 +1109,7 @@ void limSendP2PActionFrame(tpAniSirGlobal pMac, tpSirMsgQ pMsg) } nBytes += noaLen; limLog( pMac, LOGE, - FL("noaLen=%d origLen=%d pP2PIe=%p" + FL("noaLen=%d origLen=%d pP2PIe=%pK" " nBytes=%d nBytesToCopy=%zu"), noaLen,origLen, pP2PIe, nBytes, ((pP2PIe + origLen + 2) - (v_U8_t *)pMbMsg->data)); @@ -1098,7 +1127,7 @@ void limSendP2PActionFrame(tpAniSirGlobal pMac, tpSirMsgQ pMsg) if (pMac->lim.gpLimRemainOnChanReq == NULL) { limLog( pMac, LOGE, - FL("Failed to Send Action frame \n")); + FL("Failed to Send Action frame")); limSendSmeRsp(pMac, eWNI_SME_ACTION_FRAME_SEND_CNF, eHAL_STATUS_FAILURE, pMbMsg->sessionId, 0); return; @@ -1138,58 +1167,19 @@ void limSendP2PActionFrame(tpAniSirGlobal pMac, tpSirMsgQ pMsg) #ifdef WLAN_FEATURE_11W pActionHdr = (tpSirMacActionFrameHdr) (pFrame + sizeof(tSirMacMgmtHdr)); + pMacHdr = (tpSirMacMgmtHdr)pFrame; /* - * Setting Protected bit for SA_QUERY Action Frame + * Setting Protected bit only for Robust Action Frames * This has to be based on the current Connection with the station - * limSetProtectedBit API will set the protected bit if connection if PMF + * limSetProtectedBit API will set the protected bit if connection is PMF */ - if ((SIR_MAC_MGMT_ACTION == pFc->subType) && - (SIR_MAC_ACTION_SA_QUERY == pActionHdr->category)) - { - pMacHdr = (tpSirMacMgmtHdr ) pFrame; - psessionEntry = peFindSessionByBssid(pMac, - (tANI_U8*)pMbMsg->data + BSSID_OFFSET, &sessionId); - - /* Check for session corresponding to ADDR2 ss supplicant is filling - ADDR2 with BSSID */ - if(NULL == psessionEntry) - { - psessionEntry = peFindSessionByBssid(pMac, - (tANI_U8*)pMbMsg->data + ADDR2_OFFSET, &sessionId); - } + psessionEntry->limRmfEnabled && (!limIsGroupAddr(pMacHdr->da)) && + lim_is_robust_mgmt_action_frame(pActionHdr->category)) { + /* All psession checks are already done at start */ + limSetProtectedBit(pMac, psessionEntry, pMacHdr->da, pMacHdr); - if(NULL != psessionEntry) - { - limSetProtectedBit(pMac, psessionEntry, pMacHdr->da, pMacHdr); - } - else - { - limLog(pMac, LOGE, - FL("Dropping SA Query frame - Unable to find PE Session \n")); - limSendSmeRsp(pMac, eWNI_SME_ACTION_FRAME_SEND_CNF, - eHAL_STATUS_FAILURE, pMbMsg->sessionId, 0); - palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, - ( void* ) pFrame, ( void* ) pPacket ); - return; - } - - /* - * If wep bit is not set in MAC header then we are trying to - * send SA Query via non PMF connection. Drop the packet. - */ - - if(0 == pMacHdr->fc.wep) - { - limLog(pMac, LOGE, - FL("Dropping SA Query frame due to non PMF connection\n")); - limSendSmeRsp(pMac, eWNI_SME_ACTION_FRAME_SEND_CNF, - eHAL_STATUS_FAILURE, pMbMsg->sessionId, 0); - palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, - ( void* ) pFrame, ( void* ) pPacket ); - return; - } } #endif @@ -1226,7 +1216,7 @@ void limSendP2PActionFrame(tpAniSirGlobal pMac, tpSirMsgQ pMsg) halstatus = halTxFrameWithTxComplete( pMac, pPacket, (tANI_U16)nBytes, HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,/*SMAC_SWBD_TX_TID_MGMT_HIGH */ limTxComplete, pFrame, - limP2PActionCnf, txFlag ); + limP2PActionCnf, txFlag, pMac->lim.txBdToken++ ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessActionFrame.c index f0b4cdd7b1ee..f0fbc5ea84ea 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessActionFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessActionFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016, 2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,7 +42,7 @@ #include "wniApi.h" #include "sirApi.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "schApi.h" #include "utilsApi.h" #include "limTypes.h" @@ -100,8 +100,8 @@ void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) return; } - PELOG1(limLog(pMac, LOG1, FL("Channel switch Mode == %d"), - psessionEntry->gLimChannelSwitch.switchMode);) + limLog(pMac, LOG1, FL("Channel switch Mode == %d"), + psessionEntry->gLimChannelSwitch.switchMode); if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT || psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT) @@ -165,7 +165,7 @@ void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) ------------------------------------------------------------*/ tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) { - PELOG1(limLog(pMac, LOG1, FL("Starting the channel switch"));) + limLog(pMac, LOG1, FL(" ENTER")); /*If channel switch is already running and it is on a different session, just return*/ /*This need to be removed for MCC */ @@ -259,7 +259,7 @@ __limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - PELOG3(limLog(pMac, LOG3, FL("Received Channel switch action frame"));) + limLog(pMac, LOG1, FL("Received Channel switch action frame")); if (!psessionEntry->lim11hEnable) return; @@ -323,8 +323,8 @@ __limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo } #endif - PELOG3(limLog(pMac, LOG3, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"), - psessionEntry->gLimChannelSwitch.switchTimeoutValue);) + limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"), + psessionEntry->gLimChannelSwitch.switchTimeoutValue); /* Only primary channel switch element is present */ psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; @@ -362,12 +362,12 @@ __limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo } else { - PELOG1(limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));) + limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping...")); } if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry)) { - PELOG1(limLog(pMac, LOG1, FL("Could not start channel switch"));) + limLog(pMac, LOG1, FL("Could not start channel switch")); } vos_mem_free(pChannelSwitchFrame); @@ -451,6 +451,11 @@ __limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo frameLen); } pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); + if (pSta == NULL) + { + PELOGE(limLog(pMac, LOGE, FL("Station context not found"));) + return; + } operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ; if( operMode != pOperatingModeframe->OperatingMode.chanWidth) @@ -758,15 +763,15 @@ __limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pse PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));) return; } - PELOG2(limLog(pMac, LOG2, FL("WME Delts received"));) + limLog(pMac, LOG1, FL("WME Delts received")); } else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled) { - PELOG2(limLog(pMac, LOG2, FL("11e QoS Delts received"));) + limLog(pMac, LOG1, FL("11e QoS Delts received")); } else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled) { - PELOG2(limLog(pMac, LOG2, FL("WSM Delts received"));) + limLog(pMac, LOG1, FL("WSM Delts received")); } else { @@ -871,7 +876,7 @@ __limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pse else limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); - PELOG1(limLog(pMac, LOG1, FL("DeleteTS succeeded"));) + limLog(pMac, LOG1, FL("DeleteTS succeeded")); #ifdef FEATURE_WLAN_ESE #ifdef FEATURE_WLAN_ESE_UPLOAD @@ -902,7 +907,8 @@ __limProcessQosMapConfigureFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, FL("QosMapConfigure frame parsing failed (error %d)"), retval);) return; } - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, psessionEntry, 0); + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, 0); } #ifdef ANI_SUPPORT_11H @@ -1073,8 +1079,8 @@ __limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) break; default: - PELOG1(limLog(pMac, LOG1, FL("Unknown Measurement Type %d "), - pMeasReqFrame->measReqIE.measType);) + limLog(pMac, LOG1, FL("Unknown Measurement Type %d "), + pMeasReqFrame->measReqIE.measType); break; } @@ -1106,7 +1112,7 @@ __limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - PELOG1(limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));) + limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****")); pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame )); if (NULL == pTpcReqFrame) @@ -1131,7 +1137,7 @@ __limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) } } #endif - +#include "dot11f.h" /** * \brief Validate an ADDBA Req from peer with respect @@ -1206,6 +1212,9 @@ __limValidateDelBAParameterSet( tpAniSirGlobal pMac, { tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS; + if (!(baParameterSet.tid < STACFG_MAX_TC)) + return statusCode; + // Validate if a BA is active for the requested TID if( pSta->tcCfg[baParameterSet.tid].fUseBATx || pSta->tcCfg[baParameterSet.tid].fUseBARx ) @@ -1306,6 +1315,8 @@ __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps if (!(IS_HWSTA_IDX(pSta->staIndex))) { status = eSIR_MAC_REQ_DECLINED_STATUS; + limLog( pMac, LOGE, + FL( "Sta Id is not HW Sta Id, Status code is %d " ), status); goto returnAfterError; } #endif //WLAN_SOFTAP_VSTA_FEATURE @@ -1334,7 +1345,11 @@ __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps frmAddBAReq.AddBAParameterSet, 0, //dialogue token is don't care in request validation. LIM_ADDBA_REQ, &delBAFlag))) + { + limLog( pMac, LOGE, + FL( "ADDBA parameters validation failed with status %d" ), status); goto returnAfterError; + } //BA already set, so we need to delete it before adding new one. if(delBAFlag) @@ -1345,6 +1360,9 @@ __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps eBA_RECIPIENT,psessionEntry)) { status = eSIR_MAC_UNSPEC_FAILURE_STATUS; + limLog( pMac, LOGE, + FL( "Deletion of Existing BA session failed with status %d" ), + status); goto returnAfterError; } } @@ -1395,7 +1413,12 @@ __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps frmAddBAReq.BATimeout.timeout, (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn, eBA_RECIPIENT,psessionEntry)) - status = eSIR_MAC_UNSPEC_FAILURE_STATUS; + { + status = eSIR_MAC_UNSPEC_FAILURE_STATUS; + limLog( pMac, LOGE, + FL( "Request to setup new BA session with peer " + " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr)); + } else return; @@ -1463,6 +1486,7 @@ tANI_U8 *pBody; // Request, so we should never be processing a ADDBA Response if (!(IS_HWSTA_IDX(pSta->staIndex))) { + limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " )); return; } #endif //WLAN_SOFTAP_VSTA_FEATURE @@ -1530,7 +1554,11 @@ tANI_U8 *pBody; frmAddBARsp.AddBAParameterSet, (tANI_U8)frmAddBARsp.DialogToken.token, LIM_ADDBA_RSP, NULL)) - goto returnAfterError; + { + limLog( pMac, LOGE, + FL( "ADDBA parameters validation failed" )); + goto returnAfterError; + } } else goto returnAfterError; @@ -1553,7 +1581,12 @@ tANI_U8 *pBody; frmAddBARsp.BATimeout.timeout, 0, eBA_INITIATOR,psessionEntry)) - reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; + { + reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; + limLog( pMac, LOGE, + FL( "Request to setup new BA session with peer " + " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr)); + } else return; @@ -1656,8 +1689,11 @@ tANI_U8 *pBody; if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac, frmDelBAInd.DelBAParameterSet, pSta )) + { + limLog( pMac, LOGE, + FL( "ADDBA parameters validation failed " )); return; - + } // // Post WDA_DELBA_IND to HAL and delete the // existing BA session @@ -1866,6 +1902,141 @@ __limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESes #endif +#ifdef WLAN_FEATURE_AP_HT40_24G +static void +__limProcess2040bssCoexistenceActionFrame(tpAniSirGlobal pMac, + tANI_U16 sessionId, tANI_U8 *pRxPacketInfo, + tpPESession psessionEntry) +{ + tpSirMacMgmtHdr pHdr; + tANI_U8 *pBody , i; + tANI_U32 frameLen, nStatus; + tDot11fHT2040BSSCoexistenceManagementActionFrame *pFrm; + tpSirHT2040CoexInfoInd pSirSmeHT2040CoexInfoInd = NULL; + tANI_U16 length; + tSirMsgQ mmhMsg; + tANI_U8 num_channelList; + + pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); + pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); + frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); + + pFrm = + vos_mem_malloc(sizeof(tDot11fHT2040BSSCoexistenceManagementActionFrame)); + + if (NULL == pFrm) + { + limLog(pMac, LOGE, FL("Unable to allocate memory")); + return; + } + + if(psessionEntry == NULL) + { + vos_mem_free(pFrm); + return; + } + + /**Unpack the received frame */ + nStatus = dot11fUnpackHT2040BSSCoexistenceManagementActionFrame( pMac, + pBody, frameLen, pFrm ); + + if( DOT11F_FAILED( nStatus )) + { + limLog( pMac, LOGE, FL( "Failed to unpack and parse a 20/40" + "Coex Action Frame (0x%08x, %d bytes):"), + nStatus, frameLen ); + PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) + vos_mem_free(pFrm); + return; + } + else if ( DOT11F_WARNED( nStatus )) + { + limLog(pMac, LOGW, FL( "There were warnings while unpacking a" + " 20/40 Coex Action Frame (0x%08x, %d bytes):"), + nStatus, frameLen ); + PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) + } + + num_channelList = pFrm->HT2040BSSIntolerantReport.num_channelList; + + if (num_channelList > 0) + { + length = (sizeof(tSirHT2040CoexInfoInd) - sizeof(tANI_U8) + + (num_channelList * sizeof(tANI_U8))); + } + else + length = sizeof(tSirHT2040CoexInfoInd); + + limLog(pMac, LOGW,FL("tSirHT2040CoexInfoInd: Length: %d"),length); + + pSirSmeHT2040CoexInfoInd = vos_mem_malloc(length); + + if (NULL == pSirSmeHT2040CoexInfoInd) + { + limLog(pMac, LOGP, + FL("AllocateMemory failed for eWNI_SME_2040_COEX_IND")); + vos_mem_free(pFrm); + return; + } + + vos_mem_set((void*)pSirSmeHT2040CoexInfoInd, length, 0); + + pSirSmeHT2040CoexInfoInd->messageType = eWNI_SME_2040_COEX_IND; + pSirSmeHT2040CoexInfoInd->sessionId = sessionId; + pSirSmeHT2040CoexInfoInd->length = length; + + if (pFrm->HT2040BSSCoexistence.present) + { + + limLog(pMac, LOGW, FL("infoRequest: %d fortyMHzIntolerant: %d" + " twentyMHzBssWidthReq: %d obssScanExemptionReq: %d" + " obssScanExemptionGrant: %d "), + pFrm->HT2040BSSCoexistence.infoRequest, + pFrm->HT2040BSSCoexistence.fortyMHzIntolerant, + pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq, + pFrm->HT2040BSSCoexistence.obssScanExemptionReq, + pFrm->HT2040BSSCoexistence.obssScanExemptionGrant); + + pSirSmeHT2040CoexInfoInd->HT40MHzIntolerant = + pFrm->HT2040BSSCoexistence.fortyMHzIntolerant; + pSirSmeHT2040CoexInfoInd->HT20MHzBssWidthReq = + pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq; + } + + if (pFrm->HT2040BSSIntolerantReport.present) + { + limLog(pMac, LOGW, FL("operatingClass: %d num_channelList: %d "), + pFrm->HT2040BSSIntolerantReport.operatingClass, + num_channelList); + + if (num_channelList > 0) + { + vos_mem_zero(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport, + num_channelList); + vos_mem_copy(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport, + pFrm->HT2040BSSIntolerantReport.channelList, + num_channelList); + + pSirSmeHT2040CoexInfoInd->channel_num = num_channelList; + } + + for(i=0; i < num_channelList; i++) + { + limLog(pMac, LOGW, FL("Channel : %d "), + pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i]); + } + } + + mmhMsg.type = eWNI_SME_2040_COEX_IND; + mmhMsg.bodyptr = pSirSmeHT2040CoexInfoInd; + mmhMsg.bodyval = 0; + limLog(pMac, LOGW, FL("Posting eWNI_SME_2040_COEX_IND Message to SME ")); + limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); + + vos_mem_free(pFrm); +} +#endif + #ifdef WLAN_FEATURE_11W /** * limProcessSAQueryRequestActionFrame @@ -1891,6 +2062,7 @@ static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 * tpSirMacMgmtHdr pHdr; tANI_U8 *pBody; tANI_U8 transId[2]; + uint32_t frame_len; /* Prima --- Below Macro not available in prima pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd); @@ -1898,7 +2070,13 @@ static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 * pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); + frame_len = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + if (frame_len < sizeof(struct sDot11fSaQueryReq)) { + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, + ("Invalid frame length")); + return; + } /* If this is an unprotected SA Query Request, then ignore it. */ if (pHdr->fc.wep == 0) return; @@ -1947,17 +2125,25 @@ static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 tANI_U16 aid; tANI_U16 transId; tANI_U8 retryNum; + uint32_t frame_len; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); + frame_len = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("SA Query Response received...")) ; + if (frame_len < sizeof(struct sDot11fSaQueryRsp)) { + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, + ("Invalid frame length")); + return; + } /* When a station, supplicant handles SA Query Response. Forward to SME to HDD to wpa_supplicant. */ if (eLIM_STA_ROLE == psessionEntry->limSystemRole) { - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, psessionEntry, 0); + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, 0); return; } @@ -2078,15 +2264,20 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody; #ifdef WLAN_FEATURE_11W tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); + + if (lim_is_robust_mgmt_action_frame(pActionHdr->category) && + limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, + pActionHdr->category)) { + limLog(pMac, LOGE, + FL("Don't send unprotect action frame to upper layer categ %d "), + pActionHdr->category); + return; + } #endif switch (pActionHdr->category) { case SIR_MAC_ACTION_QOS_MGMT: -#ifdef WLAN_FEATURE_11W - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; -#endif if ( (psessionEntry->limQosEnabled) || (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) ) { @@ -2108,7 +2299,9 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); break; default: - PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);) + limLog(pMac, LOG1, + FL("Qos action %d not handled"), + pActionHdr->actionID); break; } break ; @@ -2117,10 +2310,6 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps break; case SIR_MAC_ACTION_SPECTRUM_MGMT: -#ifdef WLAN_FEATURE_11W - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; -#endif switch (pActionHdr->actionID) { #ifdef ANI_SUPPORT_11H @@ -2150,7 +2339,9 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps } break; default: - PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);) + limLog(pMac, LOG1, + FL("Spectrum mgmt action id %d not handled"), + pActionHdr->actionID); break; } break; @@ -2181,17 +2372,14 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps break; default: - PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);) + limLog(pMac, LOG1, FL("WME action %d not handled"), + pActionHdr->actionID); break; } break; case SIR_MAC_ACTION_BLKACK: // Determine the "type" of BA Action Frame -#ifdef WLAN_FEATURE_11W - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; -#endif switch(pActionHdr->actionID) { case SIR_MAC_BLKACK_ADD_REQ: @@ -2218,17 +2406,15 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); break; default: - PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);) + limLog(pMac, LOG1, + FL("Action ID %d not handled in HT Action category"), + pActionHdr->actionID); break; } break; case SIR_MAC_ACTION_WNM: { -#ifdef WLAN_FEATURE_11W - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; -#endif PELOGE(limLog(pMac, LOG1, FL("WNM Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);) switch (pActionHdr->actionID) @@ -2243,7 +2429,8 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps tANI_S8 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); /* Forward to the SME to HDD to wpa_supplicant */ - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, rssi); break; } @@ -2252,10 +2439,6 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps } #if defined WLAN_FEATURE_VOWIFI case SIR_MAC_ACTION_RRM: -#ifdef WLAN_FEATURE_11W - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; -#endif if( pMac->rrm.rrmPEContext.rrmEnable ) { switch(pActionHdr->actionID) { @@ -2269,7 +2452,8 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry ); break; default: - PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);) + limLog( pMac, LOG1, FL("Action ID %d not handled in RRM"), + pActionHdr->actionID); break; } @@ -2277,7 +2461,8 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps else { // Else we will just ignore the RRM messages. - PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));) + limLog( pMac, LOG1, + FL("RRM Action frame ignored as RRM is disabled in cfg")); } break; #endif @@ -2301,18 +2486,20 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);) /* Forward to the SME to HDD to wpa_supplicant */ // type is ACTION - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, 0); } else { - limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( " - "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or " - "not received with SelfSta Mac address) system role = %d"), - IS_WES_MODE_ENABLED(pMac), - pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], - pVendorSpecific->Oui[2], - psessionEntry->limSystemRole ); + limLog( pMac, LOG1, + FL("Dropping the vendor specific action frame because of( " + "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or " + "not received with SelfSta Mac address) system role = %d"), + IS_WES_MODE_ENABLED(pMac), + pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], + pVendorSpecific->Oui[2], + psessionEntry->limSystemRole ); } } break; @@ -2323,43 +2510,68 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps { tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr; tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; + tANI_U32 frameLen; + + frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + + if (frameLen < sizeof(pActionHdr)) { + limLog(pMac, LOG1, + FL("Received action frame of invalid len %d"), + frameLen); + break; + } //Check if it is a P2P public action frame. if (vos_mem_compare(pPubAction->Oui, P2POui, 4)) { /* Forward to the SME to HDD to wpa_supplicant */ // type is ACTION - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, 0); } else { - limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), - pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] ); + limLog( pMac, LOG1, + FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), + pPubAction->Oui[0], pPubAction->Oui[1], + pPubAction->Oui[2], pPubAction->Oui[3] ); } } break; +#ifdef WLAN_FEATURE_AP_HT40_24G + case SIR_MAC_ACTION_2040_BSS_COEXISTENCE: + { + if (pMac->roam.configParam.apHT40_24GEnabled) + { + limLog( pMac, LOGW, FL("Public Action 20/40 BSS" + "Coexistence Management frame")); + + __limProcess2040bssCoexistenceActionFrame(pMac, + psessionEntry->smeSessionId, (tANI_U8 *) pRxPacketInfo, + psessionEntry); + } + break; + } +#endif #ifdef FEATURE_WLAN_TDLS case SIR_MAC_TDLS_DIS_RSP: { -#ifdef FEATURE_WLAN_TDLS_INTERNAL - //LIM_LOG_TDLS(printk("Public Action TDLS Discovery RSP ..")) ; - limProcessTdlsPublicActionFrame(pMac, (tANI_U32*)pRxPacketInfo, psessionEntry) ; -#else tANI_S8 rssi; rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Public Action TDLS Discovery RSP ..")) ; - limSendSmeMgmtFrameInd(pMac, 0, pRxPacketInfo, + limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, + pRxPacketInfo, psessionEntry, rssi); -#endif } break; #endif default: - PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);) + limLog(pMac, LOG1, FL("Unhandled public action frame -- %x "), + pActionHdr->actionID); break; } break; @@ -2368,8 +2580,6 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps case SIR_MAC_ACTION_SA_QUERY: { PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);) - if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category)) - break; switch (pActionHdr->actionID) { case SIR_MAC_SA_QUERY_REQ: @@ -2406,7 +2616,8 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps } #endif default: - PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);) + limLog(pMac, LOG1, + FL("Action category %d not handled"), pActionHdr->category); break; } } @@ -2446,6 +2657,16 @@ limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd) case SIR_MAC_ACTION_VENDOR_SPECIFIC: { tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; + tANI_U32 frameLen; + + frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd); + + if (frameLen < sizeof(pActionHdr)) { + limLog(pMac, LOG1, + FL("Received action frame of invalid len %d"), + frameLen); + break; + } //Check if it is a P2P public action frame. if (vos_mem_compare(pActionHdr->Oui, P2POui, 4)) @@ -2456,19 +2677,24 @@ limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd) } else { - limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), - pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] ); + limLog( pMac, LOG1, + FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), + pActionHdr->Oui[0], pActionHdr->Oui[1], + pActionHdr->Oui[2], pActionHdr->Oui[3]); } } break; default: - PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);) + limLog(pMac, LOG1, + FL("Unhandled public action frame -- %x "), pActionHdr->actionID); break; } break; default: - PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);) - break; + limLog(pMac, LOG1, + FL("Unhandled action frame without session -- %x "), + pActionHdr->category); + break; } } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c index f40d53851c29..44c4cce9cf29 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "palTypes.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sirApi.h" #include "cfgApi.h" @@ -54,9 +54,6 @@ #include "limAdmitControl.h" #include "palApi.h" #include "limSessionUtils.h" -#ifdef WLAN_FEATURE_11W -#include "wniCfgAp.h" -#endif #include "vos_types.h" @@ -234,14 +231,47 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, */ pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &peerIdx, &psessionEntry->dph.dphHashTable); - if ((NULL != pStaDs) && (pHdr->fc.retry > 0)) + if (NULL != pStaDs) { - limLog(pMac, LOGE, - FL("STA is initiating Assoc Req after ACK lost.So, do not Process" - "sessionid: %d sys subType=%d for role=%d from: "MAC_ADDRESS_STR), - psessionEntry->peSessionId, subType, - psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pHdr->sa)); - return; + if (pHdr->fc.retry > 0) + { + /* Ignore the Retry */ + limLog(pMac, LOGE, + FL("STA is initiating Assoc Req after ACK lost. " + "So, do not Process sessionid: %d sys subType=%d " + "for role=%d from: "MAC_ADDRESS_STR), + psessionEntry->peSessionId, subType, + psessionEntry->limSystemRole, + MAC_ADDR_ARRAY(pHdr->sa)); + return; + } + else + { +#ifdef WLAN_FEATURE_11W + /* Do not send Assoc rsp for duplicate assoc req in case of PMF + * enabled STA, as driver needs to start SA Querry in this case + */ + if (!pStaDs->rmfEnabled) +#endif + { + /* STA might have missed the assoc response, + * so it is sending assoc request frame again. + */ + limSendAssocRspMgmtFrame( pMac, eSIR_SUCCESS, + pStaDs->assocId, pStaDs->staAddr, + pStaDs->mlmStaContext.subType, pStaDs, + psessionEntry); + limLog(pMac, LOGE, + FL("DUT already received an assoc request frame " + "and STA is sending another assoc req.So, do not " + "Process sessionid: %d sys subType=%d for role=%d " + "from: "MAC_ADDRESS_STR), + psessionEntry->peSessionId, subType, + psessionEntry->limSystemRole, + MAC_ADDR_ARRAY(pHdr->sa)); + return; + } + } } // Get pointer to Re/Association Request frame body @@ -303,7 +333,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if (status != eSIR_SUCCESS) { - limLog(pMac, LOGW, FL("Parse error AssocRequest, length=%d from "MAC_ADDRESS_STR), + limLog(pMac, LOGW, + FL("Parse error AssocRequest, length=%d from "MAC_ADDRESS_STR), framelen, MAC_ADDR_ARRAY(pHdr->sa)); limSendAssocRspMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_STATUS, 1, pHdr->sa, subType, 0, psessionEntry); goto error; @@ -332,8 +363,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, pAssocReq, &localCapabilities,psessionEntry) == false) { - limLog(pMac, LOGW, FL("local caps mismatch received caps")); - limLog(pMac, LOGW, FL("Received %s Req with unsupported " + limLog(pMac, LOGE, FL("local caps mismatch received caps")); + limLog(pMac, LOGE, FL("Received %s Req with unsupported " "capabilities from"MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", MAC_ADDR_ARRAY(pHdr->sa)); @@ -356,7 +387,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if (limCmpSSid(pMac, &pAssocReq->ssId, psessionEntry) == false) { - limLog(pMac, LOGW, FL("Received %s Req with unmatched ssid ( Received" + limLog(pMac, LOGE, FL("Received %s Req with unmatched ssid ( Received" " SSID: %.*s current SSID: %.*s ) from "MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", pAssocReq->ssId.length, pAssocReq->ssId.ssId, psessionEntry->ssId.length, @@ -397,7 +428,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } if (limCheckRxBasicRates(pMac, basicRates, psessionEntry) == false) { - limLog(pMac, LOGW, FL("Received %s Req with unsupported " + limLog(pMac, LOGE, FL("Received %s Req with unsupported " "rates from"MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", MAC_ADDR_ARRAY(pHdr->sa)); @@ -509,7 +540,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if ( (pAssocReq->HTCaps.present) && (limCheckMCSSet(pMac, pAssocReq->HTCaps.supportedMCSSet) == false)) { - limLog(pMac, LOGW, FL("received %s req with unsupported" + limLog(pMac, LOGE, FL("received %s req with unsupported" "MCS Rate Set from "MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", MAC_ADDR_ARRAY(pHdr->sa)); @@ -540,7 +571,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if (!pAssocReq->extendedRatesPresent && val) { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from 11b STA: " + limLog(pMac, LOGE, FL("Rejecting Re/Assoc req from 11b STA: " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); /** * Received Re/Association Request from @@ -662,7 +693,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, && psessionEntry->pLimStartBssReq->privacy && psessionEntry->pLimStartBssReq->rsnIE.length) { - limLog(pMac, LOGE, + limLog(pMac, LOG1, FL("RSN enabled auth, Re/Assoc req from STA: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->sa)); if(pAssocReq->rsnPresent) @@ -670,10 +701,18 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if(pAssocReq->rsn.length) { // Unpack the RSN IE - dot11fUnpackIeRSN(pMac, + if (dot11fUnpackIeRSN(pMac, &pAssocReq->rsn.info[0], pAssocReq->rsn.length, - &Dot11fIERSN); + &Dot11fIERSN) != DOT11F_PARSE_SUCCESS) + { + limLog(pMac, LOGE, + FL("Invalid RSNIE received")); + limSendAssocRspMgmtFrame(pMac, + eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS, + 1, pHdr->sa, subType, 0,psessionEntry); + goto error; + } /* Check RSN version is supported or not */ if(SIR_MAC_OUI_VERSION_1 == Dot11fIERSN.version) @@ -682,7 +721,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if(eSIR_SUCCESS != (status = limCheckRxRSNIeMatch(pMac, Dot11fIERSN, psessionEntry, pAssocReq->HTCaps.present, &pmfConnection))) { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " + limLog(pMac, LOGE, FL("RSN Mismatch. Rejecting Re/Assoc req from " "STA: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->sa)); @@ -701,7 +740,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } else { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " + limLog(pMac, LOGE, FL("RSN Version mismatch. " + "Rejecting Re/Assoc req from " "STA: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->sa)); @@ -718,8 +758,10 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } else { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from STA:" - MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); + limLog(pMac, LOGW, FL("RSN length not correct. " + "Rejecting Re/Assoc req from STA:" + MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); /* received Association req frame with RSN IE but length is 0 */ limSendAssocRspMgmtFrame( pMac, @@ -737,15 +779,24 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, // Unpack the WPA IE if(pAssocReq->wpa.length) { - dot11fUnpackIeWPA(pMac, + if (dot11fUnpackIeWPA(pMac, &pAssocReq->wpa.info[4], //OUI is not taken care - pAssocReq->wpa.length, - &Dot11fIEWPA); + (pAssocReq->wpa.length - 4), + &Dot11fIEWPA) != DOT11F_PARSE_SUCCESS) + { + limLog(pMac, LOGE, FL("Invalid WPA IE")); + limSendAssocRspMgmtFrame(pMac, + eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS, + 1, pHdr->sa, subType, 0,psessionEntry); + goto error; + } /* check the groupwise and pairwise cipher suites */ if(eSIR_SUCCESS != (status = limCheckRxWPAIeMatch(pMac, Dot11fIEWPA, psessionEntry, pAssocReq->HTCaps.present))) { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " - "STA: "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); + limLog(pMac, LOGW, FL("WPA IE mismatch. " + "Rejecting Re/Assoc req from " + "STA: "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); /* received Association req frame with WPA IE but mismatch */ limSendAssocRspMgmtFrame( pMac, @@ -759,8 +810,10 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } else { - limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from STA: " - MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); + limLog(pMac, LOGW, FL("WPA len incorrect. " + "Rejecting Re/Assoc req from STA: " + MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); /* received Association req frame with invalid WPA IE */ limSendAssocRspMgmtFrame( pMac, @@ -795,6 +848,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, * Maximum number of STAs that AP can handle reached. * Send Association response to peer MAC entity */ + limLog(pMac, LOGE, FL("Max Sta count reached : %d"), + pMac->lim.maxStation); limRejectAssociation(pMac, pHdr->sa, subType, false, (tAniAuthType) 0, 0, @@ -823,7 +878,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON, //=9 pHdr->sa, psessionEntry, FALSE); - limLog(pMac, LOGW, FL("received %s req on sessionid: %d from STA " + limLog(pMac, LOGE, FL("received %s req on sessionid: %d from STA " "that does not have pre-auth context"MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", psessionEntry->peSessionId, @@ -855,7 +910,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, #ifdef WLAN_DEBUG pMac->lim.gLimNumAssocReqDropInvldState++; #endif - limLog(pMac, LOG1, FL("received Assoc req in state " + limLog(pMac, LOGE, FL("received Assoc req in state " "%d from "), pStaDs->mlmStaContext.mlmState); } else @@ -863,7 +918,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, #ifdef WLAN_DEBUG pMac->lim.gLimNumReassocReqDropInvldState++; #endif - limLog(pMac, LOG1, FL("received ReAssoc req in state %d" + limLog(pMac, LOGE, FL("received ReAssoc req in state %d" " from "), pStaDs->mlmStaContext.mlmState); } limPrintMacAddr(pMac, pHdr->sa, LOG1); @@ -944,6 +999,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, * 'associated' state. Update STA capabilities and * send Association response frame with same AID */ + limLog(pMac, LOG1, FL("Received Assoc req from STA already connected" + " UpdateConext")); pStaDs->mlmStaContext.capabilityInfo = pAssocReq->capabilityInfo; if (pStaPreAuthContext && (pStaPreAuthContext->mlmState == @@ -983,7 +1040,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if (limAdmitControlAddTS(pMac, pHdr->sa, &(pAssocReq->addtsReq), &(pAssocReq->qosCapability), 0, false, NULL, &tspecIdx, psessionEntry) != eSIR_SUCCESS) { - limLog(pMac, LOGW, FL("AdmitControl: TSPEC rejected")); + limLog(pMac, LOGE, FL("AdmitControl: TSPEC rejected")); limSendAssocRspMgmtFrame( pMac, eSIR_MAC_QAP_NO_BANDWIDTH_REASON, @@ -999,7 +1056,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, else if (limAdmitControlAddSta(pMac, pHdr->sa, false) != eSIR_SUCCESS) { - limLog(pMac, LOGW, FL("AdmitControl: Sta rejected")); + limLog(pMac, LOGE, FL("AdmitControl: Sta rejected")); limSendAssocRspMgmtFrame( pMac, eSIR_MAC_QAP_NO_BANDWIDTH_REASON, @@ -1035,6 +1092,8 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, { // Could not assign AID // Reject association + limLog(pMac, LOGE, FL("PeerIdx not avaialble. Reject associaton")); + limRejectAssociation(pMac, pHdr->sa, subType, true, authType, peerIdx, false, @@ -1127,8 +1186,36 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, pStaDs->htMaxAmsduLength = (tANI_U8)pAssocReq->HTCaps.maximalAMSDUsize; pStaDs->htMaxRxAMpduFactor = pAssocReq->HTCaps.maxRxAMPDUFactor; pStaDs->htMIMOPSState = pAssocReq->HTCaps.mimoPowerSave; - pStaDs->htShortGI20Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI20MHz; - pStaDs->htShortGI40Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI40MHz; + + /* pAssocReq will be copied to psessionEntry->parsedAssocReq later */ + /* check whether AP is enabled with shortGI */ + if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_20MHZ, &val) != + eSIR_SUCCESS) { + limLog(pMac, LOGE, + FL("could not retrieve shortGI 20Mhz CFG")); + goto error; + } + if (val) { + pStaDs->htShortGI20Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI20MHz; + } else { + /* Unset htShortGI20Mhz in ht_caps*/ + pAssocReq->HTCaps.shortGI20MHz = 0; + pStaDs->htShortGI20Mhz = 0; + } + + if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_40MHZ, &val) != + eSIR_SUCCESS) { + limLog(pMac, LOGE, + FL("could not retrieve shortGI 40Mhz CFG")); + goto error; + } + if (val) { + pStaDs->htShortGI40Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI40MHz; + } else { + /* Unset htShortGI40Mhz in ht_caps */ + pAssocReq->HTCaps.shortGI40MHz = 0; + pStaDs->htShortGI40Mhz = 0; + } pStaDs->htSupportedChannelWidthSet = (tANI_U8)pAssocReq->HTCaps.supportedChannelWidthSet; /* peer just follows AP; so when we are softAP/GO, we just store our session entry's secondary channel offset here in peer INFRA STA * However, if peer's 40MHz channel width support is disabled then secondary channel will be zero @@ -1288,9 +1375,9 @@ if (limPopulateMatchingRateSet(pMac, (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); goto error; } - if (WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APMIN > retryInterval) + if (WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMIN > retryInterval) { - retryInterval = WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APDEF; + retryInterval = WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STADEF; } if (tx_timer_create(&pStaDs->pmfSaQueryTimer, "PMF SA Query timer", limPmfSaQueryTimerHandler, timerId.value, @@ -1366,8 +1453,8 @@ if (limPopulateMatchingRateSet(pMac, /* use the same AID, already allocated */ if (limAddSta(pMac, pStaDs, false, psessionEntry) != eSIR_SUCCESS) { - limLog( pMac, LOGE, FL( "AP do not support UPASD " - "REASSOC Failed")); + limLog(pMac, LOGE, FL( "Could not AddSta with assocId= %d staId %d"), + pStaDs->assocId, pStaDs->staIndex); limRejectAssociation( pMac, pStaDs->staAddr, pStaDs->mlmStaContext.subType, true, pStaDs->mlmStaContext.authType, pStaDs->assocId, true,(tSirResultCodes) eSIR_MAC_WME_REFUSED_STATUS, psessionEntry); @@ -1556,6 +1643,15 @@ void limSendMlmAssocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession p /* Note: we are not rejecting association here because IOT will fail */ } +#ifdef WLAN_FEATURE_AP_HT40_24G + if(pAssocReq->HTCaps.present) + { + limLog(pMac, LOGW, FL("HT40MHzInto: %d"), + pAssocReq->HTCaps.stbcControlFrame); + pMlmAssocInd->HT40MHzIntoPresent = + pAssocReq->HTCaps.stbcControlFrame; + } +#endif // Required for indicating the frames to upper layer pMlmAssocInd->assocReqLength = pAssocReq->assocReqFrameLength; @@ -1681,6 +1777,16 @@ void limSendMlmAssocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession p } +#ifdef WLAN_FEATURE_AP_HT40_24G + if(pAssocReq->HTCaps.present) + { + limLog(pMac, LOGW, FL("RASSOC HT40MHzInto: %d"), + pAssocReq->HTCaps.stbcControlFrame); + pMlmReassocInd->HT40MHzIntoPresent = + pAssocReq->HTCaps.stbcControlFrame; + } +#endif + // Required for indicating the frames to upper layer pMlmReassocInd->assocReqLength = pAssocReq->assocReqFrameLength; pMlmReassocInd->assocReqPtr = pAssocReq->assocReqFrame; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c index 84cae757a556..82838fd247a2 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" @@ -371,9 +371,9 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub /// Received unexpected Re/Association Response frame #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOG1(limLog(pMac, LOG1, FL("Recieved Re/Assoc rsp in unexpected " + limLog(pMac, LOG1, FL("Recieved Re/Assoc rsp in unexpected " "state %d on session=%d"), - psessionEntry->limMlmState, psessionEntry->peSessionId);) + psessionEntry->limMlmState, psessionEntry->peSessionId); #endif // Log error if (!pHdr->fc.retry) @@ -469,9 +469,12 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub } if(pAssocRsp->ExtCap.present) { - limLog(pMac, LOGE, FL("Filling tdls prohibited in session entry")); + struct s_ext_cap *p_ext_cap = (struct s_ext_cap *) + pAssocRsp->ExtCap.bytes; + limLog(pMac, LOG1, + FL("Filling tdls prohibited in session entry")); psessionEntry->tdlsChanSwitProhibited = - pAssocRsp->ExtCap.TDLSChanSwitProhibited ; + p_ext_cap->TDLSChanSwitProhibited; } if(!pAssocRsp->suppRatesPresent) { @@ -552,13 +555,13 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub vos_mem_copy(psessionEntry->tspecIes, &pAssocRsp->TSPECInfo[0], psessionEntry->tspecLen); } - PELOG1(limLog(pMac, LOG1, FL(" Tspec EID present in assoc rsp "));) + limLog(pMac, LOG1, FL(" Tspec EID present in assoc rsp ")); } else { psessionEntry->tspecLen = 0; psessionEntry->tspecIes = NULL; - PELOG1(limLog(pMac, LOG1, FL(" Tspec EID *NOT* present in assoc rsp "));) + limLog(pMac, LOG1, FL(" Tspec EID *NOT* present in assoc rsp ")); } #endif @@ -674,7 +677,7 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub if (subType == LIM_REASSOC) { // Log success - PELOG1(limLog(pMac, LOG1, FL("Successfully Reassociated with BSS"));) + limLog(pMac, LOG1, FL("Successfully Reassociated with BSS")); #ifdef FEATURE_WLAN_ESE { tANI_U8 cnt = 0; @@ -792,8 +795,8 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub } // Log success - PELOG1(limLog(pMac, LOG1, FL("Successfully Associated with BSS "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pHdr->sa));) + limLog(pMac, LOG1, FL("Successfully Associated with BSS "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); #ifdef FEATURE_WLAN_ESE if(psessionEntry->eseContext.tsm.tsmInfo.state) { @@ -923,7 +926,7 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub /* CR: vos packet memory is leaked when assoc rsp timeouted/failed. */ /* notify TL that association is failed so that TL can flush the cached frame */ - PELOG1(limLog(pMac, LOG1, FL("notify TL that association is failed"));) + limLog(pMac, LOG1, FL("notify TL that association is failed")); WLANTL_AssocFailed (psessionEntry->staId); vos_mem_free(pBeaconStruct); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAuthFrame.c index 806ff12d18ef..1566620aac6d 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAuthFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessAuthFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" @@ -140,12 +140,14 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse { tANI_U8 *pBody, keyId, cfgPrivacyOptImp, defaultKey[SIR_MAC_KEY_LENGTH], - encrAuthFrame[LIM_ENCR_AUTH_BODY_LEN], - plainBody[256]; + *encrAuthFrame = NULL, + *plainBody = NULL; tANI_U16 frameLen; //tANI_U32 authRspTimeout, maxNumPreAuth, val; tANI_U32 maxNumPreAuth, val; - tSirMacAuthFrameBody *pRxAuthFrameBody, rxAuthFrame, authFrame; + tSirMacAuthFrameBody *pRxAuthFrameBody, + *rxAuthFrame = NULL, + *authFrame = NULL; tpSirMacMgmtHdr pHdr; tCfgWepKeyEntry *pKeyMapEntry = NULL; struct tLimPreAuthNode *pAuthNode; @@ -153,16 +155,16 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse tANI_U8 decryptResult; tANI_U8 *pChallenge; tANI_U32 key_length=8; - tANI_U8 challengeTextArray[SIR_MAC_AUTH_CHALLENGE_LENGTH]; + tANI_U8 *challengeTextArray = NULL; tpDphHashNode pStaDs = NULL; tANI_U16 assocId = 0; + tANI_U16 currSeqNo = 0; /* Added For BT -AMP support */ // Get pointer to Authentication frame header and body pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - if (!frameLen) { @@ -178,12 +180,13 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse { // Received Auth frame from a BC/MC address // Log error and ignore it - PELOGE(limLog(pMac, LOGE, - FL("received Auth frame from a BC/MC address - "));) - PELOG1( limPrintMacAddr(pMac, pHdr->sa, LOG1);) + limLog(pMac, LOGE, + FL("received Auth frame from a BC/MC address - ")); + limPrintMacAddr(pMac, pHdr->sa, LOGE); return; } + currSeqNo = (pHdr->seqControl.seqNumHi << 4) | (pHdr->seqControl.seqNumLo); limLog(pMac, LOG1, FL("Sessionid: %d System role : %d limMlmState: %d :Auth " "Frame Received: BSSID: "MAC_ADDRESS_STR " (RSSI %d)"), @@ -202,6 +205,35 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse ccmCfgSetInt(pMac,WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT , psessionEntry->defaultAuthFailureTimeout, NULL, eANI_BOOLEAN_FALSE); } + + rxAuthFrame = vos_mem_malloc(sizeof(tSirMacAuthFrameBody)); + if (!rxAuthFrame) { + limLog(pMac, LOGE, FL("Failed to allocate memory")); + return; + } + + authFrame = vos_mem_malloc(sizeof(tSirMacAuthFrameBody)); + if (!authFrame) { + limLog(pMac, LOGE, FL("failed to allocate memory")); + goto free; + } + + plainBody = vos_mem_malloc(LIM_ENCR_AUTH_BODY_LEN); + if (!plainBody) { + limLog(pMac, LOGE, FL("failed to allocate memory")); + goto free; + } + + challengeTextArray = vos_mem_malloc(SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH); + if(!challengeTextArray) { + limLog(pMac, LOGE, FL("failed to allocate memory")); + goto free; + } + + vos_mem_set(rxAuthFrame, sizeof(tSirMacAuthFrameBody), 0); + vos_mem_set(authFrame, sizeof(tSirMacAuthFrameBody), 0); + vos_mem_set(plainBody, LIM_ENCR_AUTH_BODY_LEN, 0); + vos_mem_set(challengeTextArray, SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH, 0); /// Determine if WEP bit is set in the FC or received MAC header if (pHdr->fc.wep) @@ -219,7 +251,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limSendDeauthMgmtFrame( pMac, eSIR_MAC_MIC_FAILURE_REASON, pHdr->sa, psessionEntry, FALSE ); - return; + goto free; } // Extract key ID from IV (most 2 bits of 4th byte of IV) @@ -237,21 +269,23 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse if (psessionEntry->limSystemRole == eLIM_STA_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) { - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; // Log error PELOGE(limLog(pMac, LOGE, FL("received Authentication frame with wep bit set on " "role=%d "MAC_ADDRESS_STR), psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pHdr->sa) );) - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); - return; + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); + goto free; } - if (frameLen < LIM_ENCR_AUTH_BODY_LEN) + if ((frameLen < LIM_ENCR_AUTH_BODY_LEN_SAP) || + (frameLen > LIM_ENCR_AUTH_BODY_LEN)) { // Log error limLog(pMac, LOGE, @@ -259,7 +293,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse frameLen); limPrintMacAddr(pMac, pHdr->sa, LOGE); - return; + goto free; } if(psessionEntry->limSystemRole == eLIM_AP_ROLE) { @@ -301,17 +335,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * an Authentication frame with FC bit set. * Send Auth frame4 with 'out of sequence' status code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } else { @@ -339,17 +374,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * out of sequence Auth frame status code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } } @@ -374,17 +410,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Send Authentication frame * with challenge failure status code */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } // if (!pKeyMapEntry->wepOn) else { @@ -406,29 +443,30 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limDeletePreAuthNode(pMac, pHdr->sa); - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } if ( ( sirConvertAuthFrame2Struct(pMac, plainBody, frameLen-8, - &rxAuthFrame)!=eSIR_SUCCESS ) || - ( !isAuthValid(pMac, &rxAuthFrame,psessionEntry) ) ) + rxAuthFrame)!=eSIR_SUCCESS ) || + ( !isAuthValid(pMac, rxAuthFrame,psessionEntry) ) ) { PELOGE(limLog(pMac, LOGE, FL("failed to convert Auth Frame to structure " "or Auth is not valid "));) - return; + goto free; } @@ -460,17 +498,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * with challenge failure status code */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } key_length=val; @@ -492,27 +531,28 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse /// ICV failure limDeletePreAuthNode(pMac, pHdr->sa); - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } if ( ( sirConvertAuthFrame2Struct(pMac, plainBody, frameLen-8, - &rxAuthFrame)!=eSIR_SUCCESS ) || - ( !isAuthValid(pMac, &rxAuthFrame, psessionEntry) ) ) + rxAuthFrame)!=eSIR_SUCCESS ) || + ( !isAuthValid(pMac, rxAuthFrame, psessionEntry) ) ) { limLog(pMac, LOGE, FL("failed to convert Auth Frame to structure " "or Auth is not valid ")); - return; + goto free; } } // End of check for Key Mapping/Default key presence } @@ -532,17 +572,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * should have been 'unsupported algorithm' status code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } // else if (wlan_cfgGetInt(CFG_PRIVACY_OPTION_IMPLEMENTED)) } // if (fc.wep) else @@ -550,18 +591,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse if ( ( sirConvertAuthFrame2Struct(pMac, pBody, - frameLen, &rxAuthFrame)!=eSIR_SUCCESS ) || - ( !isAuthValid(pMac, &rxAuthFrame,psessionEntry) ) ) + frameLen, rxAuthFrame)!=eSIR_SUCCESS ) || + ( !isAuthValid(pMac, rxAuthFrame,psessionEntry) ) ) { PELOGE(limLog(pMac, LOGE, FL("failed to convert Auth Frame to structure or Auth is " "not valid "));) - return; + goto free; } } - pRxAuthFrameBody = &rxAuthFrame; + pRxAuthFrameBody = rxAuthFrame; PELOGW(limLog(pMac, LOGW, FL("Received Auth frame with type=%d seqnum=%d, status=%d (%d)"), @@ -633,7 +674,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limSendDeauthMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, (tANI_U8 *) pHdr->sa, psessionEntry, FALSE); limTriggerSTAdeletion(pMac, pStaDs, psessionEntry); - return; + goto free; } } @@ -642,7 +683,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse if (pAuthNode) { /// Pre-auth context exists for the STA - if (pHdr->fc.retry == 0) + if (pHdr->fc.retry == 0 || pAuthNode->seqNo != currSeqNo) { /** * STA is initiating brand-new Authentication @@ -696,7 +737,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limSendDeauthMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, (tANI_U8 *) pAuthNode->peerMacAddr, psessionEntry, FALSE); limTriggerSTAdeletion(pMac, pStaDs, psessionEntry); - return; + goto free; } } else @@ -708,7 +749,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * */ PELOGE(limLog(pMac, LOGE, FL("STA is initiating " "Authentication after ACK lost..."));) - return; + goto free; } } if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH, @@ -721,7 +762,9 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limLog(pMac, LOGP, FL("could not retrieve MaxNumPreAuth")); } - if (pMac->lim.gLimNumPreAuthContexts == maxNumPreAuth) + + if (pMac->lim.gLimNumPreAuthContexts == maxNumPreAuth && + !limDeleteOpenAuthPreAuthNode(pMac)) { PELOGE(limLog(pMac, LOGE, FL("Max number of " "preauth context reached"));) @@ -730,18 +773,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * reached. Send Authentication frame * with unspecified failure */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } /// No Pre-auth context exists for the STA. if (limIsAuthAlgoSupported( @@ -761,12 +805,12 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limLog(pMac, LOGW, FL("Max pre-auth nodes reached ")); limPrintMacAddr(pMac, pHdr->sa, LOGW); - - return; + goto free; } - PELOG1(limLog(pMac, LOG1, FL("Alloc new data: %x peer "), pAuthNode); - limPrintMacAddr(pMac, pHdr->sa, LOG1);) + limLog(pMac, LOG1, + FL("Alloc new data: peer "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); vos_mem_copy((tANI_U8 *) pAuthNode->peerMacAddr, pHdr->sa, @@ -778,6 +822,9 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse pRxAuthFrameBody->authAlgoNumber; pAuthNode->fSeen = 0; pAuthNode->fTimerStarted = 0; + pAuthNode->seqNo = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + pAuthNode->timestamp = vos_timer_get_system_ticks(); limAddPreAuthNode(pMac, pAuthNode); /** @@ -785,15 +832,16 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * status code. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = eSIR_MAC_SUCCESS_STATUS; + authFrame->authStatusCode = eSIR_MAC_SUCCESS_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); /// Send Auth indication to SME @@ -843,19 +891,20 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * code. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } else { @@ -869,7 +918,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse FL("Max pre-auth nodes reached ")); limPrintMacAddr(pMac, pHdr->sa, LOGW); - return; + goto free; } vos_mem_copy((tANI_U8 *) pAuthNode->peerMacAddr, @@ -883,11 +932,14 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse pRxAuthFrameBody->authAlgoNumber; pAuthNode->fSeen = 0; pAuthNode->fTimerStarted = 0; + pAuthNode->seqNo = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + pAuthNode->timestamp = vos_timer_get_system_ticks(); limAddPreAuthNode(pMac, pAuthNode); - PELOG1(limLog(pMac, LOG1, FL("Alloc new data: %x id %d peer "), - pAuthNode, pAuthNode->authNodeIdx);) - PELOG1(limPrintMacAddr(pMac, pHdr->sa, LOG1);) + limLog(pMac, LOG1, + FL("Alloc new data: id %d peer "MAC_ADDRESS_STR), + pAuthNode->authNodeIdx, MAC_ADDR_ARRAY(pHdr->sa)); /// Create and activate Auth Response timer if (tx_timer_change_context(&pAuthNode->timer, pAuthNode->authNodeIdx) != TX_SUCCESS) @@ -903,32 +955,34 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * unspecified failure status code. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); limDeletePreAuthNode(pMac, pHdr->sa); - return; + goto free; } limActivateAuthRspTimer(pMac, pAuthNode); pAuthNode->fTimerStarted = 1; - // get random bytes and use as - // challenge text - // TODO - //if( !VOS_IS_STATUS_SUCCESS( vos_rand_get_bytes( 0, (tANI_U8 *)challengeTextArray, SIR_MAC_AUTH_CHALLENGE_LENGTH ) ) ) + /* + * get random bytes and use as challenge text + */ + if( !VOS_IS_STATUS_SUCCESS( vos_rand_get_bytes( 0, (tANI_U8 *)challengeTextArray, SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH ) ) ) { limLog(pMac, LOGE,FL("Challenge text " "preparation failed in limProcessAuthFrame")); + goto free; } pChallenge = pAuthNode->challengeText; @@ -941,22 +995,23 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Sending Authenticaton frame with challenge. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_SUCCESS_STATUS; - authFrame.type = SIR_MAC_CHALLENGE_TEXT_EID; - authFrame.length = SIR_MAC_AUTH_CHALLENGE_LENGTH; - vos_mem_copy(authFrame.challengeText, + authFrame->type = SIR_MAC_CHALLENGE_TEXT_EID; + authFrame->length = SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH; + vos_mem_copy(authFrame->challengeText, pAuthNode->challengeText, - SIR_MAC_AUTH_CHALLENGE_LENGTH); + SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH); limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); } // if (wlan_cfgGetInt(CFG_PRIVACY_OPTION_IMPLEMENTED)) break; @@ -977,19 +1032,20 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * with auth algorithm not supported status code */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } // end switch(pRxAuthFrameBody->authAlgoNumber) } // if (limIsAuthAlgoSupported(pRxAuthFrameBody->authAlgoNumber)) else @@ -1006,18 +1062,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * authentication algorithm requested by sending party. * Reject Authentication with StatusCode=13. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } //end if (limIsAuthAlgoSupported(pRxAuthFrameBody->authAlgoNumber)) break; @@ -1032,12 +1089,12 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse */ // Log error - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("received Auth frame2 from peer in state %d, addr "), - psessionEntry->limMlmState);) - PELOG1(limPrintMacAddr(pMac, pHdr->sa, LOG1);) + psessionEntry->limMlmState); + limPrintMacAddr(pMac, pHdr->sa, LOG1); - return; + goto free; } if ( !vos_mem_compare((tANI_U8 *) pHdr->sa, @@ -1112,17 +1169,21 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse FL("Max pre-auth nodes reached ")); limPrintMacAddr(pMac, pHdr->sa, LOGW); - return; + goto free; } - PELOG1(limLog(pMac, LOG1, FL("Alloc new data: %x peer "), pAuthNode);) - PELOG1(limPrintMacAddr(pMac, pHdr->sa, LOG1);) + limLog(pMac, LOG1, + FL("Alloc new data: peer "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); vos_mem_copy((tANI_U8 *) pAuthNode->peerMacAddr, pMac->lim.gpLimMlmAuthReq->peerMacAddr, sizeof(tSirMacAddr)); pAuthNode->fTimerStarted = 0; pAuthNode->authType = pMac->lim.gpLimMlmAuthReq->authType; + pAuthNode->seqNo = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + pAuthNode->timestamp = vos_timer_get_system_ticks(); limAddPreAuthNode(pMac, pAuthNode); limRestoreFromAuthState(pMac, eSIR_SME_SUCCESS, @@ -1163,17 +1224,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse MAC_ADDRESS_STR), pRxAuthFrameBody->authAlgoNumber, MAC_ADDR_ARRAY(pHdr->sa));) - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); - return; + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); + goto free; } else { @@ -1186,7 +1248,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse FL("received Auth frame with invalid " "challenge text IE"));) - return; + goto free; } /** @@ -1211,21 +1273,22 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Send Auth frame with * challenge failure status code */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); limRestoreFromAuthState(pMac, eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); - return; + goto free; } // if (pKeyMapEntry->key == NULL) else { @@ -1235,10 +1298,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse sirSwapU16ifNeeded((tANI_U16) (pRxAuthFrameBody->authTransactionSeqNumber + 1)); ((tpSirMacAuthFrameBody) plainBody)->authStatusCode = eSIR_MAC_SUCCESS_STATUS; ((tpSirMacAuthFrameBody) plainBody)->type = SIR_MAC_CHALLENGE_TEXT_EID; - ((tpSirMacAuthFrameBody) plainBody)->length = SIR_MAC_AUTH_CHALLENGE_LENGTH; + ((tpSirMacAuthFrameBody) plainBody)->length = pRxAuthFrameBody->length; vos_mem_copy((tANI_U8 *) ((tpSirMacAuthFrameBody) plainBody)->challengeText, pRxAuthFrameBody->challengeText, - SIR_MAC_AUTH_CHALLENGE_LENGTH); + pRxAuthFrameBody->length); + + encrAuthFrame = vos_mem_malloc(pRxAuthFrameBody->length + + LIM_ENCR_AUTH_INFO_LEN); + if (!encrAuthFrame) { + limLog(pMac, LOGE, FL("failed to allocate memory")); + goto free; + } + vos_mem_set(encrAuthFrame, pRxAuthFrameBody->length + + LIM_ENCR_AUTH_INFO_LEN, 0); limEncryptAuthFrame(pMac, 0, pKeyMapEntry->key, @@ -1251,7 +1323,8 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limSendAuthMgmtFrame(pMac, (tpSirMacAuthFrameBody) encrAuthFrame, pHdr->sa, - LIM_WEP_IN_FC,psessionEntry); + pRxAuthFrameBody->length, + psessionEntry, eSIR_FALSE); break; } // end if (pKeyMapEntry->key == NULL) @@ -1289,17 +1362,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limLog(pMac, LOGP, FL("could not retrieve Default key")); - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); limRestoreFromAuthState(pMac, eSIR_SME_INVALID_WEP_DEFAULT_KEY, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); @@ -1313,10 +1387,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse sirSwapU16ifNeeded((tANI_U16) (pRxAuthFrameBody->authTransactionSeqNumber + 1)); ((tpSirMacAuthFrameBody) plainBody)->authStatusCode = eSIR_MAC_SUCCESS_STATUS; ((tpSirMacAuthFrameBody) plainBody)->type = SIR_MAC_CHALLENGE_TEXT_EID; - ((tpSirMacAuthFrameBody) plainBody)->length = SIR_MAC_AUTH_CHALLENGE_LENGTH; + ((tpSirMacAuthFrameBody) plainBody)->length = pRxAuthFrameBody->length; vos_mem_copy((tANI_U8 *) ((tpSirMacAuthFrameBody) plainBody)->challengeText, pRxAuthFrameBody->challengeText, - SIR_MAC_AUTH_CHALLENGE_LENGTH); + pRxAuthFrameBody->length); + + encrAuthFrame = vos_mem_malloc(pRxAuthFrameBody->length + + LIM_ENCR_AUTH_INFO_LEN); + if (!encrAuthFrame) { + limLog(pMac, LOGE, FL("failed to allocate memory")); + goto free; + } + vos_mem_set(encrAuthFrame, pRxAuthFrameBody->length + + LIM_ENCR_AUTH_INFO_LEN, 0); limEncryptAuthFrame(pMac, keyId, defaultKey, @@ -1330,7 +1413,8 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limSendAuthMgmtFrame(pMac, (tpSirMacAuthFrameBody) encrAuthFrame, pHdr->sa, - LIM_WEP_IN_FC,psessionEntry); + pRxAuthFrameBody->length, + psessionEntry, eSIR_FALSE); break; } // end if (pKeyMapEntry) @@ -1373,17 +1457,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Shared Key authentication type. Reject with Auth frame4 * with 'out of sequence' status code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } if (psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE || @@ -1403,17 +1488,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse MAC_ADDR_ARRAY(pHdr->sa));) /// WEP bit is not set in FC of Auth Frame3 - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } pAuthNode = limSearchPreAuthList(pMac, @@ -1433,17 +1519,18 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Send Auth frame4 with 'out of sequence' * status code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } if (pAuthNode->mlmState == eLIM_MLM_AUTH_RSP_TIMEOUT_STATE) @@ -1457,22 +1544,23 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Reject by sending Auth Frame4 with * Auth respone timeout Status Code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_AUTH_RSP_TIMEOUT_STATUS; limSendAuthMgmtFrame( - pMac, &authFrame, + pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); /// Delete pre-auth context of STA limDeletePreAuthNode(pMac, pHdr->sa); - return; + goto free; } // end switch (pAuthNode->mlmState) if (pRxAuthFrameBody->authStatusCode != eSIR_MAC_SUCCESS_STATUS) @@ -1489,7 +1577,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse MAC_ADDRESS_STR), pRxAuthFrameBody->authStatusCode, MAC_ADDR_ARRAY(pHdr->sa));) - return; + goto free; } /** @@ -1499,7 +1587,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse if (vos_mem_compare(pRxAuthFrameBody->challengeText, pAuthNode->challengeText, - SIR_MAC_AUTH_CHALLENGE_LENGTH)) + SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH)) { /// Challenge match. STA is autheticated ! @@ -1514,14 +1602,15 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse /** * Send Authentication Frame4 with 'success' Status Code. */ - authFrame.authAlgoNumber = eSIR_SHARED_KEY; - authFrame.authTransactionSeqNumber = + authFrame->authAlgoNumber = eSIR_SHARED_KEY; + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = eSIR_MAC_SUCCESS_STATUS; + authFrame->authStatusCode = eSIR_MAC_SUCCESS_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); /// Send Auth indication to SME vos_mem_copy((tANI_U8 *) mlmAuthInd.peerMacAddr, @@ -1551,18 +1640,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * delete STA context. */ - authFrame.authAlgoNumber = + authFrame->authAlgoNumber = pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = + authFrame->authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; - authFrame.authStatusCode = + authFrame->authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, + limSendAuthMgmtFrame(pMac, authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, + psessionEntry, eSIR_FALSE); - return; + goto free; } } // if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE || ... @@ -1578,12 +1668,12 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse */ // Log error - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("received unexpected Auth frame4 from peer in state " "%d, addr "MAC_ADDRESS_STR), psessionEntry->limMlmState, - MAC_ADDR_ARRAY(pHdr->sa));) + MAC_ADDR_ARRAY(pHdr->sa)); - return; + goto free; } if (pRxAuthFrameBody->authAlgoNumber != eSIR_SHARED_KEY) @@ -1601,7 +1691,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse "algo %d "MAC_ADDRESS_STR), pRxAuthFrameBody->authAlgoNumber, MAC_ADDR_ARRAY(pHdr->sa));) - return; + goto free; } if ( !vos_mem_compare((tANI_U8 *) pHdr->sa, @@ -1657,16 +1747,20 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse FL("Max pre-auth nodes reached ")); limPrintMacAddr(pMac, pHdr->sa, LOGW); - return; + goto free; } - PELOG1(limLog(pMac, LOG1, FL("Alloc new data: %x peer "), pAuthNode); - limPrintMacAddr(pMac, pHdr->sa, LOG1);) + limLog(pMac, LOG1, + FL("Alloc new data: peer " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pHdr->sa)); vos_mem_copy((tANI_U8 *) pAuthNode->peerMacAddr, pMac->lim.gpLimMlmAuthReq->peerMacAddr, sizeof(tSirMacAddr)); pAuthNode->fTimerStarted = 0; pAuthNode->authType = pMac->lim.gpLimMlmAuthReq->authType; + pAuthNode->seqNo = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + pAuthNode->timestamp = vos_timer_get_system_ticks(); limAddPreAuthNode(pMac, pAuthNode); limRestoreFromAuthState(pMac, eSIR_SME_SUCCESS, @@ -1702,6 +1796,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse break; } // end switch (pRxAuthFrameBody->authTransactionSeqNumber) + +free: + if (authFrame) + vos_mem_free(authFrame); + if (rxAuthFrame) + vos_mem_free(rxAuthFrame); + if (encrAuthFrame) + vos_mem_free(encrAuthFrame); + if (plainBody) + vos_mem_free(plainBody); + if (challengeTextArray) + vos_mem_free(challengeTextArray); + } /*** end limProcessAuthFrame() ***/ @@ -1799,14 +1906,14 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo * pre-auth. */ PELOGE(limLog(pMac,LOG1,"Auth rsp already posted to SME" - " (session %p, FT session %p)", psessionEntry, + " (session %pK, FT session %pK)", psessionEntry, pMac->ft.ftPEContext.pftSessionEntry);); return eSIR_SUCCESS; } else { PELOGE(limLog(pMac,LOGW,"Auth rsp not yet posted to SME" - " (session %p, FT session %p)", psessionEntry, + " (session %pK, FT session %pK)", psessionEntry, pMac->ft.ftPEContext.pftSessionEntry);); pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = eANI_BOOLEAN_TRUE; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c index 6f25f8556616..de765b27c956 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c @@ -37,7 +37,7 @@ * */ -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" #include "schApi.h" @@ -82,9 +82,9 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); - PELOG2(limLog(pMac, LOG2, FL("Received Beacon frame with length=%d from "), + limLog(pMac, LOG2, FL("Received Beacon frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); - limPrintMacAddr(pMac, pHdr->sa, LOG2);) + limPrintMacAddr(pMac, pHdr->sa, LOG2); if (!pMac->fScanOffload) { @@ -106,7 +106,7 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps || pMac->fScanOffload ) { - pBeacon = vos_mem_malloc(sizeof(tSchBeaconStruct)); + pBeacon = vos_mem_vmalloc(sizeof(tSchBeaconStruct)); if ( NULL == pBeacon ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessBeaconFrame") ); @@ -127,7 +127,7 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps (sirCompareMacAddr( psessionEntry->bssId, pHdr->sa))) limParseBeaconForTim(pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry); - vos_mem_free(pBeacon); + vos_mem_vfree(pBeacon); return; } /*during scanning, when any session is active, and beacon/Pr belongs to @@ -191,7 +191,7 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps // STA in WT_JOIN_BEACON_STATE (IBSS) limCheckAndAnnounceJoinSuccess(pMac, pBeacon, pHdr,psessionEntry); } // if (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) - vos_mem_free(pBeacon); + vos_mem_vfree(pBeacon); } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ... else { @@ -214,9 +214,9 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps } else { - PELOG1(limLog(pMac, LOG1, FL("Received Beacon in unexpected state %d"), + limLog(pMac, LOG1, FL("Received Beacon in unexpected state %d"), psessionEntry->limMlmState); - limPrintMlmState(pMac, LOG1, psessionEntry->limMlmState);) + limPrintMlmState(pMac, LOG1, psessionEntry->limMlmState); #ifdef WLAN_DEBUG pMac->lim.gLimUnexpBcnCnt++; #endif @@ -264,7 +264,7 @@ limProcessBeaconFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)) { - pBeacon = vos_mem_malloc(sizeof(tSchBeaconStruct)); + pBeacon = vos_mem_vmalloc(sizeof(tSchBeaconStruct)); if ( NULL == pBeacon ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessBeaconFrameNoSession") ); @@ -276,7 +276,7 @@ limProcessBeaconFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) // Received wrongly formatted/invalid Beacon. Ignore and move on. limLog(pMac, LOGW, FL("Received invalid Beacon in global MLM state %d"), pMac->lim.gLimMlmState); limPrintMlmState(pMac, LOGW, pMac->lim.gLimMlmState); - vos_mem_free(pBeacon); + vos_mem_vfree(pBeacon); return; } @@ -293,7 +293,7 @@ limProcessBeaconFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) { } // end of eLIM_MLM_LEARN_STATE) - vos_mem_free(pBeacon); + vos_mem_vfree(pBeacon); } // end of (eLIM_MLM_WT_PROBE_RESP_STATE) || (eLIM_MLM_PASSIVE_SCAN_STATE) else { diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c index 4abb196be9e4..3e3cc3776e23 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -37,7 +37,7 @@ #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sirMacProtDef.h" #include "cfgApi.h" #include "limTypes.h" @@ -649,7 +649,7 @@ limApplyConfiguration(tpAniSirGlobal pMac,tpPESession psessionEntry) { tANI_U32 val=0, phyMode; - PELOG2(limLog(pMac, LOG2, FL("Applying config"));) + limLog(pMac, LOG2, FL("Applying config")); limInitWdsInfoParams(pMac); @@ -691,9 +691,10 @@ limApplyConfiguration(tpAniSirGlobal pMac,tpPESession psessionEntry) return; } - PELOG1(limLog(pMac, LOG1, FL("pMac->lim.gScanInPowersave = %hu"), - pMac->lim.gScanInPowersave);) pMac->lim.gScanInPowersave = (tANI_U8) val; + limLog(pMac, LOG1, FL("pMac->lim.gScanInPowersave = %hu"), + pMac->lim.gScanInPowersave); + } /*** end limApplyConfiguration() ***/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c index f0ad86597558..e3f953104d08 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c @@ -68,15 +68,19 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p tpDphHashNode pStaDs; tpPESession pRoamSessionEntry=NULL; tANI_U8 roamSessionId; -#ifdef WLAN_FEATURE_11W tANI_U32 frameLen; -#endif - pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); + frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + if (frameLen < sizeof(reasonCode)) { + PELOGE(limLog(pMac, LOGE, + FL("received invalid framelen %d"), frameLen);) + return; + } + if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState)) { @@ -122,7 +126,6 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p PELOGE(limLog(pMac, LOGE, FL("received an unprotected deauth from AP"));) // If the frame received is unprotected, forward it to the supplicant to initiate // an SA query - frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); //send the unprotected frame indication to SME limSendSmeUnprotectedMgmtFrameInd( pMac, pHdr->fc.subType, @@ -264,8 +267,8 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p MAC_ADDR_ARRAY(pHdr->sa));) if (limSearchPreAuthList(pMac, pHdr->sa)) { - PELOG1(limLog(pMac, LOG1, FL("Preauth entry exist. " - "Deleting... "));) + limLog(pMac, LOG1, FL("Preauth entry exist. " + "Deleting... ")); limDeletePreAuthNode(pMac, pHdr->sa); } return; @@ -289,11 +292,11 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p */ // Log error - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("received Deauth frame state %d with failure " "code %d from "MAC_ADDRESS_STR), psessionEntry->limMlmState, reasonCode, - MAC_ADDR_ARRAY(pHdr->sa));) + MAC_ADDR_ARRAY(pHdr->sa)); limRestoreFromAuthState(pMac, eSIR_SME_DEAUTH_WHILE_JOIN, reasonCode,psessionEntry); @@ -455,7 +458,8 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p } if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || - (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)) + (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE) || + pStaDs->sta_deletion_in_progress) { /** * Already in the process of deleting context for the peer @@ -463,12 +467,19 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p */ PELOGE(limLog(pMac, LOGE, FL("received Deauth frame from peer that is in state %d, addr " - MAC_ADDRESS_STR), - pStaDs->mlmStaContext.mlmState,MAC_ADDR_ARRAY(pHdr->sa));) + MAC_ADDRESS_STR", isDisassocDeauthInProgress : %d\n"), + + pStaDs->mlmStaContext.mlmState,MAC_ADDR_ARRAY(pHdr->sa), + pStaDs->isDisassocDeauthInProgress);) + return; } pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes)reasonCode; pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DEAUTH; + pStaDs->sta_deletion_in_progress = true; + + /* send the LOST_LINK_PARAMS_IND to SME*/ + limUpdateLostLinkParams(pMac, psessionEntry, pRxPacketInfo); /// Issue Deauth Indication to SME. vos_mem_copy((tANI_U8 *) &mlmDeauthInd.peerMacAddr, diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c index e3242b627d58..2fd6f80031c4 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,7 +39,7 @@ #include "wniApi.h" #include "sirApi.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "utilsApi.h" #include "limTypes.h" @@ -77,12 +77,16 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession tpSirMacMgmtHdr pHdr; tpDphHashNode pStaDs; tLimMlmDisassocInd mlmDisassocInd; -#ifdef WLAN_FEATURE_11W - tANI_U32 frameLen; -#endif + tANI_U32 frame_len; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); + frame_len = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + + if (frame_len < 2) { + limLog(pMac, LOGE, FL("frame len less than 2")); + return; + } if (limIsGroupAddr(pHdr->sa)) @@ -112,10 +116,9 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession PELOGE(limLog(pMac, LOG1, FL("received an unprotected disassoc from AP"));) // If the frame received is unprotected, forward it to the supplicant to initiate // an SA query - frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); //send the unprotected frame indication to SME limSendSmeUnprotectedMgmtFrameInd( pMac, pHdr->fc.subType, - (tANI_U8*)pHdr, (frameLen + sizeof(tSirMacMgmtHdr)), + (tANI_U8*)pHdr, (frame_len + sizeof(tSirMacMgmtHdr)), psessionEntry->smeSessionId, psessionEntry); return; } @@ -124,11 +127,12 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession // Get reasonCode from Disassociation frame body reasonCode = sirReadU16(pBody); - PELOG2(limLog(pMac, LOGE, - FL("Received Disassoc frame for Addr: "MAC_ADDRESS_STR"(mlm state=%s, sme state=%d)," + limLog(pMac, LOGE, + FL("Received Disassoc frame for Addr: "MAC_ADDRESS_STR + "(mlm state=%s, sme state=%d)," "with reason code %d from "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da), - limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, reasonCode, - MAC_ADDR_ARRAY(pHdr->sa));) + limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, + reasonCode, MAC_ADDR_ARRAY(pHdr->sa)); /** * Extract 'associated' context for STA, if any. @@ -268,19 +272,22 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession } if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || - (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)) + (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE) || + pStaDs->sta_deletion_in_progress) { /** * Already in the process of deleting context for the peer * and received Disassociation frame. Log and Ignore. */ PELOGE(limLog(pMac, LOGE, - FL("received Disassoc frame in state %d from "MAC_ADDRESS_STR), - pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa));) + FL("received Disassoc frame in state %d from "MAC_ADDRESS_STR + ",isDisassocDeauthInProgress : %d\n"), + pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa), + pStaDs->isDisassocDeauthInProgress);) return; } - + pStaDs->sta_deletion_in_progress = true; if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) { /** @@ -329,7 +336,7 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession limRestorePreReassocState(pMac,eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry); return; } - + limUpdateLostLinkParams(pMac, psessionEntry, pRxPacketInfo); limPostSmeMessage(pMac, LIM_MLM_DISASSOC_IND, (tANI_U32 *) &mlmDisassocInd); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessLmmMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessLmmMessages.c index 353f1b1997c4..3b17bf80cbdd 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessLmmMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessLmmMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ #include "aniGlobal.h" #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "sirApi.h" #include "schApi.h" diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 5453cb6db812..62c1b8124c07 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -44,7 +44,7 @@ #include "wlan_qct_pal_packet.h" #include "wlan_qct_wda.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "sirCommon.h" #include "utilsApi.h" @@ -80,7 +80,7 @@ #include "vos_memory.h" /* This value corresponds to 500 ms */ -#define MAX_PROBEREQ_TIME 5000 +#define MAX_PROBEREQ_TIME 50 #ifdef WLAN_FEATURE_EXTSCAN #define SIZE_OF_FIXED_PARAM 12 @@ -150,7 +150,25 @@ defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) #ifdef FEATURE_OEM_DATA_SUPPORT (limMsg->type != WDA_START_OEM_DATA_RSP) && #endif - (limMsg->type != WDA_ADD_TS_RSP)) + (limMsg->type != WDA_ADD_TS_RSP) && + + /* LIM won't process any defer queue commands if gLimAddtsSent is set to + TRUE. gLimAddtsSent will be set TRUE to while sending ADDTS REQ. Say, + when deferring is enabled, if SIR_LIM_ADDTS_RSP_TIMEOUT is posted + (because of not receiving ADDTS RSP) then this command will be added + to defer queue and as gLimAddtsSent is set TRUE LIM will never + process any commands from defer queue, including + SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing SIR_LIM_ADDTS_RSP_TIMEOUT + command to be processed with deferring enabled, so that this will be + processed immediately and sets gLimAddtsSent to FALSE. + */ + (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) && + (limMsg->type != WDA_LOST_LINK_PARAMS_IND) && + /* Allow processing of RX frames while awaiting reception of + ADD TS response over the air. This logic particularly handles the + case when host sends ADD BA request to FW after ADD TS request + is sent over the air and ADD TS response received over the air */ + !(limMsg->type == SIR_BB_XPORT_MGMT_MSG && pMac->lim.gLimAddtsSent)) { PELOG1(limLog(pMac, LOG1, FL("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"), limMsgStr(limMsg->type));) @@ -358,8 +376,8 @@ static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketIn if (limIsGroupAddr(pMacHdr->addr2)) { - PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:")); - limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);) + limLog(pMac, LOG1, FL("Ignoring A2 Invalid Packet received for MC/BC:")); + limPrintMacAddr(pMac, pMacHdr->addr2, LOG1); return; } @@ -572,7 +590,7 @@ limProcessEXTScanRealTimeData(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) if ( DOT11F_FAILED( status ) ) { limLog(pMac, LOGE, FL("Failed to parse a Beacons" - "(%d):\n"), status); + "(%d)"), status); vos_mem_free(pBeacon); return; } @@ -610,7 +628,7 @@ limProcessEXTScanRealTimeData(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) if ( DOT11F_FAILED( status ) ) { limLog(pMac, LOGE, FL("Failed to parse a Probe" - "Response (%d:\n"), status); + "Response (%d"), status); vos_mem_free(pProbeResponse); return; } @@ -779,6 +797,21 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) } else #endif + + if ((fc.type == SIR_MAC_MGMT_FRAME) && + (fc.subType == SIR_MAC_MGMT_PROBE_RSP) && + pMac->lim.isSpoofingEnabled) + { + limLog( pMac, LOG2, FL("Probe Rsp recieved with DA: "MAC_ADDRESS_STR + " and selfMac Addr:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da), + MAC_ADDR_ARRAY(pMac->lim.gSelfMacAddr)); + if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pHdr->da, + (v_VOID_t*) pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN)) + { + vos_mem_copy(pHdr->da, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN); + } + } + /* Added For BT-AMP Support */ if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL) { @@ -792,8 +825,7 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) #endif if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS) { - limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); - return; + goto end; } } #endif @@ -807,8 +839,7 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL) { limLog(pMac, LOG1, FL("session does not exist for given bssId")); - limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); - return; + goto end; } else limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid", @@ -827,8 +858,7 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry)) { limLog( pMac, LOG1, FL("Received frame is passed to SME")); - limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); - return; + goto end; } @@ -837,11 +867,10 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) { // Received Frame with non-zero Protocol Version limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"), fc.protVer); - limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); #ifdef WLAN_DEBUG pMac->lim.numProtErr++; #endif - return; + goto end; } if (!pMac->fScanOffload) @@ -973,27 +1002,6 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) break; case SIR_MAC_DATA_FRAME: { -#ifdef FEATURE_WLAN_TDLS_INTERNAL - /* - * if we reach here, following cases are possible. - * Possible cases: a) if frame translation is disabled. - * b) Some frame with ADRR2 filter enabled may come - * here. - */ - tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); - tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ; - tANI_U16 ethType = GET_BE16(rfc1042Hdr) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TDLS frame with 80211 Header")) ; - if(ETH_TYPE_89_0d == ethType) - { - tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ; - if(PAYLOAD_TYPE_TDLS == payloadType) - { - limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ; - } - } -#endif #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) /* We accept data frame (IAPP frame) only if Session is * present and ese connection is established on that @@ -1011,9 +1019,7 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) } // switch (fc.type) -#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD end: -#endif limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ; return; } /*** end limHandle80211Frames() ***/ @@ -1086,7 +1092,7 @@ limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId) * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication * to start the background scan again */ - PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));) + limLog(pMac, LOG1, FL("Processing AbortScan Ind")); limAbortBackgroundScan(pMac); @@ -1294,8 +1300,29 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState), limMlmStateStr(pMac->lim.gLimMlmState));) - MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));) + /* + * MTRACE logs not captured for events received from SME + * SME enums (eWNI_SME_START_REQ) starts with 0x16xx. + * Compare received SME events with SIR_SME_MODULE_ID + */ + if (SIR_SME_MODULE_ID == (tANI_U8)MAC_TRACE_GET_MODULE_ID(limMsg->type)) + { + MTRACE(macTrace(pMac, TRACE_CODE_RX_SME_MSG, NO_SESSION, limMsg->type)); + } + else + { + /* Omitting below message types as these are too frequent and when crash + * happens we loose critical trace logs if these are also logged + */ + if (limMsg->type != SIR_LIM_MAX_CHANNEL_TIMEOUT && + limMsg->type != SIR_LIM_MIN_CHANNEL_TIMEOUT && + limMsg->type != SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT && + limMsg->type != SIR_CFG_PARAM_UPDATE_IND && + limMsg->type != SIR_BB_XPORT_MGMT_MSG) + MTRACE(macTraceMsgRx(pMac, NO_SESSION, + LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));) + } switch (limMsg->type) { @@ -1374,10 +1401,6 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) vos_pkt_t *pVosPkt; VOS_STATUS vosStatus; tSirMsgQ limMsgNew; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - tANI_U32 *pBD = NULL ; -#endif - /* The original limMsg which we were deferring have the * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer. @@ -1399,6 +1422,16 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) } +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr)) + limLog(pMac, LOG1, FL("roamCandidateInd %d"), + WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr)); + + if (WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr)) + limLog(pMac, LOG1, FL("offloadScanLearn %d"), + WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr)); +#endif + /* * putting a check for age out probe request frames * such that any probe req more than 0.5 sec old can directly @@ -1411,30 +1444,13 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) break; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL - /* - * TDLS frames comes as translated frames as well as - * MAC 802.11 data frames.. - */ - limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD); - if(0 != WDA_GET_RX_FT_DONE(pBD)) - { - /* - * TODO: check for scanning state and set deferMesg flag - * accordingly.. - */ - deferMsg = false ; - - limProcessTdlsFrame(pMac, pBD) ; - } - else -#endif limHandle80211Frames(pMac, &limMsgNew, &deferMsg); if ( deferMsg == true ) { - PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);) + limLog(pMac, LOG2, FL("Defer message type=%X "), + limMsg->type); if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) { PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"), @@ -1457,7 +1473,6 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) } } break; - case eWNI_SME_SCAN_REQ: case eWNI_SME_REMAIN_ON_CHANNEL_REQ: case eWNI_SME_DISASSOC_REQ: @@ -1473,11 +1488,6 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: // tdlsoffchan case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ: -#endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eWNI_SME_TDLS_DISCOVERY_START_REQ: - case eWNI_SME_TDLS_LINK_START_REQ: - case eWNI_SME_TDLS_TEARDOWN_REQ: #endif case eWNI_SME_RESET_AP_CAPS_CHANGED: // These messages are from HDD @@ -1555,6 +1565,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) case eWNI_SME_GET_TSM_STATS_REQ: #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ case eWNI_SME_MAC_SPOOF_ADDR_IND: + case eWNI_SME_REGISTER_MGMT_FRAME_CB: // These messages are from HDD limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd break; @@ -1756,7 +1767,11 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) limMsg->bodyptr = NULL; break; - + case WDA_LOST_LINK_PARAMS_IND: + limProcessLostLinkParamsInd(pMac,limMsg); + vos_mem_free(limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; case SIR_LIM_ADDTS_RSP_TIMEOUT: limProcessSmeReqMessages(pMac,limMsg); @@ -1821,6 +1836,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) case SIR_LIM_DISASSOC_ACK_TIMEOUT: case SIR_LIM_DEAUTH_ACK_TIMEOUT: case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: + case SIR_LIM_AUTH_RETRY_TIMEOUT: // These timeout messages are handled by MLM sub module limProcessMlmReqMessages(pMac, @@ -1946,80 +1962,6 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) limProcessWPSOverlapTimeout(pMac); break; #endif - - -#ifdef FEATURE_WLAN_TDLS_INTERNAL - /* - * Here discovery timer expires, now we can go ahead and collect all - * the dicovery responses PE has process till now and send this - * responses to SME.. - */ - case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT: - { - //fetch the sessionEntry based on the sessionId - tpPESession psessionEntry = peFindSessionBySessionId(pMac, - pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ; - if(NULL == psessionEntry) - { - limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId); - return; - } - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - ("Discovery Rsp timer expires ")) ; -#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet - /* restore RXP filters */ - limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE, - psessionEntry->bssId) ; -#endif - limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS, - eWNI_SME_TDLS_DISCOVERY_START_RSP) ; - break ; - } - - /* - * we initiated link setup and did not receive TDLS setup rsp - * from TDLS peer STA, send failure RSP to SME. - */ - case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT: - { - tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TDLS setup rsp timer expires ")) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TDLS setup rsp timer expires for peer:" - MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); - - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - if(NULL != setupPeer) - { - limTdlsDelLinkPeer( pMac, peerMac) ; - } - - limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac, - eWNI_SME_TDLS_LINK_START_RSP) ; - break ; - } - case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT: - { - tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TDLS setup CNF timer expires ")) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TDLS setup CNF timer expires for peer: " - MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - if(NULL != setupPeer) - { - limTdlsDelLinkPeer( pMac, peerMac) ; - } - break ; - } -#endif /* FEATURE_WLAN_TDLS TIMER */ case WDA_ADD_BSS_RSP: limProcessMlmAddBssRsp( pMac, limMsg ); break; @@ -2222,6 +2164,14 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) "OBSS Scan Stop not started "); } break; +#ifdef WLAN_FEATURE_AP_HT40_24G + case eWNI_SME_SET_HT_2040_MODE: + limProcessSmeReqMessages(pMac, limMsg); + vos_mem_free((v_VOID_t*)limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; +#endif + #ifdef FEATURE_WLAN_TDLS case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP: { @@ -2234,7 +2184,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) pTdlsLinkEstablishParams->staIdx, &sessionId))== NULL) { - limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId); + limLog(pMac, LOGE, FL("session %u does not exist"), sessionId); /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME with session id as zero and status as FAILURE so, that message queued in SME queue can be freed to prevent the SME cmd buffer leak */ @@ -2268,7 +2218,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) pTdlsChanSwitchParams->staIdx, &sessionId))== NULL) { - limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId); + limLog(pMac, LOGE, FL("session %u does not exist"), sessionId); /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME with session id as zero and status as FAILURE so, that message queued in SME queue can be freed to prevent the SME cmd buffer leak */ @@ -2304,6 +2254,22 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) break; } + case WDA_SPOOF_MAC_ADDR_RSP: + limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval); + break; + + case eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ: + limProcessSmeSetTdls2040BSSCoexReq(pMac, limMsg->bodyptr); + vos_mem_free((v_VOID_t*)limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; + + case eWNI_SME_DEL_ALL_TDLS_PEERS: + limProcessSmeDelAllTdlsPeers(pMac, limMsg->bodyptr); + vos_mem_free((v_VOID_t*)limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; + default: vos_mem_free((v_VOID_t*)limMsg->bodyptr); limMsg->bodyptr = NULL; @@ -2367,7 +2333,7 @@ limProcessDeferredMessageQueue(tpAniSirGlobal pMac) limProcessMessages(pMac, &limMsg); if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) || - (pMac->lim.gLimSystemInScanLearnMode)) + (pMac->lim.gLimSystemInScanLearnMode) || pMac->lim.gLimAddtsSent) break; } } @@ -2552,10 +2518,13 @@ void limLogSessionStates(tpAniSirGlobal pMac) { if(pMac->lim.gpSession[i].valid) { - PELOG1(limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d (prev sme state %d) mlm state %d (prev mlm state %d)"), - i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState, - pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState, - pMac->lim.gpSession[i].limPrevMlmState);) + limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d " + "(prev sme state %d) mlm state %d (prev mlm state %d)"), + i, pMac->lim.gpSession[i].limSystemRole, + pMac->lim.gpSession[i].limSmeState, + pMac->lim.gpSession[i].limPrevSmeState, + pMac->lim.gpSession[i].limMlmState, + pMac->lim.gpSession[i].limPrevMlmState); } } #endif //ifdef WLAN_DEBUG diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index 853f5b5127e0..0a61d6886f7c 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,7 +36,7 @@ * */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "sirApi.h" #include "sirParams.h" @@ -88,6 +88,8 @@ static void limProcessAuthFailureTimeout(tpAniSirGlobal); static void limProcessAuthRspTimeout(tpAniSirGlobal, tANI_U32); static void limProcessAssocFailureTimeout(tpAniSirGlobal, tANI_U32); static void limProcessPeriodicJoinProbeReqTimer(tpAniSirGlobal); +static void limProcessAuthRetryTimer(tpAniSirGlobal); + static void limProcessMlmRemoveKeyReq(tpAniSirGlobal pMac, tANI_U32 * pMsgBuf); void @@ -158,6 +160,9 @@ limProcessMlmReqMessages(tpAniSirGlobal pMac, tpSirMsgQ Msg) limProcessInsertSingleShotNOATimeout(pMac); break; case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: limConvertActiveChannelToPassiveChannel(pMac); break; + case SIR_LIM_AUTH_RETRY_TIMEOUT: + limProcessAuthRetryTimer(pMac); + break; case SIR_LIM_DISASSOC_ACK_TIMEOUT: limProcessDisassocAckTimeout(pMac); break; case SIR_LIM_DEAUTH_ACK_TIMEOUT: limProcessDeauthAckTimeout(pMac); break; case LIM_MLM_ADDBA_REQ: limProcessMlmAddBAReq( pMac, Msg->bodyptr ); break; @@ -207,7 +212,7 @@ limSetScanMode(tpAniSirGlobal pMac) else checkTraffic = eSIR_CHECK_ROAMING_SCAN; - PELOG1(limLog(pMac, LOG1, FL("Calling limSendHalInitScanReq"));) + limLog(pMac, LOG1, FL("Calling limSendHalInitScanReq")); limSendHalInitScanReq(pMac, eLIM_HAL_INIT_SCAN_WAIT_STATE, checkTraffic); return ; @@ -266,9 +271,12 @@ limSuspendLink(tpAniSirGlobal pMac, tSirLinkTrafficCheck trafficCheck, SUSPEND_ return; } - if( pMac->lim.gpLimSuspendCallback ) + if( pMac->lim.gpLimSuspendCallback || + pMac->lim.gLimSystemInScanLearnMode ) { - limLog( pMac, LOGE, "%s:%d: gLimSuspendLink callback is not NULL...something is wrong", __func__, __LINE__ ); + limLog( pMac, LOGE, FL("Something is wrong, SuspendLinkCbk:%pK " + "IsSystemInScanLearnMode:%d"), pMac->lim.gpLimSuspendCallback, + pMac->lim.gLimSystemInScanLearnMode ); callback( pMac, eHAL_STATUS_FAILURE, data ); return; } @@ -399,10 +407,9 @@ limChangeChannelWithCallback(tpAniSirGlobal pMac, tANI_U8 newChannel, void limContinuePostChannelScan(tpAniSirGlobal pMac) { tANI_U8 channelNum; - tANI_U8 handleError = 0; tANI_U8 i = 0; tSirRetStatus status = eSIR_SUCCESS; - + if( pMac->lim.abortScan || (NULL == pMac->lim.gpLimMlmScanReq ) || (pMac->lim.gLimCurrentScanChannelId > (tANI_U32)(pMac->lim.gpLimMlmScanReq->channelList.numChannels - 1))) @@ -430,19 +437,36 @@ void limContinuePostChannelScan(tpAniSirGlobal pMac) (limActiveScanAllowed(pMac, channelNum))) { TX_TIMER *periodicScanTimer; - PELOG2(limLog(pMac, LOG2, FL("ACTIVE Scan chan %d, sending probe"), channelNum);) pMac->lim.probeCounter++; + /* Prepare and send Probe Request frame for all + * the SSIDs present in the saved MLM + */ do { - /* Prepare and send Probe Request frame for all the SSIDs present in the saved MLM - */ - - PELOGE(limLog(pMac, LOG1, FL("sending ProbeReq number %d, for SSID %s on channel: %d"), - i, pMac->lim.gpLimMlmScanReq->ssId[i].ssId, channelNum);) + tSirMacAddr gSelfMacAddr; + + /* Send self MAC as src address if + * MAC spoof is not enabled OR + * spoofMacAddr is all 0 OR + * disableP2PMacSpoof is enabled and scan is P2P scan + * else use the spoofMac as src address + */ + if ((pMac->lim.isSpoofingEnabled != TRUE) || + (TRUE == + vos_is_macaddr_zero((v_MACADDR_t *)&pMac->lim.spoofMacAddr)) || + (pMac->roam.configParam.disableP2PMacSpoofing && + pMac->lim.gpLimMlmScanReq->p2pSearch)) { + vos_mem_copy(gSelfMacAddr, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN); + } else { + vos_mem_copy(gSelfMacAddr, pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN); + } + limLog(pMac, LOG1, + FL(" Mac Addr "MAC_ADDRESS_STR " used in sending ProbeReq number %d, for SSID %s on channel: %d"), + MAC_ADDR_ARRAY(gSelfMacAddr) ,i, pMac->lim.gpLimMlmScanReq->ssId[i].ssId, channelNum); // include additional IE if there is status = limSendProbeReqMgmtFrame( pMac, &pMac->lim.gpLimMlmScanReq->ssId[i], - pMac->lim.gpLimMlmScanReq->bssId, channelNum, pMac->lim.gSelfMacAddr, + pMac->lim.gpLimMlmScanReq->bssId, channelNum, gSelfMacAddr, pMac->lim.gpLimMlmScanReq->dot11mode, pMac->lim.gpLimMlmScanReq->uIEFieldLen, (tANI_U8 *)(pMac->lim.gpLimMlmScanReq)+pMac->lim.gpLimMlmScanReq->uIEFieldOffset); @@ -471,17 +495,18 @@ void limContinuePostChannelScan(tpAniSirGlobal pMac) limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); #ifdef GEN6_TODO - /* revisit this piece of code to assign the appropriate sessionId below - * priority - LOW/might not be needed - */ + /* revisit this piece of code to assign the appropriate sessionId + * below priority - LOW/might not be needed + */ pMac->lim.limTimers.gLimMinChannelTimer.sessionId = sessionId; -#endif - - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_MIN_CHANNEL_TIMER)); - - if (tx_timer_activate(&pMac->lim.limTimers.gLimMinChannelTimer) != TX_SUCCESS) +#endif + if (tx_timer_activate(&pMac->lim.limTimers.gLimMinChannelTimer) != + TX_SUCCESS) { - limLog(pMac, LOGP, FL("could not start min channel timer")); + limLog(pMac, LOGE, FL("could not start min channel timer")); + limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); + limSendHalEndScanReq(pMac, channelNum, + eLIM_HAL_END_SCAN_WAIT_STATE); return; } @@ -496,14 +521,16 @@ void limContinuePostChannelScan(tpAniSirGlobal pMac) #endif //No Need to start Min channel timer. Start Max Channel timer. limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, pMac->lim.limTimers.gLimMaxChannelTimer.sessionId, eLIM_MAX_CHANNEL_TIMER)); if (tx_timer_activate(&pMac->lim.limTimers.gLimMaxChannelTimer) == TX_TIMER_ERROR) { /// Could not activate max channel timer. // Log error - limLog(pMac,LOGP, FL("could not start max channel timer")); - return; + limLog(pMac,LOGE, FL("could not start max channel timer")); + limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); + limSendHalEndScanReq(pMac, + channelNum, eLIM_HAL_END_SCAN_WAIT_STATE); + return; } } @@ -515,31 +542,28 @@ void limContinuePostChannelScan(tpAniSirGlobal pMac) limDeactivateAndChangeTimer(pMac, eLIM_PERIODIC_PROBE_REQ_TIMER); if (tx_timer_activate(periodicScanTimer) != TX_SUCCESS) { - limLog(pMac, LOGP, FL("could not start periodic probe req " + limLog(pMac, LOGE, FL("could not start periodic probe req " "timer")); - return; } periodicScanTimer->sessionId = channelNum; - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, periodicScanTimer->sessionId, eLIM_PERIODIC_PROBE_REQ_TIMER)); } else { tANI_U32 val; - PELOG2(limLog(pMac, LOG2, FL("START PASSIVE Scan chan %d"), channelNum);) + limLog(pMac, LOG1, FL("START PASSIVE Scan chan %d"), channelNum); /// Passive Scanning. Activate maxChannelTimer - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, eLIM_MAX_CHANNEL_TIMER)); if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer) != TX_SUCCESS) { // Could not deactivate max channel timer. // Log error - limLog(pMac, LOGP, FL("Unable to deactivate max channel timer")); - return; + limLog(pMac, LOGE, FL("Unable to deactivate max channel timer")); + limSendHalEndScanReq(pMac, channelNum, + eLIM_HAL_END_SCAN_WAIT_STATE); } else { - tANI_U32 val1 = 0; if (pMac->miracast_mode) { val = DEFAULT_MIN_CHAN_TIME_DURING_MIRACAST + @@ -552,70 +576,38 @@ void limContinuePostChannelScan(tpAniSirGlobal pMac) * Could not get max channel value * from CFG. Log error. */ - limLog(pMac, LOGP, FL("could not retrieve passive max channel value")); - return; + limLog(pMac, LOGE, + FL("could not retrieve passive max chan value, Use Def val")); + val= WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF; } val = SYS_MS_TO_TICKS(val); - //TODO: consider sessions. -#if 0 - // If a background was triggered via Quiet BSS, - // then we need to adjust the MIN and MAX channel - // timer's accordingly to the Quiet duration that - // was specified - if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState && - pMac->lim.gLimTriggerBackgroundScanDuringQuietBss ) - { - // gLimQuietDuration is already cached in units of - // system ticks. No conversion is reqd... - val1 = pMac->lim.gLimSpecMgmt.quietDuration; - } - else - { - val1 = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime); - } -#endif - //Pick the longer stay time - val = (val > val1) ? val : val1; - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_MAX_CHANNEL_TIMER)); if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer, val, 0) != TX_SUCCESS) { // Could not change max channel timer. // Log error - limLog(pMac, LOGP, FL("Unable to change max channel timer")); + limLog(pMac, LOGE, FL("Unable to change max channel timer")); + limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); + limSendHalEndScanReq(pMac, channelNum, + eLIM_HAL_END_SCAN_WAIT_STATE); return; } - else if (tx_timer_activate(&pMac->lim.limTimers.gLimMaxChannelTimer) != TX_SUCCESS) + else if (tx_timer_activate(&pMac->lim.limTimers.gLimMaxChannelTimer) + != TX_SUCCESS) { - limLog(pMac, LOGP, FL("could not start max channel timer")); + + limLog(pMac, LOGE, FL("could not start max channel timer")); + limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); + limSendHalEndScanReq(pMac, channelNum, + eLIM_HAL_END_SCAN_WAIT_STATE); return; } } // Wait for Beacons to arrive } // if (pMac->lim.gLimMlmScanReq->scanType == eSIR_ACTIVE_SCAN) - if( handleError ) - { - // - // FIXME - With this, LIM/SoftMAC will try and recover - // state, but eWNI_SME_SCAN_CNF maybe reporting an - // incorrect status back to the SME. Some of the possible - // errors are: - // eSIR_SME_HAL_SCAN_INIT_FAILED - // eSIR_SME_RESOURCES_UNAVAILABLE - // - //Set the resume channel to Any valid channel (invalid). - //This will instruct HAL to set it to any previous valid channel. - peSetResumeChannel(pMac, 0, 0); - limSendHalFinishScanReq( pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE ); - //limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); - } - else - { - limAddScanChannelInfo(pMac, channelNum); - } - + limAddScanChannelInfo(pMac, channelNum); return; } @@ -662,21 +654,27 @@ void limCovertChannelScanType(tpAniSirGlobal pMac,tANI_U8 channelNum, tANI_BOOLE limLog(pMac, LOGE, FL("Invalid scan control list length:%d"), len); return ; } + if (pMac->fActiveScanOnDFSChannels) + { + limLog(pMac, LOG1, FL("DFS feature triggered," + "block scan type conversion")); + return ; + } for (i=0; (i+1) < len; i+=2) { if (channelPair[i] == channelNum) { if ((eSIR_PASSIVE_SCAN == channelPair[i+1]) && TRUE == passiveToActive) { - PELOG1(limLog(pMac, LOG1, FL("Channel %d changed from Passive to Active"), - channelNum);) + limLog(pMac, LOG1, FL("Channel %d changed from Passive to Active"), + channelNum); channelPair[i+1] = eSIR_ACTIVE_SCAN; break ; } if ((eSIR_ACTIVE_SCAN == channelPair[i+1]) && FALSE == passiveToActive) { - PELOG1(limLog(pMac, LOG1, FL("Channel %d changed from Active to Passive"), - channelNum);) + limLog(pMac, LOG1, FL("Channel %d changed from Active to Passive"), + channelNum); channelPair[i+1] = eSIR_PASSIVE_SCAN; break ; } @@ -722,14 +720,13 @@ void limSetDFSChannelList(tpAniSirGlobal pMac,tANI_U8 channelNum, tSirDFSChannel if (dfsChannelList->timeStamp[channelNum] == 0) { //Received first beacon; Convert DFS channel to Active channel. - PELOG1(limLog(pMac, LOG1, FL("Received first beacon on DFS channel: %d"), channelNum);) + limLog(pMac, LOG1, FL("Received first beacon on DFS channel: %d"), channelNum); limCovertChannelScanType(pMac,channelNum, passiveToActive); } dfsChannelList->timeStamp[channelNum] = vos_timer_get_system_time(); } else { - PELOG1(limLog(pMac, LOG1, FL("Channel %d is Active"), channelNum);) return; } if (!tx_timer_running(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer)) @@ -938,6 +935,7 @@ limSendHalInitScanReq(tpAniSirGlobal pMac, tLimLimHalScanState nextState, tSirLi switch(nextState) { case eLIM_HAL_START_SCAN_WAIT_STATE: + case eLIM_HAL_INIT_SCAN_WAIT_STATE: limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); break; @@ -992,7 +990,6 @@ limSendHalStartScanReq(tpAniSirGlobal pMac, tANI_U8 channelNum, tLimLimHalScanSt SET_LIM_PROCESS_DEFD_MESGS(pMac, false); MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); - limLog(pMac, LOG1, FL("Channel %d"), channelNum); rc = wdaPostCtrlMsg(pMac, &msg); if (rc == eSIR_SUCCESS) { @@ -1241,10 +1238,6 @@ limContinueChannelScan(tpAniSirGlobal pMac) { tANI_U8 channelNum; - PELOG1(limLog(pMac, LOG1, FL("Continue SCAN : chan %d tot %d"), - pMac->lim.gLimCurrentScanChannelId, - pMac->lim.gpLimMlmScanReq->channelList.numChannels);) - if (pMac->lim.gLimCurrentScanChannelId > (tANI_U32) (pMac->lim.gpLimMlmScanReq->channelList.numChannels - 1) || pMac->lim.abortScan) @@ -1299,8 +1292,8 @@ limContinueChannelScan(tpAniSirGlobal pMac) } channelNum = limGetCurrentScanChannel(pMac); - PELOG2(limLog(pMac, LOG2, FL("Current Channel to be scanned is %d"), - channelNum);) + limLog(pMac, LOG1, FL("Current Channel to be scanned is %d"), + channelNum); limSendHalStartScanReq(pMac, channelNum, eLIM_HAL_START_SCAN_WAIT_STATE); return; @@ -1361,7 +1354,8 @@ limRestorePreScanState(tpAniSirGlobal pMac) //limCleanupMsgQ(pMac); pMac->lim.gLimSystemInScanLearnMode = 0; - PELOG1(limLog(pMac, LOG1, FL("Scan ended, took %d tu"), (tx_time_get() - pMac->lim.scanStartTime));) + limLog(pMac, LOG1, FL("Scan ended, took %ld tu"), + (tx_time_get() - pMac->lim.scanStartTime)); } /*** limRestorePreScanState() ***/ #ifdef FEATURE_OEM_DATA_SUPPORT @@ -1506,18 +1500,18 @@ void limSetOemDataReqMode(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* data if(status != eHAL_STATUS_SUCCESS) { limLog(pMac, LOGE, FL("OEM_DATA: failed in suspend link")); - goto error; + /* If failed to suspend the link, there is no need + * to resume link. Return failure. + */ + limSetOemDataReqModeFailed(pMac, status, data); } else { PELOGE(limLog(pMac, LOGE, FL("OEM_DATA: Calling limSendHalOemDataReq"));) limSendHalOemDataReq(pMac); - return; } -error: - limResumeLink(pMac, limSetOemDataReqModeFailed, NULL); - return ; + return; } /*** end limSendHalOemDataReq() ***/ #endif //FEATURE_OEM_DATA_SUPPORT @@ -1666,8 +1660,15 @@ limMlmAddBss ( pAddBssParams->cfParamSet.cfpDurRemaining = pMlmStartReq->cfParamSet.cfpDurRemaining; pAddBssParams->rateSet.numRates = pMlmStartReq->rateSet.numRates; + if (pAddBssParams->rateSet.numRates > SIR_MAC_RATESET_EID_MAX) { + limLog(pMac, LOGW, + FL("num of sup rates %d exceeding the limit %d, resetting"), + pAddBssParams->rateSet.numRates, + SIR_MAC_RATESET_EID_MAX); + pAddBssParams->rateSet.numRates = SIR_MAC_RATESET_EID_MAX; + } vos_mem_copy(pAddBssParams->rateSet.rate, - pMlmStartReq->rateSet.rate, pMlmStartReq->rateSet.numRates); + pMlmStartReq->rateSet.rate, pAddBssParams->rateSet.numRates); pAddBssParams->nwType = pMlmStartReq->nwType; @@ -1691,10 +1692,19 @@ limMlmAddBss ( pAddBssParams->sessionId = pMlmStartReq->sessionId; //Send the SSID to HAL to enable SSID matching for IBSS - vos_mem_copy(&(pAddBssParams->ssId.ssId), - pMlmStartReq->ssId.ssId, - pMlmStartReq->ssId.length); pAddBssParams->ssId.length = pMlmStartReq->ssId.length; + if (pAddBssParams->ssId.length > SIR_MAC_MAX_SSID_LENGTH) { + limLog(pMac, LOGE, + FL("Invalid ssid length %d, max length allowed %d"), + pAddBssParams->ssId.length, + SIR_MAC_MAX_SSID_LENGTH); + vos_mem_free(pAddBssParams); + return eSIR_SME_INVALID_PARAMETERS; + } + vos_mem_copy(pAddBssParams->ssId.ssId, + pMlmStartReq->ssId.ssId, + pAddBssParams->ssId.length); + pAddBssParams->bHiddenSSIDEn = pMlmStartReq->ssidHidden; limLog( pMac, LOGE, FL( "TRYING TO HIDE SSID %d" ),pAddBssParams->bHiddenSSIDEn); // CR309183. Disable Proxy Probe Rsp. Host handles Probe Requests. Until FW fixed. @@ -1981,8 +1991,8 @@ limProcessMlmScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) /// Hold onto SCAN REQ criteria pMac->lim.gpLimMlmScanReq = (tLimMlmScanReq *) pMsgBuf; - PELOG3(limLog(pMac, LOG3, FL("Number of channels to scan are %d "), - pMac->lim.gpLimMlmScanReq->channelList.numChannels);) + limLog(pMac, LOG1, FL("Number of channels to scan are %d "), + pMac->lim.gpLimMlmScanReq->channelList.numChannels); pMac->lim.gLimPrevMlmState = pMac->lim.gLimMlmState; @@ -2005,10 +2015,10 @@ limProcessMlmScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) * Could not get max channel value * from CFG. Log error. */ - limLog(pMac, LOGP, FL("could not retrieve passive max channel value")); - - /* use a default value of 110ms */ - val = 110; + limLog(pMac, LOGP, + FL("could not retrieve passive max channel value use def")); + /* use a default value */ + val= WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF; } for (i = 0; i < pMac->lim.gpLimMlmScanReq->channelList.numChannels; i++) { @@ -2273,20 +2283,20 @@ limProcessMlmJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if( isLimSessionOffChannel(pMac, sessionId) ) { - limLog(pMac,LOG1,"SessionId:%d LimSession is on OffChannel", - sessionId); //suspend link limLog(pMac, LOG1, FL("Suspend link as LimSession on sessionid %d" "is off channel"),sessionId); + if (limIsLinkSuspended(pMac)) + { + limLog(pMac, LOGE, FL("Link is already suspended for some other" + " reason. Return failure on sessionId:%d"), sessionId); + goto error; + } limSuspendLink(pMac, eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN, limProcessMlmPostJoinSuspendLink, (tANI_U32*)psessionEntry ); } else { - limLog(pMac, LOG1, FL("No need to Suspend link as LimSession on " - "sessionid %d is not off channel, calling " - "limProcessMlmPostJoinSuspendLink with status as SUCCESS"), - sessionId); //No need to suspend link. limLog(pMac,LOG1,"SessionId:%d Join request on current channel", sessionId); @@ -2299,31 +2309,26 @@ limProcessMlmJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) else { /** - * Should not have received JOIN req in states other than - * Idle state or on AP. - * Return join confirm with invalid parameters code. - */ - PELOGE(limLog(pMac, LOGE, - FL("Unexpected Join request for role %d state %d"), - psessionEntry->limSystemRole, - psessionEntry->limMlmState);) - limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); - + * Should not have received JOIN req in states other than + * Idle state or on AP. + * Return join confirm with invalid parameters code. + */ limLog(pMac, LOGE, FL("SessionId:%d Unexpected Join request for role %d state %d "), psessionEntry->peSessionId,psessionEntry->limSystemRole, psessionEntry->limMlmState); + limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); } error: + vos_mem_free(pMsgBuf); + if (psessionEntry != NULL) + psessionEntry->pLimMlmJoinReq = NULL; - - mlmJoinCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; - mlmJoinCnf.sessionId = sessionId; - mlmJoinCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; - limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); - - + mlmJoinCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; + mlmJoinCnf.sessionId = sessionId; + mlmJoinCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); } /*** limProcessMlmJoinReq() ***/ @@ -2483,14 +2488,17 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) (tANI_U8) pMac->lim.gpLimMlmAuthReq->authType; authFrameBody.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; authFrameBody.authStatusCode = 0; + pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD; limSendAuthMgmtFrame(pMac, &authFrameBody, pMac->lim.gpLimMlmAuthReq->peerMacAddr, - LIM_NO_WEP_IN_FC,psessionEntry); + LIM_NO_WEP_IN_FC, psessionEntry, eSIR_TRUE); //assign appropriate sessionId to the timer object pMac->lim.limTimers.gLimAuthFailureTimer.sessionId = sessionId; - + /* assign appropriate sessionId to the timer object */ + pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId = sessionId; + limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); // Activate Auth failure timer MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_AUTH_FAIL_TIMER)); if (tx_timer_activate(&pMac->lim.limTimers.gLimAuthFailureTimer) @@ -2503,7 +2511,17 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) // Cleanup as if auth timer expired limProcessAuthFailureTimeout(pMac); } - + else + { + MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, + psessionEntry->peSessionId, eLIM_AUTH_RETRY_TIMER)); + // Activate Auth Retry timer + if (tx_timer_activate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer) + != TX_SUCCESS) + { + limLog(pMac, LOGP, FL("could not activate Auth Retry timer")); + } + } return; } else @@ -2834,6 +2852,9 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ tLimMlmDisassocCnf mlmDisassocCnf; tpPESession psessionEntry; extern tANI_BOOLEAN sendDisassocFrame; + tSirSmeDisassocRsp *pSirSmeDisassocRsp; + tANI_U32 *pMsg; + tANI_U8 *pBuf; if(eHAL_STATUS_SUCCESS != suspendStatus) { @@ -2924,16 +2945,45 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ * have context or in some transit state. * Log error */ - PELOGW(limLog(pMac, LOGW, + limLog(pMac, LOGE, FL("received MLM_DISASSOC_REQ for STA that either has no context " "or in some transit state, Addr= " - MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMlmDisassocReq->peerMacAddr));) + MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMlmDisassocReq->peerMacAddr)); + if (pStaDs != NULL) + limLog(pMac, LOGE, FL("Sta MlmState : %d"), + pStaDs->mlmStaContext.mlmState); - /// Prepare and Send LIM_MLM_DISASSOC_CNF + /* + * Disassociation response due to + * host triggered disassociation + */ - mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; + pSirSmeDisassocRsp = vos_mem_malloc(sizeof(tSirSmeDisassocRsp)); + if ( NULL == pSirSmeDisassocRsp ) + { + // Log error + limLog(pMac, LOGP, + FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_RSP")); + return; + } + limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_RSP with " + "retCode: %d for "MAC_ADDRESS_STR),eSIR_SME_DEAUTH_STATUS, + MAC_ADDR_ARRAY(pMlmDisassocReq->peerMacAddr)); + pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP; + pSirSmeDisassocRsp->length = sizeof(tSirSmeDisassocRsp); + pSirSmeDisassocRsp->sessionId = pMlmDisassocReq->sessionId; + pSirSmeDisassocRsp->transactionId = 0; + pSirSmeDisassocRsp->statusCode = eSIR_SME_DEAUTH_STATUS; + + pBuf = (tANI_U8 *) pSirSmeDisassocRsp->peerMacAddr; + vos_mem_copy( pBuf, pMlmDisassocReq->peerMacAddr, sizeof(tSirMacAddr)); + + pMsg = (tANI_U32*) pSirSmeDisassocRsp; + + limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, + (tANI_U32*) pMsg ); + return; - goto end; } //pStaDs->mlmStaContext.rxPurgeReq = 1; @@ -3116,13 +3166,7 @@ void limProcessDisassocAckTimeout(tpAniSirGlobal pMac) static void limProcessMlmDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { -// tANI_U16 aid; -// tSirMacAddr currentBssId; -// tpDphHashNode pStaDs; tLimMlmDisassocReq *pMlmDisassocReq; -// tLimMlmDisassocCnf mlmDisassocCnf; - tpPESession psessionEntry; -// extern tANI_BOOLEAN sendDisassocFrame; if(pMsgBuf == NULL) { @@ -3131,18 +3175,11 @@ limProcessMlmDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } pMlmDisassocReq = (tLimMlmDisassocReq *) pMsgBuf; + limLog(pMac, LOG1,FL("Process DisAssoc Req on sessionID %d " "from: "MAC_ADDRESS_STR), pMlmDisassocReq->sessionId, MAC_ADDR_ARRAY(pMlmDisassocReq->peerMacAddr)); - if((psessionEntry = peFindSessionBySessionId(pMac,pMlmDisassocReq->sessionId))== NULL) - { - - limLog(pMac, LOGE, - FL("session does not exist for given sessionId %d"), - pMlmDisassocReq->sessionId); - return; - } limProcessMlmDisassocReqNtf( pMac, eHAL_STATUS_SUCCESS, (tANI_U32*) pMsgBuf ); } /*** limProcessMlmDisassocReq() ***/ @@ -3157,6 +3194,9 @@ limProcessMlmDeauthReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_U3 tLimMlmDeauthReq *pMlmDeauthReq; tLimMlmDeauthCnf mlmDeauthCnf; tpPESession psessionEntry; + tSirSmeDeauthRsp *pSirSmeDeauthRsp; + tANI_U8 *pBuf; + tANI_U32 *pMsg; if(eHAL_STATUS_SUCCESS != suspendStatus) @@ -3272,10 +3312,10 @@ limProcessMlmDeauthReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_U3 break; case eLIM_STA_IN_IBSS_ROLE: - vos_mem_free(pMlmDeauthReq); - - return; - + limLog(pMac, LOGE, + FL("received MLM_DEAUTH_REQ IBSS Mode ")); + mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; + goto end; default: // eLIM_AP_ROLE break; @@ -3338,11 +3378,38 @@ limProcessMlmDeauthReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_U3 FL("received MLM_DEAUTH_REQ for STA that either has no context or in some transit state, Addr=" MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMlmDeauthReq->peerMacAddr));) - /// Prepare and Send LIM_MLM_DEAUTH_CNF + /* + * Deauthentication response to host triggered + * deauthentication. + */ + pSirSmeDeauthRsp = vos_mem_malloc(sizeof(tSirSmeDeauthRsp)); + if ( NULL == pSirSmeDeauthRsp ) + { + // Log error + limLog(pMac, LOGP, + FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_RSP")); - mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; + return; + } + limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " + "retCode: %d for"MAC_ADDRESS_STR),eSIR_SME_DEAUTH_STATUS, + MAC_ADDR_ARRAY(pMlmDeauthReq->peerMacAddr)); + pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP; + pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp); + pSirSmeDeauthRsp->statusCode = eSIR_SME_DEAUTH_STATUS; + pSirSmeDeauthRsp->sessionId = pMlmDeauthReq->sessionId; + pSirSmeDeauthRsp->transactionId = 0; + + pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr; + vos_mem_copy( pBuf, pMlmDeauthReq->peerMacAddr, sizeof(tSirMacAddr)); + + pMsg = (tANI_U32*)pSirSmeDeauthRsp; + + limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, + (tANI_U32*) pMsg ); + + return; - goto end; } //pStaDs->mlmStaContext.rxPurgeReq = 1; @@ -3835,8 +3902,6 @@ limProcessMinChannelTimeout(tpAniSirGlobal pMac) if (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE && pMac->lim.gLimHalScanState != eLIM_HAL_FINISH_SCAN_WAIT_STATE) { - PELOG1(limLog(pMac, LOG1, FL("Scanning : min channel timeout occurred"));) - /// Min channel timer timed out pMac->lim.limTimers.gLimPeriodicProbeReqTimer.sessionId = 0xff; limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); @@ -3910,7 +3975,7 @@ limProcessMaxChannelTimeout(tpAniSirGlobal pMac) pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) && pMac->lim.gLimHalScanState != eLIM_HAL_FINISH_SCAN_WAIT_STATE) { - PELOG1(limLog(pMac, LOG1, FL("Scanning : Max channel timed out"));) + limLog(pMac, LOG1, FL("Scanning : Max channel timed out")); /** * MAX channel timer timed out * Continue channel scan. @@ -3984,7 +4049,7 @@ limProcessPeriodicProbeReqTimer(tpAniSirGlobal pMac) if(vos_timer_getCurrentState(&pPeriodicProbeReqTimer->vosTimer) != VOS_TIMER_STATE_STOPPED) { - PELOG1(limLog(pMac, LOG1, FL("Invalid state of timer"));) + limLog(pMac, LOG1, FL("Invalid state of timer")); return; } @@ -3992,19 +4057,37 @@ limProcessPeriodicProbeReqTimer(tpAniSirGlobal pMac) (pPeriodicProbeReqTimer->sessionId != 0xff) && (pMac->lim.probeCounter < pMac->lim.maxProbe)) { tLimMlmScanReq *pLimMlmScanReq = pMac->lim.gpLimMlmScanReq; - PELOG1(limLog(pMac, LOG1, FL("Scanning : Periodic scanning"));) pMac->lim.probeCounter++; /** * Periodic channel timer timed out * to send probe request. */ channelNum = limGetCurrentScanChannel(pMac); + /* Prepare and send Probe Request frame for all the SSIDs + * present in the saved MLM + */ do { - /* Prepare and send Probe Request frame for all the SSIDs - * present in the saved MLM + tSirMacAddr gSelfMacAddr; + + /* Send self MAC as src address if + * MAC spoof is not enabled OR + * spoofMacAddr is all 0 OR + * disableP2PMacSpoof is enabled and scan is P2P scan + * else use the spoofMac as src address */ - + if ((pMac->lim.isSpoofingEnabled != TRUE) || + (TRUE == + vos_is_macaddr_zero((v_MACADDR_t *)&pMac->lim.spoofMacAddr)) || + (pMac->roam.configParam.disableP2PMacSpoofing && + pMac->lim.gpLimMlmScanReq->p2pSearch)) { + vos_mem_copy(gSelfMacAddr, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN); + } else { + vos_mem_copy(gSelfMacAddr, pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN); + } + limLog( pMac, LOG1, FL("Mac Addr used in Probe Req is :"MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(gSelfMacAddr)); + /* * PELOGE(limLog(pMac, LOGW, FL("sending ProbeReq number %d," * " for SSID %s on channel: %d"), @@ -4012,7 +4095,7 @@ limProcessPeriodicProbeReqTimer(tpAniSirGlobal pMac) * channelNum);) */ status = limSendProbeReqMgmtFrame( pMac, &pLimMlmScanReq->ssId[i], - pLimMlmScanReq->bssId, channelNum, pMac->lim.gSelfMacAddr, + pLimMlmScanReq->bssId, channelNum, gSelfMacAddr, pLimMlmScanReq->dot11mode, pLimMlmScanReq->uIEFieldLen, (tANI_U8 *)(pLimMlmScanReq) + pLimMlmScanReq->uIEFieldOffset); @@ -4029,7 +4112,6 @@ limProcessPeriodicProbeReqTimer(tpAniSirGlobal pMac) } while (i < pLimMlmScanReq->numSsid); /* Activate timer again */ - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, pPeriodicProbeReqTimer->sessionId, eLIM_PERIODIC_PROBE_REQ_TIMER)); if (tx_timer_activate(pPeriodicProbeReqTimer) != TX_SUCCESS) { limLog(pMac, LOGP, FL("could not start periodic probe" @@ -4212,6 +4294,75 @@ static void limProcessPeriodicJoinProbeReqTimer(tpAniSirGlobal pMac) return; } /*** limProcessPeriodicJoinProbeReqTimer() ***/ +/** + * limProcessAuthRetryTimer() + * + *FUNCTION: + * This function is called to process Auth Retry request + * send during joining process. + * + *LOGIC: + * + *ASSUMPTIONS: + * + *NOTE: + * + * @param pMac Pointer to Global MAC structure + * @return None + */ + +static void limProcessAuthRetryTimer(tpAniSirGlobal pMac) +{ + tpPESession psessionEntry; + limLog(pMac, LOG1, FL(" ENTER ")); + if ((psessionEntry = + peFindSessionBySessionId(pMac, + pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId)) == NULL) + { + limLog(pMac, LOGE,FL("session does not exist for given SessionId : %d"), + pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId); + return; + } + + if ((VOS_TRUE == + tx_timer_running(&pMac->lim.limTimers.gLimAuthFailureTimer)) && + (psessionEntry->limMlmState == eLIM_MLM_WT_AUTH_FRAME2_STATE) && + (LIM_AUTH_ACK_RCD_SUCCESS != pMac->authAckStatus)) + { + tSirMacAuthFrameBody authFrameBody; + + /* Send the auth retry only in case we have received ack failure + * else just restart the retry timer. + */ + if (LIM_AUTH_ACK_RCD_FAILURE == pMac->authAckStatus) + { + /// Prepare & send Authentication frame + authFrameBody.authAlgoNumber = + (tANI_U8) pMac->lim.gpLimMlmAuthReq->authType; + authFrameBody.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; + authFrameBody.authStatusCode = 0; + limLog(pMac, LOGW, FL("Retry Auth ")); + pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD; + limSendAuthMgmtFrame(pMac, + &authFrameBody, + pMac->lim.gpLimMlmAuthReq->peerMacAddr, + LIM_NO_WEP_IN_FC, psessionEntry, eSIR_TRUE); + } + + limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); + + // Activate Auth Retry timer + if (tx_timer_activate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer) + != TX_SUCCESS) + { + limLog(pMac, LOGE, + FL("could not activate Auth Retry failure timer")); + return; + } + } + return; +} /*** limProcessAuthRetryTimer() ***/ + /** * limProcessAuthFailureTimeout() @@ -4347,9 +4498,9 @@ limProcessAuthRspTimeout(tpAniSirGlobal pMac, tANI_U32 authIndex) // timedout for an STA. pAuthNode->mlmState = eLIM_MLM_AUTH_RSP_TIMEOUT_STATE; pAuthNode->fTimerStarted = 0; - PELOG1( limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("AUTH rsp timedout for MAC address "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pAuthNode->peerMacAddr));) + MAC_ADDR_ARRAY(pAuthNode->peerMacAddr)); // Change timer to reactivate it in future limDeactivateAndChangePerStaIdTimer(pMac, @@ -4429,8 +4580,8 @@ limProcessAssocFailureTimeout(tpAniSirGlobal pMac, tANI_U32 MsgType) WLANTL_AssocFailed (psessionEntry->staId); // Log error - PELOG1(limLog(pMac, LOG1, - FL("Re/Association Response not received before timeout "));) + limLog(pMac, LOG1, + FL("Re/Association Response not received before timeout ")); if (( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) )|| ( (psessionEntry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) && @@ -4473,8 +4624,8 @@ limProcessAssocFailureTimeout(tpAniSirGlobal pMac, tANI_U32 MsgType) //To remove the preauth node in case of fail to associate if (limSearchPreAuthList(pMac, psessionEntry->bssId)) { - PELOG1(limLog(pMac, LOG1, FL(" delete pre auth node for " - MAC_ADDRESS_STR), MAC_ADDR_ARRAY(psessionEntry->bssId));) + limLog(pMac, LOG1, FL(" delete pre auth node for " + MAC_ADDRESS_STR), MAC_ADDR_ARRAY(psessionEntry->bssId)); limDeletePreAuthNode(pMac, psessionEntry->bssId); } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c index e5dee585d0fb..e5c2305651b0 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,7 +36,7 @@ * */ #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "sirApi.h" #include "schApi.h" @@ -59,10 +59,7 @@ #include #endif #include "wlan_qct_wda.h" - -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif static void limHandleSmeJoinResult(tpAniSirGlobal, tSirResultCodes, tANI_U16,tpPESession); static void limHandleSmeReaasocResult(tpAniSirGlobal, tSirResultCodes, tANI_U16, tpPESession); @@ -408,7 +405,7 @@ limProcessMlmStartCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOG1, FL("*** Started BSS in INFRA AP SIDE***")); } else - PELOG1(limLog(pMac, LOG1, FL("*** Started BSS ***"));) + limLog(pMac, LOG1, FL("*** Started BSS ***")); } else { @@ -416,7 +413,6 @@ limProcessMlmStartCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) peDeleteSession(pMac,psessionEntry); psessionEntry = NULL; PELOGE(limLog(pMac, LOGE,FL("Start BSS Failed "));) - return; } /// Send response to Host limSendSmeStartBssRsp(pMac, eWNI_SME_START_BSS_RSP, @@ -475,8 +471,8 @@ limProcessMlmJoinCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) /// Process Join confirm from MLM if (resultCode == eSIR_SME_SUCCESS) { - PELOG1(limLog(pMac, LOG1, FL("***SessionId:%d Joined ESS ***"), - pLimMlmJoinCnf->sessionId);) + limLog(pMac, LOG1, FL("***SessionId: %d Joined ESS ***"), + pLimMlmJoinCnf->sessionId); //Setup hardware upfront //Done: 7-27-2009. JIM_FIX_ME sessionize the following function if(limStaSendAddBssPreAssoc( pMac, false, psessionEntry) == eSIR_SUCCESS) @@ -660,9 +656,9 @@ limProcessMlmAuthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) * Successful MAC based authentication * Trigger Association with BSS */ - PELOG1(limLog(pMac, LOG1, - FL("SessionId:%d Authenticated with BSS"), - psessionEntry->peSessionId);) + limLog(pMac, LOG1, + FL("SessionId: %d Authenticated with BSS"), + psessionEntry->peSessionId); pMlmAssocReq = vos_mem_malloc(sizeof(tLimMlmAssocReq)); if ( NULL == pMlmAssocReq ) { @@ -853,11 +849,11 @@ limProcessMlmAssocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if (((tLimMlmAssocCnf *) pMsgBuf)->resultCode != eSIR_SME_SUCCESS) { // Association failure - PELOG1(limLog(pMac, LOG1, - FL("SessionId:%d Association failure resultCode: resultCode:%d" - "limSmeState:%d"), psessionEntry->peSessionId, + limLog(pMac, LOG1, + FL("SessionId: %d Association failure resultCode: %d" + "limSmeState: %d"), psessionEntry->peSessionId, ((tLimMlmAssocCnf *) pMsgBuf)->resultCode, - psessionEntry->limSmeState);) + psessionEntry->limSmeState); /* If driver gets deauth when its waiting for ADD_STA_RSP then we need * to do DEL_STA followed by DEL_BSS. So based on below reason-code here @@ -881,8 +877,8 @@ limProcessMlmAssocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) else { // Successful Association - PELOG1(limLog(pMac, LOG1, FL("SessionId:%d Associated with BSS"), - psessionEntry->peSessionId);) + limLog(pMac, LOG1, FL("SessionId: %d Associated with BSS"), + psessionEntry->peSessionId); psessionEntry->limSmeState = eLIM_SME_LINK_EST_STATE; MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); /** @@ -948,10 +944,27 @@ limProcessMlmReassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->pLimReAssocReq = NULL; } + /* Upon Reassoc success or failure, freeup the cached + * preauth request, to ensure that channel switch is now + * allowed following any change in HT params. + */ + if (pMac->ft.ftPEContext.pFTPreAuthReq) + { + limLog(pMac, LOG1, "%s: Freeing pFTPreAuthReq= %pK", __func__, + pMac->ft.ftPEContext.pFTPreAuthReq); + if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) + { + vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); + pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; + } + vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq); + pMac->ft.ftPEContext.pFTPreAuthReq = NULL; + } + PELOGE(limLog(pMac, LOG1, FL("Rcv MLM_REASSOC_CNF with result code %d"), pLimMlmReassocCnf->resultCode);) if (pLimMlmReassocCnf->resultCode == eSIR_SME_SUCCESS) { // Successful Reassociation - PELOG1(limLog(pMac, LOG1, FL("*** Reassociated with new BSS ***"));) + limLog(pMac, LOG1, FL("*** Reassociated with new BSS ***")); psessionEntry->limSmeState = eLIM_SME_LINK_EST_STATE; MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); @@ -1060,7 +1073,7 @@ limProcessMlmReassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) msgQ.type = eWNI_SME_REASSOC_IND; msgQ.bodyptr = pSirSmeReassocInd; msgQ.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, msgQ.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_IND_EVENT, psessionEntry, 0, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT @@ -1074,8 +1087,8 @@ limProcessMlmReassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); - PELOG1(limLog(pMac, LOG1, - FL("Create CNF_WAIT_TIMER after received LIM_MLM_REASSOC_IND"));) + limLog(pMac, LOG1, + FL("Create CNF_WAIT_TIMER after received LIM_MLM_REASSOC_IND")); /* ** turn on a timer to detect the loss of REASSOC CNF **/ @@ -1125,7 +1138,7 @@ limProcessMlmAuthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) msgQ.type = eWNI_SME_AUTH_IND; msgQ.bodyptr = pSirSmeAuthInd; msgQ.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_IND_EVENT, NULL, 0, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT @@ -1188,6 +1201,11 @@ limFillAssocIndParams(tpAniSirGlobal pMac, tpLimMlmAssocInd pAssocInd, } // Fill in WmmInfo pSirSmeAssocInd->wmmEnabledSta = pAssocInd->WmmStaInfoPresent; +#ifdef WLAN_FEATURE_AP_HT40_24G + pSirSmeAssocInd->HT40MHzIntoEnabledSta = pAssocInd->HT40MHzIntoPresent; + limLog(pMac, LOGW, FL("HT40MHzIntoPresent: %d"), + pSirSmeAssocInd->HT40MHzIntoEnabledSta); +#endif } /*** end limAssocIndSerDes() ***/ @@ -1256,14 +1274,15 @@ limProcessMlmAssocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } pSirSmeAssocInd->staId = pStaDs->staIndex; pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType; - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, + msgQ.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); - PELOG1(limLog(pMac, LOG1, - FL("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND"));) + limLog(pMac, LOG1, + FL("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND")); /* ** turn on a timer to detect the loss of ASSOC CNF **/ @@ -1338,9 +1357,9 @@ limProcessMlmDisassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); break; default: // eLIM_AP_ROLE //eLIM_BT_AMP_AP_ROLE - PELOG1(limLog(pMac, LOG1, - FL("*** Peer staId=%d Disassociated ***"), - pMlmDisassocInd->aid);) + limLog(pMac, LOG1, + FL("*** Peer staId = %d Disassociated ***"), + pMlmDisassocInd->aid); // Send SME_DISASOC_IND after Polaris cleanup // (after receiving LIM_MLM_PURGE_STA_IND) break; @@ -1460,7 +1479,8 @@ limProcessMlmDeauthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pMlmDeauthInd = (tLimMlmDeauthInd *) pMsgBuf; if((psessionEntry = peFindSessionByBssid(pMac,pMlmDeauthInd->peerMacAddr,&sessionId))== NULL) { - PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) + PELOGE(limLog(pMac, LOGE,FL("session does not exist for Addr:" MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pMlmDeauthInd->peerMacAddr));) return; } switch (psessionEntry->limSystemRole) @@ -1474,9 +1494,9 @@ limProcessMlmDeauthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) default: // eLIM_AP_ROLE { - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("*** Received Deauthentication from staId=%d ***"), - pMlmDeauthInd->aid);) + pMlmDeauthInd->aid); } // Send SME_DEAUTH_IND after Polaris cleanup // (after receiving LIM_MLM_PURGE_STA_IND) @@ -1532,7 +1552,8 @@ limProcessMlmDeauthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) { // Deauth Confirm from MLM - if (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) + if ((psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && + (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) { /** * Should not have received Deauth confirm @@ -1547,8 +1568,8 @@ limProcessMlmDeauthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if (pMlmDeauthCnf->resultCode == eSIR_SME_SUCCESS) { psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; - PELOG1(limLog(pMac, LOG1, - FL("*** Deauthenticated with BSS ***"));) + limLog(pMac, LOG1, + FL("*** Deauthenticated with BSS ***")); } else psessionEntry->limSmeState = psessionEntry->limPrevSmeState; @@ -1805,12 +1826,20 @@ limHandleSmeJoinResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U16 pStaDs->mlmStaContext.protStatusCode = protStatusCode; //Done: 7-27-2009. JIM_FIX_ME: at the end of limCleanupRxPath, make sure PE is sending eWNI_SME_JOIN_RSP to SME limCleanupRxPath(pMac, pStaDs, psessionEntry); + /* Cleanup if add bss failed */ + if(psessionEntry->addBssfailed) + { + dphDeleteHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, + &psessionEntry->dph.dphHashTable); + goto error; + } vos_mem_free(psessionEntry->pLimJoinReq); psessionEntry->pLimJoinReq = NULL; return; } } +error: vos_mem_free(psessionEntry->pLimJoinReq); psessionEntry->pLimJoinReq = NULL; //Delete teh session if JOIN failure occurred. @@ -1874,10 +1903,17 @@ limHandleSmeReaasocResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_ pStaDs->mlmStaContext.resultCode = resultCode; pStaDs->mlmStaContext.protStatusCode = protStatusCode; limCleanupRxPath(pMac, pStaDs, psessionEntry); + /* Cleanup if add bss failed */ + if(psessionEntry->addBssfailed) + { + dphDeleteHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, + &psessionEntry->dph.dphHashTable); + goto error; + } return; } } - +error: //Delete teh session if REASSOC failure occurred. if(resultCode != eSIR_SME_SUCCESS) { @@ -1956,6 +1992,7 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess //either assoc cnf or reassoc cnf handler. mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA; + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; psessionEntry->staId = pAddStaParams->staIdx; goto end; } @@ -2027,6 +2064,7 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess if(psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) mesgType = LIM_MLM_REASSOC_CNF; mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; } end: if( 0 != limMsgQ->bodyptr ) @@ -2121,17 +2159,20 @@ void limProcessStaMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESessi statusCode = eSIR_SME_REFUSED; goto end; } - PELOG1(limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); - limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) + limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); + limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); } else { - limLog( pMac, LOGE, FL( "DEL BSS failed!" ) ); - vos_mem_free(pDelBssParams); - limMsgQ->bodyptr = NULL; - return; + /* If DelBSS response is failure, go ahead and + * post response to SME + */ + limLog( pMac, LOGE, FL( "DEL BSS failed! Status:%d" ), + pDelBssParams->status ); + statusCode = eSIR_SME_REFUSED; } - end: + +end: if( 0 != limMsgQ->bodyptr ) { vos_mem_free(pDelBssParams); @@ -2270,24 +2311,28 @@ void limProcessBtAmpApMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPES tSirResultCodes statusCode = eSIR_SME_SUCCESS; if(limMsgQ->bodyptr == NULL) { - return; + limLog( pMac, LOGE, + FL( "limMsgQ->bodyptry NULL")); + return; } - pStaDs = dphGetHashEntry(pMac, pDelStaParams->assocId, &psessionEntry->dph.dphHashTable); if(pStaDs == NULL) { limLog( pMac, LOGE, - FL( "DPH Entry for STA %X missing."), pDelStaParams->assocId); + FL( "DPH Entry for STA %d missing."), pDelStaParams->assocId); statusCode = eSIR_SME_REFUSED; vos_mem_free(pDelStaParams); limMsgQ->bodyptr = NULL; return; } + limLog( pMac, LOG1, + FL( "Received del Sta Rsp in StaD MlmState : %d"), + pStaDs->mlmStaContext.mlmState); if( eHAL_STATUS_SUCCESS == pDelStaParams->status ) { limLog( pMac, LOGW, - FL( "AP received the DEL_STA_RSP for assocID: %X."), pDelStaParams->assocId); + FL( "AP received the DEL_STA_RSP for assocID: %d."), pDelStaParams->assocId); if(( eLIM_MLM_WT_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) && ( eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState)) @@ -2356,47 +2401,56 @@ void limProcessStaMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESessi tSirResultCodes statusCode = eSIR_SME_SUCCESS; tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; tpDphHashNode pStaDs = NULL; + if(NULL == pDelStaParams ) { limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); goto end; } - if( eHAL_STATUS_SUCCESS == pDelStaParams->status ) + + limLog(pMac, LOG1, FL("Del STA RSP received. Status:%d AssocID:%d"), + pDelStaParams->status, pDelStaParams->assocId); + + if (eHAL_STATUS_SUCCESS != pDelStaParams->status) { - pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); - if (pStaDs == NULL) - { - //TODO: any response to be sent out here ? - limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), - pDelStaParams->assocId); - statusCode = eSIR_SME_REFUSED; - goto end; - } - if( eLIM_MLM_WT_DEL_STA_RSP_STATE != psessionEntry->limMlmState) - { - //TODO: any response to be sent out here ? - limLog( pMac, LOGE, FL( "Received unexpected WDA_DELETE_STA_RSP in state %s" ), - limMlmStateStr(psessionEntry->limMlmState)); - statusCode = eSIR_SME_REFUSED; - goto end; - } - PELOG1(limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); - limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) - limLog( pMac, LOGW, FL( "DEL_STA_RSP received for assocID: %X"), pDelStaParams->assocId); - //we must complete all cleanup related to delSta before calling limDelBSS. - if( 0 != limMsgQ->bodyptr ) - { - vos_mem_free(pDelStaParams); - limMsgQ->bodyptr = NULL; - } - statusCode = (tSirResultCodes) limDelBss(pMac, pStaDs, 0,psessionEntry); - return; + limLog(pMac, LOGE, FL("Del STA failed! Status:%d, still proceeding" + "with Del BSS"), pDelStaParams->status); } - else + + pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); + + if (pStaDs == NULL) { - limLog( pMac, LOGE, FL( "DEL_STA failed for sta Id %d" ), pDelStaParams->staIdx); + //TODO: any response to be sent out here ? + limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), + pDelStaParams->assocId); statusCode = eSIR_SME_REFUSED; + goto end; } + + if (eLIM_MLM_WT_DEL_STA_RSP_STATE != psessionEntry->limMlmState) + { + //TODO: any response to be sent out here ? + limLog( pMac, LOGE, FL( "Received unexpected WDA_DELETE_STA_RSP in state %s" ), + limMlmStateStr(psessionEntry->limMlmState)); + statusCode = eSIR_SME_REFUSED; + goto end; + } + + limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); + limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); + + //we must complete all cleanup related to delSta before calling limDelBSS. + if (0 != limMsgQ->bodyptr ) + { + vos_mem_free(pDelStaParams); + limMsgQ->bodyptr = NULL; + } + + // Proceed to do DelBSS even if DelSta resulted in failure + statusCode = (tSirResultCodes) limDelBss(pMac, pStaDs, 0,psessionEntry); + return; + end: if( 0 != limMsgQ->bodyptr ) { @@ -2454,7 +2508,7 @@ void limProcessBtAmpApMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPES pStaDs->valid = 1; pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_CNF_STATE; limLog( pMac, LOG1, - FL("STA AssocID %d staId %d MAC "), + FL("AddStaRsp Success.STA AssocID %d staId %d MAC "), pStaDs->assocId, pStaDs->staIndex); limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); @@ -2537,7 +2591,7 @@ limProcessApMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ) mlmStartCnf.sessionId = pAddBssParams->sessionId; if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) { - PELOG2(limLog(pMac, LOG2, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS"));) + limLog(pMac, LOG1, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS")); if (limSetLinkState(pMac, eSIR_LINK_AP_STATE,psessionEntry->bssId, psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) goto end; @@ -2651,7 +2705,7 @@ limProcessIbssMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession } if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) { - PELOG1(limLog(pMac, LOG1, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS"));) + limLog(pMac, LOG1, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS")); if (limSetLinkState(pMac, eSIR_LINK_IBSS_STATE,psessionEntry->bssId, psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) goto end; @@ -2844,6 +2898,10 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession tANI_U32 listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF; tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; tANI_U32 selfStaDot11Mode = 0; +#ifdef FEATURE_WLAN_ESE + tLimMlmReassocReq *pMlmReassocReq; + tANI_U32 val = 0; +#endif /* Sanity Checks */ @@ -2870,11 +2928,45 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession limPrintMacAddr(pMac, pAddBssParams->staContext.staMac, LOGE); goto end; } -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_LIM_ADD_BS_RSP, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_LIM_ADD_BS_RSP, NULL, 0); + } // Prepare and send Reassociation request frame // start reassoc timer. + + +#ifdef FEATURE_WLAN_ESE + /* + * In case of Ese Reassociation, change the reassoc timer + * value. + */ + pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); + if (pMlmReassocReq == NULL) + { + limLog(pMac, LOGE, + FL("Invalid pMlmReassocReq")); + goto end; + } + val = pMlmReassocReq->reassocFailureTimeout; + if (psessionEntry->isESEconnection) + { + val = val/LIM_MAX_REASSOC_RETRY_LIMIT; + } + if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != + TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to deactivate Reassoc failure timer")); + } + val = SYS_MS_TO_TICKS(val); + if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, + val, 0) != TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to change Reassociation failure timer")); + } +#endif pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; /// Start reassociation failure timer MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); @@ -2909,9 +3001,10 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession pMac->lim.reAssocRetryAttempt = 0; #endif limSendReassocReqWithFTIEsMgmtFrame(pMac, psessionEntry->pLimMlmReassocReq, psessionEntry); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_LIM_SEND_REASSOC_REQ, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_LIM_SEND_REASSOC_REQ, NULL, 0); + } psessionEntry->limPrevMlmState = psessionEntry->limMlmState; psessionEntry->limMlmState = eLIM_MLM_WT_FT_REASSOC_RSP_STATE; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_FT_REASSOC_RSP_STATE)); @@ -3102,15 +3195,17 @@ limProcessStaMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession ps limProcessStaMlmAddBssRspPreAssoc(pMac, limMsgQ, psessionEntry); goto end; } - if( eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE == psessionEntry->limMlmState ) + + if(( eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE == psessionEntry->limMlmState ) || + ( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState )) { mesgType = LIM_MLM_REASSOC_CNF; subType = LIM_REASSOC; - //If Reassoc is happening for the same BSS, then use the existing StaId and indicate to HAL - //to update the existing STA entry. - //If Reassoc is happening for the new BSS, then old BSS and STA entry would have been already deleted - //before PE tries to add BSS for the new BSS, so set the updateSta to false and pass INVALID STA Index. - if (sirCompareMacAddr( psessionEntry->bssId, psessionEntry->limReAssocbssId)) + //If Reassoc is happening for the same BSS, then use the existing StaId and indicate to HAL + //to update the existing STA entry. + //If Reassoc is happening for the new BSS, then old BSS and STA entry would have been already deleted + //before PE tries to add BSS for the new BSS, so set the updateSta to false and pass INVALID STA Index. + if (sirCompareMacAddr( psessionEntry->bssId, psessionEntry->limReAssocbssId)) { staIdx = psessionEntry->staId; updateSta = true; @@ -3183,14 +3278,24 @@ limProcessStaMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession ps } else { - limLog( pMac, LOGP, FL( "SessionId:%d ADD_BSS failed!" ), - psessionEntry->peSessionId); + limLog( pMac, LOGP, FL( "SessionId:%d ADD_BSS failed! mlmState = %d" ), + psessionEntry->peSessionId, psessionEntry->limMlmState); + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; // Return Assoc confirm to SME with failure - mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; + if(eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState) + mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_FT_REASSOC_FAILURE; + else + mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; + psessionEntry->addBssfailed = true; } if(mlmAssocCnf.resultCode != eSIR_SME_SUCCESS) { + psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; + //Set the RXP mode to IDLE, so it starts filtering the frames. + if(limSetLinkState(pMac, eSIR_LINK_IDLE_STATE,psessionEntry->bssId, + psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) + PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState\n"));) /* Update PE session Id*/ mlmAssocCnf.sessionId = psessionEntry->peSessionId; limPostSmeMessage( pMac, mesgType, (tANI_U32 *) &mlmAssocCnf ); @@ -3412,48 +3517,43 @@ void limProcessMlmSetStaKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) } void limProcessMlmSetBssKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) { - tANI_U8 respReqd = 1; tLimMlmSetKeysCnf mlmSetKeysCnf; tANI_U16 resultCode; tANI_U8 sessionId = 0; tpPESession psessionEntry; + tpLimMlmSetKeysReq lpLimMlmSetKeysReq; + SET_LIM_PROCESS_DEFD_MESGS(pMac, true); vos_mem_set((void *)&mlmSetKeysCnf, sizeof( tLimMlmSetKeysCnf ), 0); - //BTAMP - if( NULL == limMsgQ->bodyptr ) + if ( NULL == limMsgQ->bodyptr ) { PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is null"));) return; } sessionId = ((tpSetBssKeyParams) limMsgQ->bodyptr)->sessionId; - if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) + if ((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) { - PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) + limLog(pMac, LOGE,FL("session does not exist for sessionId %d"), + sessionId); vos_mem_zero(limMsgQ->bodyptr, sizeof(tSetBssKeyParams)); vos_mem_free( limMsgQ->bodyptr ); limMsgQ->bodyptr = NULL; return; } - if( eLIM_MLM_WT_SET_BSS_KEY_STATE == psessionEntry->limMlmState ) + if ( eLIM_MLM_WT_SET_BSS_KEY_STATE == psessionEntry->limMlmState ) resultCode = (tANI_U16) (((tpSetBssKeyParams) limMsgQ->bodyptr)->status); else - resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); //BCAST key also uses tpSetStaKeyParams. Done this way for readabilty. + /* BCAST key also uses tpSetStaKeyParams. Done this way for readabilty */ + resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); - // - // TODO & FIXME_GEN4 - // Need to inspect tSirMsgQ.reserved for a valid Dialog token! - // - // Validate SME/LIM state - Read the above "ASSUMPTIONS" - //if( eLIM_SME_LINK_EST_STATE == pMac->lim.gLimSmeState ) - //{ - // Validate MLME state if( eLIM_MLM_WT_SET_BSS_KEY_STATE != psessionEntry->limMlmState && eLIM_MLM_WT_SET_STA_BCASTKEY_STATE != psessionEntry->limMlmState ) { - // Mesg received from HAL in Invalid state! - limLog( pMac, LOGW, FL( "Received unexpected [Mesg Id - %d] in state %d" ), limMsgQ->type, psessionEntry->limMlmState ); - // There's not much that MLME can do at this stage... - respReqd = 0; + /* Mesg received from HAL in Invalid state! */ + limLog( pMac, LOGW, + FL( "Received unexpected [Mesg Id - %d] in state %d" ), + limMsgQ->type, psessionEntry->limMlmState ); + mlmSetKeysCnf.resultCode = eSIR_SME_INVALID_STATE; } else mlmSetKeysCnf.resultCode = resultCode; @@ -3464,26 +3564,24 @@ void limProcessMlmSetBssKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) // Restore MLME state psessionEntry->limMlmState = psessionEntry->limPrevMlmState; - MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); - if( respReqd ) - { - tpLimMlmSetKeysReq lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; - mlmSetKeysCnf.sessionId = sessionId; + MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, + psessionEntry->peSessionId, psessionEntry->limMlmState)); + lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; + mlmSetKeysCnf.sessionId = sessionId; - // Prepare and Send LIM_MLM_SETKEYS_CNF - if( NULL != lpLimMlmSetKeysReq ) - { - vos_mem_copy((tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, - (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, - sizeof(tSirMacAddr)); - // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq - vos_mem_zero(pMac->lim.gpLimMlmSetKeysReq, - sizeof(tLimMlmSetKeysReq)); - vos_mem_free(pMac->lim.gpLimMlmSetKeysReq); - pMac->lim.gpLimMlmSetKeysReq = NULL; - } - limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); + /* Prepare and Send LIM_MLM_SETKEYS_CNF */ + if( NULL != lpLimMlmSetKeysReq ) + { + vos_mem_copy((tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, + (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, + sizeof(tSirMacAddr)); + /* Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq */ + vos_mem_zero(pMac->lim.gpLimMlmSetKeysReq, + sizeof(tLimMlmSetKeysReq)); + vos_mem_free(pMac->lim.gpLimMlmSetKeysReq); + pMac->lim.gpLimMlmSetKeysReq = NULL; } + limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); } /** * limProcessMlmRemoveKeyRsp() @@ -3708,6 +3806,9 @@ static void limProcessSwitchChannelReAssocReq(tpAniSirGlobal pMac, tpPESession p { tLimMlmReassocCnf mlmReassocCnf; tLimMlmReassocReq *pMlmReassocReq; +#ifdef FEATURE_WLAN_ESE + tANI_U32 val = 0; +#endif pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); if(pMlmReassocReq == NULL) { @@ -3722,6 +3823,32 @@ static void limProcessSwitchChannelReAssocReq(tpAniSirGlobal pMac, tpPESession p mlmReassocCnf.resultCode = eSIR_SME_CHANNEL_SWITCH_FAIL; goto end; } + +#ifdef FEATURE_WLAN_ESE + /* + * In case of Ese Reassociation, change the reassoc timer + * value. + */ + val = pMlmReassocReq->reassocFailureTimeout; + if (psessionEntry->isESEconnection) + { + val = val/LIM_MAX_REASSOC_RETRY_LIMIT; + } + if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != + TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to deactivate Reassoc failure timer")); + } + val = SYS_MS_TO_TICKS(val); + if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, + val, 0) != TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to change Reassociation failure timer")); + } +#endif + pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; /// Start reassociation failure timer MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) @@ -3972,7 +4099,7 @@ void limProcessSwitchChannelRsp(tpAniSirGlobal pMac, void *body) */ if (pMac->lim.gpchangeChannelCallback) { - PELOG1(limLog( pMac, LOG1, "Channel changed hence invoke registered call back");) + limLog( pMac, LOG1, "Channel changed hence invoke registered call back"); if (eHAL_CHANNEL_SWITCH_SOURCE_CSA == pChnlParams->channelSwitchSrc ) { if (IS_MCC_SUPPORTED && limIsLinkSuspended( pMac ) ) @@ -4186,6 +4313,8 @@ void limProcessFinishScanRsp(tpAniSirGlobal pMac, void *body) { case eLIM_HAL_FINISH_SCAN_WAIT_STATE: pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; + if (pMac->lim.abortScan) + pMac->lim.abortScan = 0; limCompleteMlmScan(pMac, eSIR_SME_SUCCESS); if (limIsChanSwitchRunning(pMac)) { @@ -4628,13 +4757,23 @@ limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESe psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; /* Update PE session Id*/ mlmReassocCnf.sessionId = psessionEntry->peSessionId; - switch (psessionEntry->limMlmState) { + switch (psessionEntry->limSmeState) { case eLIM_SME_WT_REASSOC_STATE : { tpSirAssocRsp assocRsp; tpDphHashNode pStaDs; tSirRetStatus retStatus = eSIR_SUCCESS; - tSchBeaconStruct beaconStruct; + tpSchBeaconStruct pBeaconStruct; + pBeaconStruct = vos_mem_vmalloc(sizeof(tSchBeaconStruct)); + if (NULL == pBeaconStruct) + { + limLog(pMac, LOGE, FL("beaconStruct allocation failed")); + mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; + mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + limDeleteDphHashEntry(pMac, psessionEntry->bssId, + DPH_STA_HASH_INDEX_PEER, psessionEntry); + goto Error; + } /** Delete the older STA Table entry */ limDeleteDphHashEntry(pMac, psessionEntry->bssId, DPH_STA_HASH_INDEX_PEER, psessionEntry); /** @@ -4648,6 +4787,7 @@ limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESe limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS; + vos_mem_vfree(pBeaconStruct); goto Error; } /** While Processing the ReAssoc Response Frame the ReAssocRsp Frame @@ -4659,17 +4799,17 @@ limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESe limExtractApCapabilities( pMac, (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields, limGetIElenFromBssDescription( &psessionEntry->pLimReAssocReq->bssDescription ), - &beaconStruct ); + pBeaconStruct ); if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) - limDecideStaProtectionOnAssoc(pMac, &beaconStruct, psessionEntry); - if(beaconStruct.erpPresent) { - if (beaconStruct.erpIEInfo.barkerPreambleMode) + limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); + if(pBeaconStruct->erpPresent) { + if (pBeaconStruct->erpIEInfo.barkerPreambleMode) psessionEntry->beaconParams.fShortPreamble = 0; else psessionEntry->beaconParams.fShortPreamble = 1; } //updateBss flag is false, as in this case, PE is first deleting the existing BSS and then adding a new one. - if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, &beaconStruct, + if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, pBeaconStruct, &psessionEntry->pLimReAssocReq->bssDescription, false, psessionEntry)) { limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed ")); retStatus = eSIR_FAILURE; @@ -4679,10 +4819,12 @@ limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESe mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; vos_mem_free(assocRsp); + vos_mem_vfree(pBeaconStruct); pMac->lim.gLimAssocResponseData = NULL; goto Error; } vos_mem_free(assocRsp); + vos_mem_vfree(pBeaconStruct); psessionEntry->limAssocResponseData = NULL; } break; @@ -5073,6 +5215,31 @@ void limProcessRxScanEvent(tpAniSirGlobal pMac, void *buf) } } +void limProcessMlmSpoofMacAddrRsp(tpAniSirGlobal pMac, tSirRetStatus rspStatus) +{ + tANI_U32 val; + + if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MAC_ADDR_SPOOFING, &val) + != eSIR_SUCCESS) + { + limLog(pMac, LOGP, FL("fail to Get WNI_CFG_ENABLE_MAC_ADDR_SPOOFING")); + /*If we here means mac spoofing is enable. So enable both Host and + FW spoofing */ + val = 1; + } + if ((rspStatus != eSIR_SUCCESS) || (val != 1) || + (TRUE == vos_is_macaddr_zero((v_MACADDR_t *)&pMac->lim.spoofMacAddr))) + { + limLog(pMac, LOG1, FL(" LIM Disabling Spoofing %d"), val); + pMac->lim.isSpoofingEnabled = FALSE; + } else { + limLog(pMac, LOG1, FL(" LIM Enabling Spoofing")); + pMac->lim.isSpoofingEnabled = TRUE; + } + + return; +} + void limSwitchChannelResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmAddBssRsp) diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c index 7a84b39e12d1..279bd4abdcc1 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,7 +36,7 @@ * */ -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" @@ -550,7 +550,8 @@ limProcessProbeReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pSirSmeProbeReq->sessionId = psessionEntry->smeSessionId; vos_mem_copy(pSirSmeProbeReq->peerMacAddr, pHdr->sa, sizeof(tSirMacAddr)); pSirSmeProbeReq->devicePasswdId = probeReq.probeReqWscIeInfo.DevicePasswordID.id; - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, msgQ.type)); if (limSysProcessMmhMsgApi(pMac, &msgQ, ePROT) != eSIR_SUCCESS){ PELOG3(limLog(pMac, LOG3, FL("couldnt send the probe req to wsm "));) } @@ -664,7 +665,7 @@ static void limIndicateProbeReqToHDD(tpAniSirGlobal pMac, tANI_U8 *pBd, tpPESession psessionEntry) { - limLog( pMac, LOG1, "Received a probe request frame"); + limLog( pMac, LOG1, FL("Received a probe request frame")); //send the probe req to SME. limSendSmeMgmtFrameInd( pMac, psessionEntry->smeSessionId, pBd, @@ -795,7 +796,12 @@ limSendSmeProbeReqInd(tpAniSirGlobal pMac, vos_mem_copy(pSirSmeProbeReqInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); vos_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.peerMacAddr, peerMacAddr, sizeof(tSirMacAddr)); - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, + msgQ.type)); + + if (ProbeReqIELen > sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE)) + ProbeReqIELen = sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE); + pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIELen = (tANI_U16)ProbeReqIELen; vos_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE, ProbeReqIELen); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c index a80bc3746f1a..528ce8bdfeae 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "schApi.h" #include "utilsApi.h" @@ -127,7 +127,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry->peSessionId); - pProbeRsp = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); + pProbeRsp = vos_mem_vmalloc(sizeof(tSirProbeRespBeacon)); if ( NULL == pProbeRsp ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessProbeRspFrame") ); @@ -142,16 +142,16 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); - PELOG2(limLog(pMac, LOG2, + limLog(pMac, LOG2, FL("Received Probe Response frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); - limPrintMacAddr(pMac, pHdr->sa, LOG2);) + limPrintMacAddr(pMac, pHdr->sa, LOG2); if (!pMac->fScanOffload) { if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) { - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } } @@ -162,7 +162,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession { PELOG1(limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d"), frameLen);) - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } @@ -212,7 +212,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession PELOG1(limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d"), frameLen);) - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } @@ -279,7 +279,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession if ( !vos_mem_compare(currentBssId, pHdr->bssId, sizeof(tSirMacAddr)) ) { - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } @@ -357,7 +357,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession limHandleIBSScoalescing(pMac, pProbeRsp, pRxPacketInfo,psessionEntry); } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ... - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); // Ignore Probe Response frame in all other states return; } /*** end limProcessProbeRspFrame() ***/ @@ -371,7 +371,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) tpSirMacMgmtHdr pHdr; tSirProbeRespBeacon *pProbeRsp; - pProbeRsp = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); + pProbeRsp = vos_mem_vmalloc(sizeof(tSirProbeRespBeacon)); if ( NULL == pProbeRsp ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessProbeRspFrameNoSession") ); @@ -400,7 +400,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) { if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) { - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } } @@ -413,7 +413,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) { PELOG1(limLog(pMac, LOG1,FL("Parse error ProbeResponse, length=%d"), frameLen);) - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } /* Since there is no psessionEntry, PE cannot be in the following states: @@ -445,7 +445,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE) { limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d\n"), frameLen); - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache")); @@ -466,7 +466,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) { limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d\n"), frameLen); - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, @@ -492,7 +492,7 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE) { limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d"), frameLen); - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } @@ -503,6 +503,6 @@ limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) { } } - vos_mem_free(pProbeRsp); + vos_mem_vfree(pProbeRsp); return; } /*** end limProcessProbeRspFrameNew() ***/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 6a7cf5478639..f0d9c7e8c4fd 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,7 +41,7 @@ #include "palTypes.h" #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "sirApi.h" #include "schApi.h" @@ -80,6 +80,7 @@ #endif +#define JOIN_FAILURE_TIMEOUT 1000 // in msecs /* This overhead is time for sending NOA start to host in case of GO/sending NULL data & receiving ACK * in case of P2P Client and starting actual scanning with init scan req/rsp plus in case of concurrency, * taking care of sending null data and receiving ACK to/from AP/Also SetChannel with calibration is taking @@ -352,7 +353,7 @@ __limProcessSmeStartReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tANI_U16 smetransactionId; - PELOG1(limLog(pMac, LOG1, FL("Received START_REQ"));) + limLog(pMac, LOG1, FL("Received SME_START_REQ")); limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); @@ -532,7 +533,7 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_REQ_EVENT, NULL, 0, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT - PELOG1(limLog(pMac, LOG1, FL("Received START_BSS_REQ"));) + limLog(pMac, LOG1, FL("Received SME_START_BSS_REQ")); /* Global Sme state and mlm states are not defined yet, for BT-AMP Suppoprt . TO BE DONE */ if ( (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) || @@ -621,6 +622,14 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->maxTxPower = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); + +#ifdef WLAN_FEATURE_AP_HT40_24G + /*Store Overlapping BSS Scan Parameters IEs to session table */ + if (pSmeStartBssReq->apHT40_24GEnabled) + { + limInitOBSSScanParams(pMac, psessionEntry); + } +#endif /* Store the dot 11 mode in to the session Table*/ psessionEntry->dot11mode = pSmeStartBssReq->dot11mode; @@ -1242,11 +1251,12 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) /*copy the Self MAC address from SmeReq to the globalplace, used for sending probe req*/ sirCopyMacAddr(pMac->lim.gSelfMacAddr, pScanReq->selfMacAddr); - /* This routine should return the sme sessionId and SME transaction Id */ - - if (!limIsSmeScanReqValid(pMac, pScanReq)) + /* Check if scan req is not valid or link is already suspended*/ + if (!limIsSmeScanReqValid(pMac, pScanReq) || limIsLinkSuspended(pMac)) { - limLog(pMac, LOGE, FL("Received SME_SCAN_REQ with invalid parameters")); + limLog(pMac, LOGE, + FL("Received SME_SCAN_REQ with invalid params or link is suspended %d"), + limIsLinkSuspended(pMac)); if (pMac->lim.gLimRspReqd) { @@ -1355,6 +1365,16 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmScanReq (%d)"), len); + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + + limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), + eSIR_SME_RESOURCES_UNAVAILABLE, + pScanReq->sessionId, + pScanReq->transactionId); + } + return; } @@ -1372,8 +1392,59 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ limLog(pMac, LOGP, FL("could not retrieve Valid channel list")); + + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + + limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), + eSIR_SME_INVALID_PARAMETERS, + pScanReq->sessionId, + pScanReq->transactionId); + } + vos_mem_free(pMlmScanReq); + return; } pMlmScanReq->channelList.numChannels = (tANI_U8) cfg_len; + + //Ignore DFS channels if DFS scan is disabled + if(pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_DISABLED) + { + tANI_U8 numChan = 0; + tANI_U8 channel_state; + tANI_U8 *chan_ptr = pMlmScanReq->channelList.channelNumber; + + limLog(pMac, LOG1, + FL("Ignore DFS channels from valid channel list")); + + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, + pMlmScanReq->channelList.channelNumber, + pMlmScanReq->channelList.numChannels); + + //Filter DFS channels + for (i = 0; i < cfg_len; i++) + { + channel_state = + vos_nv_getChannelEnabledState(*(chan_ptr + i)); + + //Allow channel if not DFS + if(channel_state != NV_CHANNEL_DFS) + { + *(chan_ptr + numChan) = *(chan_ptr + i); + numChan++; + } + } + pMlmScanReq->channelList.numChannels = (tANI_U8) numChan; + + limLog(pMac, LOG1, FL("No of valid channels %d, No of" + "channels after filtering %d"), cfg_len, numChan); + + limLog(pMac, LOG1, FL("Channel list after filtering: ")); + + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, + pMlmScanReq->channelList.channelNumber, + pMlmScanReq->channelList.numChannels); + } } else { @@ -1388,6 +1459,16 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmScanReq(%d)"), len); + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + + limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), + eSIR_SME_RESOURCES_UNAVAILABLE, + pScanReq->sessionId, + pScanReq->transactionId); + } + return; } @@ -1616,8 +1697,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tANI_U16 nSize; tANI_U8 sessionId; tpPESession psessionEntry = NULL; - tANI_U8 smesessionId; - tANI_U16 smetransactionId; + tANI_U8 smesessionId = 0; + tANI_U16 smetransactionId = 0; tPowerdBm localPowerConstraint = 0, regMax = 0; tANI_U16 ieLen; v_U8_t *vendorIE; @@ -1627,7 +1708,7 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_REQ_EVENT, NULL, 0, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT - PELOG1(limLog(pMac, LOG1, FL("Received SME_JOIN_REQ"));) + limLog(pMac, LOG1, FL("Received SME_JOIN_REQ")); #ifdef WLAN_FEATURE_VOWIFI /* Need to read the CFG here itself as this is used in limExtractAPCapability() below. @@ -1731,8 +1812,14 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) else limLog(pMac,LOG1,FL("SessionId:%d New session created"), sessionId); - } - handleHTCapabilityandHTInfo(pMac, psessionEntry); + } + + if(psessionEntry != NULL && pSmeJoinReq->operationalRateSet.numRates > 0 ){ + if(!limCheck11BRateBitmap(pSmeJoinReq->rateBitMap)){ + psessionEntry->is11Gonly = true; + } + } + psessionEntry->isAmsduSupportInAMPDU = pSmeJoinReq->isAmsduSupportInAMPDU; /* Store Session related parameters */ @@ -1759,6 +1846,7 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->statypeForBss = STA_ENTRY_PEER; psessionEntry->limWmeEnabled = pSmeJoinReq->isWMEenabled; psessionEntry->limQosEnabled = pSmeJoinReq->isQosEnabled; + psessionEntry->bOSENAssociation = pSmeJoinReq->bOSENAssociation; /* Store vendor specfic IE for CISCO AP */ ieLen = (pSmeJoinReq->bssDescription.length + @@ -1843,6 +1931,7 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) /*Phy mode*/ psessionEntry->gLimPhyMode = pSmeJoinReq->bssDescription.nwType; + handleHTCapabilityandHTInfo(pMac, psessionEntry); /* Copy The channel Id to the session Table */ psessionEntry->currentOperChannel = pSmeJoinReq->bssDescription.channelId; psessionEntry->htSupportedChannelWidthSet = (pSmeJoinReq->cbMode)?1:0; // This is already merged value of peer and self - done by csr in csrGetCBModeFromIes @@ -1929,7 +2018,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { limLog(pMac, LOGP, FL("call to AllocateMemory " "failed for mlmJoinReq")); - return; + retCode = eSIR_SME_RESOURCES_UNAVAILABLE; + goto end; } (void) vos_mem_set((void *) pMlmJoinReq, val, 0); @@ -1938,7 +2028,11 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, (tANI_U32 *) &pMlmJoinReq->joinFailureTimeout) != eSIR_SUCCESS) - limLog(pMac, LOGP, FL("could not retrieve JoinFailureTimer value")); + { + limLog(pMac, LOGE, FL("could not retrieve JoinFailureTimer value " + "setting it to default value")); + pMlmJoinReq->joinFailureTimeout = JOIN_FAILURE_TIMEOUT; + } /* copy operational rate from psessionEntry*/ vos_mem_copy((void*)&psessionEntry->rateSet, (void*)&pSmeJoinReq->operationalRateSet, @@ -1977,6 +2071,14 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) #else psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); #endif + if (!psessionEntry->maxTxPower) + { + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("Tx power" + "is zero. Setting it to default value %d"), + TX_POWER_DEFAULT); + psessionEntry->maxTxPower = TX_POWER_DEFAULT; + } + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "Regulatory max = %d, local power constraint = %d," " max tx = %d", regMax, localPowerConstraint, @@ -1999,8 +2101,12 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if(SIR_BAND_5_GHZ == psessionEntry->limRFBand) { if (wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &val) != eSIR_SUCCESS) + { limLog(pMac, LOGP, FL("Fail to get WNI_CFG_11H_ENABLED ")); - psessionEntry->lim11hEnable = val; + psessionEntry->lim11hEnable = 1; + } + else + psessionEntry->lim11hEnable = val; } else psessionEntry->lim11hEnable = 0; @@ -2029,8 +2135,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->spectrumMgtEnabled = TRUE; } - PELOG1(limLog(pMac,LOG1,FL("SessionId:%d MLM_JOIN_REQ is posted to MLM" - "SM"),pMlmJoinReq->sessionId)); + limLog(pMac,LOG1,FL("SessionId: %d LIM_MLM_JOIN_REQ is posted to MLM " + "SM"), pMlmJoinReq->sessionId); /* Issue LIM_MLM_JOIN_REQ to MLM */ limPostMlmMessage(pMac, LIM_MLM_JOIN_REQ, (tANI_U32 *) pMlmJoinReq); return; @@ -2127,7 +2233,7 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tANI_U16 nSize; - PELOG3(limLog(pMac, LOG3, FL("Received REASSOC_REQ"));) + limLog(pMac, LOG1, FL("Received SME_REASSOC_REQ")); nSize = __limGetSmeJoinReqSizeForAlloc((tANI_U8 *) pMsgBuf); pReassocReq = vos_mem_malloc(nSize); @@ -2243,6 +2349,13 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ); psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); + if (!psessionEntry->maxTxPower) + { + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("Tx power " + "is zero. Setting it to default value %d"), + TX_POWER_DEFAULT); + psessionEntry->maxTxPower = TX_POWER_DEFAULT; + } #if defined WLAN_VOWIFI_DEBUG limLog( pMac, LOGE, "Regulatory max = %d, local power constraint " "= %d, max tx = %d", regMax, localPowerConstraint, @@ -2500,6 +2613,9 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { case eLIM_SME_ASSOCIATED_STATE: case eLIM_SME_LINK_EST_STATE: + limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " + "limSmeState: %d "),psessionEntry->limSmeState); + psessionEntry->limPrevSmeState = psessionEntry->limSmeState; psessionEntry->limSmeState= eLIM_SME_WT_DISASSOC_STATE; #ifdef FEATURE_WLAN_TDLS @@ -2507,8 +2623,6 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limDeleteTDLSPeers(pMac, psessionEntry); #endif MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); - limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " - "limSmeState: %d "),psessionEntry->limSmeState); break; case eLIM_SME_WT_DEAUTH_STATE: @@ -2589,18 +2703,15 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) goto sendDisassoc; } // end switch (pMac->lim.gLimSystemRole) - if (smeDisassocReq.reasonCode == eLIM_LINK_MONITORING_DISASSOC) + if (smeDisassocReq.reasonCode == eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON) { /// Disassociation is triggered by Link Monitoring - limLog(pMac, LOG1, FL("**** Lost link with AP ****")); + limLog(pMac, LOG1, FL("Sending Disasscoc with reason Link Monitoring")); disassocTrigger = eLIM_LINK_MONITORING_DISASSOC; - reasonCode = eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON; } else - { disassocTrigger = eLIM_HOST_DISASSOC; reasonCode = smeDisassocReq.reasonCode; - } if (smeDisassocReq.doNotSendOverTheAir) { @@ -2608,7 +2719,9 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) sendDisassocFrame = 0; } // Trigger Disassociation frame to peer MAC entity - + limLog(pMac, LOG1, FL("Sending Disasscoc with disassoc Trigger" + " : %d, reasonCode : %d"), + disassocTrigger, reasonCode); pMlmDisassocReq = vos_mem_malloc(sizeof(tLimMlmDisassocReq)); if ( NULL == pMlmDisassocReq ) { @@ -2672,7 +2785,7 @@ __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tANI_U8 sessionId; - PELOG1(limLog(pMac, LOG1, FL("received DISASSOC_CNF message"));) + limLog(pMac, LOG1, FL("received SME_DISASSOC_CNF message")); status = limDisassocCnfSerDes(pMac, &smeDisassocCnf,(tANI_U8 *) pMsgBuf); @@ -2744,6 +2857,21 @@ __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) MAC_ADDR_ARRAY(smeDisassocCnf.peerMacAddr));) return; } + /* + * If MlM state is either of del_sta or del_bss state, then no need to + * go ahead and clean up further as there must be some cleanup in + * progress from upper layer disassoc/deauth request. + */ + if((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || + (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)) + { + limLog(pMac, LOGE, FL("No need to cleanup for addr:"MAC_ADDRESS_STR + "as Mlm state is %d"), + MAC_ADDR_ARRAY(smeDisassocCnf.peerMacAddr), + pStaDs->mlmStaContext.mlmState); + return; + } + /* Delete FT session if there exists one */ limFTCleanup(pMac); limCleanupRxPath(pMac, pStaDs, psessionEntry); @@ -2802,17 +2930,13 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if ((status == eSIR_FAILURE) || (!limIsSmeDeauthReqValid(pMac, &smeDeauthReq, psessionEntry))) { - PELOGE(limLog(pMac, LOGW,FL("received invalid SME_DEAUTH_REQ message"));) - if (pMac->lim.gLimRspReqd) - { - pMac->lim.gLimRspReqd = false; + PELOGE(limLog(pMac, LOGE,FL + ("received invalid SME_DEAUTH_REQ message"));) + pMac->lim.gLimRspReqd = false; - retCode = eSIR_SME_INVALID_PARAMETERS; - deauthTrigger = eLIM_HOST_DEAUTH; - goto sendDeauth; - } - - return; + retCode = eSIR_SME_INVALID_PARAMETERS; + deauthTrigger = eLIM_HOST_DEAUTH; + goto sendDeauth; } limLog(pMac, LOG1,FL("received DEAUTH_REQ message on sessionid %d " "Systemrole %d with reasoncode %u in limSmestate %d from " @@ -2860,6 +2984,15 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOG1, FL("Rcvd SME_DEAUTH_REQ while in " "SME_WT_DEAUTH_STATE. ")); break; + case eLIM_SME_WT_DISASSOC_STATE: + /* + * PE Recieved a Disassoc frame. Normally it gets + * DISASSOC_CNF but it received DEAUTH_REQ. This means + * host is also trying to disconnect. + */ + limLog(pMac, LOG1, FL("Rcvd SME_DEAUTH_REQ while in " + "SME_WT_DISASSOC_STATE. ")); + break; default: /** * STA is not in a state to deauthenticate with @@ -2899,7 +3032,14 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) break; case eLIM_STA_IN_IBSS_ROLE: - + limLog(pMac, LOGE,FL("Deauth not allowed in IBSS")); + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + retCode = eSIR_SME_INVALID_PARAMETERS; + deauthTrigger = eLIM_HOST_DEAUTH; + goto sendDeauth; + } return; case eLIM_AP_ROLE: @@ -2911,14 +3051,27 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOGE, FL("received unexpected SME_DEAUTH_REQ for role %d"), psessionEntry->limSystemRole); + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + retCode = eSIR_SME_INVALID_PARAMETERS; + deauthTrigger = eLIM_HOST_DEAUTH; + goto sendDeauth; + } return; + } // end switch (pMac->lim.gLimSystemRole) if (smeDeauthReq.reasonCode == eLIM_LINK_MONITORING_DEAUTH) { /// Deauthentication is triggered by Link Monitoring - PELOG1(limLog(pMac, LOG1, FL("**** Lost link with AP ****"));) + limLog(pMac, LOG1, + FL("Deauthentication is triggered by Link Monitoring")); + limLog(pMac, LOG1, + FL("Set Trigger to eLIM_LINK_MONITORING_DEAUTH")); + limLog(pMac, LOG1, + FL("and Reason to eSIR_MAC_UNSPEC_FAILURE_REASON")); deauthTrigger = eLIM_LINK_MONITORING_DEAUTH; reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; } @@ -2933,9 +3086,15 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if ( NULL == pMlmDeauthReq ) { // Log error - limLog(pMac, LOGP, + limLog(pMac, LOGE, FL("call to AllocateMemory failed for mlmDeauthReq")); - + if (pMac->lim.gLimRspReqd) + { + pMac->lim.gLimRspReqd = false; + retCode = eSIR_SME_RESOURCES_UNAVAILABLE; + deauthTrigger = eLIM_HOST_DEAUTH; + goto sendDeauth; + } return; } @@ -3063,7 +3222,7 @@ __limProcessSmeSetContextReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmSetKeysReq")); goto end; } - + vos_mem_zero(pMlmSetKeysReq,sizeof(tLimMlmSetKeysReq)); pMlmSetKeysReq->edType = pSetContextReq->keyMaterial.edType; pMlmSetKeysReq->numKeys = pSetContextReq->keyMaterial.numKeys; if(pMlmSetKeysReq->numKeys > SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS) @@ -3158,8 +3317,8 @@ __limProcessSmeRemoveKeyReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tANI_U8 smesessionId; tANI_U16 smetransactionId; - PELOG1(limLog(pMac, LOG1, - FL("received REMOVEKEY_REQ message"));) + limLog(pMac, LOG1, + FL("received SME_REMOVEKEY_REQ message")); if(pMsgBuf == NULL) { @@ -3282,9 +3441,9 @@ void limProcessSmeGetScanChannelInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pMac->lim.scanChnInfo.numChnInfo = SIR_MAX_SUPPORTED_CHANNEL_LIST; } - PELOG2(limLog(pMac, LOG2, + limLog(pMac, LOG1, FL("Sending message %s with number of channels %d"), - limMsgStr(eWNI_SME_GET_SCANNED_CHANNEL_RSP), pMac->lim.scanChnInfo.numChnInfo);) + limMsgStr(eWNI_SME_GET_SCANNED_CHANNEL_RSP), pMac->lim.scanChnInfo.numChnInfo); len = sizeof(tSmeGetScanChnRsp) + (pMac->lim.scanChnInfo.numChnInfo - 1) * sizeof(tLimScanChn); pSirSmeRsp = vos_mem_malloc(len); @@ -3323,7 +3482,7 @@ void limProcessSmeGetScanChannelInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) mmhMsg.bodyval = 0; pMac->lim.gLimRspReqd = false; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -3388,7 +3547,7 @@ void limProcessSmeGetAssocSTAsInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { pStaDs = dphGetHashEntry(pMac, assocId, &psessionEntry->dph.dphHashTable); - if (NULL == pStaDs) + if ((NULL == pStaDs) || (NULL == pAssocStasTemp)) continue; if (pStaDs->valid) @@ -3509,7 +3668,9 @@ void limProcessSmeGetWPSPBCSessions(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limGetWPSPBCSessionsEnd: pSapEventCallback = (tpWLAN_SAPEventCB)GetWPSPBCSessionsReq.pSapEventCallback; - pSapEventCallback(&sapEvent, GetWPSPBCSessionsReq.pUsrContext); + + if (NULL != pSapEventCallback) + pSapEventCallback(&sapEvent, GetWPSPBCSessionsReq.pUsrContext); } @@ -3798,9 +3959,10 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg if (pStaDs == NULL) { - limLog(pMac, LOG1, - FL("Received invalid message %X due to no STA context, for aid %d, peer "), - msgType, assocCnf.aid); + limLog(pMac, LOGE, + FL("Received invalid message %X due to no STA context, " + "for aid %d, peer "), + msgType, assocCnf.aid); limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); /* @@ -3821,9 +3983,11 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg ((pStaDs->mlmStaContext.subType == LIM_REASSOC) && (msgType != eWNI_SME_ASSOC_CNF))))) // since softap is passing this as ASSOC_CNF and subtype differs { - limLog(pMac, LOG1, - FL("Received invalid message %X due to peerMacAddr mismatched or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer "), - msgType, assocCnf.aid); + limLog(pMac, LOGE, + FL("Received invalid message %X due to peerMacAddr mismatched " + "or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer " + "StaD mlmState : %d"), + msgType, assocCnf.aid, pStaDs->mlmStaContext.mlmState); limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); goto end; } @@ -3853,6 +4017,8 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg /*Since the HAL sta entry is created for denied STA we need to remove this HAL entry.So to do that set updateContext to 1*/ if(!pStaDs->mlmStaContext.updateContext) pStaDs->mlmStaContext.updateContext = 1; + limLog(pMac, LOG1, FL("Receive Assoc Cnf with status Code : %d(assoc id=%d) "), + assocCnf.statusCode, pStaDs->assocId); limRejectAssociation(pMac, pStaDs->staAddr, pStaDs->mlmStaContext.subType, true, pStaDs->mlmStaContext.authType, @@ -3922,10 +4088,10 @@ __limProcessSmeAddtsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) * - wait for addts response from ap * if ap, just ignore with error log */ - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("Received SME_ADDTS_REQ (TSid %d, UP %d)"), pSirAddts->req.tspec.tsinfo.traffic.tsid, - pSirAddts->req.tspec.tsinfo.traffic.userPrio);) + pSirAddts->req.tspec.tsinfo.traffic.userPrio); if ((psessionEntry->limSystemRole != eLIM_STA_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_STA_ROLE)) { @@ -3935,16 +4101,6 @@ __limProcessSmeAddtsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } - //Ignore the request if STA is in 11B mode. - if(psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11B) - { - PELOGE(limLog(pMac, LOGE, "AddTS received while Dot11Mode is 11B - ignoring");) - limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, - smesessionId,smetransactionId); - return; - } - - pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); if(pStaDs == NULL) @@ -4022,7 +4178,7 @@ __limProcessSmeAddtsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) // ship out the message now limSendAddtsReqActionFrame(pMac, peerMac, &pSirAddts->req, psessionEntry); - PELOG1(limLog(pMac, LOG1, "Sent ADDTS request");) + limLog(pMac, LOG1, FL("Sent ADDTS request")); // start a timer to wait for the response if (pSirAddts->timeout) @@ -4095,9 +4251,9 @@ __limProcessSmeDeltsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } - PELOG1(limLog(pMac, LOG1, FL("Sent DELTS request to station with " - "assocId = %d MacAddr = "MAC_ADDRESS_STR), - pDeltsReq->aid, MAC_ADDR_ARRAY(peerMacAddr));) + limLog(pMac, LOG1, FL("Sent DELTS request to station with " + "assocId = %d MacAddr = "MAC_ADDRESS_STR), + pDeltsReq->aid, MAC_ADDR_ARRAY(peerMacAddr)); limSendDeltsReqActionFrame(pMac, peerMacAddr, pDeltsReq->req.wmeTspecPresent, &pDeltsReq->req.tsinfo, &pDeltsReq->req.tspec, psessionEntry); @@ -4448,8 +4604,8 @@ __limProcessSmeHideSSID(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tpSirUpdateParams pUpdateParams; tpPESession psessionEntry; - PELOG1(limLog(pMac, LOG1, - FL("received HIDE_SSID message"));); + limLog(pMac, LOG1, + FL("received SME_HIDE_SSID message")); if(pMsgBuf == NULL) { @@ -4582,7 +4738,118 @@ __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } /*** end __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ +/** ------------------------------------------------------------- +\fn +\brief handles indication message from HDD to update HT mode +\param tpAniSirGlobal pMac +\param tANI_U32 pMsgBuf +\return None +-------------------------------------------------------------*/ +#ifdef WLAN_FEATURE_AP_HT40_24G +static void __limProcessSmeSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) +{ + tpSirSetHT2040Mode pSetHT2040Mode; + tpPESession psessionEntry; + tANI_U8 sessionId = 0; + tUpdateVHTOpMode *pHtOpMode = NULL; + vos_msg_t msg; + + PELOG1(limLog(pMac, LOGRW, + FL("received Set HT 20/40 mode message"));); + + if(pMsgBuf == NULL) + { + limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); + return; + } + + pSetHT2040Mode = (tpSirSetHT2040Mode)pMsgBuf; + + if((psessionEntry = peFindSessionByBssid(pMac, pSetHT2040Mode->bssId, + &sessionId)) == NULL) + { + limLog(pMac, LOGE, FL("Session does not exist for given BSSID ")); + limPrintMacAddr(pMac, pSetHT2040Mode->bssId, LOGE); + return; + } + + limLog(pMac, LOGW, FL("Update session entry for cbMod=%d"), + pSetHT2040Mode->cbMode); + + /*Update sessionEntry HT related fields*/ + switch(pSetHT2040Mode->cbMode) + { + case PHY_SINGLE_CHANNEL_CENTERED: + psessionEntry->htSecondaryChannelOffset = PHY_SINGLE_CHANNEL_CENTERED; + psessionEntry->htRecommendedTxWidthSet = 0; + break; + case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: + psessionEntry->htSecondaryChannelOffset = + PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + psessionEntry->htRecommendedTxWidthSet = 1; + break; + case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: + psessionEntry->htSecondaryChannelOffset = + PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + psessionEntry->htRecommendedTxWidthSet = 1; + break; + default: + limLog(pMac, LOGE,FL("Invalid cbMode")); + return; + } + + limLog(pMac, LOGW, FL("Channel Bonding mode : %d" + " htSecondaryChannelOffset: %d" + " htRecommendedTxWidthSet :%d"), + pSetHT2040Mode->cbMode, + psessionEntry->htSecondaryChannelOffset, + psessionEntry->htRecommendedTxWidthSet); + + limLog(pMac, LOGW, FL("Update Beacon IEs")); + + /* Update beacon */ + schSetFixedBeaconFields(pMac, psessionEntry); + limSendBeaconInd(pMac, psessionEntry); + + /* Update OP Mode */ + pHtOpMode = vos_mem_malloc(sizeof(tUpdateVHTOpMode)); + if ( NULL == pHtOpMode ) + { + limLog(pMac, LOGE, + FL("Not able to allocate memory for setting OP mode")); + return; + } + + pHtOpMode->opMode = (psessionEntry->htSecondaryChannelOffset == + PHY_SINGLE_CHANNEL_CENTERED)? + eHT_CHANNEL_WIDTH_20MHZ:eHT_CHANNEL_WIDTH_40MHZ; + /* Pass Self STA ID to FW. Based on Self STA ID FW will update the + * operating mode for all connected STA. + */ + + pHtOpMode->staId = psessionEntry->staId; + + msg.type = WDA_UPDATE_OP_MODE; + msg.reserved = 0; + msg.bodyptr = pHtOpMode; + + if (!VOS_IS_STATUS_SUCCESS( + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) + { + limLog(pMac, LOGE, + FL("Not able to post WDA_UPDATE_OP_MODE message to WDA")); + vos_mem_free(pHtOpMode); + return; + } + + limLog(pMac, LOGW, + FL("Notifed FW about OP mode: %d for staId=%d"), + pHtOpMode->opMode, pHtOpMode->staId); + + return; +} +#endif /** ------------------------------------------------------------- \fn limProcessSmeDelBaPeerInd @@ -4718,11 +4985,12 @@ limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac, tPowerdBm txPower, tpPESession pS } #if defined(WLAN_VOWIFI_DEBUG) || defined(FEATURE_WLAN_ESE) - PELOG1(limLog( pMac, LOG1, "%s:%d: Allocated memory for pMaxTxParams...will be freed in other module", __func__, __LINE__ );) + limLog( pMac, LOG1, + FL(" Allocated memory for pMaxTxParams, which will be freed in other module")); #endif if( pMaxTxParams == NULL ) { - limLog( pMac, LOGE, "%s:%d: pMaxTxParams is NULL", __func__, __LINE__); + limLog( pMac, LOGE, FL("pMaxTxParams is NULL")); return eSIR_FAILURE; } pMaxTxParams->power = txPower; @@ -4732,7 +5000,7 @@ limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac, tPowerdBm txPower, tpPESession pS msgQ.type = WDA_SET_MAX_TX_POWER_REQ; msgQ.bodyptr = pMaxTxParams; msgQ.bodyval = 0; - PELOG1(limLog(pMac, LOG1, FL("Posting WDA_SET_MAX_TX_POWER_REQ to WDA"));) + limLog(pMac, LOG1, FL("Posting WDA_SET_MAX_TX_POWER_REQ to WDA")); MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg(pMac, &msgQ); if (eSIR_SUCCESS != retCode) @@ -4833,7 +5101,7 @@ __limProcessSmeDelStaSelfReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) msg.bodyptr = pDelStaSelfParams; msg.bodyval = 0; - PELOGW(limLog(pMac, LOG1, FL("sending SIR_HAL_ADD_STA_SELF_REQ msg to HAL"));) + PELOGW(limLog(pMac, LOG1, FL("sending SIR_HAL_DEL_STA_SELF_REQ msg to HAL"));) MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) @@ -4868,9 +5136,9 @@ __limProcessSmeRegisterMgmtFrameReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) tpSirRegisterMgmtFrame pSmeReq = (tpSirRegisterMgmtFrame)pMsgBuf; tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL; tANI_BOOLEAN match = VOS_FALSE; - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("registerFrame %d, frameType %d, matchLen %d"), - pSmeReq->registerFrame, pSmeReq->frameType, pSmeReq->matchLen);) + pSmeReq->registerFrame, pSmeReq->frameType, pSmeReq->matchLen); /* First check whether entry exists already*/ @@ -5146,305 +5414,6 @@ void limProcessRegdDefdSmeReqAfterNOAStart(tpAniSirGlobal pMac) } } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Process Discovery request recieved from SME and transmit to AP. - */ -static tSirRetStatus limProcessSmeDisStartReq(tpAniSirGlobal pMac, - tANI_U32 *pMsgBuf) -{ - /* get all discovery request parameters */ - tSirTdlsDisReq *disReq = (tSirTdlsDisReq *) pMsgBuf ; - tpPESession psessionEntry; - tANI_U8 sessionId; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Discovery Req Recieved")) ; - - if((psessionEntry = peFindSessionByBssid(pMac, disReq->bssid, &sessionId)) - == NULL) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - disReq->sessionId); - goto lim_tdls_dis_start_error; - } - - /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "dis req received in wrong system Role %d", - psessionEntry->limSystemRole); - goto lim_tdls_dis_start_error; - } - - /* - * if we are still good, go ahead and check if we are in proper state to - * do TDLS discovery procedure. - */ - if ((psessionEntry->limSmeState != eLIM_SME_ASSOCIATED_STATE) && - (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) - { - - limLog(pMac, LOGE, "dis req received in invalid LIMsme \ - state (%d)", psessionEntry->limSmeState); - goto lim_tdls_dis_start_error; - } - - /* - * if we are still good, go ahead and transmit TDLS discovery request, - * and save Dis Req info for future reference. - */ - -#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet - /* - * send message to HAL to set RXP filters to receieve frame on - * direct link.. - */ - //limSetLinkState(pMac, eSIR_LINK_TDLS_DISCOVERY_STATE, - // psessionEntry->bssId) ; -#endif - - /* save dis request message for matching dialog token */ - vos_mem_copy((tANI_U8 *) &pMac->lim.gLimTdlsDisReq, - (tANI_U8 *) disReq, sizeof(tSirTdlsDisReq)); - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - "Transmit Discovery Request Frame") ; - /* format TDLS discovery request frame and transmit it */ - limSendTdlsDisReqFrame(pMac, disReq->peerMac, disReq->dialog, - psessionEntry) ; - - /* prepare for response */ - pMac->lim.gLimTdlsDisStaCount = 0 ; - pMac->lim.gLimTdlsDisResultList = NULL ; - - /* - * start TDLS discovery request timer to wait for discovery responses - * from all TDLS enabled clients in BSS. - */ - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Start Discovery request Timeout Timer")) ; - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, - eLIM_TDLS_DISCOVERY_RSP_WAIT)); - - /* assign appropriate sessionId to the timer object */ - pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId = - psessionEntry->peSessionId; - - if (tx_timer_activate(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer) - != TX_SUCCESS) - { - limLog(pMac, LOGP, FL("TDLS discovery response timer \ - activation failed!")); - goto lim_tdls_dis_start_error; - } - /* - * when timer expired, eWNI_SME_TDLS_DISCOVERY_START_RSP is sent - * back to SME - */ - return (eSIR_SUCCESS) ; -lim_tdls_dis_start_error: - /* in error case, PE has to sent the response SME immediately with error code */ - limSendSmeTdlsDisRsp(pMac, eSIR_FAILURE, - eWNI_SME_TDLS_DISCOVERY_START_RSP); - return eSIR_FAILURE; -} -/* - * Process link start request recieved from SME and transmit to AP. - */ -eHalStatus limProcessSmeLinkStartReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) -{ - /* get all discovery request parameters */ - tSirTdlsSetupReq *setupReq = (tSirTdlsSetupReq *) pMsgBuf ; - tLimTdlsLinkSetupInfo *linkSetupInfo; - //tLimTdlsLinkSetupPeer *setupPeer; - tpPESession psessionEntry; - tANI_U8 sessionId; - eHalStatus status; - - if((psessionEntry = peFindSessionByBssid(pMac, - setupReq->bssid, &sessionId)) == NULL) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - setupReq->sessionId); - goto lim_tdls_link_start_error; - } - - /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "TDLS link setup req received in wrong system Role %d", - psessionEntry->limSystemRole); - goto lim_tdls_link_start_error; - } - - /* - * if we are still good, go ahead and check if we are in proper state to - * do TDLS setup procedure. - */ - if ((psessionEntry->limSmeState != eLIM_SME_ASSOCIATED_STATE) && - (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) - { - limLog(pMac, LOGE, "Setup request in invalid LIMsme \ - state (%d)", pMac->lim.gLimSmeState); - goto lim_tdls_link_start_error; - } - - /* - * Now, go ahead and transmit TDLS discovery request, and save setup Req - * info for future reference. - */ - /* create node for Link setup */ - linkSetupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - //setupPeer = NULL ; - - status = limTdlsPrepareSetupReqFrame(pMac, linkSetupInfo, setupReq->dialog, - setupReq->peerMac, psessionEntry) ; - if(eHAL_STATUS_SUCCESS == status) - /* in case of success, eWNI_SME_TDLS_LINK_START_RSP is sent back to SME later when - TDLS setup cnf TX complete is successful. */ - return eSIR_SUCCESS; -#if 0 - - /* - * we allocate the TDLS setup Peer Memory here, we will free'd this - * memory after teardown, if the link is successfully setup or - * free this memory if any timeout is happen in link setup procedure - */ - setupPeer = vos_mem_malloc(sizeof( tLimTdlsLinkSetupPeer )); - if ( NULL == setupPeer ) - { - limLog( pMac, LOGP, - FL( "Unable to allocate memory during ADD_STA" )); - VOS_ASSERT(0) ; - return eSIR_MEM_ALLOC_FAILED; - } - setupPeer->dialog = setupReq->dialog ; - setupPeer->tdls_prev_link_state = setupPeer->tdls_link_state ; - setupPeer->tdls_link_state = TDLS_LINK_SETUP_START_STATE ; - /* TDLS_sessionize: remember sessionId for future */ - setupPeer->tdls_sessionId = psessionEntry->peSessionId; - setupPeer->tdls_bIsResponder = 1; - - /* - * we only populate peer MAC, so it can assit us to find the - * TDLS peer after response/or after response timeout - */ - vos_mem_copy(setupPeer->peerMac, setupReq->peerMac, - sizeof(tSirMacAddr)) ; - /* format TDLS discovery request frame and transmit it */ - limSendTdlsLinkSetupReqFrame(pMac, setupReq->peerMac, - setupReq->dialog, psessionEntry, NULL, 0) ; - - limStartTdlsTimer(pMac, psessionEntry->peSessionId, - &setupPeer->gLimTdlsLinkSetupRspTimeoutTimer, - (tANI_U32)setupPeer->peerMac, WNI_CFG_TDLS_LINK_SETUP_RSP_TIMEOUT, - SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT) ; - /* update setup peer list */ - setupPeer->next = linkSetupInfo->tdlsLinkSetupList ; - linkSetupInfo->tdlsLinkSetupList = setupPeer ; - /* in case of success, eWNI_SME_TDLS_LINK_START_RSP is sent back to SME later when - TDLS setup cnf TX complete is successful. --> see limTdlsSetupCnfTxComplete() */ - return eSIR_SUCCESS ; -#endif -lim_tdls_link_start_error: - /* in case of error, return immediately to SME */ - limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, setupReq->peerMac, - eWNI_SME_TDLS_LINK_START_RSP); - return eSIR_FAILURE ; -} - -/* - * Process link teardown request recieved from SME and transmit to AP. - */ -eHalStatus limProcessSmeTeardownReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) -{ - /* get all discovery request parameters */ - tSirTdlsTeardownReq *teardownReq = (tSirTdlsTeardownReq *) pMsgBuf ; - tLimTdlsLinkSetupPeer *setupPeer; - tpPESession psessionEntry; - tANI_U8 sessionId; - - if((psessionEntry = peFindSessionByBssid(pMac, teardownReq->bssid, &sessionId)) == NULL) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", teardownReq->sessionId); - goto lim_tdls_teardown_req_error; - } - - /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "TDLS teardown req received in wrong system Role %d", psessionEntry->limSystemRole); - goto lim_tdls_teardown_req_error; - } - - /* - * if we are still good, go ahead and check if we are in proper state to - * do TDLS setup procedure. - */ - if ((psessionEntry->limSmeState != eLIM_SME_ASSOCIATED_STATE) && - (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) - { - limLog(pMac, LOGE, "TDLS teardwon req received in invalid LIMsme \ - state (%d)", psessionEntry->limSmeState); - goto lim_tdls_teardown_req_error; - } - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - "Teardown for peer = " MAC_ADDRESS_STR, MAC_ADDR_ARRAY(teardownReq->peerMac)); - /* - * Now, go ahead and transmit TDLS teardown request, and save teardown info - * info for future reference. - */ - /* Verify if this link is setup */ - setupPeer = NULL ; - limTdlsFindLinkPeer(pMac, teardownReq->peerMac, &setupPeer); - if(NULL == setupPeer) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("invalid Peer on teardown ")) ; - goto lim_tdls_teardown_req_error; - } - - - (setupPeer)->tdls_prev_link_state = (setupPeer)->tdls_link_state ; - (setupPeer)->tdls_link_state = TDLS_LINK_TEARDOWN_START_STATE ; - /* TDLS_sessionize: check sessionId in case */ - if((setupPeer)->tdls_sessionId != psessionEntry->peSessionId) - { - limLog(pMac, LOGE, "TDLS teardown req; stored sessionId (%d) not matched from peSessionId (%d)", \ - (setupPeer)->tdls_sessionId, psessionEntry->limSmeState); - (setupPeer)->tdls_sessionId = psessionEntry->peSessionId; - } - - /* format TDLS teardown request frame and transmit it */ - if(eSIR_SUCCESS != limSendTdlsTeardownFrame(pMac, teardownReq->peerMac, - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON, psessionEntry, NULL, 0 )) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("couldn't send teardown frame ")) ; - goto lim_tdls_teardown_req_error; - } - /* in case of success, eWNI_SME_TDLS_TEARDOWN_RSP is sent back to SME later when - TDLS teardown TX complete is successful. --> see limTdlsTeardownTxComplete() */ - return eSIR_SUCCESS; -lim_tdls_teardown_req_error: - /* in case of error, return immediately to SME */ - limSendSmeTdlsTeardownRsp(pMac, eSIR_FAILURE, teardownReq->peerMac, - eWNI_SME_TDLS_TEARDOWN_RSP); - return eSIR_FAILURE; -} - - -#endif - static void __limProcessSmeResetApCapsChange(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { @@ -5479,12 +5448,17 @@ __limProcessSmeSpoofMacAddrRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pSpoofMacAddrParams = vos_mem_malloc(sizeof( tSpoofMacAddrReqParams)); if ( NULL == pSpoofMacAddrParams ) { - limLog( pMac, LOGP, FL("Unable to allocate memory for tDelStaSelfParams") ); + limLog( pMac, LOGE, FL("Unable to allocate memory for tDelStaSelfParams") ); return; } vos_mem_copy( pSpoofMacAddrParams->macAddr, pSmeReq->macAddr, sizeof(tSirMacAddr) ); + vos_mem_copy(pMac->lim.spoofMacAddr, pSmeReq->macAddr, VOS_MAC_ADDRESS_LEN); + + limLog( pMac, LOG1, FL("Recieved Spoofed Mac Addr request with Addr:" + MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMac->lim.spoofMacAddr) ); + msg.type = WDA_SPOOF_MAC_ADDR_REQ; msg.reserved = 0; msg.bodyptr = pSpoofMacAddrParams; @@ -5495,12 +5469,41 @@ __limProcessSmeSpoofMacAddrRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) { - limLog(pMac, LOGP, FL("wdaPostCtrlMsg failed for SIR_HAL_SPOOF_MAC_ADDR_REQ")); + limLog(pMac, LOGE, FL("wdaPostCtrlMsg failed for SIR_HAL_SPOOF_MAC_ADDR_REQ")); vos_mem_free(pSpoofMacAddrParams); } return; } +/** + * lim_register_mgmt_frame_ind_cb() - Save the Management frame + * indication callback in PE. + * @pMac: Mac pointer + * @pMsgBuf: Msg pointer containing the callback + * + * This function is used save the Management frame + * indication callback in PE. + * + * Return: None + */ +static void lim_register_mgmt_frame_ind_cb(tpAniSirGlobal pMac, + tANI_U32 *msg_buf) +{ + struct sir_sme_mgmt_frame_cb_req *sme_req = + (struct sir_sme_mgmt_frame_cb_req *)msg_buf; + + if (NULL == msg_buf) + { + limLog(pMac, LOGE, FL("msg_buf is null")); + return; + } + if (sme_req->callback) + pMac->mgmt_frame_ind_cb = + (sir_mgmt_frame_ind_callback)sme_req->callback; + else + limLog(pMac, LOGE, FL("sme_req->callback is null")); +} + /** * limProcessSmeReqMessages() * @@ -5685,24 +5688,24 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) case eWNI_SME_ASSOC_CNF: case eWNI_SME_REASSOC_CNF: if (pMsg->type == eWNI_SME_ASSOC_CNF) - PELOG1(limLog(pMac, LOG1, FL("Received ASSOC_CNF message"));) + limLog(pMac, LOG1, FL("Received ASSOC_CNF message")); else - PELOG1(limLog(pMac, LOG1, FL("Received REASSOC_CNF message"));) + limLog(pMac, LOG1, FL("Received REASSOC_CNF message")); __limProcessSmeAssocCnfNew(pMac, pMsg->type, pMsgBuf); break; case eWNI_SME_ADDTS_REQ: - PELOG1(limLog(pMac, LOG1, FL("Received ADDTS_REQ message"));) + limLog(pMac, LOG1, FL("Received ADDTS_REQ message")); __limProcessSmeAddtsReq(pMac, pMsgBuf); break; case eWNI_SME_DELTS_REQ: - PELOG1(limLog(pMac, LOG1, FL("Received DELTS_REQ message"));) + limLog(pMac, LOG1, FL("Received DELTS_REQ message")); __limProcessSmeDeltsReq(pMac, pMsgBuf); break; case SIR_LIM_ADDTS_RSP_TIMEOUT: - PELOG1(limLog(pMac, LOG1, FL("Received SIR_LIM_ADDTS_RSP_TIMEOUT message "));) + limLog(pMac, LOG1, FL("Received SIR_LIM_ADDTS_RSP_TIMEOUT message ")); limProcessSmeAddtsRspTimeout(pMac, pMsg->bodyval); break; @@ -5763,6 +5766,12 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) //Update the beaconInterval __limProcessSmeChangeBI(pMac, pMsgBuf ); break; + +#ifdef WLAN_FEATURE_AP_HT40_24G + case eWNI_SME_SET_HT_2040_MODE: + __limProcessSmeSetHT2040Mode(pMac, pMsgBuf); + break; +#endif #if defined WLAN_FEATURE_VOWIFI case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: @@ -5816,17 +5825,6 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ: limProcesSmeTdlsChanSwitchReq(pMac, pMsgBuf); break; -#endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eWNI_SME_TDLS_DISCOVERY_START_REQ: - limProcessSmeDisStartReq(pMac, pMsgBuf); - break ; - case eWNI_SME_TDLS_LINK_START_REQ: - limProcessSmeLinkStartReq(pMac, pMsgBuf); - break ; - case eWNI_SME_TDLS_TEARDOWN_REQ: - limProcessSmeTeardownReq(pMac, pMsgBuf); - break ; #endif case eWNI_SME_RESET_AP_CAPS_CHANGED: __limProcessSmeResetApCapsChange(pMac, pMsgBuf); @@ -5839,7 +5837,9 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) case eWNI_SME_MAC_SPOOF_ADDR_IND: __limProcessSmeSpoofMacAddrRequest(pMac, pMsgBuf); break ; - + case eWNI_SME_REGISTER_MGMT_FRAME_CB: + lim_register_mgmt_frame_ind_cb(pMac, pMsgBuf); + break; default: vos_mem_free((v_VOID_t*)pMsg->bodyptr); pMsg->bodyptr = NULL; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessTdls.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessTdls.c index e6ad9b57403b..ed7f863dc92d 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessTdls.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessTdls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -92,32 +92,7 @@ If there is other IOT issue because of this bandage, define NO_PAD... #define MIN_IEEE_8023_SIZE 46 #define MIN_VENDOR_SPECIFIC_IE_SIZE 5 #endif -#ifdef WLAN_FEATURE_TDLS_DEBUG -#define TDLS_DEBUG_LOG_LEVEL VOS_TRACE_LEVEL_ERROR -#else -#define TDLS_DEBUG_LOG_LEVEL VOS_TRACE_LEVEL_INFO -#endif - - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* forword declarations */ -static tSirRetStatus limTdlsDisAddSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, - tSirTdlsPeerInfo *peerInfo, tpPESession psessionEntry) ; -static eHalStatus limSendSmeTdlsLinkSetupInd(tpAniSirGlobal pMac, - tSirMacAddr peerMac, tANI_U8 status); -static eHalStatus limSendSmeTdlsDelPeerInd(tpAniSirGlobal pMac, - tANI_U8 sessionId, tDphHashNode *pStaDs, tANI_U8 status) ; -static tSirTdlsPeerInfo *limTdlsFindDisPeerByState(tpAniSirGlobal pMac, - tANI_U8 state); -static tANI_U8 limTdlsFindSetupPeerByState(tpAniSirGlobal pMac, tANI_U8 state, - tLimTdlsLinkSetupPeer **setupPeer) ; -static tSirRetStatus limTdlsLinkEstablish(tpAniSirGlobal pMac, tSirMacAddr peer_mac); - -static tSirRetStatus limTdlsLinkTeardown(tpAniSirGlobal pMac, tSirMacAddr peer_mac); -static tpDphHashNode limTdlsDelSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, - tpPESession psessionEntry) ; -#endif static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, tSirTdlsAddStaReq *pAddStaReq, tpPESession psessionEntry) ; @@ -159,6 +134,9 @@ op_class_map_t global_op_class[] = { {125, 20, BW20, {149, 153, 157, 161, 165, 169}}, {126, 40, BW40PLUS, {149, 157}}, {127, 40, BW40MINUS, {153, 161}}, + {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, + 116, 120, 124, 128, 132, 136, 140, 144, + 149, 153, 157, 161}}, {0, 0, 0, {0}}, };/*end global_op_class*/ @@ -166,18 +144,22 @@ op_class_map_t global_op_class[] = { op_class_map_t us_op_class[] = { {1, 20, BW20, {36, 40, 44, 48}}, {2, 20, BW20, {52, 56, 60, 64}}, - {4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, + {4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144}}, {5, 20, BW20, {149, 153, 157, 161, 165}}, + {12, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}, {22, 40, BW40PLUS, {36, 44}}, {23, 40, BW40PLUS, {52, 60}}, - {24, 40, BW40PLUS, {100, 108, 116, 124, 132}}, + {24, 40, BW40PLUS, {100, 108, 116, 124, 132, 140}}, {26, 40, BW40PLUS, {149, 157}}, {27, 40, BW40MINUS, {40, 48}}, {28, 40, BW40MINUS, {56, 64}}, - {29, 40, BW40MINUS, {104, 112, 120, 128, 136}}, + {29, 40, BW40MINUS, {104, 112, 120, 128, 136, 144}}, {31, 40, BW40MINUS, {153, 161}}, {32, 40, BW40PLUS, {1, 2, 3, 4, 5, 6, 7}}, {33, 40, BW40MINUS, {5, 6, 7, 8, 9, 10, 11}}, + {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, + 116, 120, 124, 128, 132, 136, 140, 144, + 149, 153, 157, 161}}, {0, 0, 0, {0}}, };/*end us_op_class*/ @@ -195,6 +177,8 @@ op_class_map_t euro_op_class[] = { {11, 40, BW40PLUS, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, {12, 40, BW40MINUS, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, {17, 20, BW20, {149, 153, 157, 161, 165, 169}}, + {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, + 116, 120, 124, 128}}, {0, 0, 0, {0}}, };/*end euro_op_class*/ @@ -210,6 +194,8 @@ op_class_map_t japan_op_class[] = { {41, 40, BW40MINUS, {40, 48}}, {42, 40, BW40MINUS, {56, 64}}, {44, 40, BW40MINUS, {104, 112, 120, 128, 136}}, + {128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, + 116, 120, 124, 128}}, {0, 0, 0, {0}}, };/*end japan_op_class*/ @@ -223,6 +209,12 @@ static const tANI_U8 eth_890d_header[] = 0x00, 0x00, 0x89, 0x0d, } ; +/* store tdls self supported channels + * which are non passive */ +#define LIM_TDLS_MAX_NON_DFS_CHANNELS 50 +static tANI_U8 tdlsSelfNumChans = 0; +static tANI_U8 tdlsSelfSupportedChannels[LIM_TDLS_MAX_NON_DFS_CHANNELS] = {0}; + /* * type of links used in TDLS */ @@ -354,19 +346,6 @@ static void printMacAddr(tSirMacAddr macAddr) */ void limInitTdlsData(tpAniSirGlobal pMac, tpPESession pSessionEntry) { -#ifdef FEATURE_WLAN_TDLS_INTERNAL - pMac->lim.gLimTdlsDisResultList = NULL ; - pMac->lim.gLimTdlsDisStaCount = 0 ; - vos_mem_set(&pMac->lim.gLimTdlsDisReq, sizeof(tSirTdlsDisReq), 0); - vos_mem_set(&pMac->lim.gLimTdlsLinkSetupInfo, sizeof(tLimTdlsLinkSetupInfo), 0); - pMac->lim.gAddStaDisRspWait = 0 ; - -#ifdef FEATURE_WLAN_TDLS_NEGATIVE - /* when reassociated, negative behavior will not be kept */ - /* you have to explicitly enable negative behavior per (re)association */ - pMac->lim.gLimTdlsNegativeBehavior = 0; -#endif -#endif limInitPeerIdxpool(pMac, pSessionEntry) ; return ; @@ -455,13 +434,16 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, tANI_U32 header_offset = 0 ; tANI_U8 *addr1 = NULL ; tANI_U8 *addr3 = NULL ; + tpDphHashNode pStaDs = NULL; + tANI_U16 aid = 0; + tANI_U8 qosMode = 0; + tANI_U8 toDs = (tdlsLinkType == TDLS_LINK_AP) ? ANI_TXDIR_TODS :ANI_TXDIR_IBSS ; tANI_U8 *peerMac = (reqType == TDLS_INITIATOR) ? link_iden->RespStaAddr : link_iden->InitStaAddr; tANI_U8 *staMac = (reqType == TDLS_INITIATOR) ? link_iden->InitStaAddr : link_iden->RespStaAddr; - pMacHdr = (tpSirMacDataHdr3a) (pFrame); /* @@ -478,7 +460,18 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, */ pMacHdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; pMacHdr->fc.type = SIR_MAC_DATA_FRAME ; - pMacHdr->fc.subType = IS_QOS_ENABLED(psessionEntry) ? SIR_MAC_DATA_QOS_DATA : SIR_MAC_DATA_DATA; + + pStaDs = dphLookupHashEntry(pMac, peerMac, &aid, + &psessionEntry->dph.dphHashTable); + if (pStaDs) + { + qosMode = pStaDs->qosMode; + } + + pMacHdr->fc.subType = ((IS_QOS_ENABLED(psessionEntry) && + (tdlsLinkType == TDLS_LINK_AP)) || + ((tdlsLinkType == TDLS_LINK_DIRECT) && qosMode)) + ? SIR_MAC_DATA_QOS_DATA : SIR_MAC_DATA_DATA; /* * TL is not setting up below fields, so we are doing it here @@ -499,17 +492,19 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, (tANI_U8 *) (addr3), sizeof( tSirMacAddr )); - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN, ("Preparing TDLS frame header to %s\n%02x:%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x:%02x"), - (tdlsLinkType == TDLS_LINK_AP) ? "AP" : "TD", - pMacHdr->addr1[0], pMacHdr->addr1[1], pMacHdr->addr1[2], pMacHdr->addr1[3], pMacHdr->addr1[4], pMacHdr->addr1[5], - pMacHdr->addr2[0], pMacHdr->addr2[1], pMacHdr->addr2[2], pMacHdr->addr2[3], pMacHdr->addr2[4], pMacHdr->addr2[5], - pMacHdr->addr3[0], pMacHdr->addr3[1], pMacHdr->addr3[2], pMacHdr->addr3[3], pMacHdr->addr3[4], pMacHdr->addr3[5])); + limLog(pMac, LOG1, + FL("Preparing TDLS frame header to %s A1:"MAC_ADDRESS_STR", A2:"MAC_ADDRESS_STR", A3:"MAC_ADDRESS_STR), + (tdlsLinkType == TDLS_LINK_AP) ? "AP" : "DIRECT", + MAC_ADDR_ARRAY(pMacHdr->addr1), + MAC_ADDR_ARRAY(pMacHdr->addr2), + MAC_ADDR_ARRAY(pMacHdr->addr3)); //printMacAddr(pMacHdr->bssId) ; //printMacAddr(pMacHdr->sa) ; //printMacAddr(pMacHdr->da) ; - if (IS_QOS_ENABLED(psessionEntry)) + if (((tdlsLinkType == TDLS_LINK_AP) && (IS_QOS_ENABLED(psessionEntry))) || + ((tdlsLinkType == TDLS_LINK_DIRECT) && qosMode)) { pMacHdr->qosControl.tid = tid; header_offset += sizeof(tSirMacDataHdr3a); @@ -535,20 +530,34 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, * TX Complete for Management frames */ eHalStatus limMgmtTXComplete(tpAniSirGlobal pMac, - tANI_U32 txCompleteSuccess) + void *pData) { - tpPESession psessionEntry = NULL ; + tANI_U32 txCompleteSuccess = 0; + tpSirTxBdStatus pTxBdStatus = NULL; + + if (!pData) + { + limLog(pMac, LOGE, FL("pData is NULL")); + return eHAL_STATUS_SUCCESS; + } + + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + pTxBdStatus = (tpSirTxBdStatus) pData; + txCompleteSuccess = pTxBdStatus->txCompleteStatus; + limLog(pMac, LOG1, FL("txCompleteSuccess %u, token %u"), + txCompleteSuccess, pTxBdStatus->txBdToken); + } + else + { + txCompleteSuccess = *((tANI_U32*) pData); + limLog(pMac, LOG1, FL("txCompleteSuccess %u"), txCompleteSuccess); + } if (0xff != pMac->lim.mgmtFrameSessionId) { - psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.mgmtFrameSessionId); - if (NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("%s: sessionID %d is not found"), __func__, pMac->lim.mgmtFrameSessionId); - return eHAL_STATUS_FAILURE; - } - limSendSmeMgmtTXCompletion(pMac, psessionEntry, txCompleteSuccess); + limSendSmeMgmtTXCompletion(pMac, pMac->lim.mgmtFrameSessionId, + txCompleteSuccess); pMac->lim.mgmtFrameSessionId = 0xff; } return eHAL_STATUS_SUCCESS; @@ -601,16 +610,17 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, status = dot11fGetPackedTDLSDisReqSize( pMac, &tdlsDisReq, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a discovery Request (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fTDLSDisReq ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a discovery Request (0x%08x)."), + status); } /* @@ -649,8 +659,9 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Discovery Request."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -682,16 +693,16 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, FL("Failed to pack a TDLS discovery req (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, FL("There were warnings while packing TDLS Discovery Request (0x%08x)."), + status); } #ifndef NO_PAD_TDLS_MIN_8023_SIZE @@ -706,8 +717,7 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -716,8 +726,11 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, } #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA "), - SIR_MAC_TDLS_DIS_REQ, limTraceTdlsActionString(SIR_MAC_TDLS_DIS_REQ) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_DIS_REQ, + limTraceTdlsActionString(SIR_MAC_TDLS_DIS_REQ), + MAC_ADDR_ARRAY(peer_mac)); halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, HAL_TXRX_FRM_802_11_DATA, @@ -725,267 +738,20 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, TID_AC_VI, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME); + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Discovery Request frame")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Once Discovery response is sent successfully (or failure) on air, now send - * response to PE and send del STA to HAL. - */ -eHalStatus limTdlsDisRspTxComplete(tpAniSirGlobal pMac, - tANI_U32 txCompleteSuccess) -{ - eHalStatus status = eHAL_STATUS_SUCCESS ; - tpDphHashNode pStaDs = NULL ; - tSirTdlsPeerInfo *peerInfo = 0 ; - - /* find peer by looking into the list by expected state */ - peerInfo = limTdlsFindDisPeerByState(pMac, TDLS_DIS_RSP_SENT_WAIT_STATE) ; - - if(NULL == peerInfo) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("DisRspTxComplete: No TDLS state machine waits for this event")); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - peerInfo->tdlsPeerState = TDLS_DIS_RSP_SENT_DONE_STATE ; - - if(peerInfo->delStaNeeded) - { - tpPESession psessionEntry; - - peerInfo->delStaNeeded = false ; - psessionEntry = peFindSessionBySessionId (pMac, peerInfo->sessionId); - - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("DisRspTxComplete: sessionID %d is not found"), peerInfo->sessionId); - return eHAL_STATUS_FAILURE; - } - /* send del STA to remove context for this TDLS STA */ - pStaDs = limTdlsDelSta(pMac, peerInfo->peerMac, psessionEntry) ; - - /* now send indication to SME-->HDD->TL to remove STA from TL */ - if(pStaDs) - { - limSendSmeTdlsDelPeerInd(pMac, psessionEntry->smeSessionId, - pStaDs, eSIR_SUCCESS) ; - } - else - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("DisRspTxComplete: staDs not found for " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY((peerInfo)->peerMac)); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - } - - if(!txCompleteSuccess) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TX complete failure for Dis RSP")); - limSendSmeTdlsDisRsp(pMac, eSIR_FAILURE, - eWNI_SME_TDLS_DISCOVERY_START_IND) ; - status = eHAL_STATUS_FAILURE; - } - else - { - limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS, - eWNI_SME_TDLS_DISCOVERY_START_IND) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TX complete Success for Dis RSP")); - status = eHAL_STATUS_SUCCESS ; - } - //pMac->hal.pCBackFnTxComp = NULL ; - return status ; - -} -#endif - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Once setup CNF is sent successfully (or failure) on air, now send - * response to PE and send del STA to HAL. - */ -eHalStatus limTdlsSetupCnfTxComplete(tpAniSirGlobal pMac, - tANI_U32 txCompleteSuccess) -{ - eHalStatus status = eHAL_STATUS_SUCCESS ; - tLimTdlsLinkSetupPeer *peerInfo = 0 ; - /* find peer by looking into the list by expected state */ - limTdlsFindSetupPeerByState(pMac, - TDLS_LINK_SETUP_RSP_WAIT_STATE, &peerInfo) ; - - if(NULL == peerInfo) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsSetupCnfTxComplete: No TDLS state machine waits for this event")); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - (peerInfo)->tdls_prev_link_state = (peerInfo)->tdls_link_state ; - (peerInfo)->tdls_link_state = TDLS_LINK_SETUP_DONE_STATE ; - - if(!txCompleteSuccess) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TX complete Failure for setup CNF")); - limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, (peerInfo)->peerMac, - eWNI_SME_TDLS_LINK_START_RSP) ; - status = eHAL_STATUS_FAILURE; - } - else - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("RSP-->SME peer MAC = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY((peerInfo)->peerMac)); - - limSendSmeTdlsLinkStartRsp(pMac, eSIR_SUCCESS, (peerInfo)->peerMac, - eWNI_SME_TDLS_LINK_START_RSP) ; - - /* tdls_hklee: prepare PTI template and send it to HAL */ - limTdlsLinkEstablish(pMac, (peerInfo)->peerMac); - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TX complete Success for setup CNF")); - status = eHAL_STATUS_SUCCESS ; - } - //pMac->hal.pCBackFnTxComp = NULL ; - return status ; -} -#endif - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Tx Complete for Teardown frame - */ -eHalStatus limTdlsTeardownTxComplete(tpAniSirGlobal pMac, - tANI_U32 txCompleteSuccess) -{ - eHalStatus status = eHAL_STATUS_SUCCESS ; - tpDphHashNode pStaDs = NULL ; - tLimTdlsLinkSetupPeer *peerInfo = 0 ; - tpPESession psessionEntry = NULL ; - //tANI_U16 msgType = 0 ; - - //tSirMacAddr peerMac = {0} ; - /* find peer by looking into the list by expected state */ - limTdlsFindSetupPeerByState(pMac, - TDLS_LINK_TEARDOWN_START_STATE, &peerInfo) ; - - if(NULL == peerInfo) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsTeardownTxComplete: No TDLS state machine waits for this event")); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("teardown peer Mac = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY((peerInfo)->peerMac)); - - - //pMac->hal.pCBackFnTxComp = NULL ; - - psessionEntry = peFindSessionBySessionId(pMac, (peerInfo)->tdls_sessionId); - - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsTeardownTxComplete: sessionID %d is not found"), (peerInfo)->tdls_sessionId); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - if(!txCompleteSuccess) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TX complete failure for Teardown ")) ; - - /* - * we should be sending Teradown to AP with status code - * eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE, we are not worried if - * that is delivered or not, any way we removing this peer STA from our - * list - */ - if(NULL != psessionEntry) - { - limSendTdlsTeardownFrame(pMac, (peerInfo)->peerMac, - eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE, psessionEntry, NULL, 0) ; - } - } - - if(TDLS_LINK_SETUP_WAIT_STATE != (peerInfo)->tdls_prev_link_state) - { - (peerInfo)->tdls_prev_link_state = (peerInfo)->tdls_link_state ; - (peerInfo)->tdls_link_state = TDLS_LINK_TEARDOWN_DONE_STATE ; - /* send del STA to remove context for this TDLS STA */ - if(NULL != psessionEntry) - { - /* tdls_hklee: send message to HAL before it is deleted */ - limTdlsLinkTeardown(pMac, (peerInfo)->peerMac) ; - - pStaDs = limTdlsDelSta(pMac, (peerInfo)->peerMac, psessionEntry) ; - } - - /* now send indication to SME-->HDD->TL to remove STA from TL */ - if(!pStaDs) - { - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - limSendSmeTdlsDelPeerInd(pMac, psessionEntry->smeSessionId, - pStaDs, eSIR_SUCCESS) ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TX complete SUCCESS for Teardown")) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Prev State = %d"), (peerInfo)->tdls_prev_link_state) ; - limSendSmeTdlsTeardownRsp(pMac, eSIR_SUCCESS, (peerInfo)->peerMac, - eWNI_SME_TDLS_TEARDOWN_RSP) ; - /* Delete Peer for Link Peer List */ - limTdlsDelLinkPeer(pMac, (peerInfo)->peerMac) ; - } - else - { - (peerInfo)->tdls_prev_link_state = (peerInfo)->tdls_link_state ; - (peerInfo)->tdls_link_state = TDLS_LINK_TEARDOWN_DONE_STATE ; - limSendSmeTdlsTeardownRsp(pMac, eSIR_SUCCESS, (peerInfo)->peerMac, - eWNI_SME_TDLS_TEARDOWN_IND) ; - } - - -#if 0 - /* if previous state is link restart, then restart link setup again */ - if(TDLS_LINK_SETUP_RESTART_STATE == (peerInfo)->tdls_prev_link_state) - { - tLimTdlsLinkSetupInfo *setupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - limTdlsPrepareSetupReqFrame(pMac, setupInfo, 37, - peerMac, psessionEntry) ; - } -#endif - status = eHAL_STATUS_SUCCESS ; - return status ; -} -#endif - /* * This static function is consistent with any kind of TDLS management * frames we are sending. Currently it is being used by limSendTdlsDisRspFrame, @@ -999,45 +765,42 @@ static void PopulateDot11fTdlsHtVhtCap(tpAniSirGlobal pMac, uint32 selfDot11Mode { /* Include HT Capability IE */ PopulateDot11fHTCaps( pMac, NULL, htCap ); + /* Advertize ht capability and max supported channel + * bandwidth when populating HT IE in TDLS Setup Request/ + * Setup Response/Setup Confirmation frames. + * 11.21.6.2 Setting up a 40 MHz direct link: A 40 MHz off-channel + * direct link may be started if both TDLS peer STAs indicated + * 40 MHz support in the Supported Channel Width Set field of the + * HT Capabilities element (which is included in the TDLS Setup Request + * frame and the TDLS Setup Response frame). Switching to a 40 MHz + * off-channel direct link is achieved by including the following + * information in the TDLS Channel Switch Request + * 11.21.1 General: The channel width of the TDLS direct link on the + * base channel shall not exceed the channel width of the BSS to which + * the TDLS peer STAs are associated.*/ htCap->present = 1; - if (psessionEntry->currentOperChannel <= SIR_11B_CHANNEL_END) - { - /* hardcode NO channel bonding in 2.4Ghz */ - htCap->supportedChannelWidthSet = 0; - } - else - { - //Placeholder to support different channel bonding mode of TDLS than AP. - //wlan_cfgGetInt(pMac,WNI_CFG_TDLS_CHANNEL_BONDING_MODE,&tdlsChannelBondingMode); - //htCap->supportedChannelWidthSet = tdlsChannelBondingMode ? 1 : 0; - htCap->supportedChannelWidthSet = 1; // hardcode it to max - } + htCap->supportedChannelWidthSet = 1; // hardcode it to max } else { htCap->present = 0; } + limLog(pMac, LOG1, FL("HT present = %hu, Chan Width = %hu"), + htCap->present, htCap->supportedChannelWidthSet); #ifdef WLAN_FEATURE_11AC - if (((psessionEntry->currentOperChannel <= SIR_11B_CHANNEL_END) && - pMac->roam.configParam.enableVhtFor24GHz) || - (psessionEntry->currentOperChannel >= SIR_11B_CHANNEL_END)) + if (IS_DOT11_MODE_VHT(selfDot11Mode) && + IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) { - if (IS_DOT11_MODE_VHT(selfDot11Mode) && - IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) - { - /* Include VHT Capability IE */ - PopulateDot11fVHTCaps( pMac, vhtCap, eSIR_FALSE ); - } - else - { - vhtCap->present = 0; - } + /* Include VHT Capability IE */ + PopulateDot11fVHTCaps( pMac, vhtCap, + psessionEntry->currentOperChannel, eSIR_FALSE ); } else { - /* Vht Disable from ini in 2.4 GHz */ vhtCap->present = 0; } + limLog(pMac, LOG1, FL("VHT present = %hu"), + vhtCap->present); #endif } @@ -1051,7 +814,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, tANI_U16 addIeLen) { tDot11fTDLSDisRsp tdlsDisRsp ; - tANI_U16 caps = 0 ; + tANI_U16 caps = 0 ; tANI_U32 status = 0 ; tANI_U32 nPayload = 0 ; tANI_U32 nBytes = 0 ; @@ -1065,7 +828,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, // As of now, we hardcoded to max channel bonding of dot11Mode (i.e HT80 for 11ac/HT40 for 11n) // uint32 tdlsChannelBondingMode; - /* + /* * The scheme here is to fill out a 'tDot11fProbeRequest' structure * and then hand it off to 'dot11fPackProbeRequest' (for * serialization). We start by zero-initializing the structure: @@ -1080,7 +843,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, tdlsDisRsp.Action.action = SIR_MAC_TDLS_DIS_RSP ; tdlsDisRsp.DialogToken.token = dialog ; - PopulateDot11fLinkIden( pMac, psessionEntry, &tdlsDisRsp.LinkIdentifier, + PopulateDot11fLinkIden( pMac, psessionEntry, &tdlsDisRsp.LinkIdentifier, peerMac, TDLS_RESPONDER) ; if (cfgGetCapabilityInfo(pMac, &caps, psessionEntry) != eSIR_SUCCESS) @@ -1089,20 +852,17 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGP, FL("could not retrieve Capabilities value")); } swapBitField16(caps, ( tANI_U16* )&tdlsDisRsp.Capabilities ); - /* populate supported rate IE */ - PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsDisRsp.SuppRates, psessionEntry ); - - /* Populate extended supported rates */ - PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsDisRsp.ExtSuppRates, psessionEntry ); + /* populate supported rate and ext supported rate IE */ + if (eSIR_FAILURE == PopulateDot11fRatesTdls(pMac, &tdlsDisRsp.SuppRates, + &tdlsDisRsp.ExtSuppRates, + psessionEntry->currentOperChannel)) + limLog(pMac, LOGE, FL("could not populate supported data rates")); - /* Populate extended supported rates */ + /* Populate extended capability IE */ PopulateDot11fTdlsExtCapability( pMac, &tdlsDisRsp.ExtCap ); wlan_cfgGetInt(pMac,WNI_CFG_DOT11_MODE,&selfDot11Mode); @@ -1116,11 +876,14 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, &tdlsDisRsp.SuppChannels, &tdlsDisRsp.SuppOperatingClasses); - if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && - ( pMac->roam.configParam.bandCapability != eCSR_BAND_24) ) + if (TRUE == pMac->lim.EnableTdls2040BSSCoexIE) { - tdlsDisRsp.HT2040BSSCoexistence.present = 1; - tdlsDisRsp.HT2040BSSCoexistence.infoRequest = 1; + if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && + ( pMac->roam.configParam.bandCapability != eCSR_BAND_24) ) + { + tdlsDisRsp.HT2040BSSCoexistence.present = 1; + tdlsDisRsp.HT2040BSSCoexistence.infoRequest = 1; + } } /* * now we pack it. First, how much space are we going to need? @@ -1128,16 +891,17 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, status = dot11fGetPackedTDLSDisRspSize( pMac, &tdlsDisRsp, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Discovery Response (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a Discovery Response (0x%08x)."), + status); } /* @@ -1156,8 +920,9 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Discovery Response."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1203,16 +968,18 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog( pMac, LOGE, + FL("Failed to pack a TDLS Discovery Response (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog( pMac, LOGW, + FL("There were warnings while packing TDLS Discovery Request (0x%08x)."), + status); } #if 0 @@ -1230,17 +997,15 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, #endif if (0 != addIeLen) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Copy Additional Ie Len = %d"), addIeLen )); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), addIeLen); vos_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload, addIe, addIeLen); } - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("transmitting Discovery response on direct link")) ; - - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -DIRECT-> OTA"), - SIR_MAC_TDLS_DIS_RSP, limTraceTdlsActionString(SIR_MAC_TDLS_DIS_RSP) )); - + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -DIRECT-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_DIS_RSP, + limTraceTdlsActionString(SIR_MAC_TDLS_DIS_RSP), + MAC_ADDR_ARRAY(peerMac)); /* * Transmit Discovery response and watch if this is delivered to @@ -1252,14 +1017,15 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, 0, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_SELF_STA_REQUESTED_MASK ); + HAL_USE_SELF_STA_REQUESTED_MASK, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Discovery Response frame!")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; @@ -1293,15 +1059,15 @@ static void PopulateDotfTdlsVhtAID(tpAniSirGlobal pMac, uint32 selfDot11Mode, else { Aid->present = 0; - limLog( pMac, LOGE, FL("pStaDs is NULL for " MAC_ADDRESS_STR ), - MAC_ADDR_ARRAY(peerMac)); + limLog(pMac, LOGE, FL("pStaDs is NULL for " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(peerMac)); } } } else { Aid->present = 0; - limLog( pMac, LOGW, FL("Vht not enable from ini for 2.4GHz.")); + limLog(pMac, LOGW, FL("Vht not enable from ini for 2.4GHz.")); } } @@ -1350,8 +1116,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); } pCapInfo = (tpSirMacCapabilityInfo) ∩︀ @@ -1360,21 +1125,38 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, swapBitField16(caps, ( tANI_U16* )&tdlsSetupReq.Capabilities ); - /* populate supported rate IE */ - PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsSetupReq.SuppRates, psessionEntry ); + limLog(pMac, LOG1, FL("Sending operating channel %d and dotl11mode %d\n"), + psessionEntry->currentOperChannel, + psessionEntry->dot11mode); - /* Populate extended supported rates */ - PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsSetupReq.ExtSuppRates, psessionEntry ); + /* populate supported rate and ext supported rate IE */ + PopulateDot11fRatesTdls(pMac, &tdlsSetupReq.SuppRates, + &tdlsSetupReq.ExtSuppRates, + psessionEntry->currentOperChannel); - /* Populate extended supported rates */ + /* Populate extended capability IE */ PopulateDot11fTdlsExtCapability( pMac, &tdlsSetupReq.ExtCap ); if ( 1 == pMac->lim.gLimTDLSWmmMode ) { + tANI_U32 val = 0; + /* include WMM IE */ - PopulateDot11fWMMInfoStation( pMac, &tdlsSetupReq.WMMInfoStation ); + tdlsSetupReq.WMMInfoStation.version = SIR_MAC_OUI_VERSION_1; + tdlsSetupReq.WMMInfoStation.acvo_uapsd = + (pMac->lim.gLimTDLSUapsdMask & 0x01); + tdlsSetupReq.WMMInfoStation.acvi_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x02) >> 1); + tdlsSetupReq.WMMInfoStation.acbk_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x04) >> 2); + tdlsSetupReq.WMMInfoStation.acbe_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x08) >> 3); + + if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) + limLog(pMac, LOGE, FL("could not retrieve Max SP Length")); + + tdlsSetupReq.WMMInfoStation.max_sp_length = (tANI_U8)val; + tdlsSetupReq.WMMInfoStation.present = 1; } else { @@ -1387,6 +1169,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, /* Populate QOS info, needed for Peer U-APSD session */ /* TODO: Now hardcoded, because PopulateDot11fQOSCapsStation() depends on AP's capability, and TDLS doesn't want to depend on AP's capability */ + limLog(pMac, LOG1, FL("populate QOS IE in Setup Request Frame")); tdlsSetupReq.QOSCapsStation.present = 1; tdlsSetupReq.QOSCapsStation.max_sp_length = 0; tdlsSetupReq.QOSCapsStation.qack = 0; @@ -1417,11 +1200,14 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, &tdlsSetupReq.SuppChannels, &tdlsSetupReq.SuppOperatingClasses); - if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && - ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + if (TRUE == pMac->lim.EnableTdls2040BSSCoexIE) { - tdlsSetupReq.HT2040BSSCoexistence.present = 1; - tdlsSetupReq.HT2040BSSCoexistence.infoRequest = 1; + if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && + ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + { + tdlsSetupReq.HT2040BSSCoexistence.present = 1; + tdlsSetupReq.HT2040BSSCoexistence.infoRequest = 1; + } } /* @@ -1431,16 +1217,17 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Setup Request (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a Setup Request (0x%08x)."), + status); } @@ -1464,8 +1251,9 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Request."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1480,7 +1268,9 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, /* fill out the buffer descriptor */ header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, - LINK_IDEN_ADDR_OFFSET(tdlsSetupReq), TDLS_LINK_AP, TDLS_INITIATOR, TID_AC_BK, psessionEntry) ; + LINK_IDEN_ADDR_OFFSET(tdlsSetupReq), + TDLS_LINK_AP, TDLS_INITIATOR, + TID_AC_VI, psessionEntry) ; #ifdef FEATURE_WLAN_TDLS_NEGATIVE if(pMac->lim.gLimTdlsNegativeBehavior & LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_SETUP_REQ) @@ -1492,25 +1282,29 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, MAC_ADDR_ARRAY(tdlsSetupReq.LinkIdentifier.bssid)); } #endif - limLog( pMac, LOGW, FL("%s: SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), - __func__, tdlsSetupReq.VHTCaps.supportedChannelWidthSet, tdlsSetupReq.VHTCaps.rxMCSMap, - tdlsSetupReq.VHTCaps.txMCSMap, tdlsSetupReq.VHTCaps.txSupDataRate ); + limLog( pMac, LOGW, FL("SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), + tdlsSetupReq.VHTCaps.supportedChannelWidthSet, + tdlsSetupReq.VHTCaps.rxMCSMap, + tdlsSetupReq.VHTCaps.txMCSMap, + tdlsSetupReq.VHTCaps.txSupDataRate); status = dot11fPackTDLSSetupReq( pMac, &tdlsSetupReq, pFrame + header_offset, nPayload, &nPayload ); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Setup Request (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Request (0x%08x)."), + status); } //Copy the additional IE. @@ -1519,29 +1313,32 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, //if there is any IOT issue. if( addIeLen != 0 ) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("Copy Additional Ie Len = %d"), - addIeLen )); - vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), + addIeLen); + vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_REQ, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_REQ) )); + limLog(pMac, LOG1, FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_REQ, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_REQ), + MAC_ADDR_ARRAY(peerMac)); halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, HAL_TXRX_FRM_802_11_DATA, ANI_TXDIR_TODS, - TID_AC_BK, + TID_AC_VI, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME ); + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Request frame!")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; @@ -1565,6 +1362,11 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, #ifndef NO_PAD_TDLS_MIN_8023_SIZE tANI_U32 padLen = 0; #endif + tpDphHashNode pStaDs = NULL; + tANI_U16 aid = 0; + tANI_U8 qosMode = 0; + tANI_U8 tdlsLinkType = 0; + /* * The scheme here is to fill out a 'tDot11fProbeRequest' structure * and then hand it off to 'dot11fPackProbeRequest' (for @@ -1577,35 +1379,40 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, PopulateDot11fLinkIden( pMac, psessionEntry, &teardown.LinkIdentifier, peerMac, (responder == TRUE) ? TDLS_RESPONDER : TDLS_INITIATOR) ; - - /* * now we pack it. First, how much space are we going to need? */ status = dot11fGetPackedTDLSTeardownSize( pMac, &teardown, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for Teardown frame (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Teardown frame (0x%08x)."), + status); } - - /* * This frame is going out from PE as data frames with special ethertype * 89-0d. * 8 bytes of RFC 1042 header */ - - - nBytes = nPayload + ((IS_QOS_ENABLED(psessionEntry)) + pStaDs = dphLookupHashEntry(pMac, peerMac, &aid, + &psessionEntry->dph.dphHashTable); + if (pStaDs) + { + qosMode = pStaDs->qosMode; + } + tdlsLinkType = (reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) + ? TDLS_LINK_AP : TDLS_LINK_DIRECT; + nBytes = nPayload + (((IS_QOS_ENABLED(psessionEntry) && + (tdlsLinkType == TDLS_LINK_AP)) || + ((tdlsLinkType == TDLS_LINK_DIRECT) && qosMode)) ? sizeof(tSirMacDataHdr3a) : sizeof(tSirMacMgmtHdr)) + sizeof( eth_890d_header ) + PAYLOAD_TYPE_TDLS_SIZE @@ -1635,8 +1442,9 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Teardown Frame."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1647,7 +1455,7 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, * IE formation, memory allocation is completed, Now form TDLS discovery * request frame */ - + limLog(pMac, LOGE, FL("Reason of TDLS Teardown: %d"), reason); /* fill out the buffer descriptor */ header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, @@ -1663,15 +1471,15 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { limLog( pMac, LOGE, FL("Failed to pack a TDLS Teardown req (0x%08x)."), - status ); + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Teardown Request (0x%08x)."), status ); + limLog(pMac, LOGW, FL("There were warnings while packing TDLS Teardown frame (0x%08x)."), + status); } #if 0 if(pMac->hal.pCBackFnTxComp == NULL) @@ -1693,9 +1501,8 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, if( addIeLen != 0 ) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("Copy Additional Ie Len = %d"), - addIeLen )); - vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), addIeLen); + vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } #ifndef NO_PAD_TDLS_MIN_8023_SIZE @@ -1710,8 +1517,7 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -1719,9 +1525,12 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, padLen - MIN_VENDOR_SPECIFIC_IE_SIZE, 0); } #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -%s-> OTA"), - SIR_MAC_TDLS_TEARDOWN, limTraceTdlsActionString(SIR_MAC_TDLS_TEARDOWN), - (reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) ? "AP": "DIRECT" )); + limLog(pMac, LOG1, FL("[TDLS] action %d (%s) -%s-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_TEARDOWN, + limTraceTdlsActionString(SIR_MAC_TDLS_TEARDOWN), + ((reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) ? + "AP": "DIRECT"), + MAC_ADDR_ARRAY(peerMac)); halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, HAL_TXRX_FRM_802_11_DATA, @@ -1729,15 +1538,16 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, TID_AC_VI, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME ); + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Teardown frame")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; } @@ -1745,13 +1555,13 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, /* * Send Setup RSP frame on AP link. */ -static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, - tSirMacAddr peerMac, tANI_U8 dialog, tpPESession psessionEntry, +static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, + tSirMacAddr peerMac, tANI_U8 dialog, tpPESession psessionEntry, etdlsLinkSetupStatus setupStatus, tANI_U8 *addIe, tANI_U16 addIeLen ) { tDot11fTDLSSetupRsp tdlsSetupRsp ; tANI_U32 status = 0 ; - tANI_U16 caps = 0 ; + tANI_U16 caps = 0 ; tANI_U32 nPayload = 0 ; tANI_U32 header_offset = 0 ; tANI_U32 nBytes = 0 ; @@ -1766,7 +1576,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, // As of now, we hardcoded to max channel bonding of dot11Mode (i.e HT80 for 11ac/HT40 for 11n) // uint32 tdlsChannelBondingMode; - /* + /* * The scheme here is to fill out a 'tDot11fProbeRequest' structure * and then hand it off to 'dot11fPackProbeRequest' (for * serialization). We start by zero-initializing the structure: @@ -1789,8 +1599,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); } pCapInfo = (tpSirMacCapabilityInfo) ∩︀ @@ -1799,21 +1608,34 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, swapBitField16(caps, ( tANI_U16* )&tdlsSetupRsp.Capabilities ); - /* ipopulate supported rate IE */ - PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsSetupRsp.SuppRates, psessionEntry ); - - /* Populate extended supported rates */ - PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &tdlsSetupRsp.ExtSuppRates, psessionEntry ); + /* populate supported rate and ext supported rate IE */ + PopulateDot11fRatesTdls(pMac, &tdlsSetupRsp.SuppRates, + &tdlsSetupRsp.ExtSuppRates, + psessionEntry->currentOperChannel); - /* Populate extended supported rates */ + /* Populate extended capability IE */ PopulateDot11fTdlsExtCapability( pMac, &tdlsSetupRsp.ExtCap ); if ( 1 == pMac->lim.gLimTDLSWmmMode ) { + tANI_U32 val = 0; + /* include WMM IE */ - PopulateDot11fWMMInfoStation( pMac, &tdlsSetupRsp.WMMInfoStation ); + tdlsSetupRsp.WMMInfoStation.version = SIR_MAC_OUI_VERSION_1; + tdlsSetupRsp.WMMInfoStation.acvo_uapsd = + (pMac->lim.gLimTDLSUapsdMask & 0x01); + tdlsSetupRsp.WMMInfoStation.acvi_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x02) >> 1); + tdlsSetupRsp.WMMInfoStation.acbk_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x04) >> 2); + tdlsSetupRsp.WMMInfoStation.acbe_uapsd = + ((pMac->lim.gLimTDLSUapsdMask & 0x08) >> 3); + + if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) + limLog(pMac, LOGE, FL("could not retrieve Max SP Length")); + + tdlsSetupRsp.WMMInfoStation.max_sp_length = (tANI_U8)val; + tdlsSetupRsp.WMMInfoStation.present = 1; } else { @@ -1826,6 +1648,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, /* Populate QOS info, needed for Peer U-APSD session */ /* TODO: Now hardcoded, because PopulateDot11fQOSCapsStation() depends on AP's capability, and TDLS doesn't want to depend on AP's capability */ + limLog(pMac, LOG1, FL("populate QOS IE in Setup Response frame")); tdlsSetupRsp.QOSCapsStation.present = 1; tdlsSetupRsp.QOSCapsStation.max_sp_length = 0; tdlsSetupRsp.QOSCapsStation.qack = 0; @@ -1852,11 +1675,14 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, tdlsSetupRsp.Status.status = setupStatus ; - if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && - ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + if (TRUE == pMac->lim.EnableTdls2040BSSCoexIE) { - tdlsSetupRsp.HT2040BSSCoexistence.present = 1; - tdlsSetupRsp.HT2040BSSCoexistence.infoRequest = 1; + if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && + ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + { + tdlsSetupRsp.HT2040BSSCoexistence.present = 1; + tdlsSetupRsp.HT2040BSSCoexistence.infoRequest = 1; + } } /* * now we pack it. First, how much space are we going to need? @@ -1865,16 +1691,17 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Setup Response (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Setup Response (0x%08x)."), + status); } /* @@ -1897,8 +1724,9 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Response."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1915,7 +1743,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, LINK_IDEN_ADDR_OFFSET(tdlsSetupRsp), TDLS_LINK_AP, TDLS_RESPONDER, - TID_AC_BK, psessionEntry) ; + TID_AC_VI, psessionEntry) ; #ifdef FEATURE_WLAN_TDLS_NEGATIVE if(pMac->lim.gLimTdlsNegativeBehavior & LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_SETUP_RSP) @@ -1927,24 +1755,28 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, MAC_ADDR_ARRAY(tdlsSetupRsp.LinkIdentifier.bssid)); } #endif - limLog( pMac, LOGW, FL("%s: SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), - __func__, tdlsSetupRsp.VHTCaps.supportedChannelWidthSet, tdlsSetupRsp.VHTCaps.rxMCSMap, - tdlsSetupRsp.VHTCaps.txMCSMap, tdlsSetupRsp.VHTCaps.txSupDataRate ); + limLog(pMac, LOG1, + FL("SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), + tdlsSetupRsp.VHTCaps.supportedChannelWidthSet, + tdlsSetupRsp.VHTCaps.rxMCSMap, + tdlsSetupRsp.VHTCaps.txMCSMap, + tdlsSetupRsp.VHTCaps.txSupDataRate); status = dot11fPackTDLSSetupRsp( pMac, &tdlsSetupRsp, pFrame + header_offset, nPayload, &nPayload ); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, FL("Failed to pack a TDLS Setup Response (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Response (0x%08x)."), + status); } //Copy the additional IE. @@ -1956,24 +1788,28 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_RSP, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_RSP) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_RSP, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_RSP), + MAC_ADDR_ARRAY(peerMac)); halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, HAL_TXRX_FRM_802_11_DATA, ANI_TXDIR_TODS, //ANI_TXDIR_IBSS, - TID_AC_BK, + TID_AC_VI, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME ); + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Response")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; @@ -2012,13 +1848,8 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer tdlsSetupCnf.Action.action = SIR_MAC_TDLS_SETUP_CNF ; tdlsSetupCnf.DialogToken.token = dialog ; -#if 1 PopulateDot11fLinkIden( pMac, psessionEntry, &tdlsSetupCnf.LinkIdentifier, peerMac, TDLS_INITIATOR) ; -#else - vos_mem_copy( (tANI_U8 *)&tdlsSetupCnf.LinkIdentifier, - (tANI_U8 *)&setupRsp->LinkIdentifier, sizeof(tDot11fIELinkIdentifier)) ; -#endif /* * TODO: we need to see if we have to support conditions where we have @@ -2030,13 +1861,15 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer /* Check self and peer WMM capable */ if ((1 == pMac->lim.gLimTDLSWmmMode) && (CHECK_BIT(peerCapability, TDLS_PEER_WMM_CAP))) { + limLog(pMac, LOG1, FL("populate WMM praram in Setup Confirm")); PopulateDot11fWMMParams(pMac, &tdlsSetupCnf.WMMParams, psessionEntry); } /* Check peer is VHT capable*/ if (CHECK_BIT(peerCapability, TDLS_PEER_VHT_CAP)) { - PopulateDot11fVHTOperation( pMac, &tdlsSetupCnf.VHTOperation); + PopulateDot11fVHTOperation( pMac, &tdlsSetupCnf.VHTOperation, + psessionEntry->currentOperChannel); PopulateDot11fHTInfo( pMac, &tdlsSetupCnf.HTInfo, psessionEntry ); } else if (CHECK_BIT(peerCapability, TDLS_PEER_HT_CAP)) /* Check peer is HT capable */ @@ -2044,11 +1877,14 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer PopulateDot11fHTInfo( pMac, &tdlsSetupCnf.HTInfo, psessionEntry ); } - if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && - ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + if (TRUE == pMac->lim.EnableTdls2040BSSCoexIE) { - tdlsSetupCnf.HT2040BSSCoexistence.present = 1; - tdlsSetupCnf.HT2040BSSCoexistence.infoRequest = 1; + if ( 1 == pMac->lim.gLimTDLSOffChannelEnabled && + ( pMac->roam.configParam.bandCapability != eCSR_BAND_24)) + { + tdlsSetupCnf.HT2040BSSCoexistence.present = 1; + tdlsSetupCnf.HT2040BSSCoexistence.infoRequest = 1; + } } /* @@ -2058,16 +1894,17 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for Setup Confirm (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Setup Confirm (0x%08x)."), + status); } /* @@ -2108,8 +1945,9 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Confirm."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -2139,16 +1977,18 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Setup Confirm (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Confirm (0x%08x)."), + status); } #if 0 if(pMac->hal.pCBackFnTxComp == NULL) @@ -2188,8 +2028,7 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -2199,8 +2038,11 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_CNF, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_CNF) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_CNF, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_CNF), + MAC_ADDR_ARRAY(peerMac)); halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, HAL_TXRX_FRM_802_11_DATA, @@ -2208,238 +2050,66 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, tSirMacAddr peer TID_AC_VI, limTxComplete, pFrame, limMgmtTXComplete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME ); + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + pMac->lim.txBdToken++); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Confirm frame")); return eSIR_FAILURE; } - pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; + pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId; return eSIR_SUCCESS; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Convert HT caps to lim based HT caps - */ -static void limTdlsCovertHTCaps(tpAniSirGlobal pMac, - tSirTdlsPeerInfo *peerInfo, tDot11fIEHTCaps *HTCaps) -{ - - /* HT Capability Info */ - peerInfo->tdlsPeerHtCaps.advCodingCap = HTCaps->advCodingCap ; - peerInfo->tdlsPeerHtCaps.supportedChannelWidthSet = - HTCaps->supportedChannelWidthSet ; - peerInfo->tdlsPeerHtCaps.mimoPowerSave = HTCaps->mimoPowerSave ; - peerInfo->tdlsPeerHtCaps.greenField = HTCaps->greenField ; - peerInfo->tdlsPeerHtCaps.shortGI20MHz = HTCaps->shortGI20MHz ; - peerInfo->tdlsPeerHtCaps.shortGI40MHz = HTCaps->shortGI40MHz ; - peerInfo->tdlsPeerHtCaps.txSTBC = HTCaps->txSTBC ; - peerInfo->tdlsPeerHtCaps.rxSTBC = HTCaps->rxSTBC ; - peerInfo->tdlsPeerHtCaps.delayedBA = HTCaps->delayedBA; - peerInfo->tdlsPeerHtCaps.maximalAMSDUsize = HTCaps->maximalAMSDUsize ; - peerInfo->tdlsPeerHtCaps.dsssCckMode40MHz = HTCaps->dsssCckMode40MHz ; - peerInfo->tdlsPeerHtCaps.psmp = HTCaps->stbcControlFrame ; - peerInfo->tdlsPeerHtCaps.stbcControlFrame = HTCaps->stbcControlFrame ; - peerInfo->tdlsPeerHtCaps.lsigTXOPProtection = - HTCaps->lsigTXOPProtection ; - - /* HT Capa parameters */ - peerInfo->tdlsPeerHtParams.maxRxAMPDUFactor = HTCaps->maxRxAMPDUFactor ; - peerInfo->tdlsPeerHtParams.mpduDensity = HTCaps->mpduDensity ; - peerInfo->tdlsPeerHtParams.reserved = HTCaps->reserved1 ; - - /* Extended HT caps */ - peerInfo->tdlsPeerHtExtCaps.pco = HTCaps->pco ; - peerInfo->tdlsPeerHtExtCaps.transitionTime = HTCaps->transitionTime ; - peerInfo->tdlsPeerHtExtCaps.mcsFeedback = HTCaps->mcsFeedback ; - vos_mem_copy( peerInfo->supportedMCSSet, - HTCaps->supportedMCSSet, SIZE_OF_SUPPORTED_MCS_SET) ; - - return ; -} - -/* - * update capability info.. +/* This Function is similar to PopulateDot11fHTCaps, except that the HT Capabilities + * are considered from the AddStaReq rather from the cfg.dat as in PopulateDot11fHTCaps */ -void tdlsUpdateCapInfo(tSirMacCapabilityInfo *capabilityInfo, - tDot11fFfCapabilities *Capabilities) +static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESession psessionEntry, + tSirTdlsAddStaReq *pTdlsAddStaReq, tDot11fIEHTCaps *pDot11f) { + tANI_U32 nCfgValue; + tANI_U8 nCfgValue8; + tSirMacHTParametersInfo *pHTParametersInfo; + union { + tANI_U16 nCfgValue16; + tSirMacHTCapabilityInfo htCapInfo; + tSirMacExtendedHTCapabilityInfo extHtCapInfo; + } uHTCapabilityInfo; - capabilityInfo->ess = Capabilities->ess; - capabilityInfo->ibss = Capabilities->ibss; - capabilityInfo->cfPollable = Capabilities->cfPollable; - capabilityInfo->cfPollReq = Capabilities->cfPollReq; - capabilityInfo->privacy = Capabilities->privacy; - capabilityInfo->shortPreamble = Capabilities->shortPreamble; - capabilityInfo->pbcc = Capabilities->pbcc; - capabilityInfo->channelAgility = Capabilities->channelAgility; - capabilityInfo->spectrumMgt = Capabilities->spectrumMgt; - capabilityInfo->qos = Capabilities->qos; - capabilityInfo->shortSlotTime = Capabilities->shortSlotTime; - capabilityInfo->apsd = Capabilities->apsd; - capabilityInfo->rrm = Capabilities->rrm; - capabilityInfo->dsssOfdm = Capabilities->dsssOfdm; - capabilityInfo->immediateBA = Capabilities->immediateBA; - - return ; -} + tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; + tSirMacASCapabilityInfo *pASCapabilityInfo; -/* - * update Peer info from the link request frame recieved from Peer.. - * in list of STA participating in TDLS link setup - */ -void limTdlsUpdateLinkReqPeerInfo(tpAniSirGlobal pMac, - tLimTdlsLinkSetupPeer *setupPeer, - tDot11fTDLSSetupReq *setupReq) -{ + nCfgValue = pTdlsAddStaReq->htCap.capInfo; - /* Populate peer info of tdls discovery result */ + uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; - tdlsUpdateCapInfo(&setupPeer->capabilityInfo, &setupReq->Capabilities) ; + pDot11f->advCodingCap = uHTCapabilityInfo.htCapInfo.advCodingCap; + pDot11f->mimoPowerSave = uHTCapabilityInfo.htCapInfo.mimoPowerSave; + pDot11f->greenField = uHTCapabilityInfo.htCapInfo.greenField; + pDot11f->shortGI20MHz = uHTCapabilityInfo.htCapInfo.shortGI20MHz; + pDot11f->shortGI40MHz = uHTCapabilityInfo.htCapInfo.shortGI40MHz; + pDot11f->txSTBC = uHTCapabilityInfo.htCapInfo.txSTBC; + pDot11f->rxSTBC = uHTCapabilityInfo.htCapInfo.rxSTBC; + pDot11f->delayedBA = uHTCapabilityInfo.htCapInfo.delayedBA; + pDot11f->maximalAMSDUsize = uHTCapabilityInfo.htCapInfo.maximalAMSDUsize; + pDot11f->dsssCckMode40MHz = uHTCapabilityInfo.htCapInfo.dsssCckMode40MHz; + pDot11f->psmp = uHTCapabilityInfo.htCapInfo.psmp; + pDot11f->stbcControlFrame = uHTCapabilityInfo.htCapInfo.stbcControlFrame; + pDot11f->lsigTXOPProtection = uHTCapabilityInfo.htCapInfo.lsigTXOPProtection; - if(setupReq->SuppRates.present) + // All sessionized entries will need the check below + if (psessionEntry == NULL) // Only in case of NO session { - ConvertSuppRates( pMac, &setupPeer->supportedRates, - &setupReq->SuppRates ); + pDot11f->supportedChannelWidthSet = uHTCapabilityInfo.htCapInfo.supportedChannelWidthSet; } - - /* update QOS info, needed for Peer U-APSD session */ - if(setupReq->QOSCapsStation.present) + else { - ConvertQOSCapsStation(pMac->hHdd, &setupPeer->qosCaps, - &setupReq->QOSCapsStation) ; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,("setupReq->SPLen=%d (be %d %d %d %d vo) more %d qack %d."), - setupReq->QOSCapsStation.max_sp_length, setupReq->QOSCapsStation.acbe_uapsd, - setupReq->QOSCapsStation.acbk_uapsd, setupReq->QOSCapsStation.acvi_uapsd, - setupReq->QOSCapsStation.acvo_uapsd, setupReq->QOSCapsStation.more_data_ack, - setupReq->QOSCapsStation.qack)); - } - - if (setupReq->ExtSuppRates.present) - { - setupPeer->ExtRatesPresent = 1; - ConvertExtSuppRates( pMac, &setupPeer->extendedRates, - &setupReq->ExtSuppRates ); - } - /* update HT caps */ - if (setupReq->HTCaps.present) - { - vos_mem_copy( &setupPeer->tdlsPeerHTCaps, - &setupReq->HTCaps, sizeof(tDot11fIEHTCaps)) ; - } - /* Update EXT caps */ - if (setupReq->ExtCap.present) - { - vos_mem_copy( &setupPeer->tdlsPeerExtCaps, - &setupReq->ExtCap, sizeof(tDot11fIEExtCap)) ; - } - - return ; -} - -/* - * update peer Info recieved with TDLS setup RSP - */ -void limTdlsUpdateLinkRspPeerInfo(tpAniSirGlobal pMac, - tLimTdlsLinkSetupPeer *setupPeer, - tDot11fTDLSSetupRsp *setupRsp) -{ - - /* Populate peer info of tdls discovery result */ - tdlsUpdateCapInfo(&setupPeer->capabilityInfo, &setupRsp->Capabilities) ; - - if(setupRsp->SuppRates.present) - { - tDot11fIESuppRates *suppRates = &setupRsp->SuppRates ; - ConvertSuppRates( pMac, &setupPeer->supportedRates, suppRates); - } - - /* update QOS info, needed for Peer U-APSD session */ - if(setupRsp->QOSCapsStation.present) - { - ConvertQOSCapsStation(pMac->hHdd, &setupPeer->qosCaps, - &setupRsp->QOSCapsStation) ; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("setupRsp->SPLen=%d (be %d %d %d %d vo) more %d qack %d."), - setupRsp->QOSCapsStation.max_sp_length, setupRsp->QOSCapsStation.acbe_uapsd, - setupRsp->QOSCapsStation.acbk_uapsd, setupRsp->QOSCapsStation.acvi_uapsd, - setupRsp->QOSCapsStation.acvo_uapsd, setupRsp->QOSCapsStation.more_data_ack, - setupRsp->QOSCapsStation.qack)); - } - - if(setupRsp->ExtSuppRates.present) - { - setupPeer->ExtRatesPresent = 1; - ConvertExtSuppRates( pMac, &setupPeer->extendedRates, - &setupRsp->ExtSuppRates ); - } - /* update HT caps */ - if (setupRsp->HTCaps.present) - { - vos_mem_copy(&setupPeer->tdlsPeerHTCaps, - &setupRsp->HTCaps, sizeof(tDot11fIEHTCaps)) ; - } - - /* update EXT caps */ - if (setupRsp->ExtCap.present) - { - vos_mem_copy( &setupPeer->tdlsPeerExtCaps, - &setupRsp->ExtCap, sizeof(tDot11fIEExtCap)) ; - } - - return ; -} -#endif - -/* This Function is similar to PopulateDot11fHTCaps, except that the HT Capabilities - * are considered from the AddStaReq rather from the cfg.dat as in PopulateDot11fHTCaps - */ -static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESession psessionEntry, - tSirTdlsAddStaReq *pTdlsAddStaReq, tDot11fIEHTCaps *pDot11f) -{ - tANI_U32 nCfgValue; - tANI_U8 nCfgValue8; - tSirMacHTParametersInfo *pHTParametersInfo; - union { - tANI_U16 nCfgValue16; - tSirMacHTCapabilityInfo htCapInfo; - tSirMacExtendedHTCapabilityInfo extHtCapInfo; - } uHTCapabilityInfo; - - tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; - tSirMacASCapabilityInfo *pASCapabilityInfo; - - nCfgValue = pTdlsAddStaReq->htCap.capInfo; - - uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; - - pDot11f->advCodingCap = uHTCapabilityInfo.htCapInfo.advCodingCap; - pDot11f->mimoPowerSave = uHTCapabilityInfo.htCapInfo.mimoPowerSave; - pDot11f->greenField = uHTCapabilityInfo.htCapInfo.greenField; - pDot11f->shortGI20MHz = uHTCapabilityInfo.htCapInfo.shortGI20MHz; - pDot11f->shortGI40MHz = uHTCapabilityInfo.htCapInfo.shortGI40MHz; - pDot11f->txSTBC = uHTCapabilityInfo.htCapInfo.txSTBC; - pDot11f->rxSTBC = uHTCapabilityInfo.htCapInfo.rxSTBC; - pDot11f->delayedBA = uHTCapabilityInfo.htCapInfo.delayedBA; - pDot11f->maximalAMSDUsize = uHTCapabilityInfo.htCapInfo.maximalAMSDUsize; - pDot11f->dsssCckMode40MHz = uHTCapabilityInfo.htCapInfo.dsssCckMode40MHz; - pDot11f->psmp = uHTCapabilityInfo.htCapInfo.psmp; - pDot11f->stbcControlFrame = uHTCapabilityInfo.htCapInfo.stbcControlFrame; - pDot11f->lsigTXOPProtection = uHTCapabilityInfo.htCapInfo.lsigTXOPProtection; - - // All sessionized entries will need the check below - if (psessionEntry == NULL) // Only in case of NO session - { - pDot11f->supportedChannelWidthSet = uHTCapabilityInfo.htCapInfo.supportedChannelWidthSet; - } - else - { - pDot11f->supportedChannelWidthSet = psessionEntry->htSupportedChannelWidthSet; + pDot11f->supportedChannelWidthSet = psessionEntry->htSupportedChannelWidthSet; } /* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is @@ -2449,9 +2119,14 @@ static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESessio pDot11f->shortGI40MHz = 0; } - dot11fLog(pMac, LOG2, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d"), - pDot11f->supportedChannelWidthSet, pDot11f->mimoPowerSave, pDot11f->greenField, - pDot11f->shortGI20MHz, pDot11f->shortGI40MHz, pDot11f->dsssCckMode40MHz); + limLog(pMac, LOG1, + FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d"), + pDot11f->supportedChannelWidthSet, + pDot11f->mimoPowerSave, + pDot11f->greenField, + pDot11f->shortGI20MHz, + pDot11f->shortGI40MHz, + pDot11f->dsssCckMode40MHz); nCfgValue = pTdlsAddStaReq->htCap.ampduParamsInfo; @@ -2462,7 +2137,7 @@ static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESessio pDot11f->mpduDensity = pHTParametersInfo->mpduDensity; pDot11f->reserved1 = pHTParametersInfo->reserved; - dot11fLog( pMac, LOG2, FL( "AMPDU Param: %x" ), nCfgValue); + limLog(pMac, LOG1, FL("AMPDU Param: %x"), nCfgValue); vos_mem_copy( pDot11f->supportedMCSSet, pTdlsAddStaReq->htCap.suppMcsSet, SIZE_OF_SUPPORTED_MCS_SET); @@ -2604,7 +2279,7 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, &val) != eSIR_SUCCESS) { /// Could not get rateset from CFG. Log error. - limLog(pMac, LOGP, FL("could not retrieve rateset")); + limLog(pMac, LOGE, FL("could not retrieve rateset")); val = 0; } tempRateSet.numRates = val; @@ -2622,7 +2297,7 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, if ((tempRateSet.numRates + tempRateSet2.numRates) > 12) { - PELOGE(limLog(pMac, LOGE, FL("more than 12 rates in CFG"));) + limLog(pMac, LOGE, FL("more than 12 rates in CFG")); goto error; } @@ -2667,9 +2342,9 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, */ if (supporteRatesLength > SIR_MAC_RATESET_EID_MAX) { - limLog( pMac, LOGW, FL("Supported rates length %d more than " - "the Max limit, reset to Max"), - supporteRatesLength); + limLog(pMac, LOGW, + FL("Supported rates length %d more than the Max limit, reset to Max"), + supporteRatesLength); supporteRatesLength = SIR_MAC_RATESET_EID_MAX; } for (i = 0; i < supporteRatesLength; i++) @@ -2689,23 +2364,21 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, for (j = 0;j < tempRateSet.numRates; j++) { if ((tempRateSet2.rate[i] & 0x7F) == - (tempRateSet.rate[j] & 0x7F)) + (tempRateSet.rate[j] & 0x7F)) { -#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC - if ((bRateIndex > HAL_NUM_11B_RATES) || (aRateIndex > HAL_NUM_11A_RATES)) - { - limLog(pMac, LOGE, FL("Invalid number of rates (11b->%d, 11a->%d)"), - bRateIndex, aRateIndex); - return eSIR_FAILURE; - } -#endif if (sirIsArate(tempRateSet2.rate[i] & 0x7f)) { isArate=1; - rates->llaRates[aRateIndex++] = tempRateSet2.rate[i]; + if (aRateIndex < SIR_NUM_11A_RATES) + rates->llaRates[aRateIndex++] = + tempRateSet2.rate[i]; } else - rates->llbRates[bRateIndex++] = tempRateSet2.rate[i]; + { + if (bRateIndex < SIR_NUM_11B_RATES) + rates->llbRates[bRateIndex++] = + tempRateSet2.rate[i]; + } break; } } @@ -2734,10 +2407,12 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, for (i=0; isupportedRates.supportedMCSSet[i] = mcsSet[i] & pSupportedMCSSet[i]; - PELOG2(limLog(pMac, LOG2, FL("limPopulateMatchingRateSet: MCS Rate Set Bitmap from CFG and DPH :"));) + limLog(pMac, LOG1, FL("MCS Rate Set Bitmap from CFG and DPH:")); for (i=0; isupportedRates.supportedMCSSet[i]);) + limLog(pMac, LOG1, FL("%x %x"), + mcsSet[i], + pStaDs->supportedRates.supportedMCSSet[i]); } } @@ -2844,7 +2519,25 @@ static void limTdlsUpdateHashNodeInfo(tpAniSirGlobal pMac, tDphHashNode *pStaDs, { pStaDs->mlmStaContext.htCapability = 1 ; pStaDs->htGreenfield = htCaps->greenField ; - pStaDs->htSupportedChannelWidthSet = htCaps->supportedChannelWidthSet ; + /* pStaDs->htSupportedChannelWidthSet should have the base channel + * capability. The htSupportedChannelWidthSet of the TDLS link on + * base channel should be less than or equal to channel width of + * STA-AP link. So take this setting from the psessionEntry. + */ + limLog(pMac, LOG1, + FL("supportedChannelWidthSet %x htSupportedChannelWidthSet %x"), + htCaps->supportedChannelWidthSet, + psessionEntry->htSupportedChannelWidthSet); + + pStaDs->htSupportedChannelWidthSet = + (htCaps->supportedChannelWidthSet < + psessionEntry->htSupportedChannelWidthSet) ? + htCaps->supportedChannelWidthSet : + psessionEntry->htSupportedChannelWidthSet; + + limLog(pMac, LOG1, FL("pStaDs->htSupportedChannelWidthSet %x"), + pStaDs->htSupportedChannelWidthSet); + pStaDs->htMIMOPSState = htCaps->mimoPowerSave ; pStaDs->htMaxAmsduLength = htCaps->maximalAMSDUsize; pStaDs->htAMpduDensity = htCaps->mpduDensity; @@ -2870,17 +2563,11 @@ static void limTdlsUpdateHashNodeInfo(tpAniSirGlobal pMac, tDphHashNode *pStaDs, { pStaDs->mlmStaContext.vhtCapability = 1 ; - if ((psessionEntry->currentOperChannel <= SIR_11B_CHANNEL_END) && - pMac->roam.configParam.enableVhtFor24GHz) - { - pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; - } - else - { - pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; - pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ ; - } + pStaDs->vhtSupportedChannelWidthSet = + psessionEntry->vhtTxChannelWidthSet; + + limLog(pMac, LOG1, FL("Vht supported channel width is set to = %d"), + pStaDs->vhtSupportedChannelWidthSet); pStaDs->vhtLdpcCapable = pVhtCaps->ldpcCodingCap; pStaDs->vhtBeamFormerCapable= pVhtCaps->suBeamFormerCap; @@ -2904,2013 +2591,127 @@ static void limTdlsUpdateHashNodeInfo(tpAniSirGlobal pMac, tDphHashNode *pStaDs, pStaDs->htSecondaryChannelOffset = limGetHTCBState(cbMode); } #endif - + pSessStaDs = dphLookupHashEntry(pMac, psessionEntry->bssId, &aid, &psessionEntry->dph.dphHashTable) ; /* Lets enable QOS parameter */ - pStaDs->qosMode = 1; + pStaDs->qosMode = (pTdlsAddStaReq->capability & CAPABILITIES_QOS_OFFSET) || + pTdlsAddStaReq->htcap_present; pStaDs->wmeEnabled = 1; pStaDs->lleEnabled = 0; - /* TDLS Dummy AddSTA does not have qosInfo , is it OK ?? - */ - pStaDs->qos.capability.qosInfo = (*(tSirMacQosInfoStation *) &pTdlsAddStaReq->uapsd_queues); - - /* populate matching rate set */ - - /* TDLS Dummy AddSTA does not have HTCap,VHTCap,Rates info , is it OK ?? - */ - limTdlsPopulateMatchingRateSet(pMac, pStaDs, pTdlsAddStaReq->supported_rates, - pTdlsAddStaReq->supported_rates_length, - (tANI_U8 *)pTdlsAddStaReq->htCap.suppMcsSet, - &pStaDs->mlmStaContext.propRateSet, - psessionEntry, pVhtCaps); - - /* TDLS Dummy AddSTA does not have right capability , is it OK ?? - */ - pStaDs->mlmStaContext.capabilityInfo = ( *(tSirMacCapabilityInfo *) &pTdlsAddStaReq->capability); - - return ; -} - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * find Peer in setup link list. - */ - -tANI_U8 limTdlsFindLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac, - tLimTdlsLinkSetupPeer **setupPeer) -{ - tLimTdlsLinkSetupInfo *setupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - tLimTdlsLinkSetupPeer *linkSetupList = setupInfo->tdlsLinkSetupList ; - tANI_U8 checkNode = TDLS_NODE_NOT_FOUND ; - - while (linkSetupList != NULL) - { - if (vos_mem_compare((tANI_U8 *) peerMac, - (tANI_U8 *) linkSetupList->peerMac, - sizeof(tSirMacAddr)) ) - { - checkNode = TDLS_NODE_FOUND ; - *setupPeer = linkSetupList ; - break ; - } - linkSetupList = linkSetupList->next; - } - - return ((TDLS_NODE_FOUND == checkNode) ? eSIR_SUCCESS : eSIR_FAILURE ) ; -} - -/* - * find peer in Discovery list. - * Dicovery list get populated in two instances, a) Recieved responses in reply - * to discovery request b) If discover request is received from TDLS peer STA - */ -tSirTdlsPeerInfo *limTdlsFindDisPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac) -{ - tLimDisResultList *discoveryList = pMac->lim.gLimTdlsDisResultList ; - tSirTdlsPeerInfo *peerInfo = NULL ; - - while (discoveryList != NULL) - { - peerInfo = &discoveryList->tdlsDisPeerInfo ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Peer in discovery list = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerInfo->peerMac)); - - if (vos_mem_compare((tANI_U8 *) peerMac, - (tANI_U8 *) &peerInfo->peerMac, sizeof(tSirMacAddr)) ) - { - break ; - } - discoveryList = discoveryList->next; - } - - return peerInfo ; -} - -/* - * find peer in Discovery list by looking into peer state. - * Dicovery list get populated in two instances, a) Recieved responses in reply - * to discovery request b) If discover request is received from TDLS peer STA - */ -static tSirTdlsPeerInfo *limTdlsFindDisPeerByState(tpAniSirGlobal pMac, - tANI_U8 state) -{ - tLimDisResultList *discoveryList = pMac->lim.gLimTdlsDisResultList ; - tSirTdlsPeerInfo *peerInfo = NULL ; - - while (discoveryList != NULL) - { - peerInfo = &discoveryList->tdlsDisPeerInfo ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peerInfo Mac = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerInfo->peerMac)); - - if (peerInfo->tdlsPeerState == state) - { - break ; - } - discoveryList = discoveryList->next; - } - - return peerInfo ; -} - -/* - * find peer in Setup list by looking into peer state. - * setup list get populated in two instances, a) Recieved responses in reply - * to setup request b) If discover request is received from TDLS peer STA - */ -static tANI_U8 limTdlsFindSetupPeerByState(tpAniSirGlobal pMac, tANI_U8 state, - tLimTdlsLinkSetupPeer **setupPeer) -{ - - tLimTdlsLinkSetupInfo *setupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - tLimTdlsLinkSetupPeer *linkSetupList = setupInfo->tdlsLinkSetupList ; - tANI_U8 checkNode = TDLS_NODE_NOT_FOUND ; - - while (linkSetupList != NULL) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peer state = %02x"), (linkSetupList)->tdls_link_state) ; - if((linkSetupList)->tdls_link_state == state) - { - checkNode = TDLS_NODE_FOUND ; - *setupPeer = linkSetupList ; - break ; - } - linkSetupList = (linkSetupList)->next; - } - - return ((TDLS_NODE_FOUND == checkNode) ? eSIR_SUCCESS: eSIR_FAILURE) ; -} - - -/* - * delete Peer from Setup Link - */ -void limTdlsDelLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac) -{ - tLimTdlsLinkSetupInfo *setupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - tLimTdlsLinkSetupPeer **linkSetupList = &setupInfo->tdlsLinkSetupList ; - tLimTdlsLinkSetupPeer *currentNode = NULL ; - tLimTdlsLinkSetupPeer *prevNode = NULL ; - - for(currentNode = *linkSetupList ; currentNode != NULL ; - prevNode = currentNode, currentNode = currentNode->next) - { - if (vos_mem_compare( (tANI_U8 *) peerMac, - (tANI_U8 *) currentNode->peerMac, - sizeof(tSirMacAddr)) ) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Del Node for Peer = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(currentNode->peerMac)); - /* if it's first Node */ - if(NULL == prevNode) - { - *linkSetupList = currentNode->next ; - } - else - { - prevNode->next = currentNode->next ; - } - vos_mem_free(currentNode) ; - return ; - } - } - - return ; -} - - - -/* - * TDLS discovery request frame received from TDLS peer STA.. - */ -static tSirRetStatus limProcessTdlsDisReqFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen ) -{ - tDot11fTDLSDisReq tdlsDisReq = {{0}} ; - tANI_U32 status = 0 ; - tLimDisResultList *tdlsDisResult = NULL ; - tLimDisResultList **disResultList = &pMac->lim.gLimTdlsDisResultList ; - tSirMacAddr peerMac = {0} ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tSirTdlsPeerInfo *peerInfo = NULL ; - tpPESession psessionEntry = NULL ; - tANI_U8 sessionId = 0 ; - - status = dot11fUnpackTDLSDisReq(pMac, pBody, frmLen, &tdlsDisReq) ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN, - ("TDLS dis request dialog = %d"), tdlsDisReq.DialogToken.token); - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse TDLS discovery Request " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "discovery Request frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - } - - /* - * find session entry using BSSID in link identifier, not using MAC - * header beacuse, there is cases in TDLS, there may be BSSID will not - * be present in header - */ - psessionEntry = peFindSessionByBssid(pMac, - &tdlsDisReq.LinkIdentifier.bssid[0], &sessionId) ; - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no Session entry for TDLS session (bssid "MAC_ADDR_ARRAY")"), - MAC_ADDR_ARRAY(tdlsDisReq.LinkIdentifier.bssid)); - - //VOS_ASSERT(0) ; - return eSIR_FAILURE; - } - - /* varify BSSID */ - status = vos_mem_compare( &psessionEntry->bssId[0], - &tdlsDisReq.LinkIdentifier.bssid[0], sizeof(tSirMacAddr)) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("lim BSSID "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY( psessionEntry->bssId)); - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Dis req from BSSID "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(tdlsDisReq.LinkIdentifier.bssid)); - if(!status) - { - limLog( pMac, LOGE, FL("TDLS discovery request frame from other BSS -> something wrong. Check RXP filter")) ; - - return eSIR_FAILURE ; - } - - /* - * check if this is echo of our transmitted discovery request - * drop it here, TODO: better to drop this in TL. - */ - status = vos_mem_compare( psessionEntry->selfMacAddr, - &tdlsDisReq.LinkIdentifier.InitStaAddr[0], - sizeof(tSirMacAddr)) ; - if(status) - { - limLog( pMac, LOGE, FL("Echo of our TDLS discovery request frame")) ; - return eSIR_FAILURE ; - } - - /* - * while processing Discovery request from Peer, - * STA_MAC--> MAC of TDLS discovery initiator - * STA_PEER_MAC--> MAC of TDLS discovery responder. - */ - vos_mem_copy( peerMac, - &tdlsDisReq.LinkIdentifier.InitStaAddr[0], - sizeof(tSirMacAddr)) ; - /* TODO, do more validation */ - - /* see if discovery is already in progress */ - peerInfo = limTdlsFindDisPeer(pMac, peerMac) ; - - if(NULL == peerInfo) - { - /* - * we are allocating peer info for individual peers found in TDLS - * discovery, we need to keep adding TDLS peers till we have timed - * out. We are freeing this memory at the time we are sending this - * collected peer info to SME. - */ - tdlsDisResult = vos_mem_malloc(sizeof(tLimDisResultList)); - if ( NULL == tdlsDisResult ) - { - limLog(pMac, LOGP, FL("alloc fail for TDLS discovery " - "reponse info")) ; - return eSIR_FAILURE ; - } - - - peerInfo = &tdlsDisResult->tdlsDisPeerInfo ; - peerInfo->tdlsPeerState = TDLS_DIS_REQ_PROCESS_STATE ; - peerInfo->dialog = tdlsDisReq.DialogToken.token ; - - peerInfo->sessionId = psessionEntry->peSessionId; - - /* Populate peer info of tdls discovery result */ - vos_mem_copy( peerInfo->peerMac, peerMac, sizeof(tSirMacAddr)) ; - - /* - * Now, as per D13, there will not be any Supp rates, ext Supp rates - * info in Discovery request frames, so we are populating this info - * locally to pass it to ADD STA. - */ - do - { - tDot11fIESuppRates suppRates = {0} ; - tDot11fIEExtSuppRates extSuppRates = {0} ; - tANI_U16 caps = 0 ; - tDot11fFfCapabilities capsInfo = {0} ; - tDot11fIEHTCaps HTCaps = {0} ; - /* populate supported rate IE */ - PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &suppRates, psessionEntry ); - ConvertSuppRates( pMac, &peerInfo->tdlsPeerSuppRates, - &suppRates); - /* Populate extended supported rates */ - PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, - &extSuppRates, psessionEntry ); - - peerInfo->ExtRatesPresent = 1; - ConvertExtSuppRates( pMac, &peerInfo->tdlsPeerExtRates, - &extSuppRates); - - if(cfgGetCapabilityInfo(pMac, &caps, psessionEntry) != eSIR_SUCCESS) - { - /* - * Could not get Capabilities value - * from CFG. Log error. - */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); - } - swapBitField16(caps, ( tANI_U16* )&capsInfo ); - /* update Caps Info */ - tdlsUpdateCapInfo(&peerInfo->capabilityInfo, &capsInfo) ; - - PopulateDot11fHTCaps( pMac, psessionEntry, &HTCaps ); - limTdlsCovertHTCaps(pMac, peerInfo, &HTCaps) ; - - } while (0) ; - - /* now add this new found discovery node into tdls discovery list */ - tdlsDisResult->next = *disResultList ; - *disResultList = tdlsDisResult ; - pMac->lim.gLimTdlsDisStaCount++ ; - - /* See if for this peer already entry in setup Link */ - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - - /* - * if there is no entry for this peer in setup list, we need to - * do add sta for this peer to transmit discovery rsp. - */ - if(NULL == setupPeer) - { - /* To start with, send add STA request to HAL */ - pMac->lim.gLimAddStaTdls = true ; - peerInfo->delStaNeeded = true ; - - if(eSIR_FAILURE == limTdlsDisAddSta(pMac, peerMac, - peerInfo, psessionEntry)) - { - VOS_ASSERT(0) ; - limLog(pMac, LOGE, "Add STA for dis response is failed ") ; - return eSIR_FAILURE ; - } - } /* use setup link sta ID for discovery rsp */ - else - { - peerInfo->delStaNeeded = false ; - limSendTdlsDisRspFrame(pMac, peerInfo->peerMac, peerInfo->dialog, - psessionEntry, NULL, 0); - peerInfo->tdlsPeerState = TDLS_DIS_RSP_SENT_WAIT_STATE ; - } - - } - else - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("discovery procedure in progress for this peer")) ; - } - - return eSIR_SUCCESS ; -} - -/* Process TDLS setup Request Frame */ - -static tSirRetStatus limProcessTdlsSetupReqFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen) -{ - - tDot11fTDLSSetupReq tdlsSetupReq = {{0}} ; - tANI_U32 status = 0 ; - tpPESession psessionEntry = NULL ; - tANI_U8 sessionId = 0 ; - tANI_U8 currentState = TDLS_LINK_SETUP_WAIT_STATE ; - tANI_U8 previousState = TDLS_LINK_IDLE_STATE ; - /* create node for Link setup */ - tLimTdlsLinkSetupInfo *linkSetupInfo = &pMac->lim.gLimTdlsLinkSetupInfo ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tLimTdlsLinkSetupPeer *tmpSetupPeer = NULL ; - - status = dot11fUnpackTDLSSetupReq(pMac, pBody, frmLen, &tdlsSetupReq) ; - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse TDLS discovery Request " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "setup Request frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - } - /* - * find session entry using BSSID in link identifier, not using MAC - * header beacuse, there is cases in TDLS, there may be BSSID will not - * be present in header - */ - psessionEntry = peFindSessionByBssid(pMac, - &tdlsSetupReq.LinkIdentifier.bssid[0], &sessionId) ; - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no Session entry for TDLS session (bssid " - MAC_ADDRESS_STR")"), - MAC_ADDR_ARRAY(tdlsSetupReq.LinkIdentifier.bssid)); - - //VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - /* TODO: we don;t need this check now, varify BSSID */ - status = vos_mem_compare( psessionEntry->bssId, - &tdlsSetupReq.LinkIdentifier.bssid[0], - sizeof(tSirMacAddr)) ; - - if(!status) - { - limLog( pMac, LOGE, FL("TDLS setup request frame from other BSS -> something wrong. Check RXP filter")) ; - - limSendTdlsSetupRspFrame(pMac, tdlsSetupReq.LinkIdentifier.InitStaAddr, - tdlsSetupReq.DialogToken.token, psessionEntry, - TDLS_SETUP_STATUS_FAILURE, NULL, 0 ) ; - return eSIR_FAILURE ; - } - -#ifdef FEATURE_WLAN_TDLS_NEGATIVE - if(pMac->lim.gLimTdlsNegativeBehavior & LIM_TDLS_NEGATIVE_RSP_TIMEOUT_TO_SETUP_REQ) - { - /* simply ignore this setup request packet */ - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TDLS negative running: ignore TDLS Setup Req packet")); - return eSIR_SUCCESS ; - } - if(pMac->lim.gLimTdlsNegativeBehavior & LIM_TDLS_NEGATIVE_SEND_REQ_TO_SETUP_REQ) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("TDLS negative running: send TDLS Setup Req to peer TDLS Setup Req")); - /* format TDLS discovery request frame and transmit it */ - limSendTdlsLinkSetupReqFrame(pMac, tdlsSetupReq.LinkIdentifier.InitStaAddr, tdlsSetupReq.DialogToken.token, psessionEntry, - NULL, 0) ; - } -#endif - /* TODO, do more validation */ - - if(!limTdlsFindLinkPeer(pMac, - &tdlsSetupReq.LinkIdentifier.InitStaAddr[0], - &tmpSetupPeer)) - { - tANI_U32 tdlsStateStatus = TDLS_LINK_SETUP_START_STATE ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Link is already setup with this peer" )) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("state = %d"), tmpSetupPeer->tdls_link_state) ; - //return eSIR_FAILURE ; - - if(tmpSetupPeer == NULL) - { - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - - } - switch(tmpSetupPeer->tdls_link_state) - { - - case TDLS_LINK_SETUP_START_STATE: - { - v_SINT_t macCompare = 0 ; - macCompare= vos_mem_compare2(tmpSetupPeer->peerMac, - psessionEntry->selfMacAddr, sizeof(tSirMacAddr)) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("MAC comparison Rslt = %d"), macCompare ) ; - if(0 > macCompare) - { - /* - * Delete our Setup Request/Peer info and honour Peer - * Setup Request, go ahead and respond for this - */ - /* Deactivate the timer */ - tx_timer_deactivate(&tmpSetupPeer->gLimTdlsLinkSetupRspTimeoutTimer) ; -#ifdef FEATURE_WLAN_TDLS_NEGATIVE - if((pMac->lim.gLimTdlsNegativeBehavior & LIM_TDLS_NEGATIVE_SEND_REQ_TO_SETUP_REQ) - != LIM_TDLS_NEGATIVE_SEND_REQ_TO_SETUP_REQ) -#endif - limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, - tmpSetupPeer->peerMac, eWNI_SME_TDLS_LINK_START_RSP); - - limTdlsDelLinkPeer(pMac, tmpSetupPeer->peerMac) ; - tdlsStateStatus = TDLS_LINK_IDLE_STATE ; - } - else if(0 < macCompare) - { - /* - * Go ahead with current setup as peer is going to - * respond for setup request - */ - tdlsStateStatus = TDLS_LINK_SETUP_START_STATE ; - } - else - { - /* same MAC, not possible */ - VOS_ASSERT(0) ; - } - - break ; - } -#if 1 - case TDLS_LINK_SETUP_DONE_STATE: - { - tpDphHashNode pStaDs = NULL ; - - previousState = TDLS_LINK_SETUP_WAIT_STATE ; - currentState = TDLS_LINK_TEARDOWN_START_STATE ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("link Setup Done state " )) ; - tmpSetupPeer->tdls_prev_link_state = previousState ; - tmpSetupPeer->tdls_link_state = currentState ; - setupPeer = tmpSetupPeer ; -#if 0 - /* Send Teardown to this Peer and Initiate new TDLS Setup */ - limSendTdlsTeardownFrame(pMac, - &tdlsSetupReq.LinkIdentifier.InitStaAddr[0], - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON, psessionEntry) ; -#else - - /* tdls_hklee: send message to HAL before it is deleted, cause */ - limTdlsLinkTeardown(pMac, (setupPeer)->peerMac) ; - - /* send del STA to remove context for this TDLS STA */ - pStaDs = limTdlsDelSta(pMac, (setupPeer)->peerMac, psessionEntry) ; - - /* now send indication to SME-->HDD->TL to remove STA from TL */ - - if(pStaDs) - { - limSendSmeTdlsDelPeerInd(pMac, psessionEntry->smeSessionId, - pStaDs, eSIR_SUCCESS) ; - - /* send Teardown Ind to SME */ - limSendSmeTdlsTeardownRsp(pMac, eSIR_SUCCESS, (setupPeer)->peerMac, - eWNI_SME_TDLS_TEARDOWN_IND) ; - /* remove node from setup list */ - limTdlsDelLinkPeer(pMac, (setupPeer)->peerMac) ; - } -#endif - //setupPeer->tdls_prev_link_state = TDLS_LINK_SETUP_RESTART_STATE; - tdlsStateStatus = TDLS_LINK_IDLE_STATE ; - break ; - - } - default: - { - VOS_ASSERT(0) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("link Setup is Recieved in unknown state" )) ; - break ; - } -#endif - } - if(tdlsStateStatus == TDLS_LINK_SETUP_START_STATE) - return eSIR_FAILURE ; - } - - if(currentState != TDLS_LINK_TEARDOWN_START_STATE) - { - /* - * Now we are sure to send discovery response frame to TDLS discovery - * initiator, we don't care, if this request is unicast ro broadcast, - * we simply, send discovery response frame on direct link. - */ - setupPeer = vos_mem_malloc(sizeof( tLimTdlsLinkSetupPeer )); - if ( NULL == setupPeer ) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ( "Unable to allocate memory during ADD_STA" )); - return eSIR_MEM_ALLOC_FAILED; - } - - setupPeer->dialog = tdlsSetupReq.DialogToken.token ; - //setupPeer->tdls_prev_link_state = setupPeer->tdls_link_state ; - //setupPeer->tdls_link_state = TDLS_LINK_SETUP_WAIT_STATE ; - setupPeer->tdls_prev_link_state = previousState ; - setupPeer->tdls_link_state = currentState ; - /* TDLS_sessionize: remember sessionId for future */ - setupPeer->tdls_sessionId = psessionEntry->peSessionId; - setupPeer->tdls_bIsResponder = 0; - - vos_mem_copy(setupPeer->peerMac, - &tdlsSetupReq.LinkIdentifier.InitStaAddr[0], - sizeof(tSirMacAddr)) ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Setup REQ MAC = " MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(setupPeer->peerMac)); - - limTdlsUpdateLinkReqPeerInfo(pMac, setupPeer, &tdlsSetupReq) ; - pMac->lim.gLimAddStaTdls = true ; - - /* To start with, send add STA request to HAL */ - if(eSIR_FAILURE == limTdlsSetupAddSta(pMac, setupPeer->peerMac, - setupPeer, psessionEntry)) - { - VOS_ASSERT(0) ; - vos_mem_free((void **) &setupPeer) ; - return eSIR_FAILURE ; - } - - limSendTdlsSetupRspFrame(pMac, tdlsSetupReq.LinkIdentifier.InitStaAddr, - tdlsSetupReq.DialogToken.token, psessionEntry, - TDLS_SETUP_STATUS_SUCCESS, NULL, 0) ; - - limStartTdlsTimer(pMac, psessionEntry->peSessionId, - &setupPeer->gLimTdlsLinkSetupCnfTimeoutTimer, - (tANI_U32)setupPeer->peerMac, - WNI_CFG_TDLS_LINK_SETUP_CNF_TIMEOUT, - SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT) ; - - /* update setup peer list */ - setupPeer->next = linkSetupInfo->tdlsLinkSetupList ; - linkSetupInfo->tdlsLinkSetupList = setupPeer ; - } - else - { - setupPeer->dialog = tdlsSetupReq.DialogToken.token ; - //setupPeer->tdls_prev_link_state = setupPeer->tdls_link_state ; - //setupPeer->tdls_link_state = TDLS_LINK_SETUP_WAIT_STATE ; - setupPeer->tdls_prev_link_state = previousState ; - setupPeer->tdls_link_state = currentState ; - /* TDLS_sessionize: remember sessionId for future */ - setupPeer->tdls_sessionId = psessionEntry->peSessionId; - setupPeer->tdls_bIsResponder = 0; - - vos_mem_copy( setupPeer->peerMac, - &tdlsSetupReq.LinkIdentifier.InitStaAddr[0], - sizeof(tSirMacAddr)) ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Setup REQ MAC = "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(setupPeer->peerMac)); - - limTdlsUpdateLinkReqPeerInfo(pMac, setupPeer, &tdlsSetupReq) ; - limSendTdlsSetupRspFrame(pMac, tdlsSetupReq.LinkIdentifier.InitStaAddr, - tdlsSetupReq.DialogToken.token, psessionEntry, - TDLS_SETUP_STATUS_SUCCESS, NULL, 0) ; - - limStartTdlsTimer(pMac, psessionEntry->peSessionId, - &setupPeer->gLimTdlsLinkSetupCnfTimeoutTimer, - (tANI_U32)setupPeer->peerMac, - WNI_CFG_TDLS_LINK_SETUP_CNF_TIMEOUT, - SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT) ; - } - - - return eSIR_SUCCESS ; - -} - -/* - * TDLS discovery request frame received from TDLS peer STA.. - */ -static tSirRetStatus limProcessTdlsSetupRspFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen ) -{ - tDot11fTDLSSetupRsp tdlsSetupRsp = {{0}} ; - tANI_U32 status = 0 ; - tSirMacAddr peerMac = {0} ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tpPESession psessionEntry = NULL ; - tANI_U8 sessionId = 0 ; - - status = dot11fUnpackTDLSSetupRsp(pMac, pBody, frmLen, &tdlsSetupRsp) ; - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse TDLS discovery Request " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "discovery Request frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - } - - /* - * find session entry using BSSID in link identifier, not using MAC - * header beacuse, there is cases in TDLS, there may be BSSID will not - * be present in header - */ - psessionEntry = peFindSessionByBssid(pMac, - &tdlsSetupRsp.LinkIdentifier.bssid[0], &sessionId) ; - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no Session entry for TDLS session (bssid " - MAC_ADDRESS_STR")"), - MAC_ADDR_ARRAY(tdlsSetupRsp.LinkIdentifier.bssid)); - - //VOS_ASSERT(0) ; - return eSIR_FAILURE; - } - - /* varify BSSID */ - status = vos_mem_compare( psessionEntry->bssId, - &tdlsSetupRsp.LinkIdentifier.bssid[0], - sizeof(tSirMacAddr)) ; - - if(!status) - { - limLog( pMac, LOGE, FL("TDLS discovery request frame from other BSS -> something wrong. Check RXP filter")) ; - - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - vos_mem_copy( peerMac, - &tdlsSetupRsp.LinkIdentifier.RespStaAddr[0], - sizeof(tSirMacAddr)) ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("TDLS setup RSP peer = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - - if(NULL == setupPeer) - { - limLog( pMac, LOGE, FL("unknown setup Response frame other BSS")) ; - return eSIR_FAILURE ; - } - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("deactivating Setup RSP timer")) ; - - /* Deactivate the timer */ - tx_timer_deactivate(&(setupPeer)->gLimTdlsLinkSetupRspTimeoutTimer) ; - - /* - * TDLS Setup RSP is recieved with Failure, Delete this STA entry - * don't respond with TDLS CNF frame. - */ - if(TDLS_SETUP_STATUS_SUCCESS != tdlsSetupRsp.Status.status) - { - limTdlsDelLinkPeer(pMac, (setupPeer)->peerMac) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("setup RSP with Failure Code")) ; - return eSIR_FAILURE ; - } - - /* update Link Info */ - limTdlsUpdateLinkRspPeerInfo(pMac, setupPeer, &tdlsSetupRsp) ; - - /* TODO, do more validation */ - - - /* - * Now we are sure to send link setup CNF frame to TDLS link setup - * reponded, now we will create dph hash entry and send add STA to HAL - */ - - pMac->lim.gLimAddStaTdls = true ; - if(eSIR_FAILURE == limTdlsSetupAddSta(pMac, peerMac, - setupPeer, psessionEntry)) - { - /* through error */ - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - /* TDLS_HKLEE_FIXME: now we add some delay for AddSta_Rsp comes */ - - - /* send TDLS confim frame to TDLS Peer STA */ - limSendTdlsLinkSetupCnfFrame(pMac, peerMac, tdlsSetupRsp.DialogToken.token, 0, psessionEntry, NULL, 0) ; - - /* - * set the tdls_link_state to TDLS_LINK_SETUP_RSP_WAIT_STATE, and - * wait for Setup CNF transmission on air, once we receive tx complete - * message, we will change the peer state and send message to SME - * callback.. - */ - (setupPeer)->tdls_prev_link_state = (setupPeer)->tdls_link_state ; - (setupPeer)->tdls_link_state = TDLS_LINK_SETUP_RSP_WAIT_STATE ; - - return eSIR_SUCCESS ; -} -/* - * TDLS setup CNF frame processing .. - */ - -static tSirRetStatus limProcessTdlsSetupCnfFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen) -{ - tDot11fTDLSSetupCnf tdlsSetupCnf = {{0}} ; - tANI_U32 status = 0 ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tpPESession psessionEntry = NULL ; - tANI_U8 sessionId = 0 ; - - status = dot11fUnpackTDLSSetupCnf(pMac, pBody, frmLen, &tdlsSetupCnf) ; - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse an TDLS discovery Response " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "discovery Response frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - } - /* - * find session entry using BSSID in link identifier, not using MAC - * header beacuse, there is cases in TDLS, there may be BSSID will not - * be present in header - */ - psessionEntry = peFindSessionByBssid(pMac, - &tdlsSetupCnf.LinkIdentifier.bssid[0], &sessionId) ; - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no Session entry for TDLS session (bssid " - MAC_ADDRESS_STR")"), - MAC_ADDR_ARRAY(tdlsSetupCnf.LinkIdentifier.bssid)); - - //VOS_ASSERT(0) ; - return eSIR_FAILURE; - } - - /* varify BSSID */ - status = vos_mem_compare( psessionEntry->bssId, - &tdlsSetupCnf.LinkIdentifier.bssid[0], - sizeof(tSirMacAddr)) ; - - if(!status) - { - limLog( pMac, LOGE, FL("TDLS setup CNF frame other BSS -> something wrong. Check RXP filter")) ; - - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - /* TODO, do more validation */ - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("setup Cnf peer MAc = "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(tdlsSetupCnf.LinkIdentifier.InitStaAddr)); - - limTdlsFindLinkPeer(pMac, - &tdlsSetupCnf.LinkIdentifier.InitStaAddr[0], - &setupPeer) ; - - if(NULL == setupPeer) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - (" unknown setup CNF frame")) ; - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("setup CNF peer MAC = "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY((setupPeer)->peerMac)); - /*T match dialog token, before proceeding further */ - if((setupPeer)->dialog != tdlsSetupCnf.DialogToken.token) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("setup CNF frame not matching with setup RSP")) ; - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - - /* - * Now we are sure that, this set CNF is for us, now stop - * the running timer.. - */ - tx_timer_deactivate(&(setupPeer)->gLimTdlsLinkSetupCnfTimeoutTimer) ; - - /* change TDLS peer State */ - (setupPeer)->tdls_prev_link_state = (setupPeer)->tdls_link_state ; - (setupPeer)->tdls_link_state = TDLS_LINK_SETUP_DONE_STATE ; - - /* send indication to SME that, new link is setup */ - limSendSmeTdlsLinkSetupInd(pMac, (setupPeer)->peerMac, eSIR_SUCCESS) ; - - /* tdls_hklee: prepare PTI template and send it to HAL */ - limTdlsLinkEstablish(pMac, (setupPeer)->peerMac); - - return eSIR_SUCCESS ; - -} - -/* - * TDLS discovery response frame processing .. - */ - -static tSirRetStatus limProcessTdlsDisRspFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen, - tANI_S8 rssi, tpPESession psessionEntry) -{ - tDot11fTDLSDisRsp tdlsDisRsp = {{0}} ; - tANI_U32 status = 0 ; - tLimDisResultList *tdlsDisResult = NULL ; - tLimDisResultList **disResultList = &pMac->lim.gLimTdlsDisResultList ; - tSirTdlsDisReq *prevDisReq = &pMac->lim.gLimTdlsDisReq ; - - status = dot11fUnpackTDLSDisRsp(pMac, pBody, frmLen, &tdlsDisRsp) ; - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse an TDLS discovery Response " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "discovery Response frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) - } - /*TODO: match dialog token, before proceeding further */ - - /* varify BSSID */ - status = vos_mem_compare( psessionEntry->bssId, - &tdlsDisRsp.LinkIdentifier.bssid[0], - sizeof(tSirMacAddr)) ; - - if(!status) - { - limLog( pMac, LOGW, FL(" TDLS discovery Response frame other BSS")) ; - return eSIR_FAILURE ; - } - /* TODO, do more validation */ - - if(tdlsDisRsp.DialogToken.token != prevDisReq->dialog) - { - limLog( pMac, LOGW, FL(" wrong TDLS discovery Response frame")) ; - return eSIR_FAILURE ; - } - - pMac->lim.gLimTdlsDisStaCount++ ; - - /* - * we are allocating peer info for individual peers found in TDLS - * discovery, we need to keep adding TDLS peers till we have timed - * out. We are freeing this memory at the time we are sending this - * collected peer info to SME. - */ - tdlsDisResult = vos_mem_malloc(sizeof(tLimDisResultList)); - if ( NULL == tdlsDisResult ) - { - limLog(pMac, LOGP, FL("alloc fail for TDLS discovery reponse info")) ; - return eSIR_FAILURE ; - } - - do - { - tSirTdlsPeerInfo *peerInfo = &tdlsDisResult->tdlsDisPeerInfo ; - - /* Populate peer info of tdls discovery result */ - peerInfo->sessionId = psessionEntry->peSessionId; - /* - * When we receive DIS RSP from peer MAC, - * STA_MAC_OFFSET will carry peer MAC address and PEER MAC OFFSET - * will carry our MAC. - */ - vos_mem_copy( peerInfo->peerMac, - &tdlsDisRsp.LinkIdentifier.RespStaAddr[0], - sizeof(tSirMacAddr)) ; - - /* update RSSI for this TDLS peer STA */ - peerInfo->tdlsPeerRssi = rssi ; - - /* update Caps Info */ - tdlsUpdateCapInfo(&peerInfo->capabilityInfo, - &tdlsDisRsp.Capabilities) ; - - /* update Supp rates */ - if(tdlsDisRsp.SuppRates.present) - { - ConvertSuppRates( pMac, &peerInfo->tdlsPeerSuppRates, - &tdlsDisRsp.SuppRates ); - } - - /* update EXT supp rates */ - if(tdlsDisRsp.ExtSuppRates.present) - { - peerInfo->ExtRatesPresent = 1; - ConvertExtSuppRates( pMac, &peerInfo->tdlsPeerExtRates, - &tdlsDisRsp.ExtSuppRates ); - } - /* update HT caps */ - if (tdlsDisRsp.HTCaps.present) - { - vos_mem_copy( &peerInfo->tdlsPeerHtCaps, &tdlsDisRsp.HTCaps, - sizeof( tDot11fIEHTCaps ) ); - } - } while(0) ; - - /* now add this new found discovery node into tdls discovery list */ - tdlsDisResult->next = *disResultList ; - *disResultList = tdlsDisResult ; - - return eSIR_SUCCESS ; -} - -/* - * Process TDLS Teardown request frame from TDLS peer STA - */ -static tSirRetStatus limProcessTdlsTeardownFrame(tpAniSirGlobal pMac, - tANI_U8 *pBody, tANI_U32 frmLen ) -{ - tDot11fTDLSTeardown tdlsTeardown = {{0}} ; - tANI_U32 status = 0 ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tpPESession psessionEntry = NULL ; - tANI_U8 sessionId = 0 ; - - status = dot11fUnpackTDLSTeardown(pMac, pBody, frmLen, &tdlsTeardown) ; - - if ( DOT11F_FAILED( status ) ) - { - limLog(pMac, LOGE, FL("Failed to parse an TDLS discovery Response " - "frame (0x%08x, %d bytes):"),status, frmLen); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a TDLS " - "discovery Response frame (0x%08x, %d bytes):"), - status, frmLen ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frmLen);) - } - - /* - * find session entry using BSSID in link identifier, not using MAC - * header beacuse, there is cases in TDLS, there may be BSSID will not - * be present in header - */ - psessionEntry = peFindSessionByBssid(pMac, - &tdlsTeardown.LinkIdentifier.bssid[0], &sessionId) ; - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no Session entry for TDLS session (bssid " - MAC_ADDRESS_STR")"), - MAC_ADDR_ARRAY(tdlsTeardown.LinkIdentifier.bssid)); - - //VOS_ASSERT(0) ; - return eSIR_FAILURE; - } - - /* varify BSSID */ - status = vos_mem_compare( psessionEntry->bssId, - &tdlsTeardown.LinkIdentifier.bssid[0], - sizeof(tSirMacAddr)) ; - - - if(!status) - { - limLog( pMac, LOGE, FL("Teardown from other BSS -> something wrong. Check RXP filter")) ; - VOS_ASSERT(0) ; - return eSIR_FAILURE ; - } - - limTdlsFindLinkPeer(pMac, - &tdlsTeardown.LinkIdentifier.InitStaAddr[0], - &setupPeer) ; - - if(NULL == setupPeer) - { - //ignore - //VOS_ASSERT(0) ; - limLog( pMac, LOGE, FL("Teardown from unknown peer. --> ignored") ); - - return eSIR_FAILURE ; - } - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("teardown for peer "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY((setupPeer)->peerMac)); - - switch(tdlsTeardown.Reason.code) - { - case eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON: - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("teardown with unspecified reason")) ; - break ; - } - case eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE: - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - (" Teardown from AP, TDLS peer unreachable")) ; - break ; - } - default: - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - (" unknown teardown")) ; - break ; - } - } - - /* change TDLS peer State */ - (setupPeer)->tdls_prev_link_state = (setupPeer)->tdls_link_state ; - (setupPeer)->tdls_link_state = TDLS_LINK_TEARDOWN_START_STATE ; - - do - { - tpDphHashNode pStaDs = NULL ; - - /* tdls_hklee: send message to HAL before it is deleted, cause */ - limTdlsLinkTeardown(pMac, (setupPeer)->peerMac) ; - - /* send del STA to remove context for this TDLS STA */ - pStaDs = limTdlsDelSta(pMac, (setupPeer)->peerMac, psessionEntry) ; - - /* now send indication to SME-->HDD->TL to remove STA from TL */ - - if(pStaDs) - { - limSendSmeTdlsDelPeerInd(pMac, psessionEntry->smeSessionId, - pStaDs, eSIR_SUCCESS) ; - - /* send Teardown Ind to SME */ - limSendSmeTdlsTeardownRsp(pMac, eSIR_SUCCESS, (setupPeer)->peerMac, - eWNI_SME_TDLS_TEARDOWN_IND) ; - /* remove node from setup list */ - limTdlsDelLinkPeer(pMac, (setupPeer)->peerMac) ; - } - - }while(0) ; - - return status ; -} - -/* - * Common processing of TDLS action frames recieved - */ -void limProcessTdlsFrame(tpAniSirGlobal pMac, tANI_U32 *pBd) -{ - tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd); - tANI_U8 pOffset = ((0 == WDA_GET_RX_FT_DONE(pBd)) - ? (( sizeof( eth_890d_header ))) :(0)) ; - - tANI_U8 category = (pBody + pOffset + PAYLOAD_TYPE_TDLS_SIZE)[0] ; - tANI_U8 action = (pBody + pOffset + PAYLOAD_TYPE_TDLS_SIZE)[1] ; - tANI_U32 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd) ; - tANI_U8 *tdlsFrameBody = (pBody + pOffset + PAYLOAD_TYPE_TDLS_SIZE) ; - //tANI_S8 rssi = (tANI_S8)SIR_MAC_BD_TO_RSSI_DB(pBd); - - if(category != SIR_MAC_ACTION_TDLS) - { - limLog( pMac, LOGE, FL("Invalid TDLS action frame=(%d). Ignored"), category ); - return ; - } - - frameLen -= (pOffset + PAYLOAD_TYPE_TDLS_SIZE) ; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("Received TDLS action %d (%s)"), - action, limTraceTdlsActionString(action) )); - - switch(action) - { - - case SIR_MAC_TDLS_SETUP_REQ: - { - limProcessTdlsSetupReqFrame(pMac, tdlsFrameBody, frameLen) ; - break ; - } - case SIR_MAC_TDLS_SETUP_RSP: - { - limProcessTdlsSetupRspFrame(pMac, tdlsFrameBody, frameLen) ; - break ; - } - case SIR_MAC_TDLS_SETUP_CNF: - { - limProcessTdlsSetupCnfFrame(pMac, tdlsFrameBody, frameLen) ; - break ; - } - case SIR_MAC_TDLS_TEARDOWN: - { - limProcessTdlsTeardownFrame(pMac, tdlsFrameBody, frameLen) ; - break ; - } - case SIR_MAC_TDLS_DIS_REQ: - { - limProcessTdlsDisReqFrame(pMac, tdlsFrameBody, frameLen) ; - break ; - } - case SIR_MAC_TDLS_PEER_TRAFFIC_IND: - case SIR_MAC_TDLS_CH_SWITCH_REQ: - case SIR_MAC_TDLS_CH_SWITCH_RSP: - case SIR_MAC_TDLS_PEER_TRAFFIC_RSP: - default: - { - break ; - } - } - - return ; -} - -/* - * ADD sta for dis response fame sent on direct link - */ -static tSirRetStatus limTdlsDisAddSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, - tSirTdlsPeerInfo *peerInfo, tpPESession psessionEntry) -{ - tpDphHashNode pStaDs = NULL ; - tSirRetStatus status = eSIR_SUCCESS ; - tANI_U16 aid = 0 ; - - if(NULL == peerInfo) - { - VOS_ASSERT(0) ; - return status ; - - } - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("ADD STA peer MAC: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerMac)); - - - if(NULL != dphLookupHashEntry(pMac, peerMac, - &aid, &psessionEntry->dph.dphHashTable)) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - (" there is hash entry for this client")) ; - status = eSIR_FAILURE ; - VOS_ASSERT(0) ; - return status ; - } - - aid = limAssignPeerIdx(pMac, psessionEntry) ; - - /* Set the aid in peerAIDBitmap as it has been assigned to TDLS peer */ - SET_PEER_AID_BITMAP(psessionEntry->peerAIDBitmap, aid); - - pStaDs = dphGetHashEntry(pMac, aid, &psessionEntry->dph.dphHashTable); - - if (pStaDs) - { - (void) limDelSta(pMac, pStaDs, false /*asynchronous*/, psessionEntry); - limDeleteDphHashEntry(pMac, pStaDs->staAddr, aid, psessionEntry); - } - pStaDs = dphAddHashEntry(pMac, peerMac, aid, - &psessionEntry->dph.dphHashTable) ; - - if(NULL == pStaDs) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - (" add hash entry failed")) ; - status = eSIR_FAILURE ; - VOS_ASSERT(0) ; - return status; - } - if(eSIR_SUCCESS == status) - { -#ifdef TDLS_RATE_DEBUG - tSirMacRateSet *suppRates = &peerInfo->tdlsPeerSuppRates ; - tSirMacRateSet *extRates = &peerInfo->tdlsPeerExtRates ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("pSta DS [%p] "), pStaDs) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peerInfo->tdlsPeerSuppRates = [%p]"), - (tANI_U8 *)&peerInfo->tdlsPeerSuppRates) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peerInfo->tdlsPeerExtRates = [%p]"), - (tANI_U8 *)&peerInfo->tdlsPeerExtRates) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peerInfo->tdlsPeerPropRates = [%p]"), - (tANI_U8 *)&pStaDs->mlmStaContext.propRateSet) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("peerInfo->mcs = [%p]"), - (tANI_U8 *)peerInfo->supportedMCSSet) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("num of supp rates = %02x"), suppRates->numRates) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("num of ext rates = %01x"), extRates->numRates) ; -#endif - - /* Populate matching rate set */ -#ifdef WLAN_FEATURE_11AC - if(eSIR_FAILURE == limPopulateMatchingRateSet(pMac, pStaDs, - &peerInfo->tdlsPeerSuppRates, - &peerInfo->tdlsPeerExtRates, - peerInfo->supportedMCSSet, - &pStaDs->mlmStaContext.propRateSet, - psessionEntry, NULL)) -#else - if(eSIR_FAILURE == limPopulateMatchingRateSet(pMac, pStaDs, - &peerInfo->tdlsPeerSuppRates, - &peerInfo->tdlsPeerExtRates, - peerInfo->supportedMCSSet, - &pStaDs->mlmStaContext.propRateSet, - psessionEntry)) -#endif - { - VOS_ASSERT(0) ; - } - - - pStaDs->mlmStaContext.capabilityInfo = peerInfo->capabilityInfo; - vos_mem_copy( pStaDs->staAddr, peerMac, sizeof(tSirMacAddr)) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Add STA for Peer: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pStaDs->staAddr)); - - - pStaDs->staType = STA_ENTRY_TDLS_PEER ; - - status = limAddSta(pMac, pStaDs, false, psessionEntry); - - if(eSIR_SUCCESS != status) - { - /* should not fail */ - VOS_ASSERT(0) ; - } - } - - return status ; -} -#endif -/* - * Add STA for TDLS setup procedure - */ -static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, - tSirTdlsAddStaReq *pAddStaReq, - tpPESession psessionEntry) -{ - tpDphHashNode pStaDs = NULL ; - tSirRetStatus status = eSIR_SUCCESS ; - tANI_U16 aid = 0 ; - - pStaDs = dphLookupHashEntry(pMac, pAddStaReq->peerMac, &aid, - &psessionEntry->dph.dphHashTable); - if(NULL == pStaDs) - { - aid = limAssignPeerIdx(pMac, psessionEntry) ; - - if( !aid ) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("%s: No more free AID for peer " MAC_ADDRESS_STR), - __func__, MAC_ADDR_ARRAY(pAddStaReq->peerMac)) ; - return eSIR_FAILURE; - } - - /* Set the aid in peerAIDBitmap as it has been assigned to TDLS peer */ - SET_PEER_AID_BITMAP(psessionEntry->peerAIDBitmap, aid); - - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsSetupAddSta: Aid = %d, for peer =" MAC_ADDRESS_STR), - aid, MAC_ADDR_ARRAY(pAddStaReq->peerMac)); - pStaDs = dphGetHashEntry(pMac, aid, &psessionEntry->dph.dphHashTable); - - if (pStaDs) - { - (void) limDelSta(pMac, pStaDs, false /*asynchronous*/, psessionEntry); - limDeleteDphHashEntry(pMac, pStaDs->staAddr, aid, psessionEntry); - } - - pStaDs = dphAddHashEntry(pMac, pAddStaReq->peerMac, aid, - &psessionEntry->dph.dphHashTable) ; - - if(NULL == pStaDs) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - (" add hash entry failed")) ; - VOS_ASSERT(0) ; - return eSIR_FAILURE; - } - } - - limTdlsUpdateHashNodeInfo(pMac, pStaDs, pAddStaReq, psessionEntry) ; - - pStaDs->staType = STA_ENTRY_TDLS_PEER ; - - status = limAddSta(pMac, pStaDs, (pAddStaReq->tdlsAddOper == TDLS_OPER_UPDATE) ? true: false, psessionEntry); - - if(eSIR_SUCCESS != status) - { - /* should not fail */ - VOS_ASSERT(0) ; - } - return status ; -} - -/* - * Del STA, after Link is teardown or discovery response sent on direct link - */ -static tpDphHashNode limTdlsDelSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, - tpPESession psessionEntry) -{ - tSirRetStatus status = eSIR_SUCCESS ; - tANI_U16 peerIdx = 0 ; - tpDphHashNode pStaDs = NULL ; - - pStaDs = dphLookupHashEntry(pMac, peerMac, &peerIdx, - &psessionEntry->dph.dphHashTable) ; - - if(pStaDs) - { - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("DEL STA peer MAC: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pStaDs->staAddr)); - - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsDelSta: STA type = %x, sta idx = %x"),pStaDs->staType, - pStaDs->staIndex) ; - - limDeleteBASessions(pMac, psessionEntry, BA_BOTH_DIRECTIONS, - eSIR_MAC_PEER_TIMEDOUT_REASON); - - status = limDelSta(pMac, pStaDs, false, psessionEntry) ; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - if(eSIR_SUCCESS == status) - { - limDeleteDphHashEntry(pMac, pStaDs->staAddr, peerIdx, psessionEntry) ; - limReleasePeerIdx(pMac, peerIdx, psessionEntry) ; - } - else - { - VOS_ASSERT(0) ; - } -#endif - } - - return pStaDs ; -} - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* -* Prepare link establish message for HAL, construct PTI template. -* -*/ -static tSirRetStatus limTdlsLinkEstablish(tpAniSirGlobal pMac, tSirMacAddr peerMac) -{ - tANI_U8 pFrame[64] ; - tDot11fTDLSPeerTrafficInd tdlsPtiTemplate ; - tANI_U32 status = 0 ; - tANI_U32 nPayload = 0 ; - tANI_U32 nBytes = 0 ; - tANI_U32 header_offset = 0 ; - tANI_U16 aid = 0 ; - tDphHashNode *pStaDs = NULL ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tpPESession psessionEntry = NULL ; - - - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - if(NULL == setupPeer) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkEstablish: cannot find peer mac " - "in tdls linksetup list: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerMac)); - return eSIR_FAILURE; - } - - psessionEntry = peFindSessionBySessionId(pMac, - setupPeer->tdls_sessionId) ; - - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkEstablish: sessionID %d is not found"), setupPeer->tdls_sessionId); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - - pStaDs = dphLookupHashEntry(pMac, peerMac, &aid, &psessionEntry->dph.dphHashTable) ; - if(pStaDs == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkEstablish: cannot find peer mac " - "in tdls linksetup list: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerMac)); - return eSIR_FAILURE; - } - - vos_mem_set( ( tANI_U8* )&tdlsPtiTemplate, - sizeof( tDot11fTDLSPeerTrafficInd ), 0 ); - - /* - * setup Fixed fields, - */ - tdlsPtiTemplate.Category.category = SIR_MAC_ACTION_TDLS; - tdlsPtiTemplate.Action.action = SIR_MAC_TDLS_PEER_TRAFFIC_IND; - tdlsPtiTemplate.DialogToken.token = 0 ; /* filled by firmware at the time of transmission */ -#if 1 - /* CHECK_PTI_LINK_IDENTIFIER_INITIATOR_ADDRESS: initator address should be TDLS link setup's initiator address, - then below code makes such an way */ - PopulateDot11fLinkIden( pMac, psessionEntry, &tdlsPtiTemplate.LinkIdentifier, - peerMac, !setupPeer->tdls_bIsResponder) ; -#else - /* below code will make PTI's linkIdentifier's initiator address be selfAddr */ - PopulateDot11fLinkIden( pMac, psessionEntry, &tdlsPtiTemplate.LinkIdentifier, - peerMac, TDLS_INITIATOR) ; -#endif - - /* PUBufferStatus will be filled by firmware at the time of transmission */ - tdlsPtiTemplate.PUBufferStatus.present = 1; - - /* TODO: get ExtendedCapabilities IE */ - - /* - * now we pack it. First, how much space are we going to need? - */ - status = dot11fGetPackedTDLSPeerTrafficIndSize ( pMac, &tdlsPtiTemplate, &nPayload); - if ( DOT11F_FAILED( status ) ) - { - limLog( pMac, LOGP, FL("Failed to calculate the packed size for a PTI template (0x%08x)."), status ); - /* We'll fall back on the worst case scenario: */ - nPayload = sizeof( tdlsPtiTemplate ); - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while calculating the packed size for a PTI template (0x%08x)."), status ); - } - - /* - * This frame is going out from PE as data frames with special ethertype - * 89-0d. - * 8 bytes of RFC 1042 header - */ - - nBytes = nPayload + sizeof( tSirMacMgmtHdr ) - + sizeof( eth_890d_header ) - + PAYLOAD_TYPE_TDLS_SIZE ; - - if(nBytes > 64) { - limLog( pMac, LOGE, FL("required memory for PTI frame is %ld, but reserved only 64."), nBytes); - nBytes = 64; - } - /* zero out the memory */ - vos_mem_set( pFrame, sizeof(pFrame), 0 ); - - /* fill out the buffer descriptor */ - - header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, - LINK_IDEN_ADDR_OFFSET(tdlsPtiTemplate), TDLS_LINK_AP, !setupPeer->tdls_bIsResponder, psessionEntry) ; - - status = dot11fPackTDLSPeerTrafficInd ( pMac, &tdlsPtiTemplate, pFrame - + header_offset, nPayload, &nPayload ); - - if ( DOT11F_FAILED( status ) ) - { - limLog( pMac, LOGE, FL("Failed to pack a PTI template (0x%08x)."), - status ); - return eSIR_FAILURE; - } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Peer Traffic Indication (0x%08x)."), status ); - } - - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("bIsResponder=%d, header_offset=%ld, linkIdenOffset=%d, ptiBufStatusOffset=%d "), - setupPeer->tdls_bIsResponder, header_offset, PTI_LINK_IDEN_OFFSET, PTI_BUF_STATUS_OFFSET)); - - limSendTdlsLinkEstablish(pMac, setupPeer->tdls_bIsResponder, - header_offset+PTI_LINK_IDEN_OFFSET, header_offset+PTI_BUF_STATUS_OFFSET, - nBytes, pFrame, (tANI_U8 *)&setupPeer->tdlsPeerExtCaps); - - return eSIR_SUCCESS; -} - -/* -* Prepare link teardown message for HAL from peer_mac -* -*/ -static tSirRetStatus limTdlsLinkTeardown(tpAniSirGlobal pMac, tSirMacAddr peerMac) -{ - tDphHashNode *pStaDs = NULL ; - tANI_U16 aid = 0 ; - tLimTdlsLinkSetupPeer *setupPeer = NULL ; - tpPESession psessionEntry = NULL ; - - - limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; - if(NULL == setupPeer) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkTeardown: cannot find peer mac " - "in tdls linksetup list: " - MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); - return eSIR_FAILURE; - } - - psessionEntry = peFindSessionBySessionId(pMac, - setupPeer->tdls_sessionId) ; - - if(NULL == psessionEntry) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkTeardown: sessionID %d is not found"), setupPeer->tdls_sessionId); - VOS_ASSERT(0) ; - return eHAL_STATUS_FAILURE; - } - - - - pStaDs = dphLookupHashEntry(pMac, peerMac, &aid, &psessionEntry->dph.dphHashTable); - - if(pStaDs == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("limTdlsLinkTeardown: cannot find peer mac " - "in hash table: " - MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); - return eSIR_FAILURE; - } - - limSendTdlsLinkTeardown(pMac, pStaDs->staIndex); - - return eSIR_SUCCESS; -} - -/* - * Prepare Discovery RSP message for SME, collect peerINfo for all the - * peers discovered and delete/clean discovery lists in PE. - */ - -static tSirTdlsDisRsp *tdlsPrepareTdlsDisRsp(tpAniSirGlobal pMac, - tSirTdlsDisRsp *disRsp, tANI_U8 disStaCount) -{ - tANI_U32 disMsgRspSize = sizeof(tSirTdlsDisRsp); - tANI_U8 status = eHAL_STATUS_SUCCESS ; - - /* - * allocate memory for tdls discovery response, allocated memory should - * be alloc_mem = tdlsStaCount * sizeof(peerinfo) - * + siezeof tSirTdlsDisRsp. - */ - disMsgRspSize += (disStaCount * sizeof(tSirTdlsPeerInfo)); - - /* now allocate memory */ - - disRsp = vos_mem_malloc(disMsgRspSize); - if ( NULL == disRsp ) - { - limLog(pMac, LOGP, FL("AllocateMemory failed for DIS RSP")); - return NULL ; - } - - if(disStaCount) - { - tLimDisResultList *tdlsDisRspList = pMac->lim.gLimTdlsDisResultList ; - tSirTdlsPeerInfo *peerInfo = &disRsp->tdlsDisPeerInfo[0] ; - - tLimDisResultList *currentNode = tdlsDisRspList ; - while(tdlsDisRspList != NULL) - { - - vos_mem_copy( (tANI_U8 *)peerInfo, - (tANI_U8 *) &tdlsDisRspList->tdlsDisPeerInfo, - sizeof(tSirTdlsPeerInfo)); - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Msg Sent to PE, peer MAC: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerInfo->peerMac)); - disStaCount-- ; - peerInfo++ ; - currentNode = tdlsDisRspList ; - tdlsDisRspList = tdlsDisRspList->next ; - vos_mem_free(currentNode) ; - /* boundary condition check, may be fatal */ - if(((!disStaCount) && (tdlsDisRspList)) - || ((!tdlsDisRspList) && disStaCount)) - { - limLog(pMac, LOG1, FL("mismatch in dis sta count and " - "number of nodes in list")) ; - VOS_ASSERT(0) ; - return NULL ; - } - } /* end of while */ - - /* All discovery STA processed */ - pMac->lim.gLimTdlsDisResultList = NULL ; - - } /* end of if dis STA count */ - - return (disRsp) ; -} - -/* Send Teardown response back to PE */ - -void limSendSmeTdlsTeardownRsp(tpAniSirGlobal pMac, tSirResultCodes statusCode, - tSirMacAddr peerMac, tANI_U16 msgType) -{ - tSirMsgQ mmhMsg = {0} ; - tSirTdlsTeardownRsp *teardownRspMsg = NULL ; - tANI_U8 status = eHAL_STATUS_SUCCESS ; - - mmhMsg.type = msgType ; - - teardownRspMsg = vos_mem_malloc(sizeof(tSirTdlsTeardownRsp)); - if ( NULL == teardownRspMsg ) - { - VOS_ASSERT(0) ; - } - vos_mem_copy( teardownRspMsg->peerMac, (tANI_U8 *)peerMac, - sizeof(tSirMacAddr)) ; - teardownRspMsg->statusCode = statusCode ; - mmhMsg.bodyptr = teardownRspMsg ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - - return ; - -} - -/* - * Send Link start RSP back to SME after link is setup or failed - */ -void limSendSmeTdlsLinkStartRsp(tpAniSirGlobal pMac, - tSirResultCodes statusCode, - tSirMacAddr peerMac, - tANI_U16 msgType) -{ - tSirMsgQ mmhMsg = {0} ; - tSirTdlsLinksetupRsp *setupRspMsg = NULL ; - tANI_U8 status = eHAL_STATUS_SUCCESS ; - - mmhMsg.type = msgType ; - - setupRspMsg = vos_mem_malloc(sizeof(tSirTdlsLinksetupRsp)); - if ( NULL == setupRspMsg ) - { - VOS_ASSERT(0) ; - } - - vos_mem_copy( setupRspMsg->peerMac, (tANI_U8 *)peerMac, - sizeof(tSirMacAddr)) ; - setupRspMsg->statusCode = statusCode ; - mmhMsg.bodyptr = setupRspMsg ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - - return ; -} - -/* - * Send TDLS discovery RSP back to SME - */ -void limSendSmeTdlsDisRsp(tpAniSirGlobal pMac, tSirResultCodes statusCode, - tANI_U16 msgType) -{ - tSirMsgQ mmhMsg = {0} ; - tSirTdlsDisRsp *tdlsDisRsp = NULL ; - - mmhMsg.type = msgType ; - - if(eSIR_SME_SUCCESS == statusCode) - { - tANI_U8 tdlsStaCount = pMac->lim.gLimTdlsDisStaCount ; - - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("no of TDLS STA discovered: %d"), tdlsStaCount) ; - tdlsDisRsp = tdlsPrepareTdlsDisRsp(pMac, tdlsDisRsp, tdlsStaCount) ; - - if(tdlsDisRsp) - { - tdlsDisRsp->numDisSta = tdlsStaCount ; - } - else - { - limLog(pMac, LOGP, FL("fatal failure for TDLS DIS RSP")); - VOS_ASSERT(0) ; - return ; - } - /* all Discovery STA is processed */ - pMac->lim.gLimTdlsDisStaCount = 0 ; - } - else - { - tdlsDisRsp = tdlsPrepareTdlsDisRsp(pMac, tdlsDisRsp, 0) ; - } - - tdlsDisRsp->statusCode = statusCode ; - mmhMsg.bodyptr = tdlsDisRsp ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - - return ; -} - -/* - * Once Link is setup with PEER, send Add STA ind to SME - */ -static eHalStatus limSendSmeTdlsAddPeerInd(tpAniSirGlobal pMac, - tANI_U8 sessionId, tDphHashNode *pStaDs, tANI_U8 status) -{ - tSirMsgQ mmhMsg = {0} ; - tSirTdlsPeerInd *peerInd = NULL ; - mmhMsg.type = eWNI_SME_ADD_TDLS_PEER_IND ; - - peerInd = vos_mem_malloc(sizeof(tSirTdlsPeerInd)); - if ( NULL == peerInd ) - { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) - return eSIR_FAILURE; - } - - vos_mem_copy( peerInd->peerMac, - (tANI_U8 *) pStaDs->staAddr, sizeof(tSirMacAddr)); - peerInd->sessionId = sessionId; - peerInd->staId = pStaDs->staIndex ; - peerInd->ucastSig = pStaDs->ucUcastSig ; - peerInd->bcastSig = pStaDs->ucBcastSig ; - peerInd->length = sizeof(tSmeIbssPeerInd) ; - - mmhMsg.bodyptr = peerInd ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - - return eSIR_SUCCESS ; - -} - -/* - * Once link is teardown, send Del Peer Ind to SME - */ -static eHalStatus limSendSmeTdlsDelPeerInd(tpAniSirGlobal pMac, - tANI_U8 sessionId, tDphHashNode *pStaDs, tANI_U8 status) -{ - tSirMsgQ mmhMsg = {0} ; - tSirTdlsPeerInd *peerInd = NULL ; - mmhMsg.type = eWNI_SME_DELETE_TDLS_PEER_IND ; - - peerInd = vos_mem_malloc(sizeof(tSirTdlsPeerInd)); - if ( NULL == peerInd ) - { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) - return eSIR_FAILURE; - } + /* TDLS Dummy AddSTA does not have qosInfo , is it OK ?? + */ + pStaDs->qos.capability.qosInfo = (*(tSirMacQosInfoStation *) &pTdlsAddStaReq->uapsd_queues); - vos_mem_copy( peerInd->peerMac, - (tANI_U8 *) pStaDs->staAddr, sizeof(tSirMacAddr)); - peerInd->sessionId = sessionId; - peerInd->staId = pStaDs->staIndex ; - peerInd->ucastSig = pStaDs->ucUcastSig ; - peerInd->bcastSig = pStaDs->ucBcastSig ; - peerInd->length = sizeof(tSmeIbssPeerInd) ; + /* populate matching rate set */ - mmhMsg.bodyptr = peerInd ; + /* TDLS Dummy AddSTA does not have HTCap,VHTCap,Rates info , is it OK ?? + */ + limTdlsPopulateMatchingRateSet(pMac, pStaDs, pTdlsAddStaReq->supported_rates, + pTdlsAddStaReq->supported_rates_length, + (tANI_U8 *)pTdlsAddStaReq->htCap.suppMcsSet, + &pStaDs->mlmStaContext.propRateSet, + psessionEntry, pVhtCaps); - //peerInd->statusCode = status ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - return eSIR_SUCCESS ; + /* TDLS Dummy AddSTA does not have right capability , is it OK ?? + */ + pStaDs->mlmStaContext.capabilityInfo = ( *(tSirMacCapabilityInfo *) &pTdlsAddStaReq->capability); + return ; } /* - * Send Link setup Ind to SME, This is the case where, link setup is - * initiated by peer STA + * Add STA for TDLS setup procedure */ -static eHalStatus limSendSmeTdlsLinkSetupInd(tpAniSirGlobal pMac, - tSirMacAddr peerMac, tANI_U8 status) +static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, + tSirTdlsAddStaReq *pAddStaReq, + tpPESession psessionEntry) { - tSirMsgQ mmhMsg = {0} ; - tSirTdlsLinkSetupInd *setupInd = NULL ; + tpDphHashNode pStaDs = NULL ; + tSirRetStatus status = eSIR_SUCCESS ; + tANI_U16 aid = 0 ; - mmhMsg.type = eWNI_SME_TDLS_LINK_START_IND ; - setupInd = vos_mem_malloc(sizeof(tSirTdlsLinkSetupInd)); - if ( NULL == setupInd ) + pStaDs = dphLookupHashEntry(pMac, pAddStaReq->peerMac, &aid, + &psessionEntry->dph.dphHashTable); + if(NULL == pStaDs) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) - return eSIR_FAILURE; - } - - vos_mem_copy( setupInd->peerMac, - (tANI_U8 *) peerMac, sizeof(tSirMacAddr)); - setupInd->length = sizeof(tSirTdlsLinkSetupInd); - setupInd->statusCode = status ; - mmhMsg.bodyptr = setupInd ; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - - return eSIR_SUCCESS ; - -} + aid = limAssignPeerIdx(pMac, psessionEntry) ; -/* - * Setup RSP timer handler - */ -void limTdlsLinkSetupRspTimerHandler(void *pMacGlobal, tANI_U32 timerId) -{ + if( !aid ) + { + limLog(pMac, LOGE, FL("No more free AID for peer " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pAddStaReq->peerMac)); + return eSIR_FAILURE; + } - tANI_U32 statusCode; - tSirMsgQ msg; - tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; + /* Set the aid in peerAIDBitmap as it has been assigned to TDLS peer */ + SET_PEER_AID_BITMAP(psessionEntry->peerAIDBitmap, aid); - /* Prepare and post message to LIM Message Queue */ + limLog(pMac, LOG1, FL("Aid = %d, for peer =" MAC_ADDRESS_STR), + aid, MAC_ADDR_ARRAY(pAddStaReq->peerMac)); + pStaDs = dphGetHashEntry(pMac, aid, &psessionEntry->dph.dphHashTable); - msg.type = SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT; - msg.bodyptr = NULL ; - msg.bodyval = timerId ; + if (pStaDs) + { + (void) limDelSta(pMac, pStaDs, false /*asynchronous*/, psessionEntry); + limDeleteDphHashEntry(pMac, pStaDs->staAddr, aid, psessionEntry); + } - if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) - limLog(pMac, LOGE, - FL("posting message %X to LIM failed, reason=%d"), - msg.type, statusCode); - return ; -} + pStaDs = dphAddHashEntry(pMac, pAddStaReq->peerMac, aid, + &psessionEntry->dph.dphHashTable) ; -/* - * Link setup CNF timer - */ -void limTdlsLinkSetupCnfTimerHandler(void *pMacGlobal, tANI_U32 timerId) -{ + if(NULL == pStaDs) + { + limLog(pMac, LOGE, FL("add hash entry failed")); + VOS_ASSERT(0) ; + return eSIR_FAILURE; + } + } - tANI_U32 statusCode; - tSirMsgQ msg; - tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; + limTdlsUpdateHashNodeInfo(pMac, pStaDs, pAddStaReq, psessionEntry) ; - // Prepare and post message to LIM Message Queue + pStaDs->staType = STA_ENTRY_TDLS_PEER ; - msg.type = SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT; - msg.bodyptr = NULL ; - msg.bodyval = timerId ; + status = limAddSta(pMac, pStaDs, (pAddStaReq->tdlsAddOper == TDLS_OPER_UPDATE) ? true: false, psessionEntry); - if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) - limLog(pMac, LOGE, - FL("posting message %X to LIM failed, reason=%d"), - msg.type, statusCode); - return ; + if(eSIR_SUCCESS != status) + { + /* should not fail */ + VOS_ASSERT(0) ; + } + return status ; } /* - * start TDLS timer + * Del STA, after Link is teardown or discovery response sent on direct link */ -void limStartTdlsTimer(tpAniSirGlobal pMac, tANI_U8 sessionId, TX_TIMER *timer, - tANI_U32 timerId, tANI_U16 timerType, tANI_U32 timerMsg) +static tpDphHashNode limTdlsDelSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, + tpPESession psessionEntry) { - tANI_U32 cfgValue = (timerMsg == SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT) - ? WNI_CFG_TDLS_LINK_SETUP_RSP_TIMEOUT - : WNI_CFG_TDLS_LINK_SETUP_CNF_TIMEOUT ; - - void *timerFunc = (timerMsg == SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT) - ? (limTdlsLinkSetupRspTimerHandler) - : limTdlsLinkSetupCnfTimerHandler ; - - /* TODO: Read timer vals from CFG */ + tSirRetStatus status = eSIR_SUCCESS ; + tANI_U16 peerIdx = 0 ; + tpDphHashNode pStaDs = NULL ; + + pStaDs = dphLookupHashEntry(pMac, peerMac, &peerIdx, + &psessionEntry->dph.dphHashTable) ; - cfgValue = SYS_MS_TO_TICKS(cfgValue); - /* - * create TDLS discovery response wait timer and activate it - */ - if (tx_timer_create(timer, "TDLS link setup timers", timerFunc, - timerId, cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) + if(pStaDs) { - limLog(pMac, LOGP, - FL("could not create TDLS discovery response wait timer")); - return; - } - - //assign appropriate sessionId to the timer object - timer->sessionId = sessionId; - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, - eLIM_TDLS_DISCOVERY_RSP_WAIT)); - if (tx_timer_activate(timer) != TX_SUCCESS) - { - limLog(pMac, LOGP, FL("TDLS link setup timer activation failed!")); - return ; + limLog(pMac, LOG1, FL("DEL STA peer MAC: "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pStaDs->staAddr)); + limLog(pMac, LOG1, FL("STA type = %x, sta idx = %x"), + pStaDs->staType, + pStaDs->staIndex); + limDeleteBASessions(pMac, psessionEntry, BA_BOTH_DIRECTIONS, + eSIR_MAC_PEER_TIMEDOUT_REASON); + status = limDelSta(pMac, pStaDs, false, psessionEntry) ; } - - return ; - + + return pStaDs ; } -#endif - + /* * Once Link is setup with PEER, send Add STA ind to SME */ @@ -4925,7 +2726,7 @@ static eHalStatus limSendSmeTdlsAddStaRsp(tpAniSirGlobal pMac, addStaRsp = vos_mem_malloc(sizeof(tSirTdlsAddStaRsp)); if ( NULL == addStaRsp ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return eSIR_FAILURE; } @@ -4969,15 +2770,14 @@ eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, tANI_U16 aid = 0 ; SET_LIM_PROCESS_DEFD_MESGS(pMac, true); - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsAddStaRsp: staIdx=%d, staMac="MAC_ADDRESS_STR), pAddStaParams->staIdx, - MAC_ADDR_ARRAY(pAddStaParams->staMac)); + limLog(pMac, LOG1, FL("staIdx=%d, staMac="MAC_ADDRESS_STR), + pAddStaParams->staIdx, + MAC_ADDR_ARRAY(pAddStaParams->staMac)); if (pAddStaParams->status != eHAL_STATUS_SUCCESS) { VOS_ASSERT(0) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Add sta failed ")) ; + limLog(pMac, LOGE, FL("Add sta failed ")); status = eSIR_FAILURE; goto add_sta_error; } @@ -4986,8 +2786,7 @@ eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, &psessionEntry->dph.dphHashTable); if(NULL == pStaDs) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("pStaDs is NULL ")) ; + limLog(pMac, LOGE, FL("pStaDs is NULL ")); status = eSIR_FAILURE; goto add_sta_error; } @@ -4998,42 +2797,6 @@ eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, pStaDs->ucBcastSig = pAddStaParams->ucBcastSig; pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; pStaDs->valid = 1 ; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - status = limSendSmeTdlsAddPeerInd(pMac, psessionEntry->smeSessionId, - pStaDs, eSIR_SUCCESS ) ; - if(eSIR_FAILURE == status) - { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Peer IND msg to SME failed")) ; - vos_mem_free( pAddStaParams ); - return eSIR_FAILURE ; - } - - /* - * Now, there is two things a) ADD STA RSP for ADD STA request sent - * after recieving discovery request from Peer. - * now we have to send discovery response, if there is any pending - * discovery equest.. - */ - do - { - tSirTdlsPeerInfo *peerInfo = limTdlsFindDisPeer(pMac, - pAddStaParams->staMac) ; - - - if(peerInfo) - { - /* - * send TDLS discovery response frame on direct link, state machine - * is rolling.., once discovery response is get Acked, we will - * send response to SME based on TxComplete callback results - */ - limSendTdlsDisRspFrame(pMac, peerInfo->peerMac, peerInfo->dialog, - psessionEntry, NULL, 0); - peerInfo->tdlsPeerState = TDLS_DIS_RSP_SENT_WAIT_STATE ; - } - } while(0) ; -#endif add_sta_error: status = limSendSmeTdlsAddStaRsp(pMac, psessionEntry->smeSessionId, pAddStaParams->staMac, pAddStaParams->updateSta, pStaDs, status) ; @@ -5048,7 +2811,7 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, { tANI_U32 numChans = WNI_CFG_VALID_CHANNEL_LIST_LEN; tANI_U8 validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN]; - tANI_U8 i; + tANI_U8 i, j; tANI_U8 op_class; if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, validChan, &numChans) != eSIR_SUCCESS) @@ -5057,17 +2820,29 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, * Could not get Valid channel list from CFG. * Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Valid channel list")); + limLog(pMac, LOGE, FL("could not retrieve valid channel list")); + return; } suppChannels->num_bands = (tANI_U8) numChans; - for ( i = 0U; i < suppChannels->num_bands; i++) + for ( i = 0U, j = 0U; i < suppChannels->num_bands && + j < LIM_MAX_BANDS; i++) { - suppChannels->bands[i][0] = validChan[i]; - suppChannels->bands[i][1] = 1; + /* don't populate dfs channels in supported channels ie */ + if (!(NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(validChan[i]))) { + suppChannels->bands[j][0] = validChan[i]; + suppChannels->bands[j][1] = 1; + /* store tdls self supported channels */ + tdlsSelfSupportedChannels[j] = validChan[i]; + j++; + } } + /* update the channel list with new length */ + suppChannels->num_bands = j; suppChannels->present = 1 ; + /* store tdls self supported channels new length */ + tdlsSelfNumChans = j; + /*Get present operating class based on current operating channel*/ op_class = limGetOPClassFromChannel( pMac->scan.countryCodeCurrent, @@ -5075,14 +2850,19 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, psessionEntry->htSecondaryChannelOffset); if (op_class == 0) { - PELOGE(limLog(pMac, LOGE, FL("Present Operating class is Wrong!!!"));) + limLog(pMac, LOGE, + FL("Present Operating class is wrong, countryCodeCurrent: %s, currentOperChannel: %d, htSecondaryChannelOffset: %d"), + pMac->scan.countryCodeCurrent, + psessionEntry->currentOperChannel, + psessionEntry->htSecondaryChannelOffset); } else { - PELOGE(limLog(pMac, LOG1, FL("Present Operating channel=%d offset=%d class=%d"), - psessionEntry->currentOperChannel, - psessionEntry->htSecondaryChannelOffset, - op_class);) + limLog(pMac, LOG1, + FL("Present Operating channel=%d offset=%d class=%d"), + psessionEntry->currentOperChannel, + psessionEntry->htSecondaryChannelOffset, + op_class); } suppOperClasses->present = 1; suppOperClasses->classes[0] = op_class; @@ -5134,88 +2914,20 @@ void PopulateDot11fLinkIden(tpAniSirGlobal pMac, tpPESession psessionEntry, void PopulateDot11fTdlsExtCapability(tpAniSirGlobal pMac, tDot11fIEExtCap *extCapability) { - extCapability->TDLSPeerPSMSupp = PEER_PSM_SUPPORT ; - extCapability->TDLSPeerUAPSDBufferSTA = pMac->lim.gLimTDLSBufStaEnabled; - extCapability->TDLSChannelSwitching = pMac->lim.gLimTDLSOffChannelEnabled ; - extCapability->TDLSSupport = TDLS_SUPPORT ; - extCapability->TDLSProhibited = TDLS_PROHIBITED ; - extCapability->TDLSChanSwitProhibited = TDLS_CH_SWITCH_PROHIBITED ; - extCapability->present = 1 ; - return ; -} - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Public Action frame common processing - * This Function will be moved/merged to appropriate place - * once other public action frames (particularly 802.11k) - * is in place - */ -void limProcessTdlsPublicActionFrame(tpAniSirGlobal pMac, tANI_U32 *pBd, - tpPESession psessionEntry) -{ - tANI_U32 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd) ; - tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd) ; - tANI_S8 rssi = (tANI_S8)WDA_GET_RX_RSSI_DB(pBd) ; - - limProcessTdlsDisRspFrame(pMac, pBody, frameLen, rssi, psessionEntry) ; - return ; -} - -eHalStatus limTdlsPrepareSetupReqFrame(tpAniSirGlobal pMac, - tLimTdlsLinkSetupInfo *linkSetupInfo, - tANI_U8 dialog, tSirMacAddr peerMac, - tpPESession psessionEntry) -{ - tLimTdlsLinkSetupPeer *setupPeer = NULL ; + struct s_ext_cap *p_ext_cap = (struct s_ext_cap *)extCapability->bytes; - /* - * we allocate the TDLS setup Peer Memory here, we will free'd this - * memory after teardown, if the link is successfully setup or - * free this memory if any timeout is happen in link setup procedure - */ - - setupPeer = vos_mem_malloc(sizeof( tLimTdlsLinkSetupPeer )); - if ( NULL == setupPeer ) - { - limLog( pMac, LOGP, - FL( "Unable to allocate memory during ADD_STA" )); - VOS_ASSERT(0) ; - return eSIR_MEM_ALLOC_FAILED; - } - setupPeer->dialog = dialog ; - setupPeer->tdls_prev_link_state = setupPeer->tdls_link_state ; - setupPeer->tdls_link_state = TDLS_LINK_SETUP_START_STATE ; + p_ext_cap->TDLSPeerPSMSupp = PEER_PSM_SUPPORT ; + p_ext_cap->TDLSPeerUAPSDBufferSTA = pMac->lim.gLimTDLSBufStaEnabled; + p_ext_cap->TDLSChannelSwitching = pMac->lim.gLimTDLSOffChannelEnabled ; + p_ext_cap->TDLSSupport = TDLS_SUPPORT ; + p_ext_cap->TDLSProhibited = TDLS_PROHIBITED ; + p_ext_cap->TDLSChanSwitProhibited = TDLS_CH_SWITCH_PROHIBITED ; - /* TDLS_sessionize: remember sessionId for future */ - setupPeer->tdls_sessionId = psessionEntry->peSessionId; - setupPeer->tdls_bIsResponder = 1; + extCapability->present = 1; + extCapability->num_bytes = lim_compute_ext_cap_ie_length(extCapability); - /* - * we only populate peer MAC, so it can assit us to find the - * TDLS peer after response/or after response timeout - */ - vos_mem_copy(setupPeer->peerMac, peerMac, - sizeof(tSirMacAddr)) ; - /* format TDLS discovery request frame and transmit it */ - limSendTdlsLinkSetupReqFrame(pMac, peerMac, dialog, psessionEntry, NULL, 0) ; - - limStartTdlsTimer(pMac, psessionEntry->peSessionId, - &setupPeer->gLimTdlsLinkSetupRspTimeoutTimer, - (tANI_U32)setupPeer->peerMac, - WNI_CFG_TDLS_LINK_SETUP_RSP_TIMEOUT, - SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT) ; - /* update setup peer list */ - setupPeer->next = linkSetupInfo->tdlsLinkSetupList ; - linkSetupInfo->tdlsLinkSetupList = setupPeer ; - - /* in case of success, eWNI_SME_TDLS_LINK_START_RSP is sent back to - * SME later when TDLS setup cnf TX complete is successful. --> see - * limTdlsSetupCnfTxComplete() - */ - return eSIR_SUCCESS ; + return ; } -#endif /* * Process Send Mgmt Request from SME and transmit to AP. @@ -5229,15 +2941,14 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, tANI_U8 sessionId; tSirResultCodes resultCode = eSIR_SME_INVALID_PARAMETERS; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("Send Mgmt Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pSendMgmtReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pSendMgmtReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pSendMgmtReq->sessionId); goto lim_tdls_send_mgmt_error; } @@ -5258,16 +2969,15 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "send mgmt received in invalid LIMsme " - "state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, FL("send mgmt received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_send_mgmt_error; } switch( pSendMgmtReq->reqType ) { case SIR_MAC_TDLS_DIS_REQ: - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - "Transmit Discovery Request Frame") ; + limLog(pMac, LOG1, FL("Transmit Discovery Request Frame")); /* format TDLS discovery request frame and transmit it */ limSendTdlsDisReqFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry) ; @@ -5275,6 +2985,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_DIS_RSP: { + limLog(pMac, LOG1, FL("Transmit Discovery Response Frame")); //Send a response mgmt action frame limSendTdlsDisRspFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, @@ -5285,6 +2996,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_REQ: { + limLog(pMac, LOG1, FL("Transmit Setup Request Frame")); limSendTdlsLinkSetupReqFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -5293,6 +3005,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_RSP: { + limLog(pMac, LOG1, FL("Transmit Setup Response Frame")); limSendTdlsSetupRspFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, pSendMgmtReq->statusCode, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -5301,6 +3014,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_CNF: { + limLog(pMac, LOG1, FL("Transmit Setup Confirm Frame")); limSendTdlsLinkSetupCnfFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, pSendMgmtReq->peerCapability, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); resultCode = eSIR_SME_SUCCESS; @@ -5308,6 +3022,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_TEARDOWN: { + limLog(pMac, LOG1, FL("Transmit Teardown Frame")); limSendTdlsTeardownFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->statusCode, pSendMgmtReq->responder, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -5356,7 +3071,7 @@ void limSendSmeTdlsLinkEstablishReqRsp(tpAniSirGlobal pMac, pTdlsLinkEstablishReqRsp = vos_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp)); if ( NULL == pTdlsLinkEstablishReqRsp ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return ; } pTdlsLinkEstablishReqRsp->statusCode = status ; @@ -5419,7 +3134,7 @@ static eHalStatus limSendSmeTdlsDelStaRsp(tpAniSirGlobal pMac, pDelSta = vos_mem_malloc(sizeof(tSirTdlsDelStaRsp)); if ( NULL == pDelSta ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return eSIR_FAILURE; } @@ -5459,15 +3174,14 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, tpPESession psessionEntry; tANI_U8 sessionId; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("TDLS Add STA Request Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pAddStaReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pAddStaReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pAddStaReq->sessionId); goto lim_tdls_add_sta_error; } @@ -5488,8 +3202,9 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "send mgmt received in invalid LIMsme " - "state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, + FL("Add STA received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_add_sta_error; } @@ -5498,7 +3213,7 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, /* To start with, send add STA request to HAL */ if (eSIR_FAILURE == limTdlsSetupAddSta(pMac, pAddStaReq, psessionEntry)) { - limLog(pMac, LOGE, "%s: Add TDLS Station request failed ", __func__); + limLog(pMac, LOGE, FL("Add TDLS Station request failed")); goto lim_tdls_add_sta_error; } return eSIR_SUCCESS; @@ -5521,15 +3236,14 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, tANI_U8 sessionId; tpDphHashNode pStaDs = NULL ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("TDLS Delete STA Request Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pDelStaReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pDelStaReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pDelStaReq->sessionId); limSendSmeTdlsDelStaRsp(pMac, pDelStaReq->sessionId, pDelStaReq->peerMac, NULL, eSIR_FAILURE) ; return eSIR_FAILURE; @@ -5552,8 +3266,8 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "Del Sta received in invalid LIMsme state (%d)", - psessionEntry->limSmeState); + limLog(pMac, LOGE, FL("Del Sta received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_del_sta_error; } @@ -5629,15 +3343,14 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, tANI_U16 peerIdx = 0 ; tpDphHashNode pStaDs = NULL ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("Link Establish Request Recieved")) ; if((psessionEntry = peFindSessionByBssid(pMac, pTdlsLinkEstablishReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pTdlsLinkEstablishReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pTdlsLinkEstablishReq->sessionId); limSendSmeTdlsLinkEstablishReqRsp(pMac, pTdlsLinkEstablishReq->sessionId, pTdlsLinkEstablishReq->peerMac, NULL, eSIR_FAILURE) ; return eSIR_FAILURE; @@ -5660,8 +3373,9 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "TDLS Link Establish Request received in " - "invalid LIMsme state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, + FL("TDLS Link Establish Request received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_link_establish_error; } /*TODO Sunil , TDLSPeer Entry has the STA ID , Use it */ @@ -5669,15 +3383,15 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, &psessionEntry->dph.dphHashTable) ; if ( NULL == pStaDs ) { - limLog( pMac, LOGE, FL( "pStaDs is NULL" )); + limLog(pMac, LOGE, FL( "pStaDs is NULL")); goto lim_tdls_link_establish_error; } pMsgTdlsLinkEstablishReq = vos_mem_malloc(sizeof( tTdlsLinkEstablishParams )); if ( NULL == pMsgTdlsLinkEstablishReq ) { - limLog( pMac, LOGE, - FL( "Unable to allocate memory TDLS Link Establish Request" )); + limLog(pMac, LOGE, + FL("Unable to allocate memory TDLS Link Establish Request")); return eSIR_MEM_ALLOC_FAILED; } @@ -5688,37 +3402,37 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, pMsgTdlsLinkEstablishReq->uapsdQueues = pTdlsLinkEstablishReq->uapsdQueues; pMsgTdlsLinkEstablishReq->maxSp = pTdlsLinkEstablishReq->maxSp; pMsgTdlsLinkEstablishReq->isBufsta = pTdlsLinkEstablishReq->isBufSta; - pMsgTdlsLinkEstablishReq->isOffChannelSupported = - pTdlsLinkEstablishReq->isOffChannelSupported; + if (psessionEntry->tdlsChanSwitProhibited) { - pMsgTdlsLinkEstablishReq->isOffChannelSupported = 3; + /* If channel switch is prohibited by AP then dut can either + * send a switch channel request with failure status or it can + * ignore the request without sending the response. + * isOffChannelSupported = 0 disables the TDLS off-channel and + * if off-channel support is disabled then FW ignores switch + * channel request sent by TDLS peer */ + pMsgTdlsLinkEstablishReq->isOffChannelSupported = 0; limLog(pMac, LOG1, FL("Channel Switch Prohibited by AP")); } else { - pMsgTdlsLinkEstablishReq->isOffChannelSupported = 1; + pMsgTdlsLinkEstablishReq->isOffChannelSupported = + pTdlsLinkEstablishReq->isOffChannelSupported; } + if ((pTdlsLinkEstablishReq->supportedChannelsLen > 0) && (pTdlsLinkEstablishReq->supportedChannelsLen <= SIR_MAC_MAX_SUPP_CHANNELS)) { - tANI_U32 selfNumChans = WNI_CFG_VALID_CHANNEL_LIST_LEN; - tANI_U8 selfSupportedChannels[WNI_CFG_VALID_CHANNEL_LIST_LEN]; - if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, - selfSupportedChannels, &selfNumChans) != eSIR_SUCCESS) + /* check self supported channels and pass them to FW */ + if ((tdlsSelfNumChans > 0) && + (tdlsSelfNumChans < LIM_TDLS_MAX_NON_DFS_CHANNELS)) { - /** - * Could not get Valid channel list from CFG. - * Log error. - */ - limLog(pMac, LOGP, - FL("could not retrieve Valid channel list")); - } - limTdlsGetIntersection(selfSupportedChannels, selfNumChans, + limTdlsGetIntersection(tdlsSelfSupportedChannels, tdlsSelfNumChans, pTdlsLinkEstablishReq->supportedChannels, pTdlsLinkEstablishReq->supportedChannelsLen, pMsgTdlsLinkEstablishReq->validChannels, &pMsgTdlsLinkEstablishReq->validChannelsLen); + } } vos_mem_copy(pMsgTdlsLinkEstablishReq->validOperClasses, pTdlsLinkEstablishReq->supportedOperClasses, pTdlsLinkEstablishReq->supportedOperClassesLen); @@ -5751,7 +3465,7 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) if (NULL == psessionEntry) { - PELOGE(limLog(pMac, LOGE, FL("NULL psessionEntry"));) + limLog(pMac, LOGE, FL("NULL psessionEntry")); return eSIR_FAILURE; } @@ -5767,8 +3481,8 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) if (NULL != pStaDs) { - PELOGE(limLog(pMac, LOGE, FL("Deleting "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pStaDs->staAddr));); + limLog(pMac, LOGE, FL("Deleting "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pStaDs->staAddr)); limSendDeauthMgmtFrame(pMac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, pStaDs->staAddr, psessionEntry, FALSE); @@ -5785,6 +3499,53 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) } +tANI_U8 limGetOffChMaxBwOffsetFromChannel(tANI_U8 *country, + tANI_U8 channel, + tANI_U8 peerVHTCapability) +{ + op_class_map_t *class = NULL; + tANI_U16 i = 0; + offset_t offset = BW20, max_allowed = BW80; + + if ((TRUE == peerVHTCapability) && + IS_FEATURE_SUPPORTED_BY_FW(DOT11AC) && + IS_FEATURE_SUPPORTED_BY_DRIVER(DOT11AC)) + max_allowed = BW80; + else + max_allowed = BW40MINUS; + + if (VOS_TRUE == vos_mem_compare(country,"US", 2)) { + + class = us_op_class; + + } else if (VOS_TRUE == vos_mem_compare(country,"EU", 2)) { + + class = euro_op_class; + + } else if (VOS_TRUE == vos_mem_compare(country,"JP", 2)) { + + class = japan_op_class; + + } else { + + class = global_op_class; + + } + + while (class->op_class) + { + for (i=0; (i < 25 && class->channels[i]); i++) + { + if (channel == class->channels[i] && class->offset <= max_allowed) + offset = class->offset; + } + class++; + } + + return offset; +} + + tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, tANI_U8 channel, tANI_U8 offset) @@ -5814,7 +3575,7 @@ tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, { if ((offset == class->offset) || (offset == BWALL)) { - for (i=0; (i < 15 && class->channels[i]); i++) + for (i=0; (i < 25 && class->channels[i]); i++) { if (channel == class->channels[i]) return class->op_class; @@ -6020,6 +3781,34 @@ tSirRetStatus limProcesSmeTdlsChanSwitchReq(tpAniSirGlobal pMac, vos_mem_set( (tANI_U8 *)pMsgTdlsChanSwitch, sizeof(tpTdlsChanSwitchParams), 0); + /* if channel bw offset is not set, + send maximum supported offset in the band */ + if (pTdlsChanSwitch->tdlsOffChBwOffset == 0) + { + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, + ("Set TDLS channel Bw Offset")); + + if ((pTdlsChanSwitch->tdlsOffCh >= 1) && + (pTdlsChanSwitch->tdlsOffCh <= 14)) + { + pTdlsChanSwitch->tdlsOffChBwOffset = BW20; + } + else if ((pTdlsChanSwitch->tdlsOffCh >= 36) && + (pTdlsChanSwitch->tdlsOffCh <= 169)) + { + pTdlsChanSwitch->tdlsOffChBwOffset = + limGetOffChMaxBwOffsetFromChannel( + pMac->scan.countryCodeCurrent, + pTdlsChanSwitch->tdlsOffCh, + pStaDs->mlmStaContext.vhtCapability); + } + } + else + { + /* Channel Bandwidth Offset is set through iwpriv ioctl */ + (pTdlsChanSwitch->tdlsOffChBwOffset)--; + } + pMsgTdlsChanSwitch->staIdx = pStaDs->staIndex; pMsgTdlsChanSwitch->tdlsOffCh = pTdlsChanSwitch->tdlsOffCh; pMsgTdlsChanSwitch->tdlsOffChBwOffset = pTdlsChanSwitch->tdlsOffChBwOffset; @@ -6028,6 +3817,7 @@ tSirRetStatus limProcesSmeTdlsChanSwitchReq(tpAniSirGlobal pMac, pMac->scan.countryCodeCurrent, pTdlsChanSwitch->tdlsOffCh, pTdlsChanSwitch->tdlsOffChBwOffset); + if(pMsgTdlsChanSwitch->operClass == 0) { @@ -6040,13 +3830,16 @@ tSirRetStatus limProcesSmeTdlsChanSwitchReq(tpAniSirGlobal pMac, { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - "%s: TDLS Channel Switch params: staIdx %d class %d ch %d bw %d mode %d", + "%s: TDLS Channel Switch params: staIdx %d class %d ch %d bw %d" + " mode %d country code %c%c", __func__, pMsgTdlsChanSwitch->staIdx, pMsgTdlsChanSwitch->operClass, pMsgTdlsChanSwitch->tdlsOffCh, pMsgTdlsChanSwitch->tdlsOffChBwOffset, - pMsgTdlsChanSwitch->tdlsSwMode); + pMsgTdlsChanSwitch->tdlsSwMode, + pMac->scan.countryCodeCurrent[0], + pMac->scan.countryCodeCurrent[1]); } msg.type = WDA_SET_TDLS_CHAN_SWITCH_REQ; @@ -6069,3 +3862,82 @@ tSirRetStatus limProcesSmeTdlsChanSwitchReq(tpAniSirGlobal pMac, return eSIR_FAILURE; } +/* + * Set 20_40 BSS Coex IE in TDLS frames. + */ +tSirRetStatus limProcessSmeSetTdls2040BSSCoexReq(tpAniSirGlobal pMac, + tANI_U32 *pMsgBuf) +{ + tAniSetTdls2040BSSCoex *pmsg = NULL; + pmsg = (tAniSetTdls2040BSSCoex*) pMsgBuf ; + + if (NULL != pmsg) { + pMac->lim.EnableTdls2040BSSCoexIE = pmsg->SetTdls2040BSSCoex; + } + VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, + "%s: 20_40 BSS Coex IE in TDLS frames " + "pMac->lim.EnableTdls2040BSSCoexIE %d ", __func__, + pMac->lim.EnableTdls2040BSSCoexIE); + + return eSIR_SUCCESS; +} + +tSirRetStatus limProcessSmeDelAllTdlsPeers(tpAniSirGlobal pMac, + tANI_U32 *pMsgBuf) +{ + tSirDelAllTdlsPeers *pMsg = NULL; + tpDphHashNode pStaDs = NULL ; + tpPESession psessionEntry = NULL; + uint8_t sessionId; + int i, aid; + pMsg = (tSirDelAllTdlsPeers*) pMsgBuf ; + + if (pMsg == NULL) { + limLog(pMac, LOGE, FL("NULL pMsg")); + return eSIR_FAILURE; + } + + psessionEntry = peFindSessionByBssid(pMac, pMsg->bssid, &sessionId); + if (NULL == psessionEntry) + { + limLog(pMac, LOGE, FL("NULL psessionEntry")); + return eSIR_FAILURE; + } + + /* Check all the set bit in peerAIDBitmap and delete the + * peer (with that aid) entry from the hash table and add + * the aid in free pool + */ + for (i = 0; i < sizeof(psessionEntry->peerAIDBitmap)/sizeof(tANI_U32); i++) + { + for (aid = 0; aid < (sizeof(tANI_U32) << 3); aid++) + { + if (CHECK_BIT(psessionEntry->peerAIDBitmap[i], aid)) + { + pStaDs = dphGetHashEntry(pMac, + (aid + i*(sizeof(tANI_U32) << 3)), + &psessionEntry->dph.dphHashTable); + if (NULL != pStaDs) + { + limLog(pMac, LOGE, FL("Deleting "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pStaDs->staAddr)); + + limSendDeauthMgmtFrame(pMac, + eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, + pStaDs->staAddr, psessionEntry, + FALSE); + + limTdlsDelSta(pMac, pStaDs->staAddr, psessionEntry); + + dphDeleteHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, + &psessionEntry->dph.dphHashTable); + } + limReleasePeerIdx(pMac, (aid + i*(sizeof(tANI_U32) << 3)), + psessionEntry) ; + CLEAR_BIT(psessionEntry->peerAIDBitmap[i], aid); + } + } + } + + return eSIR_SUCCESS; +} diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limPropExtsUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limPropExtsUtils.c index 80510e1a0449..f4f668a916a9 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limPropExtsUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limPropExtsUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,7 +39,7 @@ * */ #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sirCommon.h" #include "sirDebug.h" #include "utilsApi.h" @@ -103,7 +103,8 @@ limExtractApCapability(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen, sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG3, pIE, ieLen );) if (sirParseBeaconIE(pMac, pBeaconStruct, pIE, (tANI_U32)ieLen) == eSIR_SUCCESS) { - if (pBeaconStruct->wmeInfoPresent || pBeaconStruct->wmeEdcaPresent) + if (pBeaconStruct->wmeInfoPresent || pBeaconStruct->wmeEdcaPresent + || pBeaconStruct->HTCaps.present) LIM_BSS_CAPS_SET(WME, *qosCap); if (LIM_BSS_CAPS_GET(WME, *qosCap) && pBeaconStruct->wsmCapablePresent) LIM_BSS_CAPS_SET(WSM, *qosCap); @@ -117,11 +118,14 @@ limExtractApCapability(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen, #ifdef WLAN_FEATURE_11AC VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, - "***beacon.VHTCaps.present*****=%d",pBeaconStruct->VHTCaps.present); + "***beacon.VHTCaps.present*****=%d BSS_VHT_CAPABLE:%d", + pBeaconStruct->VHTCaps.present, + IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)); VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, "***beacon.SU Beamformer Capable*****=%d",pBeaconStruct->VHTCaps.suBeamFormerCap); - if ( pBeaconStruct->VHTCaps.present && pBeaconStruct->VHTOperation.present) + if (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) + && pBeaconStruct->VHTOperation.present) { psessionEntry->vhtCapabilityPresentInBeacon = 1; psessionEntry->apCenterChan = pBeaconStruct->VHTOperation.chanCenterFreqSeg1; @@ -192,6 +196,12 @@ limExtractApCapability(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen, { psessionEntry->countryInfoPresent = TRUE; } + /* Save the Extended caps from AP in probe resp or beacon */ + if (pBeaconStruct->ExtCap.present) + { + vos_mem_copy(&psessionEntry->ExtCap, &pBeaconStruct->ExtCap, sizeof(tDot11fIEExtCap)); + } + } vos_mem_free(pBeaconStruct); return; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limRoamingAlgo.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limRoamingAlgo.c index 28fa775394a2..4a0f06759fd1 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limRoamingAlgo.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limRoamingAlgo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -37,7 +37,7 @@ * */ -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "limTypes.h" #include "limTimerUtils.h" @@ -152,8 +152,8 @@ void limTriggerBackgroundScan(tpAniSirGlobal pMac) tSirMacAddr bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; tSirBackgroundScanMode backgroundScan; - PELOG1(limLog(pMac, LOG1, FL("Background Scan: %d success, %d consec fail "), - pMac->lim.gLimNumOfBackgroundScanSuccess, pMac->lim.gLimNumOfConsecutiveBkgndScanFailure);) + limLog(pMac, LOG1, FL("Background Scan: %d success, %d consec fail "), + pMac->lim.gLimNumOfBackgroundScanSuccess, pMac->lim.gLimNumOfConsecutiveBkgndScanFailure); if (! limIsBackgroundScanAllowed(pMac)) { diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c index c735bc8f944d..c179fe5dc3c6 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -71,15 +71,17 @@ tANI_U32 limDeactivateMinChannelTimerDuringScan(tpAniSirGlobal pMac) { - if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) && (pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE)) + if ((VOS_TRUE == + tx_timer_running(&pMac->lim.limTimers.gLimMinChannelTimer)) && + (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) && + (pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE)) { /** - * Beacon/Probe Response is received during active scanning. - * Deactivate MIN channel timer if running. - */ - + * Beacon/Probe Response is received during active scanning. + * Deactivate MIN channel timer if running. + */ + limDeactivateAndChangeTimer(pMac,eLIM_MIN_CHANNEL_TIMER); - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_MAX_CHANNEL_TIMER)); if (tx_timer_activate(&pMac->lim.limTimers.gLimMaxChannelTimer) == TX_TIMER_ERROR) { @@ -495,7 +497,7 @@ limCheckAndAddBssDescription(tpAniSirGlobal pMac, */ ieLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - if (ieLen <= SIR_MAC_B_PR_SSID_OFFSET) + if (ieLen <= (SIR_MAC_B_PR_SSID_OFFSET + 2)) { limLog(pMac, LOGP, FL("RX packet has invalid length %d"), ieLen); @@ -516,6 +518,8 @@ limCheckAndAddBssDescription(tpAniSirGlobal pMac, return; } + vos_mem_zero(pBssDescr, frameLen); + // In scan state, store scan result. #if defined WLAN_FEATURE_VOWIFI status = limCollectBssDescription(pMac, &pBssDescr->bssDescription, @@ -545,25 +549,28 @@ limCheckAndAddBssDescription(tpAniSirGlobal pMac, #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) { - limLog(pMac, LOG2, FL(" pHdr->addr1:"MAC_ADDRESS_STR), + limLog(pMac, LOG1, FL(" pHdr->addr1:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->addr1)); - limLog(pMac, LOG2, FL(" pHdr->addr2:"MAC_ADDRESS_STR), + limLog(pMac, LOG1, FL(" pHdr->addr2:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->addr2)); - limLog(pMac, LOG2, FL(" pHdr->addr3:"MAC_ADDRESS_STR), + limLog(pMac, LOG1, FL(" pHdr->addr3:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->addr3)); - limLog( pMac, LOG2, FL("Save this entry in LFR cache")); - status = limLookupNaddLfrHashEntry(pMac, pBssDescr, LIM_HASH_ADD, dontUpdateAll); + limLog( pMac, LOG1, FL("Save this entry in LFR cache")); + status = limLookupNaddLfrHashEntry(pMac, pBssDescr, LIM_HASH_ADD, + dontUpdateAll, ieLen - 2); } else #endif //If it is not scanning, only save unique results if (pMac->lim.gLimReturnUniqueResults || (!fScanning)) { - status = limLookupNaddHashEntry(pMac, pBssDescr, LIM_HASH_UPDATE, dontUpdateAll); + status = limLookupNaddHashEntry(pMac, pBssDescr, LIM_HASH_UPDATE, + dontUpdateAll, ieLen - 2); } else { - status = limLookupNaddHashEntry(pMac, pBssDescr, LIM_HASH_ADD, dontUpdateAll); + status = limLookupNaddHashEntry(pMac, pBssDescr, LIM_HASH_ADD, + dontUpdateAll, ieLen - 2); } if(fScanning) @@ -706,7 +713,7 @@ limInitHashTable(tpAniSirGlobal pMac) eHalStatus limLookupNaddHashEntry(tpAniSirGlobal pMac, tLimScanResultNode *pBssDescr, tANI_U8 action, - tANI_U8 dontUpdateAll) + tANI_U8 dontUpdateAll, tANI_U32 ie_len) { tANI_U8 index, ssidLen = 0; tANI_U8 found = false; @@ -721,6 +728,11 @@ limLookupNaddHashEntry(tpAniSirGlobal pMac, //ieFields start with TLV of SSID IE ssidLen = * ((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1); + if ((ssidLen > ie_len) || (ssidLen > DOT11F_IE_SSID_MAX_LEN)) { + limLog(pMac, LOGE, FL("SSID length %d, IE overall Length %d"), + ssidLen, ie_len); + return eHAL_STATUS_FAILURE; + } pSirCap = (tSirMacCapabilityInfo *)&pBssDescr->bssDescription.capabilityInfo; for (pprev = ptemp; ptemp; pprev = ptemp, ptemp = ptemp->next) @@ -734,6 +746,8 @@ limLookupNaddHashEntry(tpAniSirGlobal pMac, // matching band to update new channel info (vos_chan_to_band(pBssDescr->bssDescription.channelId) == vos_chan_to_band(ptemp->bssDescription.channelId)) && + (*((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1) == + *((tANI_U8 *) &ptemp->bssDescription.ieFields + 1)) && vos_mem_compare( ((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1), ((tANI_U8 *) &ptemp->bssDescription.ieFields + 1), (tANI_U8) (ssidLen + 1)) && @@ -930,9 +944,9 @@ limInitLfrHashTable(tpAniSirGlobal pMac) eHalStatus limLookupNaddLfrHashEntry(tpAniSirGlobal pMac, tLimScanResultNode *pBssDescr, tANI_U8 action, - tANI_U8 dontUpdateAll) + tANI_U8 dontUpdateAll, tANI_U32 ie_len) { - tANI_U8 index, ssidLen = 0; + tANI_U8 index, ssidLen = 0; tLimScanResultNode *ptemp, *pprev; tSirMacCapabilityInfo *pSirCap, *pSirCapTemp; int idx, len; @@ -944,6 +958,11 @@ limLookupNaddLfrHashEntry(tpAniSirGlobal pMac, //ieFields start with TLV of SSID IE ssidLen = * ((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1); + if ((ssidLen > ie_len) || (ssidLen > DOT11F_IE_SSID_MAX_LEN)) { + limLog(pMac, LOGE, FL("SSID length %d, IE overall Length %d"), + ssidLen, ie_len); + return eHAL_STATUS_FAILURE; + } pSirCap = (tSirMacCapabilityInfo *)&pBssDescr->bssDescription.capabilityInfo; for (pprev = ptemp; ptemp; pprev = ptemp, ptemp = ptemp->next) @@ -956,6 +975,8 @@ limLookupNaddLfrHashEntry(tpAniSirGlobal pMac, sizeof(tSirMacAddr))) && //matching BSSID (pBssDescr->bssDescription.channelId == ptemp->bssDescription.channelId) && + (*((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1) == + *((tANI_U8 *) &ptemp->bssDescription.ieFields + 1)) && vos_mem_compare( ((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1), ((tANI_U8 *) &ptemp->bssDescription.ieFields + 1), (tANI_U8) (ssidLen + 1)) && diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h index f9b43a05c09a..684c94c6d53a 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h @@ -44,7 +44,8 @@ tANI_U8 limScanHashFunction(tSirMacAddr); void limInitHashTable(tpAniSirGlobal); eHalStatus - limLookupNaddHashEntry(tpAniSirGlobal, tLimScanResultNode *, tANI_U8, tANI_U8); + limLookupNaddHashEntry(tpAniSirGlobal, tLimScanResultNode *, + tANI_U8, tANI_U8, tANI_U32); void limDeleteHashEntry(tLimScanResultNode *); void limDeleteCachedScanResults(tpAniSirGlobal); void limRestorePreScanState(tpAniSirGlobal); @@ -53,7 +54,8 @@ void limReInitScanResults(tpAniSirGlobal); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD void limInitLfrHashTable(tpAniSirGlobal); eHalStatus - limLookupNaddLfrHashEntry(tpAniSirGlobal, tLimScanResultNode *, tANI_U8, tANI_U8); + limLookupNaddLfrHashEntry(tpAniSirGlobal, tLimScanResultNode *, + tANI_U8, tANI_U8, tANI_U32); void limDeleteLfrHashEntry(tLimScanResultNode *); void limDeleteCachedLfrScanResults(tpAniSirGlobal); void limReInitLfrScanResults(tpAniSirGlobal); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.c index 32251c0a60dc..8c4dad56838a 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,7 +39,7 @@ #include "wniApi.h" #include "sirCommon.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" @@ -50,6 +50,10 @@ #define LIM_SEED_LENGTH 16 +/** + *preauth node timeout value in interval of 10msec + */ +#define LIM_OPENAUTH_TIMEOUT 500 /** * limIsAuthAlgoSupported() @@ -211,7 +215,7 @@ limDeletePreAuthList(tpAniSirGlobal pMac) { pTempNode = pCurrNode->next; - PELOG1(limLog(pMac, LOG1, FL("=====> limDeletePreAuthList "));) + limLog(pMac, LOG1, FL("=====> limDeletePreAuthList ")); limReleasePreAuthNode(pMac, pCurrNode); pCurrNode = pTempNode; @@ -260,7 +264,69 @@ limSearchPreAuthList(tpAniSirGlobal pMac, tSirMacAddr macAddr) return pTempNode; } /*** end limSearchPreAuthList() ***/ +/** + * limDeleteOpenAuthPreAuthNode + * + *FUNCTION: + * This function is called to delete any stale preauth nodes on + * receiving authentication frame and existing preauth nodes + * reached the maximum allowed limit. + * + *LOGIC: + * + *ASSUMPTIONS: + * + *NOTE: + * + * @param pMac - Pointer to Global MAC structure + * + * @return true if any preauthnode deleted else false + */ + +tANI_U8 +limDeleteOpenAuthPreAuthNode(tpAniSirGlobal pMac) +{ + struct tLimPreAuthNode *pPrevNode, *pTempNode, *pFoundNode; + tANI_U8 authNodeFreed = false; + + pTempNode = pPrevNode = pMac->lim.pLimPreAuthList; + + if (pTempNode == NULL) + return authNodeFreed; + while (pTempNode != NULL) + { + if (pTempNode->mlmState == eLIM_MLM_AUTHENTICATED_STATE && + pTempNode->authType == eSIR_OPEN_SYSTEM && + (vos_timer_get_system_ticks() > + (LIM_OPENAUTH_TIMEOUT + pTempNode->timestamp) || + vos_timer_get_system_ticks() < pTempNode->timestamp)) + { + // Found node to be deleted + authNodeFreed = true; + pFoundNode = pTempNode; + if (pMac->lim.pLimPreAuthList == pTempNode) + { + pPrevNode = pMac->lim.pLimPreAuthList = pTempNode = + pFoundNode->next; + } + else + { + pPrevNode->next = pTempNode->next; + pTempNode = pPrevNode->next; + } + + limReleasePreAuthNode(pMac, pFoundNode); + } + else + { + pPrevNode = pTempNode; + pTempNode = pPrevNode->next; + } + } + + return authNodeFreed; +} /** * limAddPreAuthNode @@ -365,10 +431,11 @@ limDeletePreAuthNode(tpAniSirGlobal pMac, tSirMacAddr macAddr) pMac->lim.pLimPreAuthList = pTempNode->next; - PELOG1(limLog(pMac, LOG1, FL("=====> limDeletePreAuthNode : first node to delete"));) - PELOG1(limLog(pMac, LOG1, FL("Release data entry: %x id %d peer "), - pTempNode, pTempNode->authNodeIdx); - limPrintMacAddr(pMac, macAddr, LOG1);) + limLog(pMac, LOG1, FL(" first node to delete")); + limLog(pMac, LOG1, + FL(" Release data entry:%pK idx %d peer: " MAC_ADDRESS_STR), + pTempNode, pTempNode->authNodeIdx, + MAC_ADDR_ARRAY(macAddr)); limReleasePreAuthNode(pMac, pTempNode); return; @@ -386,10 +453,10 @@ limDeletePreAuthNode(tpAniSirGlobal pMac, tSirMacAddr macAddr) pPrevNode->next = pTempNode->next; - PELOG1(limLog(pMac, LOG1, FL("=====> limDeletePreAuthNode : subsequent node to delete")); - limLog(pMac, LOG1, FL("Release data entry: %x id %d peer "), - pTempNode, pTempNode->authNodeIdx); - limPrintMacAddr(pMac, macAddr, LOG1);) + limLog(pMac, LOG1, FL(" subsequent node to delete")); + limLog(pMac, LOG1, + FL("Release data entry: %pK id %d peer: "MAC_ADDRESS_STR), + pTempNode, pTempNode->authNodeIdx, MAC_ADDR_ARRAY(macAddr)); limReleasePreAuthNode(pMac, pTempNode); return; @@ -457,8 +524,13 @@ limRestoreFromAuthState(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U1 sessionEntry->limMlmState = sessionEntry->limPrevMlmState; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, sessionEntry->peSessionId, sessionEntry->limMlmState)); - - + /* Set the authAckStatus status flag as sucess as + * host have received the auth rsp and no longer auth + * retry is needed also cancel the auth rety timer + */ + pMac->authAckStatus = LIM_AUTH_ACK_RCD_SUCCESS; + // 'Change' timer for future activations + limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); // 'Change' timer for future activations limDeactivateAndChangeTimer(pMac, eLIM_AUTH_FAIL_TIMER); @@ -542,7 +614,10 @@ limEncryptAuthFrame(tpAniSirGlobal pMac, tANI_U8 keyId, tANI_U8 *pKey, tANI_U8 * tANI_U8 *pEncrBody, tANI_U32 keyLength) { tANI_U8 seed[LIM_SEED_LENGTH], icv[SIR_MAC_WEP_ICV_LENGTH]; + tANI_U16 frame_len; + frame_len = ((tpSirMacAuthFrameBody)pPlainText)->length + + SIR_MAC_AUTH_FRAME_INFO_LEN + SIR_MAC_CHALLENGE_ID_LEN; keyLength += 3; // Bytes 0-2 of seed is IV @@ -553,15 +628,15 @@ limEncryptAuthFrame(tpAniSirGlobal pMac, tANI_U8 keyId, tANI_U8 *pKey, tANI_U8 * vos_mem_copy((tANI_U8 *) &seed[3], pKey, keyLength - 3); // Compute CRC-32 and place them in last 4 bytes of plain text - limComputeCrc32(icv, pPlainText, sizeof(tSirMacAuthFrameBody)); + limComputeCrc32(icv, pPlainText, frame_len); - vos_mem_copy( pPlainText + sizeof(tSirMacAuthFrameBody), + vos_mem_copy( pPlainText + frame_len, icv, SIR_MAC_WEP_ICV_LENGTH); // Run RC4 on plain text with the seed limRC4(pEncrBody + SIR_MAC_WEP_IV_LENGTH, (tANI_U8 *) pPlainText, seed, keyLength, - LIM_ENCR_AUTH_BODY_LEN - SIR_MAC_WEP_IV_LENGTH); + frame_len + SIR_MAC_WEP_ICV_LENGTH); // Prepare IV pEncrBody[0] = seed[0]; @@ -594,7 +669,7 @@ limEncryptAuthFrame(tpAniSirGlobal pMac, tANI_U8 keyId, tANI_U8 *pKey, tANI_U8 * */ void -limComputeCrc32(tANI_U8 *pDest, tANI_U8 * pSrc, tANI_U8 len) +limComputeCrc32(tANI_U8 *pDest, tANI_U8 * pSrc, tANI_U16 len) { tANI_U32 crc; int i; @@ -681,7 +756,7 @@ limRC4(tANI_U8 *pDest, tANI_U8 *pSrc, tANI_U8 *seed, tANI_U32 keyLength, tANI_U1 { tANI_U8 i = ctx.i; tANI_U8 j = ctx.j; - tANI_U8 len = (tANI_U8) frameLen; + tANI_U16 len = frameLen; while (len-- > 0) { @@ -763,7 +838,7 @@ limDecryptAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pKey, tANI_U8 *pEncrBody, // Compute CRC-32 and place them in last 4 bytes of encrypted body limComputeCrc32(icv, (tANI_U8 *) pPlainBody, - (tANI_U8) (frameLen - SIR_MAC_WEP_ICV_LENGTH)); + (frameLen - SIR_MAC_WEP_ICV_LENGTH)); // Compare RX_ICV with computed ICV for (i = 0; i < SIR_MAC_WEP_ICV_LENGTH; i++) diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.h index 913e34746640..2526f4e4c124 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSecurityUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,6 +42,18 @@ #define LIM_ENCR_AUTH_BODY_LEN (sizeof(tSirMacAuthFrameBody) + \ SIR_MAC_WEP_IV_LENGTH + \ SIR_MAC_WEP_ICV_LENGTH) + +#define LIM_ENCR_AUTH_BODY_LEN_SAP (SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH + \ + SIR_MAC_CHALLENGE_ID_LEN + \ + SIR_MAC_AUTH_FRAME_INFO_LEN + \ + SIR_MAC_WEP_IV_LENGTH + \ + SIR_MAC_WEP_ICV_LENGTH) + +#define LIM_ENCR_AUTH_INFO_LEN (SIR_MAC_AUTH_FRAME_INFO_LEN +\ + SIR_MAC_WEP_IV_LENGTH + \ + SIR_MAC_WEP_ICV_LENGTH + \ + SIR_MAC_CHALLENGE_ID_LEN) + struct tLimPreAuthNode; tANI_U8 limIsAuthAlgoSupported(tpAniSirGlobal, tAniAuthType, tpPESession); @@ -55,10 +67,11 @@ void limDeletePreAuthNode(tpAniSirGlobal, tSirMacAddr); void limReleasePreAuthNode(tpAniSirGlobal pMac, tpLimPreAuthNode pAuthNode); void limRestoreFromAuthState(tpAniSirGlobal, tSirResultCodes, tANI_U16,tpPESession); +tANI_U8 limDeleteOpenAuthPreAuthNode(tpAniSirGlobal pMac); // Encryption/Decryption related functions tCfgWepKeyEntry *limLookUpKeyMappings(tSirMacAddr); -void limComputeCrc32(tANI_U8 *, tANI_U8 *, tANI_U8); +void limComputeCrc32(tANI_U8 *, tANI_U8 *, tANI_U16); void limRC4(tANI_U8 *, tANI_U8 *, tANI_U8 *, tANI_U32, tANI_U16); void limEncryptAuthFrame(tpAniSirGlobal, tANI_U8, tANI_U8 *, tANI_U8 *, tANI_U8 *, tANI_U32); tANI_U8 limDecryptAuthFrame(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U8 *, tANI_U32, tANI_U16); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendManagementFrames.c index 15b61942b8e7..d9d16758cdf5 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -53,7 +53,7 @@ #include "limAssocUtils.h" #include "limFT.h" #ifdef WLAN_FEATURE_11W -#include "wniCfgAp.h" +#include "wniCfg.h" #endif #if defined WLAN_FEATURE_VOWIFI @@ -62,7 +62,7 @@ #include "wlan_qct_wda.h" - +#define IS_BROADCAST_MAC(x) (((x[0] & x[1] & x[2] & x[3] & x[4] & x[5]) == 0xff) ? 1 : 0) //////////////////////////////////////////////////////////////////////// tSirRetStatus limStripOffExtCapIE(tpAniSirGlobal pMac, @@ -109,7 +109,7 @@ tSirRetStatus limStripOffExtCapIE(tpAniSirGlobal pMac, tempLen += (elem_len + 2); } else - { /*Est Cap present size is 8 + 2 byte at present*/ + { if ( NULL != pExtractedExtCapIEBuf ) { vos_mem_set(pExtractedExtCapIEBuf, @@ -135,6 +135,7 @@ void limUpdateExtCapIEtoStruct(tpAniSirGlobal pMac, tDot11fIEExtCap *pDst) { tANI_U8 pOut[DOT11F_IE_EXTCAP_MAX_LEN]; + tANI_U8 tag, len, *val; if ( NULL == pBuf ) { @@ -149,22 +150,23 @@ void limUpdateExtCapIEtoStruct(tpAniSirGlobal pMac, return ; } - if ( DOT11F_EID_EXTCAP != pBuf[0] || - pBuf[1] > DOT11F_IE_EXTCAP_MAX_LEN ) + /* Get tlv */ + tag = pBuf[0]; + len = pBuf[1]; + val = &pBuf[2]; + + if ( DOT11F_EID_EXTCAP != tag || + len > DOT11F_IE_EXTCAP_MAX_LEN ) { limLog( pMac, LOG1, - FL("Invalid IEs eid = %d elem_len=%d "), - pBuf[0],pBuf[1]); + FL("Invalid IEs eid = %d elem_len=%d "), tag, len); return; } - vos_mem_set(( tANI_U8* )&pOut[0], DOT11F_IE_EXTCAP_MAX_LEN, 0); - /* conversion should follow 4, 2, 2 byte order */ - limUtilsframeshtonl(pMac, &pOut[0],*((tANI_U32*)&pBuf[2]),0); - limUtilsframeshtons(pMac, &pOut[4],*((tANI_U16*)&pBuf[6]),0); - limUtilsframeshtons(pMac, &pOut[6],*((tANI_U16*)&pBuf[8]),0); + vos_mem_zero(pOut, DOT11F_IE_EXTCAP_MAX_LEN); + vos_mem_copy(pOut, val, len); if ( DOT11F_PARSE_SUCCESS != dot11fUnpackIeExtCap( pMac, - &pOut[0], DOT11F_IE_EXTCAP_MAX_LEN, pDst) ) + pOut, len, pDst) ) { limLog( pMac, LOGE, FL("dot11fUnpackIeExtCap Parse Error ")); @@ -196,18 +198,41 @@ tSirRetStatus limStripOffExtCapIEAndUpdateStruct(tpAniSirGlobal pMac, } void limMergeExtCapIEStruct(tDot11fIEExtCap *pDst, - tDot11fIEExtCap *pSrc) + tDot11fIEExtCap *pSrc, + bool add) { - tANI_U8 *tempDst = (tANI_U8 *)pDst; - tANI_U8 *tempSrc = (tANI_U8 *)pSrc; - tANI_U8 structlen = sizeof(tDot11fIEExtCap); + tANI_U8 *tempDst = (tANI_U8 *)pDst->bytes; + tANI_U8 *tempSrc = (tANI_U8 *)pSrc->bytes; + tANI_U8 structlen = DOT11F_IE_EXTCAP_MAX_LEN; + + // if src is not present, nothing to do + if(!pSrc->present) { + return; + } + + // if dst is not present, and add=false, nothing to do + if (!pDst->present && !add) { + return; + } + // in other cases, need to merge the bits + pDst->present = 1; while(tempDst && tempSrc && structlen--) { - *tempDst |= *tempSrc; + if (add) { + *tempDst |= *tempSrc; + } else { + *tempDst &= *tempSrc; + } tempDst++; tempSrc++; } + pDst->num_bytes = lim_compute_ext_cap_ie_length(pDst); + + // if all bits are zero, it means it is not prsent. + if (pDst->num_bytes == 0) { + pDst->present = 0; + } } /** @@ -317,7 +342,6 @@ limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, tANI_U8 sessionId; tANI_U8 *p2pIe = NULL; tANI_U32 txFlag = 0; - tANI_U32 chanbond24G = 0; #ifndef GEN4_SCAN return eSIR_FAILURE; @@ -414,9 +438,9 @@ limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, } } - /* Get HT40 capability for 2.4GHz band */ - wlan_cfgGetInt(pMac,WNI_CFG_CHANNEL_BONDING_24G,&chanbond24G); - if( (nChannelNum <= SIR_11B_CHANNEL_END) && chanbond24G != TRUE) + if((nChannelNum <= SIR_11B_CHANNEL_END) + && (!IS_HT40_OBSS_SCAN_FEATURE_ENABLE) + && (!pMac->roam.configParam.channelBondingMode24GHz)) { pr.HTCaps.supportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; pr.HTCaps.shortGI40MHz = 0; @@ -427,12 +451,13 @@ limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, //Include HT Capability IE if (psessionEntry->vhtCapability) { - PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, eSIR_FALSE ); + PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, + psessionEntry->currentOperChannel , eSIR_FALSE ); } } else { if (IS_DOT11_MODE_VHT(dot11mode)) { - PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, eSIR_FALSE ); + PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, nChannelNum, eSIR_FALSE ); } } #endif @@ -525,6 +550,11 @@ limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } + if( ( psessionEntry != NULL ) && ( psessionEntry->is11Gonly == true ) && + ( !IS_BROADCAST_MAC(bssid) ) ){ + txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; + } + halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) sizeof(tSirMacMgmtHdr) + nPayload, HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, @@ -735,20 +765,41 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); PopulateDot11fHTInfo( pMac, &pFrm->HTInfo, psessionEntry ); } + +#ifdef WLAN_FEATURE_AP_HT40_24G + /* Populate Overlapping BSS Scan Parameters IEs, + * when operating in HT40 in 2.4GHz. + */ + if ((pMac->roam.configParam.apHT40_24GEnabled) + && (IS_DOT11_MODE_HT(psessionEntry->dot11mode))) + { + PopulateDot11fOBSSScanParameters( pMac, &pFrm->OBSSScanParameters, + psessionEntry); + /* 10.15.8 Support of DSSS/CCK in 40 MHz, An associated HT STA in + * a 20/40 MHz BSS may generate DSSS/CCK transmissions.Set DSSS/CCK + * Mode in 40 MHz bit in HT capablity. + */ + pFrm->HTCaps.dsssCckMode40MHz = 1; + } +#endif + + PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); + #ifdef WLAN_FEATURE_11AC if(psessionEntry->vhtCapability) { limLog( pMac, LOG1, FL("Populate VHT IE in Probe Response")); - PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, eSIR_TRUE ); - PopulateDot11fVHTOperation( pMac, &pFrm->VHTOperation ); + PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, + psessionEntry->currentOperChannel, eSIR_TRUE ); + PopulateDot11fVHTOperation( pMac, &pFrm->VHTOperation , + psessionEntry->currentOperChannel); // we do not support multi users yet //PopulateDot11fVHTExtBssLoad( pMac, &frm.VHTExtBssLoad ); - PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); } #endif - if ( psessionEntry->pLimStartBssReq ) + if ( psessionEntry->pLimStartBssReq ) { PopulateDot11fWPA( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), &pFrm->WPA ); @@ -918,7 +969,7 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, /*merge ExtCap IE*/ if (extractedExtCapFlag && extractedExtCap.present) { - limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); + limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap, true); } nStatus = dot11fGetPackedProbeResponseSize( pMac, pFrm, &nPayload ); @@ -1293,8 +1344,8 @@ limSendAddtsReqActionFrame(tpAniSirGlobal pMac, } } - PELOG3(limLog( pMac, LOG3, FL("Sending an Add TS Request frame to ") ); - limPrintMacAddr( pMac, peerMacAddr, LOG3 );) + limLog( pMac, LOG1, FL("Sending an Add TS Request frame to ") ); + limPrintMacAddr( pMac, peerMacAddr, LOG1 ); if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || @@ -1456,6 +1507,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, if ( pSta->mlmStaContext.htCapability && psessionEntry->htCapability ) { + limLog(pMac, LOG1, FL("Populate HT IEs in Assoc Response")); PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); /* *Check the STA capability and update the HTCaps accordingly @@ -1469,15 +1521,41 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, PopulateDot11fHTInfo( pMac, &frm.HTInfo, psessionEntry ); } + limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," + "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), + frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, + frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, + frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); + + +#ifdef WLAN_FEATURE_AP_HT40_24G + /* Populate Overlapping BSS Scan Parameters IEs, + * when operating in HT40 in 2.4GHz. + */ + if ((pMac->roam.configParam.apHT40_24GEnabled) + && (IS_DOT11_MODE_HT(psessionEntry->dot11mode))) + { + PopulateDot11fOBSSScanParameters( pMac, &frm.OBSSScanParameters, + psessionEntry); + /* 10.15.8 Support of DSSS/CCK in 40 MHz, An associated HT STA in + * a 20/40 MHz BSS may generate DSSS/CCK transmissions.Set DSSS/CCK + * Mode in 40 MHz bit in HT capablity. + */ + frm.HTCaps.dsssCckMode40MHz = 1; + } +#endif + + PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); #ifdef WLAN_FEATURE_11AC if( pSta->mlmStaContext.vhtCapability && psessionEntry->vhtCapability ) { limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Response")); - PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, eSIR_TRUE ); - PopulateDot11fVHTOperation( pMac, &frm.VHTOperation); - PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); + PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, + psessionEntry->currentOperChannel, eSIR_TRUE ); + PopulateDot11fVHTOperation( pMac, &frm.VHTOperation, + psessionEntry->currentOperChannel); } #endif @@ -1574,7 +1652,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, /* merge the ExtCap struct*/ if (extractedExtCapFlag && extractedExtCap.present) { - limMergeExtCapIEStruct(&(frm.ExtCap), &extractedExtCap); + limMergeExtCapIEStruct(&(frm.ExtCap), &extractedExtCap, true); } nStatus = dot11fGetPackedAssocResponseSize( pMac, &frm, &nPayload ); @@ -1649,16 +1727,16 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, if (subType == LIM_ASSOC) { - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("*** Sending Assoc Resp status %d aid %d to "), - statusCode, aid);) + statusCode, aid); } else{ - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("*** Sending ReAssoc Resp status %d aid %d to "), - statusCode, aid);) + statusCode, aid); } - PELOG1(limPrintMacAddr(pMac, pMacHdr->da, LOG1);) + limPrintMacAddr(pMac, pMacHdr->da, LOG1); if ( addnIEPresent ) { @@ -1682,12 +1760,28 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, psessionEntry->peSessionId, pMacHdr->fc.subType)); - /// Queue Association Response frame in high priority WQ - halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, - HAL_TXRX_FRM_802_11_MGMT, - ANI_TXDIR_TODS, - 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, - limTxComplete, pFrame, txFlag ); + + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + limLog(pMac, LOG1, FL("Re/AssocRsp - txBdToken %u"), pMac->lim.txBdToken); + /// Queue Association Response frame in high priority WQ + halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, limTxBdComplete, + txFlag, pMac->lim.txBdToken ); + pMac->lim.txBdToken++; + } + else + { + /// Queue Association Response frame in high priority WQ + halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, txFlag ); + } MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); @@ -1951,9 +2045,9 @@ limSendAddtsRspActionFrame(tpAniSirGlobal pMac, } } - PELOG1(limLog( pMac, LOG1, FL("Sending an Add TS Response (status %d) to "), + limLog( pMac, LOG1, FL("Sending an Add TS Response (status %d) to "), nStatusCode ); - limPrintMacAddr( pMac, pMacHdr->da, LOG1 );) + limPrintMacAddr( pMac, pMacHdr->da, LOG1 ); if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || @@ -2141,8 +2235,8 @@ limSendDeltsReqActionFrame(tpAniSirGlobal pMac, } } - PELOG1(limLog(pMac, LOG1, FL("Sending DELTS REQ (size %d) to "), nBytes); - limPrintMacAddr(pMac, pMacHdr->da, LOG1);) + limLog(pMac, LOG1, FL("Sending DELTS REQ (size %d) to "), nBytes); + limPrintMacAddr(pMac, pMacHdr->da, LOG1); if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || @@ -2180,7 +2274,7 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, tDot11fAssocRequest *pFrm; tANI_U16 caps; tANI_U8 *pFrame; - tSirRetStatus nSirStatus; + tSirRetStatus nSirStatus = eSIR_FAILURE; tLimMlmAssocCnf mlmAssocCnf; tANI_U32 nPayload, nStatus; tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; @@ -2224,9 +2318,12 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, vos_mem_set( ( tANI_U8* )pFrm, sizeof( tDot11fAssocRequest ), 0 ); vos_mem_set(( tANI_U8* )&extractedExtCap, sizeof( tDot11fIEExtCap ), 0); - nSirStatus = limStripOffExtCapIEAndUpdateStruct(pMac, pAddIE, + if (psessionEntry->ExtCap.present) + { + nSirStatus = limStripOffExtCapIEAndUpdateStruct(pMac, pAddIE, &nAddIELen, &extractedExtCap ); + } if(eSIR_SUCCESS != nSirStatus ) { extractedExtCapFlag = eANI_BOOLEAN_FALSE; @@ -2238,10 +2335,12 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, */ else { - if(extractedExtCap.interworkingService) - { - extractedExtCap.qosMap = 1; + struct s_ext_cap *p_ext_cap = (struct s_ext_cap *)extractedExtCap.bytes; + if (p_ext_cap->interworkingService) { + p_ext_cap->qosMap = 1; } + extractedExtCap.num_bytes = lim_compute_ext_cap_ie_length(&extractedExtCap); + extractedExtCapFlag = (extractedExtCap.num_bytes > 0); } caps = pMlmAssocReq->capabilityInfo; @@ -2370,6 +2469,7 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, if ( psessionEntry->htCapability && pMac->lim.htCapabilityPresentInBeacon) { + limLog(pMac, LOG1, FL("Populate HT IEs in Assoc Request")); PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); #ifdef DISABLE_GF_FOR_INTEROP @@ -2389,15 +2489,26 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, #endif } + + limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," + "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), + pFrm->HTCaps.supportedChannelWidthSet, pFrm->HTCaps.mimoPowerSave, + pFrm->HTCaps.greenField, pFrm->HTCaps.shortGI20MHz, pFrm->HTCaps.shortGI40MHz, + pFrm->HTCaps.dsssCckMode40MHz, pFrm->HTCaps.maxRxAMPDUFactor); + + #ifdef WLAN_FEATURE_11AC if ( psessionEntry->vhtCapability && psessionEntry->vhtCapabilityPresentInBeacon) { limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Request")); - PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, eSIR_FALSE ); + PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, + psessionEntry->currentOperChannel, eSIR_FALSE ); + } #endif - PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); + if (psessionEntry->ExtCap.present) + PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); #if defined WLAN_FEATURE_VOWIFI_11R if (psessionEntry->pLimJoinReq->is11Rconnection) @@ -2433,7 +2544,13 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, /* merge the ExtCap struct*/ if (extractedExtCapFlag && extractedExtCap.present) { - limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); + limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap, true); + } + + if (pFrm->ExtCap.present && psessionEntry->ExtCap.present) { + limMergeExtCapIEStruct(&pFrm->ExtCap, &psessionEntry->ExtCap, false); + limLog(pMac, LOG1, + FL("Clear the bits in EXTCAP IE that AP don't support to avoid IoT issues.")); } nStatus = dot11fGetPackedAssocRequestSize( pMac, pFrm, &nPayload ); @@ -2471,9 +2588,6 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; - palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, - ( void* ) pFrame, ( void* ) pPacket ); - limPostSmeMessage( pMac, LIM_MLM_ASSOC_CNF, ( tANI_U32* ) &mlmAssocCnf); @@ -2557,7 +2671,8 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } - if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) + if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || + psessionEntry->pePersona == VOS_STA_MODE) { txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; } @@ -2572,14 +2687,30 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, psessionEntry->peSessionId, pMacHdr->fc.subType)); - // enable caching - WLANTL_EnableCaching(psessionEntry->staId); - - halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), - HAL_TXRX_FRM_802_11_MGMT, - ANI_TXDIR_TODS, - 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, - limTxComplete, pFrame, txFlag ); + if( ( psessionEntry->is11Gonly == true ) && + ( !IS_BROADCAST_MAC(pMlmAssocReq->peerMacAddr) ) ){ + txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; + } + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + limLog(pMac, LOG1, FL("Assoc Req - txBdToken %u"), pMac->lim.txBdToken); + halstatus = halTxFrameWithTxComplete( pMac, pPacket, + ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), + HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, limTxBdComplete, txFlag, + pMac->lim.txBdToken); + pMac->lim.txBdToken++; + } + else + { + halstatus = halTxFrame( pMac, pPacket, + ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, txFlag ); + } MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); @@ -2592,6 +2723,9 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, return; } + //Enable caching only if Assoc Request is successfully submitted to the h/w + WLANTL_EnableCaching(psessionEntry->staId); + // Free up buffer allocated for mlmAssocReq vos_mem_free(pMlmAssocReq); pMlmAssocReq = NULL; @@ -2831,7 +2965,11 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, { PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); } - + limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," + "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), + frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, + frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, + frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); #if defined WLAN_FEATURE_VOWIFI_11R if ( psessionEntry->pLimReAssocReq->bssDescription.mdiePresent && (pMac->ft.ftSmeContext.addMDIE == TRUE) @@ -2849,10 +2987,13 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, psessionEntry->vhtCapabilityPresentInBeacon) { limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); - PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, eSIR_FALSE ); + PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, + psessionEntry->currentOperChannel, eSIR_FALSE ); + } #endif - PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); + if (psessionEntry->ExtCap.present) + PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); if ( DOT11F_FAILED( nStatus ) ) @@ -3013,18 +3154,28 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, psessionEntry->assocReqLen = (ft_ies_length); } - - // Enable TL cahching in case of roaming - WLANTL_EnableCaching(psessionEntry->staId); - MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, psessionEntry->peSessionId, pMacHdr->fc.subType)); - halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (nBytes + ft_ies_length), - HAL_TXRX_FRM_802_11_MGMT, - ANI_TXDIR_TODS, - 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, - limTxComplete, pFrame, txFlag ); + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + limLog( pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); + halstatus = halTxFrameWithTxComplete( pMac, pPacket, + ( tANI_U16 ) (nBytes + ft_ies_length), + HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, limTxBdComplete, txFlag, + pMac->lim.txBdToken); + pMac->lim.txBdToken++; + } + else + { + halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (nBytes + ft_ies_length), + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, txFlag ); + } MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); @@ -3037,6 +3188,9 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, goto end; } + // Enable TL cahching in case of roaming + WLANTL_EnableCaching(psessionEntry->staId); + end: // Free up buffer allocated for mlmAssocReq vos_mem_free( pMlmReassocReq ); @@ -3050,16 +3204,48 @@ void limSendRetryReassocReqFrame(tpAniSirGlobal pMac, { tLimMlmReassocCnf mlmReassocCnf; // keep sme tLimMlmReassocReq *pTmpMlmReassocReq = NULL; - if(NULL == pTmpMlmReassocReq) +#ifdef FEATURE_WLAN_ESE + tANI_U32 val=0; +#endif + if (pMlmReassocReq == NULL) { - pTmpMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); - if ( NULL == pTmpMlmReassocReq ) goto end; - vos_mem_set( pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0); - vos_mem_copy( pTmpMlmReassocReq, pMlmReassocReq, sizeof(tLimMlmReassocReq)); + limLog(pMac, LOGE, + FL("Invalid pMlmReassocReq")); + goto end; } + pTmpMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); + if ( NULL == pTmpMlmReassocReq ) goto end; + vos_mem_set( pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0); + vos_mem_copy( pTmpMlmReassocReq, pMlmReassocReq, sizeof(tLimMlmReassocReq)); + // Prepare and send Reassociation request frame // start reassoc timer. +#ifdef FEATURE_WLAN_ESE + /* + * In case of Ese Reassociation, change the reassoc timer + * value. + */ + val = pMlmReassocReq->reassocFailureTimeout; + if (psessionEntry->isESEconnection) + { + val = val/LIM_MAX_REASSOC_RETRY_LIMIT; + } + if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != + TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to deactivate Reassoc failure timer")); + } + val = SYS_MS_TO_TICKS(val); + if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, + val, 0) != TX_SUCCESS) + { + limLog(pMac, LOGP, + FL("unable to change Reassociation failure timer")); + } +#endif + pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; // Start reassociation failure timer MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); @@ -3122,7 +3308,7 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, #if defined WLAN_FEATURE_VOWIFI tANI_U8 PowerCapsPopulated = FALSE; #endif - tpSirMacMgmtHdr pMacHdr; + tpSirMacMgmtHdr pMacHdr; if(NULL == psessionEntry) { @@ -3267,13 +3453,20 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, { PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); } + limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," + "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), + frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, + frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, + frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); #ifdef WLAN_FEATURE_11AC if ( psessionEntry->vhtCapability && psessionEntry->vhtCapabilityPresentInBeacon) { limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); - PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, eSIR_FALSE ); - PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); + PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, + psessionEntry->currentOperChannel, eSIR_FALSE ); + if (psessionEntry->ExtCap.present) + PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); } #endif @@ -3380,7 +3573,8 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } - if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) + if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || + psessionEntry->pePersona == VOS_STA_MODE) { txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; } @@ -3389,14 +3583,25 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, psessionEntry->peSessionId, pMacHdr->fc.subType)); - // enable caching - WLANTL_EnableCaching(psessionEntry->staId); - - halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), - HAL_TXRX_FRM_802_11_MGMT, - ANI_TXDIR_TODS, - 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, - limTxComplete, pFrame, txFlag ); + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + limLog(pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); + halstatus = halTxFrameWithTxComplete( pMac, pPacket, + ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), + HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, limTxBdComplete, + txFlag, pMac->lim.txBdToken ); + pMac->lim.txBdToken++; + } + else + { + halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, txFlag ); + } MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); @@ -3409,6 +3614,9 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, goto end; } + // enable caching + WLANTL_EnableCaching(psessionEntry->staId); + end: // Free up buffer allocated for mlmAssocReq vos_mem_free( pMlmReassocReq ); @@ -3416,6 +3624,43 @@ limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, } // limSendReassocReqMgmtFrame +eHalStatus limAuthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) +{ + tANI_U32 txCompleteSuccess; + tpSirTxBdStatus pTxBdStatus; + + if (!pData) + { + limLog(pMac, LOG1, + FL(" pData is NULL")); + return eHAL_STATUS_FAILURE; + } + + if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + pTxBdStatus = (tpSirTxBdStatus) pData; + txCompleteSuccess = pTxBdStatus->txCompleteStatus; + limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), + pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); + } + else + { + txCompleteSuccess = *((tANI_U32*) pData); + limLog(pMac, LOG1, + FL("txCompleteSuccess= %d"), txCompleteSuccess); + } + + if(txCompleteSuccess) + { + pMac->authAckStatus = LIM_AUTH_ACK_RCD_SUCCESS; + // 'Change' timer for future activations + limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); + } + else + pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; + return eHAL_STATUS_SUCCESS; +} + /** * \brief Send an Authentication frame * @@ -3442,8 +3687,9 @@ void limSendAuthMgmtFrame(tpAniSirGlobal pMac, tpSirMacAuthFrameBody pAuthFrameBody, tSirMacAddr peerMacAddr, - tANI_U8 wepBit, - tpPESession psessionEntry + tANI_U8 wep_challenge_len, + tpPESession psessionEntry, + tAniBool waitForAck ) { tANI_U8 *pFrame, *pBody; @@ -3466,7 +3712,7 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, pAuthFrameBody->authStatusCode, (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), MAC_ADDR_ARRAY(peerMacAddr)); - if (wepBit == LIM_WEP_IN_FC) + if (wep_challenge_len) { /// Auth frame3 to be sent with encrypted framebody /** @@ -3476,10 +3722,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, * 128 bytes for challenge text and 4 bytes each for * IV & ICV. */ - - frameLen = sizeof(tSirMacMgmtHdr) + LIM_ENCR_AUTH_BODY_LEN; - - bodyLen = LIM_ENCR_AUTH_BODY_LEN; + bodyLen = wep_challenge_len + LIM_ENCR_AUTH_INFO_LEN; + frameLen = sizeof(tSirMacMgmtHdr) + bodyLen; } // if (wepBit == LIM_WEP_IN_FC) else { @@ -3544,9 +3788,11 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, * for challenge text. */ + bodyLen = SIR_MAC_AUTH_FRAME_INFO_LEN + + SIR_MAC_SAP_AUTH_CHALLENGE_LENGTH + + SIR_MAC_CHALLENGE_ID_LEN; frameLen = sizeof(tSirMacMgmtHdr) + - sizeof(tSirMacAuthFrame); - bodyLen = sizeof(tSirMacAuthFrameBody); + bodyLen; } break; @@ -3607,7 +3853,10 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, } pMacHdr = ( tpSirMacMgmtHdr ) pFrame; - pMacHdr->fc.wep = wepBit; + if (wep_challenge_len) + pMacHdr->fc.wep = LIM_WEP_IN_FC; + else + pMacHdr->fc.wep = LIM_NO_WEP_IN_FC; // Prepare BSSId if( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) @@ -3620,15 +3869,15 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, /// Prepare Authentication frame body pBody = pFrame + sizeof(tSirMacMgmtHdr); - if (wepBit == LIM_WEP_IN_FC) + if (wep_challenge_len) { vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), pAuthFrameBody->authStatusCode, (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), - MAC_ADDR_ARRAY(pMacHdr->da));) + MAC_ADDR_ARRAY(pMacHdr->da)); } else @@ -3687,12 +3936,12 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, } #endif - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), pAuthFrameBody->authTransactionSeqNumber, pAuthFrameBody->authStatusCode, (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), - MAC_ADDR_ARRAY(pMacHdr->da));) + MAC_ADDR_ARRAY(pMacHdr->da)); } PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) @@ -3708,13 +3957,15 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } - if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) + if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || + psessionEntry->pePersona == VOS_STA_MODE) { txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; } - limLog( pMac, LOG1, FL("Sending Auth Frame over WQ5 to "MAC_ADDRESS_STR - " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), + limLog( pMac, LOG1, + FL("Sending Auth Frame over WQ5 with waitForAck %d to "MAC_ADDRESS_STR + " From " MAC_ADDRESS_STR), waitForAck, MAC_ADDR_ARRAY(pMacHdr->da), MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); txFlag |= HAL_USE_FW_IN_TX_PATH; @@ -3722,22 +3973,55 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, psessionEntry->peSessionId, pMacHdr->fc.subType)); - /// Queue Authentication frame in high priority WQ - halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) frameLen, + + if( ( psessionEntry->is11Gonly == true ) && + ( !IS_BROADCAST_MAC(peerMacAddr) ) ){ + txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; + } + if(eSIR_TRUE == waitForAck) + { + pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD; + limLog(pMac, LOG1, FL("Auth frame - txBdToken %u"), + pMac->lim.txBdToken); + halstatus = halTxFrameWithTxComplete( pMac, pPacket, + ( tANI_U16 ) frameLen, + HAL_TXRX_FRM_802_11_MGMT, + ANI_TXDIR_TODS, + 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, + limTxComplete, pFrame, limAuthTxCompleteCnf, txFlag, + pMac->lim.txBdToken); + pMac->lim.txBdToken++; + MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, + psessionEntry->peSessionId, + halstatus)); + if (!HAL_STATUS_SUCCESS(halstatus)) + { + limLog( pMac, LOGE, + FL("Could not send Auth frame, retCode=%X "), + halstatus ); + pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; + //Pkt will be freed up by the callback + } + } + else + { + /// Queue Authentication frame in high priority WQ + halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) frameLen, HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, limTxComplete, pFrame, txFlag ); - MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, + MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); - if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) - { + if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) + { limLog(pMac, LOGE, FL("*** Could not send Auth frame, retCode=%X ***"), halstatus); //Pkt will be freed up by the callback + } } return; @@ -3856,6 +4140,8 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) pStaDs = dphLookupHashEntry(pMac, pMlmDisassocReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); if (pStaDs == NULL) { + limLog(pMac, LOGE, + FL("StaDs Null")); mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; goto end; } @@ -3864,6 +4150,8 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) if(eSIR_SUCCESS != limCleanupRxPath(pMac, pStaDs, psessionEntry)) { mlmDisassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; + limLog(pMac, LOGE, + FL("CleanupRxPath error")); goto end; } @@ -3926,13 +4214,27 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) return eHAL_STATUS_SUCCESS; } -eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) +eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, void *pData) { + if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + tpSirTxBdStatus pTxBdStatus; + pTxBdStatus = (tpSirTxBdStatus) pData; + limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), + pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); + } return limSendDisassocCnf(pMac); } -eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) +eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) { + if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + { + tpSirTxBdStatus pTxBdStatus; + pTxBdStatus = (tpSirTxBdStatus) pData; + limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), + pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); + } return limSendDeauthCnf(pMac); } @@ -4060,12 +4362,7 @@ limSendDisassocMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } - if((psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) || - (psessionEntry->pePersona == VOS_P2P_GO_MODE) || - (psessionEntry->pePersona == VOS_STA_SAP_MODE)) - { - txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; - } + txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) { @@ -4093,7 +4390,8 @@ limSendDisassocMgmtFrame(tpAniSirGlobal pMac, ANI_TXDIR_TODS, 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, limTxComplete, pFrame, limDisassocTxCompleteCnf, - txFlag ); + txFlag, + pMac->lim.txBdToken++); MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); @@ -4268,12 +4566,7 @@ limSendDeauthMgmtFrame(tpAniSirGlobal pMac, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } - if((psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) || - (psessionEntry->pePersona == VOS_P2P_GO_MODE) || - (psessionEntry->pePersona == VOS_STA_SAP_MODE)) - { - txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; - } + txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) { @@ -4303,7 +4596,8 @@ limSendDeauthMgmtFrame(tpAniSirGlobal pMac, HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, - limTxComplete, pFrame, limDeauthTxCompleteCnf, txFlag ); + limTxComplete, pFrame, limDeauthTxCompleteCnf, txFlag, + pMac->lim.txBdToken++); MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, psessionEntry->peSessionId, halstatus)); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.c index b71640f94f13..0b482885e707 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -271,13 +271,17 @@ tSirRetStatus limSendSwitchChnlParams(tpAniSirGlobal pMac, msgQ.bodyptr = pChnlParams; msgQ.bodyval = 0; #if defined WLAN_FEATURE_VOWIFI - PELOG3(limLog( pMac, LOG3, - FL( "Sending WDA_CHNL_SWITCH_REQ with SecondaryChnOffset - %d, ChannelNumber - %d, maxTxPower - %d"), - pChnlParams->secondaryChannelOffset, pChnlParams->channelNumber, pChnlParams->maxTxPower);) + limLog( pMac, LOG1, + FL( "Sending WDA_CHNL_SWITCH_REQ with SecondaryChnOffset - %d," + " ChannelNumber - %d, maxTxPower - %d"), + pChnlParams->secondaryChannelOffset, pChnlParams->channelNumber, + pChnlParams->maxTxPower); #else - PELOG3(limLog( pMac, LOG3, - FL( "Sending WDA_CHNL_SWITCH_REQ with SecondaryChnOffset - %d, ChannelNumber - %d, LocalPowerConstraint - %d"), - pChnlParams->secondaryChannelOffset, pChnlParams->channelNumber, pChnlParams->localPowerConstraint);) + limLog( pMac, LOG1, + FL( "Sending WDA_CHNL_SWITCH_REQ with SecondaryChnOffset - %d, " + "ChannelNumber - %d, LocalPowerConstraint - %d"), + pChnlParams->secondaryChannelOffset, pChnlParams->channelNumber, + pChnlParams->localPowerConstraint); #endif MTRACE(macTraceMsgTx(pMac, peSessionId, msgQ.type)); limLog(pMac,LOG1,"SessionId:%d WDA_CHNL_SWITCH_REQ for SSID:%s",peSessionId, @@ -669,10 +673,13 @@ tSirRetStatus limSendHT40OBSSScanInd(tpAniSirGlobal pMac, { limLog(pMac, LOGE, FL("could not retrieve Valid channel list")); + vos_mem_free(ht40OBSSScanInd); + return eSIR_FAILURE; } /* Extract 24G channel list */ channel24GNum = 0; - for( count =0 ;count < validChannelNum ;count++) + for( count =0 ;count < validChannelNum && + (channel24GNum < SIR_ROAM_MAX_CHANNELS);count++) { if ((validChanList[count]> RF_CHAN_1) && (validChanList[count] < RF_CHAN_14)) @@ -692,7 +699,10 @@ tSirRetStatus limSendHT40OBSSScanInd(tpAniSirGlobal pMac, msgQ.reserved = 0; msgQ.bodyptr = (void *)ht40OBSSScanInd; msgQ.bodyval = 0; - PELOGW(limLog(pMac, LOGW, FL("Sending WDA_HT40_OBSS_SCAN_IND to WDA"));) + limLog(pMac, LOG1, FL("Sending WDA_HT40_OBSS_SCAN_IND to WDA" + "Obss Scan trigger width = %d, delay factor = %d"), + ht40OBSSScanInd->BSSChannelWidthTriggerScanInterval, + ht40OBSSScanInd->BSSWidthChannelTransitionDelayFactor); MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg(pMac, &msgQ); if (eSIR_SUCCESS != retCode) @@ -724,7 +734,7 @@ tSirRetStatus limSendHT40OBSSStopScanInd(tpAniSirGlobal pMac, bssIdx = psessionEntry->bssIdx; VOS_TRACE (VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, - " Sending STOP OBSS cmd, bssid %d staid %d \n", + " Sending STOP OBSS cmd, bssid %d staid %d ", psessionEntry->bssIdx, psessionEntry->staId); msgQ.type = WDA_HT40_OBSS_STOP_SCAN_IND; @@ -915,107 +925,6 @@ tSirRetStatus limSendModeUpdate(tpAniSirGlobal pMac, return retCode; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/** --------------------------------------------------------- -\fn limSendTdlsLinkEstablish -\brief LIM sends a message to HAL to set tdls direct link -\param tpAniSirGlobal pMac -\param -\return None - -----------------------------------------------------------*/ -tSirRetStatus limSendTdlsLinkEstablish(tpAniSirGlobal pMac, tANI_U8 bIsPeerResponder, tANI_U8 linkIdenOffset, - tANI_U8 ptiBufStatusOffset, tANI_U8 ptiFrameLen, tANI_U8 *ptiFrame, tANI_U8 *extCapability) -{ - tSirMsgQ msgQ; - tSirRetStatus retCode; - tpSirTdlsLinkEstablishInd pTdlsLinkEstablish = NULL; - - // Allocate memory. - pTdlsLinkEstablish = vos_mem_malloc(sizeof(tSirTdlsLinkEstablishInd)); - if ( NULL == pTdlsLinkEstablish ) - { - limLog( pMac, LOGP, - FL( "Unable to allocate memory while sending Tdls Link Establish " )); - - retCode = eSIR_SME_RESOURCES_UNAVAILABLE; - return retCode; - } - - vos_mem_set((tANI_U8 *) pTdlsLinkEstablish, sizeof(tSirTdlsLinkEstablishInd), 0); - - pTdlsLinkEstablish->bIsResponder = !!bIsPeerResponder; - pTdlsLinkEstablish->linkIdenOffset = linkIdenOffset; - pTdlsLinkEstablish->ptiBufStatusOffset = ptiBufStatusOffset; - pTdlsLinkEstablish->ptiTemplateLen = ptiFrameLen; - /* Copy ptiFrame template */ - vos_mem_copy(pTdlsLinkEstablish->ptiTemplateBuf, ptiFrame, ptiFrameLen); - /* Copy extended capabilities */ - vos_mem_copy((tANI_U8 *) pTdlsLinkEstablish->extCapability, extCapability, sizeof(pTdlsLinkEstablish->extCapability)); - - msgQ.type = SIR_HAL_TDLS_LINK_ESTABLISH; - msgQ.reserved = 0; - msgQ.bodyptr = pTdlsLinkEstablish; - msgQ.bodyval = 0; - - MTRACE(macTraceMsgTx(pMac, 0, msgQ.type)); - - retCode = (tANI_U32)wdaPostCtrlMsg(pMac, &msgQ); - if (retCode != eSIR_SUCCESS) - { - vos_mem_free(pTdlsLinkEstablish); - limLog(pMac, LOGP, FL("Posting tdls link establish %d failed, reason = %x "), retCode); - } - - return retCode; -} - -/** --------------------------------------------------------- -\fn limSendTdlsLinkTeardown -\brief LIM sends a message to HAL to indicate tdls direct link is teardowned -\param tpAniSirGlobal pMac -\param -\return None - -----------------------------------------------------------*/ -tSirRetStatus limSendTdlsLinkTeardown(tpAniSirGlobal pMac, tANI_U16 staId) -{ - tSirMsgQ msgQ; - tSirRetStatus retCode; - tpSirTdlsLinkTeardownInd pTdlsLinkTeardown = NULL; - - // Allocate memory. - pTdlsLinkTeardown = vos_mem_malloc(sizeof(tSirTdlsLinkTeardownInd)); - if ( NULL == pTdlsLinkTeardown ) - { - limLog( pMac, LOGP, - FL( "Unable to allocate memory while sending Tdls Link Teardown " )); - - retCode = eSIR_SME_RESOURCES_UNAVAILABLE; - return retCode; - } - - vos_mem_set((tANI_U8 *) pTdlsLinkTeardown, sizeof(tSirTdlsLinkTeardownInd), 0); - - pTdlsLinkTeardown->staId = staId; - - msgQ.type = SIR_HAL_TDLS_LINK_TEARDOWN; - msgQ.reserved = 0; - msgQ.bodyptr = pTdlsLinkTeardown; - msgQ.bodyval = 0; - - MTRACE(macTraceMsgTx(pMac, 0, msgQ.type)); - - retCode = (tANI_U32)wdaPostCtrlMsg(pMac, &msgQ); - if (retCode != eSIR_SUCCESS) - { - vos_mem_free(pTdlsLinkTeardown); - limLog(pMac, LOGP, FL("Posting tdls link teardown %d failed, reason = %x "), retCode); - } - - return retCode; -} - -#endif - #ifdef WLAN_FEATURE_11W /** --------------------------------------------------------- \fn limSendExcludeUnencryptInd @@ -1050,8 +959,8 @@ tSirRetStatus limSendExcludeUnencryptInd(tpAniSirGlobal pMac, msgQ.reserved = 0; msgQ.bodyptr = pExcludeUnencryptParam; msgQ.bodyval = 0; - PELOG3(limLog(pMac, LOG3, - FL("Sending WDA_EXCLUDE_UNENCRYPTED_IND"));) + limLog(pMac, LOG1, + FL("Sending WDA_EXCLUDE_UNENCRYPTED_IND")); MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg(pMac, &msgQ); if (eSIR_SUCCESS != retCode) diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.h index a86a28d5227e..645cc866ad8e 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendMessages.h @@ -96,11 +96,6 @@ tSirRetStatus limSendHT40OBSSStopScanInd(tpAniSirGlobal pMac, tSirRetStatus limSendBeaconFilterInfo(tpAniSirGlobal pMac, tpPESession psessionEntry); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -tSirRetStatus limSendTdlsLinkEstablish(tpAniSirGlobal pMac, tANI_U8 bIsPeerResponder, tANI_U8 linkIdenOffset, \ - tANI_U8 ptiBufStatusOffset, tANI_U8 ptiFrameLen, tANI_U8 *ptiFrame, tANI_U8 *extCapability); -tSirRetStatus limSendTdlsLinkTeardown(tpAniSirGlobal pMac, tANI_U16 staId); -#endif #ifdef WLAN_FEATURE_11W tSirRetStatus limSendExcludeUnencryptInd(tpAniSirGlobal pMac, tANI_BOOLEAN excludeUnenc, diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c index 7fb6c7111cfc..ab22c5bde10b 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,7 +41,7 @@ #include "sirCommon.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sysDef.h" #include "cfgApi.h" @@ -116,7 +116,7 @@ limSendSmeRsp(tpAniSirGlobal pMac, tANI_U16 msgType, mmhMsg.type = msgType; mmhMsg.bodyptr = pSirSmeRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT { @@ -194,7 +194,7 @@ static void limSendSmeJoinReassocRspAfterResume( tpAniSirGlobal pMac, mmhMsg.type = pSirSmeJoinRsp->messageType; mmhMsg.bodyptr = pSirSmeJoinRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -310,9 +310,9 @@ limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType, limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s"), - limMsgStr(msgType), limResultCodeStr(resultCode));) + limMsgStr(msgType), limResultCodeStr(resultCode)); if(psessionEntry == NULL) { @@ -475,7 +475,21 @@ limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType, vos_mem_free( psessionEntry->assocRsp); psessionEntry->assocRsp = NULL; } +#ifdef WLAN_FEATURE_VOWIFI_11R + if(psessionEntry->ricData != NULL) + { + vos_mem_free( psessionEntry->ricData); + psessionEntry->ricData = NULL; + } +#endif +#ifdef FEATURE_WLAN_ESE + if(psessionEntry->tspecIes != NULL) + { + vos_mem_free(psessionEntry->tspecIes); + psessionEntry->tspecIes = NULL; + } +#endif } } @@ -563,8 +577,8 @@ limSendSmeStartBssRsp(tpAniSirGlobal pMac, tANI_U16 ieLen; tANI_U16 ieOffset, curLen; - PELOG1(limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s"), - limMsgStr(msgType), limResultCodeStr(resultCode));) + limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s"), + limMsgStr(msgType), limResultCodeStr(resultCode)); size = sizeof(tSirSmeStartBssRsp); @@ -659,11 +673,12 @@ limSendSmeStartBssRsp(tpAniSirGlobal pMac, mmhMsg.bodyval = 0; if(psessionEntry == NULL) { - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); } else { - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, mmhMsg.type)); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); @@ -714,10 +729,6 @@ limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length, tANI_U8 *pbBuf; tSirBssDescription *pDesc; - PELOG1(limLog(pMac, LOG1, - FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s"), - length, limResultCodeStr(resultCode));) - if (resultCode != eSIR_SME_SUCCESS) { limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId); @@ -768,7 +779,8 @@ limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length, pSirSmeScanRsp->length = curMsgLen; mmhMsg.bodyptr = pSirSmeScanRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, + mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); pSirSmeScanRsp = vos_mem_malloc(allocLength); if ( NULL == pSirSmeScanRsp ) @@ -787,17 +799,12 @@ limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length, } curMsgLen = msgLen; - PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d"), - msgLen, ptemp->bssDescription.length);) pDesc->length = ptemp->bssDescription.length; vos_mem_copy( (tANI_U8 *) &pDesc->bssId, (tANI_U8 *) &ptemp->bssDescription.bssId, ptemp->bssDescription.length); - PELOG2(limLog(pMac, LOG2, FL("BssId ")); - limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);) - pSirSmeScanRsp->sessionId = smesessionId; pSirSmeScanRsp->transcationId = smetranscationId; @@ -828,9 +835,8 @@ limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length, mmhMsg.type = eWNI_SME_SCAN_RSP; mmhMsg.bodyptr = pSirSmeScanRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); - PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS"));) + limLog(pMac, LOG1, FL("statusCode : eSIR_SME_SUCCESS")); } return; @@ -930,7 +936,8 @@ limSendSmeLfrScanRsp(tpAniSirGlobal pMac, tANI_U16 length, pSirSmeScanRsp->length = curMsgLen; mmhMsg.bodyptr = pSirSmeScanRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, + mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); pSirSmeScanRsp = vos_mem_malloc(allocLength); if ( NULL == pSirSmeScanRsp ) @@ -990,7 +997,7 @@ limSendSmeLfrScanRsp(tpAniSirGlobal pMac, tANI_U16 length, mmhMsg.type = eWNI_SME_SCAN_RSP; mmhMsg.bodyptr = pSirSmeScanRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS\n"));) } @@ -1025,9 +1032,9 @@ limPostSmeScanRspMessage(tpAniSirGlobal pMac, tpSirSmeScanRsp pSirSmeScanRsp; tSirMsgQ mmhMsg; - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("limPostSmeScanRspMessage: send SME_SCAN_RSP (len %d, reasonCode %s). "), - length, limResultCodeStr(resultCode));) + length, limResultCodeStr(resultCode)); pSirSmeScanRsp = vos_mem_malloc(length); if ( NULL == pSirSmeScanRsp ) @@ -1055,7 +1062,7 @@ limPostSmeScanRspMessage(tpAniSirGlobal pMac, mmhMsg.bodyptr = pSirSmeScanRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, (tANI_U16)resultCode, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT @@ -1223,7 +1230,7 @@ void limSendSmeDisassocDeauthNtf( tpAniSirGlobal pMac, mmhMsg.bodyptr = pMsg; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -1270,12 +1277,21 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSirSmeDisassocRsp; tSirSmeDisassocInd *pSirSmeDisassocInd; tANI_U32 *pMsg; + bool failure = FALSE; + + limLog(pMac, LOG1, FL("Disassoc Ntf with trigger : %d" + "reasonCode: %d"), + disassocTrigger, + reasonCode); switch (disassocTrigger) { case eLIM_PEER_ENTITY_DISASSOC: if (reasonCode != eSIR_SME_STA_NOT_ASSOCIATED) - return; + { + failure = TRUE; + goto error; + } case eLIM_HOST_DISASSOC: /** @@ -1289,10 +1305,10 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, // Log error limLog(pMac, LOGP, FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_RSP")); - - return; + failure = TRUE; + goto error; } - limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " + limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_RSP with " "retCode: %d for "MAC_ADDRESS_STR),reasonCode, MAC_ADDR_ARRAY(peerMacAddr)); pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP; @@ -1340,7 +1356,8 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, limLog(pMac, LOGP, FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_IND")); - return; + failure = TRUE; + goto error; } limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_IND with " "retCode: %d for "MAC_ADDRESS_STR),reasonCode, @@ -1372,15 +1389,16 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, break; } +error: /* Delete the PE session Created */ if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) || (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) ) { peDeleteSession(pMac,psessionEntry); } - - limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, - (tANI_U32*) pMsg ); + if (failure == FALSE) + limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, + (tANI_U32*) pMsg ); } /*** end limSendSmeDisassocNtf() ***/ @@ -1427,7 +1445,8 @@ limSendSmeDisassocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession pses mmhMsg.bodyptr = pSirSmeDisassocInd; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, + mmhMsg.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason); #endif //FEATURE_WLAN_DIAG_SUPPORT @@ -1624,7 +1643,7 @@ limSendSmeTDLSDeleteAllPeerInd(tpAniSirGlobal pMac, tpPESession psessionEntry) */ void limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac, - tpPESession psessionEntry, + tANI_U32 smeSessionId, tANI_U32 txCompleteStatus) { tSirMsgQ mmhMsg; @@ -1642,7 +1661,7 @@ limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac, pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd); //sessionId - pSirMgmtTxCompletionInd->sessionId = psessionEntry->smeSessionId; + pSirMgmtTxCompletionInd->sessionId = smeSessionId; pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus; @@ -1872,7 +1891,7 @@ limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusC } - MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT)) { vos_mem_free(pSirSmeWmStatusChangeNtf); @@ -1948,11 +1967,13 @@ limSendSmeSetContextRsp(tpAniSirGlobal pMac, mmhMsg.bodyval = 0; if(NULL == psessionEntry) { - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, + mmhMsg.type)); } else { - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, mmhMsg.type)); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT @@ -2030,11 +2051,12 @@ limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac, mmhMsg.bodyval = 0; if(NULL == psessionEntry) { - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); } else { - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, mmhMsg.type)); } limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } /*** end limSendSmeSetContextRsp() ***/ @@ -2170,7 +2192,7 @@ limSendSmeNeighborBssInd(tpAniSirGlobal pMac, msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND; msgQ.bodyptr = pNewBssInd; msgQ.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type)); limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); } /*** end limSendSmeNeighborBssInd() ***/ @@ -2216,11 +2238,12 @@ limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESe mmhMsg.bodyval = 0; if(NULL == psessionEntry) { - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); } else { - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, mmhMsg.type)); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0); @@ -2305,11 +2328,12 @@ limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpP mmhMsg.bodyval = 0; if(NULL == psessionEntry) { - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); } else { - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, + psessionEntry->peSessionId, mmhMsg.type)); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); @@ -2414,7 +2438,7 @@ limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) mmhMsg.bodyptr = stats; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2473,7 +2497,7 @@ limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) mmhMsg.bodyptr = stats; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2532,7 +2556,7 @@ limSendSmePEGetRoamRssiRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) mmhMsg.bodyptr = stats; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2589,7 +2613,7 @@ limSendSmePEEseTsmRsp(tpAniSirGlobal pMac, tAniGetTsmStatsRsp *pStats) mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP; mmhMsg.bodyptr = pStats; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2640,7 +2664,7 @@ limSendSmeIBSSPeerInd( mmhMsg.type = msgType; // mmhMsg.bodyval = (tANI_U32) pNewPeerInd; mmhMsg.bodyptr = pNewPeerInd; - MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -2681,8 +2705,8 @@ void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode) mmhMsg.bodyptr = pExitBmpsInd; mmhMsg.bodyval = 0; - PELOG1(limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. "));) - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. ")); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode); #endif //FEATURE_WLAN_DIAG_SUPPORT @@ -2748,7 +2772,7 @@ limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp, mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP; mmhMsg.bodyptr = aggrQosRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2773,7 +2797,7 @@ limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac) mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND; mmhMsg.bodyptr = NULL; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2797,7 +2821,7 @@ limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac) mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND; mmhMsg.bodyptr = NULL; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2823,9 +2847,9 @@ void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, pSmeMaxAssocInd->sessionId = smesessionId; mmhMsg.type = pSmeMaxAssocInd->mesgType; mmhMsg.bodyptr = pSmeMaxAssocInd; - PELOG1(limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR - " sme session id %d"), "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr));) - MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); + limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR + " sme session id %d"), "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr),smesessionId); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return; @@ -2858,9 +2882,8 @@ limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId) } pSirSmeCandidateFoundInd->messageType = eWNI_SME_CANDIDATE_FOUND_IND; - pSirSmeCandidateFoundInd->length = sizeof(tSirSmeDisassocInd); - - pSirSmeCandidateFoundInd->sessionId = sessionId; + pSirSmeCandidateFoundInd->length = sizeof(tSirSmeCandidateFoundInd); + pSirSmeCandidateFoundInd->sessionId = sessionId; limLog( pMac, LOGE, FL("posting candidate ind to SME")); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSerDesUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSerDesUtils.c index 2784ebcc3b81..cfe9ff94a6c4 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSerDesUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSerDesUtils.c @@ -739,6 +739,11 @@ limStartBssReqSerDes(tpAniSirGlobal pMac, tpSirSmeStartBssReq pStartBssReq, tANI len -= pStartBssReq->extendedRateSet.numRates; } +#ifdef WLAN_FEATURE_AP_HT40_24G + /* extract apHT40_24GEnabled */ + pStartBssReq->apHT40_24GEnabled = *pBuf++; + len--; +#endif if (len) { limLog(pMac, LOGW, FL("Extra bytes left in SME_START_BSS_REQ, len=%d"), len); @@ -963,6 +968,14 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) return eSIR_FAILURE; } + pJoinReq->bOSENAssociation = *pBuf++; + len--; + if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); + return eSIR_FAILURE; + } + // Extract cbMode pJoinReq->cbMode = *pBuf++; len--; @@ -1013,6 +1026,11 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) } } + //Extract rateBitMap + pJoinReq->rateBitMap = limGetU16(pBuf); + pBuf += sizeof(tANI_U16); + len -= sizeof(tANI_U16); + // Extract RSN IE pJoinReq->rsnIE.length = limGetU16(pBuf); pBuf += sizeof(tANI_U16); @@ -1076,7 +1094,7 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) if (pJoinReq->addIEScan.length) { // Check for IE length (that includes length of type & length) - if (pJoinReq->addIEScan.length > SIR_MAC_MAX_IE_LENGTH + 2) + if (pJoinReq->addIEScan.length > SIR_MAC_MAX_ADD_IE_LENGTH + 2) { limLog(pMac, LOGE, FL("Invalid addIE Scan length %d in SME_JOIN_REQ"), @@ -1303,11 +1321,11 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->supportedChannels.numChnl; len-= pJoinReq->supportedChannels.numChnl; - PELOG2(limLog(pMac, LOG2, + limLog(pMac, LOG1, FL("spectrumInd ON: minPower %d, maxPower %d , numChnls %d"), pJoinReq->powerCap.minTxPower, pJoinReq->powerCap.maxTxPower, - pJoinReq->supportedChannels.numChnl);) + pJoinReq->supportedChannels.numChnl); // Extract uapsdPerAcBitmask pJoinReq->uapsdPerAcBitmask = *pBuf++; @@ -1436,6 +1454,13 @@ limAssocIndSerDes(tpAniSirGlobal pMac, tpLimMlmAssocInd pAssocInd, tANI_U8 *pBuf limCopyU32(pBuf, pAssocInd->WmmStaInfoPresent); pBuf += sizeof(tANI_U32); mLen += sizeof(tANI_U32); + +#ifdef WLAN_FEATURE_AP_HT40_24G + limCopyU32(pBuf, pAssocInd->HT40MHzIntoPresent); + pBuf += sizeof(tANI_U32); + mLen += sizeof(tANI_U32); +#endif + // Fill in length of SME_ASSOC_IND message limCopyU16(pLen, mLen); diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSession.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSession.c index 3c853324e040..58b757186d7e 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSession.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSession.c @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -112,20 +109,23 @@ tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessi vos_mem_set((void*)&pMac->lim.gpSession[i], sizeof(tPESession), 0); //Allocate space for Station Table for this session. - pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = vos_mem_malloc( + pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = vos_mem_vmalloc( sizeof(tpDphHashNode)*numSta); if ( NULL == pMac->lim.gpSession[i].dph.dphHashTable.pHashTable ) { - limLog(pMac, LOGE, FL("memory allocate failed!")); + limLog(pMac, LOGE, FL("memory allocate for size %lu failed!"), + (long unsigned int) sizeof(tpDphHashNode)*numSta); return NULL; } - pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray = vos_mem_malloc( + pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray = vos_mem_vmalloc( sizeof(tDphHashNode)*numSta); if ( NULL == pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray ) { - limLog(pMac, LOGE, FL("memory allocate failed!")); - vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); + limLog(pMac, LOGE, FL("memory allocate failed for Node array" + "of size %lu"), + (long unsigned int) sizeof(tDphHashNode)*numSta); + vos_mem_vfree(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = NULL; return NULL; } @@ -134,13 +134,15 @@ tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessi dphHashTableClassInit(pMac, &pMac->lim.gpSession[i].dph.dphHashTable); - pMac->lim.gpSession[i].gpLimPeerIdxpool = vos_mem_malloc(sizeof( + pMac->lim.gpSession[i].gpLimPeerIdxpool = vos_mem_vmalloc(sizeof( *pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1)); if ( NULL == pMac->lim.gpSession[i].gpLimPeerIdxpool ) { - PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) - vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); - vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray); + limLog(pMac, LOGE, FL("memory allocate failed " + "for peerId pool of size %lu!"), (long unsigned int) + sizeof(*pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1)); + vos_mem_vfree(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); + vos_mem_vfree(pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray); pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = NULL; pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray = NULL; return NULL; @@ -195,7 +197,7 @@ tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessi return(&pMac->lim.gpSession[i]); } } - limLog(pMac, LOGE, FL("Session can not be created.. Reached Max permitted sessions \n ")); + limLog(pMac, LOGE, FL("Session can not be created.. Reached Max permitted sessions ")); return NULL; } @@ -228,7 +230,7 @@ tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_ } } - limLog(pMac, LOG4, FL("Session lookup fails for BSSID: \n ")); + limLog(pMac, LOG4, FL("Session lookup fails for BSSID: ")); limPrintMacAddr(pMac, bssid, LOG4); return(NULL); @@ -277,14 +279,13 @@ tpPESession peFindSessionByBssIdx(tpAniSirGlobal pMac, tANI_U8 bssIdx) { if(sessionId >= pMac->lim.maxBssId) { - limLog(pMac, LOGE, FL("Invalid sessionId: %d \n "), sessionId); + limLog(pMac, LOGE, FL("Invalid sessionId: %d "), sessionId); return(NULL); } if((pMac->lim.gpSession[sessionId].valid == TRUE)) { return(&pMac->lim.gpSession[sessionId]); } - limLog(pMac, LOG1, FL("Session %d not active\n "), sessionId); return(NULL); } @@ -345,6 +346,7 @@ void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry) tANI_U16 i = 0; tANI_U16 n; TX_TIMER *timer_ptr; + eHalStatus lock_status = eHAL_STATUS_SUCCESS; limLog(pMac, LOGW, FL("Trying to delete a session %d Opmode %d BssIdx %d" " BSSID: " MAC_ADDRESS_STR), psessionEntry->peSessionId, @@ -399,21 +401,26 @@ void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry) psessionEntry->pLimMlmJoinReq = NULL; } - if(psessionEntry->dph.dphHashTable.pHashTable != NULL) + lock_status = pe_AcquireGlobalLock(&pMac->lim); + if (eHAL_STATUS_SUCCESS == lock_status) { - vos_mem_free(psessionEntry->dph.dphHashTable.pHashTable); - psessionEntry->dph.dphHashTable.pHashTable = NULL; + if (psessionEntry->dph.dphHashTable.pHashTable != NULL) + { + vos_mem_vfree(psessionEntry->dph.dphHashTable.pHashTable); + psessionEntry->dph.dphHashTable.pHashTable = NULL; + } } + pe_ReleaseGlobalLock(&pMac->lim); if(psessionEntry->dph.dphHashTable.pDphNodeArray != NULL) { - vos_mem_free(psessionEntry->dph.dphHashTable.pDphNodeArray); + vos_mem_vfree(psessionEntry->dph.dphHashTable.pDphNodeArray); psessionEntry->dph.dphHashTable.pDphNodeArray = NULL; } if(psessionEntry->gpLimPeerIdxpool != NULL) { - vos_mem_free(psessionEntry->gpLimPeerIdxpool); + vos_mem_vfree(psessionEntry->gpLimPeerIdxpool); psessionEntry->gpLimPeerIdxpool = NULL; } @@ -522,7 +529,7 @@ tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U } } - limLog(pMac, LOG1, FL("Session lookup fails for Peer StaId: \n ")); + limLog(pMac, LOG1, FL("Session lookup fails for Peer StaId: ")); limPrintMacAddr(pMac, sa, LOG1); return NULL; } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.c index 3026a9dc3336..023672f48554 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.c @@ -253,7 +253,7 @@ isLimSessionOffChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) if(sessionId >= pMac->lim.maxBssId) { - limLog(pMac, LOGE, FL("Invalid sessionId: %d \n "), sessionId); + limLog(pMac, LOGE, FL("Invalid sessionId: %d "), sessionId); return FALSE; } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.h index 9e211dd73598..7e169f6607d6 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSessionUtils.h @@ -38,9 +38,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSmeReqUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSmeReqUtils.c index 07614f1fb741..03a9d8130495 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limSmeReqUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limSmeReqUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,7 +39,7 @@ */ #include "wniApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "sirApi.h" #include "schApi.h" @@ -114,7 +114,7 @@ limIsRSNieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirRSNie pRSNie) ) { limLog(pMac, LOGE, FL("RSN/WPA/WAPI EID %d not [%d || %d]"), - pRSNie->rsnIEdata[0], DOT11F_EID_RSN, + pRSNie->rsnIEdata[0], DOT11F_EID_RSN, DOT11F_EID_WPA); return false; } @@ -124,7 +124,7 @@ limIsRSNieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirRSNie pRSNie) while(len > 0) { // Check validity of RSN IE - if (pRSNie->rsnIEdata[startPos] == DOT11F_EID_RSN) + if (pRSNie->rsnIEdata[startPos] == DOT11F_EID_RSN) { if((pRSNie->rsnIEdata[startPos+1] > DOT11F_IE_RSN_MAX_LEN) || (pRSNie->rsnIEdata[startPos+1] < DOT11F_IE_RSN_MIN_LEN)) @@ -163,7 +163,7 @@ limIsRSNieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirRSNie pRSNie) { limLog(pMac, LOGE, FL("WAPI IE len %d not [%d,%d]"), - pRSNie->rsnIEdata[startPos+1], DOT11F_IE_WAPI_MIN_LEN, + pRSNie->rsnIEdata[startPos+1], DOT11F_IE_WAPI_MIN_LEN, DOT11F_IE_WAPI_MAX_LEN); return false; @@ -220,18 +220,18 @@ limIsAddieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirAddie pAddie) left -= 2; if(elem_len > left) { - limLog( pMac, LOGE, + limLog( pMac, LOGE, FL("****Invalid Add IEs eid = %d elem_len=%d left=%d*****"), elem_id,elem_len,left); return false; } - + left -= elem_len; ptr += (elem_len + 2); } // there shouldn't be any left byte - - + + return true; } /*** end limIsAddieValidInSmeReqMessage() ***/ @@ -255,12 +255,13 @@ limIsAddieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirAddie pAddie) */ tANI_U8 -limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, +limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, tpSirRSNie pRSNie, tpPESession pSessionEntry) { tANI_U8 wpaIndex = 0; tANI_U32 privacy, val; + tANI_U32 status; if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, &privacy) != eSIR_SUCCESS) @@ -294,7 +295,7 @@ limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, (pRSNie->rsnIEdata[0] != SIR_MAC_WPA_EID)) { limLog(pMac, LOGE, FL("RSN/WPA EID %d not [%d || %d]"), - pRSNie->rsnIEdata[0], SIR_MAC_RSN_EID, + pRSNie->rsnIEdata[0], SIR_MAC_RSN_EID, SIR_MAC_WPA_EID); return false; } @@ -307,7 +308,7 @@ limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, (pRSNie->rsnIEdata[1] < SIR_MAC_RSN_IE_MIN_LENGTH)) { limLog(pMac, LOGE, FL("RSN IE len %d not [%d,%d]"), - pRSNie->rsnIEdata[1], SIR_MAC_RSN_IE_MIN_LENGTH, + pRSNie->rsnIEdata[1], SIR_MAC_RSN_IE_MIN_LENGTH, SIR_MAC_RSN_IE_MAX_LENGTH); return false; } @@ -334,8 +335,17 @@ limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, limLog(pMac, LOG1, FL("Only RSN IE is present")); - dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2], - (tANI_U8)pRSNie->length,&pSessionEntry->gStartBssRSNIe); + status = dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2], + pRSNie->rsnIEdata[1], + &pSessionEntry->gStartBssRSNIe); + if (DOT11F_FAILED(status)) + { + limLog(pMac, + LOGE,FL("unpack failed for RSN IE (0x%08x)"), + status); + return false; + } + return true; } else if ((pRSNie->length == pRSNie->rsnIEdata[1] + 2) && (pRSNie->rsnIEdata[0] == SIR_MAC_WPA_EID)) @@ -344,8 +354,17 @@ limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, LOG1, FL("Only WPA IE is present")); - dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[6],(tANI_U8)pRSNie->length-4, - &pSessionEntry->gStartBssWPAIe); + status = dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[6], + pRSNie->rsnIEdata[1] - 4, + &pSessionEntry->gStartBssWPAIe); + if (DOT11F_FAILED(status)) + { + limLog(pMac, + LOGE,FL("unpack failed for WPA IE (0x%08x)"), + status); + return false; + } + return true; } // Check validity of WPA IE @@ -370,12 +389,24 @@ limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac, else { /* Both RSN and WPA IEs are present */ - dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2], - (tANI_U8)pRSNie->length,&pSessionEntry->gStartBssRSNIe); + status = dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2], + pRSNie->rsnIEdata[1], &pSessionEntry->gStartBssRSNIe); + if (DOT11F_FAILED(status)) + { + limLog(pMac,LOGE,FL("unpack failed for RSN IE status:(0x%08x)"), + status); + return false; + } - dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[wpaIndex + 6], + status = dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[wpaIndex + 6], pRSNie->rsnIEdata[wpaIndex + 1]-4, &pSessionEntry->gStartBssWPAIe); + if (DOT11F_FAILED(status)) + { + limLog(pMac, LOGE,FL("unpack failed for WPA IE status:(0x%08x)"), + status); + return false; + } } } @@ -530,9 +561,9 @@ limIsSmeStartBssReqValid(tpAniSirGlobal pMac, break; /* Added for BT AMP support */ - case eSIR_BTAMP_STA_MODE: + case eSIR_BTAMP_STA_MODE: break; - + /* Added for BT AMP support */ case eSIR_BTAMP_AP_MODE: break; @@ -540,7 +571,7 @@ limIsSmeStartBssReqValid(tpAniSirGlobal pMac, /* Added for SoftAP support */ case eSIR_INFRA_AP_MODE: break; - + default: /** * Should not have received start BSS req with bssType @@ -561,7 +592,7 @@ limIsSmeStartBssReqValid(tpAniSirGlobal pMac, if (!pStartBssReq->ssId.length || (pStartBssReq->ssId.length > SIR_MAC_MAX_SSID_LENGTH)) { - // Invalid length for SSID. + // Invalid length for SSID. // Reject START_BSS_REQ limLog(pMac, LOGW, FL("Invalid SSID length in eWNI_SME_START_BSS_REQ")); @@ -709,11 +740,11 @@ limIsSmeJoinReqValid(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq) } /* - Reject Join Req if the Self Mac Address and + Reject Join Req if the Self Mac Address and the Ap's Mac Address is same */ if ( vos_mem_compare( (tANI_U8* ) pJoinReq->selfMacAddr, - (tANI_U8 *) pJoinReq->bssDescription.bssId, + (tANI_U8 *) pJoinReq->bssDescription.bssId, (tANI_U8) (sizeof(tSirMacAddr)))) { // Log the event @@ -855,6 +886,13 @@ limIsSmeScanReqValid(tpAniSirGlobal pMac, tpSirSmeScanReq pScanReq) tANI_U8 valid = true; tANI_U8 i = 0; + if (pScanReq->numSsid > SIR_SCAN_MAX_NUM_SSID) + { + valid = false; + limLog(pMac, LOGE, FL("Number of SSIDs > SIR_SCAN_MAX_NUM_SSID")); + goto end; + } + for (i = 0; i < pScanReq->numSsid; i++) { if (pScanReq->ssId[i].length > SIR_MAC_MAX_SSID_LENGTH) @@ -862,10 +900,10 @@ limIsSmeScanReqValid(tpAniSirGlobal pMac, tpSirSmeScanReq pScanReq) limLog(pMac, LOGE, FL("Requested SSID length > SIR_MAC_MAX_SSID_LENGTH")); valid = false; - goto end; + goto end; } } - if (pScanReq->bssType > eSIR_AUTO_MODE) + if ((pScanReq->bssType < 0) || (pScanReq->bssType > eSIR_AUTO_MODE)) { limLog(pMac, LOGE, FL("Invalid BSS Type")); valid = false; @@ -974,7 +1012,7 @@ limIsSmeSetContextReqValid(tpAniSirGlobal pMac, tpSirSmeSetContextReq pSetConte (pSetContextReq->keyMaterial.edType != eSIR_ED_WEP104) && (pSetContextReq->keyMaterial.edType != eSIR_ED_NONE) && #ifdef FEATURE_WLAN_WAPI - (pSetContextReq->keyMaterial.edType != eSIR_ED_WPI) && + (pSetContextReq->keyMaterial.edType != eSIR_ED_WPI) && #endif !pSetContextReq->keyMaterial.numKeys) { @@ -1051,10 +1089,10 @@ limIsSmeSetContextReqValid(tpAniSirGlobal pMac, tpSirSmeSetContextReq pSetConte (pKey->keyLength != 13)) || ((pSetContextReq->keyMaterial.edType == eSIR_ED_TKIP) && (pKey->keyLength != 32)) || -#ifdef FEATURE_WLAN_WAPI +#ifdef FEATURE_WLAN_WAPI ((pSetContextReq->keyMaterial.edType == eSIR_ED_WPI) && (pKey->keyLength != 32)) || -#endif +#endif ((pSetContextReq->keyMaterial.edType == eSIR_ED_CCMP) && (pKey->keyLength != 16))) { diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.c index 5dd4a1e0da6d..0ff5c4403ffe 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -40,7 +40,7 @@ #include "limAssocUtils.h" #include "limSecurityUtils.h" #include "pmmApi.h" - +#include "limApi.h" // default value 5000 ms for background scan period when it is disabled #define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000 @@ -54,6 +54,8 @@ #define LIM_KEEPALIVE_TIMER_MS 3000 // Lim JoinProbeRequest Retry timer default (200)ms #define LIM_JOIN_PROBE_REQ_TIMER_MS 200 +#define LIM_AUTH_RETRY_TIMER_MS 60 + //default beacon interval value used in HB timer interval calculation #define LIM_HB_TIMER_BEACON_INTERVAL 100 @@ -257,7 +259,18 @@ limCreateTimers(tpAniSirGlobal pMac) limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer")); goto err_timer; } - + //Send Auth frame every 60 ms + if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer, + "Periodic AUTH Timer", + limTimerHandler, SIR_LIM_AUTH_RETRY_TIMEOUT, + SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0, + TX_NO_ACTIVATE)) != TX_SUCCESS) + { + /// Could not create Periodic Join Probe Request timer. + // Log error + limLog(pMac, LOGP, FL("could not create Periodic AUTH Timer timer")); + goto err_timer; + } if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, &cfgValue) != eSIR_SUCCESS) { @@ -455,39 +468,6 @@ limCreateTimers(tpAniSirGlobal pMac) FL("call to create background scan timer failed")); goto err_timer; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL - /* - * create TDLS timers.. - * a) TDLS discovery response timer. - */ - - if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, - &cfgValue) != eSIR_SUCCESS) - { - /* - * Could not get discovery response Timeout value - * from CFG. Log error. - */ - limLog(pMac, LOGP, - FL("could not retrieve ReassocFailureTimeout value")); - } - cfgValue = SYS_MS_TO_TICKS(cfgValue); - - /* - * create TDLS discovery response wait timer and activate it later - */ - if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer, - "TDLS discovery response WAIT", - limTimerHandler, - SIR_LIM_TDLS_DISCOVERY_RSP_WAIT, - cfgValue, 0, - TX_NO_ACTIVATE) != TX_SUCCESS) - { - limLog(pMac, LOGP, - FL("could not create TDLS discovery response wait timer")); - goto err_timer; - } -#endif } /** @@ -580,7 +560,7 @@ limCreateTimers(tpAniSirGlobal pMac) FL("could not retrieve mac preauth value")); } pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue; - pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_malloc(cfgValue*sizeof(tLimPreAuthNode)); + pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_vmalloc(cfgValue*sizeof(tLimPreAuthNode)); if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL) { limLog(pMac, LOGP, FL("AllocateMemory failed!")); @@ -733,6 +713,7 @@ limCreateTimers(tpAniSirGlobal pMac) tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); + tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer); tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer); tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer); tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer); @@ -744,7 +725,7 @@ limCreateTimers(tpAniSirGlobal pMac) if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable) { - vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable); + vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable); pMac->lim.gLimPreAuthTimerTable.pTable = NULL; } @@ -793,7 +774,7 @@ limTimerHandler(void *pMacGlobal, tANI_U32 param) msg.bodyptr = NULL; msg.bodyval = 0; - if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) + if ((statusCode = limPostMsgApiHighPri(pMac, &msg)) != eSIR_SUCCESS) limLog(pMac, LOGE, FL("posting message %X to LIM failed, reason=%d"), msg.type, statusCode); @@ -909,7 +890,16 @@ limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param) (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE)) { limLog(pMac, LOGE, FL("Reassoc timeout happened")); - if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT) +#ifdef FEATURE_WLAN_ESE + if (((pMac->lim.pSessionEntry->isESEconnection) && + (pMac->lim.reAssocRetryAttempt < + (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))|| + ((!pMac->lim.pSessionEntry->isESEconnection) && + (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)) + ) +#else + if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT) +#endif { limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry); pMac->lim.reAssocRetryAttempt++; @@ -999,8 +989,7 @@ void limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) { tANI_U32 val=0, val1=0; - - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); + tpPESession psessionEntry; switch (timerId) { @@ -1128,12 +1117,23 @@ limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) break; } } - if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer, - val, 0) != TX_SUCCESS) + if (val) { - // Could not change min channel timer. - // Log error - limLog(pMac, LOGP, FL("Unable to change periodic timer")); + if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer, + val, 0) != TX_SUCCESS) + { + // Could not change min channel timer. + // Log error + limLog(pMac, LOGE, FL("Unable to change periodic timer")); + } + } + else + { + limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values," + "value = %d minchannel time = %d" + "maxchannel time = %d"), val, + pMac->lim.gpLimMlmScanReq->minChannelTime, + pMac->lim.gpLimMlmScanReq->maxChannelTime); } break; @@ -1295,6 +1295,37 @@ limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) break; + case eLIM_AUTH_RETRY_TIMER: + + if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer) + != TX_SUCCESS) + { + // Could not deactivate Auth Retry Timer. + limLog(pMac, LOGP, + FL("Unable to deactivate Auth Retry timer")); + } + if ((psessionEntry = peFindSessionBySessionId(pMac, + pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId)) + == NULL) + { + limLog(pMac, LOGP, + FL("session does not exist for given SessionId : %d"), + pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId); + break; + } + /* 3/5 of the beacon interval*/ + val = psessionEntry->beaconParams.beaconInterval * 3/5; + val = SYS_MS_TO_TICKS(val); + if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer, + val, 0) != TX_SUCCESS) + { + // Could not change Auth Retry timer. + // Log error + limLog(pMac, LOGP, FL("Unable to change Auth Retry timer")); + } + + break; + case eLIM_ASSOC_FAIL_TIMER: if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) != TX_SUCCESS) @@ -1793,7 +1824,6 @@ limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEn return; } - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) return; @@ -1867,7 +1897,6 @@ limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) #endif limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); //only start the hearbeat-timer if the timeout value is non-zero if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0) @@ -2011,7 +2040,6 @@ void limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId) { tANI_U32 val; - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); switch (timerId) { @@ -2122,7 +2150,6 @@ limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_ void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry) { - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER)); pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId; if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) != TX_SUCCESS) @@ -2154,7 +2181,6 @@ void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessi void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode) { - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER)); if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS) { /// Could not activate auth rsp timer. @@ -2241,8 +2267,8 @@ limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param) tSirMsgQ msg; tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; - PELOG1(limLog(pMac, LOG1, - FL("ChannelSwitch Timer expired. Posting msg to LIM "));) + limLog(pMac, LOG1, + FL("ChannelSwitch Timer expired. Posting msg to LIM ")); msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT; msg.bodyval = (tANI_U32)param; @@ -2261,8 +2287,8 @@ limQuietTimerHandler(void *pMacGlobal, tANI_U32 param) msg.bodyval = (tANI_U32)param; msg.bodyptr = NULL; - PELOG1(limLog(pMac, LOG1, - FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));) + limLog(pMac, LOG1, + FL("Post SIR_LIM_QUIET_TIMEOUT msg. ")); limPostMsgApi(pMac, &msg); } @@ -2275,8 +2301,8 @@ limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param) msg.type = SIR_LIM_QUIET_BSS_TIMEOUT; msg.bodyval = (tANI_U32)param; msg.bodyptr = NULL; - PELOG1(limLog(pMac, LOG1, - FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));) + limLog(pMac, LOG1, + FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. ")); limPostMsgApi(pMac, &msg); } #if 0 diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.h index e623bffa1a81..19061826dc82 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTimerUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -68,21 +68,16 @@ enum #ifdef WLAN_FEATURE_VOWIFI_11R eLIM_FT_PREAUTH_RSP_TIMER, #endif - eLIM_REMAIN_CHN_TIMER, eLIM_PERIODIC_PROBE_REQ_TIMER, #ifdef FEATURE_WLAN_ESE eLIM_TSM_TIMER, -#endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL - eLIM_TDLS_DISCOVERY_RSP_WAIT, - eLIM_TDLS_LINK_SETUP_RSP_TIMEOUT, - eLIM_TDLS_LINK_SETUP_CNF_TIMEOUT, #endif eLIM_DISASSOC_ACK_TIMER, eLIM_DEAUTH_ACK_TIMER, eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER, eLIM_INSERT_SINGLESHOT_NOA_TIMER, - eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE + eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, + eLIM_AUTH_RETRY_TIMER }; #define LIM_DISASSOC_DEAUTH_ACK_TIMEOUT 500 diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTrace.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTrace.c index 955dc0d0ef88..68ea147fd2b3 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTrace.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTrace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -85,7 +82,6 @@ static tANI_U8* __limTraceGetTimerString( tANI_U16 timerId ) #ifdef WLAN_FEATURE_VOWIFI_11R CASE_RETURN_STRING(eLIM_FT_PREAUTH_RSP_TIMER); #endif - CASE_RETURN_STRING(eLIM_REMAIN_CHN_TIMER); CASE_RETURN_STRING(eLIM_PERIODIC_PROBE_REQ_TIMER); #ifdef FEATURE_WLAN_ESE CASE_RETURN_STRING(eLIM_TSM_TIMER); @@ -95,6 +91,7 @@ static tANI_U8* __limTraceGetTimerString( tANI_U16 timerId ) CASE_RETURN_STRING(eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); CASE_RETURN_STRING(eLIM_INSERT_SINGLESHOT_NOA_TIMER); CASE_RETURN_STRING(eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE); + CASE_RETURN_STRING(eLIM_AUTH_RETRY_TIMER); default: return( "UNKNOWN" ); break; @@ -154,104 +151,154 @@ void limTraceDump(tpAniSirGlobal pMac, tpvosTraceRecord pRecord, tANI_U16 recInd switch (pRecord->code) { case TRACE_CODE_MLM_STATE: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "MLM State:", limTraceGetMlmStateString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "MLM State:", + limTraceGetMlmStateString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_SME_STATE: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "SME State:", limTraceGetSmeStateString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "SME State:", + limTraceGetSmeStateString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_TX_MGMT: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "TX Mgmt:", frameSubtypeStr[pRecord->data], pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "TX Mgmt:", frameSubtypeStr[pRecord->data], pRecord->data); break; case TRACE_CODE_RX_MGMT: if (LIM_TRACE_MAX_SUBTYPES <= LIM_TRACE_GET_SUBTYPE(pRecord->data)) { - limLog(pMac, LOGE, "Wrong Subtype - %d", LIM_TRACE_GET_SUBTYPE(pRecord->data)); + limLog(pMac, LOG1, "Wrong Subtype - %d", + LIM_TRACE_GET_SUBTYPE(pRecord->data)); } else { - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(%d) SN: %d ", recIndex, pRecord->time, pRecord->session, - "RX Mgmt:", frameSubtypeStr[LIM_TRACE_GET_SUBTYPE(pRecord->data)], - LIM_TRACE_GET_SUBTYPE(pRecord->data), - LIM_TRACE_GET_SSN(pRecord->data) ); + limLog(pMac, + LOG1, "%04d %012u S%d %-14s %-30s(%d) SN: %d ", + recIndex, pRecord->time, pRecord->session, + "RX Mgmt:", + frameSubtypeStr[LIM_TRACE_GET_SUBTYPE(pRecord->data)], + LIM_TRACE_GET_SUBTYPE(pRecord->data), + LIM_TRACE_GET_SSN(pRecord->data)); } break; case TRACE_CODE_RX_MGMT_DROP: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(%d) ", recIndex, pRecord->time, pRecord->session, - "Drop RX Mgmt:", __limTraceGetMgmtDropReasonString((tANI_U16)pRecord->data), pRecord->data); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(%d)", + recIndex, pRecord->time, pRecord->session, + "Drop RX Mgmt:", + __limTraceGetMgmtDropReasonString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_RX_MGMT_TSF: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s0x%x(%d) ", recIndex, pRecord->time, pRecord->session, - "RX Mgmt TSF:", " ", pRecord->data, pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s0x%x(%d)", + recIndex, pRecord->time, pRecord->session, + "RX Mgmt TSF:", " ", pRecord->data, pRecord->data); break; case TRACE_CODE_TX_COMPLETE: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %d", recIndex, pRecord->time, pRecord->session, - "TX Complete", pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %d", + recIndex, pRecord->time, pRecord->session, + "TX Complete", pRecord->data); break; case TRACE_CODE_TX_SME_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "TX SME Msg:", macTraceGetSmeMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "TX SME Msg:", + macTraceGetSmeMsgString((tANI_U16)pRecord->data), + pRecord->data ); break; case TRACE_CODE_RX_SME_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) ? "Def/Drp LIM Msg:": "RX Sme Msg:", - macTraceGetSmeMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) + ? "Def/Drp LIM Msg:": "RX Sme Msg:", + macTraceGetSmeMsgString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_TX_WDA_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "TX WDA Msg:", macTraceGetWdaMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "TX WDA Msg:", + macTraceGetWdaMsgString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_RX_WDA_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) ? "Def/Drp LIM Msg:": "RX WDA Msg:", - macTraceGetWdaMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) + ? "Def/Drp LIM Msg:": "RX WDA Msg:", + macTraceGetWdaMsgString((tANI_U16)pRecord->data), + pRecord->data ); break; case TRACE_CODE_TX_LIM_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "TX LIM Msg:", macTraceGetLimMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "TX LIM Msg:", + macTraceGetLimMsgString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_RX_LIM_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) ? "Def/Drp LIM Msg:": "RX LIM Msg", - macTraceGetLimMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) + ? "Def/Drp LIM Msg:": "RX LIM Msg", + macTraceGetLimMsgString((tANI_U16)pRecord->data), + pRecord->data ); break; case TRACE_CODE_TX_CFG_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "TX CFG Msg:", macTraceGetCfgMsgString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "TX CFG Msg:", + macTraceGetCfgMsgString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_RX_CFG_MSG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) ? "Def/Drp LIM Msg:": "RX CFG Msg:", - macTraceGetCfgMsgString((tANI_U16)MAC_TRACE_GET_MSG_ID(pRecord->data)), - pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord->data) + ? "Def/Drp LIM Msg:": "RX CFG Msg:", + macTraceGetCfgMsgString + ((tANI_U16)MAC_TRACE_GET_MSG_ID(pRecord->data)), + pRecord->data); break; case TRACE_CODE_TIMER_ACTIVATE: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "Timer Actvtd", __limTraceGetTimerString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "Timer Actvtd", + __limTraceGetTimerString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_TIMER_DEACTIVATE: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) ", recIndex, pRecord->time, pRecord->session, - "Timer DeActvtd", __limTraceGetTimerString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "Timer DeActvtd", + __limTraceGetTimerString((tANI_U16)pRecord->data), + pRecord->data); break; case TRACE_CODE_INFO_LOG: - limLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x) \n", recIndex, pRecord->time, pRecord->session, - "INFORMATION_LOG", macTraceGetInfoLogString((tANI_U16)pRecord->data), pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + "INFORMATION_LOG", + macTraceGetInfoLogString((tANI_U16)pRecord->data), + pRecord->data); break; default : - limLog(pMac, LOGE, "%04d %012u S%d %-14s(%d) (0x%x) ", recIndex, pRecord->time, pRecord->session, - "Unknown Code", pRecord->code, pRecord->data ); + limLog(pMac, LOG1, "%04d %012u S%d %-14s(%d) (0x%x)", + recIndex, pRecord->time, pRecord->session, + "Unknown Code", pRecord->code, pRecord->data); break; } } @@ -277,6 +324,9 @@ void macTraceMsgTx(tpAniSirGlobal pMac, tANI_U8 session, tANI_U32 data) case SIR_CFG_MODULE_ID: macTrace(pMac, TRACE_CODE_TX_CFG_MSG, session, data); break; + default: + macTrace(pMac, moduleId, session, data); + break; } } @@ -300,6 +350,9 @@ void macTraceMsgTxNew(tpAniSirGlobal pMac, tANI_U8 module, tANI_U8 session, tANI case SIR_CFG_MODULE_ID: macTraceNew(pMac, module, TRACE_CODE_TX_CFG_MSG, session, data); break; + default: + macTrace(pMac, moduleId, session, data); + break; } } @@ -327,6 +380,9 @@ void macTraceMsgRx(tpAniSirGlobal pMac, tANI_U8 session, tANI_U32 data) case SIR_CFG_MODULE_ID: macTrace(pMac, TRACE_CODE_RX_CFG_MSG, session, data); break; + default: + macTrace(pMac, moduleId, session, data); + break; } } @@ -356,6 +412,9 @@ void macTraceMsgRxNew(tpAniSirGlobal pMac, tANI_U8 module, tANI_U8 session, tANI case SIR_CFG_MODULE_ID: macTraceNew(pMac, module, TRACE_CODE_RX_CFG_MSG, session, data); break; + default: + macTrace(pMac, moduleId, session, data); + break; } } @@ -399,6 +458,11 @@ tANI_U8* limTraceGetMlmStateString( tANI_U32 mlmState ) CASE_RETURN_STRING( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE); CASE_RETURN_STRING( eLIM_MLM_WT_REMOVE_STA_KEY_STATE); CASE_RETURN_STRING( eLIM_MLM_WT_SET_MIMOPS_STATE); +#if defined WLAN_FEATURE_VOWIFI_11R + CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE); + CASE_RETURN_STRING(eLIM_MLM_WT_FT_REASSOC_RSP_STATE); +#endif + CASE_RETURN_STRING(eLIM_MLM_P2P_LISTEN_STATE); default: return( "UNKNOWN" ); break; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTypes.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTypes.h index e4ae419390f2..1ad20b5c4234 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limTypes.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limTypes.h @@ -51,6 +51,7 @@ #include "limApi.h" #include "limDebug.h" +#include "limTrace.h" #include "limSendSmeRspMessages.h" #include "sysGlobal.h" #include "dphGlobal.h" @@ -257,6 +258,9 @@ typedef struct sLimMlmAssocInd tAniBool WmmStaInfoPresent; +#ifdef WLAN_FEATURE_AP_HT40_24G + tAniBool HT40MHzIntoPresent; +#endif // Required for indicating the frames to upper layer tANI_U32 beaconLength; @@ -296,6 +300,9 @@ typedef struct sLimMlmReassocInd tSirSupChnl supportedChannels; tAniBool WmmStaInfoPresent; +#ifdef WLAN_FEATURE_AP_HT40_24G + tAniBool HT40MHzIntoPresent; +#endif // Required for indicating the frames to upper layer tANI_U32 beaconLength; @@ -670,7 +677,8 @@ void limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxMetaInfo); tSirRetStatus limPopulateMacHeader(tpAniSirGlobal, tANI_U8*, tANI_U8, tANI_U8, tSirMacAddr,tSirMacAddr); tSirRetStatus limSendProbeReqMgmtFrame(tpAniSirGlobal, tSirMacSSid *, tSirMacAddr, tANI_U8, tSirMacAddr, tANI_U32, tANI_U32, tANI_U8 *); void limSendProbeRspMgmtFrame(tpAniSirGlobal, tSirMacAddr, tpAniSSID, short, tANI_U8, tpPESession, tANI_U8); -void limSendAuthMgmtFrame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr, tANI_U8,tpPESession); +void limSendAuthMgmtFrame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr, + tANI_U8, tpPESession , tAniBool); void limSendAssocReqMgmtFrame(tpAniSirGlobal, tLimMlmAssocReq *,tpPESession); void limSendReassocReqMgmtFrame(tpAniSirGlobal, tLimMlmReassocReq *,tpPESession); #ifdef WLAN_FEATURE_VOWIFI_11R @@ -690,6 +698,9 @@ void limSendAssocRspMgmtFrame(tpAniSirGlobal, tANI_U16, tANI_U16, tSirMacAddr, t void limSendNullDataFrame(tpAniSirGlobal, tpDphHashNode); void limSendDisassocMgmtFrame(tpAniSirGlobal, tANI_U16, tSirMacAddr, tpPESession, tANI_BOOLEAN waitForAck); void limSendDeauthMgmtFrame(tpAniSirGlobal, tANI_U16, tSirMacAddr, tpPESession, tANI_BOOLEAN waitForAck); +void limSendSmeDisassocDeauthNtf( tpAniSirGlobal pMac, + eHalStatus status, tANI_U32 *pCtx ); + void limContinueChannelScan(tpAniSirGlobal); tSirResultCodes limMlmAddBss(tpAniSirGlobal, tLimMlmStartReq *,tpPESession psessionEntry); @@ -711,18 +722,6 @@ tSirRetStatus limSendRadioMeasureReportActionFrame(tpAniSirGlobal, tANI_U8, tANI void limProcessIappFrame(tpAniSirGlobal, tANI_U8 *,tpPESession); #endif -#ifdef FEATURE_WLAN_TDLS_INTERNAL -tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, - tSirMacAddr peer_mac, tANI_U8 dialog, tpPESession psessionEntry); -tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, - tSirMacAddr peerMac, tANI_U8 dialog, tpPESession psessionEntry, - tANI_U8* addIe, tANI_U16 len); - -eHalStatus limTdlsPrepareSetupReqFrame(tpAniSirGlobal pMac, - tLimTdlsLinkSetupInfo *linkSetupInfo, - tANI_U8 dialog, tSirMacAddr peerMac, - tpPESession psessionEntry); -#endif #ifdef FEATURE_WLAN_TDLS void limInitTdlsData(tpAniSirGlobal, tpPESession); tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, @@ -735,7 +734,7 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf); void limSendSmeTDLSDeleteAllPeerInd(tpAniSirGlobal pMac, tpPESession psessionEntry); void limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac, - tpPESession psessionEntry, + tANI_U32 smeSessionId, tANI_U32 txCompleteStatus); tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry); eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, tpPESession); @@ -912,7 +911,10 @@ limPostSmeMessage(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) msg.bodyptr = pMsgBuf; msg.bodyval = 0; if (msgType > eWNI_SME_MSG_TYPES_BEGIN) + { + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msg.type)); limProcessSmeReqMessages(pMac, &msg); + } else limProcessMlmRspMessages(pMac, msgType, pMsgBuf); } /*** end limPostSmeMessage() ***/ @@ -955,6 +957,7 @@ limPostMlmMessage(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) msg.type = (tANI_U16) msgType; msg.bodyptr = pMsgBuf; msg.bodyval = 0; + MTRACE(macTraceMsgRx(pMac, NO_SESSION, msg.type)); limProcessMlmReqMessages(pMac, &msg); } /*** end limPostMlmMessage() ***/ @@ -1071,25 +1074,6 @@ void limSendP2PActionFrame(tpAniSirGlobal pMac, tpSirMsgQ pMsg); void limAbortRemainOnChan(tpAniSirGlobal pMac); tSirRetStatus __limProcessSmeNoAUpdate(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf); void limProcessRegdDefdSmeReqAfterNOAStart(tpAniSirGlobal pMac); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -void limProcessTdlsFrame(tpAniSirGlobal, tANI_U32 *); -void limProcessTdlsPublicActionFrame(tpAniSirGlobal pMac, tANI_U32 *pBd, - tpPESession) ; -#ifdef FEATURE_WLAN_TDLS_NEGATIVE -#define LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_DSCV_REQ 0x1 /* 5.1.4-5 */ -#define LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_SETUP_REQ 0x2 /* 5.2.4-16 */ -#define LIM_TDLS_NEGATIVE_STATUS_37_IN_SETUP_CNF 0x4 /* 5.2.4-10 */ -#define LIM_TDLS_NEGATIVE_SEND_REQ_TO_SETUP_REQ 0x8 /* 5.2.4-20/32 */ -#define LIM_TDLS_NEGATIVE_RSP_TIMEOUT_TO_SETUP_REQ 0x10 /* 5.2.3.4 */ -#define LIM_TDLS_NEGATIVE_TREAT_TDLS_PROHIBIT_AP 0x20 /* 5.2.4-49 */ - /* following is not paticularily tested in WFA test plan, but will help to validate our TDLS behavior in-house */ -#define LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_DSCV_RSP 0x40 -#define LIM_TDLS_NEGATIVE_WRONG_BSSID_IN_SETUP_RSP 0x80 - -void limTdlsSetNegativeBehavior(tpAniSirGlobal pMac, tANI_U8 value, tANI_BOOLEAN on); -#endif -#endif - void limProcessDisassocAckTimeout(tpAniSirGlobal pMac); void limProcessDeauthAckTimeout(tpAniSirGlobal pMac); eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac); @@ -1106,5 +1090,10 @@ void limProcessRxScanEvent(tpAniSirGlobal mac, void *buf); int limProcessRemainOnChnlReq(tpAniSirGlobal pMac, tANI_U32 *pMsg); void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data); +void limProcessMlmSpoofMacAddrRsp(tpAniSirGlobal pMac, tSirRetStatus rspStatus); +tSirRetStatus limProcessSmeSetTdls2040BSSCoexReq(tpAniSirGlobal pMac, + tANI_U32 *pMsgBuf); +tSirRetStatus limProcessSmeDelAllTdlsPeers(tpAniSirGlobal pMac, + tANI_U32 *pMsgBuf); #endif /* __LIM_TYPES_H */ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.c index 8b59d79974b1..11700b29a8ba 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015. The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -57,7 +57,7 @@ #include "limSession.h" #include "vos_nvitem.h" #ifdef WLAN_FEATURE_11W -#include "wniCfgAp.h" +#include "wniCfg.h" #endif /* Static global used to mark situations where pMac->lim.gLimTriggerBackgroundScanDuringQuietBss is SET @@ -91,6 +91,20 @@ static void limProcessChannelSwitchSuspendLink(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *ctx); +/** ------------------------------------------------------------- +\fn limCheck11BRateBitmap +\brief Verifies if basic rates are set. +\param tANI_U16 pRateBitmap +\return tANI_BOOLEAN - true or false + -------------------------------------------------------------*/ + +tANI_BOOLEAN limCheck11BRateBitmap(tANI_U16 pRateBitmap) +{ + return ( ( pRateBitmap & ( 1 << 0 ) ) || ( pRateBitmap & ( 1 << 1 ) ) || + ( pRateBitmap & ( 1 << 2 ) ) || + ( pRateBitmap & ( 1 << 3 ) ) ? 1 : 0 ) ; +} + /** ------------------------------------------------------------- \fn limAssignDialogueToken \brief Assigns dialogue token. @@ -562,6 +576,8 @@ char *limMsgStr(tANI_U32 msgType) return "eWNI_SME_DEAUTH_CNF"; case eWNI_SME_MIC_FAILURE_IND: return "eWNI_SME_MIC_FAILURE_IND"; + case eWNI_SME_LOST_LINK_PARAMS_IND: + return "eWNI_SME_LOST_LINK_PARAMS_IND"; case eWNI_SME_ADDTS_REQ: return "eWNI_SME_ADDTS_REQ"; case eWNI_SME_ADDTS_RSP: @@ -1012,6 +1028,10 @@ limCleanupMlm(tpAniSirGlobal pMac) tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); + // Deactivate and delete Auth Retry timer. + tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer); + tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer); + // Deactivate and delete Association failure timer. tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer); tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); @@ -1919,7 +1939,7 @@ limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeac pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); if(NULL == pStaDs) { - PELOG1(limLog(pMac, LOG1, FL("pStaDs is NULL"));) + limLog(pMac, LOG1, FL("pStaDs is NULL")); return; } limGetRfBand(pMac, &rfBand, psessionEntry); @@ -2578,6 +2598,7 @@ void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac) return; } channel = psessionEntry->gLimChannelSwitch.primaryChannel; + /* * This potentially can create issues if the function tries to set * channel while device is in power-save, hence putting an extra check @@ -2594,7 +2615,34 @@ void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac) /* Channel-switch timeout has occurred. reset the state */ psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_END; - + + /* + * If Lim allows Switch channel on same channel on which preauth + * is going on then LIM will not post resume link(WDA_FINISH_SCAN) + * during preauth rsp handling hence firmware may crash on ENTER/ + * EXIT BMPS request. + */ + if(pMac->ft.ftPEContext.pFTPreAuthReq) + { + limLog(pMac, LOGE, + FL("Avoid Switch Channel req during pre auth")); + return; + } + /* If link is already suspended mean some off + * channel operation or scan is in progress, Allowing + * Change channel here will lead to either Init Scan + * sent twice or missing Finish scan when change + * channel is completed, this may lead + * to driver in invalid state and crash. + */ + if (limIsLinkSuspended(pMac)) + { + limLog(pMac, LOGE, FL("Link is already suspended for " + "some other reason. Return here for sessionId:%d"), + pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId); + return; + } + /* Check if the AP is switching to a channel that we support. * Else, just don't bother to switch. Indicate HDD to look for a * better AP to associate @@ -2898,7 +2946,7 @@ void limProcessQuietTimeout(tpAniSirGlobal pMac) return; } - PELOG1(limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState);) + limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState); switch( psessionEntry->gLimSpecMgmt.quietState ) { case eLIM_QUIET_BEGIN: @@ -3019,7 +3067,7 @@ void limProcessQuietBssTimeout( tpAniSirGlobal pMac ) return; } - PELOG1(limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState);) + limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState); if (eLIM_AP_ROLE == psessionEntry->limSystemRole) { } @@ -3279,8 +3327,8 @@ void limSwitchChannelCback(tpAniSirGlobal pMac, eHalStatus status, mmhMsg.bodyptr = pSirSmeSwitchChInd; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); - + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, + mmhMsg.type)); SysProcessMmhMsg(pMac, &mmhMsg); } @@ -3302,8 +3350,8 @@ void limSwitchPrimaryChannel(tpAniSirGlobal pMac, tANI_U8 newChannel,tpPESession tANI_U32 localPwrConstraint; #endif - PELOG3(limLog(pMac, LOG3, FL("limSwitchPrimaryChannel: old chnl %d --> new chnl %d "), - psessionEntry->currentOperChannel, newChannel);) + limLog(pMac, LOG1, FL(" old chnl %d --> new chnl %d "), + psessionEntry->currentOperChannel, newChannel); psessionEntry->currentReqChannel = newChannel; psessionEntry->limRFBand = limGetRFBand(newChannel); @@ -5497,10 +5545,10 @@ limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr pe tsinfo = pDeltsReq->req.wmeTspecPresent ? &pDeltsReq->req.tspec.tsinfo : &pDeltsReq->req.tsinfo; - PELOG1(limLog(pMac, LOG1, + limLog(pMac, LOG1, FL("received DELTS_REQ message (wmeTspecPresent = %d, lleTspecPresent = %d, wsmTspecPresent = %d, tsid %d, up %d, direction = %d)"), pDeltsReq->req.wmeTspecPresent, pDeltsReq->req.lleTspecPresent, pDeltsReq->req.wsmTspecPresent, - tsinfo->traffic.tsid, tsinfo->traffic.userPrio, tsinfo->traffic.direction);) + tsinfo->traffic.tsid, tsinfo->traffic.userPrio, tsinfo->traffic.direction); // if no Access Control, ignore the request @@ -5871,9 +5919,9 @@ if((psessionEntry = peFindSessionByBssid(pMac,pDelTsParam->bssId,&sessionId))== PELOGE(limLog(pMac, LOGE, FL("limValidateDeltsReq failed"));) goto error2; } - PELOG1(limLog(pMac, LOG1, "Sent DELTS request to station with " - "assocId = %d MacAddr = "MAC_ADDRESS_STR, - pDelTsReq->aid, MAC_ADDR_ARRAY(peerMacAddr));) + limLog(pMac, LOG1, "Sent DELTS request to station with " + "assocId = %d MacAddr = "MAC_ADDRESS_STR, + pDelTsReq->aid, MAC_ADDR_ARRAY(peerMacAddr)); limSendDeltsReqActionFrame(pMac, peerMacAddr, pDelTsReq->req.wmeTspecPresent, &pDelTsReq->req.tsinfo, &pDelTsReq->req.tspec, psessionEntry); @@ -6270,6 +6318,8 @@ tSirMsgQ msgQ; if (!(IS_HWSTA_IDX(pSta->staIndex))) { retCode = eHAL_STATUS_FAILURE; + limLog( pMac, LOGE, + FL( "Sta Id is not HW Sta Id, return code is %d " ), retCode); goto returnFailure; } #endif //WLAN_SOFTAP_VSTA_FEATURE @@ -6744,11 +6794,11 @@ void limFrameTransmissionControl(tpAniSirGlobal pMac, tLimQuietTxMode type, tLim if (mode == eLIM_STOP_TX) { - PELOG1(limLog(pMac, LOG1, FL("Stopping the transmission of all packets, indicated softmac"));) + limLog(pMac, LOG1, FL("Stopping the transmission of all packets, indicated softmac")); } else { - PELOG1(limLog(pMac, LOG1, FL("Resuming the transmission of all packets, indicated softmac"));) + limLog(pMac, LOG1, FL("Resuming the transmission of all packets, indicated softmac")); } return; } @@ -7062,7 +7112,7 @@ void limSetTspecUapsdMask(tpAniSirGlobal pMac, tSirMacTSInfo *pTsInfo, tANI_U32 tANI_U16 direction = pTsInfo->traffic.direction; tANI_U8 ac = upToAc(userPrio); - PELOG1(limLog(pMac, LOG1, FL(" Set UAPSD mask for AC %d, direction %d, action=%d (1=set,0=clear) "),ac, direction, action );) + limLog(pMac, LOG1, FL(" Set UAPSD mask for AC %d, direction %d, action=%d (1=set,0=clear) "),ac, direction, action ); /* Converting AC to appropriate Uapsd Bit Mask * AC_BE(0) --> UAPSD_BITOFFSET_ACVO(3) @@ -7371,6 +7421,8 @@ void limHandleDeferMsgError(tpAniSirGlobal pMac, tpSirMsgQ pLimMsg) { if(SIR_BB_XPORT_MGMT_MSG == pLimMsg->type) { + /*Decrement the Pending count before droping */ + limDecrementPendingMgmtCount (pMac); vos_pkt_return_packet((vos_pkt_t*)pLimMsg->bodyptr); } else if(pLimMsg->bodyptr != NULL) @@ -7456,7 +7508,7 @@ void limProcessAddStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) mmhMsg.type = eWNI_SME_ADD_STA_SELF_RSP; mmhMsg.bodyptr = pRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -7495,7 +7547,7 @@ void limProcessDelStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) mmhMsg.type = eWNI_SME_DEL_STA_SELF_RSP; mmhMsg.bodyptr = pRsp; mmhMsg.bodyval = 0; - MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } @@ -8060,7 +8112,13 @@ void limPmfSaQueryTimerHandler(void *pMacGlobal, tANI_U32 param) pSta->pmfSaQueryRetryCount++; if (pSta->pmfSaQueryRetryCount >= maxRetries) { - limLog(pMac, LOG1, FL("SA Query timed out")); + limLog(pMac, LOGE, + FL("SA Query timed out,Deleting STA: " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pSta->staAddr)); + limSendDisassocMgmtFrame(pMac, + eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON, + pSta->staAddr, psessionEntry, FALSE); + limTriggerSTAdeletion(pMac, pSta, psessionEntry); pSta->pmfSaQueryState = DPH_SA_QUERY_TIMED_OUT; return; } @@ -8203,6 +8261,19 @@ void limInitOBSSScanParams(tpAniSirGlobal pMac, } psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel = cfgValue; + + if (wlan_cfgGetInt(pMac, + WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR, &cfgValue) + != eSIR_SUCCESS) + { + limLog(pMac, LOGE, FL("Fail to retrieve" + "WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR value")); + return ; + } + psessionEntry->obssHT40ScanParam.BSSWidthChannelTransitionDelayFactor = + cfgValue; + + if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD , &cfgValue) != eSIR_SUCCESS) { @@ -8376,6 +8447,29 @@ void limParseBeaconForTim(tpAniSirGlobal pMac,tANI_U8* pRxPacketInfo, tpPESessio return; } +void limUpdateMaxRateFlag(tpAniSirGlobal pMac, + tANI_U8 smeSessionId, + tANI_U32 maxRateFlag) +{ + tpSirSmeUpdateMaxRateParams pRsp; + tSirMsgQ msg; + + pRsp = vos_mem_malloc(sizeof(tSirSmeUpdateMaxRateParams)); + if (NULL == pRsp) + { + limLog(pMac, LOGP, FL("Memory allocation failed")); + return; + } + vos_mem_set((tANI_U8*)pRsp, sizeof(tSirSmeUpdateMaxRateParams), 0); + pRsp->maxRateFlag = maxRateFlag; + pRsp->smeSessionId = smeSessionId; + msg.type = eWNI_SME_UPDATE_MAX_RATE_IND; + msg.bodyptr = pRsp; + msg.bodyval = 0; + limSysProcessMmhMsgApi(pMac, &msg, ePROT); + return; +} + void limDecrementPendingMgmtCount (tpAniSirGlobal pMac) { if( pMac->sys.gSysBbtPendingMgmtCount ) @@ -8387,3 +8481,82 @@ void limDecrementPendingMgmtCount (tpAniSirGlobal pMac) else limLog(pMac, LOGW, FL("Pending Management count going negative")); } + +eHalStatus limTxBdComplete(tpAniSirGlobal pMac, void *pData) +{ + tpSirTxBdStatus pTxBdStatus; + + if (!pData) + { + limLog(pMac, LOGE, FL("pData is NULL")); + return eHAL_STATUS_FAILURE; + } + + pTxBdStatus = (tpSirTxBdStatus) pData; + + limLog(pMac, LOG1, FL("txBdToken %u, txBdStatus %u"), + pTxBdStatus->txBdToken, pTxBdStatus->txCompleteStatus); + return eHAL_STATUS_SUCCESS; +} + +/** + * lim_is_robust_mgmt_action_frame() - Check if action catagory is + * robust action frame + * @action_catagory: Action frame catagory. + * + * This function is used to check if given action catagory is robust + * action frame. + * + * Return: bool + */ +bool lim_is_robust_mgmt_action_frame(uint8 action_catagory) +{ + switch (action_catagory) { + /* + * NOTE: This function doesn't take care of the DMG + * (Directional Multi-Gigatbit) BSS case as 8011ad + * support is not yet added. In future, if the support + * is required then this function need few more arguments + * and little change in logic. + */ + case SIR_MAC_ACTION_SPECTRUM_MGMT: + case SIR_MAC_ACTION_QOS_MGMT: + case SIR_MAC_ACTION_DLP: + case SIR_MAC_ACTION_BLKACK: + case SIR_MAC_ACTION_RRM: + case SIR_MAC_ACTION_FAST_BSS_TRNST: + case SIR_MAC_ACTION_SA_QUERY: + case SIR_MAC_ACTION_PROT_DUAL_PUB: + case SIR_MAC_ACTION_WNM: + case SIR_MAC_ACITON_MESH: + case SIR_MAC_ACTION_MHF: + case SIR_MAC_ACTION_FST: + return true; + default: + VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, + FL("non-PMF action category[%d] "), + action_catagory); + break; + } + return false; +} + +/** + * lim_compute_ext_cap_ie_length - compute the length of ext cap ie + * based on the bits set + * @ext_cap: extended IEs structure + * + * Return: length of the ext cap ie, 0 means should not present + */ +tANI_U8 lim_compute_ext_cap_ie_length (tDot11fIEExtCap *ext_cap) { + tANI_U8 i = DOT11F_IE_EXTCAP_MAX_LEN; + + while (i) { + if (ext_cap->bytes[i-1]) { + break; + } + i --; + } + + return i; +} diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.h index 196cd26c2842..b5aef8a0784e 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -61,6 +61,8 @@ typedef enum #define LIM_MAX_REASSOC_RETRY_LIMIT 2 #endif +#define LIM_MAX_BANDS ( 48 ) + // classifier ID is coded as 0-3: tsid, 4-5:direction #define LIM_MAKE_CLSID(tsid, dir) (((tsid) & 0x0F) | (((dir) & 0x03) << 4)) @@ -103,6 +105,7 @@ typedef enum offset { BW20, BW40PLUS, BW40MINUS, + BW80, BWALL } offset_t; @@ -110,9 +113,10 @@ typedef struct op_class_map { tANI_U8 op_class; tANI_U8 ch_spacing; offset_t offset; - tANI_U8 channels[15]; + tANI_U8 channels[25]; }op_class_map_t; // LIM utility functions +tANI_BOOLEAN limCheck11BRateBitmap(tANI_U16 RateBitmap); void limGetBssidFromPkt(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U32 *); char * limMlmStateStr(tLimMlmStates state); char * limSmeStateStr(tLimSmeStates state); @@ -508,12 +512,6 @@ void peSetResumeChannel(tpAniSirGlobal pMac, tANI_U16 channel, ePhyChanBondState --------------------------------------------------------------------------*/ void peGetResumeChannel(tpAniSirGlobal pMac, tANI_U8* resumeChannel, ePhyChanBondState* resumePhyCbState); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -tANI_U8 limTdlsFindLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac, tLimTdlsLinkSetupPeer **setupPeer); -void limTdlsDelLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac); -void limStartTdlsTimer(tpAniSirGlobal pMac, tANI_U8 sessionId, TX_TIMER *timer, tANI_U32 timerId, - tANI_U16 timerType, tANI_U32 timerMsg); -#endif void limGetShortSlotFromPhyMode(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U32 phyMode, tANI_U8 *pShortSlotEnable); @@ -550,5 +548,17 @@ tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, void limParseBeaconForTim(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpPESession psessionEntry); +void limUpdateMaxRateFlag(tpAniSirGlobal pMac, + tANI_U8 smeSessionId, + tANI_U32 maxRateFlag); + +extern tANI_U32 limGetMaxRateFlags(tpDphHashNode pStaDs, + tpPESession psessionEntry); + void limDecrementPendingMgmtCount (tpAniSirGlobal pMac); + +eHalStatus limTxBdComplete(tpAniSirGlobal pMac, void *pData); +bool lim_is_robust_mgmt_action_frame(uint8 action_catagory); +tANI_U8 lim_compute_ext_cap_ie_length (tDot11fIEExtCap *ext_cap); + #endif /* __LIM_UTILS_H */ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmAP.c b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmAP.c index fb36c490a6f0..528626e40710 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmAP.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmAP.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -44,7 +44,7 @@ #include "schApi.h" #include "limApi.h" #include "cfgApi.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "pmmApi.h" #include "pmmDebug.h" diff --git a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmApi.c b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmApi.c index 48a220a0b492..cf537ad9f276 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmApi.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sirCommon.h" #include "aniGlobal.h" @@ -222,6 +222,8 @@ void pmmInitBmpsResponseHandler(tpAniSirGlobal pMac, tpSirMsgQ limMsg ) if (NULL == limMsg->bodyptr) { PELOGE(pmmLog(pMac, LOGE, FL("pmmBmps: Received SIR_HAL_ENTER_BMPS_RSP with NULL "));) + nextState = ePMM_STATE_READY; + retStatus = eSIR_SME_BMPS_REQ_FAILED; goto failure; } pEnterBmpsParams = (tpEnterBmpsParams)(limMsg->bodyptr); @@ -230,8 +232,8 @@ void pmmInitBmpsResponseHandler(tpAniSirGlobal pMac, tpSirMsgQ limMsg ) //If response is failure, then send the response back to PMC and reset its state. if(pEnterBmpsParams->status == eHAL_STATUS_SUCCESS) { - PELOG2(pmmLog(pMac, LOG2, - FL("pmmBmps: Received successful response from HAL to enter BMPS_POWER_SAVE "));) + pmmLog(pMac, LOG1, + FL("pmmBmps: Received successful response from HAL to enter BMPS_POWER_SAVE ")); pMac->pmm.gPmmState = ePMM_STATE_BMPS_SLEEP; @@ -259,7 +261,7 @@ void pmmInitBmpsResponseHandler(tpAniSirGlobal pMac, tpSirMsgQ limMsg ) FL("pmmBmps: BMPS_INIT_PWR_SAVE_REQ failed, informing SME"));) pmmBmpsUpdateInitFailureCnt(pMac); - nextState = ePMM_STATE_BMPS_WAKEUP; + nextState = ePMM_STATE_READY; retStatus = eSIR_SME_BMPS_REQ_FAILED; goto failure; } @@ -340,7 +342,9 @@ void pmmExitBmpsRequestHandler(tpAniSirGlobal pMac, tpExitBmpsInfo pExitBmpsInfo /* send wakeup request, only when in sleep state */ PELOGW(pmmLog(pMac, LOGW, FL("pmmBmps: Sending eWNI_PMC_EXIT_BMPS_REQ to HAL"));) - if (pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) + + if ((pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) || + (pMac->pmm.gPmmState == ePMM_STATE_UAPSD_SLEEP)) { /* Store the reason code for exiting BMPS. This value will be * checked when PMM receives SIR_HAL_EXIT_BMPS_RSP from HAL @@ -363,8 +367,8 @@ void pmmExitBmpsRequestHandler(tpAniSirGlobal pMac, tpExitBmpsInfo pExitBmpsInfo } else { - PELOG1(pmmLog(pMac, LOG1, - FL("pmmBmps: eWNI_PMC_EXIT_BMPS_REQ was successfully sent to HAL"));) + pmmLog(pMac, LOG1, + FL("pmmBmps: eWNI_PMC_EXIT_BMPS_REQ was successfully sent to HAL")); } } else @@ -596,7 +600,7 @@ tSirRetStatus pmmSendChangePowerSaveMsg(tpAniSirGlobal pMac) return retStatus; } - PELOG1(pmmLog(pMac, LOG1, FL("WDA_EXIT_BMPS_REQ has been successfully sent to HAL"));) + pmmLog(pMac, LOG1, FL("WDA_EXIT_BMPS_REQ has been successfully sent to HAL")); return retStatus; } @@ -677,7 +681,7 @@ tSirRetStatus pmmSendInitPowerSaveMsg(tpAniSirGlobal pMac,tpPESession psessionE (tANI_U8)GET_MIN_VALUE((tANI_U8) numBeaconPerRssiAverage, WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE_STAMAX); pmmLog (pMac, LOG1, - "%s: [INFOLOG]RssiFilterInfo..%d %x %x", __func__, (int)pBmpsParams->bRssiFilterEnable, + "%s: RssiFilterInfo..%d %x %x", __func__, (int)pBmpsParams->bRssiFilterEnable, (unsigned int)pBmpsParams->rssiFilterPeriod, (unsigned int)pBmpsParams->numBeaconPerRssiAverage); msgQ.type = WDA_ENTER_BMPS_REQ; @@ -685,8 +689,8 @@ tSirRetStatus pmmSendInitPowerSaveMsg(tpAniSirGlobal pMac,tpPESession psessionE msgQ.bodyptr = pBmpsParams; msgQ.bodyval = 0; - PELOG2(pmmLog( pMac, LOG2, - FL( "pmmBmps: Sending WDA_ENTER_BMPS_REQ" ));) + pmmLog( pMac, LOG1, + FL( "pmmBmps: Sending WDA_ENTER_BMPS_REQ" )); /* we need to defer any incoming messages until we get a * WDA_ENTER_BMPS_RSP from HAL. @@ -792,7 +796,7 @@ tSirRetStatus pmmSendPowerSaveCfg(tpAniSirGlobal pMac, tpSirPowerSaveCfg pUpdate msgQ.bodyptr = pUpdatedPwrSaveCfg; msgQ.bodyval = 0; - PELOG1(pmmLog( pMac, LOG1, FL( "pmmBmps: Sending WDA_PWR_SAVE_CFG to HAL"));) + pmmLog( pMac, LOG1, FL( "pmmBmps: Sending WDA_PWR_SAVE_CFG to HAL")); MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) { @@ -885,6 +889,7 @@ void pmmExitBmpsResponseHandler(tpAniSirGlobal pMac, tpSirMsgQ limMsg) { case eHAL_STATUS_SUCCESS: retStatus = eSIR_SME_SUCCESS; + pMac->pmm.gPmmState = ePMM_STATE_BMPS_WAKEUP; /* Update wakeup statistics */ pmmUpdateWakeupStats(pMac); break; @@ -896,14 +901,13 @@ void pmmExitBmpsResponseHandler(tpAniSirGlobal pMac, tpSirMsgQ limMsg) * But, PMC will be informed about the error. */ retStatus = eSIR_SME_BMPS_REQ_FAILED; + pMac->pmm.gPmmState = ePMM_STATE_BMPS_SLEEP; pmmBmpsUpdateWakeupReqFailureCnt(pMac); } break; } - pMac->pmm.gPmmState = ePMM_STATE_BMPS_WAKEUP; - // turn on background scan pMac->sys.gSysEnableScanMode = true; @@ -972,7 +976,7 @@ void pmmMissedBeaconHandler(tpAniSirGlobal pMac) (pMac->lim.gLimTimersCreated)) { if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &beaconInterval) != eSIR_SUCCESS) - PELOG1(pmmLog(pMac, LOG1, FL("Fail to get BEACON_INTERVAL value"));) + pmmLog(pMac, LOG1, FL("Fail to get BEACON_INTERVAL value")); /* Change timer to reactivate it in future */ heartBeatInterval= SYS_MS_TO_TICKS(beaconInterval * heartBeatInterval); @@ -980,7 +984,7 @@ void pmmMissedBeaconHandler(tpAniSirGlobal pMac) if( tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, (tANI_U32)heartBeatInterval, 0) != TX_SUCCESS) { - PELOG1(pmmLog(pMac, LOG1, FL("Fail to change HeartBeat timer"));) + pmmLog(pMac, LOG1, FL("Fail to change HeartBeat timer")); } /* update some statistics */ @@ -1091,8 +1095,8 @@ void pmmExitBmpsIndicationHandler(tpAniSirGlobal pMac, tANI_U8 mode, eHalStatus */ case eHAL_STATUS_HEARTBEAT_TMOUT: { - PELOG1(pmmLog(pMac, LOG1, - FL("pmmBmps: The device woke up due to HeartBeat Timeout"));) + pmmLog(pMac, LOG1, + FL("pmmBmps: The device woke up due to HeartBeat Timeout")); /* Proceed only if HeartBeat timer is created */ if((pMac->lim.limTimers.gLimHeartBeatTimer.pMac) && @@ -1108,8 +1112,8 @@ void pmmExitBmpsIndicationHandler(tpAniSirGlobal pMac, tANI_U8 mode, eHalStatus if(tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, (tANI_U32)heartBeatInterval, 0) != TX_SUCCESS) { - PELOG1(pmmLog(pMac, LOG1, - FL("pmmBmps: Unable to change HeartBeat timer"));) + pmmLog(pMac, LOG1, + FL("pmmBmps: Unable to change HeartBeat timer")); } /* update some statistics */ @@ -1500,8 +1504,8 @@ void pmmEnterImpsRequestHandler (tpAniSirGlobal pMac) } else { - PELOG1(pmmLog(pMac, LOG1, - FL("pmmImps: Waiting for SoftMac response for IMPS request"));) + pmmLog(pMac, LOG1, + FL("pmmImps: Waiting for SoftMac response for IMPS request")); } return; @@ -1539,6 +1543,7 @@ void pmmEnterImpsResponseHandler (tpAniSirGlobal pMac, eHalStatus rspStatus) { tPmmState nextState = pMac->pmm.gPmmState; tSirResultCodes resultCode = eSIR_SME_SUCCESS; + static int failCnt = 0; /* we need to process all the deferred messages enqueued since * the initiating the WDA_ENTER_IMPS_REQ. @@ -1562,8 +1567,8 @@ void pmmEnterImpsResponseHandler (tpAniSirGlobal pMac, eHalStatus rspStatus) //if success, change the state to IMPS sleep mode pMac->pmm.gPmmState = ePMM_STATE_IMPS_SLEEP; - PELOG2(pmmLog(pMac, LOG2, - FL("pmmImps: Received successful WDA_ENTER_IMPS_RSP from HAL"));) + pmmLog(pMac, LOG1, + FL("pmmImps: Received successful WDA_ENTER_IMPS_RSP from HAL")); //update power save statistics pmmImpsUpdatePwrSaveStats(pMac); @@ -1575,18 +1580,20 @@ void pmmEnterImpsResponseHandler (tpAniSirGlobal pMac, eHalStatus rspStatus) else { // go back to previous state if request failed - nextState = ePMM_STATE_IMPS_WAKEUP; + nextState = ePMM_STATE_READY; resultCode = eSIR_SME_CANNOT_ENTER_IMPS; goto failure; } return; failure: - PELOGE(pmmLog(pMac, LOGE, + if (!(failCnt & 0xF)) + PELOGE(pmmLog(pMac, LOGE, FL("pmmImpsSleepRsp failed, Ret Code: %d, next state will be: %d"), rspStatus, pMac->pmm.gPmmState);) + failCnt++; pmmImpsUpdateSleepErrStats(pMac, rspStatus); pMac->pmm.gPmmState = nextState; @@ -1711,8 +1718,8 @@ void pmmExitImpsResponseHandler(tpAniSirGlobal pMac, eHalStatus rspStatus) { resultCode = eSIR_SME_SUCCESS; pMac->pmm.gPmmState = ePMM_STATE_IMPS_WAKEUP; - PELOG2(pmmLog(pMac, LOG2, - FL("pmmImps: Received WDA_EXIT_IMPS_RSP with Successful response from HAL"));) + pmmLog(pMac, LOG1, + FL("pmmImps: Received WDA_EXIT_IMPS_RSP with Successful response from HAL")); //update power save statistics pmmImpsUpdateWakeupStats(pMac); } @@ -1787,11 +1794,14 @@ void pmmEnterUapsdRequestHandler (tpAniSirGlobal pMac) { PELOGE(pmmLog(pMac, LOGE, FL("pmmUapsd: HAL_ENTER_UAPSD_REQ failed with response: %x"), retStatus);) - resultCode = eSIR_SME_UAPSD_REQ_FAILED; + if (retStatus == eSIR_PMM_INVALID_REQ) + resultCode = eSIR_SME_UAPSD_REQ_INVALID; + else + resultCode = eSIR_SME_UAPSD_REQ_FAILED; goto failure; } - PELOG1(pmmLog(pMac, LOG1, FL("pmmUapsd: Waiting for WDA_ENTER_UAPSD_RSP "));) + pmmLog(pMac, LOG1, FL("pmmUapsd: Waiting for WDA_ENTER_UAPSD_RSP ")); return; failure: @@ -2510,12 +2520,12 @@ tSirRetStatus pmmImpsSendChangePwrSaveMsg(tpAniSirGlobal pMac, tANI_U8 mode) if (SIR_PM_SLEEP_MODE == mode) { msgQ.type = WDA_ENTER_IMPS_REQ; - PELOG2(pmmLog (pMac, LOG2, FL("Sending WDA_ENTER_IMPS_REQ to HAL"));) + pmmLog (pMac, LOG1, FL("Sending WDA_ENTER_IMPS_REQ to HAL")); } else { msgQ.type = WDA_EXIT_IMPS_REQ; - PELOG2(pmmLog (pMac, LOG2, FL("Sending WDA_EXIT_IMPS_REQ to HAL"));) + pmmLog (pMac, LOG1, FL("Sending WDA_EXIT_IMPS_REQ to HAL")); } msgQ.reserved = 0; @@ -2678,6 +2688,22 @@ tSirRetStatus pmmUapsdSendChangePwrSaveMsg (tpAniSirGlobal pMac, tANI_U8 mode) pUapsdParams->viTriggerEnabled, pUapsdParams->voTriggerEnabled);) + if (pUapsdParams->bkDeliveryEnabled == 0 && + pUapsdParams->beDeliveryEnabled == 0 && + pUapsdParams->viDeliveryEnabled == 0 && + pUapsdParams->voDeliveryEnabled == 0 && + pUapsdParams->bkTriggerEnabled == 0 && + pUapsdParams->beTriggerEnabled == 0 && + pUapsdParams->viTriggerEnabled == 0 && + pUapsdParams->voTriggerEnabled == 0) + { + limLog(pMac, LOGW, FL("No Need to enter UAPSD since Trigger " + "Enabled and Delivery Enabled Mask is zero for all ACs")); + vos_mem_free(pUapsdParams); + retStatus = eSIR_PMM_INVALID_REQ; + return retStatus; + } + PELOGW(pmmLog (pMac, LOGW, FL("pmmUapsd: Sending WDA_ENTER_UAPSD_REQ to HAL"));) } else diff --git a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmDebug.c b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmDebug.c index b0cecd1e522d..202b9b1660cf 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmDebug.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/pmm/pmmDebug.c @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c b/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c index f96d18040ad9..2ddd349cb482 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,7 +45,7 @@ #include "wniApi.h" #include "sirApi.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "limTypes.h" #include "limUtils.h" #include "limSendSmeRspMessages.h" @@ -450,7 +450,8 @@ rrmProcessNeighborReportResponse( tpAniSirGlobal pMac, //Send request to SME. mmhMsg.type = pSmeNeighborRpt->messageType; mmhMsg.bodyptr = pSmeNeighborRpt; - MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, pSessionEntry->peSessionId, + mmhMsg.type)); status = limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); return status; @@ -655,21 +656,33 @@ rrmProcessBeaconReportReq( tpAniSirGlobal pMac, pSmeBcnReportReq->channelList.numChannels = num_channels; if( pBeaconReq->measurement_request.Beacon.num_APChannelReport ) { - tANI_U8 *pChanList = pSmeBcnReportReq->channelList.channelNumber; - for( num_APChanReport = 0 ; num_APChanReport < pBeaconReq->measurement_request.Beacon.num_APChannelReport ; num_APChanReport++ ) - { - vos_mem_copy(pChanList, - pBeaconReq->measurement_request.Beacon.APChannelReport[num_APChanReport].channelList, - pBeaconReq->measurement_request.Beacon.APChannelReport[num_APChanReport].num_channelList); - - pChanList += pBeaconReq->measurement_request.Beacon.APChannelReport[num_APChanReport].num_channelList; + tANI_U8 *ch_lst = pSmeBcnReportReq->channelList.channelNumber; + tANI_U8 len; + tANI_U16 ch_ctr = 0; + for(num_APChanReport = 0; + num_APChanReport < + pBeaconReq->measurement_request.Beacon.num_APChannelReport; + num_APChanReport++) { + len = pBeaconReq->measurement_request.Beacon. + APChannelReport[num_APChanReport].num_channelList; + if (ch_ctr + len > + sizeof(pSmeBcnReportReq->channelList.channelNumber)) + break; + + vos_mem_copy(&ch_lst[ch_ctr], + pBeaconReq->measurement_request.Beacon. + APChannelReport[num_APChanReport].channelList, + len); + + ch_ctr += len; } } //Send request to SME. mmhMsg.type = eWNI_SME_BEACON_REPORT_REQ_IND; mmhMsg.bodyptr = pSmeBcnReportReq; - MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, mmhMsg.type)); + MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, pSessionEntry->peSessionId, + mmhMsg.type)); return limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/sch/schApi.c b/drivers/staging/prima/CORE/MAC/src/pe/sch/schApi.c index 24bee2c20a7a..45b4e1c5d0a1 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/sch/schApi.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/sch/schApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,7 +39,7 @@ */ #include "palTypes.h" #include "aniGlobal.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "sirMacProtDef.h" #include "sirMacPropExts.h" @@ -243,7 +243,7 @@ schSendStartScanRsp(tpAniSirGlobal pMac) tSirMsgQ msgQ; tANI_U32 retCode; - PELOG1(schLog(pMac, LOG1, FL("Sending LIM message to go into scan"));) + schLog(pMac, LOG1, FL("Sending SIR_SCH_START_SCAN_RSP to LIM")); msgQ.type = SIR_SCH_START_SCAN_RSP; if ((retCode = limPostMsgApi(pMac, &msgQ)) != eSIR_SUCCESS) schLog(pMac, LOGE, diff --git a/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconGen.c b/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconGen.c index 031380c9e668..8def5f3a89f7 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconGen.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconGen.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "sirMacProtDef.h" @@ -338,15 +338,33 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn PopulateDot11fHTCaps( pMac,psessionEntry, &pBcn2->HTCaps ); PopulateDot11fHTInfo( pMac, &pBcn2->HTInfo, psessionEntry ); } + +#ifdef WLAN_FEATURE_AP_HT40_24G + if ((pMac->roam.configParam.apHT40_24GEnabled) + && (IS_DOT11_MODE_HT(psessionEntry->dot11mode))) + { + PopulateDot11fOBSSScanParameters( pMac, &pBcn2->OBSSScanParameters, + psessionEntry); + /* 10.15.8 Support of DSSS/CCK in 40 MHz, An associated HT STA in + * a 20/40 MHz BSS may generate DSSS/CCK transmissions. Set DSSS/CCK + * Mode in 40 MHz bit in HT capablity. + */ + pBcn2->HTCaps.dsssCckMode40MHz = 1; + } +#endif + + PopulateDot11fExtCap( pMac, &pBcn2->ExtCap, psessionEntry); + #ifdef WLAN_FEATURE_11AC if(psessionEntry->vhtCapability) { schLog( pMac, LOGW, FL("Populate VHT IEs in Beacon")); - PopulateDot11fVHTCaps( pMac, &pBcn2->VHTCaps, eSIR_TRUE ); - PopulateDot11fVHTOperation( pMac, &pBcn2->VHTOperation); + PopulateDot11fVHTCaps( pMac, &pBcn2->VHTCaps, + psessionEntry->currentOperChannel, eSIR_TRUE ); + PopulateDot11fVHTOperation( pMac, &pBcn2->VHTOperation, + psessionEntry->currentOperChannel); // we do not support multi users yet //PopulateDot11fVHTExtBssLoad( pMac, &bcn2.VHTExtBssLoad); - PopulateDot11fExtCap( pMac, &pBcn2->ExtCap, psessionEntry); if(psessionEntry->gLimOperatingMode.present) PopulateDot11fOperatingMode( pMac, &pBcn2->OperatingMode, psessionEntry ); } @@ -617,6 +635,31 @@ void limUpdateProbeRspTemplateIeBitmapBeacon2(tpAniSirGlobal pMac, sizeof(beacon2->HTInfo)); } +#ifdef WLAN_FEATURE_AP_HT40_24G + // Overlapping BSS Scan Parameters IE + if (pMac->roam.configParam.apHT40_24GEnabled) + { + if (beacon2->OBSSScanParameters.present) + { + SetProbeRspIeBitmap(DefProbeRspIeBitmap, + SIR_MAC_OBSS_SCAN_PARAMETERS_EID); + vos_mem_copy((void *)&prb_rsp->OBSSScanParameters, + (void *)&beacon2->OBSSScanParameters, + sizeof(beacon2->OBSSScanParameters)); + } + + if (beacon2->ExtCap.present) + { + SetProbeRspIeBitmap(DefProbeRspIeBitmap, + SIR_MAC_EXTENDED_CAPABILITIES_EID); + vos_mem_copy((void *)&prb_rsp->ExtCap, + (void *)&beacon2->ExtCap, + sizeof(beacon2->ExtCap)); + + } + } +#endif + #ifdef WLAN_FEATURE_11AC if(beacon2->VHTCaps.present) { diff --git a/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconProcess.c b/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconProcess.c index c24a31426b47..89c509272ce4 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconProcess.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/sch/schBeaconProcess.c @@ -38,7 +38,7 @@ */ #include "palTypes.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "cfgApi.h" #include "pmmApi.h" @@ -131,7 +131,8 @@ ap_beacon_process( if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| //if erp not present then 11B AP overlapping - (pBcnStruct->erpPresent && + (!pMac->roam.configParam.ignorePeerErpInfo && + pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { @@ -158,7 +159,8 @@ ap_beacon_process( if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| //if erp not present then 11B AP overlapping - (pBcnStruct->erpPresent && + (!pMac->roam.configParam.ignorePeerErpInfo && + pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { @@ -200,7 +202,8 @@ ap_beacon_process( //then we need to enable protection from 11g station. //we don't need protection from 11b because if that's needed then our operating //mode would have already been set to legacy in the previous blocks. - if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode) + if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode + && !pMac->roam.configParam.ignorePeerHTopMode) { if((eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) && (eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode)) @@ -405,8 +408,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, bi = psessionEntry->beaconParams.beaconInterval; if (bi != pBeacon->beaconInterval) { - PELOG1(schLog(pMac, LOG1, FL("Beacon interval changed from %d to %d"), - pBeacon->beaconInterval, bi);) + schLog(pMac, LOG1, FL("Beacon interval changed from %d to %d"), + pBeacon->beaconInterval, bi); bi = pBeacon->beaconInterval; psessionEntry->beaconParams.beaconInterval = (tANI_U16) bi; @@ -466,7 +469,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, sendProbeReq = TRUE; } - if ( psessionEntry->htCapability && pBeacon->HTInfo.present ) + if ( psessionEntry->htCapability && pBeacon->HTInfo.present && + (!LIM_IS_IBSS_ROLE(psessionEntry))) { limUpdateStaRunTimeHTSwitchChnlParams( pMac, &pBeacon->HTInfo, bssIdx,psessionEntry); } @@ -490,7 +494,7 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, /* Update the channel bonding mode only if channel bonding * mode is enabled in INI. */ - if ( (pStaDs != NULL) && + if ( (pStaDs != NULL) && (HAL_STA_INVALID_IDX != pStaDs->staIndex ) && (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != channelBondingMode) ) { /* Following check is related to HT40 on 2.4GHz mode*/ @@ -515,6 +519,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, pBeacon->HTInfo.recommendedTxWidthSet; pStaDs->htSecondaryChannelOffset = pBeacon->HTInfo.secondaryChannelOffset; + limUpdateMaxRateFlag(pMac, psessionEntry->smeSessionId, + limGetMaxRateFlags(pStaDs, psessionEntry)); } } } @@ -535,7 +541,7 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, /* Update the channel bonding mode only if channel bonding * mode is enabled in INI. */ - if ( (NULL != pStaDs) && + if ( (NULL != pStaDs) && (HAL_STA_INVALID_IDX != pStaDs->staIndex ) && (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != channelBondingMode) ) { if (psessionEntry->vhtCapability && pBeacon->OperatingMode.present ) @@ -546,30 +552,25 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ; if (operMode != pBeacon->OperatingMode.chanWidth) { - PELOG1(schLog(pMac, LOG1, + schLog(pMac, LOG1, FL(" received OpMode Chanwidth %d, staIdx = %d"), pBeacon->OperatingMode.chanWidth, - pStaDs->staIndex);) - PELOG1(schLog(pMac, LOG1, FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"), - pMh->sa[0], - pMh->sa[1], - pMh->sa[2], - pMh->sa[3], - pMh->sa[4], - pMh->sa[5]);) + pStaDs->staIndex); + schLog(pMac, LOG1, FL(" MAC -" MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pMh->sa)); if (pBeacon->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ) { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 80MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 80MHz")); pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; } else if (pBeacon->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ) { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 40MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 40MHz")); pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; @@ -577,8 +578,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, else if (pBeacon->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ) { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 20MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 20MHz")); pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; @@ -593,23 +594,18 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, operMode = pStaDs->vhtSupportedChannelWidthSet; if (operMode != pBeacon->VHTOperation.chanWidth) { - PELOG1(schLog(pMac, LOG1, + schLog(pMac, LOG1, FL(" received VHTOP CHWidth %d staIdx = %d"), pBeacon->VHTOperation.chanWidth, - pStaDs->staIndex);) - PELOG1(schLog(pMac, LOG1, FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"), - pMh->sa[0], - pMh->sa[1], - pMh->sa[2], - pMh->sa[3], - pMh->sa[4], - pMh->sa[5]);) + pStaDs->staIndex); + schLog(pMac, LOG1, FL(" MAC -" MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pMh->sa)); if (pBeacon->VHTOperation.chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 80MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 80MHz")); pStaDs->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; @@ -622,16 +618,16 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; if (pBeacon->HTCaps.supportedChannelWidthSet) { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 40MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 40MHz")); pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; chWidth = eHT_CHANNEL_WIDTH_40MHZ; } else { - PELOG1(schLog(pMac, LOG1, - FL("Updating the CH Width to 20MHz"));) + schLog(pMac, LOG1, + FL("Updating the CH Width to 20MHz")); pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; chWidth = eHT_CHANNEL_WIDTH_20MHZ; @@ -649,7 +645,6 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, /* Obtain the Max Tx power for the current regulatory */ regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); #endif - #if defined WLAN_FEATURE_VOWIFI { tPowerdBm localRRMConstraint = 0; @@ -707,8 +702,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, if(beaconParams.paramChangeBitmap) { - PELOGW(schLog(pMac, LOGW, FL("Beacon for session[%d] got changed. "), psessionEntry->peSessionId);) - PELOGW(schLog(pMac, LOGW, FL("sending beacon param change bitmap: 0x%x "), beaconParams.paramChangeBitmap);) + schLog(pMac, LOGW, FL("Beacon for session[%d] got changed. "), psessionEntry->peSessionId); + schLog(pMac, LOGW, FL("sending beacon param change bitmap: 0x%x "), beaconParams.paramChangeBitmap); limSendBeaconParams(pMac, &beaconParams, psessionEntry); } @@ -754,7 +749,6 @@ void schBeaconProcess(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpPESession p return; } - if (beaconStruct.ssidPresent) { beaconStruct.ssId.ssId[beaconStruct.ssId.length] = 0; @@ -786,8 +780,10 @@ void schBeaconProcess(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpPESession p { //Update the beacons and apply the new settings to HAL schSetFixedBeaconFields(pMac, pAPSession); - PELOG1(schLog(pMac, LOG1, FL("Beacon for PE session[%d] got changed. "), pAPSession->peSessionId);) - PELOG1(schLog(pMac, LOG1, FL("sending beacon param change bitmap: 0x%x "), beaconParams.paramChangeBitmap);) + schLog(pMac, LOG1, FL("Beacon for PE session[%d] got changed."), + pAPSession->peSessionId); + schLog(pMac, LOG1, FL("sending beacon param change bitmap: 0x%x "), + beaconParams.paramChangeBitmap); limSendBeaconParams(pMac, &beaconParams, pAPSession); } } diff --git a/drivers/staging/prima/CORE/MAC/src/pe/sch/schMessage.c b/drivers/staging/prima/CORE/MAC/src/pe/sch/schMessage.c index bd33de47d557..083a7c8009c5 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/sch/schMessage.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/sch/schMessage.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,7 +38,7 @@ #include "palTypes.h" #include "sirCommon.h" -#include "wniCfgSta.h" +#include "wniCfg.h" #include "aniGlobal.h" #include "cfgApi.h" #include "limApi.h" diff --git a/drivers/staging/prima/CORE/SAP/inc/sapApi.h b/drivers/staging/prima/CORE/SAP/inc/sapApi.h index 1c92e0760775..1d935d02dbf3 100644 --- a/drivers/staging/prima/CORE/SAP/inc/sapApi.h +++ b/drivers/staging/prima/CORE/SAP/inc/sapApi.h @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2010 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -189,7 +187,6 @@ typedef enum { eSAP_ASSOC_STA_CALLBACK_EVENT, /*Event sent when user called WLANSAP_GetAssocStations */ eSAP_GET_WPSPBC_SESSION_EVENT, /* Event send when user call WLANSAP_getWpsSessionOverlap */ eSAP_WPS_PBC_PROBE_REQ_EVENT, /* Event send on WPS PBC probe request is received */ - eSAP_INDICATE_MGMT_FRAME, eSAP_REMAIN_CHAN_READY, eSAP_SEND_ACTION_CNF, eSAP_DISCONNECT_ALL_P2P_CLIENT, @@ -396,7 +393,6 @@ typedef struct sap_Event_s { tSap_AssocStaListEvent sapAssocStaListEvent; /*SAP_ASSOC_STA_CALLBACK_EVENT */ tSap_GetWPSPBCSessionEvent sapGetWPSPBCSessionEvent; /*SAP_GET_WPSPBC_SESSION_EVENT */ tSap_WPSPBCProbeReqEvent sapPBCProbeReqEvent; /*eSAP_WPS_PBC_PROBE_REQ_EVENT */ - tSap_ManagementFrameInfo sapManagementFrameInfo; /*eSAP_INDICATE_MGMT_FRAME*/ tSap_SendActionCnf sapActionCnf; /* eSAP_SEND_ACTION_CNF */ tSap_UnknownSTAJoinEvent sapUnknownSTAJoin; /* eSAP_UNKNOWN_STA_JOIN */ tSap_MaxAssocExceededEvent sapMaxAssocExceeded; /* eSAP_MAX_ASSOC_EXCEEDED */ @@ -1005,7 +1001,12 @@ WLANSAP_StopBss VOS_STATUS WLANSAP_DisassocSta ( - v_PVOID_t pvosGCtx, v_U8_t *pPeerStaMac + v_PVOID_t pvosGCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_U8_t *pPeerStaMac +#else + v_U8_t *pPeerStaMac +#endif ); /*========================================================================== diff --git a/drivers/staging/prima/CORE/SAP/src/sapApiLinkCntl.c b/drivers/staging/prima/CORE/SAP/src/sapApiLinkCntl.c index fc56481ffb2d..e5447cfdce4e 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapApiLinkCntl.c +++ b/drivers/staging/prima/CORE/SAP/src/sapApiLinkCntl.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -74,6 +71,9 @@ #include "sme_Api.h" // SAP Internal API header file #include "sapInternal.h" +#ifdef WLAN_FEATURE_AP_HT40_24G +#include "vos_utils.h" +#endif /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants @@ -104,36 +104,870 @@ * Function Declarations and Documentation * -------------------------------------------------------------------------*/ +/*========================================================================== + FUNCTION sapSetOperatingChannel() + + DESCRIPTION + Set SAP Operating Channel + + DEPENDENCIES + NA. + + PARAMETERS + + IN + *pContext : The second context pass in for the caller (sapContext) + operChannel : SAP Operating Channel + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +void sapSetOperatingChannel(ptSapContext psapContext, v_U8_t operChannel) +{ + v_U8_t i = 0; + v_U32_t event; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SAP Channel : %d"), psapContext->channel); + + if (operChannel == SAP_CHANNEL_NOT_SELECTED) +#ifdef SOFTAP_CHANNEL_RANGE + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("No suitable channel selected")); + + if ( eCSR_BAND_ALL == psapContext->scanBandPreference || + psapContext->allBandScanned == eSAP_TRUE) + { + if(psapContext->channelList != NULL) + { + psapContext->channel = SAP_DEFAULT_CHANNEL; + for ( i = 0 ; i < psapContext->numofChannel ; i++) + { + if (NV_CHANNEL_ENABLE == + vos_nv_getChannelEnabledState(psapContext->channelList[i])) + { + psapContext->channel = psapContext->channelList[i]; + break; + } + } + } + else + { + /* if the channel list is empty then there is no valid channel + in the selected sub-band so select default channel in the + BAND(2.4GHz) as 2.4 channels are available in all the + countries*/ + psapContext->channel = SAP_DEFAULT_CHANNEL; + } + } + else + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Has scan band preference")); + if (eCSR_BAND_24 == psapContext->currentPreferredBand) + psapContext->currentPreferredBand = eCSR_BAND_5G; + else + psapContext->currentPreferredBand = eCSR_BAND_24; + + psapContext->allBandScanned = eSAP_TRUE; + //go back to DISCONNECT state, scan next band + psapContext->sapsMachine = eSAP_DISCONNECTED; + event = eSAP_CHANNEL_SELECTION_FAILED; + } + } +#else + psapContext->channel = SAP_DEFAULT_CHANNEL; +#endif + else + { + psapContext->channel = operChannel; + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SAP Channel : %d"), psapContext->channel); +} + +#ifdef WLAN_FEATURE_AP_HT40_24G +/*========================================================================== + FUNCTION sap_ht2040_timer_cb() + + DESCRIPTION + SAP HT40 timer CallBack, Once this function execute it will move SAP + from HT20 to HT40 + + DEPENDENCIES + NA. + + PARAMETERS + + IN + usrDataForCallback : The second context pass in for the caller (sapContext) + + RETURN VALUE + SIDE EFFECTS +============================================================================*/ +void sap_ht2040_timer_cb(v_PVOID_t usrDataForCallback) +{ + v_U8_t cbMode; + tHalHandle hHal; + eHalStatus halStatus = eHAL_STATUS_SUCCESS; + ptSapContext sapContext = (ptSapContext)usrDataForCallback; + eSapPhyMode sapPhyMode; + + hHal = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, + sapContext->pvosGCtx); + if (NULL == hHal) + { + /* we have a serious problem */ + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL, + FL("Invalid hHal")); + return; + } + + cbMode = sme_GetChannelBondingMode24G(hHal); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Current Channel bonding : %d"), cbMode); + + if(cbMode) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL, + FL("Already in HT40 Channel bonding : %d"), cbMode); + return; + } + + sapPhyMode = + sapConvertSapPhyModeToCsrPhyMode(sapContext->csrRoamProfile.phyMode); + + sme_SelectCBMode(hHal, sapPhyMode, sapContext->channel); + + cbMode = sme_GetChannelBondingMode24G(hHal); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Selected Channel bonding : %d"), cbMode); + + if(cbMode) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Move SAP from HT20 to HT40")); + + if (cbMode == eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY) + cbMode = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + else if (cbMode == eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY) + cbMode = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + + halStatus = sme_SetHT2040Mode(hHal, sapContext->sessionId, cbMode); + + if (halStatus == eHAL_STATUS_FAILURE ) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to change HT20/40 mode")); + } + } +} + +/*========================================================================== + FUNCTION sapCheckHT2040CoexAction() + + DESCRIPTION + Check 20/40 Coex Info + + DEPENDENCIES + NA. + + PARAMETERS + + IN + ptSapContext : The second context pass in for the caller (sapContext) + tpSirHT2040CoexInfoInd : 20/40 Coex info + + RETURN VALUE + The eHalStatus code associated with performing the operation + + eHAL_STATUS_SUCCESS: Success + + SIDE EFFECTS +============================================================================*/ +void sapCheckHT2040CoexAction(ptSapContext psapCtx, + tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd) +{ + v_U8_t i; + v_U8_t isHT40Allowed = 1; + tHalHandle hHal; + v_U8_t cbMode; + eHalStatus halStatus; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + unsigned int delay; + + /* tHalHandle */ + hHal = VOS_GET_HAL_CB(psapCtx->pvosGCtx); + + if (NULL == hHal) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("In invalid hHal")); + return; + } + + // Get Channel Bonding Mode + cbMode = sme_GetChannelBondingMode24G(hHal); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Current Channel Bonding Mode: %d"), + cbMode); + + if (pSmeHT2040CoexInfoInd->HT20MHzBssWidthReq) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("20 MHz BSS width request bit is " + "set in 20/40 coexistence info")); + isHT40Allowed = 0; + } + + if (pSmeHT2040CoexInfoInd->HT40MHzIntolerant) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("40 MHz intolerant bit is set in " + "20/40 coexistence info")); + isHT40Allowed = 0; + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Total Reported 20/40 BSS Intolerant Channels :%d"), + pSmeHT2040CoexInfoInd->channel_num); + + if ((0 == psapCtx->affected_start) && (0 == psapCtx->affected_end)) + { + if (!sapGet24GOBSSAffectedChannel(hHal, psapCtx)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to get OBSS Affected Channel " + "Range for Channel: %d"), psapCtx->channel); + return; + } + /* Update to Original Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(hHal, cbMode); + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("OBSS Affected Channel Range : [%d %d]"), + psapCtx->affected_start, psapCtx->affected_end); + + if (pSmeHT2040CoexInfoInd->channel_num) + { + for(i = 0; i < pSmeHT2040CoexInfoInd->channel_num; i++) + { + if ((pSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i] > + psapCtx->affected_start) + && (pSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i] < + psapCtx->affected_end)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("BSS Intolerant Channel: %d within OBSS" + " Affected Channel Range : [%d %d]"), + pSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i], + psapCtx->affected_start, psapCtx->affected_end); + isHT40Allowed = 0; + break; + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Reported 20/40 BSS Intolerant Channel:%d " + " is Out of OBSS Affected Channel Range : [%d %d]"), + pSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i], + psapCtx->affected_start, psapCtx->affected_end); + } + } + + if (!isHT40Allowed) + { + if(cbMode) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Move SAP from HT40 to HT20")); + + halStatus = sme_SetHT2040Mode(hHal, psapCtx->sessionId, + PHY_SINGLE_CHANNEL_CENTERED); + if (halStatus == eHAL_STATUS_FAILURE) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to change HT20/40 mode")); + return; + } + + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(hHal, + PHY_SINGLE_CHANNEL_CENTERED); + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SAP is Already in HT20")); + + if ((!sapCheckHT40SecondaryIsNotAllowed(psapCtx)) + && (!psapCtx->numHT40IntoSta)) + { + /* Stop Previous Running HT20/40 Timer & Start timer + with (OBSS TransitionDelayFactor * obss interval) + delay after time out move AP from HT20 -> HT40 + mode + */ + if (VOS_TIMER_STATE_RUNNING == psapCtx->sap_HT2040_timer.state) + { + vosStatus = vos_timer_stop(&psapCtx->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + + delay = psapCtx->ObssScanInterval * psapCtx->ObssTransitionDelayFactor; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Start HT20/40 itransition" + " timer (%d sec)"), delay); + + vosStatus = vos_timer_start( &psapCtx->sap_HT2040_timer, + (delay * 1000)); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Start HT20/40 timer")); + } + } + return; +} + +/*========================================================================== + FUNCTION sapCheckFor20MhzObss() + + DESCRIPTION + Check 20 MHz Overlapping BSS + + DEPENDENCIES + NA. + + PARAMETERS + + IN + channelNumber : Peer BSS Operating Channel + tpSirProbeRespBeacon: Pointer to Beacon Struct + ptSapContext: Pointer to SAP Context + + RETURN VALUE + v_U8_t : Success - Found OBSS BSS, Fail - zero + + SIDE EFFECTS +============================================================================*/ + +eHalStatus sapCheckFor20MhzObss(v_U8_t channelNumber, + tpSirProbeRespBeacon pBeaconStruct, + ptSapContext psapCtx) +{ + + v_U16_t secondaryChannelOffset; + eHalStatus halStatus = eHAL_STATUS_SUCCESS; + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("channelNumber: %d BSS: %s"), channelNumber, + pBeaconStruct->ssId.ssId); + + if (channelNumber < psapCtx->affected_start + || channelNumber > psapCtx->affected_end) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("channelNumber: %d out of Affetced Channel Range: [%d,%d]"), + channelNumber, psapCtx->affected_start, + psapCtx->affected_end); + return halStatus; + } + + if (!pBeaconStruct->HTCaps.present) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Found overlapping legacy BSS: %s on Channel : %d"), + pBeaconStruct->ssId.ssId, channelNumber); + halStatus = eHAL_STATUS_FAILURE; + return halStatus; + } + + if (pBeaconStruct->HTInfo.present) + { + secondaryChannelOffset = pBeaconStruct->HTInfo.secondaryChannelOffset; + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("BSS: %s secondaryChannelOffset: %d on Channel : %d"), + pBeaconStruct->ssId.ssId, secondaryChannelOffset, + channelNumber); + if (PHY_SINGLE_CHANNEL_CENTERED == secondaryChannelOffset) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Found overlapping 20 MHz HT BSS: %s on Channel : %d"), + pBeaconStruct->ssId.ssId, channelNumber); + halStatus = eHAL_STATUS_FAILURE; + return halStatus; + } + } + return halStatus; +} + +/*========================================================================== + FUNCTION sapGetPrimarySecondaryChannelOfBss() + + DESCRIPTION + Get Primary & Seconary Channel of Overlapping BSS + + DEPENDENCIES + NA. + + PARAMETERS + + IN + tpSirProbeRespBeacon: Pointer to Beacon Struct + pri_chan : Primary Operating Channel + sec_chan : Seconary Operating Channel + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +void sapGetPrimarySecondaryChannelOfBss(tpSirProbeRespBeacon pBeaconStruct, + v_U32_t *pri_chan, v_U32_t *sec_chan) +{ + v_U16_t secondaryChannelOffset; + *pri_chan = 0; + *sec_chan = 0; + + if (pBeaconStruct->HTInfo.present) + { + *pri_chan = pBeaconStruct->HTInfo.primaryChannel; + secondaryChannelOffset = pBeaconStruct->HTInfo.secondaryChannelOffset; + if (PHY_DOUBLE_CHANNEL_LOW_PRIMARY == secondaryChannelOffset) + *sec_chan = *pri_chan + 4; + else if (PHY_DOUBLE_CHANNEL_HIGH_PRIMARY == secondaryChannelOffset) + *sec_chan = *pri_chan - 4; + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("BSS Primary & Secondary Channel : %d %d "), + *pri_chan, *sec_chan); +} + +/*========================================================================== + FUNCTION sapCheckHT40SecondaryIsNotAllowed() + + DESCRIPTION + Check HT40 Channel Secondary is Allowed + + DEPENDENCIES + NA. + + PARAMETERS + + IN + ptSapContext: Pointer to SAP Context + + RETURN VALUE + v_U8_t : Success - HT40 Allowed in Selected Channale Pair + Fail - HT40 Not Allowed + + SIDE EFFECTS +============================================================================*/ + +eHalStatus sapCheckHT40SecondaryIsNotAllowed(ptSapContext psapCtx) +{ + v_U8_t count; + v_U8_t fValidChannel = 0; + eHalStatus halStatus = eHAL_STATUS_SUCCESS; +#ifdef FEATURE_WLAN_CH_AVOID + int i; + v_U16_t unsafeChannelList[NUM_20MHZ_RF_CHANNELS]; + v_U16_t unsafeChannelCount; +#endif /* FEATURE_WLAN_CH_AVOID */ + + /* Verify that HT40 secondary channel is an allowed 20 MHz + * channel */ + for (count = RF_CHAN_1; count <= RF_CHAN_14; count++) + { + if ((regChannels[count].enabled) + && (rfChannels[count].channelNum == psapCtx->sap_sec_chan)) + { + fValidChannel = TRUE; + break; + } + } + +#ifdef FEATURE_WLAN_CH_AVOID + /* Get unsafe cahnnel list from cached location */ + vos_get_wlan_unsafe_channel(unsafeChannelList, + sizeof(unsafeChannelList), + &unsafeChannelCount); + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Unsafe Channel count %d" + " SAP Secondary Channel: %d"), + unsafeChannelCount, psapCtx->sap_sec_chan); + + for (i = 0; i < unsafeChannelCount; i++) + { + if ((psapCtx->sap_sec_chan == unsafeChannelList[i])) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Unsafe Channel %d SAP Secondary Channel: %d"), + unsafeChannelList[i], psapCtx->sap_sec_chan); + fValidChannel = FALSE; + break; + } + } +#endif /* FEATURE_WLAN_CH_AVOID */ + + if (!fValidChannel) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("HT40 In Secondary Channel : %d not allowed"), + psapCtx->sap_sec_chan); + + halStatus = eHAL_STATUS_FAILURE; + return halStatus; + } + + return halStatus; +} + +/*========================================================================== + FUNCTION sapGet24GOBSSAffectedChannel() + + DESCRIPTION + Get OBSS Affected Channel Range + + DEPENDENCIES + NA. + + PARAMETERS + + IN + tHalHandle : tHalHandle passed in with Affected Channel + ptSapContext: Pointer to SAP Context + + RETURN VALUE + v_U8_t : Success - Able to get AffectedChannel + Fail - Fail to get AffectedChannel + + SIDE EFFECTS +============================================================================*/ + +eHalStatus sapGet24GOBSSAffectedChannel(tHalHandle halHandle, + ptSapContext psapCtx) +{ + + v_U8_t cbMode; + v_U32_t pri_freq, sec_freq; + v_U32_t affected_start_freq, affected_end_freq; + eSapPhyMode sapPhyMode; + eHalStatus halStatus; + + pri_freq = vos_chan_to_freq(psapCtx->channel); + + sapPhyMode = + sapConvertSapPhyModeToCsrPhyMode(psapCtx->csrRoamProfile.phyMode); + + sme_SelectCBMode(halHandle, sapPhyMode, psapCtx->channel); + + cbMode = sme_GetChannelBondingMode24G(halHandle); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Selected Channel bonding : %d"), cbMode); + + if (cbMode == eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY) + sec_freq = pri_freq - 20; + else if (cbMode == eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY) + sec_freq = pri_freq + 20; + else + sec_freq = eCSR_INI_SINGLE_CHANNEL_CENTERED; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Primary Freq : %d MHz Secondary Freq : %d MHz"), + pri_freq, sec_freq); + + if (sec_freq) + { + /* As per 802.11 Std, Section 10.15.3.2 */ + affected_start_freq = (pri_freq + sec_freq) / 2 - 25; + affected_end_freq = (pri_freq + sec_freq) / 2 + 25; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Affected Start Freq: %d MHz Affected End Freq : %d MHz"), + affected_start_freq, affected_end_freq); + + psapCtx->affected_start = vos_freq_to_chan(affected_start_freq); + + /* As there is no channel availabe for 2397 & 2402 Frequency + * Hence taking valid channel 1 (Freq 2412) here + */ + if (affected_start_freq < 2412) + psapCtx->affected_start = 1; + + psapCtx->affected_end = vos_freq_to_chan(affected_end_freq); + + /* As there is no channel availabe for 2477 & 2482 Frequency + * Hence taking lower channel 13 (Freq 2472) here. + */ + if ((2477 == (affected_end_freq)) || (2482 == affected_end_freq)) + { + psapCtx->affected_end = 13; + } + else if (2487 == affected_end_freq) + { + /* As there is no channel availabe for 2487 Frequency + * Hence taking lower channel 14 (Freq 2484) here. + */ + psapCtx->affected_end = 14; + } + + psapCtx->sap_sec_chan = vos_freq_to_chan(sec_freq); + + halStatus = eHAL_STATUS_SUCCESS; + return halStatus; + } + else + { + psapCtx->affected_start = 0; + psapCtx->affected_end = 0; + psapCtx->sap_sec_chan = 0; + halStatus = eHAL_STATUS_FAILURE; + return halStatus; + } +} + +/*========================================================================== + FUNCTION sapCheck40Mhz24G + + DESCRIPTION + Check HT40 is possible in 2.4GHz mode + + DEPENDENCIES + NA. + + PARAMETERS + + IN + halHandle : Pointer to HAL handle + ptSapContext : Pointer to SAP Context + pResult : Pointer to tScanResultHandle + + RETURN VALUE + v_U8_t : Success - HT40 Possible, Fail - zero + + SIDE EFFECTS +============================================================================*/ + +eHalStatus sapCheck40Mhz24G(tHalHandle halHandle, ptSapContext psapCtx, + tScanResultHandle pResult) +{ + v_U32_t pri_chan, sec_chan; + v_U32_t ieLen = 0; + v_U8_t channelNumber = 0; + tSirProbeRespBeacon *pBeaconStruct; + tCsrScanResultInfo *pScanResult; + tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; + eHalStatus halStatus = eHAL_STATUS_FAILURE; + + if ( (0 == psapCtx->affected_start) && (0 == psapCtx->affected_end) + && (0 == psapCtx->sap_sec_chan)) + { + if (eHAL_STATUS_SUCCESS != + sapGet24GOBSSAffectedChannel(halHandle, psapCtx)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to get OBSS Affected Channel Range for Channel: %d"), + psapCtx->channel); + return halStatus; + } + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("40 MHz affected channel range: [%d,%d] MHz"), + psapCtx->affected_start, psapCtx->affected_end); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SAP Primary & Secondary Channel : [%d,%d] MHz"), + psapCtx->channel, psapCtx->sap_sec_chan); + + pBeaconStruct = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); + if ( NULL == pBeaconStruct ) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Unable to allocate memory ")); + return halStatus; + } + + /* Check neighboring BSSes from scan result to see whether 40 MHz is + * allowed per IEEE Std 802.11-2012, 10.15.3.2 */ + pScanResult = sme_ScanResultGetFirst(halHandle, pResult); + + while (pScanResult) + { + + /* if the Beacon has channel ID, use it other wise we will + * rely on the channelIdSelf + */ + if(pScanResult->BssDescriptor.channelId == 0) + channelNumber = pScanResult->BssDescriptor.channelIdSelf; + else + channelNumber = pScanResult->BssDescriptor.channelId; + + if (channelNumber > SIR_11B_CHANNEL_END) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("channelNumber: %d BSS: %s"), + channelNumber, pBeaconStruct->ssId.ssId); + goto NextResult; + } + + if ((pScanResult->BssDescriptor.ieFields != NULL)) + { + ieLen = (pScanResult->BssDescriptor.length + sizeof(tANI_U16)); + ieLen += (sizeof(tANI_U32) - sizeof(tSirBssDescription)); + vos_mem_set((tANI_U8 *) pBeaconStruct, + sizeof(tSirProbeRespBeacon), 0); + + if ((eSIR_SUCCESS == sirParseBeaconIE(pMac, pBeaconStruct, + (tANI_U8 *)( pScanResult->BssDescriptor.ieFields), ieLen))) + { + /* Check Peer BSS is HT20 or Legacy AP */ + if (eHAL_STATUS_SUCCESS != + sapCheckFor20MhzObss(channelNumber, pBeaconStruct, + psapCtx)) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Overlapping 20 MHz BSS is found")); + vos_mem_free(pBeaconStruct); + return halStatus; + } + + sapGetPrimarySecondaryChannelOfBss(pBeaconStruct, + &pri_chan, &sec_chan); + + /* Check peer BSS Operating channel is not within OBSS affected + * channel range + */ + if ((pri_chan < psapCtx->affected_start + || pri_chan > psapCtx->affected_end) + && (sec_chan < psapCtx->affected_start + || sec_chan > psapCtx->affected_end)) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Peer BSS: %s Primary & Secondary Channel [%d %d]" + "is out of affected Range: [%d %d]"), + pBeaconStruct->ssId.ssId, pri_chan, sec_chan, + psapCtx->affected_start, psapCtx->affected_end); + goto NextResult; /* not within affected channel range */ + } + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Neighboring BSS: %s Primary & Secondary Channel [%d %d]"), + pBeaconStruct->ssId.ssId, pri_chan, sec_chan); + + if (sec_chan) + { + /* Peer BSS is HT40 capable then check peer BSS + * primary & secondary channel with SAP + * Primary & Secondary channel. + */ + if ((psapCtx->channel != pri_chan) + || (psapCtx->sap_sec_chan != sec_chan)) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("40 MHz Pri/Sec channel : [%d %d]" + " missmatch with BSS: %s" + " Pri/Sec channel : [%d %d]"), + psapCtx->channel, psapCtx->sap_sec_chan, + pBeaconStruct->ssId.ssId, pri_chan, sec_chan); + vos_mem_free(pBeaconStruct); + return halStatus; + } + } + + if (pBeaconStruct->HTCaps.present) + { + /* Check Peer BSS HT capablity has 40MHz Intolerant bit */ + if (pBeaconStruct->HTCaps.stbcControlFrame) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Found BSS: %s with 40 MHz" + "Intolerant is set on Channel : %d"), + pBeaconStruct->ssId.ssId, + channelNumber); + vos_mem_free(pBeaconStruct); + return halStatus; + } + } + } + else + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Parse the Beacon IEs")); + } + } + else + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("BSS IEs Failed is NULL in Scan")); + } + +NextResult: + pScanResult = sme_ScanResultGetNext(halHandle, pResult); + } + vos_mem_free(pBeaconStruct); + + if (psapCtx->sap_sec_chan) + { + if (eHAL_STATUS_SUCCESS == sapCheckHT40SecondaryIsNotAllowed(psapCtx)) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Start SAP/P2P GO in HT 40MHz " + "Primary & Secondary Channel: [%d %d]"), + psapCtx->channel, psapCtx->sap_sec_chan); + halStatus = eHAL_STATUS_SUCCESS; + return halStatus; + } + } + + return halStatus; +} +#endif + /*========================================================================== FUNCTION WLANSAP_ScanCallback() - DESCRIPTION - Callback for Scan (scan results) Events + DESCRIPTION + Callback for Scan (scan results) Events - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN tHalHandle : tHalHandle passed in with the scan request *pContext : The second context pass in for the caller (sapContext) scanID : scanID got after the scan status : Status of scan -success, failure or abort - + RETURN VALUE - The eHalStatus code associated with performing the operation + The eHalStatus code associated with performing the operation eHAL_STATUS_SUCCESS: Success - - SIDE EFFECTS + + SIDE EFFECTS ============================================================================*/ eHalStatus WLANSAP_ScanCallback ( - tHalHandle halHandle, + tHalHandle halHandle, void *pContext, /* Opaque SAP handle */ - v_U32_t scanID, + v_U32_t scanID, eCsrScanStatus scanStatus ) { @@ -143,9 +977,9 @@ WLANSAP_ScanCallback void *pTempHddCtx; tWLAN_SAPEvent sapEvent; /* State machine event */ v_U8_t operChannel = 0; - v_U8_t i = 0; VOS_STATUS sapstatus; v_U32_t event; + eSapPhyMode sapPhyMode; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ @@ -158,95 +992,87 @@ WLANSAP_ScanCallback return eHAL_STATUS_FAILURE; } - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before switch on scanStatus = %d", __func__, scanStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "In %s, before switch on scanStatus = %d", __func__, scanStatus); - switch (scanStatus) + switch (scanStatus) { case eCSR_SCAN_SUCCESS: // sapScanCompleteCallback with eCSR_SCAN_SUCCESS - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR scanStatus = %s (%d)", __func__, "eCSR_SCAN_SUCCESS", scanStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "In %s, CSR scanStatus = %s (%d)", __func__, + "eCSR_SCAN_SUCCESS", scanStatus); - // Get scan results, Run channel selection algorithm, select channel and keep in pSapContext->Channel - scanGetResultStatus = sme_ScanGetResult(halHandle, 0, NULL, &pResult); + /* Get scan results, Run channel selection algorithm, + * select channel and keep in pSapContext->Channel + */ + scanGetResultStatus = sme_ScanGetResult(halHandle, 0, NULL, + &pResult); event = eSAP_MAC_SCAN_COMPLETE; - if ((scanGetResultStatus != eHAL_STATUS_SUCCESS)&& (scanGetResultStatus != eHAL_STATUS_E_NULL_VALUE)) + if ((scanGetResultStatus != eHAL_STATUS_SUCCESS) + && (scanGetResultStatus != eHAL_STATUS_E_NULL_VALUE)) { // No scan results - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, Get scan result failed! ret = %d", + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "In %s, Get scan result failed! ret = %d", __func__, scanGetResultStatus); + sapSetOperatingChannel(psapContext, operChannel); break; } - operChannel = sapSelectChannel(halHandle, psapContext, pResult); +#ifdef WLAN_FEATURE_AP_HT40_24G + if (psapContext->channel == AUTO_CHANNEL_SELECT) +#endif + { + operChannel = sapSelectChannel(halHandle, psapContext, pResult); + sapSetOperatingChannel(psapContext, operChannel); + } +#ifdef WLAN_FEATURE_AP_HT40_24G + if ((psapContext->channel <= SIR_11B_CHANNEL_END) + && (psapContext->channel > 0)) + { + if (eHAL_STATUS_SUCCESS != + sapCheck40Mhz24G(halHandle, psapContext, pResult)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Starting SAP into HT20")); + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(halHandle, + PHY_SINGLE_CHANNEL_CENTERED); + } + } +#endif sme_ScanResultPurge(halHandle, pResult); break; default: event = eSAP_CHANNEL_SELECTION_FAILED; - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR scanStatus = %s (%d)", __func__, "eCSR_SCAN_ABORT/FAILURE", scanStatus); + if (psapContext->channel == AUTO_CHANNEL_SELECT) + sapSetOperatingChannel(psapContext, operChannel); +#ifdef WLAN_FEATURE_AP_HT40_24G + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Starting SAP into HT20")); + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(halHandle, + PHY_SINGLE_CHANNEL_CENTERED); +#endif + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("CSR scanStatus = %s (%d)"), + "eCSR_SCAN_ABORT/FAILURE", scanStatus); } - if (operChannel == SAP_CHANNEL_NOT_SELECTED) -#ifdef SOFTAP_CHANNEL_RANGE - { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, - "%s: No suitable channel selected", __func__); - if ( eCSR_BAND_ALL == psapContext->scanBandPreference || - psapContext->allBandScanned == eSAP_TRUE) - { - if(psapContext->channelList != NULL) - { - psapContext->channel = SAP_DEFAULT_CHANNEL; - for ( i = 0 ; i < psapContext->numofChannel ; i++) - { - if (NV_CHANNEL_ENABLE == - vos_nv_getChannelEnabledState(psapContext->channelList[i])) - { - psapContext->channel = psapContext->channelList[i]; - break; - } - } - } - else - { - /* if the channel list is empty then there is no valid channel in - the selected sub-band so select default channel in the - BAND(2.4GHz) as 2.4 channels are available in all the - countries*/ - psapContext->channel = SAP_DEFAULT_CHANNEL; - } - } - else - { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, - "%s: Has scan band preference", - __func__); - if (eCSR_BAND_24 == psapContext->currentPreferredBand) - psapContext->currentPreferredBand = eCSR_BAND_5G; - else - psapContext->currentPreferredBand = eCSR_BAND_24; + sapPhyMode = + sapConvertSapPhyModeToCsrPhyMode(psapContext->csrRoamProfile.phyMode); - psapContext->allBandScanned = eSAP_TRUE; - //go back to DISCONNECT state, scan next band - psapContext->sapsMachine = eSAP_DISCONNECTED; - event = eSAP_CHANNEL_SELECTION_FAILED; - } - } -#else - psapContext->channel = SAP_DEFAULT_CHANNEL; +#ifdef WLAN_FEATURE_AP_HT40_24G + if (psapContext->channel > SIR_11B_CHANNEL_END) #endif - else - { - psapContext->channel = operChannel; - } + sme_SelectCBMode(halHandle, sapPhyMode, psapContext->channel); - sme_SelectCBMode(halHandle, - sapConvertSapPhyModeToCsrPhyMode(psapContext->csrRoamProfile.phyMode), - psapContext->channel); #ifdef SOFTAP_CHANNEL_RANGE if(psapContext->channelList != NULL) { @@ -257,7 +1083,8 @@ WLANSAP_ScanCallback } #endif - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Channel selected = %d", __func__, psapContext->channel); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "In %s, Channel selected = %d", __func__, psapContext->channel); /* Fill in the event structure */ sapEvent.event = event; @@ -313,13 +1140,18 @@ WLANSAP_RoamCallback VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus halStatus = eHAL_STATUS_SUCCESS; - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before switch on roamStatus = %d\n", __func__, roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Before switch on roamStatus = %d"), + roamStatus); switch(roamStatus) { case eCSR_ROAM_SESSION_OPENED: { /* tHalHandle */ tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_SESSION_OPENED", roamStatus); if (NULL == hHal) { @@ -340,8 +1172,9 @@ WLANSAP_RoamCallback } case eCSR_ROAM_INFRA_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_INFRA_IND", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_INFRA_IND", roamStatus); if(roamResult == eCSR_ROAM_RESULT_INFRA_START_FAILED) { /* Fill in the event structure */ @@ -360,18 +1193,21 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_LOSTLINK: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_LOSTLINK", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_LOSTLINK", roamStatus); break; case eCSR_ROAM_MIC_ERROR_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_MIC_ERROR_IND", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_MIC_ERROR_IND", roamStatus); break; case eCSR_ROAM_SET_KEY_COMPLETE: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_SET_KEY_COMPLETE", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_SET_KEY_COMPLETE", roamStatus); if (roamResult == eCSR_ROAM_RESULT_FAILURE ) { /* Format the SET KEY complete information pass to HDD... */ @@ -380,8 +1216,9 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_REMOVE_KEY_COMPLETE: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_REMOVE_KEY_COMPLETE", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_REMOVE_KEY_COMPLETE", roamStatus); if (roamResult == eCSR_ROAM_RESULT_FAILURE ) { /* Format the SET KEY complete information pass to HDD... */ @@ -390,8 +1227,9 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_ASSOCIATION_COMPLETION: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_ASSOCIATION_COMPLETION", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_ASSOCIATION_COMPLETION", roamStatus); if (roamResult == eCSR_ROAM_RESULT_FAILURE ) { /* Format the SET KEY complete information pass to HDD... */ @@ -400,8 +1238,9 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_DISASSOCIATED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_DISASSOCIATED", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_DISASSOCIATED", roamStatus); if (roamResult == eCSR_ROAM_RESULT_MIC_FAILURE) { /* Format the MIC failure event to return... */ @@ -410,21 +1249,22 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_WPS_PBC_PROBE_REQ_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)\n", - __func__, "eCSR_ROAM_WPS_PBC_PROBE_REQ_IND", roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_WPS_PBC_PROBE_REQ_IND", roamStatus); break; - - case eCSR_ROAM_INDICATE_MGMT_FRAME: - sapSignalHDDevent(sapContext, pCsrRoamInfo, - eSAP_INDICATE_MGMT_FRAME, - (v_PVOID_t) eSAP_STATUS_SUCCESS); - break; case eCSR_ROAM_REMAIN_CHAN_READY: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_REMAIN_CHAN_READY", roamStatus); sapSignalHDDevent(sapContext, pCsrRoamInfo, eSAP_REMAIN_CHAN_READY, (v_PVOID_t) eSAP_STATUS_SUCCESS); break; case eCSR_ROAM_SEND_ACTION_CNF: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_SEND_ACTION_CNF", roamStatus); sapSignalHDDevent(sapContext, pCsrRoamInfo, eSAP_SEND_ACTION_CNF, (v_PVOID_t)((eSapStatus)((roamResult == eCSR_ROAM_RESULT_NONE) @@ -432,33 +1272,48 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS", roamStatus); sapSignalHDDevent(sapContext, pCsrRoamInfo, eSAP_DISCONNECT_ALL_P2P_CLIENT, (v_PVOID_t) eSAP_STATUS_SUCCESS ); break; case eCSR_ROAM_SEND_P2P_STOP_BSS: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Received stopbss", __func__); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Received stopbss")); sapSignalHDDevent(sapContext, pCsrRoamInfo, eSAP_MAC_TRIG_STOP_BSS_EVENT, (v_PVOID_t) eSAP_STATUS_SUCCESS ); break; +#ifdef WLAN_FEATURE_AP_HT40_24G + case eCSR_ROAM_2040_COEX_INFO_IND: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamStatus = %s (%d)"), + "eCSR_ROAM_2040_COEX_INFO_IND", + roamStatus); + + sapCheckHT2040CoexAction(sapContext, pCsrRoamInfo->pSmeHT2040CoexInfoInd); + break; +#endif + default: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, CSR roamStatus not handled roamStatus = %s (%d)\n", - __func__, get_eRoamCmdStatus_str(roamStatus), roamStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("CSR roamStatus not handled roamStatus = %s (%d)"), + get_eRoamCmdStatus_str(roamStatus), roamStatus); break; - } - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before switch on roamResult = %d\n", - __func__, roamResult); switch (roamResult) { case eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL( "CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND", + roamResult); sapContext->nStaWPARSnReqIeLength = pCsrRoamInfo->rsnIELen; if(sapContext->nStaWPARSnReqIeLength) @@ -481,8 +1336,9 @@ WLANSAP_RoamCallback if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "In %s, CSR roamResult = (%d) MAC (" - MAC_ADDRESS_STR") fail", __func__, roamResult, + FL("CSR roamResult = (%d) MAC (" + MAC_ADDRESS_STR") fail"), + roamResult, MAC_ADDR_ARRAY(pCsrRoamInfo->peerMac)); halStatus = eHAL_STATUS_FAILURE; } @@ -490,8 +1346,9 @@ WLANSAP_RoamCallback else { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, - "In %s, CSR roamResult = (%d) MAC (" - MAC_ADDRESS_STR") not allowed", __func__, roamResult, + FL("CSR roamResult = (%d) MAC (" + MAC_ADDRESS_STR") not allowed"), + roamResult, MAC_ADDR_ARRAY(pCsrRoamInfo->peerMac)); halStatus = eHAL_STATUS_FAILURE; } @@ -499,8 +1356,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF", + roamResult); sapContext->nStaWPARSnReqIeLength = pCsrRoamInfo->rsnIELen; if (sapContext->nStaWPARSnReqIeLength) @@ -519,11 +1378,25 @@ WLANSAP_RoamCallback { halStatus = eHAL_STATUS_FAILURE; } +#ifdef WLAN_FEATURE_AP_HT40_24G + else + { + if (pCsrRoamInfo->HT40MHzIntoEnabledSta) + { + sapAddHT40IntolerantSta(sapContext, pCsrRoamInfo); + } + } +#endif break; case eCSR_ROAM_RESULT_DISASSOC_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_DISASSOC_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_DISASSOC_IND", + roamResult); +#ifdef WLAN_FEATURE_AP_HT40_24G + sapRemoveHT40IntolerantSta(sapContext, pCsrRoamInfo); +#endif /* Fill in the event structure */ vosStatus = sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_STA_DISASSOC_EVENT, (v_PVOID_t)eSAP_STATUS_SUCCESS); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) @@ -533,8 +1406,13 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_DEAUTH_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_DEAUTH_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_DEAUTH_IND", + roamResult); +#ifdef WLAN_FEATURE_AP_HT40_24G + sapRemoveHT40IntolerantSta(sapContext, pCsrRoamInfo); +#endif /* Fill in the event structure */ //TODO: we will use the same event inorder to inform HDD to disassociate the station vosStatus = sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_STA_DISASSOC_EVENT, (v_PVOID_t)eSAP_STATUS_SUCCESS); @@ -545,8 +1423,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_MIC_ERROR_GROUP: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_MIC_ERROR_GROUP", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_MIC_ERROR_GROUP", + roamResult); /* Fill in the event structure */ //TODO: support for group key MIC failure event to be handled vosStatus = sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_STA_MIC_FAILURE_EVENT,(v_PVOID_t) NULL); @@ -557,8 +1437,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_MIC_ERROR_UNICAST: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST", + roamResult); /* Fill in the event structure */ //TODO: support for unicast key MIC failure event to be handled vosStatus = sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_STA_MIC_FAILURE_EVENT,(v_PVOID_t) NULL); @@ -569,8 +1451,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_AUTHENTICATED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_AUTHENTICATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_AUTHENTICATED", + roamResult); /* Fill in the event structure */ sapSignalHDDevent( sapContext, pCsrRoamInfo,eSAP_STA_SET_KEY_EVENT, (v_PVOID_t)eSAP_STATUS_SUCCESS); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) @@ -580,15 +1464,19 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_ASSOCIATED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_ASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_ASSOCIATED", + roamResult); /* Fill in the event structure */ sapSignalHDDevent( sapContext, pCsrRoamInfo,eSAP_STA_REASSOC_EVENT, (v_PVOID_t)eSAP_STATUS_SUCCESS); break; case eCSR_ROAM_RESULT_INFRA_STARTED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_INFRA_STARTED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_INFRA_STARTED", + roamResult); /* Fill in the event structure */ sapEvent.event = eSAP_MAC_START_BSS_SUCCESS; sapEvent.params = pCsrRoamInfo; @@ -604,8 +1492,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_INFRA_STOPPED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_INFRA_STOPPED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_INFRA_STOPPED", + roamResult); /* Fill in the event structure */ sapEvent.event = eSAP_MAC_READY_FOR_CONNECTIONS; sapEvent.params = pCsrRoamInfo; @@ -621,8 +1511,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_WPS_PBC_PROBE_REQ_IND: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_WPS_PBC_PROBE_REQ_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_WPS_PBC_PROBE_REQ_IND", + roamResult); /* Fill in the event structure */ //TODO: support for group key MIC failure event to be handled vosStatus = sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_WPS_PBC_PROBE_REQ_EVENT,(v_PVOID_t) NULL); @@ -633,16 +1525,23 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_FORCED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_FORCED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_FORCED", + roamResult); +#ifdef WLAN_FEATURE_AP_HT40_24G + sapRemoveHT40IntolerantSta(sapContext, pCsrRoamInfo); +#endif //This event can be used to inform hdd about user triggered disassoc event /* Fill in the event structure */ sapSignalHDDevent( sapContext, pCsrRoamInfo, eSAP_STA_DISASSOC_EVENT, (v_PVOID_t)eSAP_STATUS_SUCCESS); break; case eCSR_ROAM_RESULT_NONE: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_NONE", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_NONE", + roamResult); //This event can be used to inform hdd about user triggered disassoc event /* Fill in the event structure */ if ( roamStatus == eCSR_ROAM_SET_KEY_COMPLETE) @@ -656,8 +1555,10 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)\n", - __func__, "eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED", roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("CSR roamResult = %s (%d)"), + "eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED", + roamResult); /* Fill in the event structure */ vosStatus = sapSignalHDDevent(sapContext, pCsrRoamInfo, eSAP_MAX_ASSOC_EXCEEDED, (v_PVOID_t)NULL); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) @@ -667,8 +1568,10 @@ WLANSAP_RoamCallback break; default: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, CSR roamResult = %s (%d) not handled\n", - __func__,get_eCsrRoamResult_str(roamResult),roamResult); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("CSR roamResult = %s (%d) not handled"), + get_eCsrRoamResult_str(roamResult), + roamResult); break; } diff --git a/drivers/staging/prima/CORE/SAP/src/sapChSelect.c b/drivers/staging/prima/CORE/SAP/src/sapChSelect.c index 037ccfaddbe7..7a3b0901f04c 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapChSelect.c +++ b/drivers/staging/prima/CORE/SAP/src/sapChSelect.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -551,8 +551,6 @@ v_U32_t sapweightRssiCount(v_S7_t rssi, v_U16_t count) if(countWeight > SOFTAP_COUNT_WEIGHT) countWeight = SOFTAP_COUNT_WEIGHT; - else if (countWeight < 0) - countWeight = 0; rssicountWeight = rssiWeight + countWeight; @@ -582,7 +580,9 @@ v_U32_t sapweightRssiCount(v_S7_t rssi, v_U16_t count) SIDE EFFECTS ============================================================================*/ -void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) +void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh, + tSapSpectChInfo *spect_ch_strt_addr, + tSapSpectChInfo *spect_ch_end_addr) { tSapSpectChInfo *pExtSpectCh = NULL; v_S31_t rssi; @@ -598,7 +598,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) { case CHANNEL_1: pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -611,7 +613,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -624,7 +628,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -637,7 +643,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -653,7 +661,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_2: pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -666,7 +676,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -679,7 +691,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -692,7 +706,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -705,7 +721,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -720,7 +738,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) break; case CHANNEL_3: pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -733,7 +753,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -746,7 +768,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -759,7 +783,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -772,7 +798,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -785,7 +813,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -800,7 +830,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) break; case CHANNEL_4: pExtSpectCh = (pSpectCh - 3); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -813,7 +845,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -826,7 +860,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -839,7 +875,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -852,7 +890,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -865,7 +905,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -878,7 +920,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -896,7 +940,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_6: case CHANNEL_7: pExtSpectCh = (pSpectCh - 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -909,7 +955,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -922,7 +970,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -935,7 +985,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -948,7 +1000,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -961,7 +1015,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -974,7 +1030,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -987,7 +1045,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1003,7 +1063,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_8: pExtSpectCh = (pSpectCh - 4); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1017,7 +1079,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) } pExtSpectCh = (pSpectCh - 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1030,7 +1094,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1043,7 +1109,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1056,7 +1124,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1069,7 +1139,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1082,7 +1154,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1098,7 +1172,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_9: pExtSpectCh = (pSpectCh - 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1112,7 +1188,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) } pExtSpectCh = (pSpectCh - 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1125,7 +1203,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1138,7 +1218,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1151,7 +1233,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1164,7 +1248,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1180,7 +1266,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_10: pExtSpectCh = (pSpectCh - 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1194,7 +1282,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) } pExtSpectCh = (pSpectCh - 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1207,7 +1297,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if(pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1220,7 +1312,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1233,7 +1327,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1249,7 +1345,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) case CHANNEL_11: pExtSpectCh = (pSpectCh - 1); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1262,7 +1360,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1275,7 +1375,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 3); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1288,7 +1390,9 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh) pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 4); - if (pExtSpectCh != NULL) + if (pExtSpectCh != NULL && + (pExtSpectCh >= spect_ch_strt_addr && + pExtSpectCh < spect_ch_end_addr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + @@ -1347,12 +1451,15 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, v_U32_t ieLen = 0; tSirProbeRespBeacon *pBeaconStruct; tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; + tSapSpectChInfo *pSpectChStartAddr = pSpectInfoParams->pSpectCh; + tSapSpectChInfo *pSpectChEndAddr = + pSpectInfoParams->pSpectCh + pSpectInfoParams->numSpectChans; pBeaconStruct = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); if ( NULL == pBeaconStruct ) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "Unable to allocate memory in sapComputeSpectWeight\n"); + "Unable to allocate memory in sapComputeSpectWeight"); return; } VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Computing spectral weight", __func__); @@ -1430,7 +1537,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, tSapSpectChInfo *pExtSpectCh = NULL; case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: // Above the Primary Channel pExtSpectCh = (pSpectCh + 1); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1446,7 +1555,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: // Below the Primary channel pExtSpectCh = (pSpectCh - 1); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; if (IS_RSSI_VALID(pExtSpectCh->rssiAgr, rssi)) @@ -1465,7 +1576,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, { tSapSpectChInfo *pExtSpectCh = NULL; pExtSpectCh = (pSpectCh + 1); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1477,7 +1590,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND2_RSSI_EFFECT_PRIMARY; @@ -1489,7 +1604,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 3); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND3_RSSI_EFFECT_PRIMARY; @@ -1505,7 +1622,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, { tSapSpectChInfo *pExtSpectCh = NULL; pExtSpectCh = (pSpectCh - 1 ); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1517,7 +1636,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1529,7 +1650,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 2); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND2_RSSI_EFFECT_PRIMARY; @@ -1545,7 +1668,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, { tSapSpectChInfo *pExtSpectCh = NULL; pExtSpectCh = (pSpectCh - 1 ); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1557,7 +1682,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND2_RSSI_EFFECT_PRIMARY; @@ -1569,7 +1696,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh + 1); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1585,7 +1714,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, { tSapSpectChInfo *pExtSpectCh = NULL; pExtSpectCh = (pSpectCh - 1 ); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND1_RSSI_EFFECT_PRIMARY; @@ -1597,7 +1728,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 2); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND2_RSSI_EFFECT_PRIMARY; @@ -1609,7 +1742,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, pExtSpectCh->rssiAgr = SOFTAP_MIN_RSSI; } pExtSpectCh = (pSpectCh - 3); - if(pExtSpectCh != NULL) + if( pExtSpectCh != NULL && + (pExtSpectCh >= pSpectChStartAddr && + pExtSpectCh < pSpectChEndAddr)) { ++pExtSpectCh->bssCount; rssi = pSpectCh->rssiAgr + SAP_SUBBAND3_RSSI_EFFECT_PRIMARY; @@ -1626,11 +1761,12 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, } else if(operatingBand == eSAP_RF_SUBBAND_2_4_GHZ) { - sapInterferenceRssiCount(pSpectCh); + sapInterferenceRssiCount(pSpectCh, pSpectChStartAddr, + pSpectChEndAddr); } VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, bssdes.ch_self=%d, bssdes.ch_ID=%d, bssdes.rssi=%d, SpectCh.bssCount=%d, pScanResult=%p, ChannelWidth %d, secondaryChanOffset %d, center frequency %d \n", + "In %s, bssdes.ch_self=%d, bssdes.ch_ID=%d, bssdes.rssi=%d, SpectCh.bssCount=%d, pScanResult=%pK, ChannelWidth %d, secondaryChanOffset %d, center frequency %d ", __func__, pScanResult->BssDescriptor.channelIdSelf, pScanResult->BssDescriptor.channelId, pScanResult->BssDescriptor.rssi, pSpectCh->bssCount, pScanResult,pSpectCh->channelWidth,secondaryChannelOffset,centerFreq); pSpectCh++; break; @@ -1656,8 +1792,9 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams, rssi = (v_S7_t)pSpectCh->rssiAgr; - pSpectCh->weight = SAPDFS_NORMALISE_1000 * sapweightRssiCount(rssi, pSpectCh->bssCount); - + pSpectCh->weight = + SAPDFS_NORMALISE_1000 * sapweightRssiCount(rssi, pSpectCh->bssCount); + pSpectCh->weight_copy = pSpectCh->weight; //------ Debug Info ------ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Chan=%d Weight= %d rssiAgr=%d bssCount=%d", __func__, @@ -1807,7 +1944,7 @@ void sapSortChlWeightHT80(tSapChSelSpectInfo *pSpectInfoParams) best channel as the selected primary channel, update its weightage with the combined weight value */ for (n=0; n<4; n++) - pSpectInfo[j+n].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+n].weight = ACS_WEIGHT_MAX * 4; pSpectInfo[j+minIdx].weight = acsHT80Channels[i].weight; } @@ -1815,13 +1952,13 @@ void sapSortChlWeightHT80(tSapChSelSpectInfo *pSpectInfoParams) { /* some channels does not exist in pSectInfo array, skip this channel and those in the same HT80 width*/ - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 4; if ((pSpectInfo[j].chNum +4) == pSpectInfo[j+1].chNum) - pSpectInfo[j+1].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+1].weight = ACS_WEIGHT_MAX * 4; if ((pSpectInfo[j].chNum +8) == pSpectInfo[j+2].chNum) - pSpectInfo[j+2].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+2].weight = ACS_WEIGHT_MAX * 4; if ((pSpectInfo[j].chNum +12) == pSpectInfo[j+3].chNum) - pSpectInfo[j+3].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+3].weight = ACS_WEIGHT_MAX * 4; } } @@ -1830,7 +1967,7 @@ void sapSortChlWeightHT80(tSapChSelSpectInfo *pSpectInfoParams) { if ( CHANNEL_165 == pSpectInfo[j].chNum ) { - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 4; break; } } @@ -1899,14 +2036,14 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) if (pSpectInfo[j].weight <= pSpectInfo[j+4].weight) { pSpectInfo[j].weight = tmpWeight1; - pSpectInfo[j+4].weight = ACS_WEIGHT_MAX; - pSpectInfo[j+8].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+4].weight = ACS_WEIGHT_MAX * 2; + pSpectInfo[j+8].weight = ACS_WEIGHT_MAX * 2; } else { pSpectInfo[j+4].weight = tmpWeight1; - pSpectInfo[j].weight = ACS_WEIGHT_MAX; - pSpectInfo[j+8].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; + pSpectInfo[j+8].weight = ACS_WEIGHT_MAX * 2; } } else @@ -1914,14 +2051,14 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) if (pSpectInfo[j+4].weight <= pSpectInfo[j+8].weight) { pSpectInfo[j+4].weight = tmpWeight2; - pSpectInfo[j].weight = ACS_WEIGHT_MAX; - pSpectInfo[j+8].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; + pSpectInfo[j+8].weight = ACS_WEIGHT_MAX * 2; } else { pSpectInfo[j+8].weight = tmpWeight2; - pSpectInfo[j].weight = ACS_WEIGHT_MAX; - pSpectInfo[j+4].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; + pSpectInfo[j+4].weight = ACS_WEIGHT_MAX * 2; } } } @@ -1931,17 +2068,17 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) if (pSpectInfo[j].weight <= pSpectInfo[j+4].weight) { pSpectInfo[j].weight = tmpWeight1; - pSpectInfo[j+4].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+4].weight = ACS_WEIGHT_MAX * 2; } else { pSpectInfo[j+4].weight = tmpWeight1; - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; } } } else - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; } sapSortChlWeight(pSpectInfoParams); @@ -1996,19 +2133,19 @@ void sapSortChlWeightHT40_5G(tSapChSelSpectInfo *pSpectInfoParams) pSpectInfo[j].weight = acsHT40Channels5G[i].weight; /* mark the adjacent channel's weight as max value so that it will be sorted to the bottom */ - pSpectInfo[j+1].weight = ACS_WEIGHT_MAX; + pSpectInfo[j+1].weight = ACS_WEIGHT_MAX * 2; } else { pSpectInfo[j+1].weight = acsHT40Channels5G[i].weight; /* mark the adjacent channel's weight as max value so that it will be sorted to the bottom */ - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; } } else - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; } /* avoid channel 165 by setting its weight to max */ @@ -2017,7 +2154,7 @@ void sapSortChlWeightHT40_5G(tSapChSelSpectInfo *pSpectInfoParams) { if ( CHANNEL_165 == pSpectInfo[j].chNum ) { - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + pSpectInfo[j].weight = ACS_WEIGHT_MAX * 2; break; } } @@ -2125,9 +2262,11 @@ eChannelWidthInfo sapGetChannelWidthInfo(tHalHandle halHandle, ptSapContext pSap v_U32_t cbMode; eChannelWidthInfo chWidth = CHWIDTH_HT20; +#ifdef WLAN_FEATURE_AP_HT40_24G if (eSAP_RF_SUBBAND_2_4_GHZ == operatingBand) cbMode = sme_GetChannelBondingMode24G(halHandle); else +#endif cbMode = sme_GetChannelBondingMode5G(halHandle); if (phyMode == eSAP_DOT11_MODE_11n || @@ -2186,13 +2325,6 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult #endif VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Running SAP Ch Select", __func__); - if (NULL == pScanResult) - { - //scan is successfull, but no AP is present, select the first channel is channel range - ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, &startChannelNum); - return startChannelNum; - } - // Initialize the structure pointed by pSpectInfoParams if(sapChanSelInit( halHandle, pSpectInfoParams) != eSAP_TRUE ) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, Ch Select initialization failed", __func__); @@ -2261,7 +2393,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult continue; } - if (pSpectInfoParams->pSpectCh[count].weight > + if (pSpectInfoParams->pSpectCh[count].weight_copy > pSapCtx->acsBandSwitchThreshold) { /* the best channel exceeds the threshold @@ -2280,7 +2412,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult { /* all bands are scanned, compare current best channel with channel scanned previously */ - if ( pSpectInfoParams->pSpectCh[count].weight > + if ( pSpectInfoParams->pSpectCh[count].weight_copy > pSapCtx->acsBestChannelInfo.weight) { /* previous stored channel is better */ @@ -2290,7 +2422,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult { pSapCtx->acsBestChannelInfo.channelNum = bestChNum; pSapCtx->acsBestChannelInfo.weight = - pSpectInfoParams->pSpectCh[count].weight; + pSpectInfoParams->pSpectCh[count].weight_copy; } } } @@ -2303,7 +2435,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult if(((pSpectInfoParams->pSpectCh[count].chNum == CHANNEL_1) || (pSpectInfoParams->pSpectCh[count].chNum == CHANNEL_6) || (pSpectInfoParams->pSpectCh[count].chNum == CHANNEL_11))&& - (pSpectInfoParams->pSpectCh[count].weight == + (pSpectInfoParams->pSpectCh[count].weight_copy == pSapCtx->acsBestChannelInfo.weight)) { tmpChNum = pSpectInfoParams->pSpectCh[count].chNum; diff --git a/drivers/staging/prima/CORE/SAP/src/sapChSelect.h b/drivers/staging/prima/CORE/SAP/src/sapChSelect.h index 1f6ff4efe1ed..fcb9fe04382a 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapChSelect.h +++ b/drivers/staging/prima/CORE/SAP/src/sapChSelect.h @@ -44,9 +44,6 @@ Are listed for each API below. - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -132,6 +129,7 @@ typedef struct { v_U16_t bssCount; // bss found in scanresult for this channel v_S31_t rssiAgr; // Max value of rssi among all BSS(es) from scanresult for this channel v_U32_t weight; // Weightage of this channel + v_U32_t weight_copy; //copy of the orignal weight v_BOOL_t valid; // Is this a valid center frequency for regulatory domain } tSapSpectChInfo;//tDfsSpectChInfo; diff --git a/drivers/staging/prima/CORE/SAP/src/sapFsm.c b/drivers/staging/prima/CORE/SAP/src/sapFsm.c index 403cc2a9f42f..6d8977d2deb4 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapFsm.c +++ b/drivers/staging/prima/CORE/SAP/src/sapFsm.c @@ -39,9 +39,6 @@ Are listed for each API below. - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -65,6 +62,10 @@ * Include Files * -------------------------------------------------------------------------*/ #include "sapInternal.h" +#ifdef WLAN_FEATURE_AP_HT40_24G +#include "csrInsideApi.h" +#include "cfgApi.h" +#endif // Pick up the SME API definitions #include "sme_Api.h" // Pick up the PMC API definitions @@ -100,6 +101,13 @@ extern safeChannelType safeChannels[]; static VOS_STATUS sapGetChannelList(ptSapContext sapContext, v_U8_t **channelList, v_U8_t *numberOfChannels); #endif + +#ifdef WLAN_FEATURE_AP_HT40_24G +static VOS_STATUS sapGetChannelListForObss(tHalHandle halHandle, + ptSapContext psapCtx, v_U8_t **channelList, + v_U8_t *numberOfChannels); +#endif + /*---------------------------------------------------------------------------- * Externalized Function Definitions * -------------------------------------------------------------------------*/ @@ -136,6 +144,80 @@ static inline void sapEventInit(ptWLAN_SAPEvent sapEvent) sapEvent->u2 = 0; } +#ifdef WLAN_FEATURE_AP_HT40_24G +/*========================================================================== + FUNCTION sapSetObssParm + + DESCRIPTION + Function for Setting OBSS Scan interval & OBSS TRANS_DELAY_FACTOR + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + + RETURN VALUE + The VOS_STATUS code associated with performing the operation + + VOS_STATUS_SUCCESS: Success + + SIDE EFFECTS +============================================================================*/ +void sapSetObssParm(ptSapContext sapContext) +{ + tHalHandle hHal; + tpAniSirGlobal pMac; + tANI_U32 cfgValue; + + /* tHalHandle */ + hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); + + if (NULL == hHal) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Invalid hHal")); + return; + } + + pMac = PMAC_STRUCT( hHal ); + + if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, + &cfgValue) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Fail to retrieve" + "WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL value")); + return; + } + + sapContext->ObssScanInterval = cfgValue; + + if (wlan_cfgGetInt(pMac, + WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR, + &cfgValue) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Fail to retrieve" + "WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR value")); + return; + } + + sapContext->ObssTransitionDelayFactor = cfgValue; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("ObssScanInterval: %d" + " ObssTransitionDelayFactor: %d"), + sapContext->ObssScanInterval, + sapContext->ObssTransitionDelayFactor); + + return; +} +#endif + + /*========================================================================== FUNCTION sapGotoChannelSel @@ -170,6 +252,7 @@ sapGotoChannelSel tCsrScanRequest scanRequest;/* To be initialised if scan is required */ v_U32_t scanRequestID = 0; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + eSapPhyMode sapPhyMode; #ifdef SOFTAP_CHANNEL_RANGE v_U8_t *channelList = NULL; @@ -187,6 +270,9 @@ sapGotoChannelSel return VOS_STATUS_E_FAULT; } + sapPhyMode = + sapConvertSapPhyModeToCsrPhyMode(sapContext->csrRoamProfile.phyMode); + /*If STA-AP concurrency is enabled take the concurrent connected channel first. In other cases wpa_supplicant should take care */ if (vos_get_concurrency_mode() == VOS_STA_SAP) { @@ -196,9 +282,10 @@ sapGotoChannelSel { /*if a valid channel is returned then use concurrent channel. Else take whatever comes from configuartion*/ sapContext->channel = channel; - sme_SelectCBMode(hHal, - sapConvertSapPhyModeToCsrPhyMode(sapContext->csrRoamProfile.phyMode), - channel); +#ifdef WLAN_FEATURE_AP_HT40_24G + if (sapContext->channel > SIR_11B_CHANNEL_END) +#endif + sme_SelectCBMode(hHal, sapPhyMode, sapContext->channel); } } @@ -242,7 +329,8 @@ sapGotoChannelSel #endif /* Set requestType to Full scan */ - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, calling sme_ScanRequest", __func__); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Auto Channel Selection Scan")); halStatus = sme_ScanRequest(hHal, 0,//Not used in csrScanRequest @@ -252,8 +340,11 @@ sapGotoChannelSel sapContext);//void * pContext scanRequestID filled up if (eHAL_STATUS_SUCCESS != halStatus) { - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "%s:sme_ScanRequest fail %d!!!", __func__, halStatus); - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "SoftAP Configuring for default channel, Ch= %d", sapContext->channel); + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Auto Channel Selection Scan fail %d!!!"), halStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SoftAP Configuring for default channel, Ch= %d"), + sapContext->channel); /* In case of error, switch to default channel */ sapContext->channel = SAP_DEFAULT_CHANNEL; @@ -272,24 +363,145 @@ sapGotoChannelSel } else { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, return from sme_ScanRequest, scanRequestID=%d, Ch= %d", - __func__, scanRequestID, sapContext->channel); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Auto Channel Selection Scan Success" + " scanRequestID=%d, Ch= %d"), + scanRequestID, sapContext->channel); } } else { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, for configured channel, Ch= %d", __func__, sapContext->channel); - /* Fill in the event structure */ - // Eventhough scan was not done, means a user set channel was chosen - sapEventInit(sapEvent); - /* Handle event */ - vosStatus = sapFsm(sapContext, sapEvent); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("For configured channel, Ch= %d"), sapContext->channel); + +#ifdef WLAN_FEATURE_AP_HT40_24G + if (vos_get_concurrency_mode() != VOS_STA_SAP) + { + if ((sapContext->channel <= SIR_11B_CHANNEL_END) + && (sapContext->channel > RF_CHAN_1)) + { + // OBSS Scan for P2P GO/SAP where Auto Channel Selection is Disable + vosStatus = sapGetChannelListForObss(hHal, sapContext, + &channelList, &numOfChannels); + if (VOS_STATUS_SUCCESS == vosStatus && channelList != NULL) + { + + if (sapCheckHT40SecondaryIsNotAllowed(sapContext)) + { + if(channelList != NULL) + { + vos_mem_free(channelList); + channelList = NULL; + } + goto disable24GChannelBonding; + } + vos_mem_zero(&scanRequest, sizeof(scanRequest)); + + /* Set scanType to Passive scan */ + scanRequest.scanType = eSIR_PASSIVE_SCAN; + + /* Set min and max channel time to zero */ + scanRequest.minChnTime = CSR_ACTIVE_MIN_CHANNEL_TIME; + scanRequest.maxChnTime = CSR_ACTIVE_MAX_CHANNEL_TIME; + + /* Set BSSType to default type */ + scanRequest.BSSType = eCSR_BSS_TYPE_ANY; + + /*Scan the channels in the list*/ + scanRequest.ChannelInfo.numOfChannels = numOfChannels; + scanRequest.ChannelInfo.ChannelList = channelList; + scanRequest.requestType = eCSR_SCAN_SOFTAP_CHANNEL_RANGE; + sapContext->channelList = channelList; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("OBSS Scan for SAP/P2P GO: Ch= %d"), + sapContext->channel); + + halStatus = sme_ScanRequest(hHal, + 0,//Not used in csrScanRequest + &scanRequest, + &scanRequestID,//, when ID == 0 11D scan/active scan with callback, min-maxChntime set in csrScanRequest()? + &WLANSAP_ScanCallback,//csrScanCompleteCallback callback, + sapContext);//void * pContext scanRequestID filled up + + if (eHAL_STATUS_SUCCESS != halStatus) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("OBSS ScanRequest Fail %d!!!"), + halStatus); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SoftAP Configuring for default channel, Ch= %d"), + sapContext->channel); + + if(sapContext->channelList != NULL) + { + vos_mem_free(sapContext->channelList); + sapContext->channelList = NULL; + } + goto disable24GChannelBonding; + } + else + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("OBSS ScanRequest Success, scanRequestID=%d" + " Ch= %d"), scanRequestID, sapContext->channel); + goto startgo; + } + } + else + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Failed to Prepare the OBSS Scan channel list")); + goto disable24GChannelBonding; + } +disable24GChannelBonding: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Disable Channel Bonding")); + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(hHal, + PHY_SINGLE_CHANNEL_CENTERED); + } + else + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("No concurrency & Channel: %d"), + sapContext->channel); + goto selectChannelBonding; + } + } + else + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("With concurrency & Channel: %d"), + sapContext->channel); + goto selectChannelBonding; + } +#endif + +#ifdef WLAN_FEATURE_AP_HT40_24G +selectChannelBonding: + if (sapContext->channel > SIR_11B_CHANNEL_END) +#endif + sme_SelectCBMode(hHal, sapPhyMode, sapContext->channel); + + /* Fill in the event structure */ + // Eventhough scan was not done, means a user set channel was chosen + sapEventInit(sapEvent); + /* Handle event */ + vosStatus = sapFsm(sapContext, sapEvent); } +#ifdef WLAN_FEATURE_AP_HT40_24G +startgo: +#endif + /* If scan failed, get default channel and advance state + * machine as success with default channel. Have to wait + * for the call back to be called to get the channel cannot + * advance state machine here as said above */ - /* If scan failed, get default channel and advance state machine as success with default channel */ - /* Have to wait for the call back to be called to get the channel cannot advance state machine here as said above */ - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before exiting sapGotoChannelSel channel=%d", __func__, sapContext->channel); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Before exiting sapGotoChannelSel channel=%d"), + sapContext->channel); return VOS_STATUS_SUCCESS; }// sapGotoChannelSel @@ -508,8 +720,8 @@ sapSignalHDDevent /* Format the Start BSS Complete event to return... */ if (NULL == sapContext->pfnSapEventCallback) { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "%s: HDD Event" - " callaback invalid", __func__); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("HDD Event callaback invalid")); return VOS_STATUS_E_INVAL; } @@ -537,8 +749,9 @@ sapSignalHDDevent } break; case eSAP_START_BSS_EVENT: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_START_BSS_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_START_BSS_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_START_BSS_EVENT; sapApAppEvent.sapevt.sapStartBssCompleteEvent.status = (eSapStatus )context; if(pCsrRoamInfo != NULL ){ @@ -550,16 +763,18 @@ sapSignalHDDevent break; case eSAP_STOP_BSS_EVENT: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STOP_BSS_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STOP_BSS_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_STOP_BSS_EVENT; sapApAppEvent.sapevt.sapStopBssCompleteEvent.status = (eSapStatus )context; break; case eSAP_STA_ASSOC_EVENT: { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STA_ASSOC_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STA_ASSOC_EVENT"); if (pCsrRoamInfo->fReassocReq) sapApAppEvent.sapHddEventCode = eSAP_STA_REASSOC_EVENT; else @@ -591,8 +806,9 @@ sapSignalHDDevent } case eSAP_STA_DISASSOC_EVENT: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STA_DISASSOC_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STA_DISASSOC_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_STA_DISASSOC_EVENT; vos_mem_copy( &sapApAppEvent.sapevt.sapStationDisassocCompleteEvent.staMac, @@ -608,8 +824,9 @@ sapSignalHDDevent break; case eSAP_STA_SET_KEY_EVENT: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STA_SET_KEY_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STA_SET_KEY_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_STA_SET_KEY_EVENT; sapApAppEvent.sapevt.sapStationSetKeyCompleteEvent.status = (eSapStatus )context; vos_mem_copy(&sapApAppEvent.sapevt.sapStationSetKeyCompleteEvent.peerMacAddr, @@ -617,8 +834,9 @@ sapSignalHDDevent break; case eSAP_STA_DEL_KEY_EVENT : - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STA_DEL_KEY_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STA_DEL_KEY_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_STA_DEL_KEY_EVENT; sapApAppEvent.sapevt.sapStationDeleteKeyCompleteEvent.status = (eSapStatus )context; //TODO: Should we need to send the key information @@ -626,8 +844,9 @@ sapSignalHDDevent break; case eSAP_STA_MIC_FAILURE_EVENT : - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_STA_MIC_FAILURE_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_STA_MIC_FAILURE_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_STA_MIC_FAILURE_EVENT; vos_mem_copy( &sapApAppEvent.sapevt.sapStationMICFailureEvent.srcMacAddr, pCsrRoamInfo->u.pMICFailureInfo->srcMacAddr, @@ -647,59 +866,47 @@ sapSignalHDDevent break; case eSAP_ASSOC_STA_CALLBACK_EVENT: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, SAP event callback event = %s", - __func__, "eSAP_ASSOC_STA_CALLBACK_EVENT"); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_ASSOC_STA_CALLBACK_EVENT"); break; case eSAP_WPS_PBC_PROBE_REQ_EVENT: + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("SAP event callback event = %s"), + "eSAP_WPS_PBC_PROBE_REQ_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_WPS_PBC_PROBE_REQ_EVENT; vos_mem_copy( &sapApAppEvent.sapevt.sapPBCProbeReqEvent.WPSPBCProbeReq, pCsrRoamInfo->u.pWPSPBCProbeReq, sizeof(tSirWPSPBCProbeReq)); break; - - case eSAP_INDICATE_MGMT_FRAME: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_INDICATE_MGMT_FRAME"); - sapApAppEvent.sapHddEventCode = eSAP_INDICATE_MGMT_FRAME; - sapApAppEvent.sapevt.sapManagementFrameInfo.nFrameLength - = pCsrRoamInfo->nFrameLength; - sapApAppEvent.sapevt.sapManagementFrameInfo.pbFrames - = pCsrRoamInfo->pbFrames; - sapApAppEvent.sapevt.sapManagementFrameInfo.frameType - = pCsrRoamInfo->frameType; - sapApAppEvent.sapevt.sapManagementFrameInfo.rxChan - = pCsrRoamInfo->rxChan; - - break; case eSAP_REMAIN_CHAN_READY: VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_REMAIN_CHAN_READY"); + FL("SAP event callback event = %s"), + "eSAP_REMAIN_CHAN_READY"); sapApAppEvent.sapHddEventCode = eSAP_REMAIN_CHAN_READY; break; case eSAP_SEND_ACTION_CNF: VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_SEND_ACTION_CNF"); + FL("SAP event callback event = %s"), + "eSAP_SEND_ACTION_CNF"); sapApAppEvent.sapHddEventCode = eSAP_SEND_ACTION_CNF; sapApAppEvent.sapevt.sapActionCnf.actionSendSuccess = (eSapStatus)context; break; case eSAP_DISCONNECT_ALL_P2P_CLIENT: VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_DISCONNECT_ALL_P2P_CLIENT"); + FL("SAP event callback event = %s"), + "eSAP_DISCONNECT_ALL_P2P_CLIENT"); sapApAppEvent.sapHddEventCode = eSAP_DISCONNECT_ALL_P2P_CLIENT; sapApAppEvent.sapevt.sapActionCnf.actionSendSuccess = (eSapStatus)context; break; case eSAP_MAC_TRIG_STOP_BSS_EVENT : VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_MAC_TRIG_STOP_BSS_EVENT"); + FL("SAP event callback event = %s"), + "eSAP_MAC_TRIG_STOP_BSS_EVENT"); sapApAppEvent.sapHddEventCode = eSAP_MAC_TRIG_STOP_BSS_EVENT; sapApAppEvent.sapevt.sapActionCnf.actionSendSuccess = (eSapStatus)context; break; @@ -707,8 +914,8 @@ sapSignalHDDevent case eSAP_UNKNOWN_STA_JOIN: VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_UNKNOWN_STA_JOIN"); + FL("SAP event callback event = %s"), + "eSAP_UNKNOWN_STA_JOIN"); sapApAppEvent.sapHddEventCode = eSAP_UNKNOWN_STA_JOIN; vos_mem_copy((v_PVOID_t)sapApAppEvent.sapevt.sapUnknownSTAJoin.macaddr.bytes, (v_PVOID_t)context, sizeof(v_MACADDR_t)); @@ -716,16 +923,17 @@ sapSignalHDDevent case eSAP_MAX_ASSOC_EXCEEDED: VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, SAP event callback event = %s", - __func__, "eSAP_MAX_ASSOC_EXCEEDED"); + FL("SAP event callback event = %s"), + "eSAP_MAX_ASSOC_EXCEEDED"); sapApAppEvent.sapHddEventCode = eSAP_MAX_ASSOC_EXCEEDED; vos_mem_copy((v_PVOID_t)sapApAppEvent.sapevt.sapMaxAssocExceeded.macaddr.bytes, (v_PVOID_t)pCsrRoamInfo->peerMac, sizeof(v_MACADDR_t)); break; default: - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, SAP Unknown callback event = %d", - __func__,sapHddevent); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("SAP Unknown callback event = %d"), + sapHddevent); break; } vosStatus = (*sapContext->pfnSapEventCallback) @@ -798,6 +1006,9 @@ sapFsm /* Set SAP device role */ sapContext->sapsMachine = eSAP_CH_SELECT; +#ifdef WLAN_FEATURE_AP_HT40_24G + sapSetObssParm(sapContext); +#endif /* Perform sme_ScanRequest */ vosStatus = sapGotoChannelSel(sapContext, sapEvent); @@ -850,6 +1061,20 @@ sapFsm /* Transition from eSAP_STARTING to eSAP_STARTED (both without substates) */ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "eSAP_STARTING", "eSAP_STARTED"); + +#ifdef WLAN_FEATURE_AP_HT40_24G + /* Initialize the HT2040 timer */ + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + "In %s, Init HT20/40 timer", __func__); + + vosStatus = vos_timer_init( &sapContext->sap_HT2040_timer, + VOS_TIMER_TYPE_SW, sap_ht2040_timer_cb, + (v_PVOID_t)sapContext ); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "In %s, Failed to Init HT20/40 timer", __func__); +#endif } else if (msg == eSAP_MAC_START_FAILS) { @@ -874,6 +1099,22 @@ sapFsm sapContext->sapsMachine = eSAP_DISCONNECTED; vosStatus = sapSignalHDDevent( sapContext, NULL, eSAP_START_BSS_EVENT, (v_PVOID_t)eSAP_STATUS_FAILURE); vosStatus = sapGotoDisconnected(sapContext); + +#ifdef WLAN_FEATURE_AP_HT40_24G + /* Reset the OBSS Affected Channel Range */ + if ( (0 != sapContext->affected_start) + && (0 != sapContext->affected_end) + && (0 != sapContext->sap_sec_chan) ) + { + sapContext->affected_start = 0; + sapContext->affected_end = 0; + sapContext->sap_sec_chan = 0; + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Reset the OBSS Affected Channel Range [%d %d]"), + sapContext->affected_start, sapContext->affected_end); + + } +#endif /* Close the SME session*/ if (eSAP_TRUE == sapContext->isSapSessionOpen) @@ -887,7 +1128,7 @@ sapFsm } else if (eHAL_STATUS_SUCCESS == sme_CloseSession(hHal, - sapContext->sessionId, NULL, NULL)) + sapContext->sessionId, VOS_TRUE, NULL, NULL)) { sapContext->isSapSessionOpen = eSAP_FALSE; } @@ -916,6 +1157,33 @@ sapFsm VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, in state %s, invalid event msg %d", __func__, "eSAP_STARTED", msg); } +#ifdef WLAN_FEATURE_AP_HT40_24G + /* Reset the OBSS Affected Channel Range */ + if ( (0 != sapContext->affected_start) + && (0 != sapContext->affected_end) + && (0 != sapContext->sap_sec_chan) ) + { + sapContext->affected_start = 0; + sapContext->affected_end = 0; + sapContext->sap_sec_chan = 0; + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Reset the OBSS Affected Channel Range [%d %d]"), + sapContext->affected_start, sapContext->affected_end); + } + + if (VOS_TIMER_STATE_RUNNING == sapContext->sap_HT2040_timer.state) + { + vosStatus = vos_timer_stop(&sapContext->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + + vosStatus = vos_timer_destroy(&sapContext->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Destroy HT20/40 timer")); +#endif break; case eSAP_DISCONNECTING: @@ -942,7 +1210,7 @@ sapFsm sapContext->isSapSessionOpen = eSAP_FALSE; if (!HAL_STATUS_SUCCESS( sme_CloseSession(hHal, - sapContext->sessionId, + sapContext->sessionId, VOS_TRUE, sapRoamSessionCloseCallback, sapContext))) { vosStatus = sapSignalHDDevent(sapContext, NULL, @@ -1290,6 +1558,256 @@ void sapPrintACL(v_MACADDR_t *macList, v_U8_t size) return; } +/*========================================================================== + FUNCTION sapGetStaId + + DESCRIPTION + Get the STA ID from Mac address. + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + staId : STA ID + pCsrRoamInfo : Pointer to CSR info + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +VOS_STATUS sapGetStaId(ptSapContext sapContext, v_U8_t *staId, + tCsrRoamInfo *pCsrRoamInfo) +{ + v_U8_t i; + + for (i = 0; i < WLAN_MAX_STA_COUNT; i++) + { + if (vos_mem_compare(&sapContext->aStaInfo[i].macAddrSTA, + pCsrRoamInfo->peerMac, sizeof(v_MACADDR_t)) + && sapContext->aStaInfo[i].isUsed) + { + *staId = i; + return VOS_STATUS_SUCCESS; + } + } + return VOS_STATUS_E_FAILURE; +} + +/*========================================================================== + FUNCTION sapAddHT40IntolerantSta + + DESCRIPTION + Add HT40 Intolerant STA & Move SAP from HT40 to HT20 + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + pCsrRoamInfo : Pointer to CSR info + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +#ifdef WLAN_FEATURE_AP_HT40_24G +void sapAddHT40IntolerantSta(ptSapContext sapContext, + tCsrRoamInfo *pCsrRoamInfo) +{ + + tHalHandle hHal; + v_U8_t cbMode; + tANI_U8 staId; + eHalStatus halStatus; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + + /* tHalHandle */ + hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); + + if (NULL == hHal) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("In invalid hHal")); + return; + } + + staId = pCsrRoamInfo->staId; + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Add HT40 MHz Intolerant STA :" + MAC_ADDRESS_STR " STA ID: %d"), + MAC_ADDR_ARRAY(pCsrRoamInfo->peerMac), + staId); + + // Get Channel Bonding Mode + cbMode = sme_GetChannelBondingMode24G(hHal); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Current Channel Bonding Mode: %d " + "HT40IntolerantSet: %d"), + cbMode, sapContext->aStaInfo[staId].isHT40IntolerantSet); + + if(sapContext->aStaInfo[staId].isHT40IntolerantSet) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("HT40Intolerant is Already Set: %d"), + sapContext->aStaInfo[staId].isHT40IntolerantSet); + return; + } + + spin_lock_bh(&sapContext->staInfo_lock); + + sapContext->aStaInfo[staId].isHT40IntolerantSet = 1; + sapContext->numHT40IntoSta++; + + spin_unlock_bh(&sapContext->staInfo_lock); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Total No of HT40 Intolerant STA: %d" + " STA ID: %d HT40IntolerantSet: %d"), + sapContext->numHT40IntoSta, + staId, sapContext->aStaInfo[staId].isHT40IntolerantSet); + + /* Stop HT20/40 Timer */ + if (VOS_TIMER_STATE_RUNNING == sapContext->sap_HT2040_timer.state) + { + vosStatus = vos_timer_stop(&sapContext->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + + if(cbMode) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Move SAP from HT40 to HT20")); + + halStatus = sme_SetHT2040Mode(hHal, sapContext->sessionId, + PHY_SINGLE_CHANNEL_CENTERED); + + if (halStatus == eHAL_STATUS_FAILURE) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to change HT20/40 mode")); + return; + } + + /* Disable Channel Bonding for 2.4GHz */ + sme_UpdateChannelBondingMode24G(hHal, + PHY_SINGLE_CHANNEL_CENTERED); + + } + else + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("SAP is Already in HT20")); +} + +/*========================================================================== + FUNCTION sapRemoveHT40IntolerantSta + + DESCRIPTION + Remove HT40 Intolerant STA & Move SAP from HT40 to HT20 + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + pCsrRoamInfo : Pointer to CSR info + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +void sapRemoveHT40IntolerantSta(ptSapContext sapContext, + tCsrRoamInfo *pCsrRoamInfo) +{ + tANI_U8 staId; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + unsigned int delay; + + vosStatus = sapGetStaId(sapContext, &staId, pCsrRoamInfo); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("ERROR: SAP Failed to find sta id!!")); + return; + } + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Remove HT40 MHz Intolerant STA :" + MAC_ADDRESS_STR " STA ID: %d" + " HT40IntolerantSet:%d"), + MAC_ADDR_ARRAY(pCsrRoamInfo->peerMac), + staId, sapContext->aStaInfo[staId].isHT40IntolerantSet); + + if(!sapContext->aStaInfo[staId].isHT40IntolerantSet) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("HT40Intolerant is not Set: %d"), + sapContext->aStaInfo[staId].isHT40IntolerantSet); + return; + } + + spin_lock_bh(&sapContext->staInfo_lock); + sapContext->aStaInfo[staId].isHT40IntolerantSet = 0; + + if (sapContext->numHT40IntoSta > 0) + sapContext->numHT40IntoSta--; + + spin_unlock_bh(&sapContext->staInfo_lock); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Total No of HT40 Intolerant STA: %d" + " STA ID: %d HT40IntolerantSet: %d"), + sapContext->numHT40IntoSta, + staId, sapContext->aStaInfo[staId].isHT40IntolerantSet); + + if ((!sapCheckHT40SecondaryIsNotAllowed(sapContext)) + && (!sapContext->numHT40IntoSta)) + { + /* Stop Previous Running HT20/40 Timer & Start timer + with (OBSS TransitionDelayFactor * obss interval) + delay after time out move AP from HT20 -> HT40 + mode + */ + if (VOS_TIMER_STATE_RUNNING == sapContext->sap_HT2040_timer.state) + { + vosStatus = vos_timer_stop(&sapContext->sap_HT2040_timer); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Stop HT20/40 timer")); + } + + delay = + (sapContext->ObssScanInterval * sapContext->ObssTransitionDelayFactor); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Start HT20/40 itransition" + " timer (%d sec)"), delay); + + vosStatus = vos_timer_start( &sapContext->sap_HT2040_timer, + (delay * 1000)); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Failed to Start HT20/40 timer")); + } + return; +} +#endif + VOS_STATUS sapIsPeerMacAllowed(ptSapContext sapContext, v_U8_t *peerMac) { @@ -1538,3 +2056,73 @@ static VOS_STATUS sapGetChannelList(ptSapContext sapContext, return VOS_STATUS_SUCCESS; } #endif + +#ifdef WLAN_FEATURE_AP_HT40_24G +static VOS_STATUS sapGetChannelListForObss(tHalHandle halHandle, + ptSapContext psapCtx, v_U8_t **channelList, + v_U8_t *numberOfChannels) +{ + v_U32_t startChannelNum; + v_U32_t endChannelNum; + v_U8_t loopCount; + v_U8_t channelCount; + v_U8_t *list; + + if (eHAL_STATUS_SUCCESS != sapGet24GOBSSAffectedChannel(halHandle, psapCtx)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "%s:Not able to Get Affected Channel Range for Channel : %d", + __func__, psapCtx->channel); + return VOS_STATUS_E_FAILURE; + } + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + "%s: 40 MHz affected channel range: [%d,%d] MHz", + __func__, psapCtx->affected_start, psapCtx->affected_end); + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + "%s: SAP Primary & Secondary Channel : [%d,%d] MHz", + __func__, psapCtx->channel, psapCtx->sap_sec_chan); + + /* Allocate the max number of channel supported */ + list = (v_U8_t *)vos_mem_malloc(RF_CHAN_14 + 1); + if (NULL == list) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "%s: Unable to allocate channel list", __func__); + *numberOfChannels = 0; + *channelList = NULL; + return VOS_STATUS_E_RESOURCES; + } + + /*Search for the Active channels in the given range */ + channelCount = 0; + startChannelNum = RF_CHAN_1; + endChannelNum = RF_CHAN_14; + for( loopCount = startChannelNum; loopCount <= endChannelNum; loopCount++ ) + { + if ((rfChannels[loopCount].channelNum >= psapCtx->affected_start) + && (rfChannels[loopCount].channelNum <= psapCtx->affected_end)) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + "%s: Channel Number: %d State : %d", __func__, + rfChannels[loopCount].channelNum, + vos_nv_getChannelEnabledState(rfChannels[loopCount].channelNum)); + list[channelCount] = rfChannels[loopCount].channelNum; + channelCount++; + } + } + /* return the channel list and number of channels to scan*/ + *numberOfChannels = channelCount; + if(channelCount != 0) + { + *channelList = list; + } + else + { + *channelList = NULL; + vos_mem_free(list); + } + return VOS_STATUS_SUCCESS; +} +#endif diff --git a/drivers/staging/prima/CORE/SAP/src/sapFsm_ext.h b/drivers/staging/prima/CORE/SAP/src/sapFsm_ext.h index 7a87786ed317..bc5ee88936b6 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapFsm_ext.h +++ b/drivers/staging/prima/CORE/SAP/src/sapFsm_ext.h @@ -25,11 +25,6 @@ * to the Linux Foundation. */ -/* - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary - */ - /* This file is generated from btampFsm.cdd - do not edit manually*/ /* Generated on: Thu Oct 16 15:40:39 PDT 2008 */ diff --git a/drivers/staging/prima/CORE/SAP/src/sapInternal.h b/drivers/staging/prima/CORE/SAP/src/sapInternal.h index efae8cffec46..b818e4819e81 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapInternal.h +++ b/drivers/staging/prima/CORE/SAP/src/sapInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,8 +39,6 @@ DESCRIPTION module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -82,6 +80,8 @@ when who what, where, why #include "sapFsm_ext.h" #include "sapChSelect.h" #include "wlan_hdd_dp_utils.h" +#include "wlan_hdd_main.h" + /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants * -------------------------------------------------------------------------*/ @@ -162,16 +162,13 @@ typedef struct { WLANTL_STAStateType tlSTAState; /** Transmit queues for each AC (VO,VI,BE etc). */ - //hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; - hdd_list_t wmm_tx_queue[4]; + hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; /** Might need to differentiate queue depth in contention case */ - //v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; - v_U16_t aTxQueueDepth[4]; + v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; /**Track whether OS TX queue has been disabled.*/ - //v_BOOL_t txSuspended[NUM_TX_QUEUES]; - v_BOOL_t txSuspended[4]; + v_BOOL_t txSuspended[NUM_TX_QUEUES]; /**Track whether 3/4th of resources are used */ v_BOOL_t vosLowResource; @@ -181,6 +178,11 @@ typedef struct { /** The station entry for which Deauth is in progress */ v_BOOL_t isDeauthInProgress; + +#ifdef WLAN_FEATURE_AP_HT40_24G + /** Track HT40 Intolerant station */ + v_BOOL_t isHT40IntolerantSet; +#endif } hdd_station_info_t; typedef struct sSapContext { @@ -260,6 +262,15 @@ typedef struct sSapContext { tSapAcsChannelInfo acsBestChannelInfo; spinlock_t staInfo_lock; //To protect access to station Info hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; +#ifdef WLAN_FEATURE_AP_HT40_24G + v_U8_t affected_start; + v_U8_t affected_end; + v_U8_t sap_sec_chan; + v_U8_t numHT40IntoSta; + vos_timer_t sap_HT2040_timer; + v_U8_t ObssScanInterval; + v_U8_t ObssTransitionDelayFactor; +#endif } *ptSapContext; @@ -283,6 +294,32 @@ typedef struct sWLAN_SAPEvent { /*---------------------------------------------------------------------------- * Function Declarations and Documentation * -------------------------------------------------------------------------*/ +#ifdef WLAN_FEATURE_AP_HT40_24G +/*========================================================================== + + FUNCTION sapGet24GOBSSAffectedChannel() + + DESCRIPTION + Get OBSS Affected Channel no for SAP + + DEPENDENCIES + NA. + + PARAMETERS + + IN + tHalHandle: the tHalHandle passed in with the scan request + ptSapContext: Pointer to SAP context + + RETURN VALUE + + SIDE EFFECTS + +============================================================================*/ + +eHalStatus sapGet24GOBSSAffectedChannel(tHalHandle halHandle, + ptSapContext psapCtx); +#endif /*========================================================================== @@ -577,6 +614,53 @@ sapconvertToCsrProfile(tsap_Config_t *pconfig_params, eCsrRoamBssType bssType, t ============================================================================*/ void sapFreeRoamProfile(tCsrRoamProfile *profile); + +#ifdef WLAN_FEATURE_AP_HT40_24G +/*========================================================================== + FUNCTION sapAddHT40IntolerantSta + + DESCRIPTION + Add HT40 Intolerant STA & Move SAP from HT40 to HT20 + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + pCsrRoamInfo : Pointer to CSR info + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +void sapAddHT40IntolerantSta(ptSapContext sapContext, tCsrRoamInfo *pCsrRoamInfo); + +/*========================================================================== + FUNCTION sapRemoveHT40IntolerantSta + + DESCRIPTION + Remove HT40 Intolerant STA & Move SAP from HT40 to HT20 + + DEPENDENCIES + NA. + + PARAMETERS + + IN + sapContext : Sap Context value + pCsrRoamInfo : Pointer to CSR info + + RETURN VALUE + + SIDE EFFECTS +============================================================================*/ + +void sapRemoveHT40IntolerantSta(ptSapContext sapContext, tCsrRoamInfo *pCsrRoamInfo); +#endif + /*========================================================================== FUNCTION sapIsPeerMacAllowed @@ -803,6 +887,27 @@ SIDE EFFECTS ============================================================================*/ eCsrPhyMode sapConvertSapPhyModeToCsrPhyMode( eSapPhyMode sapPhyMode ); +#ifdef WLAN_FEATURE_AP_HT40_24G +/*========================================================================== +FUNCTION sap_ht2040_timer_cb + +DESCRIPTION Function to implement ht2040 timer callback implementation + +SIDE EFFECTS +============================================================================*/ +void sap_ht2040_timer_cb(v_PVOID_t usrDataForCallback); + +/*========================================================================== +FUNCTION sapCheckHT40SecondaryIsNotAllowed + +DESCRIPTION Function to check HT40 secondary channel is allowed or not + +SIDE EFFECTS +============================================================================*/ + +eHalStatus sapCheckHT40SecondaryIsNotAllowed(ptSapContext psapCtx); +#endif + #ifdef __cplusplus } #endif diff --git a/drivers/staging/prima/CORE/SAP/src/sapModule.c b/drivers/staging/prima/CORE/SAP/src/sapModule.c index 9bd6a1765a22..57e50c7d3308 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapModule.c +++ b/drivers/staging/prima/CORE/SAP/src/sapModule.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -158,8 +158,6 @@ WLANSAP_Open return VOS_STATUS_E_FAULT; } - vos_mem_zero(pSapCtx, sizeof(tSapContext)); - /*------------------------------------------------------------------------ Clean up SAP control block, initialize all values ------------------------------------------------------------------------*/ @@ -167,6 +165,14 @@ WLANSAP_Open WLANSAP_CleanCB(pSapCtx, 0 /*do not empty*/); + if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_init(&pSapCtx->staInfo_lock))) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "WLANSAP_Start failed init staInfo_lock"); + vos_free_context(pvosGCtx, VOS_MODULE_ID_SAP, pSapCtx); + return VOS_STATUS_E_FAULT; + } + // Setup the "link back" to the VOSS context pSapCtx->pvosGCtx = pvosGCtx; @@ -259,13 +265,6 @@ WLANSAP_Start return VOS_STATUS_E_FAULT; } - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_init(&pSapCtx->staInfo_lock))) - { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "WLANSAP_Start failed init staInfo_lock\n"); - return VOS_STATUS_E_FAULT; - } - return VOS_STATUS_SUCCESS; }/* WLANSAP_Start */ @@ -453,7 +452,7 @@ WLANSAP_CleanCB pSapCtx->sapsMachine= eSAP_DISCONNECTED; - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d, sapContext value = %p", + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d, sapContext value = %pK", __func__, pSapCtx->sapsMachine, pSapCtx); pSapCtx->sessionId = 0; pSapCtx->channel = 0; @@ -603,9 +602,6 @@ WLANSAP_StartBss //Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; - vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid, - pSapCtx->self_mac_addr, - sizeof( tCsrBssid ) ); //Save a copy to SAP context vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid, @@ -1230,7 +1226,11 @@ VOS_STATUS WLANSAP_DisassocSta ( v_PVOID_t pvosGCtx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_U8_t *pPeerStaMac +#else v_U8_t *pPeerStaMac +#endif ) { ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); @@ -2095,7 +2095,7 @@ VOS_STATUS WLANSAP_SendAction( v_PVOID_t pvosGCtx, const tANI_U8 *pBuf, if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) { VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", + "%s: HAL pointer (%pK) NULL OR SME session is not open (%d)", __func__, hHal, pSapCtx->isSapSessionOpen ); return VOS_STATUS_E_FAULT; } @@ -2163,7 +2163,7 @@ VOS_STATUS WLANSAP_RemainOnChannel( v_PVOID_t pvosGCtx, if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) { VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", + "%s: HAL pointer (%pK) NULL OR SME session is not open (%d)", __func__, hHal, pSapCtx->isSapSessionOpen ); return VOS_STATUS_E_FAULT; } @@ -2289,7 +2289,7 @@ VOS_STATUS WLANSAP_RegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType, if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) { VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", + "%s: HAL pointer (%pK) NULL OR SME session is not open (%d)", __func__, hHal, pSapCtx->isSapSessionOpen ); return VOS_STATUS_E_FAULT; } @@ -2354,7 +2354,7 @@ VOS_STATUS WLANSAP_DeRegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType, if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) { VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", + "%s: HAL pointer (%pK) NULL OR SME session is not open (%d)", __func__, hHal, pSapCtx->isSapSessionOpen ); return VOS_STATUS_E_FAULT; } @@ -2404,7 +2404,7 @@ void WLANSAP_PopulateDelStaParams(const v_U8_t *mac, vos_mem_copy(pDelStaParams->peerMacAddr, mac, VOS_MAC_ADDR_SIZE); if (reason_code == 0) - pDelStaParams->reason_code = eCsrForcedDeauthSta; + pDelStaParams->reason_code = eSIR_MAC_DEAUTH_LEAVING_BSS_REASON; else pDelStaParams->reason_code = reason_code; diff --git a/drivers/staging/prima/CORE/SME/inc/btcApi.h b/drivers/staging/prima/CORE/SME/inc/btcApi.h index 33f4f740c127..bab11f42d9cf 100644 --- a/drivers/staging/prima/CORE/SME/inc/btcApi.h +++ b/drivers/staging/prima/CORE/SME/inc/btcApi.h @@ -31,8 +31,6 @@ * * Description: BTC Events Layer API definitions. * -* Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. -* Qualcomm Confidential and Proprietary. * ******************************************************************************/ @@ -107,12 +105,6 @@ */ #define BT_MAX_EVENT_DONE_TIMEOUT 45000 -/* - Maximum time duration to enable uapsd after the event is received from - firmware. This is added to handle back to back events from BTC. -*/ -#define BTC_MAX_ENABLE_UAPSD_TIMER (1000*60) - /* To suppurt multiple SCO connections for BT+UAPSD work */ diff --git a/drivers/staging/prima/CORE/SME/inc/ccmApi.h b/drivers/staging/prima/CORE/SME/inc/ccmApi.h index f386a9e62b00..0abfdc5b5b25 100644 --- a/drivers/staging/prima/CORE/SME/inc/ccmApi.h +++ b/drivers/staging/prima/CORE/SME/inc/ccmApi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,7 +42,7 @@ #define CCMAPI_H__ //#include "wniCfgAp.h" /* CFG_PARAM_MAX_NUM */ -#include "wniCfgSta.h" +#include "wniCfg.h" #include "halTypes.h" #define CCM_11B_CHANNEL_END 14 diff --git a/drivers/staging/prima/CORE/SME/inc/csrApi.h b/drivers/staging/prima/CORE/SME/inc/csrApi.h index 43a3d309e5ca..a8cec2364f9e 100644 --- a/drivers/staging/prima/CORE/SME/inc/csrApi.h +++ b/drivers/staging/prima/CORE/SME/inc/csrApi.h @@ -194,10 +194,27 @@ typedef enum */ typedef enum { - eCSR_SCAN_ABORT_DEFAULT, + eCSR_SCAN_ABORT_DEFAULT = 1, eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE, //Scan aborted due to band change }eCsrAbortReason; +typedef enum +{ + eCSR_INI_SINGLE_CHANNEL_CENTERED = 0, + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY, + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY, +#ifdef WLAN_FEATURE_11AC + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH, + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH, +#endif + eCSR_INI_CHANNEL_BONDING_STATE_MAX +}eIniChanBondState; + #define CSR_SCAN_TIME_DEFAULT 0 #define CSR_VALUE_IGNORED 0xFFFFFFFF #define CSR_RSN_PMKID_SIZE 16 @@ -457,7 +474,6 @@ typedef enum eCSR_ROAM_FT_RESPONSE, #endif eCSR_ROAM_FT_START, - eCSR_ROAM_INDICATE_MGMT_FRAME, eCSR_ROAM_REMAIN_CHAN_READY, eCSR_ROAM_SEND_ACTION_CNF, //this mean error happens before association_start or roaming_start is called. @@ -483,12 +499,18 @@ typedef enum eCSR_ROAM_UNPROT_MGMT_FRAME_IND, #endif +#ifdef WLAN_FEATURE_AP_HT40_24G + eCSR_ROAM_2040_COEX_INFO_IND, +#endif + #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) eCSR_ROAM_TSM_IE_IND, eCSR_ROAM_CCKM_PREAUTH_NOTIFY, eCSR_ROAM_ESE_ADJ_AP_REPORT_IND, eCSR_ROAM_ESE_BCN_REPORT_IND, #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ + eCSR_ROAM_UPDATE_MAX_RATE_IND, + eCSR_ROAM_LOST_LINK_PARAMS_IND, }eRoamCmdStatus; @@ -893,7 +915,7 @@ typedef struct tagCsrRoamProfile * It has the IE byte stream for additional IE, * which can be WSC IE and/or P2P IE */ - tANI_U8 addIEScan[SIR_MAC_MAX_IE_LENGTH+2]; //Additional IE information. + tANI_U8 addIEScan[SIR_MAC_MAX_ADD_IE_LENGTH+2]; //Additional IE information. tANI_U32 nAddIEAssocLength; //The byte count in the pAddIE for assoc tANI_U8 *pAddIEAssoc; //If not null, it has the IE byte stream for additional IE, which can be WSC IE and/or P2P IE @@ -961,6 +983,14 @@ typedef struct tagCsrRoamConnectedProfile tANI_BOOLEAN isESEAssoc; #endif tANI_U32 dot11Mode; + +#ifdef WLAN_FEATURE_11W + /* Management Frame Protection */ + tANI_BOOLEAN MFPEnabled; + tANI_U8 MFPRequired; + tANI_U8 MFPCapable; +#endif + }tCsrRoamConnectedProfile; @@ -1113,7 +1143,7 @@ typedef struct tagCsrConfigParam /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS * channels while swipping through both bands can save some time * (apprx 1.3 sec) */ - tANI_BOOLEAN fEnableDFSChnlScan; + tANI_U8 fEnableDFSChnlScan; //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD tANI_BOOLEAN fScanTwice; @@ -1142,7 +1172,7 @@ typedef struct tagCsrConfigParam #endif #endif - + tANI_BOOLEAN ignorePeerErpInfo; tANI_U8 scanCfgAgingTime; tANI_U8 enableTxLdpc; @@ -1156,6 +1186,15 @@ typedef struct tagCsrConfigParam tANI_BOOLEAN sendDeauthBeforeCon; eCsrBand scanBandPreference; +#ifdef WLAN_FEATURE_AP_HT40_24G + tANI_BOOLEAN apHT40_24GEnabled; + tANI_U32 channelBondingAPMode24GHz; // Use for SAP/P2P GO 2.4GHz channel Bonding +#endif + tANI_U32 nOBSSScanWidthTriggerInterval; + tANI_U8 roamDelayStatsEnabled; + tANI_BOOLEAN ignorePeerHTopMode; + tANI_BOOLEAN disableP2PMacSpoofing; + tANI_U8 max_chan_for_dwell_time_cfg; }tCsrConfigParam; //Tush @@ -1206,9 +1245,13 @@ typedef struct tagCsrRoamInfo tSirMicFailureInfo *pMICFailureInfo; tCsrRoamConnectedProfile *pConnectedProfile; tSirWPSPBCProbeReq *pWPSPBCProbeReq; + tSirLostLinkParamsInfo *pLostLinkParams; } u; tANI_BOOLEAN wmmEnabledSta; //set to true if WMM enabled STA +#ifdef WLAN_FEATURE_AP_HT40_24G + tANI_BOOLEAN HT40MHzIntoEnabledSta; //set to true if 40 MHz Intolerant enabled STA +#endif tANI_U32 dtimPeriod; #ifdef FEATURE_WLAN_ESE @@ -1240,6 +1283,9 @@ typedef struct tagCsrRoamInfo tANI_S8 rxRssi; tANI_U32 maxRateFlags; +#ifdef WLAN_FEATURE_AP_HT40_24G + tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd; +#endif }tCsrRoamInfo; typedef struct tagCsrFreqScanInfo @@ -1265,6 +1311,9 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf tSirRSNie rsnIE; // RSN IE received from peer tSirAddie addIE; // Additional IE received from peer, which can be WSC and/or P2P IE tANI_U8 reassocReq; //set to true if reassoc +#ifdef WLAN_FEATURE_AP_HT40_24G + tANI_U8 HT40MHzIntoEnabledSta; //set to true if 40 MHz Intolerant enabled STA +#endif } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf; typedef struct tagCsrSummaryStatsInfo @@ -1415,25 +1464,6 @@ typedef struct tagCsrTdlsSendMgmt }tCsrTdlsSendMgmt; -#ifdef FEATURE_WLAN_TDLS_INTERNAL -typedef struct tagCsrTdlsDisRequest -{ - tSirMacAddr peerMac; - tANI_U8 disType; -}tCsrTdlsDisRequest; - -typedef struct tagCsrTdlsSetupRequest -{ - tSirMacAddr peerMac; - tANI_U8 linkIndex; -}tCsrTdlsSetupRequest; - -typedef struct tagCsrTdlsTeardownRequest -{ - tSirMacAddr peerMac; - tANI_U8 linkIndex; -}tCsrTdlsTeardownRequest ; -#endif #endif typedef void * tScanResultHandle; @@ -1471,6 +1501,18 @@ struct tagCsrDelStaParams u8 subtype; }; + +/** + * struct csr_set_tx_max_pwr_per_band - Req params to + * set max tx power per band + * @band: band for which power to be set + * @power: power to set in dB + */ +struct csr_set_tx_max_pwr_per_band { + eCsrBand band; + tPowerdBm power; +}; + ////////////////////////////////////////////Common SCAN starts //void *p2 -- the second context pass in for the caller diff --git a/drivers/staging/prima/CORE/SME/inc/csrInternal.h b/drivers/staging/prima/CORE/SME/inc/csrInternal.h index 91b962c35fb0..dd5e2bd86195 100644 --- a/drivers/staging/prima/CORE/SME/inc/csrInternal.h +++ b/drivers/staging/prima/CORE/SME/inc/csrInternal.h @@ -47,6 +47,8 @@ #include "vos_nvitem.h" #include "wlan_qct_tl.h" +#include "csrApi.h" + #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING #include "csrNeighborRoam.h" #endif @@ -404,7 +406,7 @@ typedef struct tagScanCmd tCsrBGScanRequest bgScanRequest; }u; //This flag will be set while aborting the scan due to band change - tANI_BOOLEAN abortScanDueToBandChange; + eCsrAbortReason abortScanIndication; }tScanCmd; typedef struct tagRoamCmd @@ -670,7 +672,17 @@ typedef struct tagCsrConfig tANI_U8 isCoalesingInIBSSAllowed; tANI_U8 allowDFSChannelRoam; tANI_BOOLEAN initialScanSkipDFSCh; + tANI_BOOLEAN ignorePeerErpInfo; tANI_BOOLEAN sendDeauthBeforeCon; +#ifdef WLAN_FEATURE_AP_HT40_24G + tANI_BOOLEAN apHT40_24GEnabled; + tANI_U32 channelBondingAPMode24GHz; // Use for SAP/P2P GO 2.4GHz channel Bonding +#endif + tANI_U32 nOBSSScanWidthTriggerInterval; + tANI_U8 roamDelayStatsEnabled; + tANI_BOOLEAN ignorePeerHTopMode; + tANI_BOOLEAN disableP2PMacSpoofing; + tANI_U8 max_chan_for_dwell_time_cfg; }tCsrConfig; typedef struct tagCsrChannelPowerInfo @@ -716,8 +728,6 @@ typedef struct tagCsrScanStruct vos_timer_t hTimerStaApConcTimer; #endif vos_timer_t hTimerIdleScan; - vos_timer_t hTimerResultAging; - vos_timer_t hTimerResultCfgAging; tPalTimerHandle hTimerBgScan; //changes on every scan, it is used as a flag for whether 11d info is found on every scan tANI_U8 channelOf11dInfo; @@ -781,7 +791,7 @@ typedef struct tagCsrScanStruct /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS * channels while swipping through both bands can save some time * (apprx 1.3 sec) */ - tANI_BOOLEAN fEnableDFSChnlScan; + tANI_U8 fEnableDFSChnlScan; /* * To enable/disable scanning only 2.4Ghz channels on first scan @@ -798,29 +808,9 @@ typedef struct tagCsrScanStruct csrScanCompleteCallback callback11dScanDone; eCsrBand scanBandPreference; //This defines the band perference for scan + bool fcc_constraint; }tCsrScanStruct; -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * struct to carry TDLS discovery info.. - */ -typedef struct sCsrTdlsContext -{ - tDblLinkList tdlsPotentialPeerList ; - tANI_U16 tdlsCommonFlag ; - tANI_U16 tdlsCommonState ; - tANI_U16 tdlsPeerCount ; -}tCsrTdlsCtxStruct; - -typedef struct sCsrTdlsPeerLinkInfo -{ - tListElem tdlsPeerStaLink ; - tSirTdlsPeerInfo tdlsDisPeerInfo ; -}tCsrTdlsPeerLinkinfo ; -#endif - - - //Save the connected information. This structure + connectedProfile //should contain all information about the connection @@ -899,7 +889,8 @@ typedef struct tagCsrRoamSession tCsrRoamConnectedInfo connectedInfo; tCsrRoamProfile *pCurRoamProfile; tSirBssDescription *pConnectBssDesc; - tANI_U16 NumPmkidCache; + tANI_U16 NumPmkidCache; /* valid no. of pmkid in the cache */ + tANI_U16 CurCacheIndex; /* the index in pmkidcache to write next to */ tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED]; tANI_U8 cJoinAttemps; //This may or may not have the up-to-date valid channel list @@ -928,7 +919,7 @@ typedef struct tagCsrRoamSession /* This contains the additional IE in (unicast) * probe request at the time of join */ - tANI_U8 addIEScan[SIR_MAC_MAX_IE_LENGTH+2]; + tANI_U8 addIEScan[SIR_MAC_MAX_ADD_IE_LENGTH+2]; tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request @@ -973,6 +964,7 @@ typedef struct tagCsrRoamSession * the PMKID cache. To clear the cache in this particular case this is added * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */ tANI_BOOLEAN fIgnorePMKIDCache; + tANI_BOOLEAN abortConnection; } tCsrRoamSession; typedef struct tagCsrRoamStruct @@ -1157,6 +1149,7 @@ void csrScanResumeIMPS( tpAniSirGlobal pMac ); eHalStatus csrInitGetChannels(tpAniSirGlobal pMac); eHalStatus csrScanFilterResults(tpAniSirGlobal pMac); +eHalStatus csrScanFilterDFSResults(tpAniSirGlobal pMac); eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamModifyProfileFields *pModifyProfileFields); diff --git a/drivers/staging/prima/CORE/SME/inc/csrNeighborRoam.h b/drivers/staging/prima/CORE/SME/inc/csrNeighborRoam.h index 4ef16f109f4b..6a0d812e06a0 100644 --- a/drivers/staging/prima/CORE/SME/inc/csrNeighborRoam.h +++ b/drivers/staging/prima/CORE/SME/inc/csrNeighborRoam.h @@ -169,7 +169,6 @@ typedef struct sCsrNeighborRoamControlInfo vos_timer_t neighborScanTimer; vos_timer_t neighborResultsRefreshTimer; vos_timer_t emptyScanRefreshTimer; - tCsrTimerInfo neighborScanTimerInfo; tCsrNeighborRoamChannelInfo roamChannelInfo; tANI_U8 currentNeighborLookupThreshold; tANI_BOOLEAN scanRspPending; @@ -206,6 +205,7 @@ typedef struct sCsrNeighborRoamControlInfo tSirMacAddr cfgRoambssId; vos_timer_t forcedInitialRoamTo5GHTimer; tANI_U8 isForcedInitialRoamTo5GH; + tANI_U8 lastSentCmd; } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo; diff --git a/drivers/staging/prima/CORE/SME/inc/csrSupport.h b/drivers/staging/prima/CORE/SME/inc/csrSupport.h index 314feae82a5c..28c775adda74 100644 --- a/drivers/staging/prima/CORE/SME/inc/csrSupport.h +++ b/drivers/staging/prima/CORE/SME/inc/csrSupport.h @@ -784,6 +784,10 @@ tANI_BOOLEAN csrMatchBSS( tHalHandle hHal, tSirBssDescription *pBssDesc, tCsrSca tANI_BOOLEAN csrIsBssidMatch( tHalHandle hHal, tCsrBssid *pProfBssid, tCsrBssid *BssBssid ); tANI_BOOLEAN csrMatchBSSToConnectProfile( tHalHandle hHal, tCsrRoamConnectedProfile *pProfile, tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes ); + +void csrAddRateBitmap(tANI_U8 rate, tANI_U16 *pRateBitmap); +tANI_BOOLEAN csrIsRateAlreadyPresent(tANI_U8 rate, tANI_U16 RateBitmap); + tANI_BOOLEAN csrRatesIsDot11RateSupported( tHalHandle hHal, tANI_U8 rate ); tANI_U16 csrRatesFindBestRate( tSirMacRateSet *pSuppRates, tSirMacRateSet *pExtRates, tSirMacPropRateSet *pPropRates ); tSirBssType csrTranslateBsstypeToMacType(eCsrRoamBssType csrtype); diff --git a/drivers/staging/prima/CORE/SME/inc/nan_Api.h b/drivers/staging/prima/CORE/SME/inc/nan_Api.h new file mode 100644 index 000000000000..8e49cf0df7cb --- /dev/null +++ b/drivers/staging/prima/CORE/SME/inc/nan_Api.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/****************************************************************************** +* +* Name: nan_Api.h +* +* Description: NAN FSM defines. +* +******************************************************************************/ + +#ifndef __NAN_API_H__ +#define __NAN_API_H__ + +#include "vos_types.h" +#include "halTypes.h" + +typedef struct sNanRequestReq +{ + tANI_U16 request_data_len; + const tANI_U8* request_data; +} tNanRequestReq, *tpNanRequestReq; + +/****************************************************************************** + * Function: Pointer NanCallback + * + * Description: + * this function pointer is used hold nan response callback. When ever driver + * receives nan response, this callback will be used. + * + * Args: + * first argument to pass hHal pointer and second argument + * to pass the nan response data. + * + * Returns: + * void +******************************************************************************/ +typedef void (*NanCallback)(void*, tSirNanEvent*); + +/****************************************************************************** + * Function: sme_NanRegisterCallback + * + * Description: + * This function gets called when HDD wants register nan rsp callback with + * sme layer. + * + * Args: + * hHal and callback which needs to be registered. + * + * Returns: + * void +******************************************************************************/ +void sme_NanRegisterCallback(tHalHandle hHal, NanCallback callback); + +/****************************************************************************** + * Function: sme_NanRequest + * + * Description: + * This function gets called when HDD receives NAN vendor command + * from userspace + * + * Args: + * hHal, Nan Request structure ptr and sessionId + * + * Returns: + * VOS_STATUS +******************************************************************************/ +VOS_STATUS sme_NanRequest(tHalHandle hHalHandle, tpNanRequestReq input, + tANI_U32 sessionId); + +/****************************************************************************** + \fn sme_NanEvent + + \brief + a callback function called when SME received eWNI_SME_NAN_EVENT + event from WDA + + \param hHal - HAL handle for device + \param pMsg - Message body passed from WDA; includes NAN header + + \return VOS_STATUS +******************************************************************************/ +VOS_STATUS sme_NanEvent(tHalHandle hHal, void* pMsg); + +#endif /* __NAN_API_H__ */ diff --git a/drivers/staging/prima/CORE/SME/inc/pmc.h b/drivers/staging/prima/CORE/SME/inc/pmc.h index 0afe5676ac1c..5c75647ecac8 100644 --- a/drivers/staging/prima/CORE/SME/inc/pmc.h +++ b/drivers/staging/prima/CORE/SME/inc/pmc.h @@ -31,9 +31,6 @@ * * Description: Power Management Control (PMC) internal definitions. * -* Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. -* Qualcomm Confidential and Proprietary. * ******************************************************************************/ @@ -156,9 +153,6 @@ typedef struct sPmcInfo void *impsCallbackContext; /* value to be passed as parameter to routine specified above */ vos_timer_t hImpsTimer; /* timer to use with IMPS */ vos_timer_t hTrafficTimer; /* timer to measure traffic for BMPS */ -#ifdef FEATURE_WLAN_DIAG_SUPPORT - vos_timer_t hDiagEvtTimer; /* timer to report PMC state through DIAG event */ -#endif vos_timer_t hExitPowerSaveTimer; /* timer for deferred exiting of power save mode */ tDblLinkList powerSaveCheckList; /* power save check routine list */ tDblLinkList requestFullPowerList; /* request full power callback routine list */ @@ -208,6 +202,7 @@ typedef struct sPmcInfo v_BOOL_t ImpsReqTimerFailed; tANI_U8 ImpsReqFailCnt; tANI_U8 ImpsReqTimerfailCnt; + tANI_U8 ImpsRspFailCnt; #ifdef FEATURE_WLAN_BATCH_SCAN /*HDD callback to be called after receiving SET BATCH SCAN RSP from FW*/ @@ -251,13 +246,6 @@ extern eHalStatus pmcStartTrafficTimer (tHalHandle hHal, tANI_U32 expirationTime extern void pmcStopTrafficTimer (tHalHandle hHal); extern void pmcImpsTimerExpired (tHalHandle hHal); extern void pmcTrafficTimerExpired (tHalHandle hHal); - -#ifdef FEATURE_WLAN_DIAG_SUPPORT -extern eHalStatus pmcStartDiagEvtTimer (tHalHandle hHal); -extern void pmcStopDiagEvtTimer (tHalHandle hHal); -extern void pmcDiagEvtTimerExpired (tHalHandle hHal); -#endif - extern void pmcExitPowerSaveTimerExpired (tHalHandle hHal); extern tPmcState pmcGetPmcState (tHalHandle hHal); extern const char* pmcGetPmcStateStr(tPmcState state); diff --git a/drivers/staging/prima/CORE/SME/inc/pmcApi.h b/drivers/staging/prima/CORE/SME/inc/pmcApi.h index e085be299f30..4a1915f1a198 100644 --- a/drivers/staging/prima/CORE/SME/inc/pmcApi.h +++ b/drivers/staging/prima/CORE/SME/inc/pmcApi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,11 +35,8 @@ * Description: Power Management Control (PMC) API definitions. -* Copyright 2008 (c) Qualcomm, Incorporated. - * All Rights Reserved. -* Qualcomm Confidential and Proprietary. * @@ -59,6 +56,11 @@ //should be large enough to allow the auth, DHCP handshake to complete #define BMPS_TRAFFIC_TIMER_ALLOW_SECURITY_DHCP 8000 //unit = ms +//This timer value is used to start the timer right after key completion +//during roaming. This should be small enough to allow STA to enter PS +//immediately after key completion as no DHCP phase during roaming. +#define TRAFFIC_TIMER_ROAMING 100 //unit = ms + #define PMC_IS_CHIP_ACCESSIBLE(pmcState) ( (IMPS != (pmcState)) && (REQUEST_IMPS != (pmcState)) && \ (STANDBY != (pmcState)) && (REQUEST_STANDBY != (pmcState)) ) diff --git a/drivers/staging/prima/CORE/SME/inc/smeInside.h b/drivers/staging/prima/CORE/SME/inc/smeInside.h index 02d613349f05..00df2bd6cceb 100644 --- a/drivers/staging/prima/CORE/SME/inc/smeInside.h +++ b/drivers/staging/prima/CORE/SME/inc/smeInside.h @@ -35,9 +35,6 @@ \brief prototype for SME structures and APIs used insside SME - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -71,7 +68,7 @@ ------------------------------------------------------------------------*/ #define SME_TOTAL_COMMAND 30 - +#define SME_START_CHAN_STEP 4 typedef struct sGenericPmcCmd { @@ -164,23 +161,6 @@ typedef struct TdlsChanSwitchInfo tANI_U8 tdlsSwMode; } tTdlsChanSwitchCmdInfo; -#ifdef FEATURE_WLAN_TDLS_INTERNAL -typedef struct TdlsDisReqCmdinfo -{ - tSirMacAddr peerMac; - tANI_U8 tdlsDisType; -} tTdlsDisReqCmdinfo; - -typedef struct tdlsLinkSetupReqCmdinfo -{ - tSirMacAddr peerMac; -} tTdlsLinkSetupReqCmdinfo; - -typedef struct tdlsLinkTeardownCmdinfo -{ - tSirMacAddr peerMac; -} tTdlsLinkTeardownCmdinfo; -#endif /* * TDLS cmd info, CMD from SME to PE. */ @@ -189,13 +169,6 @@ typedef struct s_tdls_cmd tANI_U32 size; union { -#ifdef FEATURE_WLAN_TDLS_INTERNAL - tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ; - tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ; - tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ; - //tEnterPeerUAPSDInfo enterUapsdInfo ; - //tExitPeerUAPSDinfo exitUapsdInfo ; -#endif tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo; tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo; tTdlsAddStaCmdInfo tdlsAddStaCmdInfo; @@ -230,6 +203,12 @@ typedef struct tagSmeCmd tTdlsCmd tdlsCmd; #endif tSirPNOScanReq pnoInfo; + tSirSpoofMacAddrReq macAddrSpoofCmd; + tAniGetFrameLogReq getFramelogCmd; + struct s_ani_set_tx_max_pwr set_tx_max_pwr; + tpNanRequest pNanReq; + struct csr_set_tx_max_pwr_per_band set_tx_max_pwr_per_band; + tpSirUpdateChanList chan_list; }u; }tSmeCmd; @@ -254,7 +233,8 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); //the command, if applicable. void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); - +eHalStatus csrIsValidChannel(tpAniSirGlobal pMac, tANI_U8 chnNum); +tANI_BOOLEAN csrRoamIsValid40MhzChannel(tpAniSirGlobal pMac, tANI_U8 channel); eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); @@ -276,6 +256,17 @@ void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStop eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme); eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme); +/* --------------------------------------------------------------------------- + \fn sme_SetCfgScanControlList + \brief API to set Scan Control List + \param hHal - The handle returned by macOpen. + \param countryCode - Pointer to the countryCode + \param pChannelList - Pointer to the valid channel list + \return eHalStatus + ---------------------------------------------------------------------------*/ +eHalStatus sme_SetCfgScanControlList(tHalHandle hHal, tANI_U8 *countryCode, + tCsrChannel *pChannelList); + #ifdef FEATURE_OEM_DATA_SUPPORT eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand); #endif @@ -283,7 +274,9 @@ eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pComma eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); +eHalStatus csrProcessMacAddrSpoofCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); +eHalStatus csrProcessGetFrameLogCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); #ifdef WLAN_NS_OFFLOAD /* --------------------------------------------------------------------------- @@ -311,11 +304,33 @@ tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac); eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt); VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else tSirMacAddr peerMac, +#endif tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams); -eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); -eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams); -eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); +eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ); +eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tCsrStaParams *pstaParams); +eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ); eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand ); eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd ); eHalStatus csrTdlsProcessChanSwitchReq(tpAniSirGlobal pMac, tSmeCmd *cmd ); //tdlsoffchan @@ -326,14 +341,6 @@ VOS_STATUS csrTdlsSendChanSwitchReq(tHalHandle hHal, tANI_S32 tdlsOffCh, tANI_S32 tdlsOffChBwOffset, tANI_U8 tdlsSwMode); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, - tCsrTdlsDisRequest *tdlsDisReq); -eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId, - tCsrTdlsSetupRequest *tdlsSetupReq); -eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId, - tCsrTdlsTeardownRequest *teardown); -#endif #endif /* FEATURE_WLAN_TDLS */ #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) @@ -352,4 +359,6 @@ eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, #endif void activeListCmdTimeoutHandle(void *userData); +void csrGetStaticUapsdMask(tpAniSirGlobal pMac, tANI_U8 *staticUapsdMask); + #endif //#if !defined( __SMEINSIDE_H ) diff --git a/drivers/staging/prima/CORE/SME/inc/smeInternal.h b/drivers/staging/prima/CORE/SME/inc/smeInternal.h index 4fd96ff848e4..82a4b55612d4 100644 --- a/drivers/staging/prima/CORE/SME/inc/smeInternal.h +++ b/drivers/staging/prima/CORE/SME/inc/smeInternal.h @@ -38,9 +38,6 @@ \brief prototype for SME internal structures and APIs used for SME and MAC - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -55,6 +52,7 @@ #include "vos_memory.h" #include "vos_types.h" #include "csrLinkList.h" +#include "vos_diag_core_event.h" /*-------------------------------------------------------------------------- Type declarations @@ -75,6 +73,11 @@ typedef enum eSmeCommandType eSmeCommandAddStaSession, eSmeCommandDelStaSession, eSmeCommandPnoReq, + eSmeCommandMacSpoofRequest, + eSmeCommandGetFrameLogRequest, + eSmeCommandSetMaxTxPower, + eSmeCommandSetMaxTxPowerPerBand, + eSmeCommandUpdateChannelList, #ifdef FEATURE_WLAN_TDLS //eSmeTdlsCommandMask = 0x80000, //To identify TDLS commands //These can be considered as csr commands. @@ -83,14 +86,8 @@ typedef enum eSmeCommandType eSmeCommandTdlsDelPeer, eSmeCommandTdlsLinkEstablish, eSmeCommandTdlsChannelSwitch, // tdlsoffchan -#ifdef FEATURE_WLAN_TDLS_INTERNAL - eSmeCommandTdlsDiscovery, - eSmeCommandTdlsLinkSetup, - eSmeCommandTdlsLinkTear, - eSmeCommandTdlsEnterUapsd, - eSmeCommandTdlsExitUapsd, -#endif #endif + eSmeCommandNanReq, //PMC eSmePmcCommandMask = 0x20000, //To identify PMC commands eSmeCommandEnterImps, @@ -169,6 +166,8 @@ typedef struct tagSmeStruct void *pEXTScanCallbackContext; #endif /* WLAN_FEATURE_EXTSCAN */ tSmeEncMsgHddCbkInfo pEncMsgInfoParams; + void (*pBtCoexTDLSNotification) (void *pAdapter, int); + void (*nanCallback) (void*, tSirNanEvent*); } tSmeStruct, *tpSmeStruct; diff --git a/drivers/staging/prima/CORE/SME/inc/smeQosInternal.h b/drivers/staging/prima/CORE/SME/inc/smeQosInternal.h index c8f08a8b8067..739889389f7a 100644 --- a/drivers/staging/prima/CORE/SME/inc/smeQosInternal.h +++ b/drivers/staging/prima/CORE/SME/inc/smeQosInternal.h @@ -35,9 +35,6 @@ \brief prototype for SME QoS APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/SME/inc/smeRrmInternal.h b/drivers/staging/prima/CORE/SME/inc/smeRrmInternal.h index e0b6966a2e85..9ba377d6b050 100644 --- a/drivers/staging/prima/CORE/SME/inc/smeRrmInternal.h +++ b/drivers/staging/prima/CORE/SME/inc/smeRrmInternal.h @@ -36,9 +36,6 @@ \brief prototype for SME RRM APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/SME/inc/sme_Api.h b/drivers/staging/prima/CORE/SME/inc/sme_Api.h index 369531d89b25..cb0fcdaec5a2 100644 --- a/drivers/staging/prima/CORE/SME/inc/sme_Api.h +++ b/drivers/staging/prima/CORE/SME/inc/sme_Api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -38,9 +38,6 @@ \brief prototype for SME APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -49,6 +46,7 @@ /*-------------------------------------------------------------------------- Include Files ------------------------------------------------------------------------*/ +#include #include "ccmApi.h" #include "csrApi.h" #include "pmcApi.h" @@ -59,6 +57,7 @@ #include "btcApi.h" #include "vos_nvitem.h" #include "p2p_Api.h" +#include "smeInternal.h" #ifdef FEATURE_OEM_DATA_SUPPORT #include "oemDataApi.h" @@ -67,6 +66,7 @@ #if defined WLAN_FEATURE_VOWIFI #include "smeRrmInternal.h" #endif +#include "nan_Api.h" /*-------------------------------------------------------------------------- Preprocessor definitions and constants @@ -115,6 +115,7 @@ typedef struct _smeConfigParams tANI_U8 isAmsduSupportInAMPDU; tANI_U32 fEnableDebugLog; tANI_U32 fDeferIMPSTime; + tANI_U8 fBtcEnableIndTimerVal; } tSmeConfigParams, *tpSmeConfigParams; #ifdef WLAN_FEATURE_LINK_LAYER_STATS @@ -281,7 +282,13 @@ eHalStatus sme_EXTScanRegisterCallback (tHalHandle hHal, void *); #endif /* WLAN_FEATURE_EXTSCAN */ -tANI_BOOLEAN sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr); +/* --------------------------------------------------------------------------- + \fn sme_SpoofMacAddrReq + \brief SME API to send Spoof Mac Addr req to HAL + \param macaddr: mac address to be sent + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr); typedef enum { @@ -335,6 +342,21 @@ eHalStatus sme_Open(tHalHandle hHal); --------------------------------------------------------------------------*/ eHalStatus sme_Close(tHalHandle hHal); +/*-------------------------------------------------------------------------- + + \brief sme_PreClose() - Stop SME resources prior to final sme_Stop. + + The function stops resources in SME, PMC, CCM, CSR, etc. as needed + to handle fast closure during SSR/unload-load cases. + + \param hHal - The handle returned by macOpen. + \return v_VOID_t + + \sa + + --------------------------------------------------------------------------*/ +v_VOID_t sme_PreClose(tHalHandle hHal); + /*-------------------------------------------------------------------------- \brief sme_Start() - Put all SME modules at ready state. @@ -413,22 +435,39 @@ void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode); This is a synchronous API. - \param hHal - The handle returned by macOpen. \param sessionId - A previous opened session's ID. - + + \param bPurgeSmeCmdList - Whether sme cmd list purging is required or not. + TRUE -Purging require FALSE - Purging not require + \return eHAL_STATUS_SUCCESS - session is closed. Other status means SME is failed to open the session. eHAL_STATUS_INVALID_PARAMETER - session is not opened. \sa - + + --------------------------------------------------------------------------*/ eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, - csrRoamSessionCloseCallback callback, void *pContext); + tANI_U8 bPurgeSmeCmdList, + csrRoamSessionCloseCallback callback, + void *pContext); +/*-------------------------------------------------------------------------- + + \brief sme_PurgeCmdList() - Purge all the sme cmd list + + This is a synchronous API. + + + \param hHal - The handle returned by macOpen. + \param sessionId - A previous opened session's ID. + +--------------------------------------------------------------------------*/ +eHalStatus sme_PurgeCmdList(tHalHandle hHal, tANI_U8 sessionId); /*-------------------------------------------------------------------------- @@ -645,6 +684,16 @@ eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId); */ eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId); +/* + * --------------------------------------------------------------------------- + * \fn sme_FilterScanDFSResults + * \brief a wrapper function to request CSR to filter BSSIDs on DFS channels + * from the scan results. + * \return eHalStatus + *--------------------------------------------------------------------------- + */ +eHalStatus sme_FilterScanDFSResults(tHalHandle hHal); + eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId); /* --------------------------------------------------------------------------- @@ -767,6 +816,14 @@ eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId); ---------------------------------------------------------------------------*/ eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason); +/* --------------------------------------------------------------------------- + \fn.sme_abortConnection + \brief a wrapper function to request CSR to stop from connecting a network + \retun void. +---------------------------------------------------------------------------*/ + +void sme_abortConnection(tHalHandle hHal, tANI_U8 sessionId); + /* --------------------------------------------------------------------------- \fn sme_RoamStopBss \brief a wrapper function to request CSR to stop bss @@ -797,7 +854,13 @@ eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ -eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pPeerMacAddr); +eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pPeerMacAddr +#else + tANI_U8 *pPeerMacAddr +#endif + ); /* --------------------------------------------------------------------------- \fn sme_RoamDeauthSta @@ -2100,6 +2163,9 @@ eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, -------------------------------------------------------------------------------*/ eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId); +eHalStatus sme_register_mgmt_frame_ind_callback(tHalHandle hHal, + sir_mgmt_frame_ind_callback callback); + /* --------------------------------------------------------------------------- \fn sme_RegisterMgtFrame @@ -2127,6 +2193,31 @@ eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, -------------------------------------------------------------------------------*/ eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen); +/* --------------------------------------------------------------------------- + \fn sme_GetFramesLog + \brief a wrapper function that client calls to register a callback to get + mgmt frames logged + \param flag - flag tells to clear OR send the frame log buffer + \return eHalStatus + ---------------------------------------------------------------------------*/ +eHalStatus sme_GetFramesLog(tHalHandle hHal, tANI_U8 flag); +/* --------------------------------------------------------------------------- + + \fn sme_InitMgmtFrameLogging + + \brief + SME will pass this request to lower mac to initialize Frame Logging. + + \param + + hHal - The handle returned by macOpen. + + wlanFWLoggingInitParam - Params to initialize frame logging + + \return eHalStatus +--------------------------------------------------------------------------- */ +eHalStatus sme_InitMgmtFrameLogging( tHalHandle hHal, + tpSirFWLoggingInitParam wlanFWLoggingInitParam); /* --------------------------------------------------------------------------- @@ -2271,12 +2362,11 @@ tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ); \brief API to cancel MAC scan. \param hHal - The handle returned by macOpen. \param sessionId - sessionId for interface - \return VOS_STATUS - VOS_STATUS_E_FAILURE - failure - VOS_STATUS_SUCCESS success + \return tSirAbortScanStatus return status abort scan + ---------------------------------------------------------------------------*/ -eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, - eCsrAbortReason reason); +tSirAbortScanStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, + eCsrAbortReason reason); /* --------------------------------------------------------------------------- \fn sme_GetCfgValidChannels @@ -2515,15 +2605,19 @@ eHalStatus sme_p2pGetResultFilter(tHalHandle hHal, tANI_U8 HDDSessionId, eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, tSirMacAddr pSelfMacAddress, v_S7_t dB); -/* --------------------------------------------------------------------------- - \fn sme_SetMaxTxPowerPerBand - \brief Used to set the Maximum Transmit Power for - specific band dynamically. Note: this setting will not persist over reboots - \param band - \param power to set in dB - \- return eHalStatus - -------------------------------------------------------------------------*/ -eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t db); +/** + * sme_SetMaxTxPowerPerBand() - Set the Maximum Transmit Power + * specific to band dynamically + * @band: Band for which power needs to be applied + * @dB: power to set in dB + * @hal: HAL handle + * + * Set the maximum transmit power dynamically per band + * + * Return: eHalStatus + */ +eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB, + tHalHandle hal); /* --------------------------------------------------------------------------- @@ -3162,9 +3256,13 @@ tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue); -------------------------------------------------------------------------*/ VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, - tANI_U8 sessionId, - tSirMacAddr peerMac, - tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams); + tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams); /* --------------------------------------------------------------------------- \fn sme_SendTdlsMgmtFrame @@ -3180,8 +3278,15 @@ VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, \param responder - Tdls request type \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, - tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 status, tANI_U32 peerCapability, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder); +VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tANI_U8 frame_type, tANI_U8 dialog, + tANI_U16 status, tANI_U32 peerCapability, + tANI_U8 *buf, tANI_U8 len, tANI_U8 responder); /* --------------------------------------------------------------------------- \fn sme_ChangeTdlsPeerSta \brief API to Update TDLS peer sta parameters. @@ -3190,7 +3295,12 @@ VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr \param staParams - Peer Station Parameters. \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, +VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif tCsrStaParams *pstaParams); /* --------------------------------------------------------------------------- \fn sme_AddTdlsPeerSta @@ -3199,7 +3309,13 @@ VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr \param peerMac - peer's Mac Adress. \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); +VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ); /* --------------------------------------------------------------------------- \fn sme_DeleteTdlsPeerSta \brief API to Delete TDLS peer sta entry. @@ -3207,7 +3323,13 @@ VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr pe \param peerMac - peer's Mac Adress. \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); +VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ); /* --------------------------------------------------------------------------- \fn sme_SetTdlsPowerSaveProhibited \API to set/reset the isTdlsPowerSaveProhibited. @@ -3224,21 +3346,62 @@ void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val); -------------------------------------------------------------------------*/ v_BOOL_t sme_IsPmcBmps(tHalHandle hHal); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -typedef struct smeTdlsDisResult -{ - tSirMacAddr tdlsPeerMac; - v_S7_t tdlsPeerRssi; -} tSmeTdlsDisResult; - -VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); -v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, - tSmeTdlsDisResult *disResult, v_U8_t listType); -VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); -VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); -#endif /* FEATURE_WLAN_TDLS */ eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan); +/* --------------------------------------------------------------------------- + \fn sme_UpdateDFSRoamMode + \brief Update DFS roam scan mode + This function is called to configure allowDFSChannelRoam + dynamically + \param hHal - HAL handle for device + \param allowDFSChannelRoam - DFS roaming scan mode + mode 0 disable roam scan on DFS channels + mode 1 enables roam scan (passive/active) on DFS channels + \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config + successfully. + Other status means SME failed to update DFS roaming scan config. + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_UpdateDFSRoamMode(tHalHandle hHal, tANI_U8 allowDFSChannelRoam); + +/* --------------------------------------------------------------------------- + \fn sme_UpdateDFSScanMode + \brief Update DFS scan mode + This function is called to configure fEnableDFSChnlScan. + \param hHal - HAL handle for device + \param dfsScanMode - DFS scan mode + mode 0 disable scan on DFS channels + mode 1 enables passive scan on DFS channels + mode 2 enables active scan on DFS channels for static list + \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config + successfully. + Other status means SME failed to update DFS scan config. + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, tANI_U8 dfsScanMode); + +/*-------------------------------------------------------------------------- + \brief sme_GetDFSScanMode() - get DFS scan mode + \param hHal - The handle returned by macOpen. + \return DFS scan mode + mode 0 disable scan on DFS channels + mode 1 enables passive scan on DFS channels + mode 2 enables active scan on DFS channels for static list + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetDFSScanMode(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_HandleDFSChanScan + \brief Gets Valid channel list and updates scan control list according to + dfsScanMode + \param hHal - HAL handle for device + \return eHAL_STATUS_FAILURE when failed to get valid channel list + Otherwise eHAL_STATUS_SUCCESS - + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_HandleDFSChanScan(tHalHandle hHal); + /* * SME API to enable/disable WLAN driver initiated SSR */ @@ -3303,6 +3466,17 @@ eHalStatus sme_HandoffRequest(tHalHandle hHal, tCsrHandoffRequest *pHandoffInfo) --------------------------------------------------------------------------*/ VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal); +/*-------------------------------------------------------------------------- + \brief hdd_is_any_session_connected() - a wrapper function to check if there + is any connected session . + This is a synchronous call + \param hHal - The handle returned by macOpen + \return VOS_STATUS - SME passed the request to CSR successfully. + Other status means SME is failed to send the request. + \sa + --------------------------------------------------------------------------*/ +VOS_STATUS sme_is_any_session_connected(tHalHandle hHal); + #ifdef FEATURE_WLAN_LPHB /* --------------------------------------------------------------------------- \fn sme_LPHBConfigReq @@ -3364,10 +3538,15 @@ eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateP */ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, tANI_U8 *bssid, - tSmeFastRoamTrigger fastRoamTrig); + tSmeFastRoamTrigger fastRoamTrig, + tANI_U8 channel); eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pBSSId, +#else tANI_U8 *pBSSId, +#endif tANI_BOOLEAN flush_cache ); void smeGetCommandQStatus( tHalHandle hHal ); @@ -3443,6 +3622,7 @@ eHalStatus sme_AddChAvoidCallback ); #endif /* FEATURE_WLAN_CH_AVOID */ eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value); + /* --------------------------------------------------------------------------- \fn sme_requestTypetoString \brief API to convert requestType enum values @@ -3467,13 +3647,20 @@ VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, tANI_S32 tdlsOffCh, tANI_S32 tdlsOffChBwOffset, tANI_U8 tdlsSwMode); - +eHalStatus sme_GetFwStats(tHalHandle hHal, tANI_U32 stats, + void *pContext, tSirFWStatsCallback callback); void sme_SetMiracastMode (tHalHandle hHal,tANI_U8 mode); void sme_resetCoexEevent(tHalHandle hHal); tANI_U32 sme_GetChannelBondingMode5G(tHalHandle hHal); tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal); +#ifdef WLAN_FEATURE_AP_HT40_24G +void sme_UpdateChannelBondingMode24G(tHalHandle hHal, + tANI_U8 cbMode); +eHalStatus sme_SetHT2040Mode(tHalHandle hHal, + tANI_U8 sessionId, tANI_U8 cbMode); +#endif void sme_disable_dfs_channel(tHalHandle hHal, bool disable_dfs); @@ -3485,9 +3672,92 @@ eHalStatus sme_Encryptmsgsend (tHalHandle hHal, int length, pEncryptMsgRSPCb encCB); +/* --------------------------------------------------------------------------- + \fn sme_RegisterBtCoexTDLSCallback + \brief Used to plug in callback function + Which notify btcoex on or off. + Notification come from FW. + \param hHal + \param pCallbackfn : callback function pointer should be plugged in + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_RegisterBtCoexTDLSCallback +( + tHalHandle hHal, + void (*pCallbackfn)(void *pAdapter, int) +); + +/* --------------------------------------------------------------------------- + \fn smeNeighborMiddleOfRoaming + + \brief This function is a wrapper to call csrNeighborMiddleOfRoaming + + \param hHal - The handle returned by macOpen. + + \return eANI_BOOLEAN_TRUE if reassoc in progress, + eANI_BOOLEAN_FALSE otherwise +---------------------------------------------------------------------------*/ +tANI_BOOLEAN smeNeighborMiddleOfRoaming(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + + \fn sme_IsTdlsOffChannelValid + \brief To check if the channel is valid for currently established domain + This is a synchronous API. + + \param hHal - The handle returned by macOpen. + \param channel - channel to verify + + \return TRUE/FALSE, TRUE if channel is valid + + -------------------------------------------------------------------------------*/ +tANI_BOOLEAN sme_IsTdlsOffChannelValid(tHalHandle hHal, tANI_U8 channel); + +/* -------------------------------------------------------------------------- + + \fn sme_IsCoexScoIndicationSet + \brief To check if the BTC module in fwr has sent the SCO + indication to host or not + + \param hHal - The handle returned by macOpen. + \return TRUE - Sco call in progress FALSE- No SCO call in progress + + --------------------------------------------------------------------------*/ +tANI_BOOLEAN sme_IsCoexScoIndicationSet(tHalHandle hHal); eHalStatus sme_SetMiracastVendorConfig(tHalHandle hHal, tANI_U32 iniNumBuffAdvert, tANI_U32 set_value); +void sme_SetDefDot11Mode(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_SetTdls2040BSSCoexistence + \brief API to enable or disable 20_40 BSS Coexistence IE in TDLS frames. + + \param isEnabled - Enable or Disable. + \- return VOS_STATUS_SUCCES + -------------------------------------------------------------------------*/ +eHalStatus sme_SetTdls2040BSSCoexistence(tHalHandle hHal, tANI_S32 isEnabled); + +/* --------------------------------------------------------------------------- + \fn sme_SetRtsCtsHtVht + \brief API to to enable/disable RTS/CTS for different modes. + + \param set_value - Bit mask value to enable RTS/CTS for different modes. + \- return VOS_STATUS_SUCCES if INdication is posted to + WDA else return eHAL_STATUS_FAILURE + -------------------------------------------------------------------------*/ +eHalStatus sme_SetRtsCtsHtVht(tHalHandle hHal, tANI_U32 set_value); + +tANI_BOOLEAN sme_handleSetFccChannel(tHalHandle hHal, + tANI_U8 fcc_constraint); + +eHalStatus sme_DeleteAllTDLSPeers(tHalHandle hHal, uint8_t sessionId); +eHalStatus sme_fatal_event_logs_req(tHalHandle hHal, tANI_U32 is_fatal, + tANI_U32 indicator, tANI_U32 reason_code); + +eHalStatus sme_enableDisableChanAvoidIndEvent(tHalHandle hHal, + tANI_U8 set_value); + #endif //#if !defined( __SME_API_H ) diff --git a/drivers/staging/prima/CORE/SME/inc/sme_QosApi.h b/drivers/staging/prima/CORE/SME/inc/sme_QosApi.h index f22528b935dc..93adff280ff5 100644 --- a/drivers/staging/prima/CORE/SME/inc/sme_QosApi.h +++ b/drivers/staging/prima/CORE/SME/inc/sme_QosApi.h @@ -35,9 +35,6 @@ \brief prototype for SME QoS APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -60,6 +57,7 @@ #define SME_QOS_UAPSD_VI 0x02 #define SME_QOS_UAPSD_BE 0x08 #define SME_QOS_UAPSD_BK 0x04 +#define WLAN_MAX_DSCP 0x3f /*-------------------------------------------------------------------------- Type declarations diff --git a/drivers/staging/prima/CORE/SME/inc/sme_RrmApi.h b/drivers/staging/prima/CORE/SME/inc/sme_RrmApi.h index d996b309bcf9..621ac2909f58 100644 --- a/drivers/staging/prima/CORE/SME/inc/sme_RrmApi.h +++ b/drivers/staging/prima/CORE/SME/inc/sme_RrmApi.h @@ -35,9 +35,6 @@ \brief prototype for SME RRM APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/SME/inc/sme_Trace.h b/drivers/staging/prima/CORE/SME/inc/sme_Trace.h index e9b1591fcd52..abb49e5b5c9d 100644 --- a/drivers/staging/prima/CORE/SME/inc/sme_Trace.h +++ b/drivers/staging/prima/CORE/SME/inc/sme_Trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,9 +41,16 @@ #include "macTrace.h" #define NO_SESSION 0xFF -#define TRACE_CODE_SME_COMMAND 0xFF enum { - TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, + TRACE_CODE_SME_COMMAND, + TRACE_CODE_SME_TX_WDA_MSG, + TRACE_CODE_SME_RX_WDA_MSG, +}; +enum { + /* Starts enums from 3 onwards, because unknown code captures for first + * three enums in smeTraceDump() + */ + TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ = 3, TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, TRACE_CODE_SME_RX_HDD_MSG_CONNECT, TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, @@ -62,6 +69,7 @@ enum { TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, + TRACE_CODE_SME_RX_HDD_ROAM_DEL_PMKIDCACHE, TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, @@ -133,6 +141,19 @@ enum { TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SIGNF_CHANGE, TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SIGNF_CHANGE, TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS, + TRACE_CODE_SME_RX_HDD_MSG_DEAUTH_STA, +#ifdef FEATURE_WLAN_TDLS + TRACE_CODE_SME_RX_HDD_TDLS_LINK_ESTABLISH_PARAM, + TRACE_CODE_SME_RX_HDD_TDLS_CHAN_SWITCH_REQ, + TRACE_CODE_SME_RX_HDD_TDLS_SEND_MGMT_FRAME, + TRACE_CODE_SME_RX_HDD_TDLS_CHANGE_PEER_STA, + TRACE_CODE_SME_RX_HDD_TDLS_ADD_PEER_STA, + TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA, +#endif + TRACE_CODE_SME_RX_HDD_PREF_NET_LIST, +#ifdef FEATURE_WLAN_LPHB + TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ, +#endif /* FEATURE_WLAN_LPHB */ }; void smeTraceInit(tpAniSirGlobal pMac); diff --git a/drivers/staging/prima/CORE/SME/src/QoS/sme_Qos.c b/drivers/staging/prima/CORE/SME/src/QoS/sme_Qos.c index aee50a8826c9..3b01d8ea829d 100644 --- a/drivers/staging/prima/CORE/SME/src/QoS/sme_Qos.c +++ b/drivers/staging/prima/CORE/SME/src/QoS/sme_Qos.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -53,9 +53,7 @@ #include #endif -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif #ifndef WLAN_MDM_CODE_REDUCTION_OPT /* TODO : 6Mbps as Cisco APs seem to like only this value; analysis req. */ @@ -1420,7 +1418,7 @@ sme_QosStatusType sme_QosInternalSetupReq(tpAniSirGlobal pMac, pentry->tspec_mask = pACInfo->tspec_mask_status; pentry->QoSInfo = Tspec_Info; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Creating entry on session %d at %p with flowID %d", + "%s: %d: Creating entry on session %d at %pK with flowID %d", __func__, __LINE__, sessionId, pentry, QosFlowID); csrLLInsertTail(&sme_QosCb.flow_list, &pentry->link, VOS_TRUE); @@ -1750,7 +1748,7 @@ sme_QosStatusType sme_QosInternalSetupReq(tpAniSirGlobal pMac, pentry->tspec_mask = tmask; pentry->QoSInfo = Tspec_Info; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: On session %d creating entry at %p with flowID %d", + "%s: %d: On session %d creating entry at %pK with flowID %d", __func__, __LINE__, sessionId, pentry, QosFlowID); csrLLInsertTail(&sme_QosCb.flow_list, &pentry->link, VOS_TRUE); @@ -2011,7 +2009,7 @@ sme_QosStatusType sme_QosInternalModifyReq(tpAniSirGlobal pMac, flow_info->reason = SME_QOS_REASON_MODIFY; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, "%s: %d: On session %d creating modified " - "entry at %p with flowID %d", + "entry at %pK with flowID %d", __func__, __LINE__, sessionId, pNewEntry, pNewEntry->QosFlowID); //add the new entry under construction to the Flow List @@ -2451,7 +2449,7 @@ sme_QosStatusType sme_QosInternalReleaseReq(tpAniSirGlobal pMac, pACInfo->requested_QoSInfo[flow_info->tspec_mask - 1]; //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -2496,7 +2494,7 @@ sme_QosStatusType sme_QosInternalReleaseReq(tpAniSirGlobal pMac, //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, "%s: %d: On session %d deleting entry at " - "%p with flowID %d", + "%pK with flowID %d", __func__, __LINE__, sessionId, flow_info, QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -2654,7 +2652,7 @@ sme_QosStatusType sme_QosInternalReleaseReq(tpAniSirGlobal pMac, flow_info->QosFlowID); VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); } @@ -2704,7 +2702,7 @@ sme_QosStatusType sme_QosInternalReleaseReq(tpAniSirGlobal pMac, pACInfo->num_flows[flow_info->tspec_mask - 1]--; //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: On session %d deleting entry at %p with flowID %d", + "%s: %d: On session %d deleting entry at %pK with flowID %d", __func__, __LINE__, sessionId, flow_info, QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -3155,7 +3153,7 @@ eHalStatus sme_QosESEProcessReassocTspecRsp(tpAniSirGlobal pMac, v_U8_t sessionI } VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, - "TspecLen = %d, pbFrames = %p, pTspecIE = %p", + "TspecLen = %d, pbFrames = %pK, pTspecIE = %pK", tspecIeLen, pCsrConnectedInfo->pbFrames, pTspecIE); numTspec = (tspecIeLen)/sizeof(tDot11fIEWMMTSPEC); @@ -6244,7 +6242,7 @@ static eHalStatus sme_QosBufferExistingFlows(tpAniSirGlobal pMac, } //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting original entry at %p with flowID %d", + "%s: %d: Deleting original entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -6295,7 +6293,7 @@ static eHalStatus sme_QosDeleteExistingFlows(tpAniSirGlobal pMac, flow_info->QosFlowID); } VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); //delete the entry from Flow List @@ -6688,7 +6686,7 @@ eHalStatus sme_QosModifyFnp(tpAniSirGlobal pMac, tListElem *pEntry) case SME_QOS_REASON_MODIFY: //delete the original entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting original entry at %p with flowID %d", + "%s: %d: Deleting original entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -6887,7 +6885,7 @@ eHalStatus sme_QosReassocSuccessEvFnp(tpAniSirGlobal pMac, tListElem *pEntry) { //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -6990,7 +6988,7 @@ eHalStatus sme_QosAddTsFailureFnp(tpAniSirGlobal pMac, tListElem *pEntry) } //delete the entry from Flow List VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); csrLLRemoveEntry(&sme_QosCb.flow_list, pEntry, VOS_TRUE ); @@ -7190,26 +7188,25 @@ eHalStatus sme_QosAddTsSuccessFnp(tpAniSirGlobal pMac, tListElem *pEntry) } } -#ifdef DEBUG_ROAM_DELAY - - if (pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_VO || - pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_NC) + if (pMac->roam.configParam.roamDelayStatsEnabled) { - vos_record_roam_event(e_SME_VO_ADDTS_RSP, NULL, 0); - } - - if (pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_VI|| - pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_CL) + if (pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_VO || + pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_NC) + { + vos_record_roam_event(e_SME_VO_ADDTS_RSP, NULL, 0); + } - { - vos_record_roam_event(e_SME_VI_ADDTS_RSP, NULL, 0); + if (pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_VI || + pACInfo->curr_QoSInfo[pACInfo->tspec_pending - 1].ts_info.up == SME_QOS_WMM_UP_CL) + { + vos_record_roam_event(e_SME_VI_ADDTS_RSP, NULL, 0); + } } -#endif if(delete_entry) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: Deleting entry at %p with flowID %d", + "%s: %d: Deleting entry at %pK with flowID %d", __func__, __LINE__, flow_info, flow_info->QosFlowID); //delete the entry from Flow List @@ -7438,7 +7435,7 @@ void sme_QosPmcDeviceStateUpdateInd(void *callbackContext, tPmcState pmcState) break; default: status = eHAL_STATUS_SUCCESS; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: %d: nothing to process in PMC state %s (%d)", __func__, __LINE__, sme_PmcStatetoString(pmcState), pmcState); diff --git a/drivers/staging/prima/CORE/SME/src/btc/btcApi.c b/drivers/staging/prima/CORE/SME/src/btc/btcApi.c index 9107656646dd..4e1e9ea34a83 100644 --- a/drivers/staging/prima/CORE/SME/src/btc/btcApi.c +++ b/drivers/staging/prima/CORE/SME/src/btc/btcApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,8 +31,6 @@ * * Description: Routines that make up the BTC API. * -* Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. -* Qualcomm Confidential and Proprietary. * ******************************************************************************/ #include "wlan_qct_wda.h" @@ -43,6 +41,7 @@ #include "cfgApi.h" #include "pmc.h" #include "smeQosInternal.h" +#include "sme_Trace.h" #ifdef FEATURE_WLAN_DIAG_SUPPORT #include "vos_diag_core_event.h" #include "vos_diag_core_log.h" @@ -275,6 +274,8 @@ static VOS_STATUS btcSendBTEvent(tpAniSirGlobal pMac, tpSmeBtEvent pBtEvent) msg.type = WDA_SIGNAL_BT_EVENT; msg.reserved = 0; msg.bodyptr = ptrSmeBtEvent; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " @@ -470,9 +471,22 @@ void btcEnableUapsdTimerExpiryHandler(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pMac->btc.btcUapsdOk = VOS_TRUE; - smsLog(pMac, LOG1, FL("Uapsd Timer Expired, Enable Uapsd")); - sme_QoSUpdateUapsdBTEvent(pMac); + if (IS_DYNAMIC_WMM_PS_ENABLED) + { + if (pMac->btc.btcUapsdOk == VOS_FALSE) + { + pMac->btc.btcUapsdOk = VOS_TRUE; + smsLog(pMac, LOG1, FL("Uapsd Timer Expired, Enable Uapsd")); + sme_QoSUpdateUapsdBTEvent(pMac); + } + } + + if (pMac->sme.pBtCoexTDLSNotification) + { + smsLog(pMac, LOG1, FL("btCoex notification, Enable TDLS")); + pMac->sme.pBtCoexTDLSNotification(pMac->pAdapter, + SIR_COEX_IND_TYPE_TDLS_ENABLE); + } } /* --------------------------------------------------------------------------- @@ -544,6 +558,8 @@ VOS_STATUS btcSendCfgMsg(tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) msg.type = WDA_BTC_SET_CFG; msg.reserved = 0; msg.bodyptr = ptrSmeBtcConfig; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "btcSendCfgMsg: " @@ -2014,31 +2030,31 @@ eHalStatus btcHandleCoexInd(tHalHandle hHal, void* pMsg) else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_DISABLE_UAPSD) { smsLog(pMac, LOG1, FL("DISABLE UAPSD BT Event received")); + if (VOS_TIMER_STATE_RUNNING == + vos_timer_getCurrentState(&pMac->btc.enableUapsdTimer)) { + smsLog(pMac, LOG1, FL("Stop Uapsd Timer")); + vos_timer_stop(&pMac->btc.enableUapsdTimer); + } if (IS_DYNAMIC_WMM_PS_ENABLED) { if (pMac->btc.btcUapsdOk == VOS_TRUE) { pMac->btc.btcUapsdOk = VOS_FALSE; sme_QoSUpdateUapsdBTEvent(pMac); } - else { - if (VOS_TIMER_STATE_RUNNING == - vos_timer_getCurrentState(&pMac->btc.enableUapsdTimer)) { - smsLog(pMac, LOG1, FL("Stop Uapsd Timer")); - vos_timer_stop(&pMac->btc.enableUapsdTimer); - } - } + } + + if (pMac->sme.pBtCoexTDLSNotification) + { + smsLog(pMac, LOG1, FL("btCoex notification, Disable TDLS")); + pMac->sme.pBtCoexTDLSNotification(pMac->pAdapter, + SIR_COEX_IND_TYPE_TDLS_DISABLE); } } else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_ENABLE_UAPSD) { smsLog(pMac, LOG1, FL("ENABLE UAPSD BT Event received")); - - if (IS_DYNAMIC_WMM_PS_ENABLED) { - if (pMac->btc.btcUapsdOk == VOS_FALSE) { - smsLog(pMac, LOG1, FL("Start Uapsd Timer")); - vos_timer_start(&pMac->btc.enableUapsdTimer, BTC_MAX_ENABLE_UAPSD_TIMER); - } - } + vos_timer_start(&pMac->btc.enableUapsdTimer, + (pMac->fBtcEnableIndTimerVal * 1000)); } else // unknown indication type { diff --git a/drivers/staging/prima/CORE/SME/src/ccm/ccmApi.c b/drivers/staging/prima/CORE/SME/src/ccm/ccmApi.c index 3be9efb086d0..38cd438b3df8 100644 --- a/drivers/staging/prima/CORE/SME/src/ccm/ccmApi.c +++ b/drivers/staging/prima/CORE/SME/src/ccm/ccmApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -239,7 +239,7 @@ static void sendQueuedReqToMacSw(tpAniSirGlobal pMac, tHddHandle hHdd) } #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("ccmComplete(%p)"), req->done); + smsLog(pMac, LOGW, FL("ccmComplete(%pK)"), req->done); #endif ccmComplete(hHdd, req->done); @@ -382,12 +382,12 @@ static eHalStatus cfgSet(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 type, tANI_S3 if ((status == eHAL_STATUS_SUCCESS) && (sem != NULL)) { #ifdef CCM_DEBUG - smsLog(pMac, LOG1, FL("ccmWaitForCompletion(%p)"), req->done); + smsLog(pMac, LOG1, FL("ccmWaitForCompletion(%pK)"), req->done); #endif ccmWaitForCompletion(hHdd, sem); #ifdef CCM_DEBUG - smsLog(pMac, LOG1, FL("free(%p)"), req->done); + smsLog(pMac, LOG1, FL("free(%pK)"), req->done); #endif palSemaphoreFree( hHdd, sem ) ; } @@ -472,7 +472,7 @@ void ccmCfgCnfMsgHandler(tHalHandle hHal, void *m) /* Wake up the sleeping process */ #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("ccmComplete(%p)"), pMac->ccm.replay.done); + smsLog(pMac, LOGW, FL("ccmComplete(%pK)"), pMac->ccm.replay.done); #endif ccmComplete(hHdd, pMac->ccm.replay.done); //Let go with the rest of the set CFGs waiting. @@ -517,7 +517,7 @@ void ccmCfgCnfMsgHandler(tHalHandle hHal, void *m) /* Wake up the sleeping process */ #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("cfgId=%ld, calling ccmComplete(%p)"), cfgId, req->done); + smsLog(pMac, LOGW, FL("cfgId=%ld, calling ccmComplete(%pK)"), cfgId, req->done); #endif ccmComplete(hHdd, req->done); @@ -545,7 +545,7 @@ void ccmCfgCnfMsgHandler(tHalHandle hHal, void *m) (int)cfgId, (int)result, req->cfgId, req->state); #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("ccmComplete(%p)"), req->done); + smsLog(pMac, LOGW, FL("ccmComplete(%pK)"), req->done); #endif } @@ -815,12 +815,12 @@ eHalStatus ccmCfgUpdate(tHalHandle hHal, tCcmCfgSetCallback callback) if (status == eHAL_STATUS_SUCCESS && pMac->ccm.replay.done) { #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("ccmWaitForCompletion(%p)"), pMac->ccm.replay.done); + smsLog(pMac, LOGW, FL("ccmWaitForCompletion(%pK)"), pMac->ccm.replay.done); #endif ccmWaitForCompletion(hHdd, pMac->ccm.replay.done); #ifdef CCM_DEBUG - smsLog(pMac, LOGW, FL("free(%p)"), pMac->ccm.replay.done); + smsLog(pMac, LOGW, FL("free(%pK)"), pMac->ccm.replay.done); #endif palSemaphoreFree( hHdd, pMac->ccm.replay.done) ; } diff --git a/drivers/staging/prima/CORE/SME/src/ccm/ccmLogDump.c b/drivers/staging/prima/CORE/SME/src/ccm/ccmLogDump.c index acbf858c9d82..ac24fa8a55d9 100644 --- a/drivers/staging/prima/CORE/SME/src/ccm/ccmLogDump.c +++ b/drivers/staging/prima/CORE/SME/src/ccm/ccmLogDump.c @@ -30,9 +30,6 @@ ccmLogDump.c Implements the dump commands specific to the ccm module. -Copyright (c) 2007 QUALCOMM Incorporated. -All Rights Reserved. -Qualcomm Confidential and Proprietary ============================================================================*/ diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c index 598f2c9b8960..d94ed3f28083 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -58,6 +58,7 @@ #include "palApi.h" #include "csrInsideApi.h" #include "smsDebug.h" +#include "sme_Trace.h" #include "logDump.h" #include "smeQosInternal.h" #include "wlan_qct_tl.h" @@ -74,9 +75,7 @@ #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) #include "csrEse.h" #endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */ -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif #define CSR_NUM_IBSS_START_CHANNELS_50 4 #define CSR_NUM_IBSS_START_CHANNELS_24 3 #define CSR_DEF_IBSS_START_CHANNEL_50 36 @@ -553,8 +552,13 @@ eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac) tCsrScanStruct *pScan = &pMac->scan; tANI_U32 numChan = 0; tANI_U32 bufLen ; - vos_msg_t msg; - tANI_U8 i; + tANI_U8 i, j; + tANI_U8 num_channel = 0; + tANI_U8 channel_state; + tANI_U8 cfgnumChannels = 0; + tANI_U8 *cfgChannelList = NULL; + eHalStatus status; + tSmeCmd *command; limInitOperatingClasses((tHalHandle)pMac); numChan = sizeof(pMac->roam.validChannelList); @@ -576,34 +580,101 @@ eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac) "Failed to allocate memory for tSirUpdateChanList"); return eHAL_STATUS_FAILED_ALLOC; } + vos_mem_zero(pChanList, bufLen); - msg.type = WDA_UPDATE_CHAN_LIST_REQ; - msg.reserved = 0; - msg.bodyptr = pChanList; - pChanList->numChan = numChan; - for (i = 0; i < pChanList->numChan; i++) + smsLog(pMac, LOG1, FL("fEnableDFSChnlScan %d"), + pMac->scan.fEnableDFSChnlScan); + + for (i = 0; i < numChan; i++) { - pChanList->chanParam[i].chanId = pMac->roam.validChannelList[i]; - pChanList->chanParam[i].pwr = cfgGetRegulatoryMaxTransmitPower(pMac, - pScan->defaultPowerTable[i].chanId); - if (vos_nv_getChannelEnabledState(pChanList->chanParam[i].chanId) == - NV_CHANNEL_DFS) - pChanList->chanParam[i].dfsSet = VOS_TRUE; + channel_state = + vos_nv_getChannelEnabledState(pMac->roam.validChannelList[i]); + + if((pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_DISABLED) + && (channel_state == NV_CHANNEL_DFS)) + { + continue; + } + pChanList->chanParam[num_channel].chanId = + pMac->roam.validChannelList[i]; + pChanList->chanParam[num_channel].pwr = + cfgGetRegulatoryMaxTransmitPower(pMac, + pScan->defaultPowerTable[i].chanId); + if (!pChanList->chanParam[num_channel].pwr) + { + smsLog(pMac, LOGE, FL("Power level is zero for channel %d " + "setting to default %d"), + pChanList->chanParam[num_channel].chanId, + TX_POWER_DEFAULT); + pChanList->chanParam[num_channel].pwr = TX_POWER_DEFAULT; + } + if (channel_state == NV_CHANNEL_DFS) + pChanList->chanParam[num_channel].dfsSet = VOS_TRUE; else - pChanList->chanParam[i].dfsSet = VOS_FALSE; + pChanList->chanParam[num_channel].dfsSet = VOS_FALSE; + + /* When DFS mode is 2, mark static channels as active */ + if (pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_ENABLED_ACTIVE) + { + cfgnumChannels = + pMac->roam.neighborRoamInfo.cfgParams.channelInfo.numOfChannels; + cfgChannelList = + pMac->roam.neighborRoamInfo.cfgParams.channelInfo.ChannelList; + + if (cfgChannelList) + { + for(j=0; j< cfgnumChannels; j++) + { + if (CSR_IS_CHANNEL_DFS(cfgChannelList[j]) && + (pMac->roam.validChannelList[i] == cfgChannelList[j])) + { + pChanList->chanParam[num_channel].dfsSet = VOS_FALSE; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s Marked DFS ch %d as active\n", __func__, + cfgChannelList[j]); + } + } + } + else + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s cfgChannelList is NULL \n", __func__); + } + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s Supported Channel: %d\n", __func__, pChanList->chanParam[i].chanId); + "%s Supported Channel: %d dfsSet %d pwr: %d \n", __func__, + pChanList->chanParam[num_channel].chanId, + pChanList->chanParam[num_channel].dfsSet, + pChanList->chanParam[num_channel].pwr); + num_channel++; } + pChanList->regId = csrGetCurrentRegulatoryDomain(pMac); - if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, - "%s: Failed to post msg to WDA", __func__); - vos_mem_free(pChanList); - return eHAL_STATUS_FAILURE; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s : regID : %d \n", __func__, + pChanList->regId); + + pChanList->numChan = num_channel; + + status = sme_AcquireGlobalLock(&pMac->sme); + if (HAL_STATUS_SUCCESS(status)) { + command = csrGetCommandBuffer(pMac); + if (command) { + command->command = eSmeCommandUpdateChannelList; + command->u.chan_list = pChanList; + + status = csrQueueSmeCommand(pMac, command, eANI_BOOLEAN_TRUE); + if (!HAL_STATUS_SUCCESS(status)) { + smsLog(pMac, LOGE, FL("fail to send msg status = %d"), status); + csrReleaseCommand(pMac, command); + } + } else { + smsLog(pMac, LOGE, FL("can not obtain a common buffer")); + status = eHAL_STATUS_RESOURCES; + } + sme_ReleaseGlobalLock(&pMac->sme); } - return eHAL_STATUS_SUCCESS; + return status; } eHalStatus csrStart(tpAniSirGlobal pMac) @@ -653,7 +724,7 @@ eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType) for(sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) { - csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL); + csrRoamCloseSession(pMac, sessionId, TRUE, TRUE, NULL, NULL); } csrScanDisable(pMac); pMac->scan.fCancelIdleScan = eANI_BOOLEAN_FALSE; @@ -669,7 +740,6 @@ eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType) (void) pmcDeregisterPowerSaveCheck(pMac, csrCheckPSReady); //Reset the domain back to the deault pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault; - csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_FALSE ); for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) { @@ -699,14 +769,6 @@ eHalStatus csrReady(tpAniSirGlobal pMac) //WNI_CFG_VALID_CHANNEL_LIST should be set by this time //use it to init the background scan list csrInitBGScanChannelList(pMac); - /* HDD issues the init scan */ - csrScanStartResultAgingTimer(pMac); - /* If the gScanAgingTime is set to '0' then scan results aging timeout - based on timer feature is not enabled*/ - if(0 != pMac->scan.scanResultCfgAgingTime ) - { - csrScanStartResultCfgAgingTimer(pMac); - } //Store the AC weights in TL for later use WLANTL_GetACWeights(pMac->roam.gVosContext, pMac->roam.ucACWeights); status = csrInitChannelList( pMac ); @@ -782,7 +844,7 @@ eHalStatus csrRoamClose(tpAniSirGlobal pMac) tANI_U32 sessionId; for(sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) { - csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL); + csrRoamCloseSession(pMac, sessionId, TRUE, TRUE, NULL, NULL); } vos_timer_stop(&pMac->roam.hTimerWaitForKey); vos_timer_destroy(&pMac->roam.hTimerWaitForKey); @@ -1001,7 +1063,7 @@ void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStop { case eSmeCommandScan: // We need to inform the requester before dropping the scan command - smsLog( pMac, LOGW, "%s: Drop scan reason %d callback %p", + smsLog( pMac, LOGW, "%s: Drop scan reason %d callback %pK", __func__, pCommand->u.scanCmd.reason, pCommand->u.scanCmd.callback); if (NULL != pCommand->u.scanCmd.callback) @@ -1520,45 +1582,46 @@ ePhyChanBondState csrConvertCBIniValueToPhyCBState(v_U32_t cbIniValue) ePhyChanBondState phyCbState; switch (cbIniValue) { // secondary none - case 0: + case eCSR_INI_SINGLE_CHANNEL_CENTERED: phyCbState = PHY_SINGLE_CHANNEL_CENTERED; break; // secondary LOW - case 1: + case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: phyCbState = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; break; // secondary HIGH - case 2: + case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: phyCbState = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; break; #ifdef WLAN_FEATURE_11AC - case 3: - phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: + phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; break; - case 4: + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; break; - case 5: - phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; - break; - case 6: + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: + phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; break; - case 7: + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; - break; - case 8: + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; break; - case 9: + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; - break; -#endif + break; +#endif default: // If an invalid value is passed, disable CHANNEL BONDING phyCbState = PHY_SINGLE_CHANNEL_CENTERED; break; } + return phyCbState; } @@ -1569,44 +1632,45 @@ v_U32_t csrConvertPhyCBStateToIniValue(ePhyChanBondState phyCbState) switch (phyCbState) { // secondary none case PHY_SINGLE_CHANNEL_CENTERED: - cbIniValue = 0; + cbIniValue = eCSR_INI_SINGLE_CHANNEL_CENTERED; break; // secondary LOW case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: - cbIniValue = 1; + cbIniValue = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; break; // secondary HIGH case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: - cbIniValue = 2; + cbIniValue = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; break; #ifdef WLAN_FEATURE_11AC case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: - cbIniValue = 3; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: - cbIniValue = 4; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: - cbIniValue = 5; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: - cbIniValue = 6; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: - cbIniValue = 7; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: - cbIniValue = 8; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; break; case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: - cbIniValue = 9; + cbIniValue = eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; break; #endif default: // return some invalid value - cbIniValue = 10; + cbIniValue = eCSR_INI_CHANNEL_BONDING_STATE_MAX; break; } + return cbIniValue; } @@ -1639,6 +1703,9 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa { smsLog( pMac, LOGW, "Invalid CB value from ini in 5GHz band %d, CB DISABLED", pParam->channelBondingMode5GHz); } +#ifdef WLAN_FEATURE_AP_HT40_24G + pMac->roam.configParam.channelBondingAPMode24GHz = csrConvertCBIniValueToPhyCBState(pParam->channelBondingAPMode24GHz); +#endif pMac->roam.configParam.channelBondingMode5GHz = csrConvertCBIniValueToPhyCBState(pParam->channelBondingMode5GHz); pMac->roam.configParam.RTSThreshold = pParam->RTSThreshold; pMac->roam.configParam.phyMode = pParam->phyMode; @@ -1684,6 +1751,13 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa cfgSetInt(pMac, WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME, pParam->nPassiveMinChnTime); } + if (pParam->nOBSSScanWidthTriggerInterval) + { + pMac->roam.configParam.nOBSSScanWidthTriggerInterval = + pParam->nOBSSScanWidthTriggerInterval; + cfgSetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, + pParam->nOBSSScanWidthTriggerInterval); + } if (pParam->nActiveMaxChnTimeBtc) { pMac->roam.configParam.nActiveMaxChnTimeBtc = pParam->nActiveMaxChnTimeBtc; @@ -1884,10 +1958,20 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa pMac->roam.configParam.isAmsduSupportInAMPDU = pParam->isAmsduSupportInAMPDU; pMac->roam.configParam.nSelect5GHzMargin = pParam->nSelect5GHzMargin; + pMac->roam.configParam.ignorePeerErpInfo = pParam->ignorePeerErpInfo; + pMac->roam.configParam.ignorePeerHTopMode = pParam->ignorePeerHTopMode; + pMac->roam.configParam.disableP2PMacSpoofing = + pParam->disableP2PMacSpoofing; pMac->roam.configParam.isCoalesingInIBSSAllowed = pParam->isCoalesingInIBSSAllowed; pMac->roam.configParam.allowDFSChannelRoam = pParam->allowDFSChannelRoam; pMac->roam.configParam.sendDeauthBeforeCon = pParam->sendDeauthBeforeCon; +#ifdef WLAN_FEATURE_AP_HT40_24G + pMac->roam.configParam.apHT40_24GEnabled = pParam->apHT40_24GEnabled; +#endif + pMac->roam.configParam.roamDelayStatsEnabled = pParam->roamDelayStatsEnabled; + pMac->roam.configParam.max_chan_for_dwell_time_cfg = + pParam->max_chan_for_dwell_time_cfg; } return status; @@ -1905,6 +1989,9 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->Is11dSupportEnabledOriginal = pMac->roam.configParam.Is11dSupportEnabledOriginal; pParam->Is11hSupportEnabled = pMac->roam.configParam.Is11hSupportEnabled; pParam->channelBondingMode24GHz = csrConvertPhyCBStateToIniValue(pMac->roam.configParam.channelBondingMode24GHz); +#ifdef WLAN_FEATURE_AP_HT40_24G + pParam->channelBondingAPMode24GHz = csrConvertPhyCBStateToIniValue(pMac->roam.configParam.channelBondingAPMode24GHz); +#endif pParam->channelBondingMode5GHz = csrConvertPhyCBStateToIniValue(pMac->roam.configParam.channelBondingMode5GHz); pParam->RTSThreshold = pMac->roam.configParam.RTSThreshold; pParam->phyMode = pMac->roam.configParam.phyMode; @@ -2023,6 +2110,10 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->isAmsduSupportInAMPDU = pMac->roam.configParam.isAmsduSupportInAMPDU; pParam->nSelect5GHzMargin = pMac->roam.configParam.nSelect5GHzMargin; + pParam->ignorePeerErpInfo = pMac->roam.configParam.ignorePeerErpInfo; + pParam->ignorePeerHTopMode = pMac->roam.configParam.ignorePeerHTopMode; + pParam->disableP2PMacSpoofing = + pMac->roam.configParam.disableP2PMacSpoofing; pParam->isCoalesingInIBSSAllowed = pMac->roam.configParam.isCoalesingInIBSSAllowed; @@ -2030,6 +2121,11 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pMac->roam.configParam.allowDFSChannelRoam; pParam->sendDeauthBeforeCon = pMac->roam.configParam.sendDeauthBeforeCon; csrSetChannels(pMac, pParam); +#ifdef WLAN_FEATURE_AP_HT40_24G + pParam->apHT40_24GEnabled = pMac->roam.configParam.apHT40_24GEnabled; +#endif + pParam->max_chan_for_dwell_time_cfg = + pMac->roam.configParam.max_chan_for_dwell_time_cfg; status = eHAL_STATUS_SUCCESS; } @@ -2438,72 +2534,117 @@ eHalStatus csrInitChannelPowerList( tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo) return eHAL_STATUS_SUCCESS; } -//pCommand may be NULL -//Pass in sessionId in case pCommand is NULL. sessionId is not used in case pCommand is not NULL. -void csrRoamRemoveDuplicateCommand(tpAniSirGlobal pMac, tANI_U32 sessionId, tSmeCmd *pCommand, eCsrRoamReason eRoamReason) +/** + * csr_roam_remove_duplicate_cmd_from_list()- Remove duplicate roam cmd from + * list + * + * @pMac: pointer to global mac + * @sessionId: session id for the cmd + * @pList: pending list from which cmd needs to be removed + * @pCommand: cmd to be removed, can be NULL + * @eRoamReason: cmd with reason to be removed + * + * Remove duplicate command from the pending list. + * + * Return: void + */ +void csr_roam_remove_duplicate_cmd_from_list(tpAniSirGlobal pMac, + tANI_U32 sessionId, tDblLinkList *pList, + tSmeCmd *pCommand, eCsrRoamReason eRoamReason) { tListElem *pEntry, *pNextEntry; tSmeCmd *pDupCommand; tDblLinkList localList; vos_mem_zero(&localList, sizeof(tDblLinkList)); - if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) + if (!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) { - smsLog(pMac, LOGE, FL(" failed to open list")); + smsLog(pMac, LOGE, FL("failed to open list")); return; } - csrLLLock( &pMac->sme.smeCmdPendingList ); - pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); - while( pEntry ) + csrLLLock(pList); + pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); + while (pEntry) { - pNextEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); - pDupCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); - // Remove the previous command if.. - // - the new roam command is for the same RoamReason... - // - the new roam command is a NewProfileList. - // - the new roam command is a Forced Dissoc - // - the new roam command is from an 802.11 OID (OID_SSID or OID_BSSID). - if ( - (pCommand && ( pCommand->sessionId == pDupCommand->sessionId ) && - ((pCommand->command == pDupCommand->command) && - /* This peermac check is requried for Softap/GO scenarios - * For STA scenario below OR check will suffice as pCommand will - * always be NULL for STA scenarios - */ - (vos_mem_compare(pDupCommand->u.roamCmd.peerMac, pCommand->u.roamCmd.peerMac, sizeof(v_MACADDR_t))) && - (pCommand->u.roamCmd.roamReason == pDupCommand->u.roamCmd.roamReason || - eCsrForcedDisassoc == pCommand->u.roamCmd.roamReason || - eCsrHddIssued == pCommand->u.roamCmd.roamReason))) - || - //below the pCommand is NULL - ( (sessionId == pDupCommand->sessionId) && - (eSmeCommandRoam == pDupCommand->command) && - ((eCsrForcedDisassoc == eRoamReason) || - (eCsrHddIssued == eRoamReason)) - ) - ) - { - smsLog(pMac, LOGW, FL(" roamReason = %d"), pDupCommand->u.roamCmd.roamReason); - // Remove the 'stale' roam command from the pending list... - if(csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK )) - { + pNextEntry = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); + pDupCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); + /* + * Remove the previous command if.. + * - the new roam command is for the same RoamReason... + * - the new roam command is a NewProfileList. + * - the new roam command is a Forced Dissoc + * - the new roam command is from an 802.11 OID + * (OID_SSID or OID_BSSID). + */ + if ((pCommand && (pCommand->sessionId == pDupCommand->sessionId) && + ((pCommand->command == pDupCommand->command) && + /* + * This peermac check is requried for Softap/GO scenarios + * For STA scenario below OR check will suffice as pCommand + * will always be NULL for STA scenarios + */ + (vos_mem_compare(pDupCommand->u.roamCmd.peerMac, + pCommand->u.roamCmd.peerMac, sizeof(v_MACADDR_t))) && + ((pCommand->u.roamCmd.roamReason == + pDupCommand->u.roamCmd.roamReason) || + (eCsrForcedDisassoc == pCommand->u.roamCmd.roamReason) || + (eCsrHddIssued == pCommand->u.roamCmd.roamReason)))) || + /* OR if pCommand is NULL */ + ((sessionId == pDupCommand->sessionId) && + (eSmeCommandRoam == pDupCommand->command) && + ((eCsrForcedDisassoc == eRoamReason) || + (eCsrHddIssued == eRoamReason)))) + { + smsLog(pMac, LOGW, FL("RoamReason = %d"), + pDupCommand->u.roamCmd.roamReason); + /* Remove the 'stale' roam command from the pending list */ + if (csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); - } } pEntry = pNextEntry; } - csrLLUnlock( &pMac->sme.smeCmdPendingList ); + csrLLUnlock(pList); - while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) + while ((pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK))) { pDupCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); - //Tell caller that the command is cancelled - csrRoamCallCallback(pMac, pDupCommand->sessionId, NULL, pDupCommand->u.roamCmd.roamId, - eCSR_ROAM_CANCELLED, eCSR_ROAM_RESULT_NONE); + /* Tell caller that the command is cancelled */ + csrRoamCallCallback(pMac, pDupCommand->sessionId, NULL, + pDupCommand->u.roamCmd.roamId, + eCSR_ROAM_CANCELLED, eCSR_ROAM_RESULT_NONE); csrReleaseCommandRoam(pMac, pDupCommand); } csrLLClose(&localList); } + +/** + * csrRoamRemoveDuplicateCommand()- Remove duplicate roam cmd + * from pending lists. + * + * @pMac: pointer to global mac + * @sessionId: session id for the cmd + * @pCommand: cmd to be removed, can be null + * @eRoamReason: cmd with reason to be removed + * + * Remove duplicate command from the sme and roam pending list. + * + * Return: void + */ +void csrRoamRemoveDuplicateCommand(tpAniSirGlobal pMac, + tANI_U32 sessionId, tSmeCmd *pCommand, + eCsrRoamReason eRoamReason) +{ + /* Always lock active list before locking pending lists */ + csrLLLock(&pMac->sme.smeCmdActiveList); + csr_roam_remove_duplicate_cmd_from_list(pMac, + sessionId, &pMac->sme.smeCmdPendingList, + pCommand, eRoamReason); + csr_roam_remove_duplicate_cmd_from_list(pMac, + sessionId, &pMac->roam.roamCmdPendingList, + pCommand, eRoamReason); + csrLLUnlock(&pMac->sme.smeCmdActiveList); +} + eHalStatus csrRoamCallCallback(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, eRoamCmdStatus u1, eCsrRoamResult u2) { @@ -2716,8 +2857,12 @@ eHalStatus csrRoamIssueDisassociate( tpAniSirGlobal pMac, tANI_U32 sessionId, \return eHalStatus ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, - tANI_U32 sessionId, + tANI_U32 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pPeerMacAddr, +#else tANI_U8 *pPeerMacAddr, +#endif tANI_U32 reason) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -3087,7 +3232,8 @@ eHalStatus csrRoamPrepareBssConfig(tpAniSirGlobal pMac, tCsrRoamProfile *pProfil } //validate CB pBssConfig->cbMode = csrGetCBModeFromIes(pMac, pBssDesc->channelId, pIes); - + smsLog(pMac, LOG1, FL("Bss Cb is %d, join timeout is %d, HB thresh is %d,"), + pBssConfig->cbMode, pBssConfig->uJoinTimeOut, pBssConfig->uHeartBeatThresh); }while(0); return (status); } @@ -3474,12 +3620,13 @@ eHalStatus csrSetQosToCfg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrMediaAcc return (status); } static eHalStatus csrGetRateSet( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, eCsrPhyMode phyMode, tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes, tSirMacRateSet *pOpRateSet, tSirMacRateSet *pExRateSet) + tDot11fBeaconIEs *pIes, tSirMacRateSet *pOpRateSet, tSirMacRateSet *pExRateSet, tANI_U16 *pRateBitmap) { eHalStatus status = eHAL_STATUS_FAILURE; int i; eCsrCfgDot11Mode cfgDot11Mode; tANI_U8 *pDstRate; + tANI_U16 rateBitmap = 0; vos_mem_set(pOpRateSet, sizeof(tSirMacRateSet), 0); vos_mem_set(pExRateSet, sizeof(tSirMacRateSet), 0); VOS_ASSERT( pIes != NULL ); @@ -3503,32 +3650,38 @@ static eHalStatus csrGetRateSet( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile { if ( csrRatesIsDot11RateSupported( pMac, pIes->SuppRates.rates[ i ] ) ) { - *pDstRate++ = pIes->SuppRates.rates[ i ]; - pOpRateSet->numRates++; + if ( !csrIsRateAlreadyPresent(pIes->SuppRates.rates[ i ], rateBitmap) ) + { + csrAddRateBitmap(pIes->SuppRates.rates[ i ], &rateBitmap); + *pDstRate++ = pIes->SuppRates.rates[ i ]; + pOpRateSet->numRates++; + } } } } - if ( eCSR_CFG_DOT11_MODE_11G == cfgDot11Mode || - eCSR_CFG_DOT11_MODE_11N == cfgDot11Mode || - eCSR_CFG_DOT11_MODE_TAURUS == cfgDot11Mode || - eCSR_CFG_DOT11_MODE_ABG == cfgDot11Mode ) + /* If there are Extended Rates in the beacon, we will reflect those + * extended rates that we support in out Extended Operational Rate + * set*/ + pDstRate = pExRateSet->rate; + if(pIes->ExtSuppRates.present) { - // If there are Extended Rates in the beacon, we will reflect those - // extended rates that we support in out Extended Operational Rate - // set: - pDstRate = pExRateSet->rate; - if(pIes->ExtSuppRates.present) + for (i = 0; i < pIes->ExtSuppRates.num_rates; i++) { - for ( i = 0; i < pIes->ExtSuppRates.num_rates; i++ ) + if (csrRatesIsDot11RateSupported(pMac, + pIes->ExtSuppRates.rates[ i ])) { - if ( csrRatesIsDot11RateSupported( pMac, pIes->ExtSuppRates.rates[ i ] ) ) + if (!csrIsRateAlreadyPresent(pIes->ExtSuppRates.rates[i], + rateBitmap)) { - *pDstRate++ = pIes->ExtSuppRates.rates[ i ]; + csrAddRateBitmap(pIes->ExtSuppRates.rates[i], + &rateBitmap); + *pDstRate++ = pIes->ExtSuppRates.rates[i]; pExRateSet->numRates++; } } } } + *pRateBitmap = rateBitmap; }//Parsing BSSDesc else { @@ -4672,7 +4825,8 @@ eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); return eHAL_STATUS_FAILURE; } - + smsLog(pMac, LOG1, FL("Roam Reason : %d, sessionId: %d"), + pCommand->u.roamCmd.roamReason, sessionId); switch ( pCommand->u.roamCmd.roamReason ) { case eCsrForcedDisassoc: @@ -5115,12 +5269,11 @@ static eHalStatus csrRoamSaveSecurityRspIE(tpAniSirGlobal pMac, tANI_U32 session pIesLocal->WAPI.multicast_cipher_suite + 4, 2); pIeBuf += 2; - //bkid_count - vos_mem_copy(pIeBuf, &pIesLocal->WAPI.bkid_count, 2); - - pIeBuf += 2; - if( pIesLocal->WAPI.bkid_count ) + if ( pIesLocal->WAPI.bkid_count ) { + //bkid_count + vos_mem_copy(pIeBuf, &pIesLocal->WAPI.bkid_count, 2); + pIeBuf += 2; //copy akm_suites vos_mem_copy(pIeBuf, pIesLocal->WAPI.bkid, pIesLocal->WAPI.bkid_count * 4); @@ -6039,6 +6192,7 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman csrScanStartIdleScan(pMac); break; case eCsrForcedIbssLeave: + csrIbssAgeBss(pMac); csrRoamCallCallback(pMac, sessionId, NULL, pCommand->u.roamCmd.roamId, eCSR_ROAM_IBSS_LEAVE, @@ -6199,8 +6353,8 @@ eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, #endif /* FEATURE_WLAN_WAPI */ if(pSrcProfile->nAddIEScanLength) { - memset(pDstProfile->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH); - if ( SIR_MAC_MAX_IE_LENGTH >= pSrcProfile->nAddIEScanLength) + memset(pDstProfile->addIEScan, 0 , SIR_MAC_MAX_ADD_IE_LENGTH); + if ( SIR_MAC_MAX_ADD_IE_LENGTH >= pSrcProfile->nAddIEScanLength) { vos_mem_copy(pDstProfile->addIEScan, pSrcProfile->addIEScan, pSrcProfile->nAddIEScanLength); @@ -6396,6 +6550,12 @@ eHalStatus csrRoamCopyConnectedProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, pDstProfile->CBMode = pSrcProfile->CBMode; vos_mem_copy(&pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys)); +#ifdef WLAN_FEATURE_11W + pDstProfile->MFPEnabled = pSrcProfile->MFPEnabled; + pDstProfile->MFPRequired = pSrcProfile->MFPRequired; + pDstProfile->MFPCapable = pSrcProfile->MFPCapable; +#endif + #ifdef WLAN_FEATURE_VOWIFI_11R if (pSrcProfile->MDID.mdiePresent) { @@ -6640,6 +6800,11 @@ eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi smsLog(pMac, LOGP, FL("No profile specified")); return eHAL_STATUS_FAILURE; } + if(!pSession) + { + smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); + return eHAL_STATUS_FAILURE; + } smsLog(pMac, LOG1, FL("called BSSType = %s (%d) authtype = %d " "encryType = %d"), lim_BssTypetoString(pProfile->BSSType), @@ -6653,6 +6818,8 @@ eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi pProfile->operationChannel); return status; } + /* Reset abortConnection for the fresh connection */ + pSession->abortConnection = FALSE; csrRoamCancelRoaming(pMac, sessionId); csrScanRemoveFreshScanCommand(pMac, sessionId); csrScanCancelIdleScan(pMac); @@ -7074,9 +7241,10 @@ eHalStatus csrRoamProcessDisassocDeauth( tpAniSirGlobal pMac, tSmeCmd *pCommand, if( fDisassoc ) { status = csrRoamIssueDisassociate( pMac, sessionId, NewSubstate, fMICFailure ); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_SME_DISASSOC_ISSUE, NULL, 0); -#endif /* DEBUG_ROAM_DELAY */ + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_SME_DISASSOC_ISSUE, NULL, 0); + } } else { @@ -7120,6 +7288,16 @@ eHalStatus csrRoamProcessDisassocDeauth( tpAniSirGlobal pMac, tSmeCmd *pCommand, { //Set the state to disconnect here pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED; +#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING + //we don't need to run this timer any more + if (VOS_TIMER_STATE_RUNNING == + pMac->roam.neighborRoamInfo.forcedInitialRoamTo5GHTimer.state) + { + status = vos_timer_stop(&pMac->roam.neighborRoamInfo.forcedInitialRoamTo5GHTimer); + if (status != eHAL_STATUS_SUCCESS) + smsLog(pMac, LOGE, FL("Failed to Stop Forced 5G timer")); + } +#endif } } else @@ -7145,10 +7323,9 @@ eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, { eHalStatus status = eHAL_STATUS_SUCCESS; tSmeCmd *pCommand; - tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_FALSE; + do { - smsLog( pMac, LOG1, FL(" reason = %d"), reason ); pCommand = csrGetCommandBuffer( pMac ); if ( !pCommand ) { @@ -7164,6 +7341,8 @@ eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, } pCommand->command = eSmeCommandRoam; pCommand->sessionId = (tANI_U8)sessionId; + smsLog( pMac, LOG1, FL("Disassociate reason: %d, sessionId: %d"), + reason,sessionId); switch ( reason ) { case eCSR_DISCONNECT_REASON_MIC_ERROR: @@ -7173,7 +7352,6 @@ eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, pCommand->u.roamCmd.roamReason = eCsrForcedDeauth; break; case eCSR_DISCONNECT_REASON_HANDOFF: - fHighPriority = eANI_BOOLEAN_TRUE; pCommand->u.roamCmd.roamReason = eCsrSmeIssuedDisassocForHandoff; break; case eCSR_DISCONNECT_REASON_UNSPECIFIED: @@ -7189,7 +7367,7 @@ eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, default: break; } - status = csrQueueSmeCommand(pMac, pCommand, fHighPriority); + status = csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); if( !HAL_STATUS_SUCCESS( status ) ) { smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status ); @@ -7282,6 +7460,18 @@ eHalStatus csrRoamDisconnect(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDi return (csrRoamDisconnectInternal(pMac, sessionId, reason)); } +void csr_abortConnection(tpAniSirGlobal pMac, tANI_U32 sessionId) +{ + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + if(!pSession) + { + smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); + return; + } + pSession->abortConnection = TRUE; + return; +} + eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes) { @@ -7335,6 +7525,12 @@ eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionI vos_mem_copy(pConnectProfile->pAddIEAssoc, pProfile->pAddIEAssoc, pProfile->nAddIEAssocLength); } + +#ifdef WLAN_FEATURE_11W + pConnectProfile->MFPEnabled = pProfile->MFPEnabled; + pConnectProfile->MFPRequired = pProfile->MFPRequired; + pConnectProfile->MFPCapable = pProfile->MFPCapable; +#endif //Save bssid csrGetBssIdBssDesc(pMac, pSirBssDesc, &pConnectProfile->bssid); @@ -7422,12 +7618,14 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo { tListElem *pEntry = NULL; tSmeCmd *pCommand = NULL; + tCsrRoamSession *pSession = NULL; //The head of the active list is the request we sent pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); if(pEntry) { pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); } + pSession = CSR_GET_SESSION( pMac, pSmeJoinRsp->sessionId ); if ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode ) { if(pCommand && eCsrSmeIssuedAssocToSimilarAP == pCommand->u.roamCmd.roamReason) @@ -7437,18 +7635,31 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo #endif } csrRoamComplete( pMac, eCsrJoinSuccess, (void *)pSmeJoinRsp ); + if(!pSession) + { + smsLog(pMac, LOGE, FL(" session %d not found "), + pSmeJoinRsp->sessionId); + return; + } + pSession->abortConnection = FALSE; } else { tANI_U32 roamId = 0; - tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pSmeJoinRsp->sessionId ); if(!pSession) { - smsLog(pMac, LOGE, FL(" session %d not found "), pSmeJoinRsp->sessionId); + smsLog(pMac, LOGE, FL(" session %d not found "), + pSmeJoinRsp->sessionId); + return; + } + if (pSession->abortConnection) + { + smsLog(pMac, LOG1, FL("Disconnection in progess" + "abort Join request")); + csrRoamComplete( pMac, eCsrNothingToJoin, NULL ); + pSession->abortConnection = FALSE; return; } - - //The head of the active list is the request we sent //Try to get back the same profile and roam again if(pCommand) @@ -7515,11 +7726,11 @@ static eHalStatus csrRoamIssueReassociate( tpAniSirGlobal pMac, tANI_U32 session VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, FL(" calling csrSendJoinReqMsg (eWNI_SME_REASSOC_REQ)")); -#ifdef DEBUG_ROAM_DELAY - //HACK usign buff len as Auth type - vos_record_roam_event(e_SME_ISSUE_REASSOC_REQ, NULL, pProfile->negotiatedAuthType); - vos_record_roam_event(e_CACHE_ROAM_PEER_MAC, (void *)pSirBssDesc->bssId, 6); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_SME_ISSUE_REASSOC_REQ, NULL, pProfile->negotiatedAuthType); + vos_record_roam_event(e_CACHE_ROAM_PEER_MAC, (void *)pSirBssDesc->bssId, 6); + } // attempt to Join this BSS... return csrSendJoinReqMsg( pMac, sessionId, pSirBssDesc, pProfile, pIes, eWNI_SME_REASSOC_REQ); } @@ -7963,8 +8174,6 @@ static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 res static void csrRoamRoamingStateAuthRspProcessor( tpAniSirGlobal pMac, tSirSmeAuthRsp *pSmeAuthRsp ) { - //No one is sending eWNI_SME_AUTH_REQ to PE. - smsLog(pMac, LOGW, FL("is no-op")); if ( eSIR_SME_SUCCESS == pSmeAuthRsp->statusCode ) { smsLog( pMac, LOGW, "CSR SmeAuthReq Successful" ); @@ -8119,6 +8328,7 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN( pMac, sessionId ) ) { + smsLog( pMac, LOG2, "***eCsrNothingToJoin***"); csrRoamComplete( pMac, eCsrNothingToJoin, NULL ); } else if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED( pMac, sessionId ) || @@ -8247,6 +8457,7 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass /* Notify sub-modules like QoS etc. that handoff happening */ sme_QosCsrEventInd(pMac, sessionId, SME_QOS_CSR_HANDOFF_ASSOC_REQ, NULL); + pmcStopTrafficTimer(pMac); csrReleaseProfile(pMac, pCurRoamProfile); vos_mem_free(pCurRoamProfile); csrFreeScanFilter(pMac, pScanFilter); @@ -8317,8 +8528,6 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass static void csrRoamRoamingStateDeauthRspProcessor( tpAniSirGlobal pMac, tSirSmeDeauthRsp *pSmeRsp ) { tSirResultCodes statusCode; - //No one is sending eWNI_SME_DEAUTH_REQ to PE. - smsLog(pMac, LOGW, FL("is no-op")); statusCode = csrGetDeAuthRspStatusCode( pSmeRsp ); pMac->roam.deauthRspStatus = statusCode; if ( CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ( pMac, pSmeRsp->sessionId) ) @@ -8427,9 +8636,10 @@ void csrRoamingStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) macTraceGetcsrRoamSubState( pMac->roam.curSubState[pSmeRsp->sessionId])); csrRoamRoamingStateDisassocRspProcessor( pMac, (tSirSmeDisassocRsp *)pSmeRsp ); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_SME_DISASSOC_COMPLETE, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_SME_DISASSOC_COMPLETE, NULL, 0); + } } break; @@ -8467,6 +8677,18 @@ void csrRoamingStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) eCSR_ROAM_CONNECT_STATUS_UPDATE, eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED); break; + case eWNI_SME_LOST_LINK_PARAMS_IND: + { + tpSirSmeLostLinkParamsInd pLostLinkParamsInd = (tpSirSmeLostLinkParamsInd)pSmeRsp; + tCsrRoamInfo roamInfo, *pRoamInfo = NULL; + eCsrRoamResult result = eCSR_ROAM_RESULT_NONE; + vos_mem_set(&roamInfo, sizeof(tCsrRoamInfo), 0); + roamInfo.u.pLostLinkParams = &pLostLinkParamsInd->info; + pRoamInfo = &roamInfo; + csrRoamCallCallback(pMac, pLostLinkParamsInd->sessionId, + pRoamInfo, 0, eCSR_ROAM_LOST_LINK_PARAMS_IND, result); + break; + } default: smsLog(pMac, LOG1, FL("Unexpected message type = %d[0x%X] received in substate %s"), @@ -8525,6 +8747,12 @@ void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) vos_mem_copy(&pRoamInfo->bssid, pUpperLayerAssocCnf->bssId, sizeof(tCsrBssid)); pRoamInfo->wmmEnabledSta = pUpperLayerAssocCnf->wmmEnabledSta; +#ifdef WLAN_FEATURE_AP_HT40_24G + pRoamInfo->HT40MHzIntoEnabledSta = + pUpperLayerAssocCnf->HT40MHzIntoEnabledSta; + smsLog( pMac, LOGW, FL("HT40MHzIntoEnabledSta: %d \n"), + pRoamInfo->HT40MHzIntoEnabledSta); +#endif if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) ) { pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED; @@ -9170,7 +9398,7 @@ tANI_BOOLEAN csrRoamIssueWmStatusChange( tpAniSirGlobal pMac, tANI_U32 sessionId pSmeRsp, sizeof( pCommand->u.wmStatusChangeCmd.u.DeauthIndMsg )); } - if( HAL_STATUS_SUCCESS( csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_TRUE) ) ) + if( HAL_STATUS_SUCCESS( csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_FALSE) ) ) { fCommandQueued = eANI_BOOLEAN_TRUE; } @@ -9441,7 +9669,7 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) case eWNI_SME_ASSOC_IND: { tCsrRoamSession *pSession; - smsLog( pMac, LOG1, FL("ASSOCIATION Indication from SME")); + smsLog( pMac, LOG1, FL("Receive WNI_SME_ASSOC_IND from SME")); pAssocInd = (tSirSmeAssocInd *)pSirMsg; status = csrRoamGetSessionIdFromBSSID( pMac, (tCsrBssid *)pAssocInd->bssId, &sessionId ); if( HAL_STATUS_SUCCESS( status ) ) @@ -9476,6 +9704,12 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) vos_mem_copy(&pRoamInfo->bssid, pAssocInd->bssId, sizeof(tCsrBssid)); pRoamInfo->wmmEnabledSta = pAssocInd->wmmEnabledSta; +#ifdef WLAN_FEATURE_AP_HT40_24G + pRoamInfo->HT40MHzIntoEnabledSta = + pAssocInd->HT40MHzIntoEnabledSta; + smsLog(pMac, LOGW, FL("HT40MHzIntoEnabledSta: %d \n"), + pRoamInfo->HT40MHzIntoEnabledSta); +#endif if(CSR_IS_WDS_AP( pRoamInfo->u.pConnectedProfile)) status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_WDS_IND, eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND);//Sta if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile)) @@ -9748,6 +9982,18 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) } } break; + case eWNI_SME_LOST_LINK_PARAMS_IND: + { + tpSirSmeLostLinkParamsInd pLostLinkParamsInd = (tpSirSmeLostLinkParamsInd)pSirMsg; + tCsrRoamInfo roamInfo, *pRoamInfo = NULL; + eCsrRoamResult result = eCSR_ROAM_RESULT_NONE; + vos_mem_set(&roamInfo, sizeof(tCsrRoamInfo), 0); + roamInfo.u.pLostLinkParams = &pLostLinkParamsInd->info; + pRoamInfo = &roamInfo; + csrRoamCallCallback(pMac, pLostLinkParamsInd->sessionId, + pRoamInfo, 0, eCSR_ROAM_LOST_LINK_PARAMS_IND, result); + break; + } case eWNI_SME_MIC_FAILURE_IND: { tpSirSmeMicFailureInd pMicInd = (tpSirSmeMicFailureInd)pSirMsg; @@ -9882,11 +10128,14 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) if(pNewBss) { vos_mem_copy(pIbssLog->bssid, pNewBss->bssId, 6); - if(pNewBss->ssId.length) - { - vos_mem_copy(pIbssLog->ssid, pNewBss->ssId.ssId, - pNewBss->ssId.length); - } + if(pNewBss->ssId.length > + VOS_LOG_MAX_SSID_SIZE) + pNewBss->ssId.length = + VOS_LOG_MAX_SSID_SIZE; + + vos_mem_copy(pIbssLog->ssid, + pNewBss->ssId.ssId, + pNewBss->ssId.length); pIbssLog->operatingChannel = pNewBss->channelNumber; } if(HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &bi))) @@ -10149,6 +10398,12 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) { setKeyEvent.eventId = WLAN_SECURITY_EVENT_SET_PTK_RSP; } + if( pRsp->peerMacAddr[0] & 0x01 ) + { + pMac->pmc.remainInPowerActiveTillDHCP = FALSE; + smsLog(pMac, LOG1, FL("Reset" + "remainInPowerActiveTillDHCP to allow BMPS")); + } setKeyEvent.encryptionModeMulticast = (v_U8_t)diagEncTypeFromCSRType(pSession->connectedProfile.mcEncryptionType); setKeyEvent.encryptionModeUnicast = @@ -10200,6 +10455,9 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) /* OBSS SCAN Indication will be sent to Firmware to start OBSS Scan */ if( CSR_IS_CHANNEL_24GHZ(pSession->connectedProfile.operationChannel) && IS_HT40_OBSS_SCAN_FEATURE_ENABLE + && (pSession->connectState == + eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED) + && pSession->pCurRoamProfile && (VOS_P2P_GO_MODE != pSession->pCurRoamProfile->csrPersona && VOS_STA_SAP_MODE != @@ -10217,6 +10475,20 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) status = palSendMBMessage(pMac->hHdd, pMsg ); } + else + { + smsLog( pMac, LOG1,FL("OBSS SCAN" + "Indication not sent to FW" + "channel %d OBSS_SCAN: %d"), + pSession->connectedProfile. + operationChannel, + IS_HT40_OBSS_SCAN_FEATURE_ENABLE); + smsLog( pMac, LOG1,FL("connectState %d" + "pCurRoamProfile %pK"), + pSession->connectState, + pSession->pCurRoamProfile); + } + result = eCSR_ROAM_RESULT_AUTHENTICATED; } else @@ -10232,6 +10504,7 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) "command failed(%d) PeerMac "MAC_ADDRESS_STR, pRsp->statusCode, MAC_ADDR_ARRAY(pRsp->peerMacAddr)); } + roamInfo.is11rAssoc = csrRoamIs11rAssoc(pMac); csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.setKeyCmd.roamId, eCSR_ROAM_SET_KEY_COMPLETE, result); // Indicate SME_QOS that the SET_KEY is completed, so that SME_QOS @@ -10763,9 +11036,13 @@ eHalStatus csrRoamLostLink( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 ty pDeauthIndMsg = (tSirSmeDeauthInd *)pSirMsg; pSession->roamingStatusCode = pDeauthIndMsg->statusCode; /* Convert into proper reason code */ - pSession->joinFailStatusCode.reasonCode = - (pDeauthIndMsg->reasonCode == eSIR_BEACON_MISSED) ? - 0 : pDeauthIndMsg->reasonCode; + if ((pDeauthIndMsg->reasonCode == eSIR_BEACON_MISSED) || + (pDeauthIndMsg->reasonCode == + eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON)) + pSession->joinFailStatusCode.reasonCode = 0; + else + pSession->joinFailStatusCode.reasonCode = pDeauthIndMsg->reasonCode; + /* cfg layer expects 0 as reason code if the driver dosent know the reason code eSIR_BEACON_MISSED is defined as locally */ @@ -10977,7 +11254,9 @@ void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand smsLog(pMac, LOGE, FL(" session %d not found "), pCommand->sessionId); return; } - + smsLog(pMac, LOG1, FL("session:%d, CmdType : %d"), + pCommand->sessionId, + pCommand->u.wmStatusChangeCmd.Type); switch ( pCommand->u.wmStatusChangeCmd.Type ) { case eCsrDisassociated: @@ -12026,10 +12305,14 @@ static void csrRoamPrepareBssParams(tpAniSirGlobal pMac, tANI_U32 sessionId, tCs { if(CSR_IS_CHANNEL_24GHZ(Channel) ) { - /* TODO- SAP: HT40 Support in SAP 2.4Ghz mode is not enabled. - so channel bonding in 2.4Ghz is configured as 20MHZ - irrespective of the 'channelBondingMode24GHz' Parameter */ +#ifdef WLAN_FEATURE_AP_HT40_24G + if (CSR_IS_INFRA_AP(pProfile)) + cbMode = pMac->roam.configParam.channelBondingAPMode24GHz; + else + cbMode = PHY_SINGLE_CHANNEL_CENTERED; +#else cbMode = PHY_SINGLE_CHANNEL_CENTERED; +#endif } else { @@ -12227,44 +12510,40 @@ eHalStatus csrRoamSetPMKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, #endif//FEATURE_WLAN_DIAG_SUPPORT_CSR status = eHAL_STATUS_SUCCESS; if (update_entire_cache) { - pSession->NumPmkidCache = (tANI_U16)numItems; if (numItems && pPMKIDCache) { + pSession->NumPmkidCache = (tANI_U16)numItems; vos_mem_copy(pSession->PmkidCacheInfo, pPMKIDCache, sizeof(tPmkidCacheInfo) * numItems); + pSession->CurCacheIndex = (tANI_U16)numItems; } } else { - tANI_U32 i = 0, j = 0; - tANI_U8 BSSIDMatched = 0; + tANI_U32 i = 0; tPmkidCacheInfo *pmksa; for (i = 0; i < numItems; i++) { pmksa = &pPMKIDCache[i]; - for (j = 0; j < CSR_MAX_PMKID_ALLOWED; j++) { - if (vos_mem_compare(pSession->PmkidCacheInfo[j].BSSID, - pmksa->BSSID, VOS_MAC_ADDR_SIZE)) { - /* If a matching BSSID found, update it */ - BSSIDMatched = 1; - vos_mem_copy(pSession->PmkidCacheInfo[j].PMKID, - pmksa->PMKID, CSR_RSN_PMKID_SIZE); - break; - } - } - if (!BSSIDMatched) { - vos_mem_copy( - pSession->PmkidCacheInfo[pSession->NumPmkidCache].BSSID, - pmksa->BSSID, VOS_MAC_ADDR_SIZE); - vos_mem_copy( - pSession->PmkidCacheInfo[pSession->NumPmkidCache].PMKID, - pmksa->PMKID, CSR_RSN_PMKID_SIZE); - /* Increment the CSR local cache index */ - if (pSession->NumPmkidCache < (CSR_MAX_PMKID_ALLOWED - 1)) - pSession->NumPmkidCache++; - else - pSession->NumPmkidCache = 0; - } - BSSIDMatched = 0; + /* Delete the entry if present */ + csrRoamDelPMKIDfromCache(pMac,sessionId,pmksa->BSSID,FALSE); + + /* Add entry to the cache */ + vos_mem_copy( + pSession->PmkidCacheInfo[pSession->CurCacheIndex].BSSID, + pmksa->BSSID, VOS_MAC_ADDR_SIZE); + vos_mem_copy( + pSession->PmkidCacheInfo[pSession->CurCacheIndex].PMKID, + pmksa->PMKID, CSR_RSN_PMKID_SIZE); + + /* Increment the CSR local cache index */ + if (pSession->CurCacheIndex < (CSR_MAX_PMKID_ALLOWED - 1)) + pSession->CurCacheIndex++; + else + pSession->CurCacheIndex = 0; + + pSession->NumPmkidCache++; + if(pSession->NumPmkidCache > CSR_MAX_PMKID_ALLOWED) + pSession->NumPmkidCache = CSR_MAX_PMKID_ALLOWED; } } } @@ -12272,13 +12551,18 @@ eHalStatus csrRoamSetPMKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, } eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pBSSId, +#else tANI_U8 *pBSSId, +#endif tANI_BOOLEAN flush_cache ) { - eHalStatus status = eHAL_STATUS_FAILURE; tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); tANI_BOOLEAN fMatchFound = FALSE; tANI_U32 Index; + tANI_U32 CurIndex; + tANI_U32 i; if(!pSession) { @@ -12301,7 +12585,6 @@ eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, /* Clear this - the matched entry */ vos_mem_zero(&pSession->PmkidCacheInfo[Index], sizeof(tPmkidCacheInfo)); - status = eHAL_STATUS_SUCCESS; break; } } @@ -12309,17 +12592,37 @@ eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, if (Index == CSR_MAX_PMKID_ALLOWED && !fMatchFound) { smsLog(pMac, LOG1, FL("No such PMKSA entry exists "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pBSSId)); - return status; } - - return status; + else { + /* Match Found */ + CurIndex = pSession->CurCacheIndex; + if(Index < CurIndex) { + for(i = Index; i < (CurIndex-1); i++) { + vos_mem_copy(&pSession->PmkidCacheInfo[i], + &pSession->PmkidCacheInfo[i+1],sizeof(tPmkidCacheInfo)); + } + pSession->CurCacheIndex--; + vos_mem_zero(&pSession->PmkidCacheInfo[pSession->CurCacheIndex], + sizeof(tPmkidCacheInfo)); + } else if(Index > CurIndex) { + for(i = Index; i > (CurIndex); i--) { + vos_mem_copy(&pSession->PmkidCacheInfo[i], + &pSession->PmkidCacheInfo[i-1],sizeof(tPmkidCacheInfo)); + } + vos_mem_zero(&pSession->PmkidCacheInfo[pSession->CurCacheIndex], + sizeof(tPmkidCacheInfo)); + } + pSession->NumPmkidCache--; + } } else { /* Flush the entire cache */ vos_mem_zero(pSession->PmkidCacheInfo, sizeof(tPmkidCacheInfo) * CSR_MAX_PMKID_ALLOWED); pSession->NumPmkidCache = 0; - return eHAL_STATUS_SUCCESS; + pSession->CurCacheIndex = 0; } + + return eHAL_STATUS_SUCCESS; } tANI_U32 csrRoamGetNumPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId) @@ -12331,6 +12634,8 @@ eHalStatus csrRoamGetPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U3 { eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + tPmkidCacheInfo *pmksa; + tANI_U16 i,j; if(!pSession) { @@ -12353,8 +12658,16 @@ eHalStatus csrRoamGetPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U3 pSession->NumPmkidCache); pSession->NumPmkidCache = CSR_MAX_PMKID_ALLOWED; } - vos_mem_copy(pPmkidCache, pSession->PmkidCacheInfo, - sizeof(tPmkidCacheInfo) * pSession->NumPmkidCache); + + for(i = 0,j = 0; (jNumPmkidCache)&&(iPmkidCacheInfo[i]; + if(!csrIsMacAddressZero(pMac, &pmksa->BSSID)) { + vos_mem_copy(pPmkidCache,pmksa,sizeof(tPmkidCacheInfo)); + pPmkidCache++; + j++; + } + } + *pNum = pSession->NumPmkidCache; status = eHAL_STATUS_SUCCESS; } @@ -12730,12 +13043,18 @@ static void csrPrepareJoinReassocReqBuffer( tpAniSirGlobal pMac, } size = sizeof(pMac->roam.validChannelList); if(HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, (tANI_U8 *)pMac->roam.validChannelList, &size))) - { - *pBuf++ = (tANI_U8)size; //tSirSupChnl->numChnl - for ( i = 0; i < size; i++) + { + tANI_U8 *actualSize = pBuf++; + *actualSize = 0; + + for ( i = 0; i < size; i++) { - *pBuf++ = pMac->roam.validChannelList[ i ]; //tSirSupChnl->channelList[ i ] - + /* Only add 5ghz channels*/ + if (CSR_IS_CHANNEL_5GHZ(pMac->roam.validChannelList[ i ])) + { + *actualSize +=1; + *pBuf++ = pMac->roam.validChannelList[ i ]; + } } } else @@ -12787,6 +13106,7 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe tANI_U8 wpaRsnIE[DOT11F_IE_RSN_MAX_LEN]; //RSN MAX is bigger than WPA MAX tANI_U32 ucDot11Mode = 0; tANI_U8 txBFCsnValue = 0; + tANI_U16 rateBitmap = 0; if(!pSession) { @@ -12869,6 +13189,8 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe //Persona *pBuf = (tANI_U8)pProfile->csrPersona; pBuf++; + *pBuf = (tANI_U8)pProfile->bOSENAssociation; + pBuf++; //CBMode *pBuf = (tANI_U8)pSession->bssParams.cbMode; pBuf++; @@ -12882,7 +13204,7 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe - status = csrGetRateSet(pMac, pProfile, (eCsrPhyMode)pProfile->phyMode, pBssDescription, pIes, &OpRateSet, &ExRateSet); + status = csrGetRateSet(pMac, pProfile, (eCsrPhyMode)pProfile->phyMode, pBssDescription, pIes, &OpRateSet, &ExRateSet,&rateBitmap); if (HAL_STATUS_SUCCESS(status) ) { // OperationalRateSet @@ -12903,6 +13225,11 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe *pBuf++ = 0; *pBuf++ = 0; } + + //rateBitmap + vos_mem_copy(pBuf, &rateBitmap, sizeof(tANI_U16)); + pBuf += sizeof(tANI_U16); + // rsnIE if ( csrIsProfileWpa( pProfile ) ) { @@ -13333,10 +13660,12 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe pBuf++; // txBFCsnValue - txBFCsnValue = (tANI_U8)pMac->roam.configParam.txBFCsnValue; - if (pIes->VHTCaps.present) + if (IS_BSS_VHT_CAPABLE(pIes->VHTCaps)) { - txBFCsnValue = CSR_ROAM_MIN(txBFCsnValue, pIes->VHTCaps.numSoundingDim); + txBFCsnValue = (tANI_U8)pMac->roam.configParam.txBFCsnValue; + if (pIes->VHTCaps.numSoundingDim) + txBFCsnValue = CSR_ROAM_MIN + (txBFCsnValue, pIes->VHTCaps.numSoundingDim); } *pBuf = txBFCsnValue; pBuf++; @@ -13674,6 +14003,58 @@ csrSendChngMCCBeaconInterval(tpAniSirGlobal pMac, tANI_U32 sessionId) return status; } +#ifdef WLAN_FEATURE_AP_HT40_24G +eHalStatus csrSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U8 cbMode) +{ + tpSirSetHT2040Mode pMsg; + tANI_U16 len = 0; + eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + + if(!pSession) + { + smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); + return eHAL_STATUS_FAILURE; + } + + /* Create the message and send to lim */ + len = sizeof(tSirSetHT2040Mode); + pMsg = vos_mem_malloc(len); + + if ( NULL == pMsg ) + { + smsLog( pMac, LOGE, FL("Memory Allocation Fail !!!")); + status = eHAL_STATUS_FAILURE; + } + else + status = eHAL_STATUS_SUCCESS; + + if(HAL_STATUS_SUCCESS(status)) + { + vos_mem_set(pMsg, sizeof(tSirSetHT2040Mode), 0); + pMsg->messageType = eWNI_SME_SET_HT_2040_MODE; + pMsg->length = len; + + // bssId + vos_mem_copy((tSirMacAddr *)pMsg->bssId, &pSession->selfMacAddr, + sizeof(tSirMacAddr)); + + smsLog( pMac, LOGW, FL("CSR Attempting to set " + "HT20/40 mode for Bssid= "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pMsg->bssId)); + + pMsg->sessionId = sessionId; + pMsg->cbMode = cbMode; + + smsLog(pMac, LOGW, FL("session %d Channel Bonding: %d"), + sessionId, cbMode); + + status = palSendMBMessage(pMac->hHdd, pMsg); + } + return status; +} +#endif + eHalStatus csrSendMBDeauthReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode ) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -13822,6 +14203,10 @@ eHalStatus csrSendAssocCnfMsg( tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd, tANI_U8 *pBuf; tSirResultCodes statusCode; tANI_U16 wTmp; + + smsLog( pMac, LOG1, FL("Posting eWNI_SME_ASSOC_CNF to LIM. " + "HalStatus : %d"), + Halstatus); do { pMsg = vos_mem_malloc(sizeof( tSirSmeAssocCnf )); if ( NULL == pMsg ) @@ -13924,6 +14309,11 @@ eHalStatus csrSendAssocIndToUpperLayerCnfMsg( tpAniSirGlobal pMac, //reassocReq *pBuf = pAssocInd->reassocReq; pBuf += sizeof (tANI_U8); +#ifdef WLAN_FEATURE_AP_HT40_24G + // 40 MHz Intolerant + *pBuf = pAssocInd->HT40MHzIntoEnabledSta; + pBuf += sizeof (tANI_U8); +#endif msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF; msgQ.bodyptr = pMsg; msgQ.bodyval = 0; @@ -14014,16 +14404,7 @@ eHalStatus csrSendMBSetContextReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, // set pSirKey->keyLength = keyLength; p = pal_set_U16( p, pal_cpu_to_be16(keyLength) ); if ( keyLength && pKey ) - { vos_mem_copy(p, pKey, keyLength); - if(keyLength == 16) - { - smsLog(pMac, LOG1, " SME Set keyIdx (%d) encType(%d) key = %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X", - keyId, edType, pKey[0], pKey[1], pKey[2], pKey[3], pKey[4], - pKey[5], pKey[6], pKey[7], pKey[8], - pKey[9], pKey[10], pKey[11], pKey[12], pKey[13], pKey[14], pKey[15]); - } - } status = palSendMBMessage(pMac->hHdd, pMsg); } while( 0 ); return( status ); @@ -14217,6 +14598,9 @@ eHalStatus csrSendMBStartBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCs pParam->extendedRateSet.numRates); pBuf += pParam->extendedRateSet.numRates; } +#ifdef WLAN_FEATURE_AP_HT40_24G + *pBuf++ = (tANI_U8)pMac->roam.configParam.apHT40_24GEnabled; +#endif msgLen = (tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)); //msg_header + msg pMsg->length = pal_cpu_to_be16(msgLen); @@ -14240,60 +14624,37 @@ eHalStatus csrSendMBStopBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId ) return eHAL_STATUS_FAILURE; } - do { - pMsg = vos_mem_malloc(sizeof(tSirSmeStopBssReq)); - if ( NULL == pMsg ) return eHAL_STATUS_FAILURE; - vos_mem_set(pMsg, sizeof( tSirSmeStopBssReq ), 0); - pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_STOP_BSS_REQ); - pBuf = &pMsg->sessionId; - //sessionId - *pBuf = (tANI_U8)sessionId; - pBuf++; - // transactionId - *pBuf = 0; - pBuf += sizeof(tANI_U16); - //reason code - *pBuf = 0; - pBuf += sizeof(tSirResultCodes); - // bssid - // if BSSType is WDS sta, use selfmacAddr as bssid, else use bssid in connectedProfile - if( CSR_IS_CONN_WDS_STA(&pSession->connectedProfile) ) - { - vos_mem_copy(pBuf, (tANI_U8 *)&pSession->selfMacAddr, - sizeof(tSirMacAddr)); - } - else - { - vos_mem_copy(pBuf, (tANI_U8 *)&pSession->connectedProfile.bssid, - sizeof(tSirMacAddr)); - } - pBuf += sizeof(tSirMacAddr); - msgLen = sizeof(tANI_U16) + sizeof(tANI_U16) + 1 + sizeof(tANI_U16) + sizeof(tSirResultCodes) + sizeof(tSirMacAddr); - pMsg->length = pal_cpu_to_be16(msgLen); - status = palSendMBMessage( pMac->hHdd, pMsg ); -#if 0 - pMsg = vos_mem_malloc(sizeof(tSirSmeStopBssReq)); - if ( NULL == pMsg ) return eHAL_STATUS_FAILURE; - vos_mem_set(pMsg, sizeof( tSirSmeStopBssReq ), 0); - pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_STOP_BSS_REQ); - pMsg->reasonCode = 0; - // bssid - // if BSSType is WDS sta, use selfmacAddr as bssid, else use bssid in connectedProfile - if( CSR_IS_CONN_WDS_STA(&pSession->connectedProfile) ) - { - pbBssid = (tANI_U8 *)&pSession->selfMacAddr; - } - else - { - pbBssid = (tANI_U8 *)&pSession->connectedProfile.bssid; - } - vos_mem_copy(&pMsg->bssId, pbBssid, sizeof(tSirMacAddr)); - pMsg->transactionId = 0; - pMsg->sessionId = (tANI_U8)sessionId; - pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeStopBssReq )); - status = palSendMBMessage( pMac->hHdd, pMsg ); -#endif - } while( 0 ); + pMsg = vos_mem_malloc(sizeof(tSirSmeStopBssReq)); + if ( NULL == pMsg ) return eHAL_STATUS_FAILURE; + vos_mem_set(pMsg, sizeof( tSirSmeStopBssReq ), 0); + pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_STOP_BSS_REQ); + pBuf = &pMsg->sessionId; + //sessionId + *pBuf = (tANI_U8)sessionId; + pBuf++; + // transactionId + *pBuf = 0; + pBuf += sizeof(tANI_U16); + //reason code + *pBuf = 0; + pBuf += sizeof(tSirResultCodes); + // bssid + // if BSSType is WDS sta, use selfmacAddr as bssid, else use bssid in connectedProfile + if( CSR_IS_CONN_WDS_STA(&pSession->connectedProfile) ) + { + vos_mem_copy(pBuf, (tANI_U8 *)&pSession->selfMacAddr, + sizeof(tSirMacAddr)); + } + else + { + vos_mem_copy(pBuf, (tANI_U8 *)&pSession->connectedProfile.bssid, + sizeof(tSirMacAddr)); + } + pBuf += sizeof(tSirMacAddr); + msgLen = sizeof(tANI_U16) + sizeof(tANI_U16) + 1 + sizeof(tANI_U16) + sizeof(tSirResultCodes) + sizeof(tSirMacAddr); + pMsg->length = pal_cpu_to_be16(msgLen); + status = palSendMBMessage( pMac->hHdd, pMsg ); + return( status ); } @@ -14581,6 +14942,7 @@ eHalStatus csrSendMBDelSelfStaReqMsg( tpAniSirGlobal pMac, tSirMacAddr macAddr ) return( status ); } eHalStatus csrIssueDelStaForSessionReq(tpAniSirGlobal pMac, tANI_U32 sessionId, + tANI_BOOLEAN fHighPriority, tSirMacAddr sessionMacAddr, csrRoamSessionCloseCallback callback, void *pContext) @@ -14600,7 +14962,7 @@ eHalStatus csrIssueDelStaForSessionReq(tpAniSirGlobal pMac, tANI_U32 sessionId, pCommand->u.delStaSessionCmd.pContext = pContext; vos_mem_copy(pCommand->u.delStaSessionCmd.selfMacAddr, sessionMacAddr, sizeof( tSirMacAddr )); - status = csrQueueSmeCommand(pMac, pCommand, TRUE); + status = csrQueueSmeCommand(pMac, pCommand, fHighPriority); if( !HAL_STATUS_SUCCESS( status ) ) { //Should be panic?? @@ -14677,8 +15039,20 @@ void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId) } } +void csrPurgeSmeCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId) +{ + purgeSmeSessionCmdList(pMac, sessionId, + &pMac->sme.smeCmdPendingList); + if (pMac->fScanOffload) + { + purgeSmeSessionCmdList(pMac, sessionId, + &pMac->sme.smeScanCmdPendingList); + } + purgeCsrSessionCmdList(pMac, sessionId); +} + eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_BOOLEAN fSync, + tANI_BOOLEAN fSync, tANI_U8 bPurgeList, csrRoamSessionCloseCallback callback, void *pContext ) { @@ -14691,16 +15065,15 @@ eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId, csrCleanupSession(pMac, sessionId); } else - { - purgeSmeSessionCmdList(pMac, sessionId, - &pMac->sme.smeCmdPendingList); - if (pMac->fScanOffload) - { - purgeSmeSessionCmdList(pMac, sessionId, - &pMac->sme.smeScanCmdPendingList); - } - purgeCsrSessionCmdList(pMac, sessionId); - status = csrIssueDelStaForSessionReq( pMac, sessionId, + { + if(bPurgeList) + csrPurgeSmeCmdList(pMac, sessionId); + /* If bPurgeList is FALSE, it means HDD already free all the + * cmd and later queue few essential cmd. Now sme should process + * the cmd in pending queue order only.Hence we should + * avoid DEL_SELF_STA as high priority cmd. + */ + status = csrIssueDelStaForSessionReq( pMac, sessionId, bPurgeList, pSession->selfMacAddr, callback, pContext); } } @@ -14761,7 +15134,7 @@ static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId ) #endif /* FEATURE_WLAN_WAPI */ if (pSession->nAddIEScanLength) { - memset(pSession->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH); + memset(pSession->addIEScan, 0 , SIR_MAC_MAX_ADD_IE_LENGTH); } pSession->nAddIEScanLength = 0; @@ -14835,27 +15208,46 @@ static void csrRoamLinkUp(tpAniSirGlobal pMac, tCsrBssid bssid) #if defined WLAN_FEATURE_NEIGHBOR_ROAMING { tANI_U32 sessionId = 0; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; /* Indicate the neighbor roal algorithm about the connect indication */ csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)bssid, &sessionId); csrNeighborRoamIndicateConnect(pMac, sessionId, VOS_STATUS_SUCCESS); - // Making sure we are roaming force fully to 5GHz AP only once and - // only when we connected to 2.4GH AP only during initial association. - if(pMac->roam.neighborRoamInfo.cfgParams.neighborInitialForcedRoamTo5GhEnable && - GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel) == SIR_BAND_2_4_GHZ) - { - //Making ini value to false here only so we just roam to - //only once for whole driver load to unload tenure - pMac->roam.neighborRoamInfo.cfgParams.neighborInitialForcedRoamTo5GhEnable = VOS_FALSE; - - status = vos_timer_start(&pMac->roam.neighborRoamInfo.forcedInitialRoamTo5GHTimer, - INITIAL_FORCED_ROAM_TO_5G_TIMER_PERIOD); - //MUKUL TODO: change the neighborResultsRefreshPeriod to some ini value reuqired ?? + /* Making sure we are roaming force fully to 5GHz AP only once and + * only when we connected to 2.4GH AP only during initial association. + */ + if(pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable && + (GetRFBand(pNeighborRoamInfo->currAPoperationChannel) == + SIR_BAND_2_4_GHZ) + ) + { + status = vos_timer_start( + &pNeighborRoamInfo->forcedInitialRoamTo5GHTimer, + INITIAL_FORCED_ROAM_TO_5G_TIMER_PERIOD); if ( status != VOS_STATUS_SUCCESS ) { - smsLog(pMac, LOGE, FL("%s Neighbor forcedInitialRoamTo5GHTimer start failed with status %d"), __func__, status); + smsLog(pMac, LOGE, + FL("forcedInitialRoamTo5GHTimer start failed status %d"), + status); + //Send RSO start because in case 5G roaming + //host have not enabled at initial connection + csrRoamOffloadScan(pMac,ROAM_SCAN_OFFLOAD_START,REASON_CONNECT); } - smsLog(pMac, LOGE, FL("%s: Forced roam to 5G started Timer"), __func__); + else + { + smsLog(pMac, LOG1, FL("%s: Forced roam to 5G started Timer"), + __func__); + } + } + /* + * Making ini value to false here only so we just roam to + * only once for whole driver load to unload tenure + * This feature is only applicable for first connection only + */ + if(pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable) + { + pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable + = VOS_FALSE; } } #endif @@ -15032,6 +15424,8 @@ eHalStatus csrSendMBStatsReqMsg( tpAniSirGlobal pMac, tANI_U32 statsMask, tANI_U { tAniGetPEStatsReq *pMsg; eHalStatus status = eHAL_STATUS_SUCCESS; + tSirMsgQ msgQ; + pMsg = vos_mem_malloc(sizeof(tAniGetPEStatsReq)); if ( NULL == pMsg ) { @@ -15039,14 +15433,20 @@ eHalStatus csrSendMBStatsReqMsg( tpAniSirGlobal pMac, tANI_U32 statsMask, tANI_U return eHAL_STATUS_FAILURE; } // need to initiate a stats request to PE - pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GET_STATISTICS_REQ); + pMsg->msgType = pal_cpu_to_be16((tANI_U16)WDA_GET_STATISTICS_REQ); pMsg->msgLen = (tANI_U16)sizeof(tAniGetPEStatsReq); pMsg->staId = staId; pMsg->statsMask = statsMask; - status = palSendMBMessage(pMac->hHdd, pMsg ); + + msgQ.type = WDA_GET_STATISTICS_REQ; + msgQ.reserved = 0; + msgQ.bodyptr = pMsg; + msgQ.bodyval = 0; + status = wdaPostCtrlMsg(pMac, &msgQ); if(!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOG1, FL("Failed to send down the stats req ")); + vos_mem_free(pMsg); } return status; } @@ -16032,6 +16432,59 @@ csrRoamScanOffloadPrepareProbeReqTemplate(tpAniSirGlobal pMac, return eSIR_SUCCESS; } +/* + * Below Table describe whether RSO command can be send down to fimrware or not. + * Host check it on the basis of previous RSO command sent down to firmware. +||===========================================================================|| +|| New cmd | LAST SENT COMMAND ---> || +||====|======================================================================|| +|| V | RSO_START | RSO_STOP | RSO_RESTART | RSO_UPDATE_CFG || +|| --------------------------------------------------------------------------|| +|| RSO_START | NO | YES | NO | NO || +|| RSO_STOP | YES | YES | YES | YES || +|| RSO_RESTART | YES | NO | NO | YES || +|| RSO_UPDATE_CFG | YES | NO | YES | YES || +||===========================================================================|| +*/ + +#define RSO_START_BIT (1<roam.neighborRoamInfo; + tANI_U8 desiredMask = 0; + switch(command) + { + case ROAM_SCAN_OFFLOAD_START: + desiredMask = RSO_START_ALLOW_MASK; + break; + case ROAM_SCAN_OFFLOAD_STOP: + desiredMask = RSO_STOP_ALLOW_MASK; + break; + case ROAM_SCAN_OFFLOAD_RESTART: + desiredMask = RSO_RESTART_ALLOW_MASK; + break; + case ROAM_SCAN_OFFLOAD_UPDATE_CFG: + desiredMask = RSO_UPDATE_CFG_ALLOW_MASK; + break; + default: + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Wrong RSO command %d, not allowed"), command); + return 0;/*Cmd Not allowed*/ + } + return ( desiredMask & ( 1 << pNeighborRoamInfo->lastSentCmd) ); +} + eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reason) { vos_msg_t msg; @@ -16040,7 +16493,7 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas tCsrRoamSession *pSession; tANI_U8 i,j,num_channels = 0, ucDot11Mode; tANI_U8 *ChannelList = NULL; - tANI_U32 sessionId; + tANI_U32 sessionId = 0; eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrChannelInfo currChannelListInfo; tANI_U32 host_channels = 0; @@ -16081,18 +16534,25 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas return eHAL_STATUS_FAILURE; } + if (!CsrIsRSOCommandAllowed(pMac, command)) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("RSO command %d lastSentCmd %d, RSO is out of sync in HOST-FWR"), + command, pNeighborRoamInfo->lastSentCmd); + return eHAL_STATUS_FAILURE; + } + /* We dont need psession during ROAM_SCAN_OFFLOAD_STOP * Also there are cases where pNeighborRoamInfo->currAPbssid * is set to 0 during disconnect and so we might return without stopping * the roam scan. So no need to find the session if command is * ROAM_SCAN_OFFLOAD_STOP. */ + status = csrRoamGetSessionIdFromBSSID(pMac, + (tCsrBssid *)pNeighborRoamInfo->currAPbssid, + &sessionId); if( ROAM_SCAN_OFFLOAD_STOP != command ) { - status = csrRoamGetSessionIdFromBSSID(pMac, - (tCsrBssid *)pNeighborRoamInfo->currAPbssid, - &sessionId); - if ( !HAL_STATUS_SUCCESS( status ) ) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -16129,6 +16589,7 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas if(command == ROAM_SCAN_OFFLOAD_STOP) { pRequestBuf->RoamScanOffloadEnabled = 0; + pRequestBuf->StartScanReason = reason; /*For a STOP Command, there is no need to * go through filling up all the below parameters * since they are not required for the STOP command*/ @@ -16342,9 +16803,10 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas ((eCSR_BAND_5G == eBand) && CSR_IS_CHANNEL_5GHZ(*ChannelList)) || (eCSR_BAND_ALL == eBand)) { - if(!CSR_IS_CHANNEL_DFS(*ChannelList) && - csrRoamIsChannelValid(pMac, *ChannelList) && - *ChannelList && (num_channels < SIR_ROAM_MAX_CHANNELS)) + if(*ChannelList && csrRoamIsChannelValid(pMac, *ChannelList) && + ((pMac->roam.configParam.allowDFSChannelRoam) || + (!CSR_IS_CHANNEL_DFS(*ChannelList))) && + (num_channels < SIR_ROAM_MAX_CHANNELS)) { pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList; } @@ -16360,9 +16822,9 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas for(i=0; iscan.occupiedChannels.numChannels; i++) { /*Allow DFS channels only if the DFS channel roam flag is enabled */ - if(((pMac->roam.configParam.allowDFSChannelRoam) || + if(*ChannelList && ((pMac->roam.configParam.allowDFSChannelRoam) || (!CSR_IS_CHANNEL_DFS(*ChannelList))) && - *ChannelList && (num_channels < SIR_ROAM_MAX_CHANNELS)) + (num_channels < SIR_ROAM_MAX_CHANNELS)) { pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList; } @@ -16393,19 +16855,21 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas ChannelList = currChannelListInfo->ChannelList; for (i=0;inumOfChannels;i++) { - if(((pMac->roam.configParam.allowDFSChannelRoam) || - (!CSR_IS_CHANNEL_DFS(*ChannelList))) && *ChannelList) - { - pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList; - } - ChannelList++; + if(*ChannelList && ((pMac->roam.configParam.allowDFSChannelRoam) || + (!CSR_IS_CHANNEL_DFS(*ChannelList)))) + { + pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = + *ChannelList; + } + ChannelList++; } pRequestBuf->ConnectedNetwork.ChannelCount = num_channels; pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; } } #endif - for (i = 0, j = 0;j < (sizeof(ChannelCacheStr)/sizeof(ChannelCacheStr[0])) && i < pRequestBuf->ConnectedNetwork.ChannelCount; i++) + for (i = 0, j = 0;j < (sizeof(ChannelCacheStr)/sizeof(ChannelCacheStr[0])) + && i < pRequestBuf->ConnectedNetwork.ChannelCount; i++) { if (j < sizeof(ChannelCacheStr)) { @@ -16441,8 +16905,8 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas } for(i=0; iroam.numValidChannels; i++) { - if(((pMac->roam.configParam.allowDFSChannelRoam) || - (!CSR_IS_CHANNEL_DFS(*ChannelList))) && *ChannelList) + if(*ChannelList && ((pMac->roam.configParam.allowDFSChannelRoam) || + (!CSR_IS_CHANNEL_DFS(*ChannelList)))) { pRequestBuf->ValidChannelList[num_channels++] = *ChannelList; } @@ -16483,6 +16947,8 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas msg.type = WDA_ROAM_SCAN_OFFLOAD_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_ROAM_SCAN_OFFLOAD_REQ message to WDA", __func__); @@ -16495,6 +16961,9 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas bRoamScanOffloadStarted = VOS_TRUE; else if (ROAM_SCAN_OFFLOAD_STOP == command) bRoamScanOffloadStarted = VOS_FALSE; + + /*update the last sent cmd*/ + pNeighborRoamInfo->lastSentCmd = command; } VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "Roam Scan Offload Command %d, Reason %d", command, reason); @@ -17016,6 +17485,12 @@ eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, reason = eSME_FULL_PWR_NEEDED_BY_TDLS_PEER_SETUP; } #endif + else if (eSmeCommandDelStaSession == pCommand->command) + { + //need full power for all + fNeedFullPower = eANI_BOOLEAN_TRUE; + } + break; case REQUEST_STOP_UAPSD: case REQUEST_EXIT_WOWL: @@ -17103,6 +17578,13 @@ void csrReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand) eHalStatus csrQueueSmeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fHighPriority ) { eHalStatus status; + + if (!SME_IS_START(pMac)) + { + smsLog( pMac, LOGE, FL("Sme in stop state")); + return eHAL_STATUS_FAILURE; + } + if( (eSmeCommandScan == pCommand->command) && pMac->scan.fDropScanCmd ) { smsLog(pMac, LOGW, FL(" drop scan (scan reason %d) command"), @@ -17342,16 +17824,18 @@ void csrRoamFTPreAuthRspProcessor( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuth { sme_QosCsrEventInd(pMac, pMac->ft.ftSmeContext.smeSessionId, SME_QOS_CSR_PREAUTH_SUCCESS_IND, NULL); } -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_CACHE_ROAM_DELAY_DATA, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_CACHE_ROAM_DELAY_DATA, NULL, 0); + } /* Start the pre-auth reassoc interval timer with a period of 400ms. When this expires, * actual transition from the current to handoff AP is triggered */ status = vos_timer_start(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer, 60); -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_SME_PREAUTH_REASSOC_START, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_SME_PREAUTH_REASSOC_START, NULL, 0); + } if (eHAL_STATUS_SUCCESS != status) { smsLog(pMac, LOGE, FL("Preauth reassoc interval timer start failed to start with status %d"), status); @@ -17755,3 +18239,30 @@ void csrDisableDfsChannel(tpAniSirGlobal pMac) csrApplyChannelPowerCountryInfo( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent, eANI_BOOLEAN_TRUE); } + +/* --------------------------------------------------------------------------- + \fn csrGetStaticUapsdMask + \brief This function will get the static uapsd settings for an existing + \ Infra session. + \param pMac - pMac global structure + \- return void + -------------------------------------------------------------------------*/ +void csrGetStaticUapsdMask(tpAniSirGlobal pMac, tANI_U8 *staticUapsdMask) +{ + tANI_S8 sessionId; + tCsrRoamSession *pSession = NULL; + + *staticUapsdMask = 0; + sessionId = csrGetInfraSessionId(pMac); + if(sessionId == -1) + smsLog(pMac, LOGE, FL("Valid session not present.")); + else + pSession = CSR_GET_SESSION(pMac, sessionId); + + if(!pSession || !pSession->pCurRoamProfile) + smsLog(pMac, LOGE, FL("Either pSession or Roam profile is NULL," + " pSession:%pK"), pSession); + else + *staticUapsdMask = pSession->pCurRoamProfile->uapsd_mask; +} + diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c b/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c index c6a36685fc3a..d24c4d13ffe2 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -119,8 +119,7 @@ tCsrIgnoreChannels countryIgnoreList[MAX_COUNTRY_IGNORE] = { }; extern tSirRetStatus wlan_cfgGetStr(tpAniSirGlobal, tANI_U16, tANI_U8*, tANI_U32*); void csrScanGetResultTimerHandler(void *); -void csrScanResultAgingTimerHandler(void *pv); -static void csrScanResultCfgAgingTimerHandler(void *pv); +static void csrPurgeScanResultByAge(void *pv); void csrScanIdleScanTimerHandler(void *); static void csrSetDefaultScanTiming( tpAniSirGlobal pMac, tSirScanType scanType, tCsrScanRequest *pScanRequest); #ifdef WLAN_AP_STA_CONCURRENCY @@ -230,19 +229,6 @@ eHalStatus csrScanOpen( tpAniSirGlobal pMac ) smsLog(pMac, LOGE, FL("cannot allocate memory for idleScan timer")); break; } - status = vos_timer_init(&pMac->scan.hTimerResultAging, VOS_TIMER_TYPE_SW, csrScanResultAgingTimerHandler, pMac); - if (!HAL_STATUS_SUCCESS(status)) - { - smsLog(pMac, LOGE, FL("cannot allocate memory for ResultAging timer")); - break; - } - status = vos_timer_init(&pMac->scan.hTimerResultCfgAging, VOS_TIMER_TYPE_SW, - csrScanResultCfgAgingTimerHandler, pMac); - if (!HAL_STATUS_SUCCESS(status)) - { - smsLog(pMac, LOGE, FL("cannot allocate memory for CFG ResultAging timer")); - break; - } }while(0); return (status); @@ -266,8 +252,6 @@ eHalStatus csrScanClose( tpAniSirGlobal pMac ) csrLLClose(&pMac->scan.channelPowerInfoList24); csrLLClose(&pMac->scan.channelPowerInfoList5G); csrScanDisable(pMac); - vos_timer_destroy(&pMac->scan.hTimerResultAging); - vos_timer_destroy(&pMac->scan.hTimerResultCfgAging); vos_timer_destroy(&pMac->scan.hTimerGetResult); #ifdef WLAN_AP_STA_CONCURRENCY vos_timer_destroy(&pMac->scan.hTimerStaApConcTimer); @@ -470,7 +454,7 @@ eHalStatus csrQueueScanRequest( tpAniSirGlobal pMac, tSmeCmd *pScanCmd ) pChnInfo->numOfChannels = pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.numOfChannels - nNumChanCombinedConc; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, - FL(" &channelToScan %p pScanCmd(%p) pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.ChannelList(%p)numChn(%d)"), + FL(" &channelToScan %pK pScanCmd(%pK) pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.ChannelList(%pK)numChn(%d)"), &channelToScan[0], pScanCmd, pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.ChannelList, numChn); @@ -811,6 +795,23 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, "dwell time for first scan %u"), scanReq.maxChnTime); } + if (!(pScanRequest->p2pSearch) + &&(pScanRequest->ChannelInfo.numOfChannels + < pMac->roam.configParam. + max_chan_for_dwell_time_cfg)) + { + pScanRequest->maxChnTime = + pScanRequest->maxChnTime << 1; + pScanRequest->minChnTime = + pScanRequest->minChnTime << 1; + smsLog(pMac, LOG1, + FL("Double ChnTime (Max=%d Min=%d) numOfChannels=%d max_chan_for_dwell_time_cfg=%d"), + pScanRequest->maxChnTime, + pScanRequest->minChnTime, + pScanRequest->ChannelInfo.numOfChannels, + pMac->roam.configParam. + max_chan_for_dwell_time_cfg); + } status = csrScanCopyRequest(pMac, &p11dScanCmd->u.scanCmd.u.scanRequest, &scanReq); //Free the channel list @@ -871,6 +872,19 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, pScanRequest->maxChnTime); } + if (!(pScanRequest->p2pSearch) + && (pScanRequest->ChannelInfo.numOfChannels + < pMac->roam.configParam.max_chan_for_dwell_time_cfg)) + { + pScanRequest->maxChnTime = pScanRequest->maxChnTime << 1; + pScanRequest->minChnTime = pScanRequest->minChnTime << 1; + smsLog(pMac, LOG1, + FL("Double ChnTime (Max=%d Min=%d) numOfChannels=%d max_chan_for_dwell_time_cfg=%d"), + pScanRequest->maxChnTime, + pScanRequest->minChnTime, + pScanRequest->ChannelInfo.numOfChannels, + pMac->roam.configParam.max_chan_for_dwell_time_cfg); + } status = csrScanCopyRequest(pMac, &pScanCmd->u.scanCmd.u.scanRequest, pScanRequest); if(HAL_STATUS_SUCCESS(status)) { @@ -1142,8 +1156,7 @@ eHalStatus csrIssueRoamAfterLostlinkScan(tpAniSirGlobal pMac, tANI_U32 sessionId } -eHalStatus csrScanGetScanChnInfo(tpAniSirGlobal pMac, tANI_U8 sessionId, - void *pContext, void *callback) +eHalStatus csrScanGetScanChnInfo(tpAniSirGlobal pMac, tSmeCmd *pCommand) { eHalStatus status = eHAL_STATUS_SUCCESS; tSmeCmd *pScanCmd; @@ -1155,12 +1168,20 @@ eHalStatus csrScanGetScanChnInfo(tpAniSirGlobal pMac, tANI_U8 sessionId, { pScanCmd->command = eSmeCommandScan; vos_mem_set(&pScanCmd->u.scanCmd, sizeof(tScanCmd), 0); - pScanCmd->u.scanCmd.callback = callback; - pScanCmd->u.scanCmd.pContext = pContext; pScanCmd->u.scanCmd.reason = eCsrScanGetScanChnInfo; //Need to make the following atomic pScanCmd->u.scanCmd.scanID = pMac->scan.nextScanID++; //let it wrap around - pScanCmd->sessionId = sessionId; + pScanCmd->sessionId = pCommand->sessionId; + if( pCommand->u.scanCmd.reason == eCsrScanUserRequest) + { + pScanCmd->u.scanCmd.callback = NULL; + pScanCmd->u.scanCmd.pContext = NULL; + } else { + pScanCmd->u.scanCmd.callback = pCommand->u.scanCmd.callback; + pScanCmd->u.scanCmd.pContext = pCommand->u.scanCmd.pContext; + pScanCmd->u.scanCmd.abortScanIndication = + pCommand->u.scanCmd.abortScanIndication; + } status = csrQueueSmeCommand(pMac, pScanCmd, eANI_BOOLEAN_FALSE); if( !HAL_STATUS_SUCCESS( status ) ) { @@ -2056,6 +2077,35 @@ static void csrScanAddToOccupiedChannels( } } } + +void csrAddChannelToOccupiedChannelList(tpAniSirGlobal pMac, + tANI_U8 channel) +{ + eHalStatus status; + tCsrChannel *pOccupiedChannels = &pMac->scan.occupiedChannels; + tANI_U8 numOccupiedChannels = pOccupiedChannels->numChannels; + tANI_U8 *pOccupiedChannelList = pOccupiedChannels->channelList; + if (!csrIsChannelPresentInList(pOccupiedChannelList, + numOccupiedChannels, channel)) + { + status = csrAddToChannelListFront(pOccupiedChannelList, + numOccupiedChannels, channel); + if(HAL_STATUS_SUCCESS(status)) + { + pOccupiedChannels->numChannels++; + smsLog(pMac, LOG2, FL("added channel %d to the list (count=%d)"), + channel, pOccupiedChannels->numChannels); + if (pOccupiedChannels->numChannels > + CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN) + { + pOccupiedChannels->numChannels = + CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN; + smsLog(pMac, LOG2, + FL("trim no of Channels for Occ channel list")); + } + } + } +} #endif //Put the BSS into the scan result list @@ -2552,6 +2602,80 @@ eHalStatus csrScanFilterResults(tpAniSirGlobal pMac) csrFreeScanResultEntry( pMac, pBssDesc ); } } + pEntry = pTempEntry; + } + + pEntry = csrLLPeekHead( &pMac->scan.tempScanResults, LL_ACCESS_LOCK ); + while( pEntry ) + { + pBssDesc = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); + pTempEntry = csrLLNext( &pMac->scan.tempScanResults, pEntry, + LL_ACCESS_LOCK ); + if(csrCheck11dChannel(pBssDesc->Result.BssDescriptor.channelId, + pMac->roam.validChannelList, len)) + { + /* Remove Scan result which does not have 11d channel */ + if( csrLLRemoveEntry( &pMac->scan.tempScanResults, pEntry, + LL_ACCESS_LOCK )) + { + csrFreeScanResultEntry( pMac, pBssDesc ); + } + } + else + { + smsLog( pMac, LOG1, FL("%d is a Valid channel"), + pBssDesc->Result.BssDescriptor.channelId); + } + pEntry = pTempEntry; + } + return status; +} + +/** + * csrScanFilterDFSResults + * + *FUNCTION: + * This function filter BSSIDs on DFS channels from the scan results. + * + *LOGIC: + * Get scan result from scan list and Check Scan result channel number + * with 11d channel list if channel number is found in 11d channel list + * and if fEnableDFSChnlScan is zero and if channel is DFS, then + * remove scan result entry from scan list + * + *ASSUMPTIONS: + * + *NOTE: + * + * @param pMac Pointer to Global MAC structure + * + * @return Status + */ + +eHalStatus csrScanFilterDFSResults(tpAniSirGlobal pMac) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tListElem *pEntry,*pTempEntry; + tCsrScanResult *pBssDesc; + + pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_LOCK ); + while( pEntry ) + { + pBssDesc = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); + pTempEntry = csrLLNext( &pMac->scan.scanResultList, pEntry, + LL_ACCESS_LOCK ); + if((pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_DISABLED) && + CSR_IS_CHANNEL_DFS(pBssDesc->Result.BssDescriptor.channelId)) + { + smsLog( pMac, LOG1, FL("%d is a DFS ch filtered from scan list"), + pBssDesc->Result.BssDescriptor.channelId); + /* Remove Scan result which does not have 11d channel */ + if( csrLLRemoveEntry( &pMac->scan.scanResultList, pEntry, + LL_ACCESS_LOCK )) + { + csrFreeScanResultEntry( pMac, pBssDesc ); + } + } else { smsLog( pMac, LOG1, FL("%d is a Valid channel"), @@ -2566,9 +2690,12 @@ eHalStatus csrScanFilterResults(tpAniSirGlobal pMac) pBssDesc = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); pTempEntry = csrLLNext( &pMac->scan.tempScanResults, pEntry, LL_ACCESS_LOCK ); - if(csrCheck11dChannel(pBssDesc->Result.BssDescriptor.channelId, - pMac->roam.validChannelList, len)) + + if((pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_DISABLED) && + CSR_IS_CHANNEL_DFS(pBssDesc->Result.BssDescriptor.channelId)) { + smsLog( pMac, LOG1, FL("%d is a DFS ch filtered from scan list"), + pBssDesc->Result.BssDescriptor.channelId); /* Remove Scan result which does not have 11d channel */ if( csrLLRemoveEntry( &pMac->scan.tempScanResults, pEntry, LL_ACCESS_LOCK )) @@ -2717,6 +2844,10 @@ eHalStatus csrScanningStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) vos_mem_copy(pRoamInfo->peerMac, pUpperLayerAssocCnf->peerMacAddr, sizeof(tSirMacAddr)); vos_mem_copy(&pRoamInfo->bssid, pUpperLayerAssocCnf->bssId, sizeof(tCsrBssid)); pRoamInfo->wmmEnabledSta = pUpperLayerAssocCnf->wmmEnabledSta; +#ifdef WLAN_FEATURE_AP_HT40_24G + pRoamInfo->HT40MHzIntoEnabledSta = + pUpperLayerAssocCnf->HT40MHzIntoEnabledSta; +#endif if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) ) { pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED; @@ -3058,7 +3189,7 @@ static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reaso { pBssDescription = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); - smsLog( pMac, LOGW, "...Bssid= "MAC_ADDRESS_STR" chan= %d, rssi = -%d", + smsLog( pMac, LOG2, "...Bssid= "MAC_ADDRESS_STR" chan= %d, rssi = -%d", MAC_ADDR_ARRAY(pBssDescription->Result.BssDescriptor.bssId), pBssDescription->Result.BssDescriptor.channelId, pBssDescription->Result.BssDescriptor.rssi * (-1) ); @@ -3146,6 +3277,7 @@ static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reaso } } + pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_LOCK ); //we don't need to update CC while connected to an AP which is advertising CC already if (csrIs11dSupported(pMac)) { @@ -3199,6 +3331,7 @@ static tCsrScanResult *csrScanSaveBssDescription( tpAniSirGlobal pMac, tSirBssDe tCsrScanResult *pCsrBssDescription = NULL; tANI_U32 cbBSSDesc; tANI_U32 cbAllocated; + tListElem *pEntry; // figure out how big the BSS description is (the BSSDesc->length does NOT // include the size of the length field itself). @@ -3216,6 +3349,7 @@ static tCsrScanResult *csrScanSaveBssDescription( tpAniSirGlobal pMac, tSirBssDe VOS_ASSERT( pCsrBssDescription->Result.pvIes == NULL ); #endif csrScanAddResult(pMac, pCsrBssDescription, pIes); + pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_LOCK ); } return( pCsrBssDescription ); @@ -3402,7 +3536,6 @@ void csrApplyPower2Current( tpAniSirGlobal pMac ) void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannelList, tANI_U8 *countryCode, tANI_BOOLEAN updateRiva) { int i, j, count, countryIndex = -1; - eNVChannelEnabledType channelEnabledType; tANI_U8 numChannels = 0; tANI_U8 tempNumChannels = 0; tANI_U8 channelIgnore = FALSE; @@ -3420,39 +3553,26 @@ void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannel } } tempNumChannels = CSR_MIN(pChannelList->numChannels, WNI_CFG_VALID_CHANNEL_LIST_LEN); - /* If user doesn't want to scan the DFS channels lets trim them from - the valid channel list*/ + for(i=0; i < tempNumChannels; i++) { channelIgnore = FALSE; - if( FALSE == pMac->scan.fEnableDFSChnlScan ) - { - channelEnabledType = - vos_nv_getChannelEnabledState(pChannelList->channelList[i]); - } - else + if( countryIndex != -1 ) { - channelEnabledType = NV_CHANNEL_ENABLE; - } - if( NV_CHANNEL_ENABLE == channelEnabledType ) - { - if( countryIndex != -1 ) + for(j=0; j < countryIgnoreList[countryIndex].channelCount; j++) { - for(j=0; j < countryIgnoreList[countryIndex].channelCount; j++) + if( pChannelList->channelList[i] == + countryIgnoreList[countryIndex].channelList[j] ) { - if( pChannelList->channelList[i] == - countryIgnoreList[countryIndex].channelList[j] ) - { - channelIgnore = TRUE; - break; - } + channelIgnore = TRUE; + break; } } - if( FALSE == channelIgnore ) - { - ChannelList.channelList[numChannels] = pChannelList->channelList[i]; - numChannels++; - } + } + if( FALSE == channelIgnore ) + { + ChannelList.channelList[numChannels] = pChannelList->channelList[i]; + numChannels++; } } ChannelList.numChannels = numChannels; @@ -3479,6 +3599,30 @@ void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannel csrSetCfgCountryCode(pMac, countryCode); } +void csrUpdateFCCChannelList(tpAniSirGlobal pMac) +{ + tCsrChannel ChannelList; + tANI_U8 chnlIndx = 0; + int i; + + for ( i = 0; i < pMac->scan.base20MHzChannels.numChannels; i++ ) + { + if (pMac->scan.fcc_constraint && + ((pMac->scan.base20MHzChannels.channelList[i] == 12) || + (pMac->scan.base20MHzChannels.channelList[i] == 13))) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + FL("removing channel %d"), + pMac->scan.base20MHzChannels.channelList[i]); + continue; + } + ChannelList.channelList[chnlIndx] = + pMac->scan.base20MHzChannels.channelList[i]; + chnlIndx++; + } + csrSetCfgValidChannelList(pMac, ChannelList.channelList, chnlIndx); + +} void csrResetCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce, tANI_BOOLEAN updateRiva ) { @@ -4461,7 +4605,8 @@ tANI_BOOLEAN csrScanComplete( tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp ) //This check only valid here because csrSaveScanresults is not yet called fSuccess = (!csrLLIsListEmpty(&pMac->scan.tempScanResults, LL_ACCESS_LOCK)); } - if (pCommand->u.scanCmd.abortScanDueToBandChange) + if (pCommand->u.scanCmd.abortScanIndication & + eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE) { /* * Scan aborted due to band change @@ -4479,8 +4624,6 @@ tANI_BOOLEAN csrScanComplete( tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp ) smsLog(pMac, LOG1, FL("11d_scan_done will flush the scan" " results")); } - pCommand->u.scanCmd.abortScanDueToBandChange - = eANI_BOOLEAN_FALSE; } csrSaveScanResults(pMac, pCommand->u.scanCmd.reason); @@ -5133,6 +5276,9 @@ eHalStatus csrScanSmeScanResponse( tpAniSirGlobal pMac, void *pMsgBuf ) pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); if ( eSmeCommandScan == pCommand->command ) { + /* Purge the scan results based on Aging */ + if (pEntry && pMac->scan.scanResultCfgAgingTime) + csrPurgeScanResultByAge(pMac); scanStatus = (eSIR_SME_SUCCESS == pScanRsp->statusCode) ? eCSR_SCAN_SUCCESS : eCSR_SCAN_FAILURE; reason = pCommand->u.scanCmd.reason; switch(pCommand->u.scanCmd.reason) @@ -5164,26 +5310,14 @@ eHalStatus csrScanSmeScanResponse( tpAniSirGlobal pMac, void *pMsgBuf ) { //Not to get channel info if the scan is not a wildcard scan because //it may cause scan results got aged out incorrectly. - if( csrScanIsWildCardScan( pMac, pCommand ) && (!pCommand->u.scanCmd.u.scanRequest.p2pSearch) + if(csrScanIsWildCardScan( pMac, pCommand ) && + (!pCommand->u.scanCmd.u.scanRequest.p2pSearch) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD && (pCommand->u.scanCmd.reason != eCsrScanGetLfrResult) #endif ) { - //Get the list of channels scanned - if( pCommand->u.scanCmd.reason != eCsrScanUserRequest) - { - csrScanGetScanChnInfo(pMac, pCommand->sessionId, - NULL, NULL); - } - else - { - csrScanGetScanChnInfo(pMac, - pCommand->sessionId, - pCommand->u.scanCmd.pContext, - pCommand->u.scanCmd.callback); - pCommand->u.scanCmd.callback = NULL; - } + csrScanGetScanChnInfo(pMac, pCommand); } } break; @@ -5397,6 +5531,28 @@ eHalStatus csrScanAgeResults(tpAniSirGlobal pMac, tSmeGetScanChnRsp *pScanChnInf return (status); } +eHalStatus csrIbssAgeBss(tpAniSirGlobal pMac) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tListElem *pEntry, *tmpEntry; + tCsrScanResult *pResult; + + csrLLLock(&pMac->scan.scanResultList); + pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK ); + while( pEntry ) + { + tmpEntry = csrLLNext(&pMac->scan.scanResultList, + pEntry, LL_ACCESS_NOLOCK); + pResult = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); + + smsLog(pMac, LOGW, FL(" age out due Forced IBSS leave")); + csrScanAgeOutBss(pMac, pResult); + pEntry = tmpEntry; + } + csrLLUnlock(&pMac->scan.scanResultList); + + return (status); +} eHalStatus csrSendMBScanReq( tpAniSirGlobal pMac, tANI_U16 sessionId, tCsrScanRequest *pScanReq, tScanReqParam *pScanReqParam ) @@ -5765,7 +5921,26 @@ eHalStatus csrScanRetrieveResult(tpAniSirGlobal pMac, tSmeCmd *pCommand) return (status); } +eHalStatus csrProcessMacAddrSpoofCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) +{ + tSirSpoofMacAddrReq *pMsg; + tANI_U16 msgLen; + eHalStatus status = eHAL_STATUS_FAILURE; + do { + msgLen = sizeof(tSirSpoofMacAddrReq); + pMsg = vos_mem_malloc(msgLen); + if ( NULL == pMsg ) + return eHAL_STATUS_FAILURE; + pMsg->messageType= pal_cpu_to_be16((tANI_U16)eWNI_SME_MAC_SPOOF_ADDR_IND); + pMsg->length= pal_cpu_to_be16(msgLen); + // spoof mac address + vos_mem_copy((tANI_U8 *)pMsg->macAddr, + (tANI_U8 *)pCommand->u.macAddrSpoofCmd.macAddr, sizeof(tSirMacAddr)); + status = palSendMBMessage(pMac->hHdd, pMsg); + } while( 0 ); + return( status ); +} eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) { @@ -6016,19 +6191,12 @@ eHalStatus csrScanBGScanEnable(tpAniSirGlobal pMac) break; } }while(0); - //BG scan results are reported automatically by PE to SME once the scan is done. - //No need to fetch the results explicitly. - //csrScanStartGetResultTimer(pMac); - csrScanStartResultAgingTimer(pMac); } else { - //We don't have BG scan so stop the aging timer - csrScanStopResultAgingTimer(pMac); - smsLog(pMac, LOGE, FL("cannot continue because the bgscan interval is 0")); - status = eHAL_STATUS_INVALID_PARAMETER; + smsLog(pMac, LOGE, FL("cannot continue because the bgscan interval is 0")); + status = eHAL_STATUS_INVALID_PARAMETER; } - return (status); } @@ -6103,6 +6271,16 @@ eHalStatus csrScanCopyRequest(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq, tCs /* Skip CH 144 if firmware support not present */ if (pSrcReq->ChannelInfo.ChannelList[index] == 144 && !ch144_support) continue; + /* Skip channel 12 and 13 when FCC constraint is true */ + if ((pMac->scan.fcc_constraint) && + ((pSrcReq->ChannelInfo.ChannelList[index] ==12) || + (pSrcReq->ChannelInfo.ChannelList[index] ==13))) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + FL("Ignoring channel : %d "), + pSrcReq->ChannelInfo.ChannelList[index]); + continue; + } NVchannel_state = vos_nv_getChannelEnabledState( pSrcReq->ChannelInfo.ChannelList[index]); @@ -6124,10 +6302,15 @@ eHalStatus csrScanCopyRequest(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq, tCs /* Since in CsrScanRequest,value of pMac->scan.nextScanID * is incremented before calling CsrScanCopyRequest, as a * result pMac->scan.nextScanID is equal to ONE for the - * first scan. + * first scan. If number of channels is less than + * max chan for dwell time no need to skip dfs + * in first scan as anyway few channels will be scanned and + * it will not take much time to display results on GUI. */ - if ((pMac->roam.configParam.initialScanSkipDFSCh && - 1 == pMac->scan.nextScanID) ||(pMac->miracast_mode)) + if (((pSrcReq->ChannelInfo.numOfChannels >= + pMac->roam.configParam.max_chan_for_dwell_time_cfg) && + (pMac->roam.configParam.initialScanSkipDFSCh && + 1 == pMac->scan.nextScanID)) ||(pMac->miracast_mode)) { smsLog(pMac, LOG1, FL("Initial scan, scan only non-DFS channels")); @@ -6165,7 +6348,9 @@ eHalStatus csrScanCopyRequest(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq, tCs */ if ( ( csrRoamIsValidChannel(pMac, pSrcReq->ChannelInfo.ChannelList[index]) ) ) { - if( (pSrcReq->skipDfsChnlInP2pSearch && + if( ((pSrcReq->skipDfsChnlInP2pSearch || + (pMac->scan.fEnableDFSChnlScan == + DFS_CHNL_SCAN_DISABLED)) && (NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(pSrcReq->ChannelInfo.ChannelList[index])) ) #ifdef FEATURE_WLAN_LFR /* @@ -6312,6 +6497,10 @@ void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus { if(pCommand->u.scanCmd.callback) { + if (pCommand->u.scanCmd.abortScanIndication){ + smsLog( pMac, LOG1, FL("scanDone due to abort")); + scanStatus = eCSR_SCAN_ABORT; + } // sme_ReleaseGlobalLock( &pMac->sme ); pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, pCommand->u.scanCmd.scanID, scanStatus); // sme_AcquireGlobalLock( &pMac->sme ); @@ -6323,14 +6512,8 @@ void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus void csrScanStopTimers(tpAniSirGlobal pMac) { - csrScanStopResultAgingTimer(pMac); csrScanStopIdleScanTimer(pMac); csrScanStopGetResultTimer(pMac); - if(0 != pMac->scan.scanResultCfgAgingTime ) - { - csrScanStopResultCfgAgingTimer(pMac); - } - } @@ -6505,38 +6688,6 @@ static void csrStaApConcTimerHandler(void *pv) } #endif -eHalStatus csrScanStartResultAgingTimer(tpAniSirGlobal pMac) -{ - eHalStatus status = eHAL_STATUS_FAILURE; - - if(pMac->scan.fScanEnable) - { - status = vos_timer_start(&pMac->scan.hTimerResultAging, CSR_SCAN_RESULT_AGING_INTERVAL/PAL_TIMER_TO_MS_UNIT); - } - return (status); -} - -eHalStatus csrScanStartResultCfgAgingTimer(tpAniSirGlobal pMac) -{ - eHalStatus status = eHAL_STATUS_FAILURE; - - if(pMac->scan.fScanEnable) - { - status = vos_timer_start(&pMac->scan.hTimerResultCfgAging, CSR_SCAN_RESULT_CFG_AGING_INTERVAL/PAL_TIMER_TO_MS_UNIT); - } - return (status); -} - -eHalStatus csrScanStopResultAgingTimer(tpAniSirGlobal pMac) -{ - return (vos_timer_stop(&pMac->scan.hTimerResultAging)); -} - -eHalStatus csrScanStopResultCfgAgingTimer(tpAniSirGlobal pMac) -{ - return (vos_timer_stop(&pMac->scan.hTimerResultCfgAging)); -} - //This function returns the maximum time a BSS is allowed in the scan result. //The time varies base on connection and power saving factors. //Not connected, No PS @@ -6600,43 +6751,7 @@ tANI_U32 csrScanGetAgeOutTime(tpAniSirGlobal pMac) return (nRet); } - -void csrScanResultAgingTimerHandler(void *pv) -{ - tpAniSirGlobal pMac = PMAC_STRUCT( pv ); - tANI_BOOLEAN fDisconnected = csrIsAllSessionDisconnected(pMac); - - //no scan, no aging - if (pMac->scan.fScanEnable && - (((eANI_BOOLEAN_FALSE == fDisconnected) && pMac->roam.configParam.bgScanInterval) - || (fDisconnected && (pMac->scan.fCancelIdleScan == eANI_BOOLEAN_FALSE)) - || (pMac->fScanOffload)) - ) - { - tListElem *pEntry, *tmpEntry; - tCsrScanResult *pResult; - tANI_TIMESTAMP ageOutTime = (tANI_TIMESTAMP)(csrScanGetAgeOutTime(pMac) * PAL_TICKS_PER_SECOND); //turn it into 10ms units - tANI_TIMESTAMP curTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); - - csrLLLock(&pMac->scan.scanResultList); - pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK ); - while( pEntry ) - { - tmpEntry = csrLLNext(&pMac->scan.scanResultList, pEntry, LL_ACCESS_NOLOCK); - pResult = GET_BASE_ADDR( pEntry, tCsrScanResult, Link ); - if((curTime - pResult->Result.BssDescriptor.nReceivedTime) > ageOutTime) - { - smsLog(pMac, LOGW, " age out due to time out"); - csrScanAgeOutBss(pMac, pResult); - } - pEntry = tmpEntry; - } - csrLLUnlock(&pMac->scan.scanResultList); - } - vos_timer_start(&pMac->scan.hTimerResultAging, CSR_SCAN_RESULT_AGING_INTERVAL/PAL_TIMER_TO_MS_UNIT); -} - -static void csrScanResultCfgAgingTimerHandler(void *pv) +static void csrPurgeScanResultByAge(void *pv) { tpAniSirGlobal pMac = PMAC_STRUCT( pv ); tListElem *pEntry, *tmpEntry; @@ -6658,7 +6773,6 @@ static void csrScanResultCfgAgingTimerHandler(void *pv) pEntry = tmpEntry; } csrLLUnlock(&pMac->scan.scanResultList); - vos_timer_start(&pMac->scan.hTimerResultCfgAging, CSR_SCAN_RESULT_CFG_AGING_INTERVAL/PAL_TIMER_TO_MS_UNIT); } eHalStatus csrScanStartIdleScanTimer(tpAniSirGlobal pMac, tANI_U32 interval) @@ -6881,8 +6995,6 @@ eHalStatus csrScanStartIdleScan(tpAniSirGlobal pMac) csrScanBGScanAbort(pMac); //Stop get result timer because idle scan gets scan result out of PE csrScanStopGetResultTimer(pMac); - //Enable aging timer since idle scan is going on - csrScanStartResultAgingTimer(pMac); } pMac->scan.fCancelIdleScan = eANI_BOOLEAN_FALSE; status = csrScanTriggerIdleScan(pMac, &nTime); @@ -7741,10 +7853,12 @@ eHalStatus csrGetCountryCode(tpAniSirGlobal pMac, tANI_U8 *pBuf, tANI_U8 *pbLen) void csrSetCfgScanControlList( tpAniSirGlobal pMac, tANI_U8 *countryCode, tCsrChannel *pChannelList ) { - tANI_U8 i, j; + tANI_U8 i, j, k; tANI_BOOLEAN found=FALSE; tANI_U8 *pControlList = NULL; tANI_U32 len = WNI_CFG_SCAN_CONTROL_LIST_LEN; + tANI_U8 cfgActiveDFSChannels = 0; + tANI_U8 *cfgActiveDFSChannelLIst = NULL; if ( (pControlList = vos_mem_malloc(WNI_CFG_SCAN_CONTROL_LIST_LEN)) != NULL ) { @@ -7766,10 +7880,38 @@ void csrSetCfgScanControlList( tpAniSirGlobal pMac, tANI_U8 *countryCode, tCsrCh { pControlList[j+1] = csrGetScanType(pMac, pControlList[j]); found = FALSE; // reset the flag + + // When DFS mode is 2, mark static channels as active + if (pMac->scan.fEnableDFSChnlScan == + DFS_CHNL_SCAN_ENABLED_ACTIVE) + { + cfgActiveDFSChannels = + pMac->roam.neighborRoamInfo.cfgParams. + channelInfo.numOfChannels; + cfgActiveDFSChannelLIst = + pMac->roam.neighborRoamInfo.cfgParams. + channelInfo.ChannelList; + if (cfgActiveDFSChannelLIst) + { + for (k=0; k < cfgActiveDFSChannels; k++) + { + if(CSR_IS_CHANNEL_DFS(cfgActiveDFSChannelLIst[k]) + && (pControlList[j] == + cfgActiveDFSChannelLIst[k])) + { + pControlList[j+1] = eSIR_ACTIVE_SCAN; + smsLog(pMac, LOG1, FL("Marked DFS ch %d" + " as active"), + cfgActiveDFSChannelLIst[k]); + } + } + } + } } - - } + } + smsLog(pMac, LOG1, FL("fEnableDFSChnlScan %d"), + pMac->scan.fEnableDFSChnlScan); VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: dump scan control list",__func__); VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, @@ -7781,7 +7923,6 @@ void csrSetCfgScanControlList( tpAniSirGlobal pMac, tANI_U8 *countryCode, tCsrCh }//AllocateMemory } - //if bgPeriod is 0, background scan is disabled. It is in millisecond units eHalStatus csrSetCfgBackgroundScanPeriod(tpAniSirGlobal pMac, tANI_U32 bgPeriod) { @@ -7830,12 +7971,6 @@ eHalStatus csrProcessSetBGScanParam(tpAniSirGlobal pMac, tSmeCmd *pCommand) //Not set the background scan interval if not connected because bd scan should not be run if not connected if(!csrIsAllSessionDisconnected(pMac)) { - //If disbaling BG scan here, we need to stop aging as well - if(pScanReq->scanInterval == 0) - { - //Stop aging because no new result is coming in - csrScanStopResultAgingTimer(pMac); - } #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR { @@ -7882,10 +8017,11 @@ eHalStatus csrProcessSetBGScanParam(tpAniSirGlobal pMac, tSmeCmd *pCommand) } -eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId, - eCsrAbortReason reason) +tSirAbortScanStatus csrScanAbortMacScan(tpAniSirGlobal pMac, + tANI_U8 sessionId, + eCsrAbortReason reason) { - eHalStatus status = eHAL_STATUS_FAILURE; + tSirAbortScanStatus abortScanStatus = eSIR_ABORT_ACTIVE_SCAN_LIST_EMPTY; tSirSmeScanAbortReq *pMsg; tANI_U16 msgLen; tListElem *pEntry; @@ -7936,26 +8072,37 @@ eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId, pMsg = vos_mem_malloc(msgLen); if ( NULL == pMsg ) { - status = eHAL_STATUS_FAILURE; smsLog(pMac, LOGE, FL("Failed to allocate memory for SmeScanAbortReq")); + abortScanStatus = eSIR_ABORT_SCAN_FAILURE; } else { + pCommand->u.scanCmd.abortScanIndication = eCSR_SCAN_ABORT_DEFAULT; if(reason == eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE) { - pCommand->u.scanCmd.abortScanDueToBandChange - = eANI_BOOLEAN_TRUE; + pCommand->u.scanCmd.abortScanIndication + = eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE; } vos_mem_set((void *)pMsg, msgLen, 0); pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_SCAN_ABORT_IND); pMsg->msgLen = pal_cpu_to_be16(msgLen); pMsg->sessionId = sessionId; - status = palSendMBMessage(pMac->hHdd, pMsg); + if (eHAL_STATUS_SUCCESS != palSendMBMessage(pMac->hHdd, pMsg)) + { + smsLog(pMac, LOGE, + FL("Failed to post eWNI_SME_SCAN_ABORT_IND")); + abortScanStatus = eSIR_ABORT_SCAN_FAILURE; + pCommand->u.scanCmd.abortScanIndication = 0; + } + else + { + abortScanStatus = eSIR_ABORT_ACTIVE_SCAN_LIST_NOT_EMPTY; + } } } } - return(status); + return(abortScanStatus); } void csrRemoveCmdWithSessionIdFromPendingList(tpAniSirGlobal pMac, @@ -8174,7 +8321,12 @@ eHalStatus csrScanAbortMacScanNotForConnect(tpAniSirGlobal pMac, if( !csrIsScanForRoamCommandActive( pMac ) ) { //Only abort the scan if it is not used for other roam/connect purpose - status = csrScanAbortMacScan(pMac, sessionId, eCSR_SCAN_ABORT_DEFAULT); + if (eSIR_ABORT_SCAN_FAILURE == + csrScanAbortMacScan(pMac, sessionId, eCSR_SCAN_ABORT_DEFAULT)) + { + smsLog(pMac, LOGE, FL("fail to abort scan")); + status = eHAL_STATUS_FAILURE; + } } return (status); @@ -8243,10 +8395,11 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, v_U32_t indx; u8 channelsAllowed[WNI_CFG_VALID_CHANNEL_LIST_LEN]; v_U32_t numChannelsAllowed = WNI_CFG_VALID_CHANNEL_LIST_LEN; + tListElem *pEntry; pParsedFrame = - (tpSirProbeRespBeacon)vos_mem_malloc(sizeof(tSirProbeRespBeacon)); + (tpSirProbeRespBeacon)vos_mem_vmalloc(sizeof(tSirProbeRespBeacon)); if (NULL == pParsedFrame) { @@ -8259,7 +8412,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, smsLog(pMac, LOGE, FL("Not enough bytes in PNO indication probe resp frame! length=%d"), pPrefNetworkFoundInd->frameLength); - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_FAILURE; } @@ -8272,7 +8425,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, smsLog(pMac, LOGE, FL("Parse error ProbeResponse, length=%d"), pPrefNetworkFoundInd->frameLength); - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_FAILURE; } //24 byte MAC header and 12 byte to ssid IE @@ -8283,6 +8436,13 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, (SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET); } + if (uLen > (UINT_MAX - sizeof(tCsrScanResult))) { + smsLog(pMac, LOGE, FL("Incorrect len: %d, may leads to int overflow, uLen %d"), + pPrefNetworkFoundInd->frameLength, uLen); + vos_mem_vfree(pParsedFrame); + return eHAL_STATUS_FAILURE; + } + pScanResult = vos_mem_malloc(sizeof(tCsrScanResult) + uLen); if ( NULL == pScanResult ) { @@ -8339,7 +8499,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, { smsLog(pMac, LOGE, FL(" sme_GetCfgValidChannels failed ")); csrFreeScanResultEntry(pMac, pScanResult); - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_FAILURE; } /* Checking chhanelId with allowed channel list */ @@ -8360,7 +8520,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, smsLog(pMac, LOGW, FL(" prefered network found on invalid channel = %d"), pBssDescr->channelId); csrFreeScanResultEntry(pMac, pScanResult); - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_FAILURE; } @@ -8426,7 +8586,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, { smsLog(pMac, LOGE, FL(" Cannot parse IEs")); csrFreeScanResultEntry(pMac, pScanResult); - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_RESOURCES; } @@ -8446,15 +8606,21 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, vos_mem_free(pParsedFrame); return eHAL_STATUS_RESOURCES; } + + if ((macHeader->fc.type == SIR_MAC_MGMT_FRAME) && + (macHeader->fc.subType == SIR_MAC_MGMT_PROBE_RSP)) + { + pScanResult->Result.BssDescriptor.fProbeRsp = 1; + } //Add to scan cache csrScanAddResult(pMac, pScanResult, pIesLocal); - + pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_LOCK ); if( (pScanResult->Result.pvIes == NULL) && pIesLocal ) { vos_mem_free(pIesLocal); } - vos_mem_free(pParsedFrame); + vos_mem_vfree(pParsedFrame); return eHAL_STATUS_SUCCESS; } diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrInsideApi.h b/drivers/staging/prima/CORE/SME/src/csr/csrInsideApi.h index 6ac04edc2a02..07aeefc7e126 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrInsideApi.h +++ b/drivers/staging/prima/CORE/SME/src/csr/csrInsideApi.h @@ -37,6 +37,7 @@ #define CSR_INSIDE_API_H__ +#include #include "csrSupport.h" #include "smeInside.h" #include "vos_nvitem.h" @@ -84,7 +85,6 @@ #define CSR_MIC_ERROR_TIMEOUT (60 * PAL_TIMER_TO_SEC_UNIT) //60 seconds #define CSR_TKIP_COUNTER_MEASURE_TIMEOUT (60 * PAL_TIMER_TO_SEC_UNIT) //60 seconds #define CSR_SCAN_RESULT_AGING_INTERVAL (5 * PAL_TIMER_TO_SEC_UNIT) //5 seconds -#define CSR_SCAN_RESULT_CFG_AGING_INTERVAL (PAL_TIMER_TO_SEC_UNIT) // 1 second //the following defines are NOT used by palTimer #define CSR_SCAN_AGING_TIME_NOT_CONNECT_NO_PS 50 //50 seconds #define CSR_SCAN_AGING_TIME_NOT_CONNECT_W_PS 300 //300 seconds @@ -255,10 +255,6 @@ eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi eHalStatus csrScanForCapabilityChange(tpAniSirGlobal pMac, tSirSmeApNewCaps *pNewCaps); eHalStatus csrScanStartGetResultTimer(tpAniSirGlobal pMac); eHalStatus csrScanStopGetResultTimer(tpAniSirGlobal pMac); -eHalStatus csrScanStartResultAgingTimer(tpAniSirGlobal pMac); -eHalStatus csrScanStopResultAgingTimer(tpAniSirGlobal pMac); -eHalStatus csrScanStartResultCfgAgingTimer(tpAniSirGlobal pMac); -eHalStatus csrScanStopResultCfgAgingTimer(tpAniSirGlobal pMac); eHalStatus csrScanBGScanEnable(tpAniSirGlobal pMac); eHalStatus csrScanStartIdleScanTimer(tpAniSirGlobal pMac, tANI_U32 interval); eHalStatus csrScanStopIdleScanTimer(tpAniSirGlobal pMac); @@ -273,8 +269,9 @@ void csrScanStopTimers(tpAniSirGlobal pMac); tANI_BOOLEAN csrScanRemoveNotRoamingScanCommand(tpAniSirGlobal pMac); //To remove fresh scan commands from the pending queue tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionId); -eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId, - eCsrAbortReason reason); +tSirAbortScanStatus csrScanAbortMacScan(tpAniSirGlobal pMac, + tANI_U8 sessionId, + eCsrAbortReason reason); void csrRemoveCmdFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pList, eSmeCommandType commandType ); void csrRemoveCmdWithSessionIdFromPendingList(tpAniSirGlobal pMac, @@ -294,6 +291,8 @@ void csrRemoveScanForSSIDFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pLis //The BSS is remove if the count reaches 0. eHalStatus csrScanAgeResults(tpAniSirGlobal pMac, tSmeGetScanChnRsp *pScanChnInfo); +eHalStatus csrIbssAgeBss(tpAniSirGlobal pMac); + //If fForce is TRUE we will save the new String that is learn't. //Typically it will be true in case of Join or user initiated ioctl tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc, @@ -383,6 +382,7 @@ eCsrCfgDot11Mode csrGetCfgDot11ModeFromCsrPhyMode(tCsrRoamProfile *pProfile, eCs tANI_U32 csrTranslateToWNICfgDot11Mode(tpAniSirGlobal pMac, eCsrCfgDot11Mode csrDot11Mode); void csrSaveChannelPowerForBand( tpAniSirGlobal pMac, tANI_BOOLEAN fPopulate5GBand ); void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannelList, tANI_U8 *countryCode, tANI_BOOLEAN updateRiva); +void csrUpdateFCCChannelList(tpAniSirGlobal pMac); void csrApplyPower2Current( tpAniSirGlobal pMac ); void csrAssignRssiForCategory(tpAniSirGlobal pMac, tANI_S8 bestApRssi, tANI_U8 catOffset); tANI_BOOLEAN csrIsMacAddressZero( tpAniSirGlobal pMac, tCsrBssid *pMacAddr ); @@ -417,9 +417,10 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, tANI_U8 *pbSessionId); //fSync: TRUE means cleanupneeds to handle synchronously. eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_BOOLEAN fSync, + tANI_BOOLEAN fSync, tANI_U8 bPurgeList, csrRoamSessionCloseCallback callback, void *pContext ); +void csrPurgeSmeCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId); void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId); eHalStatus csrRoamGetSessionIdFromBSSID( tpAniSirGlobal pMac, tCsrBssid *bssid, tANI_U32 *pSessionId ); eCsrCfgDot11Mode csrFindBestPhyMode( tpAniSirGlobal pMac, tANI_U32 phyMode ); @@ -472,6 +473,15 @@ eHalStatus csrScanBGScanAbort(tpAniSirGlobal); -------------------------------------------------------------------------------*/ eHalStatus csrScanGetResult(tpAniSirGlobal, tCsrScanResultFilter *pFilter, tScanResultHandle *phResult); +#ifdef FEATURE_WLAN_LFR +/* --------------------------------------------------------------------------- + \fn csrAddChannelToOccupiedChannelList + \brief Add channel no given by fast reassoc cmd into occ chn list + \param channel - channel no passed by fast reassoc cmd + \return void + -------------------------------------------------------------------------------*/ +void csrAddChannelToOccupiedChannelList(tpAniSirGlobal pMac, tANI_U8 channel); +#endif /* --------------------------------------------------------------------------- \fn csrScanFlushResult \brief Clear scan results. @@ -486,6 +496,14 @@ eHalStatus csrScanFlushResult(tpAniSirGlobal); */ eHalStatus csrScanFilterResults(tpAniSirGlobal pMac); +/* --------------------------------------------------------------------------- + * \fn csrScanFilterDFSResults + * \brief Filter BSSIDs on DFS channels from the scan results. + * \return eHalStatus + *------------------------------------------------------------------------------- + */ +eHalStatus csrScanFilterDFSResults(tpAniSirGlobal pMac); + eHalStatus csrScanFlushSelectiveResult(tpAniSirGlobal, v_BOOL_t flushP2P); eHalStatus csrScanFlushSelectiveResultForBand(tpAniSirGlobal, v_BOOL_t flushP2P, tSirRFBand band); @@ -862,6 +880,14 @@ eHalStatus csrRoamConnectToLastProfile(tpAniSirGlobal pMac, tANI_U32 sessionId); -------------------------------------------------------------------------------*/ eHalStatus csrRoamDisconnect(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason); +/* --------------------------------------------------------------------------- + \fn csr_abortConnection + \brief To disconnect from a connecting network + \retutn void. +----------------------------------------------------------------------------*/ + +void csr_abortConnection(tpAniSirGlobal pMac, tANI_U32 sessionId); + /* --------------------------------------------------------------------------- \fn csrScanGetPMKIDCandidateList \brief return the PMKID candidate list @@ -891,8 +917,12 @@ void csrCallRoamingCompletionCallback(tpAniSirGlobal pMac, tCsrRoamSession *pSes \return eHalStatus ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, - tANI_U32 sessionId, + tANI_U32 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pPeerMacAddr, +#else tANI_U8 *pPeerMacAddr, +#endif tANI_U32 reason); /* --------------------------------------------------------------------------- @@ -998,9 +1028,17 @@ eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac); eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pBSSId, tANI_BOOLEAN flush_cache ); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pBSSId, +#else + tANI_U8 *pBSSId, +#endif + tANI_BOOLEAN flush_cache ); tANI_BOOLEAN csrElectedCountryInfo(tpAniSirGlobal pMac); void csrAddVoteForCountryInfo(tpAniSirGlobal pMac, tANI_U8 *pCountryCode); void csrClearVotesForCountryInfo(tpAniSirGlobal pMac); +#ifdef WLAN_FEATURE_AP_HT40_24G +eHalStatus csrSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U8 cbMode); +#endif #endif diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrLogDump.c b/drivers/staging/prima/CORE/SME/src/csr/csrLogDump.c index bedb6a6eb862..a216bb44e825 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrLogDump.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrLogDump.c @@ -26,9 +26,6 @@ */ /*============================================================================ -Copyright (c) 2007 QUALCOMM Incorporated. -All Rights Reserved. -Qualcomm Confidential and Proprietary csrLogDump.c Implements the dump commands specific to the csr module. ============================================================================*/ diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrNeighborRoam.c b/drivers/staging/prima/CORE/SME/src/csr/csrNeighborRoam.c index 2bae9e30ebe1..a84051843f2b 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrNeighborRoam.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrNeighborRoam.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -249,9 +249,10 @@ void csrNeighborRoamFreeRoamableBSSList(tpAniSirGlobal pMac, tDblLinkList *pList return; } -static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, +static eHalStatus csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, tpCsrNeighborRoamControlInfo pNeighborRoamInfo) { + eHalStatus status = eHAL_STATUS_SUCCESS; #ifdef WLAN_FEATURE_VOWIFI_11R if ((pNeighborRoamInfo->is11rAssoc) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -262,7 +263,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) || (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) { - csrNeighborRoamIssuePreauthReq(pMac); + status = csrNeighborRoamIssuePreauthReq(pMac); pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], sizeof(pNeighborRoamInfo->cfgRoambssId), @@ -289,7 +290,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, { if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) { - csrNeighborRoamIssuePreauthReq(pMac); + status = csrNeighborRoamIssuePreauthReq(pMac); } else { @@ -310,7 +311,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, #endif ) { - csrNeighborRoamIssuePreauthReq(pMac); + status = csrNeighborRoamIssuePreauthReq(pMac); pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], sizeof(pNeighborRoamInfo->cfgRoambssId), @@ -340,6 +341,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, pNeighborRoamInfo->neighborRoamState)); } } + return status; } VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_BOOL_t fastRoamEnabled) @@ -659,6 +661,7 @@ static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac) #endif #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD pNeighborRoamInfo->uOsRequestedHandoff = 0; + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); #endif @@ -768,6 +771,7 @@ void csrNeighborRoamResetConnectedStateControlInfo(tpAniSirGlobal pMac) #endif #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD pNeighborRoamInfo->uOsRequestedHandoff = 0; + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); #endif } @@ -777,8 +781,6 @@ void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac) tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; pNeighborRoamInfo->csrSessionId = CSR_SESSION_ID_INVALID; vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); - pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac; - pNeighborRoamInfo->neighborScanTimerInfo.sessionId = CSR_SESSION_ID_INVALID; #ifdef FEATURE_WLAN_ESE pNeighborRoamInfo->isESEAssoc = eANI_BOOLEAN_FALSE; pNeighborRoamInfo->isVOAdmitted = eANI_BOOLEAN_FALSE; @@ -1074,7 +1076,7 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus preauthProcessed = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamBSSInfo pPreauthRspNode = NULL; - + tCsrRoamSession *pSession; #ifdef FEATURE_WLAN_LFR_METRICS tCsrRoamInfo *roamInfo; #endif @@ -1202,11 +1204,18 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l csrNeighborRoamFreeNeighborRoamBSSNode(pMac, pNeighborBssNode); } } + pSession = CSR_GET_SESSION(pMac, pNeighborRoamInfo->csrSessionId); + if ((NULL != pSession) && pSession->abortConnection) + { + smsLog(pMac, LOGE, FL(" Deauth in progress Abort preauth")); + goto abort_preauth; + } /* Issue preauth request for the same/next entry */ if (eHAL_STATUS_SUCCESS == csrNeighborRoamIssuePreauthReq(pMac)) goto DEQ_PREAUTH; +abort_preauth: #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (csrRoamIsRoamOffloadScanEnabled(pMac)) { @@ -1215,6 +1224,13 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l pNeighborRoamInfo->uOsRequestedHandoff = 0; csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_PREAUTH_FAILED_FOR_ALL); } + else if(pNeighborRoamInfo->isForcedInitialRoamTo5GH) + { + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; + smsLog(pMac, LOGE, FL("Forced 5G roaming preauth got failed" + "send RSO START cmd to fwr.")); + csrRoamOffloadScan(pMac,ROAM_SCAN_OFFLOAD_START,REASON_CONNECT); + } else { csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL); @@ -1338,21 +1354,31 @@ eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScan pScanFilter->BSSType = pCurProfile->BSSType; - /* We are intrested only in the scan results on channels that we scanned */ - pScanFilter->ChannelInfo.numOfChannels = pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels; - pScanFilter->ChannelInfo.ChannelList = vos_mem_malloc(pScanFilter->ChannelInfo.numOfChannels * sizeof(tANI_U8)); - if (NULL == pScanFilter->ChannelInfo.ChannelList) + if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels) { - smsLog(pMac, LOGE, FL("Scan Filter Channel list mem alloc failed")); - vos_mem_free(pScanFilter->SSIDs.SSIDList); - pScanFilter->SSIDs.SSIDList = NULL; - return eHAL_STATUS_FAILED_ALLOC; + /* We are intrested only in the scan results on channels that we scanned */ + pScanFilter->ChannelInfo.numOfChannels = + pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels; + pScanFilter->ChannelInfo.ChannelList = + vos_mem_malloc(pScanFilter->ChannelInfo.numOfChannels * sizeof(tANI_U8)); + if (NULL == pScanFilter->ChannelInfo.ChannelList) + { + smsLog(pMac, LOGE, FL("Scan Filter Channel list mem alloc failed")); + vos_mem_free(pScanFilter->SSIDs.SSIDList); + pScanFilter->SSIDs.SSIDList = NULL; + return eHAL_STATUS_FAILED_ALLOC; + } + for (i = 0; i < pScanFilter->ChannelInfo.numOfChannels; i++) + { + pScanFilter->ChannelInfo.ChannelList[i] = + pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i]; + } } - for (i = 0; i < pScanFilter->ChannelInfo.numOfChannels; i++) + else { - pScanFilter->ChannelInfo.ChannelList[i] = pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i]; + pScanFilter->ChannelInfo.numOfChannels = 0; + pScanFilter->ChannelInfo.ChannelList = NULL; } - #ifdef WLAN_FEATURE_VOWIFI_11R if (pNeighborRoamInfo->is11rAssoc) { @@ -1362,6 +1388,12 @@ eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScan } #endif +#ifdef WLAN_FEATURE_11W + pScanFilter->MFPEnabled = pCurProfile->MFPEnabled; + pScanFilter->MFPRequired = pCurProfile->MFPRequired; + pScanFilter->MFPCapable = pCurProfile->MFPCapable; +#endif + return eHAL_STATUS_SUCCESS; } @@ -1464,6 +1496,15 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, continue; } + if (vos_concurrent_open_sessions_running() && + !pMac->roam.configParam.fenableMCCMode && + (pScanResult->BssDescriptor.channelId != + csrGetConcurrentOperationChannel(pMac))) { + smsLog(pMac, LOG1, FL("MCC not supported so Ignore AP on channel %d"), + pScanResult->BssDescriptor.channelId); + continue; + } + #ifdef FEATURE_WLAN_LFR #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD /* In case of reassoc requested by upper layer, look for exact match of bssid & channel; @@ -1522,7 +1563,7 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD && !csrRoamIsRoamOffloadScanEnabled(pMac) #endif - && ((eSME_ROAM_TRIGGER_SCAN != pNeighborRoamInfo->cfgRoamEn) || + && ((eSME_ROAM_TRIGGER_SCAN != pNeighborRoamInfo->cfgRoamEn) && (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn))) { /* @@ -2098,7 +2139,14 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) } #endif - csrNeighborRoamTriggerHandoff(pMac, pNeighborRoamInfo); + hstatus = csrNeighborRoamTriggerHandoff(pMac,pNeighborRoamInfo); + if(eHAL_STATUS_SUCCESS != hstatus) + { + smsLog(pMac, LOGE, + FL("csrNeighborRoamTriggerHandoff fail status = %d"), + hstatus); + return eHAL_STATUS_FAILURE; + } return eHAL_STATUS_SUCCESS; } @@ -2144,6 +2192,13 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) "tempVal = %u, roamNow = %d uOsRequestedHandoff = %d", tempVal, roamNow, pNeighborRoamInfo->uOsRequestedHandoff); } + else if (pNeighborRoamInfo->isForcedInitialRoamTo5GH) + { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "No 5G candidate found tempVal=%u, roamNow=%d", + tempVal, roamNow); + return eHAL_STATUS_FAILURE; + } else { if (pNeighborRoamInfo->uOsRequestedHandoff) @@ -2152,11 +2207,7 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); pNeighborRoamInfo->uOsRequestedHandoff = 0; } - else if (pNeighborRoamInfo->isForcedInitialRoamTo5GH) - { - smsLog(pMac, LOGE, FL("Forced roam to 5G No candidate found, starting fw offload scan again, status = %d"), hstatus); - csrNeighborRoamStartLfrScan(pMac, REASON_INITIAL_FORCED_ROAM_TO_5G); - } + else { /* There is no candidate or We are not roaming Now. @@ -2364,31 +2415,31 @@ static eHalStatus csrNeighborRoamForceRoamTo5GhScanCb(tHalHandle halHandle, pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; - /* This can happen when we receive a UP event from TL in any of the scan states. Silently ignore it */ - if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) + if (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN != pNeighborRoamInfo->neighborRoamState) { - smsLog(pMac, LOGE, FL("Received in CONNECTED state. Must be because a UP event from TL after issuing scan request. Ignore it")); + smsLog(pMac, LOGE, FL("Received in neighborRoamState %d . Ignore it"), + pNeighborRoamInfo->neighborRoamState); hstatus = eHAL_STATUS_FAILURE; goto end; } - if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) - { - smsLog(pMac, LOGE, FL("Received in INIT state. Must have disconnected. Ignore it")); - hstatus = eHAL_STATUS_FAILURE; - goto end; - } + //keep track of forced 5G scan & roam is due to Forced initial roam to 5GHz + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 1; NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: process scan results", __func__); hstatus = csrNeighborRoamProcessScanComplete(pMac); - //Clear off the isForcedInitialRoamTo5GH - pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; - if (eHAL_STATUS_SUCCESS != hstatus) { - smsLog(pMac, LOGE, FL("Force Roam To 5GhScanCb failed with status %d"), hstatus); - goto end; + smsLog(pMac, LOGE, FL("Force Roam To 5GhScanCb failed with status %d"), + hstatus); + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; + /* + * Send RSO start because in case 5G roaming host have + * not enabled at initial connection + */ + csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); } if (NULL != pContext) @@ -2398,8 +2449,6 @@ static eHalStatus csrNeighborRoamForceRoamTo5GhScanCb(tHalHandle halHandle, end: if (NULL != pContext) vos_mem_free(pContext); - if (hstatus != eHAL_STATUS_SUCCESS) - csrNeighborRoamStartLfrScan(pMac, REASON_INITIAL_FORCED_ROAM_TO_5G); return hstatus; } #endif @@ -2542,7 +2591,7 @@ eHalStatus csrNeighborRoamIssueBgScanRequest(tpAniSirGlobal pMac, vos_mem_free(scanReq.SSIDs.SSIDList); if (1 == pBgScanParams->ChannelInfo.numOfChannels) - NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %p, Actual index = %d"), + NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %pK, Actual index = %d"), &pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList[0], pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex); @@ -2589,7 +2638,7 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) if ( pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList && pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels ) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %p"), &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0]); + NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %pK"), &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0]); } else { @@ -2745,7 +2794,6 @@ eHalStatus csrNeighborRoamScanForInitialForced5GRoaming(tpAniSirGlobal pMac, tAN { smsLog(pMac, LOGE, FL("Forced intial roam to 5Gh request failed: Status = %d"), status); } - return status; } #endif @@ -2834,10 +2882,14 @@ eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 ---------------------------------------------------------------------------*/ void csrNeighborRoamNeighborScanTimerCallback(void *pv) { - tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv; - tpAniSirGlobal pMac = pInfo->pMac; - tANI_U32 sessionId = pInfo->sessionId; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpAniSirGlobal pMac = PMAC_STRUCT( pv ); + tpCsrNeighborRoamControlInfo pNeighborRoamInfo; + if(!pMac) + { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); + return; + } + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; // check if bg scan is on going, no need to send down the new params if true if(eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) @@ -2847,8 +2899,6 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) return; } - VOS_ASSERT(sessionId == pNeighborRoamInfo->csrSessionId); - switch (pNeighborRoamInfo->neighborRoamState) { #ifdef WLAN_FEATURE_VOWIFI_11R @@ -2856,7 +2906,7 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) switch(pNeighborRoamInfo->prevNeighborRoamState) { case eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY: - csrNeighborRoamPerformBgScan(pMac, sessionId); + csrNeighborRoamPerformBgScan(pMac, pNeighborRoamInfo->csrSessionId); break; default: smsLog(pMac, LOGE, FL("Neighbor scan callback received in" @@ -2870,7 +2920,7 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) break; #endif /* WLAN_FEATURE_VOWIFI_11R */ case eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN: - csrNeighborRoamPerformBgScan(pMac, sessionId); + csrNeighborRoamPerformBgScan(pMac, pNeighborRoamInfo->csrSessionId ); break; default: break; @@ -2880,10 +2930,15 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) void csrNeighborRoamEmptyScanRefreshTimerCallback(void *context) { - tCsrTimerInfo *pInfo = (tCsrTimerInfo *)context; - tpAniSirGlobal pMac = pInfo->pMac; + tpAniSirGlobal pMac = PMAC_STRUCT( context ); VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo; + if(!pMac) + { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); + return; + } + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; /* Reset all the variables just as no scan had happened before */ csrNeighborRoamResetConnectedStateControlInfo(pMac); @@ -2932,11 +2987,17 @@ void csrNeighborRoamEmptyScanRefreshTimerCallback(void *context) ---------------------------------------------------------------------------*/ void csrNeighborRoamResultsRefreshTimerCallback(void *context) { - tCsrTimerInfo *pInfo = (tCsrTimerInfo *)context; - tpAniSirGlobal pMac = pInfo->pMac; + tpAniSirGlobal pMac = PMAC_STRUCT( context ); VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - + tpCsrNeighborRoamControlInfo pNeighborRoamInfo; + + if(!pMac) + { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); + return; + } + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); /* Deregister reassoc callback. Ignore return status */ @@ -2997,10 +3058,15 @@ void csrNeighborRoamResultsRefreshTimerCallback(void *context) void csrForcedInitialRoamTo5GHTimerCallback(void *context) { - tCsrTimerInfo *pInfo = (tCsrTimerInfo *)context; - tpAniSirGlobal pMac = pInfo->pMac; + tpAniSirGlobal pMac = PMAC_STRUCT( context ); eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo; + if(!pMac) + { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); + return; + } + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("forcedInitialRoamTo5GHTimer timer expired")); @@ -3023,29 +3089,25 @@ void csrForcedInitialRoamTo5GHTimerCallback(void *context) return; } - //keep track this scan & roam is due to Forced initial roam to 5GHz - pNeighborRoamInfo->isForcedInitialRoamTo5GH = 1; - - //keep firmware shut-up for any roaming related scan during - //this tenure. - status = csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, - REASON_INITIAL_FORCED_ROAM_TO_5G); - if (eHAL_STATUS_SUCCESS != status) + pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + /* + * We are about to start a fresh scan cycle for all valid channles for 5Ghz + * purge non-P2P results from the past for 5Ghz band + */ + csrScanFlushSelectiveResultForBand(pMac, VOS_FALSE, SIR_BAND_5_GHZ); + status = csrNeighborRoamScanForInitialForced5GRoaming( + pMac, pNeighborRoamInfo->csrSessionId); + if(status != eHAL_STATUS_SUCCESS) { - smsLog(pMac, LOGE, FL("csrRoamOffloadScan stop scan cmd got failed status = %d"), status); + smsLog(pMac, LOGE, + FL("csrNeighborRoamScanForInitialForced5GRoaming failed status=%d"), status); + //Send RSO start because in case 5G roaming host have not enabled at initial connection + csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); return; } - // MUKUL TODO: whatever we are doing should we need to move - // it after offload scan response comes from firmware ??? - status = csrNeighborRoamTransitToCFGChanScan(pMac); - if (eHAL_STATUS_SUCCESS != status) - { - smsLog(pMac, LOGE, - FL("csrNeighborRoamTransitToCFGChanScan failed status=%d"), status); - //restart scan offload to firmware - csrNeighborRoamStartLfrScan(pMac, REASON_INITIAL_FORCED_ROAM_TO_5G); - } + /* Transition to CFG_CHAN_LIST_SCAN */ + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN); } #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI @@ -3766,6 +3828,12 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) numOfChannels * sizeof(tANI_U8)); outputNumOfChannels = numOfChannels; } + + if (outputNumOfChannels == 0) + { + smsLog(pMac, LOGE, FL("No channels to scan")); + return VOS_STATUS_E_FAILURE; + } currChannelListInfo->ChannelList = vos_mem_malloc(outputNumOfChannels*sizeof(tANI_U8)); if (NULL == currChannelListInfo->ChannelList) @@ -3773,27 +3841,12 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); return VOS_STATUS_E_RESOURCES; } + currChannelListInfo->numOfChannels = outputNumOfChannels; vos_mem_copy(currChannelListInfo->ChannelList, scanChannelList, outputNumOfChannels * sizeof(tANI_U8)); } - else if(pNeighborRoamInfo->isForcedInitialRoamTo5GH) - { - NEIGHBOR_ROAM_DEBUG(pMac, LOG1, "Forced roam to 5G cfg chain list"); - - pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); - /* We are about to start a fresh scan cycle for all valid channles for 5Ghz - * purge non-P2P results from the past for 5Ghz band */ - csrScanFlushSelectiveResultForBand(pMac, VOS_FALSE, SIR_BAND_5_GHZ); - status = csrNeighborRoamScanForInitialForced5GRoaming(pMac, sessionId); - if(status != eHAL_STATUS_SUCCESS) - return VOS_STATUS_E_FAILURE; - - /* Transition to CFG_CHAN_LIST_SCAN */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN); - return VOS_STATUS_SUCCESS; - } #ifdef FEATURE_WLAN_LFR else if ((pNeighborRoamInfo->uScanMode == DEFAULT_SCAN) && (abs(pNeighborRoamInfo->lookupDOWNRssi) > @@ -3888,12 +3941,18 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) outputNumOfChannels = numOfChannels; } + if (outputNumOfChannels == 0) + { + smsLog(pMac, LOGE, FL("No channels to scan")); + return VOS_STATUS_E_FAILURE; + } currChannelListInfo->ChannelList = vos_mem_malloc(outputNumOfChannels * sizeof(tANI_U8)); if (NULL == currChannelListInfo->ChannelList) { smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); return VOS_STATUS_E_RESOURCES; } + currChannelListInfo->numOfChannels = outputNumOfChannels; vos_mem_copy(currChannelListInfo->ChannelList, scanChannelList, outputNumOfChannels * sizeof(tANI_U8)); @@ -3952,6 +4011,12 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) { numOfChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; } + + if (numOfChannels == 0) + { + smsLog(pMac, LOGE, FL("No channels to scan")); + return VOS_STATUS_E_FAILURE; + } currChannelListInfo->ChannelList = vos_mem_malloc(numOfChannels*sizeof(tANI_U8)); @@ -3960,6 +4025,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); return VOS_STATUS_E_RESOURCES; } + currChannelListInfo->numOfChannels = numOfChannels; #ifdef FEATURE_WLAN_LFR vos_mem_copy(currChannelListInfo->ChannelList, channelList, numOfChannels * sizeof(tANI_U8)); @@ -3971,8 +4037,6 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) } } - /* Adjust for the actual number that are used */ - currChannelListInfo->numOfChannels = numOfChannels; NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "Number of channels from CFG (or) (non-)occupied list=%d", currChannelListInfo->numOfChannels); @@ -4516,8 +4580,6 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId vos_mem_copy(pNeighborRoamInfo->currAPbssid, pMac->roam.roamSession[sessionId].connectedProfile.bssid, sizeof(tCsrBssid)); pNeighborRoamInfo->currAPoperationChannel = pMac->roam.roamSession[sessionId].connectedProfile.operationChannel; - pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac; - pNeighborRoamInfo->neighborScanTimerInfo.sessionId = sessionId; pNeighborRoamInfo->currentNeighborLookupThreshold = pNeighborRoamInfo->cfgParams.neighborLookupThreshold; #ifdef FEATURE_WLAN_LFR @@ -4584,6 +4646,21 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId if(csrRoamIsStaMode(pMac, sessionId)) { pNeighborRoamInfo->uOsRequestedHandoff = 0; + pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; + if(pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable && + (GetRFBand(pNeighborRoamInfo->currAPoperationChannel) == + SIR_BAND_2_4_GHZ)) + { + /* + * Keep 5G and Fwr roaming mutually exclusive so do not + * send RSO start Note we have to send RSO start in all + * errro case. + */ + smsLog(pMac, LOG1, + FL("Do not send RSO start" + "because 5G force roaming is enabled")); + break; + } csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); } } else { @@ -4717,19 +4794,28 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels; - pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = + if (pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels != 0) + { + pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = vos_mem_malloc(pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); - if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) - { - smsLog(pMac, LOGE, FL("Memory Allocation for CFG Channel List failed")); - return eHAL_STATUS_RESOURCES; - } + if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) + { + smsLog(pMac, LOGE, FL("Memory Allocation for CFG Channel List failed")); + return eHAL_STATUS_RESOURCES; + } - /* Update the roam global structure from CFG */ - vos_mem_copy(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, + /* Update the roam global structure from CFG */ + vos_mem_copy(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList, pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); + } + else + { + smsLog(pMac, LOGW, + FL("invalid neighbor roam channel list: %u"), + pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels); + } vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; @@ -4741,10 +4827,8 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) #endif pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; - pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac; - pNeighborRoamInfo->neighborScanTimerInfo.sessionId = CSR_SESSION_ID_INVALID; status = vos_timer_init(&pNeighborRoamInfo->neighborScanTimer, VOS_TIMER_TYPE_SW, - csrNeighborRoamNeighborScanTimerCallback, (void *)&pNeighborRoamInfo->neighborScanTimerInfo); + csrNeighborRoamNeighborScanTimerCallback, (void *)pMac); if (eHAL_STATUS_SUCCESS != status) { @@ -4755,7 +4839,7 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) } status = vos_timer_init(&pNeighborRoamInfo->neighborResultsRefreshTimer, VOS_TIMER_TYPE_SW, - csrNeighborRoamResultsRefreshTimerCallback, (void *)&pNeighborRoamInfo->neighborScanTimerInfo); + csrNeighborRoamResultsRefreshTimerCallback, (void *)pMac); if (eHAL_STATUS_SUCCESS != status) { @@ -4768,7 +4852,7 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) status = vos_timer_init(&pNeighborRoamInfo->emptyScanRefreshTimer, VOS_TIMER_TYPE_SW, csrNeighborRoamEmptyScanRefreshTimerCallback, - (void *)&pNeighborRoamInfo->neighborScanTimerInfo); + (void *)pMac); if (eHAL_STATUS_SUCCESS != status) { @@ -4781,7 +4865,7 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) } status = vos_timer_init(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer, VOS_TIMER_TYPE_SW, - csrForcedInitialRoamTo5GHTimerCallback, (void *)&pNeighborRoamInfo->neighborScanTimerInfo); + csrForcedInitialRoamTo5GHTimerCallback, (void *)pMac); if (eHAL_STATUS_SUCCESS != status) { @@ -4833,6 +4917,9 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; + + //Set the Last Sent Cmd as RSO_STOP + pNeighborRoamInfo->lastSentCmd = ROAM_SCAN_OFFLOAD_STOP; return eHAL_STATUS_SUCCESS; } @@ -4862,8 +4949,6 @@ void csrNeighborRoamClose(tpAniSirGlobal pMac) pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; - pNeighborRoamInfo->neighborScanTimerInfo.pMac = NULL; - pNeighborRoamInfo->neighborScanTimerInfo.sessionId = CSR_SESSION_ID_INVALID; vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); vos_timer_destroy(&pNeighborRoamInfo->emptyScanRefreshTimer); diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrTdlsProcess.c b/drivers/staging/prima/CORE/SME/src/csr/csrTdlsProcess.c index 0bf09ef948ed..c694104ee4ac 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrTdlsProcess.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrTdlsProcess.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -54,20 +54,6 @@ #include "csrInternal.h" - -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * initialize Discovery list - */ -eHalStatus csrTdlsInitPeerList(tpAniSirGlobal pMac ) -{ - tCsrTdlsCtxStruct *tdlsDisInfo = &pMac->tdlsCtx ; - csrLLOpen(pMac->hHdd, &tdlsDisInfo->tdlsPotentialPeerList) ; - - return eHAL_STATUS_SUCCESS ; -} -#endif - /* * common routine to remove TDLS cmd from SME command list.. * commands are removed after getting reponse from PE. @@ -158,6 +144,8 @@ eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMg tdlsSendMgmtCmd->u.tdlsCmd.size = sizeof(tTdlsSendMgmtCmdInfo) ; smePushCommand(pMac, tdlsSendMgmtCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsSendMgmtCmd to SME")); } } @@ -167,7 +155,12 @@ eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMg /* * TDLS request API, called from HDD to modify an existing TDLS peer */ -eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, +eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif tCsrStaParams *pstaParams) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -228,6 +221,8 @@ eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr tdlsAddStaCmd->command = eSmeCommandTdlsAddPeer; tdlsAddStaCmd->u.tdlsCmd.size = sizeof(tTdlsAddStaCmdInfo) ; smePushCommand(pMac, tdlsAddStaCmd, FALSE) ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsAddStaCmd to SME to modify peer ")); status = eHAL_STATUS_SUCCESS ; } } @@ -238,9 +233,13 @@ eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr * TDLS request API, called from HDD to Send Link Establishment Parameters */ VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal, - tANI_U8 sessionId, - tSirMacAddr peerMac, - tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) + tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tSmeCmd *tdlsLinkEstablishCmd; @@ -288,6 +287,8 @@ VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal, tdlsLinkEstablishCmd->u.tdlsCmd.size = sizeof(tTdlsLinkEstablishCmdInfo) ; smePushCommand(pMac, tdlsLinkEstablishCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsLinkEstablishCmd to SME")); } } @@ -297,7 +298,13 @@ VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal, /* * TDLS request API, called from HDD to add a TDLS peer */ -eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tSmeCmd *tdlsAddStaCmd ; @@ -327,6 +334,8 @@ eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr pee tdlsAddStaCmd->u.tdlsCmd.size = sizeof(tTdlsAddStaCmdInfo) ; smePushCommand(pMac, tdlsAddStaCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsAddStaCmd to SME")); } } @@ -336,7 +345,13 @@ eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr pee /* * TDLS request API, called from HDD to delete a TDLS peer */ -eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif +) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tSmeCmd *tdlsDelStaCmd ; @@ -365,6 +380,8 @@ eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr pee tdlsDelStaCmd->u.tdlsCmd.size = sizeof(tTdlsDelStaCmdInfo) ; smePushCommand(pMac, tdlsDelStaCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsDelStaCmd to SME")); } } @@ -412,6 +429,8 @@ VOS_STATUS csrTdlsSendChanSwitchReq(tHalHandle hHal, tdlsChanSwitchCmd->u.tdlsCmd.size = sizeof(tTdlsChanSwitchCmdInfo) ; smePushCommand(pMac, tdlsChanSwitchCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; + smsLog( pMac, LOG1, + FL("Successfully posted tdlsChanSwitchCmd to SME")); } } @@ -419,116 +438,6 @@ VOS_STATUS csrTdlsSendChanSwitchReq(tHalHandle hHal, } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * TDLS request API, called from HDD to enable TDLS discovery request - * in SME/CSR and send message to PE to trigger TDLS discovery procedure. - */ -eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsDisRequest *tdlsDisReq) -{ - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tSmeCmd *tdlsDisReqCmd ; - eHalStatus status = eHAL_STATUS_FAILURE ; - - if(tdlsDisReq) - { - tdlsDisReqCmd = csrGetCommandBuffer(pMac) ; - - if(tdlsDisReqCmd) - { - tTdlsDisReqCmdinfo *disReqCmdInfo = - &tdlsDisReqCmd->u.tdlsCmd.u.tdlsDisReqCmdInfo ; - - vos_mem_zero(&tdlsDisReqCmd->u.tdlsCmd, sizeof(tTdlsCmd)); - - tdlsDisReqCmd->sessionId = sessionId; - - disReqCmdInfo->tdlsDisType = tdlsDisReq->disType ; - vos_mem_copy(disReqCmdInfo->peerMac, - tdlsDisReq->peerMac, sizeof(tSirMacAddr)) ; - tdlsDisReqCmd->command = eSmeCommandTdlsDiscovery ; - tdlsDisReqCmd->u.tdlsCmd.size = sizeof(tTdlsDisReqCmdinfo) ; - smePushCommand(pMac, tdlsDisReqCmd, FALSE) ; - status = eHAL_STATUS_SUCCESS ; - } - } - - return status ; -} - -/* - * TDLS request API, called from HDD to enable TDLS link setup request - * in SME/CSR and send message to PE to trigger TDLS link setup procedure. - */ -eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSetupRequest *tdlsSetupReq) -{ - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tSmeCmd *tdlsSetupReqCmd ; - eHalStatus status = eHAL_STATUS_FAILURE ; - - if(tdlsSetupReq) - { - tdlsSetupReqCmd = csrGetCommandBuffer(pMac) ; - - if(tdlsSetupReqCmd) - { - tTdlsLinkSetupReqCmdinfo *setupCmdInfo = - &tdlsSetupReqCmd->u.tdlsCmd.u.tdlsLinkSetupReqCmdInfo ; - - vos_mem_zero(&tdlsSetupReqCmd->u.tdlsCmd, sizeof(tTdlsCmd)); - - tdlsSetupReqCmd->sessionId = sessionId; - - vos_mem_copy(setupCmdInfo->peerMac, - tdlsSetupReq->peerMac, sizeof(tSirMacAddr)) ; - tdlsSetupReqCmd->command = eSmeCommandTdlsLinkSetup ; - tdlsSetupReqCmd->u.tdlsCmd.size = sizeof(tTdlsLinkSetupReqCmdinfo) ; - smePushCommand(pMac, tdlsSetupReqCmd, FALSE) ; - status = eHAL_STATUS_SUCCESS ; - } - } - - return status ; -} -/* - * TDLS request API, called from HDD to enable TDLS link teardown request - * in SME/CSR and send message to PE to trigger TDLS link teardown procedure. - */ -eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId, - tCsrTdlsTeardownRequest *tdlsTeardownReq) -{ - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tSmeCmd *tdlsTeardownReqCmd ; - eHalStatus status = eHAL_STATUS_FAILURE ; - - if(tdlsTeardownReq) - { - tdlsTeardownReqCmd = csrGetCommandBuffer(pMac) ; - - if(tdlsTeardownReqCmd) - { - tTdlsLinkTeardownCmdinfo *teardownCmdInfo = - &tdlsTeardownReqCmd->u.tdlsCmd.u.tdlsLinkTeardownCmdInfo ; - - vos_mem_zero(&tdlsTeardownReqCmd->u.tdlsCmd, sizeof(tTdlsCmd)); - - tdlsTeardownReqCmd->sessionId = sessionId; - - vos_mem_copy(teardownCmdInfo->peerMac, - tdlsTeardownReq->peerMac, sizeof(tSirMacAddr)) ; - tdlsTeardownReqCmd->command = eSmeCommandTdlsLinkTear ; - tdlsTeardownReqCmd->u.tdlsCmd.size = - sizeof(tTdlsLinkTeardownCmdinfo) ; - smePushCommand(pMac, tdlsTeardownReqCmd, FALSE) ; - status = eHAL_STATUS_SUCCESS ; - } - } - - return status ; -} - -#endif - /* * TDLS messages sent to PE . */ @@ -541,7 +450,7 @@ eHalStatus tdlsSendMessage(tpAniSirGlobal pMac, tANI_U16 msg_type, pMsg->msgLen = (tANI_U16) (msg_size) ; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("sending msg = %d"), pMsg->type) ; + FL("sending msg = %d"), pMsg->type) ; /* Send message. */ if (palSendMBMessage(pMac->hHdd, pMsg) != eHAL_STATUS_SUCCESS) { @@ -605,7 +514,7 @@ eHalStatus csrTdlsProcessSendMgmt( tpAniSirGlobal pMac, tSmeCmd *cmd ) } // Send the request to PE. - smsLog( pMac, LOG1, "sending TDLS Mgmt Frame req to PE " ); + smsLog( pMac, LOG1, FL("sending TDLS Mgmt Frame req to PE " )); status = tdlsSendMessage(pMac, eWNI_SME_TDLS_SEND_MGMT_REQ, (void *)tdlsSendMgmtReq , sizeof(tSirTdlsSendMgmtReq)+tdlsSendMgmtCmdInfo->len) ; if(!HAL_STATUS_SUCCESS( status ) ) @@ -738,11 +647,7 @@ eHalStatus csrTdlsProcessDelSta( tpAniSirGlobal pMac, tSmeCmd *cmd ) tdlsDelStaCmdInfo->peerMac, sizeof(tSirMacAddr)) ; // Send the request to PE. -#ifdef WLAN_FEATURE_TDLS_DEBUG - smsLog( pMac, LOGE, -#else smsLog( pMac, LOG1, -#endif "sending TDLS Del Sta "MAC_ADDRESS_STR" req to PE", MAC_ADDR_ARRAY(tdlsDelStaCmdInfo->peerMac)); status = tdlsSendMessage(pMac, eWNI_SME_TDLS_DEL_STA_REQ, @@ -759,180 +664,29 @@ eHalStatus csrTdlsProcessDelSta( tpAniSirGlobal pMac, tSmeCmd *cmd ) eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac, tSmeCmd *cmd) { eSmeCommandType cmdType = cmd->command ; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - tTdlsCmd tdlsCmd = cmd->u.tdlsCmd ; -#endif - tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; + eHalStatus status = eHAL_STATUS_SUCCESS; switch(cmdType) { case eSmeCommandTdlsSendMgmt: - { - status = csrTdlsProcessSendMgmt( pMac, cmd ); - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - } + status = csrTdlsProcessSendMgmt(pMac, cmd); break ; case eSmeCommandTdlsAddPeer: - { - status = csrTdlsProcessAddSta( pMac, cmd ); - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - } + status = csrTdlsProcessAddSta(pMac, cmd); break; case eSmeCommandTdlsDelPeer: - { - status = csrTdlsProcessDelSta( pMac, cmd ); - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - } + status = csrTdlsProcessDelSta(pMac, cmd); break; case eSmeCommandTdlsLinkEstablish: - { - status = csrTdlsProcessLinkEstablish( pMac, cmd ); - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - } + status = csrTdlsProcessLinkEstablish(pMac, cmd); break; // tdlsoffchan case eSmeCommandTdlsChannelSwitch: - { - status = csrTdlsProcessChanSwitchReq( pMac, cmd ); - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - } + status = csrTdlsProcessChanSwitchReq(pMac, cmd); break; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eSmeCommandTdlsDiscovery: - { - tTdlsDisReqCmdinfo *disReqCmdInfo = &tdlsCmd.u.tdlsDisReqCmdInfo ; - tSirTdlsDisReq *disReq = NULL ; - tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, cmd->sessionId ); - - disReq = vos_mem_malloc(sizeof(tSirTdlsDisReq)); - if ( NULL == disReq ) - status = eHAL_STATUS_FAILURE; - else - status = eHAL_STATUS_SUCCESS; - - if(!HAL_STATUS_SUCCESS( status ) ) - { - smsLog( pMac, LOGE, "dis Req alloc failed " ); - VOS_ASSERT(0) ; - break ; - } - disReq->sessionId = cmd->sessionId; - disReq->transactionId = 0; /* TODO ? */ - disReq->reqType = disReqCmdInfo->tdlsDisType ; - vos_mem_copy( disReq->bssid, pSession->pConnectBssDesc->bssId, - sizeof (tSirMacAddr)); - vos_mem_copy( disReq->peerMac, - disReqCmdInfo->peerMac, sizeof(tSirMacAddr)) ; - smsLog( pMac, LOGE, "sending TDLS discovery to PE " ); - status = tdlsSendMessage(pMac, eWNI_SME_TDLS_DISCOVERY_START_REQ, - (void *)disReq , sizeof(tSirTdlsDisReq)) ; - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - /* TODO: Add error handling */ - - break ; - } - case eSmeCommandTdlsLinkSetup: - { - tTdlsLinkSetupReqCmdinfo *linkSetupReqCmdInfo = - &tdlsCmd.u.tdlsLinkSetupReqCmdInfo ; - tSirTdlsSetupReq *setupReq = NULL ; - tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, cmd->sessionId ); - - setupReq = vos_mem_malloc(sizeof(tSirTdlsSetupReq)); - if ( NULL == setupReq ) - status = eHAL_STATUS_FAILURE; - else - status = eHAL_STATUS_SUCCESS; - - - if(!HAL_STATUS_SUCCESS( status ) ) - { - smsLog( pMac, LOGE, "dis Req alloc failed " ); - VOS_ASSERT(0) ; - break ; - } - setupReq->sessionId = cmd->sessionId; - setupReq->transactionId = 0; /* TODO ? */ - - vos_mem_copy( setupReq->bssid, pSession->pConnectBssDesc->bssId, - sizeof (tSirMacAddr)); - vos_mem_copy( setupReq->peerMac, - linkSetupReqCmdInfo->peerMac, sizeof(tSirMacAddr)) ; - - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("sending TDLS link setup to PE ")); - status = tdlsSendMessage(pMac, eWNI_SME_TDLS_LINK_START_REQ, - (void *)setupReq , sizeof(tSirTdlsSetupReq) ) ; - - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - /* TODO: Add error handling */ - break ; - } - case eSmeCommandTdlsLinkTear: - { - tTdlsLinkTeardownCmdinfo *linkTeardownCmdInfo = - &tdlsCmd.u.tdlsLinkTeardownCmdInfo ; - tSirTdlsTeardownReq *teardownReq = NULL ; - tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, cmd->sessionId ); - - teardownReq = vos_mem_malloc(sizeof(tSirTdlsTeardownReq)); - if ( NULL == teardownReq ) - status = eHAL_STATUS_FAILURE; - else - status = eHAL_STATUS_SUCCESS; - - if(!HAL_STATUS_SUCCESS( status ) ) - { - smsLog( pMac, LOGE, "teardown Req alloc failed " ); - VOS_ASSERT(0) ; - break ; - } - teardownReq->sessionId = cmd->sessionId; - teardownReq->transactionId = 0; /* TODO ? */ - - vos_mem_copy( teardownReq->bssid, pSession->pConnectBssDesc->bssId, - sizeof (tSirMacAddr)); - vos_mem_copy( &teardownReq->peerMac, - linkTeardownCmdInfo->peerMac, sizeof(tSirMacAddr)) ; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("teardown request..")) ; - status = tdlsSendMessage(pMac, eWNI_SME_TDLS_TEARDOWN_REQ, - (void *)teardownReq , sizeof(tSirTdlsTeardownReq)) ; - - if(HAL_STATUS_SUCCESS( status ) ) - { - status = eANI_BOOLEAN_FALSE ; - } - /* TODO: Add error handling */ - break ; - } -#endif default: - { + status = eHAL_STATUS_FAILURE; /* TODO: Add defualt handling */ break ; - } - } return status ; } @@ -979,7 +733,8 @@ eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd ) tdlsLinkEstablishReq->isResponder= tdlsLinkEstablishCmdInfo->isResponder; tdlsLinkEstablishReq->uapsdQueues= tdlsLinkEstablishCmdInfo->uapsdQueues; tdlsLinkEstablishReq->maxSp= tdlsLinkEstablishCmdInfo->maxSp; - + tdlsLinkEstablishReq->isOffChannelSupported = + tdlsLinkEstablishCmdInfo->isOffChannelSupported; // Send the request to PE. smsLog( pMac, LOGE, "sending TDLS Link Establish Request to PE \n" ); @@ -1038,137 +793,6 @@ eHalStatus csrTdlsProcessChanSwitchReq( tpAniSirGlobal pMac, tSmeCmd *cmd ) return status; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * Find specific TDLS peer (based on peer MAC address). - */ -tCsrTdlsPeerLinkinfo *findTdlsPeer(tpAniSirGlobal pMac, - tDblLinkList *peerList, tSirMacAddr peerMac) -{ - tListElem *pEntry = NULL ; - tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; - tSirTdlsPeerInfo *peerInfo = NULL ; - - pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); - while(pEntry) - { - peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, - tdlsPeerStaLink) ; - peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; - - if ( vos_mem_compare( (tANI_U8 *)peerInfo->peerMac, - (tANI_U8 *) peerMac, sizeof(tSirMacAddr)) ) - { - break ; - } - - pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; - } - - return ((pEntry) ? peerLinkInfo: NULL) ; -} -/* - * Delete TDLD peer info, called from TDLS teardown request. - */ -static eHalStatus tdlsDeleteTdlsPeerInfo(tpAniSirGlobal pMac, - tSirMacAddr peerMac) -{ - tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; - tCsrTdlsPeerLinkinfo *peerInfo = - findTdlsPeer(pMac, &disInfo->tdlsPotentialPeerList, peerMac) ; - eHalStatus status = eHAL_STATUS_FAILURE ; - - if((csrLLRemoveEntry(&disInfo->tdlsPotentialPeerList, - &peerInfo->tdlsPeerStaLink, LL_ACCESS_NOLOCK))) - { - vos_mem_free((void *)peerInfo) ; - status = eHAL_STATUS_SUCCESS; - - } - - return status ; -} - -/* - * UPDATE TDLS peer state to TDLS LINK STATE, this will be called after - * link is successfully setup with TDLS Peer. - */ -static eHalStatus tdlsUpdateTdlsPeerState(tpAniSirGlobal pMac, - tSirMacAddr peerMac,tANI_U8 state ) -{ - tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; - tCsrTdlsPeerLinkinfo *peerLinkInfo = - findTdlsPeer(pMac, &disInfo->tdlsPotentialPeerList, peerMac) ; - eHalStatus status = eHAL_STATUS_FAILURE ; - - if(peerLinkInfo) - { - tSirTdlsPeerInfo *peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; - peerInfo->tdlsPeerState = state ; - status = eHAL_STATUS_SUCCESS ; - } - else - { - /* TODO: update this peer found in link setup in peer list */ - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("This TDLS client is not in discovery list ") ); - status = eHAL_STATUS_SUCCESS ; - } - - return status ; -} - -/* - * save TDLS peer info, this will be called after successfull completion - * of TDLS discovery procedure. - */ -static eHalStatus tdlsSaveTdlsPeerInfo(tpAniSirGlobal pMac, - tSirTdlsPeerInfo *disPeerInfo) -{ - tCsrTdlsPeerLinkinfo *peerInfo = NULL ; - tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; - eHalStatus status = eHAL_STATUS_FAILURE ; - /* - * Ok, allocate memory for peer info here - * we allocate memory for each peer here and free his memory - * at the time the peer node is getting deleted, possible case is - * teardown - */ - peerInfo = vos_mem_malloc(sizeof(tCsrTdlsPeerLinkinfo)); - if ( NULL = peerInfo ) - status = eHAL_STATUS_FAILURE; - else - status = eHAL_STATUS_SUCCESS; - - /* - * go ahead and copy peerInfo and insert this node info discovery rsp - * database. - */ - if (HAL_STATUS_SUCCESS(status)) - { - vos_mem_set( &peerInfo->tdlsDisPeerInfo, - sizeof(tSirTdlsPeerInfo), 0); - vos_mem_copy( &peerInfo->tdlsDisPeerInfo, disPeerInfo, - sizeof(tSirTdlsPeerInfo)); - - /* - * update TDLS client count to indicate there is tdls client - * in tdls potential peer list. - */ - disInfo->tdlsPeerCount++ ; - - /* - * finally insert this tdls peer info into tdls potential peer list - */ - csrLLInsertTail( &disInfo->tdlsPotentialPeerList, - &peerInfo->tdlsPeerStaLink, LL_ACCESS_LOCK ); - } - - return status ; - -} - -#endif /* * TDLS Message processor, will be called after TDLS message recieved from * PE @@ -1180,8 +804,20 @@ eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, { case eWNI_SME_TDLS_SEND_MGMT_RSP: { + tSirSmeRsp *pMsg = (tSirSmeRsp*) pMsgBuf; + tCsrRoamInfo roamInfo = {0} ; + /* remove pending eSmeCommandTdlsDiscovery command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsSendMgmt) ; + + if (eSIR_SME_SUCCESS != pMsg->statusCode) + { + /* Tx failed, so there wont be any ack confirmation*/ + /* Indicate ack failure to upper layer */ + roamInfo.reasonCode = 0; + csrRoamCallCallback(pMac, pMsg->sessionId, &roamInfo, + 0, eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, 0); + } } break; case eWNI_SME_TDLS_ADD_STA_RSP: @@ -1302,154 +938,6 @@ eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsChannelSwitch); break; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eWNI_SME_TDLS_DISCOVERY_START_RSP: - { - /* remove pending eSmeCommandTdlsDiscovery command */ - csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsDiscovery) ; - } - /* fall through .. */ - case eWNI_SME_TDLS_DISCOVERY_START_IND: - { - tSirTdlsDisRsp *disRsp = (tSirTdlsDisRsp *)pMsgBuf ; - - if(eSIR_SME_SUCCESS == disRsp->statusCode) - { - tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; - tANI_U16 disStaCount = disRsp->numDisSta ; - tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; - tANI_U8 i = 0 ; - - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("DIS START RSP/IND recieved sta count = %d"), disStaCount) ; - for( ; i < disStaCount ; i++) - { - tSirTdlsPeerInfo *peerInfo = &disRsp->tdlsDisPeerInfo[i] ; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("SME, peer MAC: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(peerInfo->peerMac)); - - peerLinkInfo = findTdlsPeer(pMac, - &disInfo->tdlsPotentialPeerList, - peerInfo->peerMac) ; - - if(NULL == peerLinkInfo) - { - /* update discovery data base, if this is new entry */ - tdlsSaveTdlsPeerInfo(pMac, peerInfo) ; - } - else - { - /* update RSSI of existing peer */ - tSirTdlsPeerInfo *newPeerInfo = - &peerLinkInfo->tdlsDisPeerInfo ; - newPeerInfo->tdlsPeerRssi = peerInfo->tdlsPeerRssi ; - } - } - if(0 == i) - { - smsLog( pMac, LOGW, "there is no tdls client \ - discovered .." ) ; - } - } - else - { - smsLog( pMac, LOGW, "there is no tdls client discovered .." ); - } - /* Now free the memory for this message */ - break ; - } - case eWNI_SME_TDLS_LINK_START_RSP: - { - /* remove pending eSmeCommandTdlsLinkSetup command */ - csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsLinkSetup) ; - } - /* fall through .. */ - case eWNI_SME_TDLS_LINK_START_IND: - { - tSirTdlsLinksetupRsp *linkSetupRsp = - (tSirTdlsLinksetupRsp *) pMsgBuf ; - - if(eSIR_SME_SUCCESS == linkSetupRsp->statusCode) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("Link setup for Peer "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(linkSetupRsp->peerMac)); - - tdlsUpdateTdlsPeerState(pMac, linkSetupRsp->peerMac, - TDLS_LINK_SETUP_STATE) ; - } - else - { - smsLog( pMac, LOGW, "failure receieved in link setup .." ); - } - break ; - } - - case eWNI_SME_TDLS_TEARDOWN_RSP: - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("TEARDOWN RSP from PE ")) ; - /* remove pending eSmeCommandTdlsLinkTear command */ - csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsLinkTear) ; - } - /* fall through .. */ - case eWNI_SME_TDLS_TEARDOWN_IND: - { - tSirTdlsTeardownRsp *linkTearRsp = - (tSirTdlsTeardownRsp *) pMsgBuf ; - if(eSIR_SME_SUCCESS == linkTearRsp->statusCode) - { - - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("Teardown peer MAC = "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(linkTearRsp->peerMac)); - tdlsDeleteTdlsPeerInfo(pMac, linkTearRsp->peerMac) ; - } - else - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("failure receieved in Teardown .." )); - } - break ; - } - case eWNI_SME_ADD_TDLS_PEER_IND: - { - tSirTdlsPeerInd *peerInd = (tSirTdlsPeerInd *) pMsgBuf ; - tCsrRoamInfo roamInfo = {0} ; - vos_mem_copy( &roamInfo.peerMac, peerInd->peerMac, - sizeof(tSirMacAddr)) ; - roamInfo.staId = peerInd->staId ; - roamInfo.ucastSig = peerInd->ucastSig ; - roamInfo.bcastSig = peerInd->bcastSig ; - /* - * register peer with TL, we have to go through HDD as this is - * the only way to register any STA with TL. - */ - csrRoamCallCallback(pMac, peerInd->sessionId, &roamInfo, 0, - eCSR_ROAM_TDLS_STATUS_UPDATE, - eCSR_ROAM_RESULT_ADD_TDLS_PEER); - break ; - - } - case eWNI_SME_DELETE_TDLS_PEER_IND: - { - tSirTdlsPeerInd *peerInd = (tSirTdlsPeerInd *) pMsgBuf ; - tCsrRoamInfo roamInfo = {0} ; - vos_mem_copy( &roamInfo.peerMac, peerInd->peerMac, - sizeof(tSirMacAddr)) ; - roamInfo.staId = peerInd->staId ; - /* - * register peer with TL, we have to go through HDD as this is - * the only way to register any STA with TL. - */ - csrRoamCallCallback(pMac, peerInd->sessionId, &roamInfo, 0, - eCSR_ROAM_TDLS_STATUS_UPDATE, - eCSR_ROAM_RESULT_DELETE_TDLS_PEER); - break ; - - } -#endif default: { break ; diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c b/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c index 730e4403865c..3e2732f81a4a 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1243,14 +1243,67 @@ get_eRoamCmdStatus_str(eRoamCmdStatus val) switch (val) { CASE_RETURN_STR(eCSR_ROAM_CANCELLED); + CASE_RETURN_STR(eCSR_ROAM_FAILED); CASE_RETURN_STR(eCSR_ROAM_ROAMING_START); CASE_RETURN_STR(eCSR_ROAM_ROAMING_COMPLETION); + CASE_RETURN_STR(eCSR_ROAM_CONNECT_COMPLETION); CASE_RETURN_STR(eCSR_ROAM_ASSOCIATION_START); CASE_RETURN_STR(eCSR_ROAM_ASSOCIATION_COMPLETION); CASE_RETURN_STR(eCSR_ROAM_DISASSOCIATED); CASE_RETURN_STR(eCSR_ROAM_SHOULD_ROAM); CASE_RETURN_STR(eCSR_ROAM_SCAN_FOUND_NEW_BSS); CASE_RETURN_STR(eCSR_ROAM_LOSTLINK); + CASE_RETURN_STR(eCSR_ROAM_LOSTLINK_DETECTED); + CASE_RETURN_STR(eCSR_ROAM_MIC_ERROR_IND); + CASE_RETURN_STR(eCSR_ROAM_IBSS_IND); + CASE_RETURN_STR(eCSR_ROAM_CONNECT_STATUS_UPDATE); + CASE_RETURN_STR(eCSR_ROAM_GEN_INFO); + CASE_RETURN_STR(eCSR_ROAM_SET_KEY_COMPLETE); + CASE_RETURN_STR(eCSR_ROAM_REMOVE_KEY_COMPLETE); + CASE_RETURN_STR(eCSR_ROAM_IBSS_LEAVE); + CASE_RETURN_STR(eCSR_ROAM_WDS_IND); + CASE_RETURN_STR(eCSR_ROAM_INFRA_IND); + CASE_RETURN_STR(eCSR_ROAM_WPS_PBC_PROBE_REQ_IND); +#ifdef WLAN_FEATURE_VOWIFI_11R + CASE_RETURN_STR(eCSR_ROAM_FT_RESPONSE); +#endif + CASE_RETURN_STR(eCSR_ROAM_FT_START); + CASE_RETURN_STR(eCSR_ROAM_REMAIN_CHAN_READY); + CASE_RETURN_STR(eCSR_ROAM_SEND_ACTION_CNF); + CASE_RETURN_STR(eCSR_ROAM_SESSION_OPENED); + CASE_RETURN_STR(eCSR_ROAM_FT_REASSOC_FAILED); +#ifdef FEATURE_WLAN_LFR + CASE_RETURN_STR(eCSR_ROAM_PMK_NOTIFY); +#endif +#ifdef FEATURE_WLAN_LFR_METRICS + CASE_RETURN_STR(eCSR_ROAM_PREAUTH_INIT_NOTIFY); + CASE_RETURN_STR(eCSR_ROAM_PREAUTH_STATUS_SUCCESS); + CASE_RETURN_STR(eCSR_ROAM_PREAUTH_STATUS_FAILURE); + CASE_RETURN_STR(eCSR_ROAM_HANDOVER_SUCCESS); +#endif +#ifdef FEATURE_WLAN_TDLS + CASE_RETURN_STR(eCSR_ROAM_TDLS_STATUS_UPDATE); + CASE_RETURN_STR(eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND); +#endif + CASE_RETURN_STR(eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS); + CASE_RETURN_STR(eCSR_ROAM_SEND_P2P_STOP_BSS); +#ifdef WLAN_FEATURE_11W + CASE_RETURN_STR(eCSR_ROAM_UNPROT_MGMT_FRAME_IND); +#endif +#ifdef WLAN_FEATURE_RMC + CASE_RETURN_STR(eCSR_ROAM_IBSS_PEER_INFO_COMPLETE); +#endif +#ifdef WLAN_FEATURE_AP_HT40_24G + CASE_RETURN_STR(eCSR_ROAM_2040_COEX_INFO_IND); +#endif +#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) + CASE_RETURN_STR(eCSR_ROAM_TSM_IE_IND); + CASE_RETURN_STR(eCSR_ROAM_CCKM_PREAUTH_NOTIFY); + CASE_RETURN_STR(eCSR_ROAM_ESE_ADJ_AP_REPORT_IND); + CASE_RETURN_STR(eCSR_ROAM_ESE_BCN_REPORT_IND); +#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ + CASE_RETURN_STR(eCSR_ROAM_UPDATE_MAX_RATE_IND); + CASE_RETURN_STR(eCSR_ROAM_LOST_LINK_PARAMS_IND); default: return "unknown"; } @@ -2056,8 +2109,37 @@ eHalStatus csrGetParsedBssDescriptionIEs(tHalHandle hHal, tSirBssDescription *pB return (status); } +eHalStatus csrProcessGetFrameLogCommand( tpAniSirGlobal pMac, + tSmeCmd *pCommand ) +{ + tAniGetFrameLogReq *pMsg; + tANI_U16 msgLen; + eHalStatus status = eHAL_STATUS_FAILURE; + + msgLen = sizeof(tAniGetFrameLogReq); + if ( NULL == pCommand ) + { + smsLog( pMac, LOGE, FL("cannot process. cmd is null") ); + return eHAL_STATUS_FAILURE; + } + pMsg = vos_mem_malloc(msgLen); + if ( NULL == pMsg ) + { + smsLog( pMac, LOGE, FL("fail to allocate memory") ); + return eHAL_STATUS_FAILURE; + } + + pMsg->msgType= pal_cpu_to_be16((tANI_U16)WDA_GET_FRAME_LOG_REQ); + pMsg->msgLen= pal_cpu_to_be16(msgLen); + + pMsg->getFrameLogCmdFlag = pCommand->u.getFramelogCmd.getFrameLogCmdFlag; + + status = palSendMBMessage(pMac->hHdd, pMsg); + + return( status ); +} tANI_BOOLEAN csrIsNULLSSID( tANI_U8 *pBssSsid, tANI_U8 len ) { @@ -2169,7 +2251,15 @@ tANI_U32 csrTranslateToWNICfgDot11Mode(tpAniSirGlobal pMac, eCsrCfgDot11Mode csr } else { - ret = WNI_CFG_DOT11_MODE_11AC; +#ifdef WLAN_FEATURE_11AC + if ( IS_FEATURE_SUPPORTED_BY_DRIVER(DOT11AC) && + IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) + ret = WNI_CFG_DOT11_MODE_11AC; + else + ret = WNI_CFG_DOT11_MODE_11N; +#else + ret = WNI_CFG_DOT11_MODE_11N; +#endif } break; case eCSR_CFG_DOT11_MODE_TAURUS: @@ -2194,19 +2284,27 @@ tANI_U32 csrTranslateToWNICfgDot11Mode(tpAniSirGlobal pMac, eCsrCfgDot11Mode csr ret = WNI_CFG_DOT11_MODE_TITAN; break; case eCSR_CFG_DOT11_MODE_11G_ONLY: - ret = WNI_CFG_DOT11_MODE_11G_ONLY; - break; + ret = WNI_CFG_DOT11_MODE_11G_ONLY; + break; case eCSR_CFG_DOT11_MODE_11N_ONLY: - ret = WNI_CFG_DOT11_MODE_11N_ONLY; - break; + ret = WNI_CFG_DOT11_MODE_11N_ONLY; + break; #ifdef WLAN_FEATURE_11AC - case eCSR_CFG_DOT11_MODE_11AC_ONLY: - ret = WNI_CFG_DOT11_MODE_11AC_ONLY; + case eCSR_CFG_DOT11_MODE_11AC_ONLY: + if ( IS_FEATURE_SUPPORTED_BY_DRIVER(DOT11AC) && + IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) + ret = WNI_CFG_DOT11_MODE_11AC_ONLY; + else + ret = WNI_CFG_DOT11_MODE_11N; + break; + case eCSR_CFG_DOT11_MODE_11AC: + if ( IS_FEATURE_SUPPORTED_BY_DRIVER(DOT11AC) && + IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) + ret = WNI_CFG_DOT11_MODE_11AC; + else + ret = WNI_CFG_DOT11_MODE_11N; break; - case eCSR_CFG_DOT11_MODE_11AC: - ret = WNI_CFG_DOT11_MODE_11AC; - break; #endif default: smsLog(pMac, LOGW, FL("doesn't expect %d as csrDo11Mode"), csrDot11Mode); @@ -2242,19 +2340,18 @@ eHalStatus csrGetPhyModeFromBss(tpAniSirGlobal pMac, tSirBssDescription *pBSSDes { phyMode = eCSR_DOT11_MODE_TAURUS; } - } - } + } + } if(pIes->HTCaps.present && (eCSR_DOT11_MODE_TAURUS != phyMode)) { phyMode = eCSR_DOT11_MODE_11n; - } - #ifdef WLAN_FEATURE_11AC - if ( pIes->VHTCaps.present && (eCSR_DOT11_MODE_TAURUS != phyMode)) - { - phyMode = eCSR_DOT11_MODE_11ac; - } + if (IS_BSS_VHT_CAPABLE(pIes->VHTCaps)) + { + phyMode = eCSR_DOT11_MODE_11ac; + } #endif + } *pPhyMode = phyMode; } @@ -3732,8 +3829,14 @@ tANI_BOOLEAN csrGetRSNInformation( tHalHandle hHal, tCsrAuthList *pAuthType, eCs Capabilities->NoPairwise = (pRSNIe->RSN_Cap[0] >> 1) & 0x1 ; // Bit 1 No Pairwise Capabilities->PTKSAReplayCounter = (pRSNIe->RSN_Cap[0] >> 2) & 0x3 ; // Bit 2, 3 PTKSA Replay Counter Capabilities->GTKSAReplayCounter = (pRSNIe->RSN_Cap[0] >> 4) & 0x3 ; // Bit 4, 5 GTKSA Replay Counter +#ifdef WLAN_FEATURE_11W Capabilities->MFPRequired = (pRSNIe->RSN_Cap[0] >> 6) & 0x1 ; // Bit 6 MFPR Capabilities->MFPCapable = (pRSNIe->RSN_Cap[0] >> 7) & 0x1 ; // Bit 7 MFPC +#else + Capabilities->MFPRequired = 0 ; // Bit 6 MFPR + Capabilities->MFPCapable = 0 ; // Bit 7 MFPC +#endif + Capabilities->Reserved = pRSNIe->RSN_Cap[1] & 0xff ; // remaining reserved } } @@ -3894,7 +3997,7 @@ tANI_BOOLEAN csrLookupPMKID( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U8 *p fRC = TRUE; } while( 0 ); - smsLog(pMac, LOGW, "csrLookupPMKID called return match = %d pMac->roam.NumPmkidCache = %d", + smsLog(pMac, LOG1, "csrLookupPMKID called return match = %d pMac->roam.NumPmkidCache = %d", fRC, pSession->NumPmkidCache); return fRC; @@ -5162,6 +5265,14 @@ tANI_BOOLEAN csrIsSsidMatch( tpAniSirGlobal pMac, tANI_U8 *ssid1, tANI_U8 ssid1L tANI_BOOLEAN fMatch = FALSE; do { + // Check for the specification of the Broadcast SSID at the beginning + // of the list. If specified, then all SSIDs are matches + // (broadcast SSID means accept all SSIDs). + if ( ssid1Len == 0 ) + { + fMatch = TRUE; + break; + } // There are a few special cases. If the Bss description has a Broadcast SSID, // then our Profile must have a single SSID without Wildcards so we can program @@ -5178,14 +5289,6 @@ tANI_BOOLEAN csrIsSsidMatch( tpAniSirGlobal pMac, tANI_U8 *ssid1, tANI_U8 ssid1L break; } - // Check for the specification of the Broadcast SSID at the beginning of the list. - // If specified, then all SSIDs are matches (broadcast SSID means accept all SSIDs). - if ( ssid1Len == 0 ) - { - fMatch = TRUE; - break; - } - if(ssid1Len != bssSsidLen) break; if (vos_mem_compare(bssSsid, ssid1, bssSsidLen)) { @@ -5729,7 +5832,7 @@ tANI_BOOLEAN csrMatchBSS( tHalHandle hHal, tSirBssDescription *pBssDesc, tCsrSca break; #ifdef WLAN_FEATURE_VOWIFI_11R - if (pFilter->MDID.mdiePresent) + if (pFilter->MDID.mdiePresent && csrRoamIs11rAssoc(pMac)) { if (pBssDesc->mdiePresent) { @@ -5826,6 +5929,103 @@ tANI_BOOLEAN csrMatchBSSToConnectProfile( tHalHandle hHal, tCsrRoamConnectedProf +void csrAddRateBitmap(tANI_U8 rate, tANI_U16 *pRateBitmap) +{ + tANI_U16 rateBitmap; + tANI_U16 n = BITS_OFF( rate, CSR_DOT11_BASIC_RATE_MASK ); + rateBitmap = *pRateBitmap; + switch(n) + { + case SIR_MAC_RATE_1: + rateBitmap |= SIR_MAC_RATE_1_BITMAP; + break; + case SIR_MAC_RATE_2: + rateBitmap |= SIR_MAC_RATE_2_BITMAP; + break; + case SIR_MAC_RATE_5_5: + rateBitmap |= SIR_MAC_RATE_5_5_BITMAP; + break; + case SIR_MAC_RATE_11: + rateBitmap |= SIR_MAC_RATE_11_BITMAP; + break; + case SIR_MAC_RATE_6: + rateBitmap |= SIR_MAC_RATE_6_BITMAP; + break; + case SIR_MAC_RATE_9: + rateBitmap |= SIR_MAC_RATE_9_BITMAP; + break; + case SIR_MAC_RATE_12: + rateBitmap |= SIR_MAC_RATE_12_BITMAP; + break; + case SIR_MAC_RATE_18: + rateBitmap |= SIR_MAC_RATE_18_BITMAP; + break; + case SIR_MAC_RATE_24: + rateBitmap |= SIR_MAC_RATE_24_BITMAP; + break; + case SIR_MAC_RATE_36: + rateBitmap |= SIR_MAC_RATE_36_BITMAP; + break; + case SIR_MAC_RATE_48: + rateBitmap |= SIR_MAC_RATE_48_BITMAP; + break; + case SIR_MAC_RATE_54: + rateBitmap |= SIR_MAC_RATE_54_BITMAP; + break; + } + *pRateBitmap = rateBitmap; +} + + + +tANI_BOOLEAN csrIsRateAlreadyPresent(tANI_U8 rate, tANI_U16 rateBitmap) +{ + tANI_U16 n = BITS_OFF( rate, CSR_DOT11_BASIC_RATE_MASK ); + + switch(n) + { + case SIR_MAC_RATE_1: + rateBitmap &= SIR_MAC_RATE_1_BITMAP; + break; + case SIR_MAC_RATE_2: + rateBitmap &= SIR_MAC_RATE_2_BITMAP; + break; + case SIR_MAC_RATE_5_5: + rateBitmap &= SIR_MAC_RATE_5_5_BITMAP; + break; + case SIR_MAC_RATE_11: + rateBitmap &= SIR_MAC_RATE_11_BITMAP; + break; + case SIR_MAC_RATE_6: + rateBitmap &= SIR_MAC_RATE_6_BITMAP; + break; + case SIR_MAC_RATE_9: + rateBitmap &= SIR_MAC_RATE_9_BITMAP; + break; + case SIR_MAC_RATE_12: + rateBitmap &= SIR_MAC_RATE_12_BITMAP; + break; + case SIR_MAC_RATE_18: + rateBitmap &= SIR_MAC_RATE_18_BITMAP; + break; + case SIR_MAC_RATE_24: + rateBitmap &= SIR_MAC_RATE_24_BITMAP; + break; + case SIR_MAC_RATE_36: + rateBitmap &= SIR_MAC_RATE_36_BITMAP; + break; + case SIR_MAC_RATE_48: + rateBitmap &= SIR_MAC_RATE_48_BITMAP; + break; + case SIR_MAC_RATE_54: + rateBitmap &= SIR_MAC_RATE_54_BITMAP; + break; + } + return !!rateBitmap; +} + + + tANI_BOOLEAN csrRatesIsDot11RateSupported( tHalHandle hHal, tANI_U8 rate ) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -5993,7 +6193,7 @@ void csrReleaseProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile) if (pProfile->nAddIEScanLength) { - memset(pProfile->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH+2); + memset(pProfile->addIEScan, 0 , SIR_MAC_MAX_ADD_IE_LENGTH+2); pProfile->nAddIEScanLength = 0; } diff --git a/drivers/staging/prima/CORE/SME/src/nan/nan_Api.c b/drivers/staging/prima/CORE/SME/src/nan/nan_Api.c new file mode 100644 index 000000000000..3ccf954c2999 --- /dev/null +++ b/drivers/staging/prima/CORE/SME/src/nan/nan_Api.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#include "sme_Api.h" +#include "smsDebug.h" +#include "csrInsideApi.h" +#include "smeInside.h" +#include "limApi.h" +#include "cfgApi.h" + +/****************************************************************************** + * Function: sme_NanRegisterCallback + * + * Description: + * This function gets called when HDD wants register nan rsp callback with + * sme layer. + * + * Args: + * hHal and callback which needs to be registered. + * + * Returns: + * void + *****************************************************************************/ +void sme_NanRegisterCallback(tHalHandle hHal, NanCallback callback) +{ + tpAniSirGlobal pMac = NULL; + + if (NULL == hHal) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return; + } + pMac = PMAC_STRUCT(hHal); + pMac->sme.nanCallback = callback; +} + +/****************************************************************************** + * Function: sme_NanRequest + * + * Description: + * This function gets called when HDD receives NAN vendor command + * from userspace + * + * Args: + * hHal, Nan Request structure ptr and sessionId + * + * Returns: + * VOS_STATUS + *****************************************************************************/ +VOS_STATUS sme_NanRequest(tHalHandle hHalHandle, tpNanRequestReq input, + tANI_U32 sessionId) +{ + tNanRequest *pNanReq = NULL; + size_t data_len; + tSmeCmd *pCommand; + tpAniSirGlobal pMac = PMAC_STRUCT(hHalHandle); + + pCommand = csrGetCommandBuffer(pMac); + if (NULL == pCommand) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Failed to get command buffer for nan req")); + return eHAL_STATUS_RESOURCES; + } + + data_len = sizeof(tNanRequest) - sizeof(pNanReq->request_data) + + input->request_data_len; + pNanReq = vos_mem_malloc(data_len); + + if (pNanReq == NULL) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Memory allocation failure, size : %zu"), data_len); + csrReleaseCommand(pMac, pCommand); + return eHAL_STATUS_RESOURCES; + } + + smsLog(pMac, LOG1, "Posting NAN command to csr queue"); + vos_mem_zero(pNanReq, data_len); + pNanReq->request_data_len = input->request_data_len; + vos_mem_copy(pNanReq->request_data, + input->request_data, + input->request_data_len); + + pCommand->command = eSmeCommandNanReq; + pCommand->sessionId = sessionId; + pCommand->u.pNanReq = pNanReq; + + if (!HAL_STATUS_SUCCESS(csrQueueSmeCommand(pMac, pCommand, TRUE))) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("failed to post eSmeCommandNanReq command")); + csrReleaseCommand(pMac, pCommand); + vos_mem_free(pNanReq); + return VOS_STATUS_E_FAILURE; + } + + return VOS_STATUS_SUCCESS; +} + +/****************************************************************************** + * Function: sme_NanEvent + * + * Description: + * This callback function will be called when SME received eWNI_SME_NAN_EVENT + * event from WMA + * + * Args: + * hHal - HAL handle for device + * pMsg - Message body passed from WDA; includes NAN header + * + * Returns: + * VOS_STATUS +******************************************************************************/ +VOS_STATUS sme_NanEvent(tHalHandle hHal, void* pMsg) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + VOS_STATUS status = VOS_STATUS_SUCCESS; + + if (NULL == pMsg) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("msg ptr is NULL")); + status = VOS_STATUS_E_FAILURE; + } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_MED, + FL("SME: Received sme_NanEvent")); + if (pMac->sme.nanCallback) + { + pMac->sme.nanCallback(pMac->hHdd, (tSirNanEvent *)pMsg); + } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("nanCallback is NULL")); + } + } + + return status; +} diff --git a/drivers/staging/prima/CORE/SME/src/oemData/oemDataApi.c b/drivers/staging/prima/CORE/SME/src/oemData/oemDataApi.c index d709d471825f..2227b60ace29 100644 --- a/drivers/staging/prima/CORE/SME/src/oemData/oemDataApi.c +++ b/drivers/staging/prima/CORE/SME/src/oemData/oemDataApi.c @@ -272,6 +272,12 @@ eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pOemDa else { smsLog(pMac, LOG1, "%s: OEM_DATA REQ not allowed in the current mode", __func__); + status = eHAL_STATUS_FAILURE; + } + + if(!HAL_STATUS_SUCCESS(status)) + { + smsLog(pMac, LOG1, "%s: OEM_DATA Failure, Release command", __func__); oemData_ReleaseOemDataReqCommand(pMac, pOemDataReqCmd, eOEM_DATA_REQ_INVALID_MODE); pMac->oemData.oemDataReqActive = eANI_BOOLEAN_FALSE; } diff --git a/drivers/staging/prima/CORE/SME/src/p2p/p2p_Api.c b/drivers/staging/prima/CORE/SME/src/p2p/p2p_Api.c index 16a98547a8d3..58bb906272f7 100644 --- a/drivers/staging/prima/CORE/SME/src/p2p/p2p_Api.c +++ b/drivers/staging/prima/CORE/SME/src/p2p/p2p_Api.c @@ -46,6 +46,38 @@ static tANI_BOOLEAN p2pIsGOportEnabled(tpAniSirGlobal pMac); #endif eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); +/*------------------------------------------------------------------ + * + * Release RoC Request command. + * + *------------------------------------------------------------------*/ + +void csrReleaseRocReqCommand(tpAniSirGlobal pMac) +{ + tListElem *pEntry = NULL; + tSmeCmd *pCommand = NULL; + + pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); + if ( pEntry ) + { + pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); + if ( eSmeCommandRemainOnChannel == pCommand->command ) + { + remainOnChanCallback callback = pCommand->u.remainChlCmd.callback; + /* process the msg */ + if ( callback ) + callback(pMac, pCommand->u.remainChlCmd.callbackCtx, 0); + smsLog(pMac, LOGE, FL("Remove RoC Request from Sme Active Cmd List ")); + if ( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) ) + { + //Now put this command back on the avilable command list + smeReleaseCommand(pMac, pCommand); + } + } + } +} + + /*------------------------------------------------------------------ * * handle SME remain on channel request. @@ -62,7 +94,8 @@ eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemaino if(!pSession) { smsLog(pMac, LOGE, FL(" session %d not found "), p2pRemainonChn->sessionId); - return eHAL_STATUS_FAILURE; + status = eHAL_STATUS_FAILURE; + goto error; } #ifdef WLAN_FEATURE_P2P_INTERNAL @@ -76,14 +109,16 @@ eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemaino { smsLog(pMac, LOGE, FL(" session %d (P2P session %d) is invalid or listen is disabled "), p2pRemainonChn->sessionId, P2PsessionId); - return eHAL_STATUS_FAILURE; + status = eHAL_STATUS_FAILURE; + goto error; } #else if(!pSession->sessionActive) { smsLog(pMac, LOGE, FL(" session %d is invalid or listen is disabled "), p2pRemainonChn->sessionId); - return eHAL_STATUS_FAILURE; + status = eHAL_STATUS_FAILURE; + goto error; } #endif #ifdef WLAN_FEATURE_P2P_INTERNAL @@ -100,11 +135,16 @@ eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemaino /*In coming len for Msg is more then 16bit value*/ smsLog(pMac, LOGE, FL(" Message length is very large, %d"), len); - return eHAL_STATUS_FAILURE; + status = eHAL_STATUS_FAILURE; + goto error; } pMsg = vos_mem_malloc(len); if ( NULL == pMsg ) + { + smsLog(pMac, LOGE, FL("Msg memory alloc failed")); status = eHAL_STATUS_FAILURE; + goto error; + } else { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s call", __func__); @@ -131,7 +171,11 @@ eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemaino #endif status = palSendMBMessage(pMac->hHdd, pMsg); } - + error: + if (eHAL_STATUS_FAILURE == status) + { + csrReleaseRocReqCommand(pMac); + } return status; } @@ -144,9 +188,10 @@ eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemaino eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg) { - eHalStatus status = eHAL_STATUS_SUCCESS; - tListElem *pEntry = NULL; - tSmeCmd *pCommand = NULL; + eHalStatus status = eHAL_STATUS_SUCCESS; + tListElem *pEntry = NULL; + tSmeCmd *pCommand = NULL; + tSirSmeRsp *pRsp = (tSirSmeRsp *)pMsg; pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); if( pEntry ) @@ -157,8 +202,9 @@ eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg) remainOnChanCallback callback = pCommand->u.remainChlCmd.callback; /* process the msg */ if( callback ) - callback(pMac, pCommand->u.remainChlCmd.callbackCtx, 0); - + callback(pMac, pCommand->u.remainChlCmd.callbackCtx, + pRsp->statusCode); + if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) ) { //Now put this command back on the avilable command list @@ -170,60 +216,6 @@ eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg) return status; } - -/*------------------------------------------------------------------ - * - * Handle the Mgmt frm ind from LIM and forward to HDD. - * - *------------------------------------------------------------------*/ - -eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm) -{ - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_SUCCESS; - tCsrRoamInfo pRoamInfo = {0}; -#ifndef WLAN_FEATURE_P2P_INTERNAL - tANI_U32 SessionId = pSmeMgmtFrm->sessionId; -#endif - -#ifdef WLAN_FEATURE_P2P_INTERNAL - tANI_U8 i; - - //For now, only action frames are needed. - if(SIR_MAC_MGMT_ACTION == pSmeMgmtFrm->frameType) - { - pRoamInfo.nFrameLength = pSmeMgmtFrm->mesgLen - sizeof(tSirSmeMgmtFrameInd); - pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; - pRoamInfo.frameType = pSmeMgmtFrm->frameType; - pRoamInfo.rxChan = pSmeMgmtFrm->rxChan; - pRoamInfo.rxRssi = pSmeMgmtFrm->rxRssi; - - //Somehow we don't get the right sessionId. - for(i = 0; i < CSR_ROAM_SESSION_MAX; i++) - { - if( CSR_IS_SESSION_VALID( pMac, i ) ) - { - status = eHAL_STATUS_SUCCESS; - /* forward the mgmt frame to all active sessions*/ - csrRoamCallCallback(pMac, i, &pRoamInfo, 0, eCSR_ROAM_INDICATE_MGMT_FRAME, 0); - } - } - } -#else - pRoamInfo.nFrameLength = pSmeMgmtFrm->mesgLen - sizeof(tSirSmeMgmtFrameInd); - pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; - pRoamInfo.frameType = pSmeMgmtFrm->frameType; - pRoamInfo.rxChan = pSmeMgmtFrm->rxChan; - pRoamInfo.rxRssi = pSmeMgmtFrm->rxRssi; - - /* forward the mgmt frame to HDD */ - csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_INDICATE_MGMT_FRAME, 0); -#endif - - return status; -} - - /*------------------------------------------------------------------ * * Handle the remain on channel ready indication from PE @@ -772,7 +764,7 @@ eHalStatus p2pRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, #ifdef WLAN_FEATURE_P2P_INTERNAL smePushCommand(pMac, pRemainChlCmd, (eP2PRemainOnChnReasonSendFrame == reason)); #else - csrQueueSmeCommand(pMac, pRemainChlCmd, eANI_BOOLEAN_FALSE); + status = csrQueueSmeCommand(pMac, pRemainChlCmd, eANI_BOOLEAN_FALSE); #endif } while(0); diff --git a/drivers/staging/prima/CORE/SME/src/pmc/pmc.c b/drivers/staging/prima/CORE/SME/src/pmc/pmc.c index cdb0236e47dc..6aa3b8bfdf6d 100644 --- a/drivers/staging/prima/CORE/SME/src/pmc/pmc.c +++ b/drivers/staging/prima/CORE/SME/src/pmc/pmc.c @@ -163,7 +163,7 @@ eHalStatus pmcEnterFullPowerState (tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, FL("Entering pmcEnterFullPowerState")); + pmcLog(pMac, LOG1, FL("PMC state is %d"), pMac->pmc.pmcState); /* Take action based on the current state. */ switch (pMac->pmc.pmcState) @@ -230,7 +230,7 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, FL("Entering pmcEnterRequestFullPowerState")); + pmcLog(pMac, LOG1, FL("Enter. PMC state is %d"), pMac->pmc.pmcState); /* Take action based on the current state of the device. */ switch (pMac->pmc.pmcState) @@ -276,6 +276,8 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas if (pmcIssueCommand( pMac, eSmeCommandExitImps, NULL, 0, FALSE ) != eHAL_STATUS_SUCCESS) { + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eSmeCommandExitImps")); return eHAL_STATUS_FAILURE; } return eHAL_STATUS_SUCCESS; @@ -289,6 +291,8 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas if (pmcIssueCommand(hHal, eSmeCommandExitBmps, &exitBmpsInfo, sizeof(tExitBmpsInfo), FALSE) != eHAL_STATUS_SUCCESS) { + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eSmeCommandExitBmps")); return eHAL_STATUS_FAILURE; } return eHAL_STATUS_SUCCESS; @@ -307,8 +311,8 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas if (pmcIssueCommand(hHal, eSmeCommandExitImps, NULL, 0, FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: failure to send message " - "eWNI_PMC_EXIT_IMPS_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eWNI_PMC_EXIT_IMPS_REQ")); return eHAL_STATUS_FAILURE; } @@ -320,8 +324,8 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas if (pmcIssueCommand(hHal, eSmeCommandExitUapsd, &fullPowerReason, sizeof(tRequestFullPowerReason), FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: failure to send message " - "eWNI_PMC_EXIT_UAPSD_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eWNI_PMC_EXIT_UAPSD_REQ")); return eHAL_STATUS_FAILURE; } return eHAL_STATUS_SUCCESS; @@ -331,8 +335,8 @@ eHalStatus pmcEnterRequestFullPowerState (tHalHandle hHal, tRequestFullPowerReas if (pmcIssueCommand(hHal, eSmeCommandExitWowl, &fullPowerReason, sizeof(tRequestFullPowerReason), FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGP, "PMC: failure to send message " - "eWNI_PMC_EXIT_WOWL_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eWNI_PMC_EXIT_WOWL_REQ")); return eHAL_STATUS_FAILURE; } return eHAL_STATUS_SUCCESS; @@ -513,7 +517,7 @@ eHalStatus pmcEnterRequestBmpsState (tHalHandle hHal) pMac->pmc.bmpsRequestQueued = eANI_BOOLEAN_TRUE; if(pmcIssueCommand(hHal, eSmeCommandEnterBmps, NULL, 0, FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: failure to send message eWNI_PMC_ENTER_BMPS_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message eWNI_PMC_ENTER_BMPS_REQ")); pMac->pmc.bmpsRequestQueued = eANI_BOOLEAN_FALSE; pMac->pmc.pmcState = FULL_POWER; if(pmcShouldBmpsTimerRun(pMac)) @@ -525,7 +529,7 @@ eHalStatus pmcEnterRequestBmpsState (tHalHandle hHal) } else { - pmcLog(pMac, LOGE, "PMC: enter BMPS command already queued"); + pmcLog(pMac, LOG1, FL("PMC: enter BMPS command already queued")); //restart the timer if needed if(pmcShouldBmpsTimerRun(pMac)) { @@ -534,7 +538,7 @@ eHalStatus pmcEnterRequestBmpsState (tHalHandle hHal) return eHAL_STATUS_SUCCESS; } - pmcLog(pMac, LOGW, FL("eWNI_PMC_ENTER_BMPS_REQ sent to PE")); + pmcLog(pMac, LOG1, FL("eWNI_PMC_ENTER_BMPS_REQ sent to PE")); return eHAL_STATUS_SUCCESS; } @@ -559,7 +563,7 @@ eHalStatus pmcEnterBmpsState (tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, FL("Entering pmcEnterBmpsState")); + pmcLog(pMac, LOG1, FL("Enter. PMC state is %d"), pMac->pmc.pmcState); /* Can enter BMPS State only from 5 states. */ if (pMac->pmc.pmcState != REQUEST_BMPS && @@ -837,7 +841,7 @@ void pmcDoCallbacks (tHalHandle hHal, eHalStatus callbackStatus) tListElem *pEntry; tpRequestFullPowerEntry pRequestFullPowerEntry; - pmcLog(pMac, LOG2, FL("Entering pmcDoCallbacks")); + pmcLog(pMac, LOG2, FL("Enter")); /* Call IMPS callback routine. */ if (pMac->pmc.impsCallbackRoutine != NULL) @@ -879,7 +883,7 @@ eHalStatus pmcStartTrafficTimer (tHalHandle hHal, tANI_U32 expirationTime) tpAniSirGlobal pMac = PMAC_STRUCT(hHal); VOS_STATUS vosStatus; - pmcLog(pMac, LOG2, FL("Entering pmcStartTrafficTimer")); + pmcLog(pMac, LOG1, FL("Enter. Timer duration is %d"), expirationTime); vosStatus = vos_timer_start(&pMac->pmc.hTrafficTimer, expirationTime); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) @@ -988,7 +992,8 @@ void pmcTrafficTimerExpired (tHalHandle hHal) /* Untill DHCP is not completed remain in power active */ if(pMac->pmc.remainInPowerActiveTillDHCP) { - pmcLog(pMac, LOG2, FL("BMPS Traffic Timer expired before DHCP completion ignore enter BMPS")); + pmcLog(pMac, LOG1, FL("BMPS Traffic Timer expired before DHCP" + " completion ignore enter BMPS")); pMac->pmc.remainInPowerActiveThreshold++; if( pMac->pmc.remainInPowerActiveThreshold >= DHCP_REMAIN_POWER_ACTIVE_THRESHOLD) { @@ -1027,7 +1032,7 @@ void pmcTrafficTimerExpired (tHalHandle hHal) if (pmcPowerSaveCheck(hHal)) { - pmcLog(pMac, LOGW, FL("BMPS entry criteria satisfied. Requesting BMPS state")); + pmcLog(pMac, LOG1, FL("BMPS entry criteria satisfied. Requesting BMPS state")); (void)pmcEnterRequestBmpsState(hHal); } else @@ -1094,7 +1099,7 @@ void pmcDoBmpsCallbacks (tHalHandle hHal, eHalStatus callbackStatus) tListElem *pEntry; tpRequestBmpsEntry pRequestBmpsEntry; - pmcLog(pMac, LOG2, "PMC: entering pmcDoBmpsCallbacks"); + pmcLog(pMac, LOG1, FL("Enter")); /* Call the routines in the request BMPS callback routine list. */ csrLLLock(&pMac->pmc.requestBmpsList); @@ -1136,7 +1141,7 @@ void pmcDoStartUapsdCallbacks (tHalHandle hHal, eHalStatus callbackStatus) tListElem *pEntry; tpStartUapsdEntry pStartUapsdEntry; - pmcLog(pMac, LOG2, "PMC: entering pmcDoStartUapsdCallbacks"); + pmcLog(pMac, LOG1, FL("Enter")); csrLLLock(&pMac->pmc.requestStartUapsdList); /* Call the routines in the request start UAPSD callback routine list. */ pEntry = csrLLRemoveHead(&pMac->pmc.requestStartUapsdList, FALSE); @@ -1169,59 +1174,49 @@ void pmcDoStartUapsdCallbacks (tHalHandle hHal, eHalStatus callbackStatus) eHalStatus pmcEnterRequestStartUapsdState (tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - v_BOOL_t fFullPower = VOS_FALSE; //need to get back to full power state - pmcLog(pMac, LOG2, "PMC: entering pmcEnterRequestStartUapsdState"); + pmcLog(pMac, LOG1, FL("Enter. PMC State is %d"), pMac->pmc.pmcState); /* Can enter UAPSD State only from FULL_POWER or BMPS State. */ switch (pMac->pmc.pmcState) { case FULL_POWER: + /* UAPSD mode will be attempted when we enter BMPS later */ + pMac->pmc.uapsdSessionRequired = TRUE; + /* Check that entry into a power save mode is allowed at this time. */ if (!pmcPowerSaveCheck(hHal)) { pmcLog(pMac, LOGW, "PMC: Power save check failed. UAPSD request " "will be accepted and buffered"); - /* UAPSD mode will be attempted when we enter BMPS later */ - pMac->pmc.uapsdSessionRequired = TRUE; /* Make sure the BMPS retry timer is running */ if(pmcShouldBmpsTimerRun(pMac)) (void)pmcStartTrafficTimer(hHal, pMac->pmc.bmpsConfig.trafficMeasurePeriod); - break; } else { - pMac->pmc.uapsdSessionRequired = TRUE; - //Check BTC state -#ifndef WLAN_MDM_CODE_REDUCTION_OPT - if( btcIsReadyForUapsd( pMac ) ) -#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ - { - /* Put device in BMPS mode first. This step should NEVER fail. - That is why no need to buffer the UAPSD request*/ - if(pmcEnterRequestBmpsState(hHal) != eHAL_STATUS_SUCCESS) - { - pmcLog(pMac, LOGE, "PMC: Device in Full Power. Enter Request Bmps failed. " - "UAPSD request will be dropped "); - return eHAL_STATUS_FAILURE; - } - } -#ifndef WLAN_MDM_CODE_REDUCTION_OPT - else + /* PowerSaveCheck passed, put the device into BMPS first */ + if(pmcEnterRequestBmpsState(hHal) != eHAL_STATUS_SUCCESS) { - (void)pmcStartTrafficTimer(hHal, pMac->pmc.bmpsConfig.trafficMeasurePeriod); + pmcLog(pMac, LOGE, "PMC: Device in Full Power. Enter Request Bmps failed. " + "UAPSD request will be dropped "); + return eHAL_STATUS_FAILURE; } -#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ } break; case BMPS: + { + tANI_U8 staticUapsdMask = 0; + csrGetStaticUapsdMask(pMac, &staticUapsdMask); + //It is already in BMPS mode, check BTC state #ifndef WLAN_MDM_CODE_REDUCTION_OPT - if( btcIsReadyForUapsd(pMac) ) + if (btcIsReadyForUapsd(pMac) || staticUapsdMask) #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ { - /* Tell MAC to have device enter UAPSD mode. */ + /* BTC is OK with Uapsd or static Uapsd is configured, then tell + MAC to have device enter UAPSD mode. */ if (pmcIssueCommand(hHal, eSmeCommandEnterUapsd, NULL, 0, FALSE) != eHAL_STATUS_SUCCESS) { @@ -1234,36 +1229,24 @@ eHalStatus pmcEnterRequestStartUapsdState (tHalHandle hHal) else { //Not ready for UAPSD at this time, save it first and wake up the chip - pmcLog(pMac, LOGE, " PMC state = %d",pMac->pmc.pmcState); + pmcLog(pMac, LOGE, "Uapsd not needed now, PMC state = %d" + "btcIsUapsdOk:%d staticUapsdMask:0x%x",pMac->pmc.pmcState, + btcIsReadyForUapsd(pMac), staticUapsdMask); pMac->pmc.uapsdSessionRequired = TRUE; - /* While BTC traffic is going on, STA can be in BMPS - * and need not go to Full Power */ - //fFullPower = VOS_TRUE; } #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ - break; + } + break; case REQUEST_START_UAPSD: -#ifndef WLAN_MDM_CODE_REDUCTION_OPT - if( !btcIsReadyForUapsd(pMac) ) - { - //BTC rejects UAPSD, bring it back to full power - fFullPower = VOS_TRUE; - } -#endif + pmcLog(pMac, LOGE, "Request Uapsd in progress"); break; case REQUEST_BMPS: - /* Buffer request for UAPSD mode. */ - pMac->pmc.uapsdSessionRequired = TRUE; -#ifndef WLAN_MDM_CODE_REDUCTION_OPT - if( !btcIsReadyForUapsd(pMac) ) - { - //BTC rejects UAPSD, bring it back to full power - fFullPower = VOS_TRUE; - } -#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ - break; + /* Buffer request for UAPSD mode. */ + pMac->pmc.uapsdSessionRequired = TRUE; + pmcLog(pMac, LOGE, "Request BMPS in progress"); + break; default: pmcLog(pMac, LOGE, "PMC: trying to enter UAPSD State from state %d", @@ -1271,15 +1254,6 @@ eHalStatus pmcEnterRequestStartUapsdState (tHalHandle hHal) return eHAL_STATUS_FAILURE; } - if(fFullPower) - { - if( eHAL_STATUS_PMC_PENDING != pmcRequestFullPower( pMac, NULL, NULL, eSME_REASON_OTHER ) ) - { - //This is an error - pmcLog(pMac, LOGE, FL(" fail to request full power because BTC")); - } - } - return eHAL_STATUS_SUCCESS; } @@ -1302,12 +1276,12 @@ eHalStatus pmcEnterUapsdState (tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, "PMC: entering pmcEnterUapsdState"); + pmcLog(pMac, LOG2, FL("Enter")); /* Can enter UAPSD State only from Request UAPSD State. */ if (pMac->pmc.pmcState != REQUEST_START_UAPSD ) { - pmcLog(pMac, LOGE, "PMC: trying to enter UAPSD State from state %d", + pmcLog(pMac, LOGE, FL("PMC: trying to enter UAPSD State from state %d"), pMac->pmc.pmcState); return eHAL_STATUS_FAILURE; } @@ -1325,6 +1299,7 @@ eHalStatus pmcEnterUapsdState (tHalHandle hHal) if (pMac->pmc.requestFullPowerPending) { /* Start exit UAPSD sequence now. */ + pmcLog(pMac, LOG1, FL("Full power request pending. Exit UAPSD")); return pmcEnterRequestFullPowerState(hHal, pMac->pmc.requestFullPowerReason); } @@ -1403,8 +1378,8 @@ eHalStatus pmcEnterRequestStandbyState (tHalHandle hHal) /* Can enter Standby State only from Full Power State. */ if (pMac->pmc.pmcState != FULL_POWER) { - pmcLog(pMac, LOGE, "PMC: trying to enter Standby State from " - "state %d", pMac->pmc.pmcState); + pmcLog(pMac, LOGE, FL("PMC: trying to enter Standby State from " + "state %d"), pMac->pmc.pmcState); return eHAL_STATUS_FAILURE; } @@ -1416,8 +1391,8 @@ eHalStatus pmcEnterRequestStandbyState (tHalHandle hHal) if (pmcIssueCommand(hHal, eSmeCommandEnterStandby, NULL, 0, FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: failure to send message " - "eWNI_PMC_ENTER_IMPS_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message " + "eWNI_PMC_ENTER_IMPS_REQ")); pMac->pmc.pmcState = FULL_POWER; if(pmcShouldBmpsTimerRun(pMac)) @@ -1447,13 +1422,13 @@ eHalStatus pmcEnterStandbyState (tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, "PMC: entering pmcEnterStandbyState"); + pmcLog(pMac, LOG2, FL("Enter")); /* Can enter STANDBY State only from REQUEST_STANDBY State. */ if (pMac->pmc.pmcState != REQUEST_STANDBY) { - pmcLog(pMac, LOGE, "PMC: trying to enter STANDBY State from state %d", - pMac->pmc.pmcState); + pmcLog(pMac, LOGE, FL("PMC: trying to enter STANDBY State from state %d"), + pMac->pmc.pmcState); return eHAL_STATUS_FAILURE; } @@ -1465,6 +1440,7 @@ eHalStatus pmcEnterStandbyState (tHalHandle hHal) if (pMac->pmc.requestFullPowerPending) { /* Start exit STANDBY sequence now. */ + pmcLog(pMac, LOG1, FL("Full power req pending. Exit Standby")); return pmcEnterRequestFullPowerState(hHal, pMac->pmc.requestFullPowerReason); } @@ -1571,7 +1547,7 @@ void pmcDoDeviceStateUpdateCallbacks (tHalHandle hHal, tPmcState state) tpDeviceStateUpdateIndEntry pDeviceStateUpdateIndEntry; void (*callbackRoutine) (void *callbackContext, tPmcState pmcState); - pmcLog(pMac, LOG2, FL("PMC - Update registered modules of new device " + pmcLog(pMac, LOG1, FL("PMC - Update registered modules of new device " "state: %s"), pmcGetPmcStateStr(state)); /* Call the routines in the update device state routine list. */ @@ -1603,7 +1579,7 @@ void pmcDoDeviceStateUpdateCallbacks (tHalHandle hHal, tPmcState state) eHalStatus pmcRequestEnterWowlState(tHalHandle hHal, tpSirSmeWowlEnterParams wowlEnterParams) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, "PMC: entering pmcRequestEnterWowlState"); + pmcLog(pMac, LOG1, FL("Enter. PMC State is %d"),pMac->pmc.pmcState); switch (pMac->pmc.pmcState) { @@ -1611,15 +1587,15 @@ eHalStatus pmcRequestEnterWowlState(tHalHandle hHal, tpSirSmeWowlEnterParams wow /* Put device in BMPS mode first. This step should NEVER fail. */ if(pmcEnterRequestBmpsState(hHal) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: Device in Full Power. pmcEnterRequestBmpsState failed. " - "Cannot enter WOWL"); + pmcLog(pMac, LOGE, FL("PMC: Device in Full Power. pmcEnterRequestBmpsState failed. " + "Cannot enter WOWL")); return eHAL_STATUS_FAILURE; } break; case REQUEST_BMPS: - pmcLog(pMac, LOGW, "PMC: BMPS transaction going on. WOWL request " - "will be buffered"); + pmcLog(pMac, LOGW, FL("PMC: BMPS transaction going on. WOWL request " + "will be buffered")); break; case BMPS: @@ -1630,24 +1606,24 @@ eHalStatus pmcRequestEnterWowlState(tHalHandle hHal, tpSirSmeWowlEnterParams wow if (pmcIssueCommand(hHal, eSmeCommandEnterWowl, wowlEnterParams, sizeof(tSirSmeWowlEnterParams), FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGE, "PMC: failure to send message eWNI_PMC_ENTER_WOWL_REQ"); + pmcLog(pMac, LOGE, FL("PMC: failure to send message eWNI_PMC_ENTER_WOWL_REQ")); return eHAL_STATUS_FAILURE; } break; case REQUEST_ENTER_WOWL: //Multiple enter WOWL requests at the same time are not accepted - pmcLog(pMac, LOGE, "PMC: Enter WOWL transaction already going on. New WOWL request " - "will be rejected"); + pmcLog(pMac, LOGE, FL("PMC: Enter WOWL transaction already going on. New WOWL request " + "will be rejected")); return eHAL_STATUS_FAILURE; case REQUEST_EXIT_WOWL: - pmcLog(pMac, LOGW, "PMC: Exit WOWL transaction going on. New WOWL request " - "will be buffered"); + pmcLog(pMac, LOGW, FL("PMC: Exit WOWL transaction going on. New WOWL request " + "will be buffered")); break; default: - pmcLog(pMac, LOGE, "PMC: Trying to enter WOWL State from state %s", + pmcLog(pMac, LOGE, FL("PMC: Trying to enter WOWL State from state %s"), pmcGetPmcStateStr(pMac->pmc.pmcState)); return eHAL_STATUS_FAILURE; } @@ -1679,7 +1655,7 @@ eHalStatus pmcEnterWowlState (tHalHandle hHal) /* Can enter WOWL State only from Request WOWL State. */ if (pMac->pmc.pmcState != REQUEST_ENTER_WOWL ) { - pmcLog(pMac, LOGP, "PMC: trying to enter WOWL State from state %d", + pmcLog(pMac, LOGE, FL("PMC: trying to enter WOWL State from state %d"), pMac->pmc.pmcState); return eHAL_STATUS_FAILURE; } @@ -1695,6 +1671,7 @@ eHalStatus pmcEnterWowlState (tHalHandle hHal) if (pMac->pmc.requestFullPowerPending) { /* Start exit Wowl sequence now. */ + pmcLog(pMac, LOG1, FL("Full power req pending. Exit Wowl")); return pmcEnterRequestFullPowerState(hHal, pMac->pmc.requestFullPowerReason); } @@ -1729,18 +1706,18 @@ eHalStatus pmcRequestExitWowlState(tHalHandle hHal) if (pmcIssueCommand(hHal, eSmeCommandExitWowl, NULL, 0, FALSE) != eHAL_STATUS_SUCCESS) { - pmcLog(pMac, LOGP, "PMC: failure to send message eWNI_PMC_EXIT_WOWL_REQ"); + pmcLog(pMac, LOGP, FL("PMC: failure to send message eWNI_PMC_EXIT_WOWL_REQ")); return eHAL_STATUS_FAILURE; } break; case REQUEST_ENTER_WOWL: - pmcLog(pMac, LOGP, "PMC: Rcvd exit WOWL even before enter WOWL was completed"); + pmcLog(pMac, LOGP, FL("PMC: Rcvd exit WOWL even before enter WOWL was completed")); return eHAL_STATUS_FAILURE; default: - pmcLog(pMac, LOGW, "PMC: Got exit WOWL in state %s. Nothing to do as already out of WOWL", - pmcGetPmcStateStr(pMac->pmc.pmcState)); + pmcLog(pMac, LOGW, FL("PMC: Got exit WOWL in state %s(%d). Nothing to do as already out of WOWL"), + pmcGetPmcStateStr(pMac->pmc.pmcState), pMac->pmc.pmcState); break; } @@ -2088,7 +2065,7 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) { eHalStatus status = eHAL_STATUS_SUCCESS; tANI_BOOLEAN fRemoveCmd = eANI_BOOLEAN_TRUE; - + pmcLog(pMac, LOG1, FL("PMC command is 0x%x"), pCommand->command); do { switch ( pCommand->command ) @@ -2124,29 +2101,33 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) break; case eSmeCommandExitImps: - pMac->pmc.requestFullPowerPending = FALSE; - if( ( IMPS == pMac->pmc.pmcState ) || ( STANDBY == pMac->pmc.pmcState ) ) { - //Check state before sending message. The state may change after that - if( STANDBY == pMac->pmc.pmcState ) + tPmcState origState = pMac->pmc.pmcState; + pMac->pmc.requestFullPowerPending = FALSE; + if( ( IMPS == pMac->pmc.pmcState ) || ( STANDBY == pMac->pmc.pmcState ) ) { - //Enable Idle scan in CSR - csrScanResumeIMPS(pMac); - } + //Check state before sending message. The state may change after that + if( STANDBY == pMac->pmc.pmcState ) + { + //Enable Idle scan in CSR + csrScanResumeIMPS(pMac); + } - status = pmcSendMessage(pMac, eWNI_PMC_EXIT_IMPS_REQ, NULL, 0); - if ( HAL_STATUS_SUCCESS( status ) ) - { pMac->pmc.pmcState = REQUEST_FULL_POWER; - pmcLog(pMac, LOG2, FL("eWNI_PMC_EXIT_IMPS_REQ sent to PE")); - fRemoveCmd = eANI_BOOLEAN_FALSE; - } - else - { - pmcLog(pMac, LOGE, - FL("eWNI_PMC_EXIT_IMPS_REQ fail to be sent to PE status %d"), status); - //Callbacks are called with success srarus, do we need to pass in real status?? - pmcEnterFullPowerState(pMac); + status = pmcSendMessage(pMac, eWNI_PMC_EXIT_IMPS_REQ, NULL, 0); + if ( HAL_STATUS_SUCCESS( status ) ) + { + pmcLog(pMac, LOG1, FL("eWNI_PMC_EXIT_IMPS_REQ sent to PE")); + fRemoveCmd = eANI_BOOLEAN_FALSE; + } + else + { + pMac->pmc.pmcState = origState; + pmcLog(pMac, LOGE, + FL("eWNI_PMC_EXIT_IMPS_REQ fail to be sent to PE status %d"), status); + //Callbacks are called with success srarus, do we need to pass in real status?? + pmcEnterFullPowerState(pMac); + } } } break; @@ -2160,7 +2141,7 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) { /* Change PMC state */ pMac->pmc.pmcState = REQUEST_BMPS; - pmcLog(pMac, LOG2, "PMC: Enter BMPS req done"); + pmcLog(pMac, LOG1, "PMC: Enter BMPS req done"); /* Tell MAC to have device enter BMPS mode. */ status = pmcSendMessage(pMac, eWNI_PMC_ENTER_BMPS_REQ, NULL, 0); @@ -2188,21 +2169,23 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) break; case eSmeCommandExitBmps: - if( BMPS == pMac->pmc.pmcState ) + if ((BMPS == pMac->pmc.pmcState) || (UAPSD == pMac->pmc.pmcState)) { + tPmcState origState = pMac->pmc.pmcState; pMac->pmc.requestFullPowerPending = FALSE; - + /* Change PMC state */ + pMac->pmc.pmcState = REQUEST_FULL_POWER; status = pmcSendMessage( pMac, eWNI_PMC_EXIT_BMPS_REQ, &pCommand->u.pmcCmd.u.exitBmpsInfo, sizeof(tExitBmpsInfo) ); if ( HAL_STATUS_SUCCESS( status ) ) { - pMac->pmc.pmcState = REQUEST_FULL_POWER; fRemoveCmd = eANI_BOOLEAN_FALSE; - pmcLog(pMac, LOG2, FL("eWNI_PMC_EXIT_BMPS_REQ sent to PE")); + pmcLog(pMac, LOG1, FL("eWNI_PMC_EXIT_BMPS_REQ sent to PE")); } else { + pMac->pmc.pmcState = origState; pmcLog(pMac, LOGE, FL("eWNI_PMC_EXIT_BMPS_REQ fail to be sent to PE status %d"), status); pmcEnterFullPowerState(pMac); } @@ -2213,14 +2196,16 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) if( BMPS == pMac->pmc.pmcState ) { pMac->pmc.uapsdSessionRequired = TRUE; + /* Change PMC state */ + pMac->pmc.pmcState = REQUEST_START_UAPSD; status = pmcSendMessage(pMac, eWNI_PMC_ENTER_UAPSD_REQ, NULL, 0); if ( HAL_STATUS_SUCCESS( status ) ) { - pMac->pmc.pmcState = REQUEST_START_UAPSD; fRemoveCmd = eANI_BOOLEAN_FALSE; } else { + pMac->pmc.pmcState = BMPS; pmcLog(pMac, LOGE, "PMC: failure to send message " "eWNI_PMC_ENTER_BMPS_REQ"); //there is no retry for re-entering UAPSD so tell the requester we are done witgh failure. @@ -2240,19 +2225,20 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) break; } + /* Change state. Note that device will be put in BMPS state at the + end of REQUEST_STOP_UAPSD state even if response is a failure*/ + pMac->pmc.pmcState = REQUEST_STOP_UAPSD; /* Tell MAC to have device exit UAPSD mode. */ status = pmcSendMessage(pMac, eWNI_PMC_EXIT_UAPSD_REQ, NULL, 0); if ( HAL_STATUS_SUCCESS( status ) ) { - /* Change state. Note that device will be put in BMPS state at the - end of REQUEST_STOP_UAPSD state even if response is a failure*/ - pMac->pmc.pmcState = REQUEST_STOP_UAPSD; pMac->pmc.requestFullPowerPending = TRUE; pMac->pmc.requestFullPowerReason = pCommand->u.pmcCmd.fullPowerReason; fRemoveCmd = eANI_BOOLEAN_FALSE; } else { + pMac->pmc.pmcState = UAPSD; pmcLog(pMac, LOGE, "PMC: failure to send message " "eWNI_PMC_EXIT_UAPSD_REQ"); pmcEnterBmpsState(pMac); @@ -2262,27 +2248,31 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) break; case eSmeCommandEnterWowl: - if( ( BMPS == pMac->pmc.pmcState ) || ( WOWL == pMac->pmc.pmcState ) ) - { - status = pmcSendMessage(pMac, eWNI_PMC_ENTER_WOWL_REQ, - &pCommand->u.pmcCmd.u.enterWowlInfo, sizeof(tSirSmeWowlEnterParams)); - if ( HAL_STATUS_SUCCESS( status ) ) - { - pMac->pmc.pmcState = REQUEST_ENTER_WOWL; - fRemoveCmd = eANI_BOOLEAN_FALSE; - } - else - { - pmcLog(pMac, LOGE, "PMC: failure to send message eWNI_PMC_ENTER_WOWL_REQ"); - pmcDoEnterWowlCallbacks(pMac, eHAL_STATUS_FAILURE); - } - } - else - { - fRemoveCmd = eANI_BOOLEAN_TRUE; - } - break; - + { + tPmcState origState = pMac->pmc.pmcState; + if( ( BMPS == pMac->pmc.pmcState ) || ( WOWL == pMac->pmc.pmcState ) ) + { + pMac->pmc.pmcState = REQUEST_ENTER_WOWL; + status = pmcSendMessage(pMac, eWNI_PMC_ENTER_WOWL_REQ, + &pCommand->u.pmcCmd.u.enterWowlInfo, sizeof(tSirSmeWowlEnterParams)); + if ( HAL_STATUS_SUCCESS( status ) ) + { + fRemoveCmd = eANI_BOOLEAN_FALSE; + } + else + { + pMac->pmc.pmcState = origState; + pmcLog(pMac, LOGE, + "PMC: failure to send message eWNI_PMC_ENTER_WOWL_REQ in state %d", origState); + pmcDoEnterWowlCallbacks(pMac, eHAL_STATUS_FAILURE); + } + } + else + { + fRemoveCmd = eANI_BOOLEAN_TRUE; + } + break; + } case eSmeCommandExitWowl: if( WOWL == pMac->pmc.pmcState ) { @@ -2297,6 +2287,7 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) } else { + pMac->pmc.pmcState = WOWL; pmcLog(pMac, LOGP, "PMC: failure to send message eWNI_PMC_EXIT_WOWL_REQ"); pmcEnterBmpsState(pMac); } @@ -2342,6 +2333,7 @@ tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ) { pmcLog(pMac, LOGE, "PMC: failure to send message " "eWNI_PMC_ENTER_IMPS_REQ"); + pMac->pmc.pmcState = FULL_POWER; pmcEnterFullPowerState(pMac); pmcDoStandbyCallbacks(pMac, eHAL_STATUS_FAILURE); /* Start the timer only if Auto BMPS feature is enabled or an UAPSD session is @@ -2376,21 +2368,21 @@ eHalStatus pmcEnterImpsCheck( tpAniSirGlobal pMac ) /* Check if IMPS is enabled. */ if (!pMac->pmc.impsEnabled) { - pmcLog(pMac, LOG2, FL("IMPS is disabled")); + pmcLog(pMac, LOG1, FL("IMPS is disabled")); return eHAL_STATUS_PMC_DISABLED; } /* Check if IMPS enabled for current power source. */ if ((pMac->pmc.powerSource == AC_POWER) && !pMac->pmc.impsConfig.enterOnAc) { - pmcLog(pMac, LOG2, FL("IMPS is disabled when operating on AC power")); + pmcLog(pMac, LOG1, FL("IMPS is disabled when operating on AC power")); return eHAL_STATUS_PMC_AC_POWER; } /* Check that entry into a power save mode is allowed at this time. */ if (!pmcPowerSaveCheck(pMac)) { - pmcLog(pMac, LOG2, FL("IMPS cannot be entered now")); + pmcLog(pMac, LOG1, FL("IMPS cannot be entered now")); return eHAL_STATUS_PMC_NOT_NOW; } @@ -2398,7 +2390,7 @@ eHalStatus pmcEnterImpsCheck( tpAniSirGlobal pMac ) running sessions agree. */ if (!pmcAllowImps(pMac)) { - pmcLog(pMac, LOG2, FL("IMPS cannot be entered now")); + pmcLog(pMac, LOG1, FL("IMPS cannot be entered now")); return eHAL_STATUS_PMC_NOT_NOW; } @@ -2406,7 +2398,7 @@ eHalStatus pmcEnterImpsCheck( tpAniSirGlobal pMac ) if ((pMac->pmc.pmcState == REQUEST_IMPS) || (pMac->pmc.pmcState == IMPS) || (pMac->pmc.pmcState == REQUEST_FULL_POWER)) { - pmcLog(pMac, LOG2, FL("Already in IMPS")); + pmcLog(pMac, LOG1, FL("Already in IMPS")); return eHAL_STATUS_PMC_ALREADY_IN_IMPS; } @@ -2429,7 +2421,7 @@ eHalStatus pmcEnterBmpsCheck( tpAniSirGlobal pMac ) /* Check if BMPS is enabled. */ if (!pMac->pmc.bmpsEnabled) { - pmcLog(pMac, LOGE, "PMC: Cannot initiate BMPS. BMPS is disabled"); + pmcLog(pMac, LOGE, FL("PMC: Cannot initiate BMPS. BMPS is disabled")); return eHAL_STATUS_PMC_DISABLED; } @@ -2444,7 +2436,8 @@ eHalStatus pmcEnterBmpsCheck( tpAniSirGlobal pMac ) /* Check that we are associated with a single active session. */ if (!pmcValidateConnectState( pMac )) { - pmcLog(pMac, LOGE, "PMC: STA not associated with an AP with single active session. BMPS cannot be entered"); + pmcLog(pMac, VOS_TRACE_LEVEL_INFO, FL("PMC: STA not associated with an AP with single" + " active session. BMPS cannot be entered")); return eHAL_STATUS_FAILURE; } @@ -2452,13 +2445,14 @@ eHalStatus pmcEnterBmpsCheck( tpAniSirGlobal pMac ) if (pMac->pmc.pmcState != FULL_POWER) { pmcLog(pMac, LOGE, - "PMC: Device not in full power. Cannot request BMPS. pmcState %d", pMac->pmc.pmcState); + FL("PMC: Device not in full power. Cannot request BMPS. pmcState %d"), + pMac->pmc.pmcState); return eHAL_STATUS_FAILURE; } /* Check that entry into a power save mode is allowed at this time. */ if (!pmcPowerSaveCheck(pMac)) { - pmcLog(pMac, LOGE, "PMC: Power save check failed. BMPS cannot be entered now"); + pmcLog(pMac, LOGE, FL("PMC: Power save check failed. BMPS cannot be entered now")); return eHAL_STATUS_PMC_NOT_NOW; } @@ -2516,60 +2510,12 @@ tANI_BOOLEAN pmcShouldBmpsTimerRun( tpAniSirGlobal pMac ) * an Infra session */ if (!csrIsInfraConnected(pMac)) { - pmcLog(pMac, LOG1, FL("No Infra Session or multiple sessions. BMPS should not be started")); + pmcLog(pMac, LOG1, FL("No Infra Session. BMPS can't be started")); return eANI_BOOLEAN_FALSE; } return eANI_BOOLEAN_TRUE; } - -#ifdef FEATURE_WLAN_DIAG_SUPPORT - -#define PMC_DIAG_EVT_TIMER_INTERVAL ( 5000 ) - -void pmcDiagEvtTimerExpired (tHalHandle hHal) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - WLAN_VOS_DIAG_EVENT_DEF(psRequest, vos_event_wlan_powersave_payload_type); - - vos_mem_zero(&psRequest, sizeof(vos_event_wlan_powersave_payload_type)); - psRequest.event_subtype = WLAN_PMC_CURRENT_STATE; - psRequest.pmc_current_state = pMac->pmc.pmcState; - - WLAN_VOS_DIAG_EVENT_REPORT(&psRequest, EVENT_WLAN_POWERSAVE_GENERIC); - - pmcLog(pMac, LOGW, FL("DIAG event timer expired")); - - /* re-arm timer */ - if (pmcStartDiagEvtTimer(hHal) != eHAL_STATUS_SUCCESS) - { - pmcLog(pMac, LOGP, FL("Cannot re-arm DIAG evt timer")); - } - vos_timer_start(&pMac->pmc.hDiagEvtTimer, PMC_DIAG_EVT_TIMER_INTERVAL); -} - -eHalStatus pmcStartDiagEvtTimer (tHalHandle hHal) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - - pmcLog(pMac, LOG2, FL("Entering pmcStartDiagEvtTimer")); - - if ( vos_timer_start(&pMac->pmc.hDiagEvtTimer, PMC_DIAG_EVT_TIMER_INTERVAL) != VOS_STATUS_SUCCESS) - { - pmcLog(pMac, LOGP, FL("Cannot start DIAG evt timer")); - return eHAL_STATUS_FAILURE; - } - - return eHAL_STATUS_SUCCESS; -} - -void pmcStopDiagEvtTimer (tHalHandle hHal) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, FL("Entering pmcStopDiagEvtTimer")); - (void)vos_timer_stop(&pMac->pmc.hDiagEvtTimer); -} -#endif const char * sme_PmcStatetoString(const v_U8_t pmcState) { switch (pmcState) { diff --git a/drivers/staging/prima/CORE/SME/src/pmc/pmcApi.c b/drivers/staging/prima/CORE/SME/src/pmc/pmcApi.c index 4c493ceee60e..160c9917c71e 100644 --- a/drivers/staging/prima/CORE/SME/src/pmc/pmcApi.c +++ b/drivers/staging/prima/CORE/SME/src/pmc/pmcApi.c @@ -39,6 +39,7 @@ #include "palTimer.h" #include "csrLinkList.h" #include "smsDebug.h" +#include "sme_Trace.h" #include "pmcApi.h" #include "pmc.h" #include "cfgApi.h" @@ -114,15 +115,6 @@ eHalStatus pmcOpen (tHalHandle hHal) return eHAL_STATUS_FAILURE; } -#ifdef FEATURE_WLAN_DIAG_SUPPORT - /* Allocate a timer used to report current PMC state through periodic DIAG event */ - if (vos_timer_init(&pMac->pmc.hDiagEvtTimer, VOS_TIMER_TYPE_SW, pmcDiagEvtTimerExpired, hHal) != VOS_STATUS_SUCCESS) - { - pmcLog(pMac, LOGE, FL("Cannot allocate timer for diag event reporting")); - return eHAL_STATUS_FAILURE; - } -#endif - //Initialize the default value for Bmps related config. pMac->pmc.bmpsConfig.trafficMeasurePeriod = BMPS_TRAFFIC_TIMER_DEFAULT; pMac->pmc.bmpsConfig.bmpsPeriod = WNI_CFG_LISTEN_INTERVAL_STADEF; @@ -251,13 +243,6 @@ eHalStatus pmcStart (tHalHandle hHal) sizeof(tSirMacHTMIMOPowerSaveState)) != eHAL_STATUS_SUCCESS) return eHAL_STATUS_FAILURE; -#ifdef FEATURE_WLAN_DIAG_SUPPORT - if (pmcStartDiagEvtTimer(hHal) != eHAL_STATUS_SUCCESS) - { - return eHAL_STATUS_FAILURE; - } -#endif - #if defined(ANI_LOGDUMP) pmcDumpInit(hHal); #endif @@ -297,10 +282,6 @@ eHalStatus pmcStop (tHalHandle hHal) pmcStopTrafficTimer(hHal); -#ifdef FEATURE_WLAN_DIAG_SUPPORT - pmcStopDiagEvtTimer(hHal); -#endif - if (vos_timer_stop(&pMac->pmc.hExitPowerSaveTimer) != VOS_STATUS_SUCCESS) { pmcLog(pMac, LOGE, FL("Cannot cancel exit power save mode timer")); @@ -360,12 +341,6 @@ eHalStatus pmcClose (tHalHandle hHal) { pmcLog(pMac, LOGE, FL("Cannot deallocate traffic timer")); } -#ifdef FEATURE_WLAN_DIAG_SUPPORT - if (vos_timer_destroy(&pMac->pmc.hDiagEvtTimer) != VOS_STATUS_SUCCESS) - { - pmcLog(pMac, LOGE, FL("Cannot deallocate timer for diag event reporting")); - } -#endif if (vos_timer_destroy(&pMac->pmc.hExitPowerSaveTimer) != VOS_STATUS_SUCCESS) { pmcLog(pMac, LOGE, FL("Cannot deallocate exit power save mode timer")); @@ -1003,7 +978,8 @@ eHalStatus pmcRequestFullPower (tHalHandle hHal, void (*callbackRoutine) (void * void *callbackContext, tRequestFullPowerReason fullPowerReason) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tpRequestFullPowerEntry pEntry; + tpRequestFullPowerEntry pRequestFullPowerEntry; + tListElem *pEntry; #ifdef FEATURE_WLAN_DIAG_SUPPORT WLAN_VOS_DIAG_EVENT_DEF(psRequest, vos_event_wlan_powersave_payload_type); @@ -1043,17 +1019,14 @@ eHalStatus pmcRequestFullPower (tHalHandle hHal, void (*callbackRoutine) (void * { pmcLog(pMac, LOGE, FL("Cannot cancel IMPS timer")); } - /* Enter Request Full Power State. */ - if (pmcEnterRequestFullPowerState(hHal, fullPowerReason) != eHAL_STATUS_SUCCESS) - return eHAL_STATUS_FAILURE; /* If able to enter Request Full Power State, then request is pending. Allocate entry for request full power callback routine list. */ //If caller doesn't need a callback, simply waits up the chip. - if( callbackRoutine ) + if (callbackRoutine) { - pEntry = vos_mem_malloc(sizeof(tRequestFullPowerEntry)); - if ( NULL == pEntry ) + pRequestFullPowerEntry = vos_mem_malloc(sizeof(tRequestFullPowerEntry)); + if (NULL == pRequestFullPowerEntry) { pmcLog(pMac, LOGE, FL("Cannot allocate memory for request full power routine list entry")); @@ -1062,11 +1035,24 @@ eHalStatus pmcRequestFullPower (tHalHandle hHal, void (*callbackRoutine) (void * } /* Store routine and context in entry. */ - pEntry->callbackRoutine = callbackRoutine; - pEntry->callbackContext = callbackContext; + pRequestFullPowerEntry->callbackRoutine = callbackRoutine; + pRequestFullPowerEntry->callbackContext = callbackContext; /* Add entry to list. */ - csrLLInsertTail(&pMac->pmc.requestFullPowerList, &pEntry->link, TRUE); + csrLLInsertTail(&pMac->pmc.requestFullPowerList, &pRequestFullPowerEntry->link, TRUE); + } + /* Enter Request Full Power State. */ + if (pmcEnterRequestFullPowerState(hHal, fullPowerReason) != eHAL_STATUS_SUCCESS) + { + /* If pmcEnterRequestFullPowerState fails ; driver need to remove callback + * from requestFullPowerList */ + if (callbackRoutine) + { + pEntry = csrLLRemoveTail(&pMac->pmc.requestFullPowerList, TRUE); + pRequestFullPowerEntry = GET_BASE_ADDR(pEntry, tRequestFullPowerEntry, link); + vos_mem_free(pRequestFullPowerEntry); + } + return eHAL_STATUS_FAILURE; } return eHAL_STATUS_PMC_PENDING; @@ -1258,7 +1244,7 @@ static void pmcProcessResponse( tpAniSirGlobal pMac, tSirSmeRsp *pMsg ) { pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); - pmcLog(pMac, LOG2, FL("process message = %d"), pMsg->messageType); + pmcLog(pMac, LOG2, FL("process message = 0x%x"), pMsg->messageType); /* Process each different type of message. */ switch (pMsg->messageType) @@ -1359,16 +1345,32 @@ static void pmcProcessResponse( tpAniSirGlobal pMac, tSirSmeRsp *pMsg ) pmcLog(pMac, LOGE, FL("SSR Is in progress do not send " "exit imps req again")); } - else if( eHAL_STATUS_SUCCESS == - pmcSendMessage(pMac, eWNI_PMC_EXIT_IMPS_REQ, NULL, 0) ) + else if( (pMac->pmc.ImpsRspFailCnt <= + BMPS_IMPS_FAILURE_REPORT_THRESHOLD)) { - fRemoveCommand = eANI_BOOLEAN_FALSE; - pMac->pmc.pmcState = REQUEST_FULL_POWER; - pmcLog(pMac, LOGE, FL("eWNI_PMC_EXIT_IMPS_REQ sent again" - " to PE")); + pMac->pmc.ImpsRspFailCnt++; + if (eHAL_STATUS_SUCCESS == + pmcSendMessage(pMac, eWNI_PMC_EXIT_IMPS_REQ, NULL, 0) ) + { + fRemoveCommand = eANI_BOOLEAN_FALSE; + pMac->pmc.pmcState = REQUEST_FULL_POWER; + pmcLog(pMac, LOGE, FL("eWNI_PMC_EXIT_IMPS_REQ sent again" + " to PE")); + break; + } + } + else + { + pMac->pmc.ImpsRspFailCnt = 0; + VOS_ASSERT(0); break; } } + else + { + pMac->pmc.ImpsRspFailCnt = 0; + } + pmcEnterFullPowerState(pMac); break; @@ -1434,15 +1436,18 @@ static void pmcProcessResponse( tpAniSirGlobal pMac, tSirSmeRsp *pMsg ) pmcLog(pMac, LOGP, FL("Response message to request to exit BMPS indicates failure, status %d"), pMsg->statusCode); + /*Status is not succes, so set back the pmc state as BMPS*/ + pMac->pmc.pmcState = BMPS; } - pmcEnterFullPowerState(pMac); + else + pmcEnterFullPowerState(pMac); break; /* We got a response to our Start UAPSD request. */ case eWNI_PMC_ENTER_UAPSD_RSP: pmcLog(pMac, LOG2, FL("Rcvd eWNI_PMC_ENTER_UAPSD_RSP with status = %d"), pMsg->statusCode); if( eSmeCommandEnterUapsd != pCommand->command ) - { + { pmcLog(pMac, LOGW, FL("Rcvd eWNI_PMC_ENTER_UAPSD_RSP without request")); fRemoveCommand = eANI_BOOLEAN_FALSE; break; @@ -1455,23 +1460,32 @@ static void pmcProcessResponse( tpAniSirGlobal pMac, tSirSmeRsp *pMsg ) break; } - /* Enter UAPSD State if response indicates success. */ + /* Enter UAPSD State if response indicates success. */ if (pMsg->statusCode == eSIR_SME_SUCCESS) { pmcEnterUapsdState(pMac); pmcDoStartUapsdCallbacks(pMac, eHAL_STATUS_SUCCESS); - } - /* If response is failure, then we try to put the chip back in - BMPS mode*/ - else { + } + else + { + /* If response is failure, then we try to put the chip back in + BMPS mode*/ + tANI_BOOLEAN OrigUapsdReqState = pMac->pmc.uapsdSessionRequired; pmcLog(pMac, LOGE, "PMC: response message to request to enter " "UAPSD indicates failure, status %d", pMsg->statusCode); + //Need to reset the UAPSD flag so pmcEnterBmpsState won't try to enter UAPSD. pMac->pmc.uapsdSessionRequired = FALSE; pmcEnterBmpsState(pMac); - //UAPSD will not be retied in this case so tell requester we are done with failure - pmcDoStartUapsdCallbacks(pMac, eHAL_STATUS_FAILURE); - } + + if (pMsg->statusCode != eSIR_SME_UAPSD_REQ_INVALID) + { + //UAPSD will not be retied in this case so tell requester we are done with failure + pmcDoStartUapsdCallbacks(pMac, eHAL_STATUS_FAILURE); + } + else + pMac->pmc.uapsdSessionRequired = OrigUapsdReqState; + } break; /* We got a response to our Stop UAPSD request. */ @@ -1597,7 +1611,7 @@ void pmcMessageProcessor (tHalHandle hHal, tSirSmeRsp *pMsg) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - pmcLog(pMac, LOG2, FL("Entering pmcMessageProcessor, message type %d"), pMsg->messageType); + pmcLog(pMac, LOG2, FL("Message type %d"), pMsg->messageType); switch( pMsg->messageType ) { @@ -2104,7 +2118,7 @@ eHalStatus pmcDeregisterDeviceStateUpdateInd (tHalHandle hHal, tListElem *pEntry; tpDeviceStateUpdateIndEntry pDeviceStateUpdateIndEntry; - pmcLog(pMac, LOG2, FL("Entering pmcDeregisterDeviceStateUpdateInd")); + pmcLog(pMac, LOG2, FL(": Enter")); /* Find entry in the power save update routine list that matches the specified routine and remove it. */ @@ -2182,7 +2196,6 @@ eHalStatus pmcWowlAddBcastPattern ( #ifdef FEATURE_WLAN_DIAG_SUPPORT vos_log_powersave_wow_add_ptrn_pkt_type *log_ptr = NULL; - WLAN_VOS_DIAG_LOG_ALLOC(log_ptr, vos_log_powersave_wow_add_ptrn_pkt_type, LOG_WLAN_POWERSAVE_WOW_ADD_PTRN_C); #endif //#ifdef FEATURE_WLAN_DIAG_SUPPORT pmcLog(pMac, LOG2, "PMC: entering pmcWowlAddBcastPattern"); @@ -2190,16 +2203,24 @@ eHalStatus pmcWowlAddBcastPattern ( if(pattern == NULL) { pmcLog(pMac, LOGE, FL("Null broadcast pattern being passed")); +#ifdef FEATURE_WLAN_DIAG_SUPPORT + WLAN_VOS_DIAG_LOG_FREE(log_ptr); +#endif return eHAL_STATUS_FAILURE; } if( pSession == NULL) { pmcLog(pMac, LOGE, FL("Session not found ")); +#ifdef FEATURE_WLAN_DIAG_SUPPORT + WLAN_VOS_DIAG_LOG_FREE(log_ptr); +#endif return eHAL_STATUS_FAILURE; } #ifdef FEATURE_WLAN_DIAG_SUPPORT + WLAN_VOS_DIAG_LOG_ALLOC(log_ptr, vos_log_powersave_wow_add_ptrn_pkt_type, + LOG_WLAN_POWERSAVE_WOW_ADD_PTRN_C); if( log_ptr ) { log_ptr->pattern_id = pattern->ucPatternId; @@ -2216,9 +2237,9 @@ eHalStatus pmcWowlAddBcastPattern ( /* 1 bit in the pattern mask denotes 1 byte of pattern hence pattern mask size is 1/8 */ vos_mem_copy(log_ptr->pattern_mask, pattern->ucPatternMask, SIR_WOWL_BCAST_PATTERN_MAX_SIZE >> 3); + WLAN_VOS_DIAG_LOG_REPORT(log_ptr); } - WLAN_VOS_DIAG_LOG_REPORT(log_ptr); #endif @@ -2594,6 +2615,8 @@ eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, msg.type = WDA_SET_HOST_OFFLOAD; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_HOST_OFFLOAD message to WDA", __func__); @@ -2647,6 +2670,8 @@ eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest, tANI_U8 msg.type = WDA_SET_KEEP_ALIVE; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " @@ -2699,6 +2724,8 @@ eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, msg.type = WDA_SET_NS_OFFLOAD; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post SIR_HAL_SET_HOST_OFFLOAD message to HAL", __func__); @@ -3067,7 +3094,8 @@ eHalStatus pmcSetPreferredNetworkList pCommand->command = eSmeCommandPnoReq; pCommand->sessionId = (tANI_U8)sessionId; - if (!HAL_STATUS_SUCCESS(csrQueueSmeCommand(pMac, pCommand, TRUE))) + if (!HAL_STATUS_SUCCESS(csrQueueSmeCommand(pMac, pCommand, + !pRequestBuf->enable))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("failed to post eSmeCommandPnoReq command")); @@ -3103,6 +3131,8 @@ eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold) msg.type = WDA_SET_RSSI_FILTER_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_PNO_REQ message to WDA", __func__); @@ -3154,6 +3184,8 @@ eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChanne msg.type = WDA_UPDATE_SCAN_PARAMS_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_UPDATE_SCAN_PARAMS message to WDA", __func__); @@ -3193,6 +3225,8 @@ eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_POWER_PARAMS_REQ message to WDA", __func__); @@ -3256,6 +3290,8 @@ eHalStatus pmcGetFilterMatchCount pMac->pmc.FilterMatchCountCB = callbackRoutine; pMac->pmc.FilterMatchCountCBContext = callbackContext; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -3313,6 +3349,8 @@ eHalStatus pmcSetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pGtkOffload, msg.type = WDA_GTK_OFFLOAD_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post " @@ -3378,6 +3416,8 @@ eHalStatus pmcGetGTKOffload(tHalHandle hHal, GTKOffloadGetInfoCallback callbackR pMac->pmc.GtkOffloadGetInfoCB = callbackRoutine; pMac->pmc.GtkOffloadGetInfoCBContext = callbackContext; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_GTK_OFFLOAD_GETINFO_REQ message to WDA", @@ -3450,6 +3490,8 @@ eHalStatus pmcSetBatchScanReq(tHalHandle hHal, tSirSetBatchScanReq *pRequest, msg.type = WDA_SET_BATCH_SCAN_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -3502,6 +3544,8 @@ eHalStatus pmcTriggerBatchScanResultInd msg.type = WDA_TRIGGER_BATCH_SCAN_RESULT_IND; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -3543,6 +3587,8 @@ eHalStatus pmcStopBatchScanInd(tHalHandle hHal, tSirStopBatchScanInd *pRequest, msg.type = WDA_STOP_BATCH_SCAN_IND; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, diff --git a/drivers/staging/prima/CORE/SME/src/pmc/pmcLogDump.c b/drivers/staging/prima/CORE/SME/src/pmc/pmcLogDump.c index ea3043ee14ad..c8c222fc7174 100644 --- a/drivers/staging/prima/CORE/SME/src/pmc/pmcLogDump.c +++ b/drivers/staging/prima/CORE/SME/src/pmc/pmcLogDump.c @@ -31,9 +31,6 @@ * * Description: Implements the dump commands specific to PMC module * -* Copyright 2008 (c) Qualcomm, Incorporated. -* All Rights Reserved. -* Qualcomm Confidential and Proprietary. * ******************************************************************************/ diff --git a/drivers/staging/prima/CORE/SME/src/rrm/sme_rrm.c b/drivers/staging/prima/CORE/SME/src/rrm/sme_rrm.c index 33996fc37d05..7f1ecf0dc501 100644 --- a/drivers/staging/prima/CORE/SME/src/rrm/sme_rrm.c +++ b/drivers/staging/prima/CORE/SME/src/rrm/sme_rrm.c @@ -31,9 +31,6 @@ \brief implementation for SME RRM APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -230,6 +227,8 @@ static eHalStatus sme_RrmSendBeaconReportXmitInd( tpAniSirGlobal pMac, ie_len+sizeof(tSirBssDescription)); if (NULL == pBeaconRep->pBssDescription[msgCounter]) break; + vos_mem_zero(pBeaconRep->pBssDescription[msgCounter], + ie_len+sizeof(tSirBssDescription)); vos_mem_copy( pBeaconRep->pBssDescription[msgCounter], pBssDesc, sizeof(tSirBssDescription) ); @@ -818,6 +817,12 @@ void sme_RrmProcessBeaconReportReqInd(tpAniSirGlobal pMac, void *pMsgBuf) #if defined WLAN_VOWIFI_DEBUG smsLog( pMac, LOGE, "Received Beacon report request ind Channel = %d", pBeaconReq->channelInfo.channelNum ); #endif + + if (pBeaconReq->channelList.numChannels > SIR_ESE_MAX_MEAS_IE_REQS) { + smsLog( pMac, LOGP, "Beacon report request numChannels: %u exceeds " + "max num channels", pBeaconReq->channelList.numChannels); + return; + } //section 11.10.8.1 (IEEE Std 802.11k-2008) //channel 0 and 255 has special meaning. if( (pBeaconReq->channelInfo.channelNum == 0) || diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c index de84d42af2d8..0febd6490e2c 100644 --- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c +++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c @@ -34,9 +34,6 @@ \brief Definitions for SME APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -75,11 +72,7 @@ #include "vos_trace.h" #include "sapApi.h" #include "macTrace.h" - - -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); @@ -96,9 +89,9 @@ extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdTyp tANI_U32 size, tSmeCmd **ppCmd ); extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); +extern void csrReleaseRocReqCommand( tpAniSirGlobal pMac); extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); -extern eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm); extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); @@ -190,9 +183,14 @@ static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) &pMac->sme.smeCmdFreeList))) goto end; - pCmd = vos_mem_malloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); + pCmd = (tSmeCmd *) vos_mem_vmalloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); if ( NULL == pCmd ) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("fail to allocate memory %lu"), + (unsigned long)(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd)); status = eHAL_STATUS_FAILURE; + } else { status = eHAL_STATUS_SUCCESS; @@ -338,7 +336,7 @@ static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) if(NULL != pMac->sme.pSmeCmdBufAddr) { - vos_mem_free(pMac->sme.pSmeCmdBufAddr); + vos_mem_vfree(pMac->sme.pSmeCmdBufAddr); pMac->sme.pSmeCmdBufAddr = NULL; } @@ -402,7 +400,8 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) /* reset when free list is available */ smeCommandQueueFull = 0; } - else { + else + { int idx = 1; //Cannot change pRetCmd here since it needs to return later. @@ -440,22 +439,33 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) } pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); } - /* Increament static variable so that it prints pending command only once*/ - smeCommandQueueFull++; csrLLUnlock(&pMac->sme.smeCmdPendingList); + idx = 1; //There may be some more command in CSR's own pending queue csrLLLock(&pMac->roam.roamCmdPendingList); pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); - while(pEntry) + while(pEntry && !smeCommandQueueFull) { pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); - smsLog( pMac, LOGE, "Out of command buffer.... CSR pending command #%d (0x%X)", - idx++, pTempCmd->command ); + /* Print only 1st five commands from CSR pending queue */ + if (idx <= 5) + smsLog( pMac, LOGE, + "Out of command buffer...CSR pending command #%d (0x%X)", + idx, pTempCmd->command ); + idx++; dumpCsrCommandInfo(pMac, pTempCmd); pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); } + /* + * Increament static variable so that it prints pending command + * only once + */ + smeCommandQueueFull++; csrLLUnlock(&pMac->roam.roamCmdPendingList); + + /* panic with out-of-command */ + VOS_BUG(0); } if( pRetCmd ) @@ -471,6 +481,11 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) { + if (!SME_IS_START(pMac)) + { + smsLog( pMac, LOGE, FL("Sme in stop state")); + return; + } if ( fHighPriority ) { csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); @@ -722,6 +737,150 @@ eHalStatus smeProcessPnoCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) return eHAL_STATUS_SUCCESS; } +/** + * sme_process_set_max_tx_power() - Set the Maximum Transmit Power + * + * @pMac: mac pointer. + * @command: cmd param containing bssid, self mac + * and power in db + * + * Set the maximum transmit power dynamically. + * + * Return: eHalStatus + * + */ +eHalStatus sme_process_set_max_tx_power(tpAniSirGlobal pMac, + tSmeCmd *command) +{ + vos_msg_t msg; + tMaxTxPowerParams *max_tx_params = NULL; + + max_tx_params = vos_mem_malloc(sizeof(*max_tx_params)); + if (NULL == max_tx_params) + { + smsLog(pMac, LOGE, FL("fail to allocate memory for max_tx_params")); + return eHAL_STATUS_FAILURE; + } + + vos_mem_copy(max_tx_params->bssId, + command->u.set_tx_max_pwr.bssid, SIR_MAC_ADDR_LENGTH); + vos_mem_copy(max_tx_params->selfStaMacAddr, + command->u.set_tx_max_pwr.self_sta_mac_addr, + SIR_MAC_ADDR_LENGTH); + max_tx_params->power = + command->u.set_tx_max_pwr.power; + + msg.type = WDA_SET_MAX_TX_POWER_REQ; + msg.reserved = 0; + msg.bodyptr = max_tx_params; + + if(VOS_STATUS_SUCCESS != + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) + { + smsLog(pMac, LOGE, + FL("Not able to post WDA_SET_MAX_TX_POWER_REQ message to WDA")); + vos_mem_free(max_tx_params); + return eHAL_STATUS_FAILURE; + } + return eHAL_STATUS_SUCCESS; +} + +static void smeProcessNanReq(tpAniSirGlobal pMac, tSmeCmd *pCommand ) +{ + tSirMsgQ msgQ; + tSirRetStatus retCode = eSIR_SUCCESS; + + msgQ.type = WDA_NAN_REQUEST; + msgQ.reserved = 0; + msgQ.bodyptr = pCommand->u.pNanReq; + msgQ.bodyval = 0; + + retCode = wdaPostCtrlMsg( pMac, &msgQ ); + if( eSIR_SUCCESS != retCode) + { + vos_mem_free(pCommand->u.pNanReq); + smsLog( pMac, LOGE, + FL("Posting WDA_NAN_REQUEST to WDA failed, reason=%X"), + retCode ); + } + else + { + smsLog(pMac, LOG1, FL("posted WDA_NAN_REQUEST command")); + } +} + +/* + * sme_process_set_max_tx_power_per_band() - Set the Maximum Transmit Power + * specific to band dynamically + * @mac_ctx: mac context + * @command: cmd param containing band, and power in db + * + * Set the maximum transmit power dynamically per band + * + * Return: eHalStatus + */ +eHalStatus sme_process_set_max_tx_power_per_band(tpAniSirGlobal mac_ctx, + tSmeCmd *command) +{ + vos_msg_t msg; + tMaxTxPowerPerBandParams *max_tx_params_per_band; + + max_tx_params_per_band = + vos_mem_malloc(sizeof(*max_tx_params_per_band)); + if (max_tx_params_per_band == NULL) { + smsLog(mac_ctx, LOGE, + FL("fail to allocate memory")); + return eHAL_STATUS_FAILURE; + } + + max_tx_params_per_band->bandInfo = + command->u.set_tx_max_pwr_per_band.band; + max_tx_params_per_band->power = + command->u.set_tx_max_pwr_per_band.power; + + msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; + msg.reserved = 0; + msg.bodyptr = max_tx_params_per_band; + + if (VOS_STATUS_SUCCESS != + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { + smsLog(mac_ctx, LOGE, + FL("Unable to post message to WDA")); + vos_mem_free(max_tx_params_per_band); + return eHAL_STATUS_FAILURE; + } + return eHAL_STATUS_SUCCESS; +} + +/** + * sme_process_update_channel_list() - Update channel list + * @mac_ctx: mac context + * @command: cmd param containing band, and power in db + * + * Return: eHalStatus + */ +eHalStatus sme_process_update_channel_list(tpAniSirGlobal mac_ctx, + tSmeCmd *command) +{ + vos_msg_t msg; + + msg.type = WDA_UPDATE_CHAN_LIST_REQ; + msg.reserved = 0; + msg.bodyptr = command->u.chan_list; + + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); + + if (VOS_STATUS_SUCCESS != + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { + smsLog(mac_ctx, LOGE, + FL("Unable to post message to WDA")); + vos_mem_free(command->u.chan_list); + return eHAL_STATUS_FAILURE; + } + return eHAL_STATUS_SUCCESS; +} + tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) { tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; @@ -816,8 +975,14 @@ tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) { + /* Set the time out to 30 sec */ + pMac->sme.smeCmdActiveList.cmdTimeoutDuration = + CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; //Force this command to wake up the chip csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_COMMAND,pPmcCmd->sessionId, + pPmcCmd->command)); csrLLUnlock( &pMac->sme.smeCmdActiveList ); fContinue = pmcProcessCommand( pMac, pPmcCmd ); if( fContinue ) @@ -842,6 +1007,24 @@ tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) { // we can reuse the pCommand + /* For ROC set timeot to 30 *3 as Supplicant can retry + * P2P Invitation Request 120 times with 500ms interval. + * For roam command set timeout to 30 * 2 sec. + * There are cases where we try to connect to different + * APs with same SSID one by one until sucessfully conneted + * and thus roam command might take more time if connection + * is rejected by too many APs. + */ + if (eSmeCommandRemainOnChannel == pCommand->command) + pMac->sme.smeCmdActiveList.cmdTimeoutDuration = + CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE * 3; + else if ((eSmeCommandRoam == pCommand->command) && + (eCsrHddIssued == pCommand->u.roamCmd.roamReason)) + pMac->sme.smeCmdActiveList.cmdTimeoutDuration = + CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE * 2; + else + pMac->sme.smeCmdActiveList.cmdTimeoutDuration = + CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; // Insert the command onto the ActiveList... csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); @@ -919,6 +1102,68 @@ tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) csrLLUnlock( &pMac->sme.smeCmdActiveList ); csrProcessDelStaSessionCommand( pMac, pCommand ); break; + case eSmeCommandMacSpoofRequest: + csrLLUnlock( &pMac->sme.smeCmdActiveList ); + csrProcessMacAddrSpoofCommand( pMac, pCommand ); + //We need to re-run the command + fContinue = eANI_BOOLEAN_TRUE; + + // No Rsp expected, free cmd from active list + if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK ) ) + { + csrReleaseCommand( pMac, pCommand ); + } + + break; + case eSmeCommandGetFrameLogRequest: + csrLLUnlock( &pMac->sme.smeCmdActiveList ); + csrProcessGetFrameLogCommand( pMac, pCommand ); + //We need to re-run the command + fContinue = eANI_BOOLEAN_TRUE; + // No Rsp expected, free cmd from active list + if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK ) ) + { + csrReleaseCommand( pMac, pCommand ); + } + break; + case eSmeCommandSetMaxTxPower: + csrLLUnlock(&pMac->sme.smeCmdActiveList); + sme_process_set_max_tx_power(pMac, pCommand); + /* We need to re-run the command */ + fContinue = eANI_BOOLEAN_TRUE; + /* No Rsp expected, free cmd from active list */ + if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK)) + { + csrReleaseCommand(pMac, pCommand); + } + break; + case eSmeCommandSetMaxTxPowerPerBand: + csrLLUnlock(&pMac->sme.smeCmdActiveList); + sme_process_set_max_tx_power_per_band(pMac, + pCommand); + /* We need to re-run the command */ + fContinue = eANI_BOOLEAN_TRUE; + /* No Rsp expected, free cmd from active list */ + if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK)) { + csrReleaseCommand(pMac, pCommand); + } + break; + + case eSmeCommandUpdateChannelList: + csrLLUnlock(&pMac->sme.smeCmdActiveList); + sme_process_update_channel_list(pMac, pCommand); + if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK)) { + csrReleaseCommand(pMac, pCommand); + } + smsLog(pMac, LOG1, + FL("eSmeCommandUpdateChannelList processed")); + fContinue = eANI_BOOLEAN_TRUE; + break; #ifdef FEATURE_OEM_DATA_SUPPORT case eSmeCommandOemDataReq: @@ -1061,22 +1306,31 @@ tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) case eSmeCommandTdlsDelPeer: case eSmeCommandTdlsLinkEstablish: case eSmeCommandTdlsChannelSwitch: // tdlsoffchan -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eSmeCommandTdlsDiscovery: - case eSmeCommandTdlsLinkSetup: - case eSmeCommandTdlsLinkTear: - case eSmeCommandTdlsEnterUapsd: - case eSmeCommandTdlsExitUapsd: -#endif + smsLog(pMac, LOG1, + FL("sending TDLS Command 0x%x to PE"), + pCommand->command); + csrLLUnlock(&pMac->sme.smeCmdActiveList); + status = csrTdlsProcessCmd(pMac, pCommand); + if(!HAL_STATUS_SUCCESS(status)) { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "sending TDLS Command 0x%x to PE", pCommand->command); - - csrLLUnlock( &pMac->sme.smeCmdActiveList ); - status = csrTdlsProcessCmd( pMac, pCommand ); + if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK)) + csrReleaseCommand(pMac, pCommand); } break ; #endif + case eSmeCommandNanReq: + csrLLUnlock( &pMac->sme.smeCmdActiveList ); + smeProcessNanReq( pMac, pCommand ); + if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, + &pCommand->Link, LL_ACCESS_LOCK)) + { + csrReleaseCommand(pMac, pCommand); + } + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "eSmeCommandNanReq processed"); + fContinue = eANI_BOOLEAN_TRUE; + break; default: //something is wrong @@ -1474,16 +1728,6 @@ eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) /* update the directed scan offload setting */ pMac->fScanOffload = pSmeConfigParams->fScanOffload; - /* Enable channel bonding mode in 2.4GHz */ - if ((pSmeConfigParams->csrConfig.channelBondingMode24GHz == TRUE) && - (IS_HT40_OBSS_SCAN_FEATURE_ENABLE)) - { - ccmCfgSetInt(hHal,WNI_CFG_CHANNEL_BONDING_24G, - eANI_BOOLEAN_TRUE, NULL,eANI_BOOLEAN_FALSE); - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "Setting channelBondingMode24GHz:%d " , - pSmeConfigParams->csrConfig.channelBondingMode24GHz); - } if (pMac->fScanOffload) { /* If scan offload is enabled then lim has allow the sending of @@ -1502,6 +1746,7 @@ eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; pMac->fDeferIMPSTime = pSmeConfigParams->fDeferIMPSTime; + pMac->fBtcEnableIndTimerVal = pSmeConfigParams->fBtcEnableIndTimerVal; return status; } @@ -1792,6 +2037,42 @@ eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, } #endif +#ifdef WLAN_FEATURE_AP_HT40_24G +/* --------------------------------------------------------------------------- + \fn sme_HT2040CoexInfoInd + \brief a Send 20/40 Coex info to SAP layer + + \param tpSirHT2040CoexInfoInd - 20/40 Coex info param + \return eHalStatus + ---------------------------------------------------------------------------*/ + +eHalStatus sme_HT2040CoexInfoInd( tHalHandle hHal, + tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + tANI_U32 SessionId = pSmeHT2040CoexInfoInd->sessionId; + tCsrRoamInfo roamInfo = {0}; + + roamInfo.pSmeHT2040CoexInfoInd = pSmeHT2040CoexInfoInd; + + smsLog(pMac, LOGW, FL("HT40MHzIntolerant: %d HT20MHzBssWidthReq: %d"), + roamInfo.pSmeHT2040CoexInfoInd->HT40MHzIntolerant, + roamInfo.pSmeHT2040CoexInfoInd->HT20MHzBssWidthReq); + + smsLog(pMac, LOGW, FL("Total Intolerant Channel: %d"), + roamInfo.pSmeHT2040CoexInfoInd->channel_num); + + /* forward the 20/40 BSS Coex information to HDD */ + smsLog(pMac, LOGW, FL("Sending eCSR_ROAM_2040_COEX_INFO_IND" + " to WLANSAP_RoamCallback ")); + + csrRoamCallCallback(pMac, SessionId, &roamInfo, + 0, eCSR_ROAM_2040_COEX_INFO_IND, 0); + return status; +} +#endif + #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) /*------------------------------------------------------------------ * @@ -1889,6 +2170,7 @@ eHalStatus sme_SetEseBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, } sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); + vos_mem_free(pSmeBcnReportReq); return status; } @@ -1940,6 +2222,8 @@ eHalStatus sme_getBcnMissRate(tHalHandle hHal, tANI_U8 sessionId, void *callback vosMessage.type = WDA_GET_BCN_MISS_RATE_REQ; vosMessage.bodyptr = pMsg; vosMessage.reserved = 0; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -1977,6 +2261,20 @@ eHalStatus sme_EncryptMsgResponseHandler(tHalHandle hHal, return eHAL_STATUS_SUCCESS; } +eHalStatus sme_UpdateMaxRateInd(tHalHandle hHal, + tSirSmeUpdateMaxRateParams *pSmeUpdateMaxRateParams) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + tANI_U8 sessionId = pSmeUpdateMaxRateParams->smeSessionId; + + /* forward the information to HDD */ + status = csrRoamCallCallback(pMac, sessionId, NULL, 0, + eCSR_ROAM_UPDATE_MAX_RATE_IND, + pSmeUpdateMaxRateParams->maxRateFlag); + return status; +} + /*-------------------------------------------------------------------------- \brief sme_ProcessMsg() - The main message processor for SME. @@ -2142,17 +2440,19 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_REMAIN_ON_CHN_RDY_IND), nothing to process"); } break; - case eWNI_SME_MGMT_FRM_IND: +#ifdef WLAN_FEATURE_AP_HT40_24G + case eWNI_SME_2040_COEX_IND: if(pMsg->bodyptr) { - sme_mgmtFrmInd(pMac, pMsg->bodyptr); + sme_HT2040CoexInfoInd(pMac, pMsg->bodyptr); vos_mem_free(pMsg->bodyptr); } else { - smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_MGMT_FRM_IND), nothing to process"); + smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_2040_COEX_IND), nothing to process"); } break; +#endif case eWNI_SME_ACTION_FRAME_SEND_CNF: if(pMsg->bodyptr) { @@ -2165,6 +2465,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) } break; case eWNI_SME_COEX_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if(pMsg->bodyptr) { tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)pMsg->bodyptr; @@ -2193,6 +2495,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef FEATURE_WLAN_SCAN_PNO case eWNI_SME_PREF_NETWORK_FOUND_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if(pMsg->bodyptr) { status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); @@ -2206,6 +2510,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #endif // FEATURE_WLAN_SCAN_PNO case eWNI_SME_TX_PER_HIT_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if (pMac->sme.pTxPerHitCallback) { pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); @@ -2238,6 +2544,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef WLAN_FEATURE_PACKET_FILTERING case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if(pMsg->bodyptr) { status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); @@ -2264,6 +2572,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef WLAN_WAKEUP_EVENTS case eWNI_SME_WAKE_REASON_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if(pMsg->bodyptr) { status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); @@ -2289,17 +2599,7 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: case eWNI_SME_TDLS_CHANNEL_SWITCH_RSP: -#ifdef FEATURE_WLAN_TDLS_INTERNAL - case eWNI_SME_TDLS_DISCOVERY_START_RSP: - case eWNI_SME_TDLS_DISCOVERY_START_IND: - case eWNI_SME_TDLS_LINK_START_RSP: - case eWNI_SME_TDLS_LINK_START_IND: - case eWNI_SME_TDLS_TEARDOWN_RSP: - case eWNI_SME_TDLS_TEARDOWN_IND: - case eWNI_SME_ADD_TDLS_PEER_IND: - case eWNI_SME_DELETE_TDLS_PEER_IND: -#endif - { + { if (pMsg->bodyptr) { status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); @@ -2350,6 +2650,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef WLAN_FEATURE_GTK_OFFLOAD case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if (pMsg->bodyptr) { sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); @@ -2367,6 +2669,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef FEATURE_WLAN_LPHB /* LPHB timeout indication arrived, send IND to client */ case eWNI_SME_LPHB_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if (pMac->sme.pLphbIndCb) { pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); @@ -2379,6 +2683,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #ifdef FEATURE_WLAN_CH_AVOID /* LPHB timeout indication arrived, send IND to client */ case eWNI_SME_CH_AVOID_IND: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if (pMac->sme.pChAvoidNotificationCb) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, @@ -2391,6 +2697,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #endif /* FEATURE_WLAN_CH_AVOID */ case eWNI_SME_ENCRYPT_MSG_RSP: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); if (pMsg->bodyptr) { sme_EncryptMsgResponseHandler(pMac, pMsg->bodyptr); @@ -2404,6 +2712,35 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) } break ; + case eWNI_SME_UPDATE_MAX_RATE_IND: + if (pMsg->bodyptr) + { + sme_UpdateMaxRateInd(pMac, pMsg->bodyptr); + vos_mem_free(pMsg->bodyptr); + } + else + { + smsLog(pMac, LOGE, + "Empty message for (eWNI_SME_UPDATE_MAX_RATE_IND)," + " nothing to process"); + } + break; + + case eWNI_SME_NAN_EVENT: + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); + if (pMsg->bodyptr) + { + sme_NanEvent(hHal, pMsg->bodyptr); + vos_mem_free(pMsg->bodyptr); + } + else + { + smsLog(pMac, LOGE, + "Empty message for (eWNI_SME_NAN_EVENT)," + " nothing to process"); + } + break; default: @@ -2635,6 +2972,19 @@ eHalStatus sme_Close(tHalHandle hHal) return status; } + +v_VOID_t sme_PreClose(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + if(!pMac) + return; + + smsLog(pMac, LOGW, FL("Stopping Active CMD List Timer")); + vos_timer_stop( pMac->sme.smeCmdActiveList.cmdTimeoutTimer ); + +} + #ifdef FEATURE_WLAN_LFR tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) { @@ -2829,6 +3179,29 @@ eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) return (status); } + /* + * --------------------------------------------------------------------------- + * \fn sme_FilterScanDFSResults + * \brief a wrapper function to request CSR to filter BSSIDs on DFS channels + * from the scan results. + * \return eHalStatus + *--------------------------------------------------------------------------- + */ +eHalStatus sme_FilterScanDFSResults(tHalHandle hHal) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + csrScanFilterDFSResults(pMac); + sme_ReleaseGlobalLock( &pMac->sme ); + } + + return (status); +} + eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_FAILURE; @@ -2890,8 +3263,6 @@ tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tCsrScanResultInfo *pRet = NULL; - MTRACE(vos_trace(VOS_MODULE_ID_SME , - TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { @@ -3052,6 +3423,7 @@ tANI_U32 sme_GetChannelBondingMode5G(tHalHandle hHal) return smeConfig.csrConfig.channelBondingMode5GHz; } +#ifdef WLAN_FEATURE_AP_HT40_24G /* --------------------------------------------------------------------------- \fn sme_GetChannelBondingMode24G \brief get the channel bonding mode for 2.4G band @@ -3065,9 +3437,66 @@ tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal) sme_GetConfigParam(pMac, &smeConfig); - return smeConfig.csrConfig.channelBondingMode24GHz; + return smeConfig.csrConfig.channelBondingAPMode24GHz; +} + +/* --------------------------------------------------------------------------- + \fn sme_UpdateChannelBondingMode24G + \brief update the channel bonding mode for 2.4G band + \param hHal - HAL handle + \param cbMode - channel bonding mode + \return + ---------------------------------------------------------------------------*/ +void sme_UpdateChannelBondingMode24G(tHalHandle hHal, tANI_U8 cbMode) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + tSmeConfigParams smeConfig; + + vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); + sme_GetConfigParam(pMac, &smeConfig); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("Previous Channel Bonding : = %d"), + smeConfig.csrConfig.channelBondingAPMode24GHz); + + smeConfig.csrConfig.channelBondingAPMode24GHz = cbMode; + sme_UpdateConfig(hHal, &smeConfig); + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, + FL("New Channel Bonding : = %d"), + sme_GetChannelBondingMode24G(hHal)); + return; } +/* --------------------------------------------------------------------------- + + \fn sme_SetHT2040Mode + + \brief To update HT Operation beacon IE & Channel Bonding. + + \param + + \return eHalStatus SUCCESS + FAILURE or RESOURCES + The API finished and failed. + + -------------------------------------------------------------------------------*/ +eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 cbMode) +{ + eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + FL("Channel Bonding =%d"), + cbMode); + + status = sme_AcquireGlobalLock(&pMac->sme); + if (HAL_STATUS_SUCCESS(status)) + { + status = csrSetHT2040Mode(pMac, sessionId, cbMode); + sme_ReleaseGlobalLock(&pMac->sme ); + } + return (status); +} +#endif /* --------------------------------------------------------------------------- \fn sme_RoamConnect @@ -3249,7 +3678,7 @@ eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDiscon { if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) { - status = csrRoamDisconnect( pMac, sessionId, reason ); + status = csrRoamDisconnect( pMac, sessionId, reason ); } else { @@ -3261,6 +3690,29 @@ eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDiscon return (status); } +/* --------------------------------------------------------------------------- + \fn.sme_abortConnection + \brief a wrapper function to request CSR to stop from connecting a network + \retun void. +---------------------------------------------------------------------------*/ + +void sme_abortConnection(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_FAILURE; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) + { + csr_abortConnection( pMac, sessionId); + } + sme_ReleaseGlobalLock( &pMac->sme ); + } + return; +} + /* --------------------------------------------------------------------------- \fn sme_RoamStopBss \brief To stop BSS for Soft AP. This is an asynchronous API. @@ -3300,7 +3752,12 @@ eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, - tANI_U8 *pPeerMacAddr) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pPeerMacAddr +#else + tANI_U8 *pPeerMacAddr +#endif +) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -3348,7 +3805,9 @@ eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, VOS_ASSERT(0); return status; } - + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_MSG_DEAUTH_STA, + sessionId, pDelStaParams->reason_code)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { @@ -3623,12 +4082,19 @@ eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, } eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tANI_U8 *pBSSId, +#else tANI_U8 *pBSSId, +#endif tANI_BOOLEAN flush_cache ) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); status = sme_AcquireGlobalLock( &pMac->sme ); + + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_ROAM_DEL_PMKIDCACHE, sessionId, flush_cache)); if ( HAL_STATUS_SUCCESS( status ) ) { if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) @@ -3820,6 +4286,7 @@ eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) return status; } #endif + pParam->fBtcEnableIndTimerVal = pMac->fBtcEnableIndTimerVal; sme_ReleaseGlobalLock( &pMac->sme ); } @@ -4680,13 +5147,6 @@ eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pS smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); return eHAL_STATUS_FAILURE; } - /*Once Setkey is done, we can go in BMPS*/ - if(pSetKey->keyLength) - { - pMac->pmc.remainInPowerActiveTillDHCP = FALSE; - smsLog(pMac, LOG1, FL("Reset remainInPowerActiveTillDHCP" - " to allow BMPS")); - } status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) @@ -4733,21 +5193,22 @@ eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pS status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); sme_ReleaseGlobalLock( &pMac->sme ); } -#ifdef DEBUG_ROAM_DELAY - //Store sent PTK key time - if(pSetKey->keyDirection == eSIR_TX_RX) + if (pMac->roam.configParam.roamDelayStatsEnabled) { - vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); - } - else if(pSetKey->keyDirection == eSIR_RX_ONLY) - { - vos_record_roam_event(e_HDD_SET_GTK_REQ, NULL, 0); - } - else - { - return (status); + //Store sent PTK key time + if(pSetKey->keyDirection == eSIR_TX_RX) + { + vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); + } + else if(pSetKey->keyDirection == eSIR_RX_ONLY) + { + vos_record_roam_event(e_HDD_SET_GTK_REQ, NULL, 0); + } + else + { + return (status); + } } -#endif return (status); } @@ -4878,7 +5339,6 @@ eHalStatus sme_GetRoamRssi(tHalHandle hHal, } #endif - #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) /* --------------------------------------------------------------------------- \fn sme_GetTsmStats @@ -4948,6 +5408,46 @@ eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId } +eHalStatus sme_GetFwStats(tHalHandle hHal, tANI_U32 stats, + void *pContext, tSirFWStatsCallback callback) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + vos_msg_t msg; + tSirFWStatsGetReq *pGetFWStatsReq; + + smsLog(pMac, LOG1, FL(" ENTER stats = %d "),stats); + + if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) + { + pGetFWStatsReq = (tSirFWStatsGetReq *)vos_mem_malloc(sizeof(tSirFWStatsGetReq)); + if ( NULL == pGetFWStatsReq) + { + smsLog(pMac, LOGE, FL("Not able to allocate memory for " + "WDA_FW_STATS_GET_REQ")); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + pGetFWStatsReq->stats = stats; + pGetFWStatsReq->callback = (tSirFWStatsCallback)callback; + pGetFWStatsReq->data = pContext; + + msg.type = WDA_FW_STATS_GET_REQ; + msg.reserved = 0; + msg.bodyptr = pGetFWStatsReq; + if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_WDA, &msg)) + { + smsLog(pMac, LOGE, + FL("Not able to post WDA_FW_STATS_GET_REQ message to HAL")); + vos_mem_free(pGetFWStatsReq); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_SUCCESS; + } + return eHAL_STATUS_FAILURE; +} + /* --------------------------------------------------------------------------- \fn smeGetTLSTAState \helper function to get the TL STA State whenever the function is called. @@ -5501,6 +6001,8 @@ eHalStatus sme_DHCPStartInd( tHalHandle hHal, vosMessage.bodyptr = pMsg; vosMessage.reserved = 0; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -5569,6 +6071,9 @@ eHalStatus sme_DHCPStopInd( tHalHandle hHal, vosMessage.bodyptr = pMsg; vosMessage.reserved = 0; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); + vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -5873,7 +6378,7 @@ VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); if(eDRIVER_TYPE_MFG == pMac->gDriverType) { - if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf)) + if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf, 0)) { return VOS_STATUS_SUCCESS; } @@ -5893,7 +6398,7 @@ VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) { - if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf)) + if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf, 0)) { status = VOS_STATUS_SUCCESS; } @@ -6440,7 +6945,9 @@ eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, --------------------------------------------------------------------------*/ eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, - csrRoamSessionCloseCallback callback, void *pContext) + tANI_U8 bPurgeSmeCmdList, + csrRoamSessionCloseCallback callback, + void *pContext) { eHalStatus status; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -6450,7 +6957,7 @@ eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrRoamCloseSession( pMac, sessionId, FALSE, + status = csrRoamCloseSession( pMac, sessionId, FALSE, bPurgeSmeCmdList, callback, pContext ); sme_ReleaseGlobalLock( &pMac->sme ); @@ -6459,6 +6966,19 @@ eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, return ( status ); } +eHalStatus sme_PurgeCmdList(tHalHandle hHal, tANI_U8 sessionId) +{ + eHalStatus status; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + csrPurgeSmeCmdList( pMac, sessionId ); + sme_ReleaseGlobalLock( &pMac->sme ); + } + return ( status ); +} + /* --------------------------------------------------------------------------- \fn sme_RoamUpdateAPWPSIE @@ -6587,6 +7107,8 @@ eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) //status = halFW_SendBTAmpEventMesg(pMac, event); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " @@ -6605,11 +7127,13 @@ eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) \param hHal - The handle returned by macOpen. \param bssid - Pointer to the BSSID to roam to. \param fastRoamTrig - Trigger to Scan or roam + \param channel - channel number on which fastroam is requested \return eHalStatus ---------------------------------------------------------------------------*/ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, tANI_U8 *bssid, - tSmeFastRoamTrigger fastRoamTrig) + tSmeFastRoamTrigger fastRoamTrig, + tANI_U8 channel) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; @@ -6628,9 +7152,16 @@ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), (void *)bssid, sizeof(tSirMacAddr)); - smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " + smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID" MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); - + /* + * As FastReassoc is based on assumption that roamable AP should be + * present into the occupied channel list.We shd add i/p channel + * in occupied channel list if roamable-ap(BSSID in fastreassoc cmd) + * aged out prior to connection and there is no scan from aged out + * to till connection indication. + */ + csrAddChannelToOccupiedChannelList(pMac, channel); vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); if (VOS_STATUS_SUCCESS != vosStatus) { @@ -6781,6 +7312,9 @@ eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pReques tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_PREF_NET_LIST, + sessionId, pRequest->ucNetworksCount)); if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) { pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); @@ -6828,13 +7362,12 @@ eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, \param hHal - The handle returned by macOpen. \param sessionId - sessionId on which we need to abort scan. \param reason - Reason to abort the scan. - \return VOS_STATUS - VOS_STATUS_E_FAILURE - failure - VOS_STATUS_SUCCESS success + \return tSirAbortScanStatus Abort scan status ---------------------------------------------------------------------------*/ -eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, - eCsrAbortReason reason) +tSirAbortScanStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, + eCsrAbortReason reason) { + tSirAbortScanStatus scanAbortStatus = eSIR_ABORT_SCAN_FAILURE; eHalStatus status; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -6843,12 +7376,12 @@ eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrScanAbortMacScan(pMac, sessionId, reason); + scanAbortStatus = csrScanAbortMacScan(pMac, sessionId, reason); sme_ReleaseGlobalLock( &pMac->sme ); } - return ( status ); + return ( scanAbortStatus ); } /* ---------------------------------------------------------------------------- @@ -6880,6 +7413,48 @@ eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 return eHAL_STATUS_FAILURE; }// sme_GetOperationChannel ends here +/** + * sme_register_mgmt_frame_ind_callback() - Register a callback for + * management frame indication to PE. + * @hHal: hal pointer + * @callback: callback pointer to be registered + * + * This function is used to register a callback for management + * frame indication to PE. + * + * Return: Success if msg is posted to PE else Failure. + */ +eHalStatus sme_register_mgmt_frame_ind_callback(tHalHandle hHal, + sir_mgmt_frame_ind_callback callback) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + struct sir_sme_mgmt_frame_cb_req *msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + + smsLog(pMac, LOG1, FL(": ENTER")); + + if (eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock(&pMac->sme)) + { + msg = vos_mem_malloc(sizeof(*msg)); + if (NULL == msg) + { + smsLog(pMac, LOGE, + FL("Not able to allocate memory for eWNI_SME_REGISTER_MGMT_FRAME_CB")); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + vos_mem_set(msg, sizeof(*msg), 0); + msg->message_type = eWNI_SME_REGISTER_MGMT_FRAME_CB; + msg->length = sizeof(*msg); + + msg->callback = callback; + status = palSendMBMessage(pMac->hHdd, msg); + sme_ReleaseGlobalLock( &pMac->sme ); + return status; + } + return eHAL_STATUS_FAILURE; +} + /* --------------------------------------------------------------------------- \fn sme_RegisterMgtFrame @@ -7179,6 +7754,88 @@ eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) return(status); } +/* --------------------------------------------------------------------------- + \fn sme_GetFramesLog + \brief a wrapper function that client calls to register a callback to get + mgmt frames logged + \param flag - flag tells to clear OR send the frame log buffer + \return eHalStatus + ---------------------------------------------------------------------------*/ +eHalStatus sme_GetFramesLog(tHalHandle hHal, tANI_U8 flag) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + eHalStatus status = eHAL_STATUS_SUCCESS; + tSmeCmd *pGetFrameLogCmd; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + pGetFrameLogCmd = csrGetCommandBuffer(pMac); + if (pGetFrameLogCmd) + { + pGetFrameLogCmd->command = eSmeCommandGetFrameLogRequest; + pGetFrameLogCmd->u.getFramelogCmd.getFrameLogCmdFlag= flag; + + status = csrQueueSmeCommand(pMac, pGetFrameLogCmd, eANI_BOOLEAN_TRUE); + if ( !HAL_STATUS_SUCCESS( status ) ) + { + smsLog( pMac, LOGE, FL("fail to send msg status = %d\n"), status ); + csrReleaseCommandScan(pMac, pGetFrameLogCmd); + } + } + else + { + //log error + smsLog(pMac, LOGE, FL("can not obtain a common buffer\n")); + status = eHAL_STATUS_RESOURCES; + } + sme_ReleaseGlobalLock( &pMac->sme); + } + return (status); +} + +/* --------------------------------------------------------------------------- + + \fn sme_InitMgmtFrameLogging + + \brief + SME will pass this request to lower mac to initialize Frame Logging. + + \param + + hHal - The handle returned by macOpen. + + wlanFWLoggingInitParam - Params to initialize frame logging + + \return eHalStatus + + +--------------------------------------------------------------------------- */ +eHalStatus sme_InitMgmtFrameLogging( tHalHandle hHal, + tSirFWLoggingInitParam *wlanFWLoggingInitParam) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t vosMessage; + + if ( eHAL_STATUS_SUCCESS == ( status = + sme_AcquireGlobalLock( &pMac->sme ) ) ) + { + /* serialize the req through MC thread */ + vosMessage.bodyptr = wlanFWLoggingInitParam; + vosMessage.type = WDA_MGMT_LOGGING_INIT_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); + vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); + if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) + { + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock( &pMac->sme ); + } + return(status); +} /* --------------------------------------------------------------------------- @@ -7220,6 +7877,8 @@ eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, /* serialize the req through MC thread */ vosMessage.bodyptr = wlanRxpFilterParam; vosMessage.type = WDA_CFG_RXP_FILTER_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -7264,6 +7923,8 @@ eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, /* serialize the req through MC thread */ vosMessage.bodyptr = wlanSuspendParam; vosMessage.type = WDA_WLAN_SUSPEND_IND; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -7308,6 +7969,8 @@ eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, /* serialize the req through MC thread */ vosMessage.bodyptr = wlanResumeParam; vosMessage.type = WDA_WLAN_RESUME_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -7496,6 +8159,20 @@ eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tAN return (status); } +eHalStatus sme_SetCfgScanControlList(tHalHandle hHal, tANI_U8 *countryCode, tCsrChannel *pChannelList) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + csrSetCfgScanControlList(pMac, countryCode, pChannelList); + sme_ReleaseGlobalLock( &pMac->sme ); + } + + return (status); +} /* --------------------------------------------------------------------------- @@ -7539,6 +8216,8 @@ eHalStatus sme_SetTxPerTracking(tHalHandle hHal, msg.reserved = 0; msg.bodyptr = pTxPerTrackingParamReq; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_TX_PER_TRACKING_REQ message to WDA", __func__); @@ -7583,6 +8262,19 @@ eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) static uNvTables nvTables; pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; + if (pMac->scan.fcc_constraint) + { + pMac->scan.fcc_constraint = false; + if (VOS_TRUE== vos_mem_compare(pMac->scan.countryCodeCurrent, + pMsg->countryCode, 2)) + { + csrInitGetChannels(pMac); + csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); + csrScanFilterResults(pMac); + return status ; + } + } + /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) @@ -7686,6 +8378,11 @@ eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) { //if 11d has priority, clear currentCountryBssid & countryCode11d to get //set again if we find AP with 11d info during scan + status = csrSetRegulatoryDomain(pMac, domainIdIoctl, NULL); + if (status != eHAL_STATUS_SUCCESS) + { + smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); + } if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) { smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); @@ -7756,6 +8453,10 @@ eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, is11dCountry = VOS_TRUE; } + smsLog( pMac, LOG1, FL("pMsg->countryCode : %c%c," + "pMac->scan.countryCode11d : %c%c\n"), + pMsg->countryCode[0], pMsg->countryCode[1], + pMac->scan.countryCode11d[0], pMac->scan.countryCode11d[1]); /* Set the country code given by userspace when 11dOriginal is FALSE * when 11doriginal is True,is11dCountry =0 and * fSupplicantCountryCodeHasPriority = 0, then revert the country code, @@ -7777,17 +8478,27 @@ eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, return eHAL_STATUS_FAILURE; } } - pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_FALSE; /* if Supplicant country code has priority, disable 11d */ - if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) + if ((!is11dCountry) && + (pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && + (!pMac->roam.configParam.fEnforceCountryCode)) { pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; smsLog( pMac, LOG1, FL(" 11d is being disabled")); } + pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_FALSE; vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, WNI_CFG_COUNTRY_CODE_LEN); + vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, + WNI_CFG_COUNTRY_CODE_LEN); + + status = csrSetRegulatoryDomain(pMac, reg_domain_id, NULL); + if (status != eHAL_STATUS_SUCCESS) + { + smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); + } status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); if (VOS_FALSE == is11dCountry ) @@ -7887,6 +8598,11 @@ eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericCha } else { + status = csrSetRegulatoryDomain(pMac, REGDOMAIN_WORLD, NULL); + if (status != eHAL_STATUS_SUCCESS) + { + smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); + } status = csrInitGetChannels(pMac); if ( status != eHAL_STATUS_SUCCESS ) { @@ -8010,7 +8726,7 @@ eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFl tCsrRoamSession *pSession = NULL; VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " - "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, + "ulMulticastAddrCnt=%d, multicastAddr[0]=%pK", __func__, pMulticastAddrs->ulMulticastAddrCnt, pMulticastAddrs->multicastAddr[0]); @@ -8056,6 +8772,8 @@ eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFl msg.type = WDA_8023_MULTICAST_LIST_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to " @@ -8109,6 +8827,8 @@ eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "Pkt Flt Req : " "FT %d FID %d ", pRequestBuf->filterType, pRequestBuf->filterId); @@ -8219,6 +8939,8 @@ eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearPara msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; msg.reserved = 0; msg.bodyptr = pRequestBuf; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post " @@ -8412,96 +9134,107 @@ eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) #endif // WLAN_WAKEUP_EVENTS -/* --------------------------------------------------------------------------- - - \fn sme_SetMaxTxPower - - \brief Set the Maximum Transmit Power dynamically. Note: this setting will - not persist over reboots. - - \param hHal - \param pBssid BSSID to set the power cap for - \param pBssid pSelfMacAddress self MAC Address - \param pBssid power to set in dB - \- return eHalStatus - - -------------------------------------------------------------------------------*/ -eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, - tSirMacAddr pSelfMacAddress, v_S7_t dB) +/** + * sme_SetMaxTxPower() - Set the Maximum Transmit Power + * + * @hHal: hal pointer. + * @bssid: bssid to set the power cap for + * @self_mac_addr:self mac address + * @db: power to set in dB + * + * Set the maximum transmit power dynamically. + * + * Return: eHalStatus + * + */ +eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr bssid, + tSirMacAddr self_mac_addr, v_S7_t db) { - vos_msg_t msg; - tpMaxTxPowerParams pMaxTxParams = NULL; - MTRACE(vos_trace(VOS_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); - pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); - if (NULL == pMaxTxParams) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to allocate memory for pMaxTxParams", __func__); - return eHAL_STATUS_FAILURE; - } - - vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); - vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, - SIR_MAC_ADDR_LENGTH); - pMaxTxParams->power = dB; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + eHalStatus status = eHAL_STATUS_SUCCESS; + tSmeCmd *set_max_tx_pwr; - msg.type = WDA_SET_MAX_TX_POWER_REQ; - msg.reserved = 0; - msg.bodyptr = pMaxTxParams; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); + smsLog(pMac, LOG1, + FL("bssid :" MAC_ADDRESS_STR " self addr: "MAC_ADDRESS_STR" power %d Db"), + MAC_ADDR_ARRAY(bssid), MAC_ADDR_ARRAY(self_mac_addr), db); - if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_MAX_TX_POWER_REQ message to WDA", __func__); - vos_mem_free(pMaxTxParams); - return eHAL_STATUS_FAILURE; - } - - return eHAL_STATUS_SUCCESS; + set_max_tx_pwr = csrGetCommandBuffer(pMac); + if (set_max_tx_pwr) + { + set_max_tx_pwr->command = eSmeCommandSetMaxTxPower; + vos_mem_copy(set_max_tx_pwr->u.set_tx_max_pwr.bssid, + bssid, SIR_MAC_ADDR_LENGTH); + vos_mem_copy(set_max_tx_pwr->u.set_tx_max_pwr.self_sta_mac_addr, + self_mac_addr, SIR_MAC_ADDR_LENGTH); + set_max_tx_pwr->u.set_tx_max_pwr.power = db; + status = csrQueueSmeCommand(pMac, set_max_tx_pwr, eANI_BOOLEAN_TRUE); + if ( !HAL_STATUS_SUCCESS( status ) ) + { + smsLog( pMac, LOGE, FL("fail to send msg status = %d"), status ); + csrReleaseCommandScan(pMac, set_max_tx_pwr); + } + } + else + { + smsLog(pMac, LOGE, FL("can not obtain a common buffer")); + status = eHAL_STATUS_RESOURCES; + } + sme_ReleaseGlobalLock( &pMac->sme); + } + return (status); } -/* --------------------------------------------------------------------------- - - \fn sme_SetMaxTxPowerPerBand - - \brief Set the Maximum Transmit Power specific to band dynamically. - Note: this setting will not persist over reboots. - - \param band - \param power to set in dB - \- return eHalStatus - - ----------------------------------------------------------------------------*/ -eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) +/** + * sme_SetMaxTxPowerPerBand() - Set the Maximum Transmit Power + * specific to band dynamically + * @band: Band for which power needs to be applied + * @dB: power to set in dB + * @hal: HAL handle + * + * Set the maximum transmit power dynamically per band + * + * Return: eHalStatus + */ +eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB, + tHalHandle hal) { vos_msg_t msg; - tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; - - pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); - if (NULL == pMaxTxPowerPerBandParams) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", - __func__); - return eHAL_STATUS_FAILURE; - } - - pMaxTxPowerPerBandParams->power = dB; - pMaxTxPowerPerBandParams->bandInfo = band; + eHalStatus status; + tSmeCmd *set_max_tx_pwr_per_band; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); - msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; - msg.reserved = 0; - msg.bodyptr = pMaxTxPowerPerBandParams; + smsLog(mac_ctx, LOG1, + FL("band : %d power %d dB"), + band, dB); - if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", - __func__); - vos_mem_free(pMaxTxPowerPerBandParams); - return eHAL_STATUS_FAILURE; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); + + status = sme_AcquireGlobalLock(&mac_ctx->sme); + if (HAL_STATUS_SUCCESS(status)) { + set_max_tx_pwr_per_band = csrGetCommandBuffer(mac_ctx); + if (set_max_tx_pwr_per_band) { + set_max_tx_pwr_per_band->command = eSmeCommandSetMaxTxPowerPerBand; + set_max_tx_pwr_per_band->u.set_tx_max_pwr_per_band.band = band; + set_max_tx_pwr_per_band->u.set_tx_max_pwr_per_band.power = dB; + status = csrQueueSmeCommand(mac_ctx, set_max_tx_pwr_per_band, + eANI_BOOLEAN_TRUE); + if (!HAL_STATUS_SUCCESS(status)) { + smsLog(mac_ctx, LOGE, FL("fail to send msg status = %d"), status); + csrReleaseCommand(mac_ctx, set_max_tx_pwr_per_band); + } + } else { + smsLog(mac_ctx, LOGE, FL("can not obtain a common buffer")); + status = eHAL_STATUS_RESOURCES; + } + sme_ReleaseGlobalLock(&mac_ctx->sme); } - - return eHAL_STATUS_SUCCESS; + return status; } /* --------------------------------------------------------------------------- @@ -8625,6 +9358,8 @@ eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) /* serialize the req through MC thread */ vosMessage.bodyptr = setTmLevelReq; vosMessage.type = WDA_SET_TM_LEVEL_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { @@ -10002,13 +10737,20 @@ tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, - tANI_U8 sessionId, - tSirMacAddr peerMac, - tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) + tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_LINK_ESTABLISH_PARAM, + sessionId, tdlsLinkEstablishParams->isOffChannelSupported)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) @@ -10039,6 +10781,9 @@ VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_CHAN_SWITCH_REQ, + sessionId, tdlsOffCh)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) @@ -10065,13 +10810,23 @@ VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, \param responder - Tdls request type \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, - tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 statusCode, tANI_U32 peerCapability, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) +VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif + tANI_U8 frame_type, tANI_U8 dialog, + tANI_U16 statusCode, tANI_U32 peerCapability, + tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) { eHalStatus status = eHAL_STATUS_SUCCESS; tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_SEND_MGMT_FRAME, + sessionId, statusCode)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { @@ -10100,7 +10855,12 @@ VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr \param staParams - Peer Station Parameters \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, +VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac, +#else + tSirMacAddr peerMac, +#endif tCsrStaParams *pstaParams) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -10112,10 +10872,14 @@ VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr "%s :pstaParams is NULL",__func__); return eHAL_STATUS_FAILURE; } + + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_CHANGE_PEER_STA, sessionId, + pstaParams->capability)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); + status = csrTdlsChangePeerSta(hHal, sessionId, peerMac, pstaParams); sme_ReleaseGlobalLock( &pMac->sme ); } @@ -10131,11 +10895,20 @@ VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr \param peerMac - peer's Mac Adress. \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif + ) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_ADD_PEER_STA, + sessionId, 0)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { @@ -10154,16 +10927,24 @@ VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr pe \param peerMac - peer's Mac Adress. \- return VOS_STATUS_SUCCES -------------------------------------------------------------------------*/ -VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const tSirMacAddr peerMac +#else + tSirMacAddr peerMac +#endif +) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA, + sessionId, 0)); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; - sme_ReleaseGlobalLock( &pMac->sme ); } @@ -10181,6 +10962,8 @@ void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) tpAniSirGlobal pMac = PMAC_STRUCT(hHal); pMac->isTdlsPowerSaveProhibited = val; + smsLog(pMac, LOG1, FL("isTdlsPowerSaveProhibited is %d"), + pMac->isTdlsPowerSaveProhibited); return; } #endif @@ -10195,123 +10978,159 @@ v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) return (BMPS == pmcGetPmcState(hHal)); } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* - * SME API to start TDLS discovery Procedure - */ -VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) { - VOS_STATUS status = VOS_STATUS_SUCCESS; - tCsrTdlsDisRequest disReq = {{0}} ; - vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; - status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; + eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return status ; + smsLog(pMac, LOG2, FL("enter")); + + if (pMac->fActiveScanOnDFSChannels) + { + smsLog(pMac, LOG1, FL("Skip updating fEnableDFSChnlScan" + " as DFS feature is triggered")); + return (status); + } + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; + sme_ReleaseGlobalLock( &pMac->sme ); + } + smsLog(pMac, LOG2, FL("exit status %d"), status); + return (status); } -/* - * Process TDLS discovery results - */ -v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, - tSmeTdlsDisResult *disResult, v_U8_t listType) +/* --------------------------------------------------------------------------- + \fn sme_UpdateDFSRoamMode + \brief Update DFS roam scan mode + This function is called to configure allowDFSChannelRoam + dynamically + \param hHal - HAL handle for device + \param allowDFSChannelRoam - DFS roaming scan mode + mode 0 disable roam scan on DFS channels + mode 1 enables roam scan (passive/active) on DFS channels + \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config + successfully. + Other status means SME failed to update DFS roaming scan config. + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_UpdateDFSRoamMode(tHalHandle hHal, tANI_U8 allowDFSChannelRoam) { - tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; - tSirTdlsPeerInfo *peerInfo = NULL ; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; - tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; - tListElem *pEntry = NULL ; - v_U8_t peerCnt = 0 ; + eHalStatus status = eHAL_STATUS_SUCCESS; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; - pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); - while(pEntry) + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) { - peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, - tdlsPeerStaLink) ; - peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; - - switch(listType) - { - case TDLS_SETUP_LIST: - { - if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) - { - vos_mem_copy(disResult[peerCnt].tdlsPeerMac, - peerInfo->peerMac, sizeof(tSirMacAddr)); - disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; - peerCnt++ ; - } - break ; - } - case TDLS_DIS_LIST: - { - vos_mem_copy(disResult[peerCnt].tdlsPeerMac, - peerInfo->peerMac, sizeof(tSirMacAddr)); - disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; - peerCnt++ ; - break ; - } - default: - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - ("unknown list type ")) ; - break ; - } - } - - pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "LFR runtime successfully set AllowDFSChannelRoam Mode to " + "%d - old value is %d", + allowDFSChannelRoam, + pMac->roam.configParam.allowDFSChannelRoam); + pMac->roam.configParam.allowDFSChannelRoam = allowDFSChannelRoam; + sme_ReleaseGlobalLock( &pMac->sme ); } +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (csrRoamIsRoamOffloadScanEnabled(pMac)) + { + csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_CHANNEL_LIST_CHANGED); + } +#endif - return peerCnt ; - + return status ; } -/* - * SME API to start TDLS link setup Procedure. - */ -VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) +/* --------------------------------------------------------------------------- + \fn sme_UpdateDFSScanMode + \brief Update DFS scan mode + This function is called to configure fEnableDFSChnlScan. + \param hHal - HAL handle for device + \param dfsScanMode - DFS scan mode + mode 0 disable scan on DFS channels + mode 1 enables passive scan on DFS channels + mode 2 enables active scan on DFS channels for static list + \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config + successfully. + Other status means SME failed to update DFS scan config. + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, tANI_U8 dfsScanMode) { - VOS_STATUS status = VOS_STATUS_SUCCESS; - tCsrTdlsSetupRequest setupReq = {{0}} ; - vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; - status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; - return status ; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; -} + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "DFS scan Mode changed to %d, old value is %d ", + dfsScanMode, + pMac->scan.fEnableDFSChnlScan); + pMac->scan.fEnableDFSChnlScan = dfsScanMode; + sme_ReleaseGlobalLock( &pMac->sme ); + } -/* - * SME API to start TDLS link Teardown Procedure. - */ -VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) -{ - VOS_STATUS status = VOS_STATUS_SUCCESS; - tCsrTdlsTeardownRequest teardownReq = {{0}} ; - vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; - status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; - return status ; + sme_FilterScanDFSResults(hHal); + sme_UpdateChannelList( hHal ); + return status ; } -#endif /* FEATURE_WLAN_TDLS */ +/*-------------------------------------------------------------------------- + \brief sme_GetDFSScanMode() - get DFS scan mode + \param hHal - The handle returned by macOpen. + \return DFS scan mode + mode 0 disable scan on DFS channels + mode 1 enables passive scan on DFS channels + mode 2 enables active scan on DFS channels for static list + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetDFSScanMode(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + return pMac->scan.fEnableDFSChnlScan; +} -eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) +/* --------------------------------------------------------------------------- + \fn sme_HandleDFSChanScan + \brief Gets Valid channel list and updates scan control list according to + dfsScanMode + \param hHal - HAL handle for device + \return eHAL_STATUS_FAILURE when failed to get valid channel list + Otherwise eHAL_STATUS_SUCCESS - + \sa + -------------------------------------------------------------------------*/ +eHalStatus sme_HandleDFSChanScan(tHalHandle hHal) { - eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrChannel ChannelList; - smsLog(pMac, LOG2, FL("enter")); - status = sme_AcquireGlobalLock( &pMac->sme ); - if ( HAL_STATUS_SUCCESS( status ) ) + /* Flag to block driver scan type conversion from active to passive + and vice versa */ + pMac->fActiveScanOnDFSChannels = 1; + + ChannelList.numChannels = sizeof(ChannelList.channelList); + status = sme_GetCfgValidChannels(hHal, (tANI_U8 *)ChannelList.channelList, + (tANI_U32*)&ChannelList.numChannels); + if (!HAL_STATUS_SUCCESS(status)) { - pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; - sme_ReleaseGlobalLock( &pMac->sme ); + smsLog(pMac, LOGE, + FL("Failed to get valid channel list (err=%d)"), status); + return status; } - smsLog(pMac, LOG2, FL("exit status %d"), status); - return (status); + smsLog(pMac, LOG1, FL("Valid Channel list:")); + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + ChannelList.channelList, ChannelList.numChannels); + + sme_SetCfgScanControlList(hHal, pMac->scan.countryCodeCurrent, + &ChannelList); + return status ; } /* @@ -10336,6 +11155,184 @@ void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) return; } +/* + * SME API to stringify bonding mode. (hostapd convention) + */ + +static const char* sme_CBMode2String( tANI_U32 mode) +{ + switch (mode) + { + case eCSR_INI_SINGLE_CHANNEL_CENTERED: + return "HT20"; + case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: + return "HT40-"; /* lower secondary channel */ + case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: + return "HT40+"; /* upper secondary channel */ +#ifdef WLAN_FEATURE_11AC + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: + return "VHT80+40+"; /* upper secondary channels */ + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: + return "VHT80+40-"; /* 1 lower and 2 upper secondary channels */ + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: + return "VHT80-40+"; /* 2 lower and 1 upper secondary channels */ + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: + return "VHT80-40-"; /* lower secondary channels */ +#endif + default: + VOS_ASSERT(0); + return "Unknown"; + } +} + +/* + * SME API to adjust bonding mode to regulatory .. etc. + * + */ +static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, + tSmeConfigParams *smeConfig, + tANI_U8 channel) +{ + const tANI_U8 step = SME_START_CHAN_STEP; + tANI_U8 i, startChan = channel, chanCnt = 0, chanBitmap = 0; + tANI_BOOLEAN violation = VOS_FALSE; + tANI_U32 newMode, mode; + tANI_U8 centerChan = channel; + /* to validate 40MHz channels against the regulatory domain */ + tANI_BOOLEAN ht40PhyMode = VOS_FALSE; + + /* get the bonding mode */ + mode = (channel <= 14) ? smeConfig->csrConfig.channelBondingMode24GHz : + smeConfig->csrConfig.channelBondingMode5GHz; + newMode = mode; + + /* get the channels */ + switch (mode) + { + case eCSR_INI_SINGLE_CHANNEL_CENTERED: + startChan = channel; + chanCnt = 1; + break; + case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: + startChan = channel - step; + chanCnt = 2; + centerChan = channel - CSR_CB_CENTER_CHANNEL_OFFSET; + ht40PhyMode = VOS_TRUE; + break; + case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: + startChan = channel; + chanCnt=2; + centerChan = channel + CSR_CB_CENTER_CHANNEL_OFFSET; + ht40PhyMode = VOS_TRUE; + break; +#ifdef WLAN_FEATURE_11AC + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: + startChan = channel; + chanCnt = 4; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: + startChan = channel - step; + chanCnt = 4; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: + startChan = channel - 2*step; + chanCnt = 4; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: + startChan = channel - 3*step; + chanCnt = 4; + break; +#endif + default: + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + /* find violation; also map valid channels to a bitmap */ + for (i = 0; i < chanCnt; i++) + { + if (csrIsValidChannel(pMac, (startChan + (i * step))) == + eHAL_STATUS_SUCCESS) + chanBitmap = chanBitmap | 1 << i; + else + violation = VOS_TRUE; + } + /* validate if 40MHz channel is allowed */ + if (ht40PhyMode) + { + if (!csrRoamIsValid40MhzChannel(pMac, centerChan)) + violation = VOS_TRUE; + } + + /* no channels are valid */ + if (chanBitmap == 0) + { + /* never be in this case */ + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("channel %d %s is not supported"), + channel, + sme_CBMode2String(mode)); + return VOS_STATUS_E_INVAL; + } + + /* fix violation */ + if (violation) + { + const tANI_U8 lowerMask = 0x03, upperMask = 0x0c; + /* fall back to single channel in all exception cases */ + newMode = eCSR_INI_SINGLE_CHANNEL_CENTERED; + + switch (mode) + { + case eCSR_INI_SINGLE_CHANNEL_CENTERED: + /* fall thru */ + case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: + /* fall thru */ + case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: + break; +#ifdef WLAN_FEATURE_11AC + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: + if ((chanBitmap & lowerMask) == lowerMask) + newMode = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: + if ((chanBitmap & lowerMask) == lowerMask) + newMode = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: + if ((chanBitmap & upperMask) == upperMask) + newMode = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + break; + case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: + if ((chanBitmap & upperMask) == upperMask) + newMode = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + break; +#endif + default: + return VOS_STATUS_E_NOSUPPORT; + break; + } + + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, + FL("bonding mode adjust: %s to %s"), + sme_CBMode2String(mode), + sme_CBMode2String(newMode)); + + } + + /* check for mode change */ + if (newMode != mode) + { + if (channel <= 14) + smeConfig->csrConfig.channelBondingMode24GHz = newMode; + else + smeConfig->csrConfig.channelBondingMode5GHz = newMode; + } + + return VOS_STATUS_SUCCESS; + +} + /* * SME API to determine the channel bonding mode */ @@ -10343,6 +11340,9 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch { tSmeConfigParams smeConfig; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); +#ifdef WLAN_FEATURE_11AC + tANI_U8 vht80Allowed; +#endif if ( #ifdef WLAN_FEATURE_11AC @@ -10361,46 +11361,98 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch return VOS_STATUS_SUCCESS; } + vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); + sme_GetConfigParam(pMac, &smeConfig); + /* If channel bonding mode is not required */ +#ifdef WLAN_FEATURE_AP_HT40_24G + if ( !pMac->roam.configParam.channelBondingMode5GHz + && !smeConfig.csrConfig.apHT40_24GEnabled ) { +#else if ( !pMac->roam.configParam.channelBondingMode5GHz ) { +#endif return VOS_STATUS_SUCCESS; } - vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); - sme_GetConfigParam(pMac, &smeConfig); #ifdef WLAN_FEATURE_11AC if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) { - if ( channel== 36 || channel == 52 || channel == 100 || - channel == 116 || channel == 149 ) - { - smeConfig.csrConfig.channelBondingMode5GHz = - PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1; - } - else if ( channel == 40 || channel == 56 || channel == 104 || - channel == 120 || channel == 153 ) - { - smeConfig.csrConfig.channelBondingMode5GHz = - PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1; - } - else if ( channel == 44 || channel == 60 || channel == 108 || - channel == 124 || channel == 157 ) + /* Check if VHT80 is allowed for the channel*/ + vht80Allowed = vos_is_channel_valid_for_vht80(channel); + + if (vht80Allowed) { - smeConfig.csrConfig.channelBondingMode5GHz = - PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH -1; + if (channel== 36 || channel == 52 || channel == 100 || + channel == 116 || channel == 149) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; + } + else if (channel == 40 || channel == 56 || channel == 104 || + channel == 120 || channel == 153) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; + } + else if (channel == 44 || channel == 60 || channel == 108 || + channel == 124 || channel == 157) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; + } + else if (channel == 48 || channel == 64 || channel == 112 || + channel == 128 || channel == 144 || channel == 161) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; + } + else if (channel == 165) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; + } } - else if ( channel == 48 || channel == 64 || channel == 112 || - channel == 128 || channel == 144 || channel == 161 ) + else /* Set VHT40 */ { - smeConfig.csrConfig.channelBondingMode5GHz = - PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1; + if (channel== 40 || channel == 48 || channel == 56 || + channel == 64 || channel == 104 || channel == 112 || + channel == 120 || channel == 128 || channel == 136 || + channel == 144 || channel == 153 || channel == 161) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + } + else if (channel== 36 || channel == 44 || channel == 52 || + channel == 60 || channel == 100 || channel == 108 || + channel == 116 || channel == 124 || channel == 132 || + channel == 140 || channel == 149 || channel == 157) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + } + else if (channel == 165) + { + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; + } } - else if ( channel == 165 ) + +#ifdef WLAN_FEATURE_AP_HT40_24G + if (smeConfig.csrConfig.apHT40_24GEnabled) { - smeConfig.csrConfig.channelBondingMode5GHz = 0; + if (channel >= 1 && channel <= 7) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + else if (channel >= 8 && channel <= 13) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + else if (channel ==14) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; } +#endif } #endif @@ -10412,19 +11464,37 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch channel == 120 || channel == 128 || channel == 136 || channel == 144 || channel == 153 || channel == 161 ) { - smeConfig.csrConfig.channelBondingMode5GHz = 1; + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; } else if ( channel== 36 || channel == 44 || channel == 52 || channel == 60 || channel == 100 || channel == 108 || channel == 116 || channel == 124 || channel == 132 || channel == 140 || channel == 149 || channel == 157 ) { - smeConfig.csrConfig.channelBondingMode5GHz = 2; + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; } else if ( channel == 165 ) { - smeConfig.csrConfig.channelBondingMode5GHz = 0; + smeConfig.csrConfig.channelBondingMode5GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; + } + +#ifdef WLAN_FEATURE_AP_HT40_24G + if (smeConfig.csrConfig.apHT40_24GEnabled) + { + if (channel >= 1 && channel <= 7) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + else if (channel >= 8 && channel <= 13) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + else if (channel ==14) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; } +#endif } /* @@ -10438,10 +11508,29 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch eCSR_DOT11_MODE_abg == eCsrPhyMode) { smeConfig.csrConfig.channelBondingMode5GHz = 0; +#ifdef WLAN_FEATURE_AP_HT40_24G + } else if ( eCSR_DOT11_MODE_11g_ONLY == eCsrPhyMode) + smeConfig.csrConfig.channelBondingAPMode24GHz = + eCSR_INI_SINGLE_CHANNEL_CENTERED; +#else } +#endif + sme_AdjustCBMode(pMac, &smeConfig, channel); + +#ifdef WLAN_FEATURE_AP_HT40_24G + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("%s cbmode selected=%d bonding mode:%s"), + (channel <= 14) ? "2G" : "5G", + (channel <= 14) ? smeConfig.csrConfig.channelBondingAPMode24GHz : + smeConfig.csrConfig.channelBondingMode5GHz, + (channel <= 14) ? + sme_CBMode2String(smeConfig.csrConfig.channelBondingAPMode24GHz) : + sme_CBMode2String(smeConfig.csrConfig.channelBondingMode5GHz)); +#else VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, - "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); + "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); +#endif sme_UpdateConfig (pMac, &smeConfig); return VOS_STATUS_SUCCESS; @@ -10507,6 +11596,20 @@ VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) return VOS_STATUS_E_FAILURE; } +/* + * SME API to check if any sessoion connected. + */ +VOS_STATUS sme_is_any_session_connected(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + if(csrIsAnySessionConnected(pMac)) + { + + return VOS_STATUS_SUCCESS; + } + return VOS_STATUS_E_FAILURE; +} + #ifdef FEATURE_WLAN_LPHB /* --------------------------------------------------------------------------- @@ -10529,6 +11632,9 @@ eHalStatus sme_LPHBConfigReq tpAniSirGlobal pMac = PMAC_STRUCT(hHal); vos_msg_t vosMessage; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ, + NO_SESSION, lphdReq->cmd)); status = sme_AcquireGlobalLock(&pMac->sme); if (eHAL_STATUS_SUCCESS == status) { @@ -10549,6 +11655,8 @@ eHalStatus sme_LPHBConfigReq /* serialize the req through MC thread */ vosMessage.bodyptr = lphdReq; vosMessage.type = WDA_LPHB_CONF_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -10606,6 +11714,8 @@ eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; msg.bodyptr = addPeriodicTxPtrnParams; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " @@ -10642,6 +11752,8 @@ eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; msg.bodyptr = delPeriodicTxPtrnParams; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " @@ -10752,6 +11864,8 @@ eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateP msg.type = WDA_RATE_UPDATE_IND; msg.bodyptr = rateUpdateParams; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " @@ -10828,6 +11942,51 @@ eHalStatus sme_StopBatchScanInd #endif +void activeListCmdTimeoutHandle(void *userData) +{ + tHalHandle hHal= (tHalHandle) userData; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + tListElem *pEntry; + tSmeCmd *pTempCmd = NULL; + + if (NULL == pMac) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, + "%s: pMac is null", __func__); + return; + } + /* Return if no cmd pending in active list as + * in this case we should not be here. + */ + if ((NULL == userData) || + (0 == csrLLCount(&pMac->sme.smeCmdActiveList))) + return; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Active List command timeout Cmd List Count %d", __func__, + csrLLCount(&pMac->sme.smeCmdActiveList) ); + smeGetCommandQStatus(hHal); + + pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); + if (pEntry) { + pTempCmd = GET_BASE_ADDR(pEntry, tSmeCmd, Link); + } + /* If user initiated scan took more than active list timeout + * abort it. + */ + if (pTempCmd && (eSmeCommandScan == pTempCmd->command) && + (eCsrScanUserRequest == pTempCmd->u.scanCmd.reason)) { + sme_AbortMacScan(hHal, pTempCmd->sessionId, + eCSR_SCAN_ABORT_DEFAULT); + return; + } + + /* Initiate SSR to recover */ + if (!(vos_isLoadUnloadInProgress() || + vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) + { + vos_wlanRestart(); + } +} #ifdef FEATURE_WLAN_CH_AVOID /* --------------------------------------------------------------------------- @@ -10865,16 +12024,6 @@ eHalStatus sme_AddChAvoidCallback } #endif /* FEATURE_WLAN_CH_AVOID */ -void activeListCmdTimeoutHandle(void *userData) -{ - if (NULL == userData) - return; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s: Active List command timeout Cmd List Count %d", __func__, - csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); - smeGetCommandQStatus((tHalHandle) userData); -} - #ifdef WLAN_FEATURE_LINK_LAYER_STATS /* --------------------------------------------------------------------------- @@ -10915,10 +12064,13 @@ eHalStatus sme_LLStatsSetReq(tHalHandle hHal, msg.reserved = 0; msg.bodyptr = plinkLayerSetReq; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "Not able to post SIR_HAL_LL_STATS_SET message to HAL", __func__); + vos_mem_free(plinkLayerSetReq); status = eHAL_STATUS_FAILURE; } sme_ReleaseGlobalLock( &pMac->sme ); @@ -10927,6 +12079,8 @@ eHalStatus sme_LLStatsSetReq(tHalHandle hHal, { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "sme_AcquireGlobalLock error", __func__); + vos_mem_free(plinkLayerSetReq); + status = eHAL_STATUS_FAILURE; } return status; } @@ -10966,10 +12120,13 @@ eHalStatus sme_LLStatsGetReq(tHalHandle hHal, msg.type = WDA_LINK_LAYER_STATS_GET_REQ; msg.reserved = 0; msg.bodyptr = pGetStatsReq; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "Not able to post SIR_HAL_LL_STATS_GET message to HAL", __func__); + vos_mem_free(pGetStatsReq); status = eHAL_STATUS_FAILURE; } sme_ReleaseGlobalLock( &pMac->sme ); @@ -10978,6 +12135,8 @@ eHalStatus sme_LLStatsGetReq(tHalHandle hHal, { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pGetStatsReq); + status = eHAL_STATUS_FAILURE; } return status; } @@ -11021,10 +12180,13 @@ eHalStatus sme_LLStatsClearReq(tHalHandle hHal, msg.reserved = 0; msg.bodyptr = pClearStatsReq; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "Not able to post SIR_HAL_LL_STATS_CLEAR message to HAL", __func__); + vos_mem_free(pClearStatsReq); status = eHAL_STATUS_FAILURE; } sme_ReleaseGlobalLock( &pMac->sme ); @@ -11033,6 +12195,8 @@ eHalStatus sme_LLStatsClearReq(tHalHandle hHal, { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pClearStatsReq); + status = eHAL_STATUS_FAILURE; } return status; @@ -11071,6 +12235,7 @@ eHalStatus sme_SetLinkLayerStatsIndCB } #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ + eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -11092,19 +12257,20 @@ VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - if (!CSR_IS_SESSION_VALID( pMac, sessionId )) + pCsrSession = CSR_GET_SESSION( pMac, sessionId ); + + if (pCsrSession == NULL) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s: Invalid session Id %u", __func__, sessionId); + "%s: CSR Session lookup fails %u", __func__, sessionId); sme_ReleaseGlobalLock( &pMac->sme); return eHAL_STATUS_FAILURE; } - pCsrSession = CSR_GET_SESSION( pMac, sessionId ); - if (pCsrSession == NULL) + if (!CSR_IS_SESSION_VALID( pMac, sessionId )) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s: CSR Session lookup fails %u", __func__, sessionId); + "%s: Invalid session Id %u", __func__, sessionId); sme_ReleaseGlobalLock( &pMac->sme); return eHAL_STATUS_FAILURE; } @@ -11122,7 +12288,7 @@ VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, if ( !pSession->QosMapSet.present ) { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: QOS Mapping IE not present", __func__); sme_ReleaseGlobalLock( &pMac->sme); return eHAL_STATUS_FAILURE; @@ -11132,26 +12298,13 @@ VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, for (i = 0; i < SME_QOS_WMM_UP_MAX; i++) { for (j = pSession->QosMapSet.dscp_range[i][0]; - j <= pSession->QosMapSet.dscp_range[i][1]; j++) - { - if ((pSession->QosMapSet.dscp_range[i][0] == 255) && - (pSession->QosMapSet.dscp_range[i][1] == 255)) - { - dscpmapping[j]= 0; - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s: User Priority %d is not used in mapping", - __func__, i); - break; - } - else - { - dscpmapping[j]= i; - } - } + j <= pSession->QosMapSet.dscp_range[i][1] && + j <= WLAN_MAX_DSCP; j++) + dscpmapping[j]= i; } for (i = 0; i< pSession->QosMapSet.num_dscp_exceptions; i++) { - if (pSession->QosMapSet.dscp_exceptions[i][0] != 255) + if (pSession->QosMapSet.dscp_exceptions[i][0] <= WLAN_MAX_DSCP) { dscpmapping[pSession->QosMapSet.dscp_exceptions[i][0] ] = pSession->QosMapSet.dscp_exceptions[i][1]; @@ -11178,34 +12331,40 @@ tANI_BOOLEAN sme_Is11dCountrycode(tHalHandle hHal) } } -tANI_BOOLEAN sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr) +eHalStatus sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr) { - eHalStatus status = eHAL_STATUS_SUCCESS; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tANI_U16 len; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + eHalStatus status = eHAL_STATUS_SUCCESS; + tSmeCmd *pMacSpoofCmd; - if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) { - tpSirSpoofMacAddrReq pMsg; - - /* Create the message and send to lim */ - len = sizeof(tSirSpoofMacAddrReq); - pMsg = vos_mem_malloc(len); - if ( NULL == pMsg ) - status = eHAL_STATUS_FAILURE; - else - { - vos_mem_set(pMsg, sizeof(tSirSpoofMacAddrReq), 0); - pMsg->messageType = eWNI_SME_MAC_SPOOF_ADDR_IND; - pMsg->length = len; - /* Data starts from here */ - vos_mem_copy(pMsg->macAddr, macaddr->bytes, VOS_MAC_ADDRESS_LEN); - - status = palSendMBMessage(pMac->hHdd, pMsg); - } - sme_ReleaseGlobalLock( &pMac->sme ); - } - return status; + pMacSpoofCmd = csrGetCommandBuffer(pMac); + if (pMacSpoofCmd) + { + pMacSpoofCmd->command = eSmeCommandMacSpoofRequest; + vos_mem_set(&pMacSpoofCmd->u.macAddrSpoofCmd, + sizeof(tSirSpoofMacAddrReq), 0); + vos_mem_copy(pMacSpoofCmd->u.macAddrSpoofCmd.macAddr, + macaddr->bytes, VOS_MAC_ADDRESS_LEN); + + status = csrQueueSmeCommand(pMac, pMacSpoofCmd, eANI_BOOLEAN_TRUE); + if ( !HAL_STATUS_SUCCESS( status ) ) + { + smsLog( pMac, LOGE, FL("fail to send msg status = %d\n"), status ); + csrReleaseCommandScan(pMac, pMacSpoofCmd); + } + } + else + { + //log error + smsLog(pMac, LOGE, FL("can not obtain a common buffer\n")); + status = eHAL_STATUS_RESOURCES; + } + sme_ReleaseGlobalLock( &pMac->sme); + } + return (status); } #ifdef WLAN_FEATURE_EXTSCAN @@ -11360,12 +12519,26 @@ eHalStatus sme_EXTScanGetCapabilities (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pGetEXTScanCapabilitiesReq; vosMessage.type = WDA_EXTSCAN_GET_CAPABILITIES_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "failed to post WDA_EXTSCAN_GET_CAPABILITIES_REQ ", + __func__); + vos_mem_free(pGetEXTScanCapabilitiesReq); status = eHAL_STATUS_FAILURE; + } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pGetEXTScanCapabilitiesReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11404,12 +12577,24 @@ eHalStatus sme_EXTScanStart (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pextScanStartReq; vosMessage.type = WDA_EXTSCAN_START_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed to post WDA_EXTSCAN_START_REQ", __func__); + vos_mem_free(pextScanStartReq); status = eHAL_STATUS_FAILURE; - + } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pextScanStartReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11447,13 +12632,25 @@ eHalStatus sme_EXTScanStop(tHalHandle hHal, tSirEXTScanStopReqParams *pStopReq) /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanStopReq; vosMessage.type = WDA_EXTSCAN_STOP_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed to post WDA_EXTSCAN_STOP_REQ", __func__); + vos_mem_free(pEXTScanStopReq); status = eHAL_STATUS_FAILURE; } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEXTScanStopReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11492,12 +12689,24 @@ eHalStatus sme_SetBssHotlist (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanSetBssidHotlistReq; vosMessage.type = WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed to post WDA_EXTSCAN_STOP_REQ", __func__); + vos_mem_free(pEXTScanSetBssidHotlistReq); status = eHAL_STATUS_FAILURE; - + } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEXTScanSetBssidHotlistReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11537,12 +12746,25 @@ eHalStatus sme_ResetBssHotlist (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanHotlistResetReq; vosMessage.type = WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed to post WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ", + __func__); + vos_mem_free(pEXTScanHotlistResetReq); status = eHAL_STATUS_FAILURE; - + } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEXTScanHotlistResetReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11582,12 +12804,22 @@ eHalStatus sme_SetSignificantChange (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanSetSignificantReq; vosMessage.type = WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + vos_mem_free(pEXTScanSetSignificantReq); status = eHAL_STATUS_FAILURE; + } sme_ReleaseGlobalLock(&pMac->sme); + } else { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEXTScanSetSignificantReq); + status = eHAL_STATUS_FAILURE; } + return(status); } @@ -11626,11 +12858,20 @@ eHalStatus sme_ResetSignificantChange (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanResetSignificantReq; vosMessage.type = WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + vos_mem_free(pEXTScanResetSignificantReq); status = eHAL_STATUS_FAILURE; + } sme_ReleaseGlobalLock(&pMac->sme); + } else { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEXTScanResetSignificantReq); + status = eHAL_STATUS_FAILURE; } return(status); } @@ -11671,12 +12912,25 @@ eHalStatus sme_getCachedResults (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEXTScanCachedResultsReq; vosMessage.type = WDA_EXTSCAN_GET_CACHED_RESULTS_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed tp post WDA_EXTSCAN_GET_CACHED_RESULTS_REQ", + __func__); + vos_mem_free(pEXTScanCachedResultsReq); status = eHAL_STATUS_FAILURE; - + } sme_ReleaseGlobalLock(&pMac->sme); } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Failed to acquire SME Global Lock")); + vos_mem_free(pEXTScanCachedResultsReq); + status = eHAL_STATUS_FAILURE; + } return(status); } @@ -11732,6 +12986,9 @@ void sme_disable_dfs_channel(tHalHandle hHal, bool disbale_dfs) pMac->scan.fEnableDFSChnlScan = !disbale_dfs; csrDisableDfsChannel(pMac); + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: Modified fEnableDFSChnlScan: %d", __func__, + pMac->scan.fEnableDFSChnlScan); } /* --------------------------------------------------------------------------- @@ -11771,15 +13028,135 @@ eHalStatus sme_Encryptmsgsend (tHalHandle hHal, /* Serialize the req through MC thread */ vosMessage.bodyptr = pEncryptMsg; vosMessage.type = SIR_HAL_ENCRYPT_MSG_REQ; + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: failed to post SIR_HAL_ENCRYPT_MSG_REQ", __func__); + vos_mem_free(pEncryptMsg); status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&pMac->sme); + } + else + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " + "sme_AcquireGlobalLock error", __func__); + vos_mem_free(pEncryptMsg); + status = eHAL_STATUS_FAILURE; + } + return(status); +} + +/* --------------------------------------------------------------------------- + \fn sme_RegisterBtCoexTDLSCallback + \brief Used to plug in callback function + Which notify btcoex on or off. + Notification come from FW. + \param hHal + \param pCallbackfn : callback function pointer should be plugged in + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_RegisterBtCoexTDLSCallback +( + tHalHandle hHal, + void (*pCallbackfn)(void *pAdapter, int ) +) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: Plug in BtCoex TDLS CB", __func__); + + status = sme_AcquireGlobalLock(&pMac->sme); + if (eHAL_STATUS_SUCCESS == status) + { + if (NULL != pCallbackfn) + { + pMac->sme.pBtCoexTDLSNotification = pCallbackfn; + } sme_ReleaseGlobalLock(&pMac->sme); } return(status); } +/* --------------------------------------------------------------------------- + \fn smeNeighborMiddleOfRoaming + + \brief This function is a wrapper to call csrNeighborMiddleOfRoaming + + \param hHal - The handle returned by macOpen. + + \return eANI_BOOLEAN_TRUE if reassoc in progress, + eANI_BOOLEAN_FALSE otherwise +---------------------------------------------------------------------------*/ + +tANI_BOOLEAN smeNeighborMiddleOfRoaming(tHalHandle hHal) +{ + return (csrNeighborMiddleOfRoaming(PMAC_STRUCT(hHal))); +} + +/* --------------------------------------------------------------------------- + + \fn sme_IsTdlsOffChannelValid + + \brief To check if the channel is valid for currently established domain + This is a synchronous API. + + \param hHal - The handle returned by macOpen. + \param channel - channel to verify + + \return TRUE/FALSE, TRUE if channel is valid + + -------------------------------------------------------------------------------*/ +tANI_BOOLEAN sme_IsTdlsOffChannelValid(tHalHandle hHal, tANI_U8 channel) +{ + eHalStatus status = eHAL_STATUS_FAILURE; + tANI_BOOLEAN valid = FALSE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + /* check whether off channel is valid and non DFS */ + if (csrRoamIsChannelValid(pMac, channel)) + { + if (!CSR_IS_CHANNEL_DFS(channel)) + valid = TRUE; + else { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: configured channel is DFS", __func__); + } + } + else { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: configured channel is not valid", __func__); + } + sme_ReleaseGlobalLock( &pMac->sme ); + } + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: current country code %c%c channel %d valid %d", + __func__, pMac->scan.countryCodeCurrent[0], + pMac->scan.countryCodeCurrent[1], channel, valid); + return (valid); +} + +tANI_BOOLEAN sme_IsCoexScoIndicationSet(tHalHandle hHal) +{ + eHalStatus status = eHAL_STATUS_FAILURE; + tANI_BOOLEAN valid = FALSE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + valid = pMac->isCoexScoIndSet; + } + sme_ReleaseGlobalLock( &pMac->sme ); + return (valid); +} eHalStatus sme_SetMiracastVendorConfig(tHalHandle hHal, tANI_U32 iniNumBuffAdvert , tANI_U32 set_value) { @@ -11855,3 +13232,227 @@ eHalStatus sme_SetMiracastVendorConfig(tHalHandle hHal, return eHAL_STATUS_SUCCESS; } +void sme_SetDefDot11Mode(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + csrSetDefaultDot11Mode(pMac); +} + +/* --------------------------------------------------------------------------- + \fn sme_SetTdls2040BSSCoexistence + \brief API to enable or disable 20_40 BSS Coexistence IE in TDLS frames. + + \param isEnabled - Enable or Disable. + \- return VOS_STATUS_SUCCES + -------------------------------------------------------------------------*/ +eHalStatus sme_SetTdls2040BSSCoexistence(tHalHandle hHal, + tANI_S32 isTdls2040BSSCoexEnabled) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t msg; + tAniSetTdls2040BSSCoex *pMsg; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if (HAL_STATUS_SUCCESS( status )) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: is2040BSSCoexEnabled %d ", + __func__, isTdls2040BSSCoexEnabled); + pMsg = vos_mem_malloc(sizeof(tAniSetTdls2040BSSCoex)); + if (NULL == pMsg ) + { + smsLog(pMac, LOGE, "failed to allocate mem for SetTdls2040BSSCoex"); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + + pMsg->msgType = pal_cpu_to_be16( + (tANI_U16)eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ); + pMsg->msgLen = (tANI_U16)sizeof(tAniSetTdls2040BSSCoex); + pMsg->SetTdls2040BSSCoex = isTdls2040BSSCoexEnabled; + + msg.type = eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ; + msg.reserved = 0; + msg.bodyptr = pMsg; + msg.bodyval = 0; + + if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_PE, &msg)) + { + smsLog(pMac, LOGE, + "sme_SetTdls2040BSSCoexistence failed to post msg to PE "); + vos_mem_free((void *)pMsg); + status = eHAL_STATUS_FAILURE; + } + smsLog(pMac, LOG1, FL(" returned")); + sme_ReleaseGlobalLock( &pMac->sme ); + } + return status; +} + +/* --------------------------------------------------------------------------- + \fn sme_SetRtsCtsHtVht + \brief API to to enable/disable RTS/CTS for different modes. + + \param set_value - Bit mask value to enable RTS/CTS for different modes. + \- return VOS_STATUS_SUCCES if INdication is posted to + WDA else return eHAL_STATUS_FAILURE + -------------------------------------------------------------------------*/ +eHalStatus sme_SetRtsCtsHtVht(tHalHandle hHal, tANI_U32 set_value) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t msg; + + smsLog(pMac, LOG1, FL(" set_value = %d"), set_value); + + if (ccmCfgSetInt(hHal, WNI_CFG_ENABLE_RTSCTS_HTVHT, set_value, + NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) + { + smsLog(pMac, LOGE, + FL("Failure: Could not set WNI_CFG_ENABLE_RTSCTS_HTVHT")); + return eHAL_STATUS_FAILURE; + } + if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) + { + vos_mem_zero(&msg, sizeof(vos_msg_t)); + msg.type = WDA_SET_RTS_CTS_HTVHT; + msg.reserved = 0; + msg.bodyval = set_value; + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_WDA, &msg)) + { + smsLog(pMac, LOGE, + FL("Not able to post WDA_SET_RTS_CTS_HTVHT message to HAL")); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_SUCCESS; + } + return eHAL_STATUS_FAILURE; + +} + + +/* --------------------------------------------------------------------------- + \fn sme_fatal_event_logs_req + \brief API to to send flush log command to FW.. + + \param hHal - Mac Context Handle + \- return VOS_STATUS_SUCCES if command is posted to + WDA else return eHAL_STATUS_FAILURE + -------------------------------------------------------------------------*/ +eHalStatus sme_fatal_event_logs_req(tHalHandle hHal, tANI_U32 is_fatal, + tANI_U32 indicator, tANI_U32 reason_code) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpSirFatalEventLogsReqParam pFatalEventLogsReqParams; + + if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) + { + pFatalEventLogsReqParams = vos_mem_malloc(sizeof(tSirFatalEventLogsReqParam)); + if(NULL == pFatalEventLogsReqParams) + { + smsLog(pMac, LOGE, + FL("vos_mem_alloc failed ")); + return eHAL_STATUS_FAILED_ALLOC; + } + vos_mem_set(pFatalEventLogsReqParams, sizeof(pFatalEventLogsReqParams), 0); + pFatalEventLogsReqParams->reason_code = reason_code; + + vos_mem_zero(&msg, sizeof(vos_msg_t)); + msg.type = WDA_FATAL_EVENT_LOGS_REQ; + msg.reserved = 0; + msg.bodyptr = pFatalEventLogsReqParams; + msg.bodyval = 0; + vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg); + if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) + { + vos_mem_free(pFatalEventLogsReqParams); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock( &pMac->sme ); + return status; + + } + return eHAL_STATUS_FAILURE; +} + + +/** + * sme_handleSetFccChannel() - handle fcc constraint request + * @hal: HAL pointer + * @fcc_constraint: whether to apply or remove fcc constraint + * + * Return: tANI_BOOLEAN. + */ +tANI_BOOLEAN sme_handleSetFccChannel(tHalHandle hHal, tANI_U8 fcc_constraint) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + + status = sme_AcquireGlobalLock(&pMac->sme); + + if (eHAL_STATUS_SUCCESS == status && + (!sme_Is11dSupported(hHal)) ) + { + pMac->scan.fcc_constraint = !fcc_constraint; + /* update the channel list to the firmware */ + csrUpdateFCCChannelList(pMac); + + } + + sme_ReleaseGlobalLock(&pMac->sme); + + return status; +} + +eHalStatus sme_enableDisableChanAvoidIndEvent(tHalHandle hHal, tANI_U8 set_value) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vosStatus; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t msg; + + smsLog(pMac, LOG1, FL("set_value: %d"), set_value); + if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) + { + vos_mem_zero(&msg, sizeof(vos_msg_t)); + msg.type = WDA_SEND_FREQ_RANGE_CONTROL_IND; + msg.reserved = 0; + msg.bodyval = set_value; + vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg); + if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) + { + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock( &pMac->sme ); + return status; + } + + return eHAL_STATUS_FAILURE; +} + +eHalStatus sme_DeleteAllTDLSPeers(tHalHandle hHal, uint8_t sessionId) +{ + tSirDelAllTdlsPeers *pMsg; + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); + + pMsg = vos_mem_malloc(sizeof(tSirDelAllTdlsPeers)); + if (NULL == pMsg) + { + smsLog(pMac, LOGE, FL("memory alloc failed")); + return eHAL_STATUS_FAILURE; + } + vos_mem_set(pMsg, sizeof( tSirDelAllTdlsPeers ), 0); + pMsg->mesgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DEL_ALL_TDLS_PEERS); + pMsg->mesgLen = pal_cpu_to_be16((tANI_U16)sizeof( tSirDelAllTdlsPeers )); + vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, + sizeof(tSirMacAddr)); + status = palSendMBMessage( pMac->hHdd, pMsg ); + return status; +} diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_FTApi.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_FTApi.c index 95bcd5078821..581399612a1e 100644 --- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_FTApi.c +++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_FTApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -30,9 +30,6 @@ \brief Definitions for SME FT APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -42,10 +39,7 @@ #include #include #include - -#ifdef DEBUG_ROAM_DELAY #include "vos_utils.h" -#endif /*-------------------------------------------------------------------------- Initialize the FT context. @@ -65,9 +59,7 @@ void sme_FTOpen(tHalHandle hHal) smsLog(pMac, LOGE, FL("Preauth Reassoc interval Timer allocation failed")); return; } -#ifdef DEBUG_ROAM_DELAY vos_reset_roam_timer_log(); -#endif } /*-------------------------------------------------------------------------- @@ -124,6 +116,9 @@ void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, { case eFT_START_READY: case eFT_AUTH_REQ_READY: +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + smsLog( pMac, LOG1, FL("ft_ies_length: %d"), ft_ies_length); +#endif if ((pMac->ft.ftSmeContext.auth_ft_ies) && (pMac->ft.ftSmeContext.auth_ft_ies_length)) { @@ -131,7 +126,7 @@ void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); pMac->ft.ftSmeContext.auth_ft_ies_length = 0; } - + ft_ies_length = VOS_MIN(ft_ies_length, MAX_FTIE_SIZE); // Save the FT IEs pMac->ft.ftSmeContext.auth_ft_ies = vos_mem_malloc(ft_ies_length); if ( NULL == pMac->ft.ftSmeContext.auth_ft_ies ) @@ -146,9 +141,6 @@ void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, ft_ies,ft_ies_length); pMac->ft.ftSmeContext.FTState = eFT_AUTH_REQ_READY; -#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "ft_ies_length=%d", ft_ies_length); -#endif break; case eFT_AUTH_COMPLETE: @@ -174,7 +166,7 @@ void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, // At this juncture we are ready to start sending Re-Assoc Req. #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, "New Reassoc Req=%p in state %d", + smsLog( pMac, LOGE, "New Reassoc Req=%pK in state %d", ft_ies, pMac->ft.ftSmeContext.FTState); #endif if ((pMac->ft.ftSmeContext.reassoc_ft_ies) && @@ -224,18 +216,11 @@ eHalStatus sme_FTSendUpdateKeyInd(tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo) tAniEdType edType; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - int i = 0; - smsLog(pMac, LOG1, FL("keyLength %d"), pFTKeyInfo->keyLength); - - for (i=0; ikeyLength; i++) - smsLog(pMac, LOG1, FL("%02x"), pFTKeyInfo->Key[i]); #endif - msgLen = sizeof( tANI_U16) + sizeof( tANI_U16 ) + - sizeof( pMsg->keyMaterial.length ) + sizeof( pMsg->keyMaterial.edType ) + - sizeof( pMsg->keyMaterial.numKeys ) + sizeof( pMsg->keyMaterial.key ); - + msgLen = sizeof(tSirFTUpdateKeyInfo); + pMsg = vos_mem_malloc(msgLen); if ( NULL == pMsg ) { @@ -272,23 +257,7 @@ eHalStatus sme_FTSendUpdateKeyInd(tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo) keymaterial->key[ 0 ].keyLength = pFTKeyInfo->keyLength; if ( pFTKeyInfo->keyLength && pFTKeyInfo->Key ) - { vos_mem_copy(&keymaterial->key[ 0 ].key, pFTKeyInfo->Key, pFTKeyInfo->keyLength); - if(pFTKeyInfo->keyLength == 16) - { - smsLog(pMac, LOG1, "SME Set Update Ind keyIdx (%d) encType(%d) key = " - "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X", - pMsg->keyMaterial.key[0].keyId, (tAniEdType)pMsg->keyMaterial.edType, - pMsg->keyMaterial.key[0].key[0], pMsg->keyMaterial.key[0].key[1], - pMsg->keyMaterial.key[0].key[2], pMsg->keyMaterial.key[0].key[3], - pMsg->keyMaterial.key[0].key[4], pMsg->keyMaterial.key[0].key[5], - pMsg->keyMaterial.key[0].key[6], pMsg->keyMaterial.key[0].key[7], - pMsg->keyMaterial.key[0].key[8], pMsg->keyMaterial.key[0].key[9], - pMsg->keyMaterial.key[0].key[10], pMsg->keyMaterial.key[0].key[11], - pMsg->keyMaterial.key[0].key[12], pMsg->keyMaterial.key[0].key[13], - pMsg->keyMaterial.key[0].key[14], pMsg->keyMaterial.key[0].key[15]); - } - } vos_mem_copy( &pMsg->bssId[ 0 ], &pFTKeyInfo->peerMac[ 0 ], @@ -341,11 +310,12 @@ eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ) switch(pMac->ft.ftSmeContext.FTState) { case eFT_SET_KEY_WAIT: -#ifdef DEBUG_ROAM_DELAY - //store the PTK send event - vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); -#endif - if (sme_GetFTPreAuthState (hHal) == TRUE) + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + //store the PTK send event + vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); + } + if (sme_GetFTPreAuthState (hHal) == TRUE) { status = sme_FTSendUpdateKeyInd(pMac, pFTKeyInfo); if (status != 0 ) @@ -369,10 +339,10 @@ eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ) pMac->ft.ftSmeContext.FTState, status); #endif break; - + default: - smsLog( pMac, LOGE, "%s: Unhandled state=%d", __func__, - pMac->ft.ftSmeContext.FTState); + smsLog(pMac, LOG1, FL("Unhandled state=%d"), + pMac->ft.ftSmeContext.FTState); status = eHAL_STATUS_FAILURE; break; } @@ -482,9 +452,10 @@ void sme_PreauthReassocIntvlTimerCallback(void *context) tpAniSirGlobal pMac = (tpAniSirGlobal )context; csrNeighborRoamRequestHandoff(pMac); #endif -#ifdef DEBUG_ROAM_DELAY - vos_record_roam_event(e_SME_PREAUTH_CALLBACK_HIT, NULL, 0); -#endif + if (pMac->roam.configParam.roamDelayStatsEnabled) + { + vos_record_roam_event(e_SME_PREAUTH_CALLBACK_HIT, NULL, 0); + } return; } @@ -502,7 +473,7 @@ void sme_FTReset(tHalHandle hHal) if (pMac->ft.ftSmeContext.auth_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL(" Freeing FT Auth IE %p and setting to NULL"), + smsLog( pMac, LOGE, FL(" Freeing FT Auth IE %pK and setting to NULL"), pMac->ft.ftSmeContext.auth_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); @@ -513,7 +484,7 @@ void sme_FTReset(tHalHandle hHal) if (pMac->ft.ftSmeContext.reassoc_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL(" Freeing FT Reassoc IE %p and setting to NULL"), + smsLog( pMac, LOGE, FL(" Freeing FT Reassoc IE %pK and setting to NULL"), pMac->ft.ftSmeContext.auth_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); @@ -524,7 +495,7 @@ void sme_FTReset(tHalHandle hHal) if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL("Freeing FtPreAuthRsp %p and setting to NULL"), + smsLog( pMac, LOGE, FL("Freeing FtPreAuthRsp %pK and setting to NULL"), pMac->ft.ftSmeContext.psavedFTPreAuthRsp); #endif vos_mem_free(pMac->ft.ftSmeContext.psavedFTPreAuthRsp); diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Trace.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Trace.c index e32902b60c25..e36cf89948f0 100644 --- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Trace.c +++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -70,6 +70,7 @@ static tANI_U8* smeTraceGetRxMsgString( tANI_U32 code ) CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_ROAM_DEL_PMKIDCACHE); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE); @@ -133,7 +134,27 @@ static tANI_U8* smeTraceGetRxMsgString( tANI_U32 code ) CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_UPDATE_WESMODE); CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_SET_SCANCTRL); - + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_MSG_DEAUTH_STA); +#ifdef FEATURE_WLAN_TDLS + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_LINK_ESTABLISH_PARAM); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_CHAN_SWITCH_REQ); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_SEND_MGMT_FRAME); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_CHANGE_PEER_STA); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_ADD_PEER_STA); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA); +#endif + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_PREF_NET_LIST); +#ifdef FEATURE_WLAN_LPHB + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ); +#endif /* FEATURE_WLAN_LPHB */ + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CAPABILITIES); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_START); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_STOP); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_BSS_HOTLIST); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_BSS_HOTLIST); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SIGNF_CHANGE); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SIGNF_CHANGE); + CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS); default: return( "UNKNOWN" ); break; @@ -153,6 +174,17 @@ static tANI_U8* smeTraceGetCommandString( tANI_U32 command ) CASE_RETURN_STRING(eSmeCommandRemoveKey); CASE_RETURN_STRING(eSmeCommandAddStaSession); CASE_RETURN_STRING(eSmeCommandDelStaSession); + CASE_RETURN_STRING(eSmeCommandPnoReq); + CASE_RETURN_STRING(eSmeCommandMacSpoofRequest); + CASE_RETURN_STRING(eSmeCommandGetFrameLogRequest); +#ifdef FEATURE_WLAN_TDLS + CASE_RETURN_STRING(eSmeCommandTdlsSendMgmt); + CASE_RETURN_STRING(eSmeCommandTdlsAddPeer); + CASE_RETURN_STRING(eSmeCommandTdlsDelPeer); + CASE_RETURN_STRING(eSmeCommandTdlsLinkEstablish); + CASE_RETURN_STRING(eSmeCommandTdlsChannelSwitch); +#endif + CASE_RETURN_STRING(eSmeCommandNanReq); CASE_RETURN_STRING(eSmePmcCommandMask); CASE_RETURN_STRING(eSmeCommandEnterImps); CASE_RETURN_STRING(eSmeCommandExitImps); @@ -179,17 +211,29 @@ static tANI_U8* smeTraceGetCommandString( tANI_U32 command ) static void smeTraceDump(tpAniSirGlobal pMac, tpvosTraceRecord pRecord, tANI_U16 recIndex) { - if (TRACE_CODE_SME_COMMAND == pRecord->code) - { - smsLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x)", recIndex, - pRecord->time, pRecord->session, "SME COMMAND:", - smeTraceGetCommandString(pRecord->data), pRecord->data ); - } - else - { - smsLog(pMac, LOGE, "%04d %012u S%d %-14s %-30s(0x%x)", recIndex, - pRecord->time, pRecord->session, "RX HDD MSG:", - smeTraceGetRxMsgString(pRecord->code), pRecord->data ); + switch (pRecord->code) { + case TRACE_CODE_SME_COMMAND: + smsLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "SME COMMAND:", + smeTraceGetCommandString(pRecord->data), pRecord->data); + break; + case TRACE_CODE_SME_TX_WDA_MSG: + smsLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "TX WDA Msg:", + macTraceGetWdaMsgString((tANI_U16)pRecord->data), + pRecord->data); + break; + case TRACE_CODE_SME_RX_WDA_MSG: + smsLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "RX WDA Msg:", + macTraceGetSmeMsgString((tANI_U16)pRecord->data), + pRecord->data); + break; + default: + smsLog(pMac, LOG1, "%04d %012u S%d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, "RX HDD MSG:", + smeTraceGetRxMsgString(pRecord->code), pRecord->data); + break; } } diff --git a/drivers/staging/prima/CORE/SVC/external/wlan_nlink_common.h b/drivers/staging/prima/CORE/SVC/external/wlan_nlink_common.h index 9b0cd4c0e0ba..4bd56986c129 100644 --- a/drivers/staging/prima/CORE/SVC/external/wlan_nlink_common.h +++ b/drivers/staging/prima/CORE/SVC/external/wlan_nlink_common.h @@ -32,9 +32,6 @@ message types and definitions that is shared between the user space service (e.g. BTC service) and WLAN kernel module. - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -42,7 +39,7 @@ #define WLAN_NLINK_COMMON_H__ #include - +#include /*--------------------------------------------------------------------------- * External Functions *-------------------------------------------------------------------------*/ @@ -88,6 +85,8 @@ // Special Message Type used by SoftAP, intercepted by send_btc_nlink_msg() and // replaced by WLAN_STA_ASSOC_DONE_IND #define WLAN_BTC_SOFTAP_BSS_START 0x11 +#define WLAN_MSG_RPS_ENABLE_IND 0x10A +#define WLAN_SVC_IFACE_NUM_QUEUES 6 #define WLAN_SVC_SAP_RESTART_IND 0x108 // Event data for WLAN_BTC_QUERY_STATE_RSP & WLAN_STA_ASSOC_DONE_IND @@ -102,14 +101,20 @@ typedef enum eAniNlModuleTypes { ANI_NL_MSG_PUMAC = ANI_NL_MSG_BASE + 0x01,// PTT Socket App ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07,// Quarky GUI WLAN_NL_MSG_BTC, + WLAN_NL_MSG_SVC = ANI_NL_MSG_BASE + 0x0A, ANI_NL_MSG_LOG = ANI_NL_MSG_BASE + 0x0C, - WLAN_NL_MSG_SVC, ANI_NL_MSG_MAX } tAniNlModTypes, tWlanNlModTypes; #define WLAN_NL_MSG_BASE ANI_NL_MSG_BASE #define WLAN_NL_MSG_MAX ANI_NL_MSG_MAX +struct wlan_rps_data { + char ifname[IFNAMSIZ]; + uint16_t num_queues; + uint16_t cpu_map[WLAN_SVC_IFACE_NUM_QUEUES]; +}; + //All Netlink messages must contain this header typedef struct sAniHdr { unsigned short type; diff --git a/drivers/staging/prima/CORE/SVC/inc/wlan_logging_sock_svc.h b/drivers/staging/prima/CORE/SVC/inc/wlan_logging_sock_svc.h index 602df23aac3e..52d1959e0b59 100644 --- a/drivers/staging/prima/CORE/SVC/inc/wlan_logging_sock_svc.h +++ b/drivers/staging/prima/CORE/SVC/inc/wlan_logging_sock_svc.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 The Linux Foundation. All rights reserved. +* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,10 +39,29 @@ #include #include + int wlan_logging_sock_init_svc(void); int wlan_logging_sock_deinit_svc(void); int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf); +int wlan_logging_flush_pkt_queue(void); int wlan_logging_sock_deactivate_svc(void); int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length); +int wlan_queue_logpkt_for_app(vos_pkt_t *pPacket, uint32 pkt_type); +void wlan_process_done_indication(uint8 type, uint32 reason_code); + +void wlan_init_log_completion(void); +int wlan_set_log_completion(uint32 is_fatal, + uint32 indicator, + uint32 reason_code); +void wlan_get_log_completion(uint32 *is_fatal, + uint32 *indicator, + uint32 *reason_code); +bool wlan_is_log_report_in_progress(void); +void wlan_reset_log_report_in_progress(void); + +void wlan_deinit_log_completion(void); + +void wlan_logging_set_log_level(void); +bool wlan_is_logger_thread(int threadId); #endif /* WLAN_LOGGING_SOCK_SVC_H */ diff --git a/drivers/staging/prima/CORE/SVC/inc/wlan_nlink_srv.h b/drivers/staging/prima/CORE/SVC/inc/wlan_nlink_srv.h index ac61efff0133..369332d12075 100644 --- a/drivers/staging/prima/CORE/SVC/inc/wlan_nlink_srv.h +++ b/drivers/staging/prima/CORE/SVC/inc/wlan_nlink_srv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -62,4 +62,5 @@ int nl_srv_bcast(struct sk_buff * skb); void nl_srv_nl_ready_indication(void); void nl_srv_nl_close_indication(int pid); #endif /* WLAN_KD_READY_NOTIFIER */ +int nl_srv_is_initialized(void); #endif diff --git a/drivers/staging/prima/CORE/SVC/inc/wlan_ptt_sock_svc.h b/drivers/staging/prima/CORE/SVC/inc/wlan_ptt_sock_svc.h index 3b6c0b0ab0e1..f5eddb5fd562 100644 --- a/drivers/staging/prima/CORE/SVC/inc/wlan_ptt_sock_svc.h +++ b/drivers/staging/prima/CORE/SVC/inc/wlan_ptt_sock_svc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -64,6 +64,8 @@ #define ANI_MAX_RADIOS 3 #define ANI_NL_MSG_OK 0 #define ANI_NL_MSG_ERROR -1 +#define INVALID_PID -1 + #define ANI_NL_MSG_OVERHEAD (NLMSG_SPACE(tAniHdr + 4)) /* * Packet Format for READ_REGISTER & WRITE_REGISTER: @@ -99,6 +101,12 @@ typedef struct sAniNlMsg { int radio; // unit number of the radio tAniHdr wmsg; // Airgo Message Header } tAniNlHdr; +typedef struct sAniNlMgmtLogMsg { + struct nlmsghdr nlh; + int radio; + tAniHdr wmsg; + uint32 frameSize; +} tAniNlLogHdr; typedef struct sAniAppRegReq { tAniNlModTypes type; // module id int pid; // process id diff --git a/drivers/staging/prima/CORE/SVC/src/btc/wlan_btc_svc.c b/drivers/staging/prima/CORE/SVC/src/btc/wlan_btc_svc.c index bc38829c6605..c9ac339209ee 100644 --- a/drivers/staging/prima/CORE/SVC/src/btc/wlan_btc_svc.c +++ b/drivers/staging/prima/CORE/SVC/src/btc/wlan_btc_svc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -56,12 +56,14 @@ void send_btc_nlink_msg (int type, int dest_pid) struct nlmsghdr *nlh; tAniMsgHdr *aniHdr; tWlanAssocData *assocData; - skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), GFP_KERNEL); + uint32_t skb_size = NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD); + skb = alloc_skb(skb_size, GFP_KERNEL); if(skb == NULL) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "BTC: alloc_skb failed\n"); return; } + vos_mem_zero(skb->data, skb_size); nlh = (struct nlmsghdr *)skb->data; nlh->nlmsg_pid = 0; /* from kernel */ nlh->nlmsg_flags = 0; diff --git a/drivers/staging/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/drivers/staging/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c index 7a0b6787e85a..0447b8760b36 100644 --- a/drivers/staging/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/drivers/staging/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 The Linux Foundation. All rights reserved. +* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -30,6 +30,7 @@ * ******************************************************************************/ #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE +#include #include #include #include @@ -39,18 +40,39 @@ #include #include #include "vos_memory.h" +#include +#include +#include #define LOGGING_TRACE(level, args...) \ - VOS_TRACE(VOS_MODULE_ID_HDD, level, ## args) + VOS_TRACE(VOS_MODULE_ID_SVC, level, ## args) /* Global variables */ #define ANI_NL_MSG_LOG_TYPE 89 #define ANI_NL_MSG_READY_IND_TYPE 90 +#define ANI_NL_MSG_LOG_PKT_TYPE 91 +#define ANI_NL_MSG_FW_LOG_PKT_TYPE 92 #define INVALID_PID -1 #define MAX_LOGMSG_LENGTH 4096 -#define SECONDS_IN_A_DAY (86400) +#define LOGGER_MGMT_DATA_PKT_POST 0x001 +#define HOST_LOG_POST 0x002 +#define LOGGER_FW_LOG_PKT_POST 0x003 +#define LOGGER_FATAL_EVENT_POST 0x004 + +#define LOGGER_MAX_DATA_MGMT_PKT_Q_LEN (8) +#define LOGGER_MAX_FW_LOG_PKT_Q_LEN (16) + +#define NL_BDCAST_RATELIMIT_INTERVAL (5*HZ) +#define NL_BDCAST_RATELIMIT_BURST 1 + +/* Qtimer Frequency */ +#define QTIMER_FREQ 19200000 + +static DEFINE_RATELIMIT_STATE(errCnt, \ + NL_BDCAST_RATELIMIT_INTERVAL, \ + NL_BDCAST_RATELIMIT_BURST); struct log_msg { struct list_head node; @@ -65,6 +87,14 @@ struct log_msg { char logbuf[MAX_LOGMSG_LENGTH]; }; +struct logger_log_complete { + uint32_t is_fatal; + uint32_t indicator; + uint32_t reason_code; + bool is_report_in_progress; + bool is_flush_complete; +}; + struct wlan_logging { /* Log Fatal and ERROR to console */ bool log_fe_to_console; @@ -76,6 +106,18 @@ struct wlan_logging { struct list_head free_list; /* Holds the filled nodes which needs to be indicated to APP */ struct list_head filled_list; + /* Points to head of logger pkt queue */ + vos_pkt_t *data_mgmt_pkt_queue; + /* Holds number of pkts in vos pkt queue */ + unsigned int data_mgmt_pkt_qcnt; + /* Lock to synchronize of queue/dequeue of pkts in logger pkt queue */ + spinlock_t data_mgmt_pkt_lock; + /* Points to head of logger fw log pkt queue */ + vos_pkt_t *fw_log_pkt_queue; + /* Holds number of pkts in fw log vos pkt queue */ + unsigned int fw_log_pkt_qcnt; + /* Lock to synchronize of queue/dequeue of pkts in fw log pkt queue */ + spinlock_t fw_log_pkt_lock; /* Wait queue for Logger thread */ wait_queue_head_t wait_queue; /* Logger thread */ @@ -84,12 +126,21 @@ struct wlan_logging { struct completion shutdown_comp; /* Indicates to logger thread to exit */ bool exit; - /* wakeup indication */ - bool wakeEvent; /* Holds number of dropped logs*/ unsigned int drop_count; + /* Holds number of dropped vos pkts*/ + unsigned int pkt_drop_cnt; + /* Holds number of dropped fw log vos pkts*/ + unsigned int fw_log_pkt_drop_cnt; /* current logbuf to which the log will be filled to */ struct log_msg *pcur_node; + /* Event flag used for wakeup and post indication*/ + unsigned long event_flag; + /* Indicates logger thread is activated */ + bool is_active; + /* data structure for log complete event*/ + struct logger_log_complete log_complete; + spinlock_t bug_report_lock; }; static struct wlan_logging gwlan_logging; @@ -168,12 +219,11 @@ static int wlan_send_sock_msg_to_app(tAniHdr *wmsg, int radio, tAniNlHdr *wnl = NULL; struct sk_buff *skb; struct nlmsghdr *nlh; - int wmsg_length = be16_to_cpu(wmsg->length); + int wmsg_length = wmsg->length; static int nlmsg_seq; if (radio < 0 || radio > ANI_MAX_RADIOS) { - LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR, - "%s: invalid radio id [%d]", + pr_err("%s: invalid radio id [%d]", __func__, radio); return -EINVAL; } @@ -182,16 +232,14 @@ static int wlan_send_sock_msg_to_app(tAniHdr *wmsg, int radio, tot_msg_len = NLMSG_SPACE(payload_len); skb = dev_alloc_skb(tot_msg_len); if (skb == NULL) { - LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR, - "%s: dev_alloc_skb() failed for msg size[%d]", + pr_err("%s: dev_alloc_skb() failed for msg size[%d]", __func__, tot_msg_len); return -ENOMEM; } nlh = nlmsg_put(skb, pid, nlmsg_seq++, src_mod, payload_len, NLM_F_REQUEST); if (NULL == nlh) { - LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR, - "%s: nlmsg_put() failed for msg size[%d]", + pr_err("%s: nlmsg_put() failed for msg size[%d]", __func__, tot_msg_len); kfree_skb(skb); return -ENOMEM; @@ -200,11 +248,9 @@ static int wlan_send_sock_msg_to_app(tAniHdr *wmsg, int radio, wnl = (tAniNlHdr *) nlh; wnl->radio = radio; vos_mem_copy(&wnl->wmsg, wmsg, wmsg_length); - LOGGING_TRACE(VOS_TRACE_LEVEL_INFO, - "%s: Sending Msg Type [0x%X] to pid[%d]\n", - __func__, be16_to_cpu(wmsg->type), pid); err = nl_srv_ucast(skb, pid, MSG_DONTWAIT); + return err; } @@ -218,6 +264,8 @@ static void set_default_logtoapp_log_level(void) vos_trace_setValue(VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_ALL, VOS_TRUE); vos_trace_setValue(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ALL, VOS_TRUE); + vos_trace_setValue(VOS_MODULE_ID_PMC, VOS_TRACE_LEVEL_ALL, VOS_TRUE); + vos_trace_setValue(VOS_MODULE_ID_SVC, VOS_TRACE_LEVEL_ALL, VOS_TRUE); } static void clear_default_logtoapp_log_level(void) @@ -233,8 +281,6 @@ static void clear_default_logtoapp_log_level(void) VOS_TRUE); } - vos_trace_setValue(VOS_MODULE_ID_RSV3, VOS_TRACE_LEVEL_NONE, - VOS_FALSE); vos_trace_setValue(VOS_MODULE_ID_RSV4, VOS_TRACE_LEVEL_NONE, VOS_FALSE); } @@ -268,7 +314,8 @@ static int wlan_queue_logmsg_for_app(void) (struct log_msg *)(gwlan_logging.filled_list.next); ++gwlan_logging.drop_count; /* print every 64th drop count */ - if (gapp_pid != INVALID_PID && (!(gwlan_logging.drop_count % 0x40))) { + if (vos_is_multicast_logging() && + (!(gwlan_logging.drop_count % 0x40))) { pr_err("%s: drop_count = %u index = %d filled_length = %d\n", __func__, gwlan_logging.drop_count, gwlan_logging.pcur_node->index, @@ -283,12 +330,11 @@ static int wlan_queue_logmsg_for_app(void) return ret; } - int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) { /* Add the current time stamp */ char *ptr; - char tbuf[50]; + char tbuf[100]; int tlen; int total_log_len; unsigned int *pfilled_length; @@ -296,8 +342,11 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) unsigned long flags; struct timeval tv; + struct rtc_time tm; + unsigned long local_time; + u64 qtimer_ticks; - if (gapp_pid == INVALID_PID) { + if (!vos_is_multicast_logging()) { /* * This is to make sure that we print the logs to kmsg console * when no logger app is running. This is also needed to @@ -307,14 +356,20 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) * messages. */ pr_err("%s\n", to_be_sent); - } + } else { - /* Format the Log time [Secondselapsedinaday.microseconds] */ + /* Format the Log time [hr:min:sec.microsec] */ do_gettimeofday(&tv); - tlen = snprintf(tbuf, sizeof(tbuf), "[%s][%5lu.%06lu] ", current->comm, - (unsigned long) (tv.tv_sec%SECONDS_IN_A_DAY), - tv.tv_usec); + /* Convert rtc to local time */ + local_time = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60)); + rtc_time_to_tm(local_time, &tm); + /* Firmware Time Stamp */ + qtimer_ticks = arch_counter_get_cntpct(); + + tlen = snprintf(tbuf, sizeof(tbuf), "[%02d:%02d:%02d.%06lu] [%016llX]" + " [%.5s] ", tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec, + qtimer_ticks, current->comm); /* 1+1 indicate '\n'+'\0' */ total_log_len = length + tlen + 1 + 1; @@ -329,8 +384,8 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) pfilled_length = &gwlan_logging.pcur_node->filled_length; /* Check if we can accomodate more log into current node/buffer */ - if ((MAX_LOGMSG_LENGTH - (*pfilled_length + sizeof(tAniNlHdr))) < - total_log_len) { + if (MAX_LOGMSG_LENGTH < (*pfilled_length + sizeof(tAniNlHdr) + + total_log_len)) { wake_up_thread = true; wlan_queue_logmsg_for_app(); pfilled_length = &gwlan_logging.pcur_node->filled_length; @@ -363,29 +418,212 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) /* Wakeup logger thread */ if ((true == wake_up_thread)) { /* If there is logger app registered wakeup the logging - * thread Else broadcast a Ready Indication message, - * apps which are waiting on this message can - * register for the logs. + * thread */ - if ( (gapp_pid != INVALID_PID)) { - gwlan_logging.wakeEvent = TRUE; + + set_bit(HOST_LOG_POST, &gwlan_logging.event_flag); wake_up_interruptible(&gwlan_logging.wait_queue); - } - else { - wlan_logging_srv_nl_ready_indication(); - } } - if ((gapp_pid != INVALID_PID) - && gwlan_logging.log_fe_to_console + if (gwlan_logging.log_fe_to_console && ((VOS_TRACE_LEVEL_FATAL == log_level) || (VOS_TRACE_LEVEL_ERROR == log_level))) { - pr_err("%s\n", to_be_sent); + pr_err("%s %s\n",tbuf, to_be_sent); + } } return 0; } +static int send_fw_log_pkt_to_user(void) +{ + int ret = -1; + int extra_header_len, nl_payload_len; + struct sk_buff *skb = NULL; + static int nlmsg_seq; + vos_pkt_t *current_pkt; + vos_pkt_t *next_pkt; + VOS_STATUS status = VOS_STATUS_E_FAILURE; + unsigned long flags; + + tAniNlHdr msg_header; + + do { + spin_lock_irqsave(&gwlan_logging.fw_log_pkt_lock, flags); + + if (!gwlan_logging.fw_log_pkt_queue) { + spin_unlock_irqrestore( + &gwlan_logging.fw_log_pkt_lock, flags); + return -EIO; + } + + /* pick first pkt from queued chain */ + current_pkt = gwlan_logging.fw_log_pkt_queue; + + /* get the pointer to the next packet in the chain */ + status = vos_pkt_walk_packet_chain(current_pkt, &next_pkt, + TRUE); + + /* both "success" and "empty" are acceptable results */ + if (!((status == VOS_STATUS_SUCCESS) || + (status == VOS_STATUS_E_EMPTY))) { + ++gwlan_logging.fw_log_pkt_drop_cnt; + spin_unlock_irqrestore( + &gwlan_logging.fw_log_pkt_lock, flags); + pr_err("%s: Failure walking packet chain", __func__); + return -EIO; + } + + /* update queue head with next pkt ptr which could be NULL */ + gwlan_logging.fw_log_pkt_queue = next_pkt; + --gwlan_logging.fw_log_pkt_qcnt; + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, flags); + + status = vos_pkt_get_os_packet(current_pkt, (v_VOID_t **)&skb, + TRUE); + if (!VOS_IS_STATUS_SUCCESS(status)) { + ++gwlan_logging.fw_log_pkt_drop_cnt; + pr_err("%s: Failure extracting skb from vos pkt", + __func__); + return -EIO; + } + + /*return vos pkt since skb is already detached */ + vos_pkt_return_packet(current_pkt); + + extra_header_len = sizeof(msg_header.radio) + sizeof(tAniHdr); + nl_payload_len = NLMSG_ALIGN(extra_header_len + skb->len); + + msg_header.nlh.nlmsg_type = ANI_NL_MSG_LOG; + msg_header.nlh.nlmsg_len = nl_payload_len; + msg_header.nlh.nlmsg_flags = NLM_F_REQUEST; + msg_header.nlh.nlmsg_pid = gapp_pid; + msg_header.nlh.nlmsg_seq = nlmsg_seq++; + + msg_header.radio = 0; + + msg_header.wmsg.type = ANI_NL_MSG_FW_LOG_PKT_TYPE; + msg_header.wmsg.length = skb->len; + + if (unlikely(skb_headroom(skb) < sizeof(msg_header))) { + pr_err("VPKT [%d]: Insufficient headroom, head[%pK]," + " data[%pK], req[%zu]", __LINE__, skb->head, + skb->data, sizeof(msg_header)); + return -EIO; + } + + vos_mem_copy(skb_push(skb, sizeof(msg_header)), &msg_header, + sizeof(msg_header)); + + ret = nl_srv_bcast(skb); + if (ret < 0) { + pr_info("%s: Send Failed %d drop_count = %u\n", + __func__, ret, ++gwlan_logging.fw_log_pkt_drop_cnt); + } else { + ret = 0; + } + + } while (next_pkt); + + return ret; +} + +static int send_data_mgmt_log_pkt_to_user(void) +{ + int ret = -1; + int extra_header_len, nl_payload_len; + struct sk_buff *skb = NULL; + static int nlmsg_seq; + vos_pkt_t *current_pkt; + vos_pkt_t *next_pkt; + VOS_STATUS status = VOS_STATUS_E_FAILURE; + unsigned long flags; + + tAniNlLogHdr msg_header; + + do { + spin_lock_irqsave(&gwlan_logging.data_mgmt_pkt_lock, flags); + + if (!gwlan_logging.data_mgmt_pkt_queue) { + spin_unlock_irqrestore( + &gwlan_logging.data_mgmt_pkt_lock, flags); + return -EIO; + } + + /* pick first pkt from queued chain */ + current_pkt = gwlan_logging.data_mgmt_pkt_queue; + + /* get the pointer to the next packet in the chain */ + status = vos_pkt_walk_packet_chain(current_pkt, &next_pkt, + TRUE); + + /* both "success" and "empty" are acceptable results */ + if (!((status == VOS_STATUS_SUCCESS) || + (status == VOS_STATUS_E_EMPTY))) { + ++gwlan_logging.pkt_drop_cnt; + spin_unlock_irqrestore( + &gwlan_logging.data_mgmt_pkt_lock, flags); + pr_err("%s: Failure walking packet chain", __func__); + return -EIO; + } + + /* update queue head with next pkt ptr which could be NULL */ + gwlan_logging.data_mgmt_pkt_queue = next_pkt; + --gwlan_logging.data_mgmt_pkt_qcnt; + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, flags); + + status = vos_pkt_get_os_packet(current_pkt, (v_VOID_t **)&skb, + TRUE); + if (!VOS_IS_STATUS_SUCCESS(status)) { + ++gwlan_logging.pkt_drop_cnt; + pr_err("%s: Failure extracting skb from vos pkt", + __func__); + return -EIO; + } + + /*return vos pkt since skb is already detached */ + vos_pkt_return_packet(current_pkt); + + extra_header_len = sizeof(msg_header.radio) + sizeof(tAniHdr) + + sizeof(msg_header.frameSize); + nl_payload_len = NLMSG_ALIGN(extra_header_len + skb->len); + + msg_header.nlh.nlmsg_type = ANI_NL_MSG_LOG; + msg_header.nlh.nlmsg_len = nl_payload_len; + msg_header.nlh.nlmsg_flags = NLM_F_REQUEST; + msg_header.nlh.nlmsg_pid = 0; + msg_header.nlh.nlmsg_seq = nlmsg_seq++; + + msg_header.radio = 0; + + msg_header.wmsg.type = ANI_NL_MSG_LOG_PKT_TYPE; + msg_header.wmsg.length = skb->len + sizeof(uint32); + + msg_header.frameSize = WLAN_MGMT_LOGGING_FRAMESIZE_128BYTES; + + if (unlikely(skb_headroom(skb) < sizeof(msg_header))) { + pr_err("VPKT [%d]: Insufficient headroom, head[%pK]," + " data[%pK], req[%zu]", __LINE__, skb->head, + skb->data, sizeof(msg_header)); + return -EIO; + } + + vos_mem_copy(skb_push(skb, sizeof(msg_header)), &msg_header, + sizeof(msg_header)); + + ret = nl_srv_bcast(skb); + if (ret < 0) { + pr_info("%s: Send Failed %d drop_count = %u\n", + __func__, ret, ++gwlan_logging.pkt_drop_cnt); + } else { + ret = 0; + } + + } while (next_pkt); + + return ret; +} + static int send_filled_buffers_to_user(void) { int ret = -1; @@ -426,7 +664,7 @@ static int send_filled_buffers_to_user(void) sizeof(wnl->radio) + sizeof(tAniHdr); tot_msg_len = NLMSG_SPACE(payload_len); - nlh = nlmsg_put(skb, gapp_pid, nlmsg_seq++, + nlh = nlmsg_put(skb, 0, nlmsg_seq++, ANI_NL_MSG_LOG, payload_len, NLM_F_REQUEST); if (NULL == nlh) { @@ -456,14 +694,15 @@ static int send_filled_buffers_to_user(void) &gwlan_logging.free_list); spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); - ret = nl_srv_ucast(skb, gapp_pid, 0); + ret = nl_srv_bcast(skb); if (ret < 0) { - pr_err("%s: Send Failed %d drop_count = %u\n", - __func__, ret, ++gwlan_logging.drop_count); + if (__ratelimit(&errCnt)) + { + pr_info("%s: Send Failed %d drop_count = %u\n", + __func__, ret, gwlan_logging.drop_count); + } + gwlan_logging.drop_count++; skb = NULL; - gapp_pid = INVALID_PID; - clear_default_logtoapp_log_level(); - wlan_logging_srv_nl_ready_indication(); break; } else { skb = NULL; @@ -490,37 +729,60 @@ static int wlan_logging_thread(void *Arg) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)) daemonize("wlan_logging_thread"); #endif - while (!gwlan_logging.exit) { ret_wait_status = wait_event_interruptible( - gwlan_logging.wait_queue, - (gwlan_logging.wakeEvent || gwlan_logging.exit)); - - gwlan_logging.wakeEvent = FALSE; + gwlan_logging.wait_queue, + (test_bit(HOST_LOG_POST, &gwlan_logging.event_flag) || + gwlan_logging.exit || + test_bit(LOGGER_MGMT_DATA_PKT_POST, + &gwlan_logging.event_flag) || + test_bit(LOGGER_FW_LOG_PKT_POST, + &gwlan_logging.event_flag) || + test_bit(LOGGER_FATAL_EVENT_POST, + &gwlan_logging.event_flag))); if (ret_wait_status == -ERESTARTSYS) { - pr_err("%s: wait_event_interruptible returned -ERESTARTSYS", - __func__); + pr_err("%s: wait_event return -ERESTARTSYS", __func__); break; } if (gwlan_logging.exit) { - pr_err("%s: Exiting the thread\n", __func__); break; } - if (INVALID_PID == gapp_pid) { - pr_err("%s: Invalid PID\n", __func__); - continue; + if (test_and_clear_bit(HOST_LOG_POST, + &gwlan_logging.event_flag)) { + ret = send_filled_buffers_to_user(); + if (-ENOMEM == ret) { + msleep(200); + } + } + + if (test_and_clear_bit(LOGGER_FW_LOG_PKT_POST, + &gwlan_logging.event_flag)) { + send_fw_log_pkt_to_user(); } - ret = send_filled_buffers_to_user(); - if (-ENOMEM == ret) { - msleep(200); + if (test_and_clear_bit(LOGGER_MGMT_DATA_PKT_POST, + &gwlan_logging.event_flag)) { + send_data_mgmt_log_pkt_to_user(); } - } - pr_info("%s: Terminating\n", __func__); + if (test_and_clear_bit(LOGGER_FATAL_EVENT_POST, + &gwlan_logging.event_flag)) { + if (gwlan_logging.log_complete.is_flush_complete == true) { + gwlan_logging.log_complete.is_flush_complete = false; + vos_send_fatal_event_done(); + } + else { + gwlan_logging.log_complete.is_flush_complete = true; + set_bit(HOST_LOG_POST, &gwlan_logging.event_flag); + set_bit(LOGGER_FW_LOG_PKT_POST,&gwlan_logging.event_flag); + set_bit(LOGGER_FATAL_EVENT_POST, &gwlan_logging.event_flag); + wake_up_interruptible(&gwlan_logging.wait_queue); + } + } + } complete_and_exit(&gwlan_logging.shutdown_comp, 0); @@ -537,13 +799,18 @@ static int wlan_logging_proc_sock_rx_msg(struct sk_buff *skb) int type; int ret; + if (TRUE == vos_isUnloadInProgress()) + { + pr_info("%s: unload in progress\n",__func__); + return -ENODEV; + } + wnl = (tAniNlHdr *) skb->data; radio = wnl->radio; type = wnl->nlh.nlmsg_type; if (radio < 0 || radio > ANI_MAX_RADIOS) { - LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR, - "%s: invalid radio id [%d]\n", + pr_err("%s: invalid radio id [%d]\n", __func__, radio); return -EINVAL; } @@ -558,7 +825,7 @@ static int wlan_logging_proc_sock_rx_msg(struct sk_buff *skb) wlan_queue_logmsg_for_app(); } spin_unlock_bh(&gwlan_logging.spin_lock); - gwlan_logging.wakeEvent = TRUE; + set_bit(HOST_LOG_POST, &gwlan_logging.event_flag); wake_up_interruptible(&gwlan_logging.wait_queue); } else { /* This is to set the default levels (WLAN logging @@ -566,27 +833,83 @@ static int wlan_logging_proc_sock_rx_msg(struct sk_buff *skb) * logger app is registered for the first time. */ gapp_pid = wnl->nlh.nlmsg_pid; - set_default_logtoapp_log_level(); } ret = wlan_send_sock_msg_to_app(&wnl->wmsg, 0, ANI_NL_MSG_LOG, wnl->nlh.nlmsg_pid); if (ret < 0) { - LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR, - "wlan_send_sock_msg_to_app: failed"); + pr_err("wlan_send_sock_msg_to_app: failed"); } return ret; } +void wlan_init_log_completion(void) +{ + gwlan_logging.log_complete.indicator = WLAN_LOG_TYPE_NON_FATAL; + gwlan_logging.log_complete.is_fatal = WLAN_LOG_INDICATOR_UNUSED; + gwlan_logging.log_complete.is_report_in_progress = false; + gwlan_logging.log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED; + + spin_lock_init(&gwlan_logging.bug_report_lock); +} + +int wlan_set_log_completion(uint32 is_fatal, + uint32 indicator, + uint32 reason_code) +{ + unsigned long flags; + + spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags); + gwlan_logging.log_complete.indicator = indicator; + gwlan_logging.log_complete.is_fatal = is_fatal; + gwlan_logging.log_complete.is_report_in_progress = true; + gwlan_logging.log_complete.reason_code = reason_code; + spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags); + + return 0; +} +void wlan_get_log_completion(uint32 *is_fatal, + uint32 *indicator, + uint32 *reason_code) +{ + unsigned long flags; + + spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags); + *indicator = gwlan_logging.log_complete.indicator; + *is_fatal = gwlan_logging.log_complete.is_fatal; + *reason_code = gwlan_logging.log_complete.reason_code; + gwlan_logging.log_complete.is_report_in_progress = false; + + spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags); + +} +bool wlan_is_log_report_in_progress(void) +{ + return gwlan_logging.log_complete.is_report_in_progress; +} + +void wlan_reset_log_report_in_progress(void) +{ + unsigned long flags; + + spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags); + gwlan_logging.log_complete.is_report_in_progress = false; + spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags); +} + + +void wlan_deinit_log_completion(void) +{ + return; +} + + int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf) { int i = 0; unsigned long irq_flag; - pr_info("%s: Initalizing FEConsoleLog = %d NumBuff = %d\n", - __func__, log_fe_to_console, num_buf); - gapp_pid = INVALID_PID; gplog_msg = (struct log_msg *) vmalloc( @@ -616,7 +939,10 @@ int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf) init_waitqueue_head(&gwlan_logging.wait_queue); gwlan_logging.exit = false; - gwlan_logging.wakeEvent = FALSE; + clear_bit(HOST_LOG_POST, &gwlan_logging.event_flag); + clear_bit(LOGGER_MGMT_DATA_PKT_POST, &gwlan_logging.event_flag); + clear_bit(LOGGER_FW_LOG_PKT_POST, &gwlan_logging.event_flag); + clear_bit(LOGGER_FATAL_EVENT_POST, &gwlan_logging.event_flag); init_completion(&gwlan_logging.shutdown_comp); gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL, "wlan_logging_thread"); @@ -631,12 +957,48 @@ int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf) return -ENOMEM; } wake_up_process(gwlan_logging.thread); + gwlan_logging.is_active = true; nl_srv_register(ANI_NL_MSG_LOG, wlan_logging_proc_sock_rx_msg); //Broadcast SVC ready message to logging app/s running wlan_logging_srv_nl_ready_indication(); - pr_info("%s: Activated wlan_logging svc\n", __func__); + return 0; +} + +int wlan_logging_flush_pkt_queue(void) +{ + vos_pkt_t *pkt_queue_head; + unsigned long flags; + + spin_lock_irqsave(&gwlan_logging.data_mgmt_pkt_lock, flags); + if (NULL != gwlan_logging.data_mgmt_pkt_queue) { + pkt_queue_head = gwlan_logging.data_mgmt_pkt_queue; + gwlan_logging.data_mgmt_pkt_queue = NULL; + gwlan_logging.pkt_drop_cnt = 0; + gwlan_logging.data_mgmt_pkt_qcnt = 0; + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, + flags); + vos_pkt_return_packet(pkt_queue_head); + } else { + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, + flags); + } + + spin_lock_irqsave(&gwlan_logging.fw_log_pkt_lock, flags); + if (NULL != gwlan_logging.fw_log_pkt_queue) { + pkt_queue_head = gwlan_logging.fw_log_pkt_queue; + gwlan_logging.fw_log_pkt_queue = NULL; + gwlan_logging.fw_log_pkt_drop_cnt = 0; + gwlan_logging.fw_log_pkt_qcnt = 0; + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, + flags); + vos_pkt_return_packet(pkt_queue_head); + } else { + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, + flags); + } + return 0; } @@ -653,15 +1015,18 @@ int wlan_logging_sock_deactivate_svc(void) INIT_COMPLETION(gwlan_logging.shutdown_comp); gwlan_logging.exit = true; + gwlan_logging.is_active = false; + vos_set_multicast_logging(0); wake_up_interruptible(&gwlan_logging.wait_queue); wait_for_completion(&gwlan_logging.shutdown_comp); spin_lock_irqsave(&gwlan_logging.spin_lock, irq_flag); vfree(gplog_msg); + gplog_msg = NULL; gwlan_logging.pcur_node = NULL; spin_unlock_irqrestore(&gwlan_logging.spin_lock, irq_flag); - pr_info("%s: Deactivate wlan_logging svc\n", __func__); + wlan_logging_flush_pkt_queue(); return 0; } @@ -669,9 +1034,13 @@ int wlan_logging_sock_deactivate_svc(void) int wlan_logging_sock_init_svc(void) { spin_lock_init(&gwlan_logging.spin_lock); + spin_lock_init(&gwlan_logging.data_mgmt_pkt_lock); + spin_lock_init(&gwlan_logging.fw_log_pkt_lock); gapp_pid = INVALID_PID; gwlan_logging.pcur_node = NULL; + wlan_init_log_completion(); + return 0; } @@ -680,6 +1049,189 @@ int wlan_logging_sock_deinit_svc(void) gwlan_logging.pcur_node = NULL; gapp_pid = INVALID_PID; - return 0; + wlan_deinit_log_completion(); + return 0; +} + +int wlan_queue_data_mgmt_pkt_for_app(vos_pkt_t *pPacket) +{ + unsigned long flags; + vos_pkt_t *next_pkt; + vos_pkt_t *free_pkt; + VOS_STATUS status = VOS_STATUS_E_FAILURE; + + spin_lock_irqsave(&gwlan_logging.data_mgmt_pkt_lock, flags); + if (gwlan_logging.data_mgmt_pkt_qcnt >= LOGGER_MAX_DATA_MGMT_PKT_Q_LEN) { + status = vos_pkt_walk_packet_chain( + gwlan_logging.data_mgmt_pkt_queue, &next_pkt, TRUE); + /*both "success" and "empty" are acceptable results*/ + if (!((status == VOS_STATUS_SUCCESS) || + (status == VOS_STATUS_E_EMPTY))) { + ++gwlan_logging.pkt_drop_cnt; + spin_unlock_irqrestore( + &gwlan_logging.data_mgmt_pkt_lock, flags); + pr_err("%s: Failure walking packet chain", __func__); + /*keep returning pkts to avoid low resource cond*/ + vos_pkt_return_packet(pPacket); + return VOS_STATUS_E_FAILURE; + } + + free_pkt = gwlan_logging.data_mgmt_pkt_queue; + gwlan_logging.data_mgmt_pkt_queue = next_pkt; + /*returning head of pkt queue. latest pkts are important*/ + --gwlan_logging.data_mgmt_pkt_qcnt; + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, + flags); + vos_pkt_return_packet(free_pkt); + } else { + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, + flags); + } + + spin_lock_irqsave(&gwlan_logging.data_mgmt_pkt_lock, flags); + + if (gwlan_logging.data_mgmt_pkt_queue) { + vos_pkt_chain_packet(gwlan_logging.data_mgmt_pkt_queue, + pPacket, TRUE); + } else { + gwlan_logging.data_mgmt_pkt_queue = pPacket; + } + ++gwlan_logging.data_mgmt_pkt_qcnt; + + spin_unlock_irqrestore(&gwlan_logging.data_mgmt_pkt_lock, flags); + + set_bit(LOGGER_MGMT_DATA_PKT_POST, &gwlan_logging.event_flag); + wake_up_interruptible(&gwlan_logging.wait_queue); + + return VOS_STATUS_SUCCESS; +} + +/** + * wlan_logging_set_log_level() - Set the logging level + * + * This function is used to set the logging level of host debug messages + * + * Return: None + */ +void wlan_logging_set_log_level(void) +{ + set_default_logtoapp_log_level(); +} + +int wlan_queue_fw_log_pkt_for_app(vos_pkt_t *pPacket) +{ + unsigned long flags; + vos_pkt_t *next_pkt; + vos_pkt_t *free_pkt; + VOS_STATUS status = VOS_STATUS_E_FAILURE; + + spin_lock_irqsave(&gwlan_logging.fw_log_pkt_lock, flags); + if (gwlan_logging.fw_log_pkt_qcnt >= LOGGER_MAX_FW_LOG_PKT_Q_LEN) { + status = vos_pkt_walk_packet_chain( + gwlan_logging.fw_log_pkt_queue, &next_pkt, TRUE); + /*both "success" and "empty" are acceptable results*/ + if (!((status == VOS_STATUS_SUCCESS) || + (status == VOS_STATUS_E_EMPTY))) { + ++gwlan_logging.fw_log_pkt_drop_cnt; + spin_unlock_irqrestore( + &gwlan_logging.fw_log_pkt_lock, flags); + pr_err("%s: Failure walking packet chain", __func__); + /*keep returning pkts to avoid low resource cond*/ + vos_pkt_return_packet(pPacket); + return VOS_STATUS_E_FAILURE; + } + + free_pkt = gwlan_logging.fw_log_pkt_queue; + gwlan_logging.fw_log_pkt_queue = next_pkt; + /*returning head of pkt queue. latest pkts are important*/ + --gwlan_logging.fw_log_pkt_qcnt; + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, + flags); + vos_pkt_return_packet(free_pkt); + } else { + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, + flags); + } + + spin_lock_irqsave(&gwlan_logging.fw_log_pkt_lock, flags); + + if (gwlan_logging.fw_log_pkt_queue) { + vos_pkt_chain_packet(gwlan_logging.fw_log_pkt_queue, + pPacket, TRUE); + } else { + gwlan_logging.fw_log_pkt_queue = pPacket; + } + ++gwlan_logging.fw_log_pkt_qcnt; + + spin_unlock_irqrestore(&gwlan_logging.fw_log_pkt_lock, flags); + + set_bit(LOGGER_FW_LOG_PKT_POST, &gwlan_logging.event_flag); + wake_up_interruptible(&gwlan_logging.wait_queue); + + return VOS_STATUS_SUCCESS; +} + +int wlan_queue_logpkt_for_app(vos_pkt_t *pPacket, uint32 pkt_type) +{ + VOS_STATUS status = VOS_STATUS_E_FAILURE; + + if (pPacket == NULL) { + pr_err("%s: Null param", __func__); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + if (gwlan_logging.is_active == false) { + /*return all packets queued*/ + wlan_logging_flush_pkt_queue(); + + /*return currently received pkt*/ + vos_pkt_return_packet(pPacket); + return VOS_STATUS_E_FAILURE; + } + + switch (pkt_type) { + case LOG_PKT_TYPE_DATA_MGMT: + status = wlan_queue_data_mgmt_pkt_for_app(pPacket); + break; + + case LOG_PKT_TYPE_FW_LOG: + status = wlan_queue_fw_log_pkt_for_app(pPacket); + break; + + default: + pr_info("%s: Unknown pkt received %d", __func__, pkt_type); + status = VOS_STATUS_E_INVAL; + break; + }; + + return status; +} + +void wlan_process_done_indication(uint8 type, uint32 reason_code) +{ + if ((type == WLAN_QXDM_LOGGING) && (wlan_is_log_report_in_progress() == TRUE)) + { + pr_info("%s: Setting LOGGER_FATAL_EVENT\n", __func__); + set_bit(LOGGER_FATAL_EVENT_POST, &gwlan_logging.event_flag); + wake_up_interruptible(&gwlan_logging.wait_queue); + } +} + +/** + * wlan_is_logger_thread()- Check if threadid is + * of logger thread + * + * @threadId: passed threadid + * + * This function is called to check if threadid is + * of logger thread. + * + * Return: true if threadid is of logger thread. + */ +bool wlan_is_logger_thread(int threadId) +{ + return ((gwlan_logging.thread) && + (threadId == gwlan_logging.thread->pid)); } #endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */ diff --git a/drivers/staging/prima/CORE/SVC/src/nlink/wlan_nlink_srv.c b/drivers/staging/prima/CORE/SVC/src/nlink/wlan_nlink_srv.c index a1dfc8a9a1b8..163018858ce1 100644 --- a/drivers/staging/prima/CORE/SVC/src/nlink/wlan_nlink_srv.c +++ b/drivers/staging/prima/CORE/SVC/src/nlink/wlan_nlink_srv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -111,6 +111,7 @@ void nl_srv_exit(void) } #endif /* WLAN_KD_READY_NOTIFIER */ netlink_kernel_release(nl_srv_sock); + nl_srv_sock = NULL; } /* @@ -176,7 +177,7 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag) if (err < 0) VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - "NLINK: netlink_unicast to pid[%d] failed, ret[0x%X]", dst_pid, err); + "NLINK: netlink_unicast to pid[%d] failed, ret[%d]", dst_pid, err); return err; } @@ -188,6 +189,10 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag) int nl_srv_bcast(struct sk_buff *skb) { int err; + int flags = GFP_KERNEL; + + if (in_interrupt() || irqs_disabled() || in_atomic()) + flags = GFP_ATOMIC; #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) NETLINK_CB(skb).pid = 0; //sender's pid @@ -196,7 +201,7 @@ int nl_srv_bcast(struct sk_buff *skb) #endif NETLINK_CB(skb).dst_group = WLAN_NLINK_MCAST_GRP_ID; //destination group - err = netlink_broadcast(nl_srv_sock, skb, 0, WLAN_NLINK_MCAST_GRP_ID, GFP_KERNEL); + err = netlink_broadcast(nl_srv_sock, skb, 0, WLAN_NLINK_MCAST_GRP_ID, flags); if (err < 0) { @@ -234,7 +239,7 @@ static void nl_srv_rcv_skb (struct sk_buff *skb) if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "NLINK: Invalid " - "Netlink message: skb[%p], len[%d], nlhdr[%p], nlmsg_len[%d]", + "Netlink message: skb[%pK], len[%d], nlhdr[%pK], nlmsg_len[%d]", skb, skb->len, nlh, nlh->nlmsg_len); return; } @@ -281,9 +286,6 @@ static void nl_srv_rcv_msg (struct sk_buff *skb, struct nlmsghdr *nlh) return; } - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "NLINK: Received NL msg type [%d]", type); - // turn type into dispatch table offset type -= WLAN_NL_MSG_BASE; @@ -386,3 +388,19 @@ void nl_srv_nl_close_indication } #endif /* WLAN_KD_READY_NOTIFIER */ +/* + * nl_srv_is_initialized() - This function is used check if the netlink + * service is initialized + * + * This function is used check if the netlink service is initialized + * + * Return: Return -EPERM if the service is not initialized + * + */ +int nl_srv_is_initialized() +{ + if (nl_srv_sock) + return 0; + else + return -EPERM; +} diff --git a/drivers/staging/prima/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c b/drivers/staging/prima/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c index c24338018487..465426e43954 100644 --- a/drivers/staging/prima/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c +++ b/drivers/staging/prima/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -73,7 +73,7 @@ static void ptt_sock_dump_buf(const unsigned char * pbuf, int cnt) int i; for (i = 0; i < cnt ; i++) { if ((i%16)==0) - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"\n%p:", pbuf); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"\n%pK:", pbuf); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO," %02X", *pbuf); pbuf++; } @@ -113,12 +113,22 @@ int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid, int wnl = (tAniNlHdr *) nlh; wnl->radio = radio; vos_mem_copy(&wnl->wmsg, wmsg, wmsg_length); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: Sending Msg Type [0x%X] to pid[%d]\n", - __func__, be16_to_cpu(wmsg->type), pid); #ifdef PTT_SOCK_DEBUG_VERBOSE ptt_sock_dump_buf((const unsigned char *)skb->data, skb->len); #endif - err = nl_srv_ucast(skb, pid, flag); + if (pid != INVALID_PID) + { + err = nl_srv_ucast(skb, pid, flag); + } + else + { + err = nl_srv_bcast(skb); + } + if (err) { + PTT_TRACE(VOS_TRACE_LEVEL_INFO, + "%s:Failed sending Msg Type [0x%X] to pid[%d]\n", + __func__, be16_to_cpu(wmsg->type), pid); + } return err; } /* @@ -147,7 +157,7 @@ static void ptt_sock_proc_reg_req(tAniHdr *wmsg, int radio) if (ptt_sock_send_msg_to_app((tAniHdr *)&rspmsg.wniHdr, radio, ANI_NL_MSG_PUMAC, reg_req->pid, MSG_DONTWAIT) < 0) { - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Error sending ANI_MSG_APP_REG_RSP to pid[%d]\n", + PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: Error sending ANI_MSG_APP_REG_RSP to pid[%d]\n", __func__, reg_req->pid); } } diff --git a/drivers/staging/prima/CORE/SYS/common/inc/wlan_qct_sys.h b/drivers/staging/prima/CORE/SYS/common/inc/wlan_qct_sys.h index 038aa6d4af86..f85d29d6d81b 100644 --- a/drivers/staging/prima/CORE/SYS/common/inc/wlan_qct_sys.h +++ b/drivers/staging/prima/CORE/SYS/common/inc/wlan_qct_sys.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -70,6 +70,8 @@ --------------------------------------------------------------------------*/ typedef v_VOID_t ( * sysResponseCback ) ( v_VOID_t *pUserData ); +typedef v_VOID_t ( * sysThreadProbeCback ) ( int threadId ); + @@ -87,6 +89,7 @@ typedef enum SYS_MSG_ID_MC_STOP, SYS_MSG_ID_FTM_RSP, + SYS_MSG_ID_RX_THR_PROBE, } SYS_MSG_ID; /*--------------------------------------------------------------------------- diff --git a/drivers/staging/prima/CORE/SYS/common/src/wlan_qct_sys.c b/drivers/staging/prima/CORE/SYS/common/src/wlan_qct_sys.c index 88fef2136c46..f55bd8c62518 100644 --- a/drivers/staging/prima/CORE/SYS/common/src/wlan_qct_sys.c +++ b/drivers/staging/prima/CORE/SYS/common/src/wlan_qct_sys.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,8 +35,6 @@ DESCRIPTION in the Gen6 host software. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -73,6 +71,7 @@ when who what, where, why #include "wlan_qct_wda.h" #include "sme_Api.h" #include "macInitApi.h" +#include "vos_sched.h" VOS_STATUS WLANFTM_McProcessMsg (v_VOID_t *message); @@ -383,9 +382,10 @@ VOS_STATUS sysMcProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) // function that is in the message. case SYS_MSG_ID_MC_THR_PROBE: { - VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, - " Received SYS_MSG_ID_MC_THR_PROBE message msgType = %d [0x%08x]", - pMsg->type, pMsg->type); +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + if(pMsg->callback) + ((sysThreadProbeCback)pMsg->callback)(current->pid); +#endif break; } @@ -395,7 +395,9 @@ VOS_STATUS sysMcProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) if (NULL != timerCB) { + vos_ssr_protect(__func__); timerCB(pMsg->bodyptr); + vos_ssr_unprotect(__func__); } break; } @@ -404,7 +406,6 @@ VOS_STATUS sysMcProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) WLANFTM_McProcessMsg((v_VOID_t *)pMsg->bodyptr); break; } - default: { VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, @@ -470,13 +471,10 @@ VOS_STATUS sysTxProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) // function that is in the message. case SYS_MSG_ID_TX_THR_PROBE: { - /* Handling for this message is not needed now so adding - * debug print and VOS_ASSERT*/ - VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, - " Received SYS_MSG_ID_TX_THR_PROBE message msgType= %d [0x%08x]", - pMsg->type, pMsg->type ); - VOS_ASSERT(0); - +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + if(pMsg->callback) + ((sysThreadProbeCback)pMsg->callback)(current->pid); +#endif break; } @@ -549,6 +547,15 @@ VOS_STATUS sysRxProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) break; } + case SYS_MSG_ID_RX_THR_PROBE: + { +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + if(pMsg->callback) + ((sysThreadProbeCback)pMsg->callback)(current->pid); +#endif + break; + } + default: { VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/pal/inc/palApi.h b/drivers/staging/prima/CORE/SYS/legacy/src/pal/inc/palApi.h index 71e1278a3eb0..4007612291a4 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/pal/inc/palApi.h +++ b/drivers/staging/prima/CORE/SYS/legacy/src/pal/inc/palApi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2013, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -451,7 +451,7 @@ extern void palGetUnicastStats(tHddHandle hHdd, tANI_U32 *tx, tANI_U32 *rx); \return tick count. ----------------------------------------------------------------------------------*/ -tANI_U32 palGetTickCount(tHddHandle hHdd); +tANI_TIMESTAMP palGetTickCount(tHddHandle hHdd); /** --------------------------------------------------------------------------- diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c b/drivers/staging/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c index f6fb3a2bcff2..c6ce6f488977 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -165,7 +165,7 @@ void palPktFree( tHddHandle hHdd, eFrameType frmType, void* buf, void *pPacket) -tANI_U32 palGetTickCount(tHddHandle hHdd) +tANI_TIMESTAMP palGetTickCount(tHddHandle hHdd) { return( vos_timer_get_system_ticks() ); } @@ -204,7 +204,9 @@ eHalStatus palSpinLockAlloc( tHddHandle hHdd, tPalSpinLockHandle *pHandle ) pLock = vos_mem_malloc( sizeof( vos_lock_t ) ); if ( NULL == pLock ) break; - + + vos_mem_set(pLock, sizeof( vos_lock_t ), 0); + vosStatus = vos_lock_init( pLock ); if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/platform/inc/VossWrapper.h b/drivers/staging/prima/CORE/SYS/legacy/src/platform/inc/VossWrapper.h index 180d27d8e652..49eec9d3aef2 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/platform/inc/VossWrapper.h +++ b/drivers/staging/prima/CORE/SYS/legacy/src/platform/inc/VossWrapper.h @@ -38,9 +38,6 @@ extern "C" { @brief This header file contains the various structure definitions and function prototypes for the RTOS abstraction layer, implemented for VOSS - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/platform/src/VossWrapper.c b/drivers/staging/prima/CORE/SYS/legacy/src/platform/src/VossWrapper.c index 5f3c0d9066a6..a137cbefb3ac 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/platform/src/VossWrapper.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/platform/src/VossWrapper.c @@ -31,9 +31,6 @@ @brief This source file contains the various function definitions for the RTOS abstraction layer, implemented for VOSS - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/system/inc/sysDef.h b/drivers/staging/prima/CORE/SYS/legacy/src/system/inc/sysDef.h index 5631c3c849d7..1839c14b389d 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/system/inc/sysDef.h +++ b/drivers/staging/prima/CORE/SYS/legacy/src/system/inc/sysDef.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -116,15 +116,6 @@ /// PTT Message Queue # define SYS_NIM_PTT_Q_SIZE 200 // Holds up to 25 messages -/// Semaphore definitions -// Data Semaphore - -# define SYS_DPH_SEM_INITIAL_CNT 0 - -// Transport Semaphore - -# define SYS_BBT_SEM_INITIAL_CNT 0 - /// Thread definitions // tHAL diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/system/src/macInitApi.c b/drivers/staging/prima/CORE/SYS/legacy/src/system/src/macInitApi.c index 79b5f03e12bc..ced0a4826416 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/system/src/macInitApi.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/system/src/macInitApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -197,7 +197,7 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter */ /* Allocate pMac */ - pMac = vos_mem_malloc(sizeof(tAniSirGlobal)); + pMac = vos_mem_vmalloc(sizeof(tAniSirGlobal)); if ( NULL == pMac ) return eSIR_FAILURE; @@ -219,11 +219,17 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter { /* Call various PE (and other layer init here) */ if( eSIR_SUCCESS != logInit(pMac)) + { + vos_mem_vfree(pMac); return eSIR_FAILURE; + } /* Call routine to initialize CFG data structures */ if( eSIR_SUCCESS != cfgInit(pMac) ) + { + vos_mem_vfree(pMac); return eSIR_FAILURE; + } sysInitGlobals(pMac); } @@ -253,7 +259,7 @@ tSirRetStatus macClose(tHalHandle hHal) logDeinit(pMac); // Finally, de-allocate the global MAC datastructure: - vos_mem_free( pMac ); + vos_mem_vfree( pMac ); return eSIR_SUCCESS; } diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/system/src/sysEntryFunc.c b/drivers/staging/prima/CORE/SYS/legacy/src/system/src/sysEntryFunc.c index fd702310ba9b..ffa574ab136e 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/system/src/sysEntryFunc.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/system/src/sysEntryFunc.c @@ -134,6 +134,10 @@ sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, if(type == SIR_MAC_MGMT_FRAME) { + if ((subType == SIR_MAC_MGMT_DEAUTH || + subType == SIR_MAC_MGMT_DISASSOC)&& + limIsDeauthDiassocForDrop(pMac, pBd)) + goto fail; if( (dropReason = limIsPktCandidateForDrop(pMac, pBd, subType)) != eMGMT_DROP_NO_DROP) { @@ -152,53 +156,6 @@ sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, } else if (type == SIR_MAC_DATA_FRAME) { -#ifdef FEATURE_WLAN_TDLS_INTERNAL - /* - * if we reached here, probably this frame can be TDLS frame. - */ - v_U16_t ethType = 0 ; - v_U8_t *mpduHdr = NULL ; - v_U8_t *ethTypeOffset = NULL ; - - /* - * Peek into payload and extract ethtype. - * In TDLS we can recieve TDLS frames with MAC HEADER (802.11) and also - * without MAC Header (Particularly TDLS action frames on direct link. - */ - mpduHdr = (v_U8_t *)WDA_GET_RX_MAC_HEADER(pBd) ; - -#define SIR_MAC_ETH_HDR_LEN (14) - if(0 != WDA_GET_RX_FT_DONE(pBd)) - { - ethTypeOffset = mpduHdr + SIR_MAC_ETH_HDR_LEN - sizeof(ethType) ; - } - else - { - ethTypeOffset = mpduHdr + WDA_GET_RX_MPDU_HEADER_LEN(pBd) - + RFC1042_HDR_LENGTH ; - } - - ethType = GET_BE16(ethTypeOffset) ; - if(ETH_TYPE_89_0d == ethType) - { - - VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - ("TDLS Data Frame \n")) ; - /* Post the message to PE Queue */ - PELOGE(sysLog(pMac, LOGE, FL("posting to TDLS frame to lim\n"));) - - ret = (tSirRetStatus) limPostMsgApi(pMac, pMsg); - if (ret != eSIR_SUCCESS) - { - PELOGE(sysLog(pMac, LOGE, FL("posting to LIM2 failed, \ - ret %d\n"), ret);) - goto fail; - } - else - return eSIR_SUCCESS; - } - /* fall through if ethType != TDLS, which is error case */ -#endif #ifdef FEATURE_WLAN_ESE PELOGW(sysLog(pMac, LOGW, FL("IAPP Frame...\n"));); //Post the message to PE Queue diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c index ed1e60404575..5ee205a222c3 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -19,22 +19,13 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/** - * Copyright (c) 2012 - 2014 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - */ - /** * \file dot11f.c * * \brief Structures, functions & definitions for * working with 802.11 Frames - * - * - * * This file was automatically generated by 'framesc' - * Mon Nov 10 19:49:53 2014 from the following file(s): + * Mon Dec 3 16:47:12 2018 from the following file(s): * * dot11f.frms * @@ -475,7 +466,7 @@ static tANI_U32 GetContainerIesLen(tpAniSirGlobal pCtx, { const tIEDefn *pIe, *pIeFirst; tANI_U8 *pBufRemaining = pBuf; - tANI_U8 len = 0; + tANI_U32 len = 0; (void)pCtx; @@ -488,7 +479,7 @@ static tANI_U32 GetContainerIesLen(tpAniSirGlobal pCtx, len += 2; while ( len < nBuf ) { - if( NULL == (pIe = FindIEDefn(pCtx, pBufRemaining, nBuf + len, IEs))) + if( NULL == (pIe = FindIEDefn(pCtx, pBufRemaining, nBuf - len, IEs))) break; if( pIe->eid == pIeFirst->eid ) break; @@ -496,6 +487,8 @@ static tANI_U32 GetContainerIesLen(tpAniSirGlobal pCtx, pBufRemaining += *(pBufRemaining + 1) + 2; } + if ((len > 0xFF) || (len > nBuf)) + return DOT11F_INTERNAL_ERROR; *pnConsumed = len; return DOT11F_PARSE_SUCCESS; @@ -987,6 +980,11 @@ tANI_U32 dot11fUnpackTlvAuthorizedMACs(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_ { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->mac, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1005,6 +1003,11 @@ tANI_U32 dot11fUnpackTlvVersion2(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 tl tANI_U32 status = DOT11F_PARSE_SUCCESS; tANI_U8 tmp7__; pDst->present = 1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp7__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -1027,6 +1030,11 @@ tANI_U32 dot11fUnpackTlvChannelList(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->countryString, pBuf, 3); pBuf += 3; tlvlen -= (tANI_U8)3; @@ -1056,9 +1064,19 @@ tANI_U32 dot11fUnpackTlvConfigurationTimeout(tpAniSirGlobal pCtx, tANI_U8 *pBuf, { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->GOConfigTimeout = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->CLConfigTimeout = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; @@ -1096,9 +1114,19 @@ tANI_U32 dot11fUnpackTlvExtendedListenTiming(tpAniSirGlobal pCtx, tANI_U8 *pBuf, { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->availibilityPeriod, pBuf, 0); pBuf += 2; tlvlen -= (tANI_U8)2; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->availibilityInterval, pBuf, 0); pBuf += 2; tlvlen -= (tANI_U8)2; @@ -1116,6 +1144,11 @@ tANI_U32 dot11fUnpackTlvIntendedP2PInterfaceAddress(tpAniSirGlobal pCtx, tANI_U8 { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->P2PInterfaceAddress, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1133,12 +1166,27 @@ tANI_U32 dot11fUnpackTlvListenChannel(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->countryString, pBuf, 3); pBuf += 3; tlvlen -= (tANI_U8)3; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->regulatoryClass = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->channel = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; @@ -1216,9 +1264,19 @@ tANI_U32 dot11fUnpackTlvNoticeOfAbsence(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->index = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->CTSWindowOppPS = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; @@ -1242,12 +1300,27 @@ tANI_U32 dot11fUnpackTlvOperatingChannel(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tAN { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->countryString, pBuf, 3); pBuf += 3; tlvlen -= (tANI_U8)3; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->regulatoryClass = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->channel = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; @@ -1262,9 +1335,19 @@ tANI_U32 dot11fUnpackTlvP2PCapability(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->deviceCapability = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->groupCapability = *pBuf; pBuf += 1; tlvlen -= (tANI_U8)1; @@ -1279,6 +1362,11 @@ tANI_U32 dot11fUnpackTlvP2PDeviceId(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1298,12 +1386,27 @@ tANI_U32 dot11fUnpackTlvP2PDeviceInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->configMethod, pBuf, 0); pBuf += 2; tlvlen -= (tANI_U8)2; + if (unlikely(tlvlen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->primaryDeviceType, pBuf, 8); pBuf += 8; tlvlen -= (tANI_U8)8; @@ -1324,6 +1427,11 @@ tANI_U32 dot11fUnpackTlvP2PGroupBssid(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->P2PGroupBssid, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1338,6 +1446,11 @@ tANI_U32 dot11fUnpackTlvP2PGroupId(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->deviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1380,12 +1493,27 @@ tANI_U32 dot11fUnpackTlvPrimaryDeviceType(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA tANI_U32 status = DOT11F_PARSE_SUCCESS; (void)pBuf; (void)tlvlen; /* Shutup the compiler */ pDst->present = 1; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->primary_category, pBuf, 1); pBuf += 2; tlvlen -= (tANI_U8)2; + if (unlikely(tlvlen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->oui, pBuf, 4); pBuf += 4; tlvlen -= (tANI_U8)4; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->sub_category, pBuf, 1); pBuf += 2; tlvlen -= (tANI_U8)2; @@ -1403,12 +1531,27 @@ tANI_U32 dot11fUnpackTlvRequestDeviceType(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->primary_category, pBuf, 1); pBuf += 2; tlvlen -= (tANI_U8)2; + if (unlikely(tlvlen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->oui, pBuf, 4); pBuf += 4; tlvlen -= (tANI_U8)4; + if (unlikely(tlvlen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->sub_category, pBuf, 1); pBuf += 2; tlvlen -= (tANI_U8)2; @@ -1455,6 +1598,11 @@ tANI_U32 dot11fUnpackTlvUUID_E(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 tlvl { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->uuid, pBuf, 16); pBuf += 16; tlvlen -= (tANI_U8)16; @@ -1469,6 +1617,11 @@ tANI_U32 dot11fUnpackTlvUUID_R(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 tlvl { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->uuid, pBuf, 16); pBuf += 16; tlvlen -= (tANI_U8)16; @@ -1490,6 +1643,11 @@ tANI_U32 dot11fUnpackTlvVendorExtension(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->vendorId, pBuf, 3); pBuf += 3; tlvlen -= (tANI_U8)3; @@ -1511,6 +1669,11 @@ tANI_U32 dot11fUnpackTlvVersion(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U16 tlv tANI_U32 status = DOT11F_PARSE_SUCCESS; tANI_U8 tmp8__; pDst->present = 1; + if (unlikely(tlvlen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp8__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -1530,6 +1693,11 @@ tANI_U32 dot11fUnpackTlvP2PInterface(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U1 { tANI_U32 status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (tANI_U8)6; @@ -1569,9 +1737,19 @@ tANI_U32 dot11fUnpackIeBPIndicator(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->indicator = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->type = *pBuf; (void)pCtx; return status; @@ -1586,6 +1764,11 @@ tANI_U32 dot11fUnpackIeCondensedCountryStr(tpAniSirGlobal pCtx, tANI_U8 *pBuf, t (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->countryStr, pBuf, 2); (void)pCtx; return status; @@ -1601,14 +1784,29 @@ tANI_U32 dot11fUnpackIeGTK(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp9__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->keyId = tmp9__ >> 0 & 0x3; pDst->reserved = tmp9__ >> 2 & 0x3feb; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->keyLength = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->RSC, pBuf, 8); pBuf += 8; ielen -= (tANI_U8)8; @@ -1635,15 +1833,35 @@ tANI_U32 dot11fUnpackIeIGTK(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, t (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->keyID, pBuf, 2); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->IPN, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->keyLength = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 24)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->key, pBuf, 24); (void)pCtx; return status; @@ -1658,6 +1876,11 @@ tANI_U32 dot11fUnpackIeLLAttr(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->defer_threshold, pBuf, 1); (void)pCtx; return status; @@ -1672,9 +1895,19 @@ tANI_U32 dot11fUnpackIeLoadBalance(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->channel = *pBuf; (void)pCtx; return status; @@ -1689,9 +1922,19 @@ tANI_U32 dot11fUnpackIeLoadInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->num_stas, pBuf, 1); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->channel_util, pBuf, 1); (void)pCtx; return status; @@ -1709,6 +1952,11 @@ tANI_U32 dot11fUnpackIePropCapability(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->capability, pBuf, 0); (void)pCtx; return status; @@ -1723,15 +1971,35 @@ tANI_U32 dot11fUnpackIePropChannSwitchAnn(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->mode = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->primary_channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->sub_band = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->channel_switch_count = *pBuf; (void)pCtx; return status; @@ -1754,12 +2022,27 @@ tANI_U32 dot11fUnpackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->qos = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reserved = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp10__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1767,14 +2050,29 @@ tANI_U32 dot11fUnpackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U pDst->acbe_acm = tmp10__ >> 4 & 0x1; pDst->acbe_aci = tmp10__ >> 5 & 0x3; pDst->unused1 = tmp10__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp11__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbe_min = tmp11__ >> 0 & 0xf; pDst->acbe_max = tmp11__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbe_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp12__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1782,14 +2080,29 @@ tANI_U32 dot11fUnpackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U pDst->acbk_acm = tmp12__ >> 4 & 0x1; pDst->acbk_aci = tmp12__ >> 5 & 0x3; pDst->unused2 = tmp12__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp13__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbk_min = tmp13__ >> 0 & 0xf; pDst->acbk_max = tmp13__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbk_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp14__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1797,14 +2110,29 @@ tANI_U32 dot11fUnpackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U pDst->acvi_acm = tmp14__ >> 4 & 0x1; pDst->acvi_aci = tmp14__ >> 5 & 0x3; pDst->unused3 = tmp14__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp15__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvi_min = tmp15__ >> 0 & 0xf; pDst->acvi_max = tmp15__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvi_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp16__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1812,11 +2140,21 @@ tANI_U32 dot11fUnpackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U pDst->acvo_acm = tmp16__ >> 4 & 0x1; pDst->acvo_aci = tmp16__ >> 5 & 0x3; pDst->unused4 = tmp16__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp17__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvo_min = tmp17__ >> 0 & 0xf; pDst->acvo_max = tmp17__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvo_txoplimit, pBuf, 0); (void)pCtx; return status; @@ -1831,15 +2169,35 @@ tANI_U32 dot11fUnpackIePropQuietBSS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->quiet_count = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->quiet_period = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->quiet_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->quiet_offset, pBuf, 0); (void)pCtx; return status; @@ -1902,6 +2260,11 @@ tANI_U32 dot11fUnpackIeR1KH_ID(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->PMK_R1_ID, pBuf, 6); (void)pCtx; return status; @@ -1916,9 +2279,19 @@ tANI_U32 dot11fUnpackIeTSFInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->TsfOffset, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->BeaconIntvl, pBuf, 0); (void)pCtx; return status; @@ -1934,12 +2307,27 @@ tANI_U32 dot11fUnpackIeTaurus(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->baTIDBitmap, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->baPolicy, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp18__, pBuf, 0); pDst->baBufferSize = tmp18__ >> 0 & 0xfff; pDst->rsvd = tmp18__ >> 12 & 0xf; @@ -1956,15 +2344,35 @@ tANI_U32 dot11fUnpackIeTitan(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->concat_tcid_bitmap = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->compression_tcid_bitmap = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->cb_state = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->rev_fcs_state = *pBuf; (void)pCtx; return status; @@ -1982,9 +2390,20 @@ tANI_U32 dot11fUnpackIeVersion(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->chip_rev, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + pDst->card_type = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->card_type = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2028,6 +2447,11 @@ tANI_U32 dot11fUnpackIeAPChannelReport(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_ (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->regulatoryClass = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2051,6 +2475,11 @@ tANI_U32 dot11fUnpackIeBcnReportingDetail(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reportingDetail = *pBuf; (void)pCtx; return status; @@ -2085,9 +2514,19 @@ tANI_U32 dot11fUnpackIeBeaconReporting(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_ (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reportingCondition = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->threshold = *pBuf; (void)pCtx; return status; @@ -2102,6 +2541,11 @@ tANI_U32 dot11fUnpackIeMeasurementPilot(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurementPilot = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2120,6 +2564,11 @@ tANI_U32 dot11fUnpackIeMultiBssid(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->maxBSSIDIndicator = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2138,12 +2587,27 @@ tANI_U32 dot11fUnpackIeRICData(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->Identifier = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->resourceDescCount = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->statusCode, pBuf, 0); (void)pCtx; return status; @@ -2158,6 +2622,11 @@ tANI_U32 dot11fUnpackIeRICDescriptor(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->resourceType = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2181,6 +2650,11 @@ tANI_U32 dot11fUnpackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp19__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2192,6 +2666,11 @@ tANI_U32 dot11fUnpackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->BeaconActive = tmp19__ >> 5 & 0x1; pDst->BeaconTable = tmp19__ >> 6 & 0x1; pDst->BeaconRepCond = tmp19__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp20__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2203,6 +2682,11 @@ tANI_U32 dot11fUnpackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->LCIAzimuth = tmp20__ >> 5 & 0x1; pDst->TCMCapability = tmp20__ >> 6 & 0x1; pDst->triggeredTCM = tmp20__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp21__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2210,6 +2694,11 @@ tANI_U32 dot11fUnpackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->RRMMIBEnabled = tmp21__ >> 1 & 0x1; pDst->operatingChanMax = tmp21__ >> 2 & 0x7; pDst->nonOperatinChanMax = tmp21__ >> 5 & 0x7; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp22__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2219,6 +2708,11 @@ tANI_U32 dot11fUnpackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->RCPIMeasurement = tmp22__ >> 5 & 0x1; pDst->RSNIMeasurement = tmp22__ >> 6 & 0x1; pDst->BssAvgAccessDelay = tmp22__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp23__ = *pBuf; pDst->BSSAvailAdmission = tmp23__ >> 0 & 0x1; pDst->AntennaInformation = tmp23__ >> 1 & 0x1; @@ -2276,6 +2770,11 @@ tANI_U32 dot11fUnpackIeSchedule(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp24__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2283,15 +2782,35 @@ tANI_U32 dot11fUnpackIeSchedule(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele pDst->tsid = tmp24__ >> 1 & 0xf; pDst->direction = tmp24__ >> 5 & 0x3; pDst->reserved = tmp24__ >> 7 & 0x1ff; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_interval, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->max_service_dur, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->spec_interval, pBuf, 0); (void)pCtx; return status; @@ -2306,70 +2825,165 @@ tANI_U32 dot11fUnpackIeTCLAS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->user_priority = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->classifier_type = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->classifier_mask = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; switch (pDst->classifier_type) { case 0: + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.source, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.dest, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.EthParams.type, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; break; case 1: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; switch (pDst->info.IpParams.version) { case 4: + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.source, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.dest, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.src_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.DSCP = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.proto = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.reserved = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; break; case 6: + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.source, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.dest, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.src_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.flow_label, pBuf, 3); pBuf += 3; ielen -= (tANI_U8)3; @@ -2377,6 +2991,11 @@ tANI_U32 dot11fUnpackIeTCLAS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, } break; case 2: + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.Params8021dq.tag_type, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; @@ -2398,6 +3017,11 @@ tANI_U32 dot11fUnpackIeTSDelay(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->delay, pBuf, 0); (void)pCtx; return status; @@ -2415,6 +3039,11 @@ tANI_U32 dot11fUnpackIeTSPEC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp25__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2426,55 +3055,135 @@ tANI_U32 dot11fUnpackIeTSPEC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, pDst->psb = tmp25__ >> 10 & 0x1; pDst->user_priority = tmp25__ >> 11 & 0x7; pDst->tsinfo_ack_pol = tmp25__ >> 14 & 0x3; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp26__ = *pBuf; pBuf += 1; ielen -= 1; pDst->schedule = tmp26__ >> 0 & 0x1; pDst->unused = tmp26__ >> 1 & 0x7f; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp27__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->size = tmp27__ >> 0 & 0x7fff; pDst->fixed = tmp27__ >> 15 & 0x1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->max_msdu_size, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_service_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->max_service_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->inactivity_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->suspension_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->mean_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->peak_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->burst_size, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->delay_bound, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_phy_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->surplus_bw_allowance, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->medium_time, pBuf, 0); (void)pCtx; return status; @@ -2490,6 +3199,11 @@ tANI_U32 dot11fUnpackIeWMMSchedule(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2498,6 +3212,11 @@ tANI_U32 dot11fUnpackIeWMMSchedule(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp28__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2505,15 +3224,35 @@ tANI_U32 dot11fUnpackIeWMMSchedule(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i pDst->tsid = tmp28__ >> 1 & 0xf; pDst->direction = tmp28__ >> 5 & 0x3; pDst->reserved = tmp28__ >> 7 & 0x1ff; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_interval, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->max_service_dur, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->spec_interval, pBuf, 0); (void)pCtx; return status; @@ -2528,6 +3267,11 @@ tANI_U32 dot11fUnpackIeWMMTCLAS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2536,70 +3280,165 @@ tANI_U32 dot11fUnpackIeWMMTCLAS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->user_priority = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->classifier_type = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->classifier_mask = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; switch (pDst->classifier_type) { case 0: + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.source, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.dest, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.EthParams.type, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; break; case 1: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; switch (pDst->info.IpParams.version) { case 4: + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.source, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.dest, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.src_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.DSCP = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.proto = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->info.IpParams.params.IpV4Params.reserved = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; break; case 6: + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.source, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.dest, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.src_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.flow_label, pBuf, 3); pBuf += 3; ielen -= (tANI_U8)3; @@ -2607,6 +3446,11 @@ tANI_U32 dot11fUnpackIeWMMTCLAS(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele } break; case 2: + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->info.Params8021dq.tag_type, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; @@ -2625,6 +3469,11 @@ tANI_U32 dot11fUnpackIeWMMTCLASPROC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2633,6 +3482,11 @@ tANI_U32 dot11fUnpackIeWMMTCLASPROC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->processing = *pBuf; (void)pCtx; return status; @@ -2647,6 +3501,11 @@ tANI_U32 dot11fUnpackIeWMMTSDelay(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2655,6 +3514,11 @@ tANI_U32 dot11fUnpackIeWMMTSDelay(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->delay, pBuf, 0); (void)pCtx; return status; @@ -2672,6 +3536,11 @@ tANI_U32 dot11fUnpackIeWMMTSPEC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -2680,6 +3549,11 @@ tANI_U32 dot11fUnpackIeWMMTSPEC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp29__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2691,55 +3565,135 @@ tANI_U32 dot11fUnpackIeWMMTSPEC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele pDst->psb = tmp29__ >> 10 & 0x1; pDst->user_priority = tmp29__ >> 11 & 0x7; pDst->tsinfo_ack_pol = tmp29__ >> 14 & 0x3; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp30__ = *pBuf; pBuf += 1; ielen -= 1; pDst->tsinfo_rsvd = tmp30__ >> 0 & 0x7f; pDst->burst_size_defn = tmp30__ >> 7 & 0x1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &tmp31__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->size = tmp31__ >> 0 & 0x7fff; pDst->fixed = tmp31__ >> 15 & 0x1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->max_msdu_size, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_service_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->max_service_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->inactivity_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->suspension_int, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->mean_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->peak_data_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->burst_size, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->delay_bound, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->min_phy_rate, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->surplus_bw_allowance, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->medium_time, pBuf, 0); (void)pCtx; return status; @@ -2754,6 +3708,11 @@ tANI_U32 dot11fUnpackIeAID(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->assocId, pBuf, 0); (void)pCtx; return status; @@ -2813,15 +3772,35 @@ tANI_U32 dot11fUnpackIeCFParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->cfp_count = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->cfp_period = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->cfp_maxduration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->cfp_durremaining, pBuf, 0); (void)pCtx; return status; @@ -2856,12 +3835,27 @@ tANI_U32 dot11fUnpackIeChanSwitchAnn(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->switchMode = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->newChannel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->switchCount = *pBuf; (void)pCtx; return status; @@ -2876,6 +3870,11 @@ tANI_U32 dot11fUnpackIeCountry(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 3)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->country, pBuf, 3); pBuf += 3; ielen -= (tANI_U8)3; @@ -2918,12 +3917,27 @@ tANI_U32 dot11fUnpackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->qos = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reserved = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp32__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2931,14 +3945,29 @@ tANI_U32 dot11fUnpackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->acbe_acm = tmp32__ >> 4 & 0x1; pDst->acbe_aci = tmp32__ >> 5 & 0x3; pDst->unused1 = tmp32__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp33__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbe_acwmin = tmp33__ >> 0 & 0xf; pDst->acbe_acwmax = tmp33__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbe_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp34__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2946,14 +3975,29 @@ tANI_U32 dot11fUnpackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->acbk_acm = tmp34__ >> 4 & 0x1; pDst->acbk_aci = tmp34__ >> 5 & 0x3; pDst->unused2 = tmp34__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp35__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbk_acwmin = tmp35__ >> 0 & 0xf; pDst->acbk_acwmax = tmp35__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbk_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp36__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2961,14 +4005,29 @@ tANI_U32 dot11fUnpackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->acvi_acm = tmp36__ >> 4 & 0x1; pDst->acvi_aci = tmp36__ >> 5 & 0x3; pDst->unused3 = tmp36__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp37__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvi_acwmin = tmp37__ >> 0 & 0xf; pDst->acvi_acwmax = tmp37__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvi_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp38__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2976,11 +4035,21 @@ tANI_U32 dot11fUnpackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 pDst->acvo_acm = tmp38__ >> 4 & 0x1; pDst->acvo_aci = tmp38__ >> 5 & 0x3; pDst->unused4 = tmp38__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp39__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvo_acwmin = tmp39__ >> 0 & 0xf; pDst->acvo_acwmax = tmp39__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvo_txoplimit, pBuf, 0); (void)pCtx; return status; @@ -2996,6 +4065,11 @@ tANI_U32 dot11fUnpackIeERPInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp40__ = *pBuf; pDst->non_erp_present = tmp40__ >> 0 & 0x1; pDst->use_prot = tmp40__ >> 1 & 0x1; @@ -3035,9 +4109,19 @@ tANI_U32 dot11fUnpackIeESERadMgmtCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->mgmt_state = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + tmp41__ = *pBuf; pDst->mbssid_mask = tmp41__ >> 0 & 0x7; pDst->reserved = tmp41__ >> 3 & 0x1f; @@ -3054,12 +4138,27 @@ tANI_U32 dot11fUnpackIeESETrafStrmMet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->tsid = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->state = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->msmt_interval, pBuf, 0); (void)pCtx; return status; @@ -3074,6 +4173,11 @@ tANI_U32 dot11fUnpackIeESETrafStrmRateSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->tsid = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -3097,9 +4201,19 @@ tANI_U32 dot11fUnpackIeESETxmitPower(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->power_limit = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reserved = *pBuf; (void)pCtx; return status; @@ -3114,6 +4228,11 @@ tANI_U32 dot11fUnpackIeESEVersion(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; (void)pCtx; return status; @@ -3125,70 +4244,21 @@ tANI_U32 dot11fUnpackIeESEVersion(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie tANI_U32 dot11fUnpackIeExtCap(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEExtCap *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U32 tmp42__; - tANI_U16 tmp43__; - tANI_U16 tmp44__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - framesntohl(pCtx, &tmp42__, pBuf, 0); - pBuf += 4; - ielen -= 4; - pDst->bssCoexistMgmtSupport = tmp42__ >> 0 & 0x1; - pDst->reserved1 = tmp42__ >> 1 & 0x1; - pDst->extChanSwitch = tmp42__ >> 2 & 0x1; - pDst->reserved2 = tmp42__ >> 3 & 0x1; - pDst->psmpCap = tmp42__ >> 4 & 0x1; - pDst->reserved3 = tmp42__ >> 5 & 0x1; - pDst->spsmpCap = tmp42__ >> 6 & 0x1; - pDst->event = tmp42__ >> 7 & 0x1; - pDst->diagnostics = tmp42__ >> 8 & 0x1; - pDst->multiDiagnostics = tmp42__ >> 9 & 0x1; - pDst->locTracking = tmp42__ >> 10 & 0x1; - pDst->FMS = tmp42__ >> 11 & 0x1; - pDst->proxyARPService = tmp42__ >> 12 & 0x1; - pDst->coLocIntfReporting = tmp42__ >> 13 & 0x1; - pDst->civicLoc = tmp42__ >> 14 & 0x1; - pDst->geospatialLoc = tmp42__ >> 15 & 0x1; - pDst->TFS = tmp42__ >> 16 & 0x1; - pDst->wnmSleepMode = tmp42__ >> 17 & 0x1; - pDst->timBroadcast = tmp42__ >> 18 & 0x1; - pDst->bssTransition = tmp42__ >> 19 & 0x1; - pDst->qosTrafficCap = tmp42__ >> 20 & 0x1; - pDst->acStaCnt = tmp42__ >> 21 & 0x1; - pDst->multiBSSID = tmp42__ >> 22 & 0x1; - pDst->timingMeas = tmp42__ >> 23 & 0x1; - pDst->chanUsage = tmp42__ >> 24 & 0x1; - pDst->ssidList = tmp42__ >> 25 & 0x1; - pDst->DMS = tmp42__ >> 26 & 0x1; - pDst->UTCTSFOffset = tmp42__ >> 27 & 0x1; - pDst->TDLSPeerUAPSDBufferSTA = tmp42__ >> 28 & 0x1; - pDst->TDLSPeerPSMSupp = tmp42__ >> 29 & 0x1; - pDst->TDLSChannelSwitching = tmp42__ >> 30 & 0x1; - pDst->interworkingService = tmp42__ >> 31 & 0x1; - framesntohs(pCtx, &tmp43__, pBuf, 0); - pBuf += 2; - ielen -= 2; - pDst->qosMap = tmp43__ >> 0 & 0x1; - pDst->EBR = tmp43__ >> 1 & 0x1; - pDst->sspnInterface = tmp43__ >> 2 & 0x1; - pDst->reserved4 = tmp43__ >> 3 & 0x1; - pDst->msgCFCap = tmp43__ >> 4 & 0x1; - pDst->TDLSSupport = tmp43__ >> 5 & 0x1; - pDst->TDLSProhibited = tmp43__ >> 6 & 0x1; - pDst->TDLSChanSwitProhibited = tmp43__ >> 7 & 0x1; - pDst->rejectUnadmittedTraffic = tmp43__ >> 8 & 0x1; - pDst->serviceIntervalGranularity = tmp43__ >> 9 & 0x7; - pDst->identifierLoc = tmp43__ >> 12 & 0x1; - pDst->uapsdCoexistence = tmp43__ >> 13 & 0x1; - pDst->wnmNotification = tmp43__ >> 14 & 0x1; - pDst->reserved5 = tmp43__ >> 15 & 0x1; - framesntohs(pCtx, &tmp44__, pBuf, 0); - pDst->UTF8SSID = tmp44__ >> 0 & 0x1; - pDst->reserved6 = tmp44__ >> 1 & 0xfff; - pDst->TDLSWiderBW = tmp44__ >> 13 & 0x1; - pDst->operModeNotification = tmp44__ >> 14 & 0x1; - pDst->reserved7 = tmp44__ >> 15 & 0x1; + + if (!ielen) /* Check to ensure copying of ielen bytes */ + goto endUnpackIeExtCap; + pDst->num_bytes = (tANI_U8)( ielen ); + if (ielen > 9){ + pDst->present = 0; + return DOT11F_SKIPPED_BAD_IE; + } + + DOT11F_MEMCPY(pCtx, pDst->bytes, pBuf, ( ielen ) ); + +endUnpackIeExtCap: (void)pCtx; return status; } /* End dot11fUnpackIeExtCap. */ @@ -3233,15 +4303,35 @@ tANI_U32 dot11fUnpackIeFHParamSet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->dwell_time, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->hop_set = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->hop_pattern = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->hop_index = *pBuf; (void)pCtx; return status; @@ -3256,9 +4346,19 @@ tANI_U32 dot11fUnpackIeFHParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->radix = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->nchannels = *pBuf; (void)pCtx; return status; @@ -3273,15 +4373,35 @@ tANI_U32 dot11fUnpackIeFHPattTable(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->flag = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->nsets = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->modulus = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->offset = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -3314,21 +4434,41 @@ tANI_U32 dot11fUnpackIeFHPattTable(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i tANI_U32 dot11fUnpackIeFTInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEFTInfo *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U16 tmp45__; + tANI_U16 tmp42__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - framesntohs(pCtx, &tmp45__, pBuf, 0); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp42__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->reserved = tmp45__ >> 0 & 0xff; - pDst->IECount = tmp45__ >> 8 & 0xff; + pDst->reserved = tmp42__ >> 0 & 0xff; + pDst->IECount = tmp42__ >> 8 & 0xff; + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->MIC, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; + if (unlikely(ielen < 32)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->Anonce, pBuf, 32); pBuf += 32; ielen -= (tANI_U8)32; + if (unlikely(ielen < 32)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->Snonce, pBuf, 32); pBuf += 32; ielen -= (tANI_U8)32; @@ -3349,17 +4489,22 @@ tANI_U32 dot11fUnpackIeFTInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tANI_U32 dot11fUnpackIeHT2040BSSCoexistence(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEHT2040BSSCoexistence *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp46__; + tANI_U8 tmp43__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - tmp46__ = *pBuf; - pDst->infoRequest = tmp46__ >> 0 & 0x1; - pDst->fortyMHzIntolerant = tmp46__ >> 1 & 0x1; - pDst->twentyMHzBssWidthReq = tmp46__ >> 2 & 0x1; - pDst->obssScanExemptionReq = tmp46__ >> 3 & 0x1; - pDst->obssScanExemptionGrant = tmp46__ >> 4 & 0x1; - pDst->unused = tmp46__ >> 5 & 0x7; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp43__ = *pBuf; + pDst->infoRequest = tmp43__ >> 0 & 0x1; + pDst->fortyMHzIntolerant = tmp43__ >> 1 & 0x1; + pDst->twentyMHzBssWidthReq = tmp43__ >> 2 & 0x1; + pDst->obssScanExemptionReq = tmp43__ >> 3 & 0x1; + pDst->obssScanExemptionGrant = tmp43__ >> 4 & 0x1; + pDst->unused = tmp43__ >> 5 & 0x7; (void)pCtx; return status; } /* End dot11fUnpackIeHT2040BSSCoexistence. */ @@ -3373,6 +4518,11 @@ tANI_U32 dot11fUnpackIeHT2040BSSIntolerantReport(tpAniSirGlobal pCtx, tANI_U8 *p (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->operatingClass = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -3393,78 +4543,108 @@ tANI_U32 dot11fUnpackIeHT2040BSSIntolerantReport(tpAniSirGlobal pCtx, tANI_U8 *p tANI_U32 dot11fUnpackIeHTCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEHTCaps *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U16 tmp47__; + tANI_U16 tmp44__; + tANI_U8 tmp45__; + tANI_U16 tmp46__; + tANI_U32 tmp47__; tANI_U8 tmp48__; - tANI_U16 tmp49__; - tANI_U32 tmp50__; - tANI_U8 tmp51__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - framesntohs(pCtx, &tmp47__, pBuf, 0); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp44__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->advCodingCap = tmp47__ >> 0 & 0x1; - pDst->supportedChannelWidthSet = tmp47__ >> 1 & 0x1; - pDst->mimoPowerSave = tmp47__ >> 2 & 0x3; - pDst->greenField = tmp47__ >> 4 & 0x1; - pDst->shortGI20MHz = tmp47__ >> 5 & 0x1; - pDst->shortGI40MHz = tmp47__ >> 6 & 0x1; - pDst->txSTBC = tmp47__ >> 7 & 0x1; - pDst->rxSTBC = tmp47__ >> 8 & 0x3; - pDst->delayedBA = tmp47__ >> 10 & 0x1; - pDst->maximalAMSDUsize = tmp47__ >> 11 & 0x1; - pDst->dsssCckMode40MHz = tmp47__ >> 12 & 0x1; - pDst->psmp = tmp47__ >> 13 & 0x1; - pDst->stbcControlFrame = tmp47__ >> 14 & 0x1; - pDst->lsigTXOPProtection = tmp47__ >> 15 & 0x1; - tmp48__ = *pBuf; + pDst->advCodingCap = tmp44__ >> 0 & 0x1; + pDst->supportedChannelWidthSet = tmp44__ >> 1 & 0x1; + pDst->mimoPowerSave = tmp44__ >> 2 & 0x3; + pDst->greenField = tmp44__ >> 4 & 0x1; + pDst->shortGI20MHz = tmp44__ >> 5 & 0x1; + pDst->shortGI40MHz = tmp44__ >> 6 & 0x1; + pDst->txSTBC = tmp44__ >> 7 & 0x1; + pDst->rxSTBC = tmp44__ >> 8 & 0x3; + pDst->delayedBA = tmp44__ >> 10 & 0x1; + pDst->maximalAMSDUsize = tmp44__ >> 11 & 0x1; + pDst->dsssCckMode40MHz = tmp44__ >> 12 & 0x1; + pDst->psmp = tmp44__ >> 13 & 0x1; + pDst->stbcControlFrame = tmp44__ >> 14 & 0x1; + pDst->lsigTXOPProtection = tmp44__ >> 15 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp45__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->maxRxAMPDUFactor = tmp48__ >> 0 & 0x3; - pDst->mpduDensity = tmp48__ >> 2 & 0x7; - pDst->reserved1 = tmp48__ >> 5 & 0x7; + pDst->maxRxAMPDUFactor = tmp45__ >> 0 & 0x3; + pDst->mpduDensity = tmp45__ >> 2 & 0x7; + pDst->reserved1 = tmp45__ >> 5 & 0x7; + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->supportedMCSSet, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; - framesntohs(pCtx, &tmp49__, pBuf, 0); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp46__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->pco = tmp49__ >> 0 & 0x1; - pDst->transitionTime = tmp49__ >> 1 & 0x3; - pDst->reserved2 = tmp49__ >> 3 & 0x1f; - pDst->mcsFeedback = tmp49__ >> 8 & 0x3; - pDst->reserved3 = tmp49__ >> 10 & 0x3f; - framesntohl(pCtx, &tmp50__, pBuf, 0); + pDst->pco = tmp46__ >> 0 & 0x1; + pDst->transitionTime = tmp46__ >> 1 & 0x3; + pDst->reserved2 = tmp46__ >> 3 & 0x1f; + pDst->mcsFeedback = tmp46__ >> 8 & 0x3; + pDst->reserved3 = tmp46__ >> 10 & 0x3f; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohl(pCtx, &tmp47__, pBuf, 0); pBuf += 4; ielen -= 4; - pDst->txBF = tmp50__ >> 0 & 0x1; - pDst->rxStaggeredSounding = tmp50__ >> 1 & 0x1; - pDst->txStaggeredSounding = tmp50__ >> 2 & 0x1; - pDst->rxZLF = tmp50__ >> 3 & 0x1; - pDst->txZLF = tmp50__ >> 4 & 0x1; - pDst->implicitTxBF = tmp50__ >> 5 & 0x1; - pDst->calibration = tmp50__ >> 6 & 0x3; - pDst->explicitCSITxBF = tmp50__ >> 8 & 0x1; - pDst->explicitUncompressedSteeringMatrix = tmp50__ >> 9 & 0x1; - pDst->explicitBFCSIFeedback = tmp50__ >> 10 & 0x7; - pDst->explicitUncompressedSteeringMatrixFeedback = tmp50__ >> 13 & 0x7; - pDst->explicitCompressedSteeringMatrixFeedback = tmp50__ >> 16 & 0x7; - pDst->csiNumBFAntennae = tmp50__ >> 19 & 0x3; - pDst->uncompressedSteeringMatrixBFAntennae = tmp50__ >> 21 & 0x3; - pDst->compressedSteeringMatrixBFAntennae = tmp50__ >> 23 & 0x3; - pDst->reserved4 = tmp50__ >> 25 & 0x7f; - tmp51__ = *pBuf; + pDst->txBF = tmp47__ >> 0 & 0x1; + pDst->rxStaggeredSounding = tmp47__ >> 1 & 0x1; + pDst->txStaggeredSounding = tmp47__ >> 2 & 0x1; + pDst->rxZLF = tmp47__ >> 3 & 0x1; + pDst->txZLF = tmp47__ >> 4 & 0x1; + pDst->implicitTxBF = tmp47__ >> 5 & 0x1; + pDst->calibration = tmp47__ >> 6 & 0x3; + pDst->explicitCSITxBF = tmp47__ >> 8 & 0x1; + pDst->explicitUncompressedSteeringMatrix = tmp47__ >> 9 & 0x1; + pDst->explicitBFCSIFeedback = tmp47__ >> 10 & 0x7; + pDst->explicitUncompressedSteeringMatrixFeedback = tmp47__ >> 13 & 0x7; + pDst->explicitCompressedSteeringMatrixFeedback = tmp47__ >> 16 & 0x7; + pDst->csiNumBFAntennae = tmp47__ >> 19 & 0x3; + pDst->uncompressedSteeringMatrixBFAntennae = tmp47__ >> 21 & 0x3; + pDst->compressedSteeringMatrixBFAntennae = tmp47__ >> 23 & 0x3; + pDst->reserved4 = tmp47__ >> 25 & 0x7f; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp48__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->antennaSelection = tmp51__ >> 0 & 0x1; - pDst->explicitCSIFeedbackTx = tmp51__ >> 1 & 0x1; - pDst->antennaIndicesFeedbackTx = tmp51__ >> 2 & 0x1; - pDst->explicitCSIFeedback = tmp51__ >> 3 & 0x1; - pDst->antennaIndicesFeedback = tmp51__ >> 4 & 0x1; - pDst->rxAS = tmp51__ >> 5 & 0x1; - pDst->txSoundingPPDUs = tmp51__ >> 6 & 0x1; - pDst->reserved5 = tmp51__ >> 7 & 0x1; + pDst->antennaSelection = tmp48__ >> 0 & 0x1; + pDst->explicitCSIFeedbackTx = tmp48__ >> 1 & 0x1; + pDst->antennaIndicesFeedbackTx = tmp48__ >> 2 & 0x1; + pDst->explicitCSIFeedback = tmp48__ >> 3 & 0x1; + pDst->antennaIndicesFeedback = tmp48__ >> 4 & 0x1; + pDst->rxAS = tmp48__ >> 5 & 0x1; + pDst->txSoundingPPDUs = tmp48__ >> 6 & 0x1; + pDst->reserved5 = tmp48__ >> 7 & 0x1; pDst->num_rsvd = (tANI_U8)( ielen ); if (ielen > 32){ pDst->present = 0; @@ -3482,41 +4662,66 @@ tANI_U32 dot11fUnpackIeHTCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tANI_U32 dot11fUnpackIeHTInfo(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEHTInfo *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp52__; - tANI_U16 tmp53__; - tANI_U16 tmp54__; + tANI_U8 tmp49__; + tANI_U16 tmp50__; + tANI_U16 tmp51__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->primaryChannel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp52__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp49__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->secondaryChannelOffset = tmp52__ >> 0 & 0x3; - pDst->recommendedTxWidthSet = tmp52__ >> 2 & 0x1; - pDst->rifsMode = tmp52__ >> 3 & 0x1; - pDst->controlledAccessOnly = tmp52__ >> 4 & 0x1; - pDst->serviceIntervalGranularity = tmp52__ >> 5 & 0x7; - framesntohs(pCtx, &tmp53__, pBuf, 0); + pDst->secondaryChannelOffset = tmp49__ >> 0 & 0x3; + pDst->recommendedTxWidthSet = tmp49__ >> 2 & 0x1; + pDst->rifsMode = tmp49__ >> 3 & 0x1; + pDst->controlledAccessOnly = tmp49__ >> 4 & 0x1; + pDst->serviceIntervalGranularity = tmp49__ >> 5 & 0x7; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp50__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->opMode = tmp53__ >> 0 & 0x3; - pDst->nonGFDevicesPresent = tmp53__ >> 2 & 0x1; - pDst->transmitBurstLimit = tmp53__ >> 3 & 0x1; - pDst->obssNonHTStaPresent = tmp53__ >> 4 & 0x1; - pDst->reserved = tmp53__ >> 5 & 0x7ff; - framesntohs(pCtx, &tmp54__, pBuf, 0); + pDst->opMode = tmp50__ >> 0 & 0x3; + pDst->nonGFDevicesPresent = tmp50__ >> 2 & 0x1; + pDst->transmitBurstLimit = tmp50__ >> 3 & 0x1; + pDst->obssNonHTStaPresent = tmp50__ >> 4 & 0x1; + pDst->reserved = tmp50__ >> 5 & 0x7ff; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp51__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->basicSTBCMCS = tmp54__ >> 0 & 0x7f; - pDst->dualCTSProtection = tmp54__ >> 7 & 0x1; - pDst->secondaryBeacon = tmp54__ >> 8 & 0x1; - pDst->lsigTXOPProtectionFullSupport = tmp54__ >> 9 & 0x1; - pDst->pcoActive = tmp54__ >> 10 & 0x1; - pDst->pcoPhase = tmp54__ >> 11 & 0x1; - pDst->reserved2 = tmp54__ >> 12 & 0xf; + pDst->basicSTBCMCS = tmp51__ >> 0 & 0x7f; + pDst->dualCTSProtection = tmp51__ >> 7 & 0x1; + pDst->secondaryBeacon = tmp51__ >> 8 & 0x1; + pDst->lsigTXOPProtectionFullSupport = tmp51__ >> 9 & 0x1; + pDst->pcoActive = tmp51__ >> 10 & 0x1; + pDst->pcoPhase = tmp51__ >> 11 & 0x1; + pDst->reserved2 = tmp51__ >> 12 & 0xf; + if (unlikely(ielen < 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->basicMCSSet, pBuf, 16); pBuf += 16; ielen -= (tANI_U8)16; @@ -3540,6 +4745,11 @@ tANI_U32 dot11fUnpackIeIBSSParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->atim, pBuf, 0); (void)pCtx; return status; @@ -3554,12 +4764,27 @@ tANI_U32 dot11fUnpackIeLinkIdentifier(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->InitStaAddr, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->RespStaAddr, pBuf, 6); (void)pCtx; return status; @@ -3580,22 +4805,37 @@ static const tIEDefn IES_reportBeacon[ ] = { tANI_U32 dot11fUnpackIeMeasurementReport(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEMeasurementReport *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp55__; - tANI_U8 tmp56__; - tANI_U8 tmp57__; + tANI_U8 tmp52__; + tANI_U8 tmp53__; + tANI_U8 tmp54__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->token = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp55__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp52__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->late = tmp55__ >> 0 & 0x1; - pDst->incapable = tmp55__ >> 1 & 0x1; - pDst->refused = tmp55__ >> 2 & 0x1; - pDst->unused = tmp55__ >> 3 & 0x1f; + pDst->late = tmp52__ >> 0 & 0x1; + pDst->incapable = tmp52__ >> 1 & 0x1; + pDst->refused = tmp52__ >> 2 & 0x1; + pDst->unused = tmp52__ >> 3 & 0x1f; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->type = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -3608,104 +4848,249 @@ tANI_U32 dot11fUnpackIeMeasurementReport(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tAN switch (pDst->type) { case 0: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Basic.channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohq(pCtx, &pDst->report.Basic.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->report.Basic.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp56__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp53__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->report.Basic.bss = tmp56__ >> 0 & 0x1; - pDst->report.Basic.ofdm_preamble = tmp56__ >> 1 & 0x1; - pDst->report.Basic.unid_signal = tmp56__ >> 2 & 0x1; - pDst->report.Basic.rader = tmp56__ >> 3 & 0x1; - pDst->report.Basic.unmeasured = tmp56__ >> 4 & 0x1; - pDst->report.Basic.unused = tmp56__ >> 5 & 0x7; + pDst->report.Basic.bss = tmp53__ >> 0 & 0x1; + pDst->report.Basic.ofdm_preamble = tmp53__ >> 1 & 0x1; + pDst->report.Basic.unid_signal = tmp53__ >> 2 & 0x1; + pDst->report.Basic.rader = tmp53__ >> 3 & 0x1; + pDst->report.Basic.unmeasured = tmp53__ >> 4 & 0x1; + pDst->report.Basic.unused = tmp53__ >> 5 & 0x7; break; case 1: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.CCA.channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohq(pCtx, &pDst->report.CCA.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->report.CCA.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.CCA.cca_busy_fraction = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; break; case 2: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohq(pCtx, &pDst->report.RPIHistogram.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->report.RPIHistogram.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi0_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi1_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi2_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi3_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi4_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi5_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi6_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.RPIHistogram.rpi7_density = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; break; case 5: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Beacon.regClass = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Beacon.channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohq(pCtx, &pDst->report.Beacon.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->report.Beacon.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp57__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp54__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->report.Beacon.condensed_PHY = tmp57__ >> 0 & 0x7f; - pDst->report.Beacon.reported_frame_type = tmp57__ >> 7 & 0x1; + pDst->report.Beacon.condensed_PHY = tmp54__ >> 0 & 0x7f; + pDst->report.Beacon.reported_frame_type = tmp54__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Beacon.RCPI = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Beacon.RSNI = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->report.Beacon.BSSID, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->report.Beacon.antenna_id = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->report.Beacon.parent_TSF, pBuf, 0); pBuf += 4; ielen -= (tANI_U8)4; @@ -3742,76 +5127,166 @@ static const tIEDefn IES_measurement_requestBeacon[ ] = { tANI_U32 dot11fUnpackIeMeasurementRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEMeasurementRequest *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp58__; + tANI_U8 tmp55__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_token = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp58__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp55__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->parallel = tmp58__ >> 0 & 0x1; - pDst->enable = tmp58__ >> 1 & 0x1; - pDst->request = tmp58__ >> 2 & 0x1; - pDst->report = tmp58__ >> 3 & 0x1; - pDst->durationMandatory = tmp58__ >> 4 & 0x1; - pDst->unused = tmp58__ >> 5 & 0x7; + pDst->parallel = tmp55__ >> 0 & 0x1; + pDst->enable = tmp55__ >> 1 & 0x1; + pDst->request = tmp55__ >> 2 & 0x1; + pDst->report = tmp55__ >> 3 & 0x1; + pDst->durationMandatory = tmp55__ >> 4 & 0x1; + pDst->unused = tmp55__ >> 5 & 0x7; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_type = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; switch (pDst->measurement_type) { case 0: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.Basic.channel_no = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->measurement_request.Basic.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->measurement_request.Basic.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; break; case 1: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.CCA.channel_no = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->measurement_request.CCA.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->measurement_request.CCA.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; break; case 2: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.RPIHistogram.channel_no = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 8)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->measurement_request.RPIHistogram.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (tANI_U8)8; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->measurement_request.RPIHistogram.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; break; case 5: + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.Beacon.regClass = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.Beacon.channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->measurement_request.Beacon.randomization, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->measurement_request.Beacon.meas_duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->measurement_request.Beacon.meas_mode = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->measurement_request.Beacon.BSSID, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; @@ -3834,17 +5309,27 @@ tANI_U32 dot11fUnpackIeMeasurementRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA tANI_U32 dot11fUnpackIeMobilityDomain(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEMobilityDomain *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp59__; + tANI_U8 tmp56__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->MDID, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp59__ = *pBuf; - pDst->overDSCap = tmp59__ >> 0 & 0x1; - pDst->resourceReqCap = tmp59__ >> 1 & 0x1; - pDst->reserved = tmp59__ >> 2 & 0x3f; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp56__ = *pBuf; + pDst->overDSCap = tmp56__ >> 0 & 0x1; + pDst->resourceReqCap = tmp56__ >> 1 & 0x1; + pDst->reserved = tmp56__ >> 2 & 0x3f; (void)pCtx; return status; } /* End dot11fUnpackIeMobilityDomain. */ @@ -3868,40 +5353,75 @@ tANI_U32 dot11fUnpackIeMobilityDomain(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U tANI_U32 dot11fUnpackIeNeighborReport(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIENeighborReport *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp60__; - tANI_U8 tmp61__; + tANI_U8 tmp57__; + tANI_U8 tmp58__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (tANI_U8)6; - tmp60__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp57__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->APReachability = tmp60__ >> 0 & 0x3; - pDst->Security = tmp60__ >> 2 & 0x1; - pDst->KeyScope = tmp60__ >> 3 & 0x1; - pDst->SpecMgmtCap = tmp60__ >> 4 & 0x1; - pDst->QosCap = tmp60__ >> 5 & 0x1; - pDst->apsd = tmp60__ >> 6 & 0x1; - pDst->rrm = tmp60__ >> 7 & 0x1; - tmp61__ = *pBuf; + pDst->APReachability = tmp57__ >> 0 & 0x3; + pDst->Security = tmp57__ >> 2 & 0x1; + pDst->KeyScope = tmp57__ >> 3 & 0x1; + pDst->SpecMgmtCap = tmp57__ >> 4 & 0x1; + pDst->QosCap = tmp57__ >> 5 & 0x1; + pDst->apsd = tmp57__ >> 6 & 0x1; + pDst->rrm = tmp57__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp58__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->DelayedBA = tmp61__ >> 0 & 0x1; - pDst->ImmBA = tmp61__ >> 1 & 0x1; - pDst->MobilityDomain = tmp61__ >> 2 & 0x1; - pDst->reserved = tmp61__ >> 3 & 0x1f; + pDst->DelayedBA = tmp58__ >> 0 & 0x1; + pDst->ImmBA = tmp58__ >> 1 & 0x1; + pDst->MobilityDomain = tmp58__ >> 2 & 0x1; + pDst->reserved = tmp58__ >> 3 & 0x1f; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->reserved1, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->regulatoryClass = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->channel = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->PhyType = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -3925,24 +5445,59 @@ tANI_U32 dot11fUnpackIeOBSSScanParameters(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->obssScanPassiveDwell, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->obssScanActiveDwell, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->bssChannelWidthTriggerScanInterval, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->obssScanPassiveTotalPerChannel, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->obssScanActiveTotalPerChannel, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->bssWidthChannelTransitionDelayFactor, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->obssScanActivityThreshold, pBuf, 0); (void)pCtx; return status; @@ -3954,15 +5509,20 @@ tANI_U32 dot11fUnpackIeOBSSScanParameters(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tA tANI_U32 dot11fUnpackIeOperatingMode(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEOperatingMode *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp62__; + tANI_U8 tmp59__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - tmp62__ = *pBuf; - pDst->chanWidth = tmp62__ >> 0 & 0x3; - pDst->reserved = tmp62__ >> 2 & 0x3; - pDst->rxNSS = tmp62__ >> 4 & 0x7; - pDst->rxNSSType = tmp62__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp59__ = *pBuf; + pDst->chanWidth = tmp59__ >> 0 & 0x3; + pDst->reserved = tmp59__ >> 2 & 0x3; + pDst->rxNSS = tmp59__ >> 4 & 0x7; + pDst->rxNSSType = tmp59__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeOperatingMode. */ @@ -4389,9 +5949,19 @@ tANI_U32 dot11fUnpackIePTIControl(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->tid = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->sequence_control, pBuf, 0); (void)pCtx; return status; @@ -4403,16 +5973,21 @@ tANI_U32 dot11fUnpackIePTIControl(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ie tANI_U32 dot11fUnpackIePUBufferStatus(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEPUBufferStatus *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp63__; + tANI_U8 tmp60__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - tmp63__ = *pBuf; - pDst->ac_bk_traffic_aval = tmp63__ >> 0 & 0x1; - pDst->ac_be_traffic_aval = tmp63__ >> 1 & 0x1; - pDst->ac_vi_traffic_aval = tmp63__ >> 2 & 0x1; - pDst->ac_vo_traffic_aval = tmp63__ >> 3 & 0x1; - pDst->reserved = tmp63__ >> 4 & 0xf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp60__ = *pBuf; + pDst->ac_bk_traffic_aval = tmp60__ >> 0 & 0x1; + pDst->ac_be_traffic_aval = tmp60__ >> 1 & 0x1; + pDst->ac_vi_traffic_aval = tmp60__ >> 2 & 0x1; + pDst->ac_vo_traffic_aval = tmp60__ >> 3 & 0x1; + pDst->reserved = tmp60__ >> 4 & 0xf; (void)pCtx; return status; } /* End dot11fUnpackIePUBufferStatus. */ @@ -4426,9 +6001,19 @@ tANI_U32 dot11fUnpackIePowerCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->minTxPower = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->maxTxPower = *pBuf; (void)pCtx; return status; @@ -4443,6 +6028,11 @@ tANI_U32 dot11fUnpackIePowerConstraints(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->localPowerConstraints = *pBuf; (void)pCtx; return status; @@ -4457,12 +6047,27 @@ tANI_U32 dot11fUnpackIeQBSSLoad(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->stacount, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->chautil = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->avail, pBuf, 0); (void)pCtx; return status; @@ -4474,16 +6079,21 @@ tANI_U32 dot11fUnpackIeQBSSLoad(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iele tANI_U32 dot11fUnpackIeQOSCapsAp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEQOSCapsAp *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp64__; + tANI_U8 tmp61__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - tmp64__ = *pBuf; - pDst->count = tmp64__ >> 0 & 0xf; - pDst->qack = tmp64__ >> 4 & 0x1; - pDst->qreq = tmp64__ >> 5 & 0x1; - pDst->txopreq = tmp64__ >> 6 & 0x1; - pDst->reserved = tmp64__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp61__ = *pBuf; + pDst->count = tmp61__ >> 0 & 0xf; + pDst->qack = tmp61__ >> 4 & 0x1; + pDst->qreq = tmp61__ >> 5 & 0x1; + pDst->txopreq = tmp61__ >> 6 & 0x1; + pDst->reserved = tmp61__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeQOSCapsAp. */ @@ -4494,18 +6104,23 @@ tANI_U32 dot11fUnpackIeQOSCapsAp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel tANI_U32 dot11fUnpackIeQOSCapsStation(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEQOSCapsStation *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp65__; + tANI_U8 tmp62__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - tmp65__ = *pBuf; - pDst->acvo_uapsd = tmp65__ >> 0 & 0x1; - pDst->acvi_uapsd = tmp65__ >> 1 & 0x1; - pDst->acbk_uapsd = tmp65__ >> 2 & 0x1; - pDst->acbe_uapsd = tmp65__ >> 3 & 0x1; - pDst->qack = tmp65__ >> 4 & 0x1; - pDst->max_sp_length = tmp65__ >> 5 & 0x3; - pDst->more_data_ack = tmp65__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp62__ = *pBuf; + pDst->acvo_uapsd = tmp62__ >> 0 & 0x1; + pDst->acvi_uapsd = tmp62__ >> 1 & 0x1; + pDst->acbk_uapsd = tmp62__ >> 2 & 0x1; + pDst->acbe_uapsd = tmp62__ >> 3 & 0x1; + pDst->qack = tmp62__ >> 4 & 0x1; + pDst->max_sp_length = tmp62__ >> 5 & 0x3; + pDst->more_data_ack = tmp62__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeQOSCapsStation. */ @@ -4539,15 +6154,35 @@ tANI_U32 dot11fUnpackIeQuiet(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->count = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->period = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->duration, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->offset, pBuf, 0); (void)pCtx; return status; @@ -4562,6 +6197,11 @@ tANI_U32 dot11fUnpackIeRCPIIE(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->rcpi = *pBuf; (void)pCtx; return status; @@ -4616,6 +6256,11 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; @@ -4624,6 +6269,11 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->gp_cipher_suite, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; @@ -4636,10 +6286,20 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->pwise_cipher_suite_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->pwise_cipher_suite_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->pwise_cipher_suite_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4656,10 +6316,20 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->akm_suite_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->akm_suite_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->akm_suite_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4675,6 +6345,11 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->RSN_Cap, pBuf, 2); pBuf += 2; ielen -= (tANI_U8)2; @@ -4686,10 +6361,20 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->pmkid_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->pmkid_count * 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->pmkid_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4704,6 +6389,11 @@ tANI_U32 dot11fUnpackIeRSN(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->gp_mgmt_cipher_suite, pBuf, 4); } (void)pCtx; @@ -4719,6 +6409,11 @@ tANI_U32 dot11fUnpackIeRSNIIE(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->rsni = *pBuf; (void)pCtx; return status; @@ -4821,12 +6516,27 @@ tANI_U32 dot11fUnpackIeTIM(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->dtim_count = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->dtim_period = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->bmpctl = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -4850,9 +6560,19 @@ tANI_U32 dot11fUnpackIeTPCReport(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->tx_power = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->link_margin = *pBuf; (void)pCtx; return status; @@ -4880,9 +6600,19 @@ tANI_U32 dot11fUnpackIeTimeoutInterval(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_ (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->timeoutType = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohl(pCtx, &pDst->timeoutValue, pBuf, 0); (void)pCtx; return status; @@ -4894,49 +6624,74 @@ tANI_U32 dot11fUnpackIeTimeoutInterval(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_ tANI_U32 dot11fUnpackIeVHTCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEVHTCaps *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U32 tmp66__; - tANI_U16 tmp67__; - tANI_U16 tmp68__; + tANI_U32 tmp63__; + tANI_U16 tmp64__; + tANI_U16 tmp65__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - framesntohl(pCtx, &tmp66__, pBuf, 0); + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohl(pCtx, &tmp63__, pBuf, 0); pBuf += 4; ielen -= 4; - pDst->maxMPDULen = tmp66__ >> 0 & 0x3; - pDst->supportedChannelWidthSet = tmp66__ >> 2 & 0x3; - pDst->ldpcCodingCap = tmp66__ >> 4 & 0x1; - pDst->shortGI80MHz = tmp66__ >> 5 & 0x1; - pDst->shortGI160and80plus80MHz = tmp66__ >> 6 & 0x1; - pDst->txSTBC = tmp66__ >> 7 & 0x1; - pDst->rxSTBC = tmp66__ >> 8 & 0x7; - pDst->suBeamFormerCap = tmp66__ >> 11 & 0x1; - pDst->suBeamformeeCap = tmp66__ >> 12 & 0x1; - pDst->csnofBeamformerAntSup = tmp66__ >> 13 & 0x7; - pDst->numSoundingDim = tmp66__ >> 16 & 0x7; - pDst->muBeamformerCap = tmp66__ >> 19 & 0x1; - pDst->muBeamformeeCap = tmp66__ >> 20 & 0x1; - pDst->vhtTXOPPS = tmp66__ >> 21 & 0x1; - pDst->htcVHTCap = tmp66__ >> 22 & 0x1; - pDst->maxAMPDULenExp = tmp66__ >> 23 & 0x7; - pDst->vhtLinkAdaptCap = tmp66__ >> 26 & 0x3; - pDst->rxAntPattern = tmp66__ >> 28 & 0x1; - pDst->txAntPattern = tmp66__ >> 29 & 0x1; - pDst->reserved1 = tmp66__ >> 30 & 0x3; + pDst->maxMPDULen = tmp63__ >> 0 & 0x3; + pDst->supportedChannelWidthSet = tmp63__ >> 2 & 0x3; + pDst->ldpcCodingCap = tmp63__ >> 4 & 0x1; + pDst->shortGI80MHz = tmp63__ >> 5 & 0x1; + pDst->shortGI160and80plus80MHz = tmp63__ >> 6 & 0x1; + pDst->txSTBC = tmp63__ >> 7 & 0x1; + pDst->rxSTBC = tmp63__ >> 8 & 0x7; + pDst->suBeamFormerCap = tmp63__ >> 11 & 0x1; + pDst->suBeamformeeCap = tmp63__ >> 12 & 0x1; + pDst->csnofBeamformerAntSup = tmp63__ >> 13 & 0x7; + pDst->numSoundingDim = tmp63__ >> 16 & 0x7; + pDst->muBeamformerCap = tmp63__ >> 19 & 0x1; + pDst->muBeamformeeCap = tmp63__ >> 20 & 0x1; + pDst->vhtTXOPPS = tmp63__ >> 21 & 0x1; + pDst->htcVHTCap = tmp63__ >> 22 & 0x1; + pDst->maxAMPDULenExp = tmp63__ >> 23 & 0x7; + pDst->vhtLinkAdaptCap = tmp63__ >> 26 & 0x3; + pDst->rxAntPattern = tmp63__ >> 28 & 0x1; + pDst->txAntPattern = tmp63__ >> 29 & 0x1; + pDst->reserved1 = tmp63__ >> 30 & 0x3; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->rxMCSMap, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - framesntohs(pCtx, &tmp67__, pBuf, 0); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp64__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->rxHighSupDataRate = tmp67__ >> 0 & 0x1fff; - pDst->reserved2 = tmp67__ >> 13 & 0x7; + pDst->rxHighSupDataRate = tmp64__ >> 0 & 0x1fff; + pDst->reserved2 = tmp64__ >> 13 & 0x7; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->txMCSMap, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - framesntohs(pCtx, &tmp68__, pBuf, 0); - pDst->txSupDataRate = tmp68__ >> 0 & 0x1fff; - pDst->reserved3 = tmp68__ >> 13 & 0x7; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp65__, pBuf, 0); + pDst->txSupDataRate = tmp65__ >> 0 & 0x1fff; + pDst->reserved3 = tmp65__ >> 13 & 0x7; (void)pCtx; return status; } /* End dot11fUnpackIeVHTCaps. */ @@ -4950,18 +6705,43 @@ tANI_U32 dot11fUnpackIeVHTExtBssLoad(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->muMIMOCapStaCount = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->ssUnderUtil = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->FortyMHzUtil = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->EightyMHzUtil = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->OneSixtyMHzUtil = *pBuf; (void)pCtx; return status; @@ -4976,15 +6756,35 @@ tANI_U32 dot11fUnpackIeVHTOperation(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->chanWidth = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->chanCenterFreqSeg1 = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->chanCenterFreqSeg2 = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->basicMCSSet, pBuf, 0); (void)pCtx; return status; @@ -4996,10 +6796,15 @@ tANI_U32 dot11fUnpackIeVHTOperation(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 tANI_U32 dot11fUnpackIeWAPI(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWAPI *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U16 tmp69__; + tANI_U16 tmp66__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; @@ -5008,9 +6813,19 @@ tANI_U32 dot11fUnpackIeWAPI(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, t pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->akm_suite_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < pDst->akm_suite_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->akm_suite_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5019,9 +6834,19 @@ tANI_U32 dot11fUnpackIeWAPI(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, t DOT11F_MEMCPY(pCtx, pDst->akm_suites, pBuf, ( pDst->akm_suite_count * 4 ) ); pBuf += ( pDst->akm_suite_count * 4 ); ielen -= ( pDst->akm_suite_count * 4 ); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->unicast_cipher_suite_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; + if (unlikely(ielen < pDst->unicast_cipher_suite_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->unicast_cipher_suite_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5030,14 +6855,24 @@ tANI_U32 dot11fUnpackIeWAPI(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, t DOT11F_MEMCPY(pCtx, pDst->unicast_cipher_suites, pBuf, ( pDst->unicast_cipher_suite_count * 4 ) ); pBuf += ( pDst->unicast_cipher_suite_count * 4 ); ielen -= ( pDst->unicast_cipher_suite_count * 4 ); + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->multicast_cipher_suite, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; - framesntohs(pCtx, &tmp69__, pBuf, 0); + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + framesntohs(pCtx, &tmp66__, pBuf, 0); pBuf += 2; ielen -= 2; - pDst->preauth = tmp69__ >> 0 & 0x1; - pDst->reserved = tmp69__ >> 1 & 0x7fff; + pDst->preauth = tmp66__ >> 0 & 0x1; + pDst->reserved = tmp66__ >> 1 & 0x7fff; if ( ! ielen ) { pDst->bkid_count = 0U; @@ -5045,10 +6880,20 @@ tANI_U32 dot11fUnpackIeWAPI(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, t } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->bkid_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->bkid_count * 16)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->bkid_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5088,9 +6933,19 @@ tANI_U32 dot11fUnpackIeWFATPC(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->txPower = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->linkMargin = *pBuf; (void)pCtx; return status; @@ -5122,10 +6977,15 @@ tANI_U32 dot11fUnpackIeWFDIEOpaque(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 i tANI_U32 dot11fUnpackIeWMMCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWMMCaps *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp70__; + tANI_U8 tmp67__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -5134,12 +6994,17 @@ tANI_U32 dot11fUnpackIeWMMCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } - tmp70__ = *pBuf; - pDst->reserved = tmp70__ >> 0 & 0xf; - pDst->qack = tmp70__ >> 4 & 0x1; - pDst->queue_request = tmp70__ >> 5 & 0x1; - pDst->txop_request = tmp70__ >> 6 & 0x1; - pDst->more_ack = tmp70__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp67__ = *pBuf; + pDst->reserved = tmp67__ >> 0 & 0xf; + pDst->qack = tmp67__ >> 4 & 0x1; + pDst->queue_request = tmp67__ >> 5 & 0x1; + pDst->txop_request = tmp67__ >> 6 & 0x1; + pDst->more_ack = tmp67__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeWMMCaps. */ @@ -5150,17 +7015,27 @@ tANI_U32 dot11fUnpackIeWMMCaps(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen tANI_U32 dot11fUnpackIeWMMInfoAp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWMMInfoAp *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp71__; + tANI_U8 tmp68__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp71__ = *pBuf; - pDst->param_set_count = tmp71__ >> 0 & 0xf; - pDst->reserved = tmp71__ >> 4 & 0x7; - pDst->uapsd = tmp71__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp68__ = *pBuf; + pDst->param_set_count = tmp68__ >> 0 & 0xf; + pDst->reserved = tmp68__ >> 4 & 0x7; + pDst->uapsd = tmp68__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeWMMInfoAp. */ @@ -5171,21 +7046,31 @@ tANI_U32 dot11fUnpackIeWMMInfoAp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel tANI_U32 dot11fUnpackIeWMMInfoStation(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWMMInfoStation *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; - tANI_U8 tmp72__; + tANI_U8 tmp69__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp72__ = *pBuf; - pDst->acvo_uapsd = tmp72__ >> 0 & 0x1; - pDst->acvi_uapsd = tmp72__ >> 1 & 0x1; - pDst->acbk_uapsd = tmp72__ >> 2 & 0x1; - pDst->acbe_uapsd = tmp72__ >> 3 & 0x1; - pDst->reserved1 = tmp72__ >> 4 & 0x1; - pDst->max_sp_length = tmp72__ >> 5 & 0x3; - pDst->reserved2 = tmp72__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp69__ = *pBuf; + pDst->acvo_uapsd = tmp69__ >> 0 & 0x1; + pDst->acvi_uapsd = tmp69__ >> 1 & 0x1; + pDst->acbk_uapsd = tmp69__ >> 2 & 0x1; + pDst->acbe_uapsd = tmp69__ >> 3 & 0x1; + pDst->reserved1 = tmp69__ >> 4 & 0x1; + pDst->max_sp_length = tmp69__ >> 5 & 0x3; + pDst->reserved2 = tmp69__ >> 7 & 0x1; (void)pCtx; return status; } /* End dot11fUnpackIeWMMInfoStation. */ @@ -5196,17 +7081,22 @@ tANI_U32 dot11fUnpackIeWMMInfoStation(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U tANI_U32 dot11fUnpackIeWMMParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWMMParams *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; + tANI_U8 tmp70__; + tANI_U8 tmp71__; + tANI_U8 tmp72__; tANI_U8 tmp73__; tANI_U8 tmp74__; tANI_U8 tmp75__; tANI_U8 tmp76__; tANI_U8 tmp77__; - tANI_U8 tmp78__; - tANI_U8 tmp79__; - tANI_U8 tmp80__; (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->version = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; @@ -5215,69 +7105,139 @@ tANI_U32 dot11fUnpackIeWMMParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel pDst->present = 0; return ( status | DOT11F_BAD_FIXED_VALUE ); } + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->qosInfo = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->reserved2 = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; - tmp73__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp70__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acbe_aifsn = tmp73__ >> 0 & 0xf; - pDst->acbe_acm = tmp73__ >> 4 & 0x1; - pDst->acbe_aci = tmp73__ >> 5 & 0x3; - pDst->unused1 = tmp73__ >> 7 & 0x1; - tmp74__ = *pBuf; + pDst->acbe_aifsn = tmp70__ >> 0 & 0xf; + pDst->acbe_acm = tmp70__ >> 4 & 0x1; + pDst->acbe_aci = tmp70__ >> 5 & 0x3; + pDst->unused1 = tmp70__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp71__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acbe_acwmin = tmp74__ >> 0 & 0xf; - pDst->acbe_acwmax = tmp74__ >> 4 & 0xf; + pDst->acbe_acwmin = tmp71__ >> 0 & 0xf; + pDst->acbe_acwmax = tmp71__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbe_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp75__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp72__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acbk_aifsn = tmp75__ >> 0 & 0xf; - pDst->acbk_acm = tmp75__ >> 4 & 0x1; - pDst->acbk_aci = tmp75__ >> 5 & 0x3; - pDst->unused2 = tmp75__ >> 7 & 0x1; - tmp76__ = *pBuf; + pDst->acbk_aifsn = tmp72__ >> 0 & 0xf; + pDst->acbk_acm = tmp72__ >> 4 & 0x1; + pDst->acbk_aci = tmp72__ >> 5 & 0x3; + pDst->unused2 = tmp72__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp73__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acbk_acwmin = tmp76__ >> 0 & 0xf; - pDst->acbk_acwmax = tmp76__ >> 4 & 0xf; + pDst->acbk_acwmin = tmp73__ >> 0 & 0xf; + pDst->acbk_acwmax = tmp73__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acbk_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp77__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp74__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acvi_aifsn = tmp77__ >> 0 & 0xf; - pDst->acvi_acm = tmp77__ >> 4 & 0x1; - pDst->acvi_aci = tmp77__ >> 5 & 0x3; - pDst->unused3 = tmp77__ >> 7 & 0x1; - tmp78__ = *pBuf; + pDst->acvi_aifsn = tmp74__ >> 0 & 0xf; + pDst->acvi_acm = tmp74__ >> 4 & 0x1; + pDst->acvi_aci = tmp74__ >> 5 & 0x3; + pDst->unused3 = tmp74__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp75__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acvi_acwmin = tmp78__ >> 0 & 0xf; - pDst->acvi_acwmax = tmp78__ >> 4 & 0xf; + pDst->acvi_acwmin = tmp75__ >> 0 & 0xf; + pDst->acvi_acwmax = tmp75__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvi_txoplimit, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; - tmp79__ = *pBuf; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp76__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acvo_aifsn = tmp79__ >> 0 & 0xf; - pDst->acvo_acm = tmp79__ >> 4 & 0x1; - pDst->acvo_aci = tmp79__ >> 5 & 0x3; - pDst->unused4 = tmp79__ >> 7 & 0x1; - tmp80__ = *pBuf; + pDst->acvo_aifsn = tmp76__ >> 0 & 0xf; + pDst->acvo_acm = tmp76__ >> 4 & 0x1; + pDst->acvo_aci = tmp76__ >> 5 & 0x3; + pDst->unused4 = tmp76__ >> 7 & 0x1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + + tmp77__ = *pBuf; pBuf += 1; ielen -= 1; - pDst->acvo_acwmin = tmp80__ >> 0 & 0xf; - pDst->acvo_acwmax = tmp80__ >> 4 & 0xf; + pDst->acvo_acwmin = tmp77__ >> 0 & 0xf; + pDst->acvo_acwmax = tmp77__ >> 4 & 0xf; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->acvo_txoplimit, pBuf, 0); (void)pCtx; return status; @@ -5292,6 +7252,11 @@ tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; @@ -5310,6 +7275,11 @@ tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD else { pDst->multicast_cipher_present = 1U; + if (unlikely(ielen < 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + DOT11F_MEMCPY(pCtx, pDst->multicast_cipher, pBuf, 4); pBuf += 4; ielen -= (tANI_U8)4; @@ -5322,10 +7292,20 @@ tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->unicast_cipher_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->unicast_cipher_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->unicast_cipher_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5341,10 +7321,20 @@ tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->auth_suite_count, pBuf, 0); pBuf += 2; ielen -= (tANI_U8)2; } + if (unlikely(ielen < pDst->auth_suite_count * 4)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + if (pDst->auth_suite_count > 4){ pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5359,6 +7349,11 @@ tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tD } else { + if (unlikely(ielen < 2)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + framesntohs(pCtx, &pDst->caps, pBuf, 0); } (void)pCtx; @@ -5432,12 +7427,27 @@ tANI_U32 dot11fUnpackIeWiderBWChanSwitchAnn(tpAniSirGlobal pCtx, tANI_U8 *pBuf, (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->newChanWidth = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->newCenterChanFreq0 = *pBuf; pBuf += 1; ielen -= (tANI_U8)1; + if (unlikely(ielen < 1)) { + pDst->present = 0; + return DOT11F_INCOMPLETE_IE; + } + pDst->newCenterChanFreq1 = *pBuf; (void)pCtx; return status; @@ -6299,7 +8309,7 @@ tANI_U32 dot11fUnpackAddTSResponse(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 {offsetof(tDot11fAssocRequest, P2PIEOpaque), offsetof(tDot11fIEP2PIEOpaque, present), 0, "P2PIEOpaque" , 0, 8, 255, SigIeP2PIEOpaque, {80, 111, 154, 9, 0}, 4, DOT11F_EID_P2PIEOPAQUE, 0, }, {offsetof(tDot11fAssocRequest, WFDIEOpaque), offsetof(tDot11fIEWFDIEOpaque, present), 0, "WFDIEOpaque" , 0, 8, 255, SigIeWFDIEOpaque, {80, 111, 154, 10, 0}, 4, DOT11F_EID_WFDIEOPAQUE, 0, }, {offsetof(tDot11fAssocRequest, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, - {offsetof(tDot11fAssocRequest, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fAssocRequest, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fAssocRequest, OperatingMode), offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode" , 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OPERATINGMODE, 0, }, {offsetof(tDot11fAssocRequest, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet" , 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; @@ -6869,57 +8879,8 @@ tANI_U32 dot11fUnpackAssocRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -6981,7 +8942,7 @@ tANI_U32 dot11fUnpackAssocRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n {offsetof(tDot11fAssocResponse, P2PAssocRes), offsetof(tDot11fIEP2PAssocRes, present), 0, "P2PAssocRes" , 0, 6, 17, SigIeP2PAssocRes, {80, 111, 154, 9, 0}, 4, DOT11F_EID_P2PASSOCRES, 0, }, {offsetof(tDot11fAssocResponse, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fAssocResponse, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, - {offsetof(tDot11fAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fAssocResponse, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, {offsetof(tDot11fAssocResponse, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet" , 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; @@ -8060,57 +10021,8 @@ tANI_U32 dot11fUnpackAssocResponse(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -8600,7 +10512,7 @@ tANI_U32 dot11fUnpackAuthentication(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 {offsetof(tDot11fBeacon, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fBeacon, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, {offsetof(tDot11fBeacon, VHTExtBssLoad), offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad" , 0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTEXTBSSLOAD, 0, }, - {offsetof(tDot11fBeacon, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fBeacon, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fBeacon, OperatingMode), offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode" , 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OPERATINGMODE, 0, }, {offsetof(tDot11fBeacon, WiderBWChanSwitchAnn), offsetof(tDot11fIEWiderBWChanSwitchAnn, present), 0, "WiderBWChanSwitchAnn" , 0, 5, 5, SigIeWiderBWChanSwitchAnn, {0, 0, 0, 0, 0}, 0, DOT11F_EID_WIDERBWCHANSWITCHANN, 0, }, {offsetof(tDot11fBeacon, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, @@ -9613,57 +11525,8 @@ tANI_U32 dot11fUnpackBeacon(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBuf, t } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -9835,7 +11698,7 @@ tANI_U32 dot11fUnpackBeacon1(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBuf, {offsetof(tDot11fBeacon2, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fBeacon2, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, {offsetof(tDot11fBeacon2, VHTExtBssLoad), offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad" , 0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTEXTBSSLOAD, 0, }, - {offsetof(tDot11fBeacon2, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fBeacon2, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fBeacon2, OperatingMode), offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode" , 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OPERATINGMODE, 0, }, {offsetof(tDot11fBeacon2, WiderBWChanSwitchAnn), offsetof(tDot11fIEWiderBWChanSwitchAnn, present), 0, "WiderBWChanSwitchAnn" , 0, 5, 5, SigIeWiderBWChanSwitchAnn, {0, 0, 0, 0, 0}, 0, DOT11F_EID_WIDERBWCHANSWITCHANN, 0, }, {offsetof(tDot11fBeacon2, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, @@ -10696,57 +12559,8 @@ tANI_U32 dot11fUnpackBeacon2(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBuf, } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -10838,7 +12652,7 @@ tANI_U32 dot11fUnpackBeacon2(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBuf, {offsetof(tDot11fBeaconIEs, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fBeaconIEs, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, {offsetof(tDot11fBeaconIEs, VHTExtBssLoad), offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad" , 0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTEXTBSSLOAD, 0, }, - {offsetof(tDot11fBeaconIEs, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fBeaconIEs, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fBeaconIEs, OperatingMode), offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode" , 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OPERATINGMODE, 0, }, {offsetof(tDot11fBeaconIEs, WiderBWChanSwitchAnn), offsetof(tDot11fIEWiderBWChanSwitchAnn, present), 0, "WiderBWChanSwitchAnn" , 0, 5, 5, SigIeWiderBWChanSwitchAnn, {0, 0, 0, 0, 0}, 0, DOT11F_EID_WIDERBWCHANSWITCHANN, 0, }, {offsetof(tDot11fBeaconIEs, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, @@ -11959,57 +13773,8 @@ tANI_U32 dot11fUnpackBeaconIEs(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBuf } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -14380,7 +16145,7 @@ tANI_U32 dot11fUnpackProbeRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n {offsetof(tDot11fProbeResponse, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fProbeResponse, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, {offsetof(tDot11fProbeResponse, VHTExtBssLoad), offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad" , 0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTEXTBSSLOAD, 0, }, - {offsetof(tDot11fProbeResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fProbeResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fProbeResponse, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; @@ -15468,57 +17233,8 @@ tANI_U32 dot11fUnpackProbeResponse(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -15952,7 +17668,7 @@ tANI_U32 dot11fUnpackRadioMeasurementRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, {offsetof(tDot11fReAssocRequest, P2PIEOpaque), offsetof(tDot11fIEP2PIEOpaque, present), 0, "P2PIEOpaque" , 0, 8, 255, SigIeP2PIEOpaque, {80, 111, 154, 9, 0}, 4, DOT11F_EID_P2PIEOPAQUE, 0, }, {offsetof(tDot11fReAssocRequest, WFDIEOpaque), offsetof(tDot11fIEWFDIEOpaque, present), 0, "WFDIEOpaque" , 0, 8, 255, SigIeWFDIEOpaque, {80, 111, 154, 10, 0}, 4, DOT11F_EID_WFDIEOPAQUE, 0, }, {offsetof(tDot11fReAssocRequest, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, - {offsetof(tDot11fReAssocRequest, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fReAssocRequest, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fReAssocRequest, OperatingMode), offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode" , 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OPERATINGMODE, 0, }, {offsetof(tDot11fReAssocRequest, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet" , 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; @@ -16909,57 +18625,8 @@ tANI_U32 dot11fUnpackReAssocRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -17022,7 +18689,7 @@ tANI_U32 dot11fUnpackReAssocRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 {offsetof(tDot11fReAssocResponse, P2PAssocRes), offsetof(tDot11fIEP2PAssocRes, present), 0, "P2PAssocRes" , 0, 6, 17, SigIeP2PAssocRes, {80, 111, 154, 9, 0}, 4, DOT11F_EID_P2PASSOCRES, 0, }, {offsetof(tDot11fReAssocResponse, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps" , 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, {offsetof(tDot11fReAssocResponse, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation" , 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, - {offsetof(tDot11fReAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fReAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fReAssocResponse, OBSSScanParameters), offsetof(tDot11fIEOBSSScanParameters, present), 0, "OBSSScanParameters" , 0, 16, 16, SigIeOBSSScanParameters, {0, 0, 0, 0, 0}, 0, DOT11F_EID_OBSSSCANPARAMETERS, 0, }, {offsetof(tDot11fReAssocResponse, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet" , 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; @@ -18108,57 +19775,8 @@ tANI_U32 dot11fUnpackReAssocResponse(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U3 } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -18359,7 +19977,7 @@ tANI_U32 dot11fUnpackTDLSDisReq(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBu {offsetof(tDot11fTDLSDisRsp, SuppChannels), offsetof(tDot11fIESuppChannels, present), 0, "SuppChannels" , 0, 4, 98, SigIeSuppChannels, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPCHANNELS, 0, }, {offsetof(tDot11fTDLSDisRsp, SuppOperatingClasses), offsetof(tDot11fIESuppOperatingClasses, present), 0, "SuppOperatingClasses" , 0, 3, 34, SigIeSuppOperatingClasses, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPOPERATINGCLASSES, 0, }, {offsetof(tDot11fTDLSDisRsp, RSN), offsetof(tDot11fIERSN, present), 0, "RSN" , 0, 8, 116, SigIeRSN, {0, 0, 0, 0, 0}, 0, DOT11F_EID_RSN, 0, }, - {offsetof(tDot11fTDLSDisRsp, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fTDLSDisRsp, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fTDLSDisRsp, FTInfo), offsetof(tDot11fIEFTInfo, present), 0, "FTInfo" , 0, 84, 222, SigIeFTInfo, {0, 0, 0, 0, 0}, 0, DOT11F_EID_FTINFO, 0, }, {offsetof(tDot11fTDLSDisRsp, TimeoutInterval), offsetof(tDot11fIETimeoutInterval, present), 0, "TimeoutInterval" , 0, 7, 7, SigIeTimeoutInterval, {0, 0, 0, 0, 0}, 0, DOT11F_EID_TIMEOUTINTERVAL, 0, }, {offsetof(tDot11fTDLSDisRsp, RICData), offsetof(tDot11fIERICData, present), 0, "RICData" , 0, 6, 6, SigIeRICData, {0, 0, 0, 0, 0}, 0, DOT11F_EID_RICDATA, 0, }, @@ -18470,57 +20088,8 @@ tANI_U32 dot11fUnpackTDLSDisRsp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 nBu } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("FTInfo:\n")); if (!pFrm->FTInfo.present) @@ -19145,7 +20714,7 @@ tANI_U32 dot11fUnpackTDLSSetupCnf(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n {offsetof(tDot11fTDLSSetupReq, ExtSuppRates), offsetof(tDot11fIEExtSuppRates, present), 0, "ExtSuppRates" , 0, 3, 14, SigIeExtSuppRates, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTSUPPRATES, 0, }, {offsetof(tDot11fTDLSSetupReq, SuppChannels), offsetof(tDot11fIESuppChannels, present), 0, "SuppChannels" , 0, 4, 98, SigIeSuppChannels, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPCHANNELS, 0, }, {offsetof(tDot11fTDLSSetupReq, RSN), offsetof(tDot11fIERSN, present), 0, "RSN" , 0, 8, 116, SigIeRSN, {0, 0, 0, 0, 0}, 0, DOT11F_EID_RSN, 0, }, - {offsetof(tDot11fTDLSSetupReq, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fTDLSSetupReq, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fTDLSSetupReq, SuppOperatingClasses), offsetof(tDot11fIESuppOperatingClasses, present), 0, "SuppOperatingClasses" , 0, 3, 34, SigIeSuppOperatingClasses, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPOPERATINGCLASSES, 0, }, {offsetof(tDot11fTDLSSetupReq, QOSCapsStation), offsetof(tDot11fIEQOSCapsStation, present), 0, "QOSCapsStation" , 0, 3, 3, SigIeQOSCapsStation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSCAPSSTATION, 0, }, {offsetof(tDot11fTDLSSetupReq, FTInfo), offsetof(tDot11fIEFTInfo, present), 0, "FTInfo" , 0, 84, 222, SigIeFTInfo, {0, 0, 0, 0, 0}, 0, DOT11F_EID_FTINFO, 0, }, @@ -19261,57 +20830,8 @@ tANI_U32 dot11fUnpackTDLSSetupReq(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("SuppOperatingClasses:\n")); if (!pFrm->SuppOperatingClasses.present) @@ -19579,7 +21099,7 @@ tANI_U32 dot11fUnpackTDLSSetupReq(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n {offsetof(tDot11fTDLSSetupRsp, ExtSuppRates), offsetof(tDot11fIEExtSuppRates, present), 0, "ExtSuppRates" , 0, 3, 14, SigIeExtSuppRates, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTSUPPRATES, 0, }, {offsetof(tDot11fTDLSSetupRsp, SuppChannels), offsetof(tDot11fIESuppChannels, present), 0, "SuppChannels" , 0, 4, 98, SigIeSuppChannels, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPCHANNELS, 0, }, {offsetof(tDot11fTDLSSetupRsp, RSN), offsetof(tDot11fIERSN, present), 0, "RSN" , 0, 8, 116, SigIeRSN, {0, 0, 0, 0, 0}, 0, DOT11F_EID_RSN, 0, }, - {offsetof(tDot11fTDLSSetupRsp, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 10, 10, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, + {offsetof(tDot11fTDLSSetupRsp, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap" , 0, 3, 11, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, }, {offsetof(tDot11fTDLSSetupRsp, SuppOperatingClasses), offsetof(tDot11fIESuppOperatingClasses, present), 0, "SuppOperatingClasses" , 0, 3, 34, SigIeSuppOperatingClasses, {0, 0, 0, 0, 0}, 0, DOT11F_EID_SUPPOPERATINGCLASSES, 0, }, {offsetof(tDot11fTDLSSetupRsp, QOSCapsStation), offsetof(tDot11fIEQOSCapsStation, present), 0, "QOSCapsStation" , 0, 3, 3, SigIeQOSCapsStation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSCAPSSTATION, 0, }, {offsetof(tDot11fTDLSSetupRsp, FTInfo), offsetof(tDot11fIEFTInfo, present), 0, "FTInfo" , 0, 84, 222, SigIeFTInfo, {0, 0, 0, 0, 0}, 0, DOT11F_EID_FTINFO, 0, }, @@ -19698,57 +21218,8 @@ tANI_U32 dot11fUnpackTDLSSetupRsp(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("SuppOperatingClasses:\n")); if (!pFrm->SuppOperatingClasses.present) @@ -20716,11 +22187,12 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx, if (pIe) { - if (nBufRemaining < pIe->minSize - pIe->noui - 2U) + if ((nBufRemaining < pIe->minSize - pIe->noui - 2U)) { - FRAMES_LOG3(pCtx, FRLOGW, FRFL("The IE %s must be " - "at least %d bytes in size, but there are onl" - "y %d bytes remaining in this frame.\n"), + FRAMES_LOG3(pCtx, FRLOGW, FRFL("The IE %s must " + "be at least %d bytes in size, but " + "there are only %d bytes remaining in " + "this frame\n"), pIe->name, pIe->minSize, nBufRemaining); FRAMES_DUMP(pCtx, FRLOG1, pBuf, nBuf); status |= DOT11F_INCOMPLETE_IE; @@ -20729,6 +22201,14 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx, } else { + if (len < pIe->minSize - pIe->noui - 2U) { + FRAMES_LOG3(pCtx, FRLOGW, FRFL("The IE %s must " + "be at least %d bytes in size, but " + "there are only %d bytes in the IE\n"), + pIe->name, pIe->minSize, (len + pIe->noui + 2U)); + goto skip_ie; + } + if (len > pIe->maxSize - pIe->noui - 2U){ FRAMES_LOG1(pCtx, FRLOGW, FRFL("The IE %s reports " "an unexpectedly large size; it is presumably " @@ -20739,6 +22219,10 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx, } countOffset = ( (0 != pIe->arraybound) * ( *(tANI_U16* )(pFrm + pIe->countOffset))); + if (0 != pIe->arraybound && countOffset >= pIe->arraybound) { + status |= DOT11F_DUPLICATE_IE; + goto skip_ie; + } switch (pIe->sig) { case SigIeAPName: @@ -21213,6 +22697,7 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx, status |= DOT11F_UNKNOWN_IES; } +skip_ie: pBufRemaining += len; if (len > nBufRemaining) @@ -23130,7 +24615,7 @@ static tANI_U32 GetPackedSizeCore(tpAniSirGlobal pCtx, break; case SigIeExtCap: offset = sizeof(tDot11fIEExtCap); - byteCount = 8; + byteCount = ((tDot11fIEExtCap* )(pFrm + pIe->offset + sizeof(tDot11fIEExtCap) * i ))->num_bytes; pIePresent = ( (tDot11fIEExtCap* )(pFrm + pIe->offset + offset * i ))->present; break; case SigIeExtChanSwitchAnn: @@ -23765,13 +25250,13 @@ void dot11fPackFfAddBAParameterSet(tpAniSirGlobal pCtx, tDot11fFfAddBAParameterSet *pSrc, tANI_U8 *pBuf) { - tANI_U16 tmp81__; - tmp81__ = 0U; - tmp81__ |= ( pSrc->amsduSupported << 0 ); - tmp81__ |= ( pSrc->policy << 1 ); - tmp81__ |= ( pSrc->tid << 2 ); - tmp81__ |= ( pSrc->bufferSize << 6 ); - frameshtons(pCtx, pBuf, tmp81__, 0); + tANI_U16 tmp78__; + tmp78__ = 0U; + tmp78__ |= ( pSrc->amsduSupported << 0 ); + tmp78__ |= ( pSrc->policy << 1 ); + tmp78__ |= ( pSrc->tid << 2 ); + tmp78__ |= ( pSrc->bufferSize << 6 ); + frameshtons(pCtx, pBuf, tmp78__, 0); (void)pCtx; } /* End dot11fPackFfAddBAParameterSet. */ @@ -23795,11 +25280,11 @@ void dot11fPackFfBAStartingSequenceControl(tpAniSirGlobal pCtx, tDot11fFfBAStartingSequenceControl *pSrc, tANI_U8 *pBuf) { - tANI_U16 tmp82__; - tmp82__ = 0U; - tmp82__ |= ( pSrc->fragNumber << 0 ); - tmp82__ |= ( pSrc->ssn << 4 ); - frameshtons(pCtx, pBuf, tmp82__, 0); + tANI_U16 tmp79__; + tmp79__ = 0U; + tmp79__ |= ( pSrc->fragNumber << 0 ); + tmp79__ |= ( pSrc->ssn << 4 ); + frameshtons(pCtx, pBuf, tmp79__, 0); (void)pCtx; } /* End dot11fPackFfBAStartingSequenceControl. */ @@ -23823,25 +25308,25 @@ void dot11fPackFfCapabilities(tpAniSirGlobal pCtx, tDot11fFfCapabilities *pSrc, tANI_U8 *pBuf) { - tANI_U16 tmp83__; - tmp83__ = 0U; - tmp83__ |= ( pSrc->ess << 0 ); - tmp83__ |= ( pSrc->ibss << 1 ); - tmp83__ |= ( pSrc->cfPollable << 2 ); - tmp83__ |= ( pSrc->cfPollReq << 3 ); - tmp83__ |= ( pSrc->privacy << 4 ); - tmp83__ |= ( pSrc->shortPreamble << 5 ); - tmp83__ |= ( pSrc->pbcc << 6 ); - tmp83__ |= ( pSrc->channelAgility << 7 ); - tmp83__ |= ( pSrc->spectrumMgt << 8 ); - tmp83__ |= ( pSrc->qos << 9 ); - tmp83__ |= ( pSrc->shortSlotTime << 10 ); - tmp83__ |= ( pSrc->apsd << 11 ); - tmp83__ |= ( pSrc->rrm << 12 ); - tmp83__ |= ( pSrc->dsssOfdm << 13 ); - tmp83__ |= ( pSrc->delayedBA << 14 ); - tmp83__ |= ( pSrc->immediateBA << 15 ); - frameshtons(pCtx, pBuf, tmp83__, 0); + tANI_U16 tmp80__; + tmp80__ = 0U; + tmp80__ |= ( pSrc->ess << 0 ); + tmp80__ |= ( pSrc->ibss << 1 ); + tmp80__ |= ( pSrc->cfPollable << 2 ); + tmp80__ |= ( pSrc->cfPollReq << 3 ); + tmp80__ |= ( pSrc->privacy << 4 ); + tmp80__ |= ( pSrc->shortPreamble << 5 ); + tmp80__ |= ( pSrc->pbcc << 6 ); + tmp80__ |= ( pSrc->channelAgility << 7 ); + tmp80__ |= ( pSrc->spectrumMgt << 8 ); + tmp80__ |= ( pSrc->qos << 9 ); + tmp80__ |= ( pSrc->shortSlotTime << 10 ); + tmp80__ |= ( pSrc->apsd << 11 ); + tmp80__ |= ( pSrc->rrm << 12 ); + tmp80__ |= ( pSrc->dsssOfdm << 13 ); + tmp80__ |= ( pSrc->delayedBA << 14 ); + tmp80__ |= ( pSrc->immediateBA << 15 ); + frameshtons(pCtx, pBuf, tmp80__, 0); (void)pCtx; } /* End dot11fPackFfCapabilities. */ @@ -23865,12 +25350,12 @@ void dot11fPackFfDelBAParameterSet(tpAniSirGlobal pCtx, tDot11fFfDelBAParameterSet *pSrc, tANI_U8 *pBuf) { - tANI_U16 tmp84__; - tmp84__ = 0U; - tmp84__ |= ( pSrc->reserved << 0 ); - tmp84__ |= ( pSrc->initiator << 11 ); - tmp84__ |= ( pSrc->tid << 12 ); - frameshtons(pCtx, pBuf, tmp84__, 0); + tANI_U16 tmp81__; + tmp81__ = 0U; + tmp81__ |= ( pSrc->reserved << 0 ); + tmp81__ |= ( pSrc->initiator << 11 ); + tmp81__ |= ( pSrc->tid << 12 ); + frameshtons(pCtx, pBuf, tmp81__, 0); (void)pCtx; } /* End dot11fPackFfDelBAParameterSet. */ @@ -23918,13 +25403,13 @@ void dot11fPackFfOperatingMode(tpAniSirGlobal pCtx, tDot11fFfOperatingMode *pSrc, tANI_U8 *pBuf) { - tANI_U8 tmp85__; - tmp85__ = 0U; - tmp85__ |= ( pSrc->chanWidth << 0 ); - tmp85__ |= ( pSrc->reserved << 2 ); - tmp85__ |= ( pSrc->rxNSS << 4 ); - tmp85__ |= ( pSrc->rxNSSType << 7 ); - *pBuf = tmp85__; + tANI_U8 tmp82__; + tmp82__ = 0U; + tmp82__ |= ( pSrc->chanWidth << 0 ); + tmp82__ |= ( pSrc->reserved << 2 ); + tmp82__ |= ( pSrc->rxNSS << 4 ); + tmp82__ |= ( pSrc->rxNSSType << 7 ); + *pBuf = tmp82__; (void)pCtx; } /* End dot11fPackFfOperatingMode. */ @@ -23980,12 +25465,12 @@ void dot11fPackFfSMPowerModeSet(tpAniSirGlobal pCtx, tDot11fFfSMPowerModeSet *pSrc, tANI_U8 *pBuf) { - tANI_U8 tmp86__; - tmp86__ = 0U; - tmp86__ |= ( pSrc->PowerSave_En << 0 ); - tmp86__ |= ( pSrc->Mode << 1 ); - tmp86__ |= ( pSrc->reserved << 2 ); - *pBuf = tmp86__; + tANI_U8 tmp83__; + tmp83__ = 0U; + tmp83__ |= ( pSrc->PowerSave_En << 0 ); + tmp83__ |= ( pSrc->Mode << 1 ); + tmp83__ |= ( pSrc->reserved << 2 ); + *pBuf = tmp83__; (void)pCtx; } /* End dot11fPackFfSMPowerModeSet. */ @@ -24025,19 +25510,19 @@ void dot11fPackFfTSInfo(tpAniSirGlobal pCtx, tDot11fFfTSInfo *pSrc, tANI_U8 *pBuf) { - tANI_U32 tmp87__; - tmp87__ = 0U; - tmp87__ |= ( pSrc->traffic_type << 0 ); - tmp87__ |= ( pSrc->tsid << 1 ); - tmp87__ |= ( pSrc->direction << 5 ); - tmp87__ |= ( pSrc->access_policy << 7 ); - tmp87__ |= ( pSrc->aggregation << 9 ); - tmp87__ |= ( pSrc->psb << 10 ); - tmp87__ |= ( pSrc->user_priority << 11 ); - tmp87__ |= ( pSrc->tsinfo_ack_pol << 14 ); - tmp87__ |= ( pSrc->schedule << 16 ); - tmp87__ |= ( pSrc->unused << 17 ); - frameshtonl(pCtx, pBuf, tmp87__, 0); + tANI_U32 tmp84__; + tmp84__ = 0U; + tmp84__ |= ( pSrc->traffic_type << 0 ); + tmp84__ |= ( pSrc->tsid << 1 ); + tmp84__ |= ( pSrc->direction << 5 ); + tmp84__ |= ( pSrc->access_policy << 7 ); + tmp84__ |= ( pSrc->aggregation << 9 ); + tmp84__ |= ( pSrc->psb << 10 ); + tmp84__ |= ( pSrc->user_priority << 11 ); + tmp84__ |= ( pSrc->tsinfo_ack_pol << 14 ); + tmp84__ |= ( pSrc->schedule << 16 ); + tmp84__ |= ( pSrc->unused << 17 ); + frameshtonl(pCtx, pBuf, tmp84__, 0); (void)pCtx; } /* End dot11fPackFfTSInfo. */ @@ -24158,7 +25643,7 @@ tANI_U32 dot11fPackTlvVersion2(tpAniSirGlobal pCtx, tANI_U8* pTlvLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp88__; + tANI_U8 tmp85__; nNeeded += 3; if ( nNeeded > nBuf ) return DOT11F_BUFFER_OVERFLOW; while ( pSrc->present ) @@ -24167,10 +25652,13 @@ tANI_U32 dot11fPackTlvVersion2(tpAniSirGlobal pCtx, pBuf += 1; *pnConsumed += 1; pTlvLen = pBuf; pBuf += 1; *pnConsumed += 1; - tmp88__ = 0U; - tmp88__ |= ( pSrc->minor << 0 ); - tmp88__ |= ( pSrc->major << 4 ); - *pBuf = tmp88__; + tmp85__ = 0U; + tmp85__ |= ( pSrc->minor << 0 ); + tmp85__ |= ( pSrc->major << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp85__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -25379,7 +26867,7 @@ tANI_U32 dot11fPackTlvVersion(tpAniSirGlobal pCtx, tANI_U8* pTlvLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp89__; + tANI_U8 tmp86__; nNeeded += 5; if ( nNeeded > nBuf ) return DOT11F_BUFFER_OVERFLOW; while ( pSrc->present ) @@ -25388,10 +26876,13 @@ tANI_U32 dot11fPackTlvVersion(tpAniSirGlobal pCtx, pBuf += 2; *pnConsumed += 2; pTlvLen = pBuf; pBuf += 2; *pnConsumed += 2; - tmp89__ = 0U; - tmp89__ |= ( pSrc->minor << 0 ); - tmp89__ |= ( pSrc->major << 4 ); - *pBuf = tmp89__; + tmp86__ = 0U; + tmp86__ |= ( pSrc->minor << 0 ); + tmp86__ |= ( pSrc->major << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp86__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -25597,7 +27088,7 @@ tANI_U32 dot11fPackIeGTK(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp90__; + tANI_U16 tmp87__; nNeeded += (pSrc->num_key + 11); while ( pSrc->present ) { @@ -25606,10 +27097,13 @@ tANI_U32 dot11fPackIeGTK(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp90__ = 0U; - tmp90__ |= ( pSrc->keyId << 0 ); - tmp90__ |= ( pSrc->reserved << 2 ); - frameshtons(pCtx, pBuf, tmp90__, 0); + tmp87__ = 0U; + tmp87__ |= ( pSrc->keyId << 0 ); + tmp87__ |= ( pSrc->reserved << 2 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp87__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -25905,14 +27399,14 @@ tANI_U32 dot11fPackIePropEDCAParams(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; + tANI_U8 tmp88__; + tANI_U8 tmp89__; + tANI_U8 tmp90__; tANI_U8 tmp91__; tANI_U8 tmp92__; tANI_U8 tmp93__; tANI_U8 tmp94__; tANI_U8 tmp95__; - tANI_U8 tmp96__; - tANI_U8 tmp97__; - tANI_U8 tmp98__; nNeeded += 18; while ( pSrc->present ) { @@ -25927,76 +27421,100 @@ tANI_U32 dot11fPackIePropEDCAParams(tpAniSirGlobal pCtx, *pBuf = pSrc->reserved; *pnConsumed += 1; pBuf += 1; - tmp91__ = 0U; - tmp91__ |= ( pSrc->acbe_aifsn << 0 ); - tmp91__ |= ( pSrc->acbe_acm << 4 ); - tmp91__ |= ( pSrc->acbe_aci << 5 ); - tmp91__ |= ( pSrc->unused1 << 7 ); - *pBuf = tmp91__; + tmp88__ = 0U; + tmp88__ |= ( pSrc->acbe_aifsn << 0 ); + tmp88__ |= ( pSrc->acbe_acm << 4 ); + tmp88__ |= ( pSrc->acbe_aci << 5 ); + tmp88__ |= ( pSrc->unused1 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp88__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp92__ = 0U; - tmp92__ |= ( pSrc->acbe_min << 0 ); - tmp92__ |= ( pSrc->acbe_max << 4 ); - *pBuf = tmp92__; + tmp89__ = 0U; + tmp89__ |= ( pSrc->acbe_min << 0 ); + tmp89__ |= ( pSrc->acbe_max << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp89__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbe_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp93__ = 0U; - tmp93__ |= ( pSrc->acbk_aifsn << 0 ); - tmp93__ |= ( pSrc->acbk_acm << 4 ); - tmp93__ |= ( pSrc->acbk_aci << 5 ); - tmp93__ |= ( pSrc->unused2 << 7 ); - *pBuf = tmp93__; + tmp90__ = 0U; + tmp90__ |= ( pSrc->acbk_aifsn << 0 ); + tmp90__ |= ( pSrc->acbk_acm << 4 ); + tmp90__ |= ( pSrc->acbk_aci << 5 ); + tmp90__ |= ( pSrc->unused2 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp90__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp94__ = 0U; - tmp94__ |= ( pSrc->acbk_min << 0 ); - tmp94__ |= ( pSrc->acbk_max << 4 ); - *pBuf = tmp94__; + tmp91__ = 0U; + tmp91__ |= ( pSrc->acbk_min << 0 ); + tmp91__ |= ( pSrc->acbk_max << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp91__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbk_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp95__ = 0U; - tmp95__ |= ( pSrc->acvi_aifsn << 0 ); - tmp95__ |= ( pSrc->acvi_acm << 4 ); - tmp95__ |= ( pSrc->acvi_aci << 5 ); - tmp95__ |= ( pSrc->unused3 << 7 ); - *pBuf = tmp95__; + tmp92__ = 0U; + tmp92__ |= ( pSrc->acvi_aifsn << 0 ); + tmp92__ |= ( pSrc->acvi_acm << 4 ); + tmp92__ |= ( pSrc->acvi_aci << 5 ); + tmp92__ |= ( pSrc->unused3 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp92__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp96__ = 0U; - tmp96__ |= ( pSrc->acvi_min << 0 ); - tmp96__ |= ( pSrc->acvi_max << 4 ); - *pBuf = tmp96__; + tmp93__ = 0U; + tmp93__ |= ( pSrc->acvi_min << 0 ); + tmp93__ |= ( pSrc->acvi_max << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp93__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acvi_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp97__ = 0U; - tmp97__ |= ( pSrc->acvo_aifsn << 0 ); - tmp97__ |= ( pSrc->acvo_acm << 4 ); - tmp97__ |= ( pSrc->acvo_aci << 5 ); - tmp97__ |= ( pSrc->unused4 << 7 ); - *pBuf = tmp97__; + tmp94__ = 0U; + tmp94__ |= ( pSrc->acvo_aifsn << 0 ); + tmp94__ |= ( pSrc->acvo_acm << 4 ); + tmp94__ |= ( pSrc->acvo_aci << 5 ); + tmp94__ |= ( pSrc->unused4 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp94__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp98__ = 0U; - tmp98__ |= ( pSrc->acvo_min << 0 ); - tmp98__ |= ( pSrc->acvo_max << 4 ); - *pBuf = tmp98__; + tmp95__ = 0U; + tmp95__ |= ( pSrc->acvo_min << 0 ); + tmp95__ |= ( pSrc->acvo_max << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp95__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -26184,7 +27702,7 @@ tANI_U32 dot11fPackIeTaurus(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp99__; + tANI_U16 tmp96__; nNeeded += 6; while ( pSrc->present ) { @@ -26199,10 +27717,13 @@ tANI_U32 dot11fPackIeTaurus(tpAniSirGlobal pCtx, frameshtons(pCtx, pBuf, pSrc->baPolicy, 0); *pnConsumed += 2; pBuf += 2; - tmp99__ = 0U; - tmp99__ |= ( pSrc->baBufferSize << 0 ); - tmp99__ |= ( pSrc->rsvd << 12 ); - frameshtons(pCtx, pBuf, tmp99__, 0); + tmp96__ = 0U; + tmp96__ |= ( pSrc->baBufferSize << 0 ); + tmp96__ |= ( pSrc->rsvd << 12 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp96__, 0); *pnConsumed += 2; // fieldsEndFlag = 1 nBuf -= 2 ; @@ -26621,11 +28142,11 @@ tANI_U32 dot11fPackIeRRMEnabledCap(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; + tANI_U8 tmp97__; + tANI_U8 tmp98__; + tANI_U8 tmp99__; tANI_U8 tmp100__; tANI_U8 tmp101__; - tANI_U8 tmp102__; - tANI_U8 tmp103__; - tANI_U8 tmp104__; nNeeded += 5; while ( pSrc->present ) { @@ -26634,57 +28155,72 @@ tANI_U32 dot11fPackIeRRMEnabledCap(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp100__ = 0U; - tmp100__ |= ( pSrc->LinkMeasurement << 0 ); - tmp100__ |= ( pSrc->NeighborRpt << 1 ); - tmp100__ |= ( pSrc->parallel << 2 ); - tmp100__ |= ( pSrc->repeated << 3 ); - tmp100__ |= ( pSrc->BeaconPassive << 4 ); - tmp100__ |= ( pSrc->BeaconActive << 5 ); - tmp100__ |= ( pSrc->BeaconTable << 6 ); - tmp100__ |= ( pSrc->BeaconRepCond << 7 ); - *pBuf = tmp100__; + tmp97__ = 0U; + tmp97__ |= ( pSrc->LinkMeasurement << 0 ); + tmp97__ |= ( pSrc->NeighborRpt << 1 ); + tmp97__ |= ( pSrc->parallel << 2 ); + tmp97__ |= ( pSrc->repeated << 3 ); + tmp97__ |= ( pSrc->BeaconPassive << 4 ); + tmp97__ |= ( pSrc->BeaconActive << 5 ); + tmp97__ |= ( pSrc->BeaconTable << 6 ); + tmp97__ |= ( pSrc->BeaconRepCond << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp97__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp101__ = 0U; - tmp101__ |= ( pSrc->FrameMeasurement << 0 ); - tmp101__ |= ( pSrc->ChannelLoad << 1 ); - tmp101__ |= ( pSrc->NoiseHistogram << 2 ); - tmp101__ |= ( pSrc->statistics << 3 ); - tmp101__ |= ( pSrc->LCIMeasurement << 4 ); - tmp101__ |= ( pSrc->LCIAzimuth << 5 ); - tmp101__ |= ( pSrc->TCMCapability << 6 ); - tmp101__ |= ( pSrc->triggeredTCM << 7 ); - *pBuf = tmp101__; + tmp98__ = 0U; + tmp98__ |= ( pSrc->FrameMeasurement << 0 ); + tmp98__ |= ( pSrc->ChannelLoad << 1 ); + tmp98__ |= ( pSrc->NoiseHistogram << 2 ); + tmp98__ |= ( pSrc->statistics << 3 ); + tmp98__ |= ( pSrc->LCIMeasurement << 4 ); + tmp98__ |= ( pSrc->LCIAzimuth << 5 ); + tmp98__ |= ( pSrc->TCMCapability << 6 ); + tmp98__ |= ( pSrc->triggeredTCM << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp98__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp102__ = 0U; - tmp102__ |= ( pSrc->APChanReport << 0 ); - tmp102__ |= ( pSrc->RRMMIBEnabled << 1 ); - tmp102__ |= ( pSrc->operatingChanMax << 2 ); - tmp102__ |= ( pSrc->nonOperatinChanMax << 5 ); - *pBuf = tmp102__; + tmp99__ = 0U; + tmp99__ |= ( pSrc->APChanReport << 0 ); + tmp99__ |= ( pSrc->RRMMIBEnabled << 1 ); + tmp99__ |= ( pSrc->operatingChanMax << 2 ); + tmp99__ |= ( pSrc->nonOperatinChanMax << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp99__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp103__ = 0U; - tmp103__ |= ( pSrc->MeasurementPilot << 0 ); - tmp103__ |= ( pSrc->MeasurementPilotEnabled << 3 ); - tmp103__ |= ( pSrc->NeighborTSFOffset << 4 ); - tmp103__ |= ( pSrc->RCPIMeasurement << 5 ); - tmp103__ |= ( pSrc->RSNIMeasurement << 6 ); - tmp103__ |= ( pSrc->BssAvgAccessDelay << 7 ); - *pBuf = tmp103__; + tmp100__ = 0U; + tmp100__ |= ( pSrc->MeasurementPilot << 0 ); + tmp100__ |= ( pSrc->MeasurementPilotEnabled << 3 ); + tmp100__ |= ( pSrc->NeighborTSFOffset << 4 ); + tmp100__ |= ( pSrc->RCPIMeasurement << 5 ); + tmp100__ |= ( pSrc->RSNIMeasurement << 6 ); + tmp100__ |= ( pSrc->BssAvgAccessDelay << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp100__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp104__ = 0U; - tmp104__ |= ( pSrc->BSSAvailAdmission << 0 ); - tmp104__ |= ( pSrc->AntennaInformation << 1 ); - tmp104__ |= ( pSrc->reserved << 2 ); - *pBuf = tmp104__; + tmp101__ = 0U; + tmp101__ |= ( pSrc->BSSAvailAdmission << 0 ); + tmp101__ |= ( pSrc->AntennaInformation << 1 ); + tmp101__ |= ( pSrc->reserved << 2 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp101__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -26767,7 +28303,7 @@ tANI_U32 dot11fPackIeSchedule(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp105__; + tANI_U16 tmp102__; nNeeded += 14; while ( pSrc->present ) { @@ -26776,12 +28312,15 @@ tANI_U32 dot11fPackIeSchedule(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp105__ = 0U; - tmp105__ |= ( pSrc->aggregation << 0 ); - tmp105__ |= ( pSrc->tsid << 1 ); - tmp105__ |= ( pSrc->direction << 5 ); - tmp105__ |= ( pSrc->reserved << 7 ); - frameshtons(pCtx, pBuf, tmp105__, 0); + tmp102__ = 0U; + tmp102__ |= ( pSrc->aggregation << 0 ); + tmp102__ |= ( pSrc->tsid << 1 ); + tmp102__ |= ( pSrc->direction << 5 ); + tmp102__ |= ( pSrc->reserved << 7 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp102__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -26981,9 +28520,9 @@ tANI_U32 dot11fPackIeTSPEC(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp106__; - tANI_U8 tmp107__; - tANI_U16 tmp108__; + tANI_U16 tmp103__; + tANI_U8 tmp104__; + tANI_U16 tmp105__; nNeeded += 55; while ( pSrc->present ) { @@ -26992,30 +28531,39 @@ tANI_U32 dot11fPackIeTSPEC(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp106__ = 0U; - tmp106__ |= ( pSrc->traffic_type << 0 ); - tmp106__ |= ( pSrc->tsid << 1 ); - tmp106__ |= ( pSrc->direction << 5 ); - tmp106__ |= ( pSrc->access_policy << 7 ); - tmp106__ |= ( pSrc->aggregation << 9 ); - tmp106__ |= ( pSrc->psb << 10 ); - tmp106__ |= ( pSrc->user_priority << 11 ); - tmp106__ |= ( pSrc->tsinfo_ack_pol << 14 ); - frameshtons(pCtx, pBuf, tmp106__, 0); + tmp103__ = 0U; + tmp103__ |= ( pSrc->traffic_type << 0 ); + tmp103__ |= ( pSrc->tsid << 1 ); + tmp103__ |= ( pSrc->direction << 5 ); + tmp103__ |= ( pSrc->access_policy << 7 ); + tmp103__ |= ( pSrc->aggregation << 9 ); + tmp103__ |= ( pSrc->psb << 10 ); + tmp103__ |= ( pSrc->user_priority << 11 ); + tmp103__ |= ( pSrc->tsinfo_ack_pol << 14 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp103__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; - tmp107__ = 0U; - tmp107__ |= ( pSrc->schedule << 0 ); - tmp107__ |= ( pSrc->unused << 1 ); - *pBuf = tmp107__; + tmp104__ = 0U; + tmp104__ |= ( pSrc->schedule << 0 ); + tmp104__ |= ( pSrc->unused << 1 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp104__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp108__ = 0U; - tmp108__ |= ( pSrc->size << 0 ); - tmp108__ |= ( pSrc->fixed << 15 ); - frameshtons(pCtx, pBuf, tmp108__, 0); + tmp105__ = 0U; + tmp105__ |= ( pSrc->size << 0 ); + tmp105__ |= ( pSrc->fixed << 15 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp105__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -27080,7 +28628,7 @@ tANI_U32 dot11fPackIeWMMSchedule(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp109__; + tANI_U16 tmp106__; nNeeded += 15; while ( pSrc->present ) { @@ -27102,12 +28650,15 @@ tANI_U32 dot11fPackIeWMMSchedule(tpAniSirGlobal pCtx, *pBuf = pSrc->version; *pnConsumed += 1; pBuf += 1; - tmp109__ = 0U; - tmp109__ |= ( pSrc->aggregation << 0 ); - tmp109__ |= ( pSrc->tsid << 1 ); - tmp109__ |= ( pSrc->direction << 5 ); - tmp109__ |= ( pSrc->reserved << 7 ); - frameshtons(pCtx, pBuf, tmp109__, 0); + tmp106__ = 0U; + tmp106__ |= ( pSrc->aggregation << 0 ); + tmp106__ |= ( pSrc->tsid << 1 ); + tmp106__ |= ( pSrc->direction << 5 ); + tmp106__ |= ( pSrc->reserved << 7 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp106__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -27346,9 +28897,9 @@ tANI_U32 dot11fPackIeWMMTSPEC(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp110__; - tANI_U8 tmp111__; - tANI_U16 tmp112__; + tANI_U16 tmp107__; + tANI_U8 tmp108__; + tANI_U16 tmp109__; nNeeded += 38; while ( pSrc->present ) { @@ -27370,30 +28921,39 @@ tANI_U32 dot11fPackIeWMMTSPEC(tpAniSirGlobal pCtx, *pBuf = pSrc->version; *pnConsumed += 1; pBuf += 1; - tmp110__ = 0U; - tmp110__ |= ( pSrc->traffic_type << 0 ); - tmp110__ |= ( pSrc->tsid << 1 ); - tmp110__ |= ( pSrc->direction << 5 ); - tmp110__ |= ( pSrc->access_policy << 7 ); - tmp110__ |= ( pSrc->aggregation << 9 ); - tmp110__ |= ( pSrc->psb << 10 ); - tmp110__ |= ( pSrc->user_priority << 11 ); - tmp110__ |= ( pSrc->tsinfo_ack_pol << 14 ); - frameshtons(pCtx, pBuf, tmp110__, 0); + tmp107__ = 0U; + tmp107__ |= ( pSrc->traffic_type << 0 ); + tmp107__ |= ( pSrc->tsid << 1 ); + tmp107__ |= ( pSrc->direction << 5 ); + tmp107__ |= ( pSrc->access_policy << 7 ); + tmp107__ |= ( pSrc->aggregation << 9 ); + tmp107__ |= ( pSrc->psb << 10 ); + tmp107__ |= ( pSrc->user_priority << 11 ); + tmp107__ |= ( pSrc->tsinfo_ack_pol << 14 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp107__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; - tmp111__ = 0U; - tmp111__ |= ( pSrc->tsinfo_rsvd << 0 ); - tmp111__ |= ( pSrc->burst_size_defn << 7 ); - *pBuf = tmp111__; + tmp108__ = 0U; + tmp108__ |= ( pSrc->tsinfo_rsvd << 0 ); + tmp108__ |= ( pSrc->burst_size_defn << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp108__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp112__ = 0U; - tmp112__ |= ( pSrc->size << 0 ); - tmp112__ |= ( pSrc->fixed << 15 ); - frameshtons(pCtx, pBuf, tmp112__, 0); + tmp109__ = 0U; + tmp109__ |= ( pSrc->size << 0 ); + tmp109__ |= ( pSrc->fixed << 15 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp109__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -27703,14 +29263,14 @@ tANI_U32 dot11fPackIeEDCAParamSet(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; + tANI_U8 tmp110__; + tANI_U8 tmp111__; + tANI_U8 tmp112__; tANI_U8 tmp113__; tANI_U8 tmp114__; tANI_U8 tmp115__; tANI_U8 tmp116__; tANI_U8 tmp117__; - tANI_U8 tmp118__; - tANI_U8 tmp119__; - tANI_U8 tmp120__; nNeeded += 18; while ( pSrc->present ) { @@ -27725,76 +29285,100 @@ tANI_U32 dot11fPackIeEDCAParamSet(tpAniSirGlobal pCtx, *pBuf = pSrc->reserved; *pnConsumed += 1; pBuf += 1; - tmp113__ = 0U; - tmp113__ |= ( pSrc->acbe_aifsn << 0 ); - tmp113__ |= ( pSrc->acbe_acm << 4 ); - tmp113__ |= ( pSrc->acbe_aci << 5 ); - tmp113__ |= ( pSrc->unused1 << 7 ); - *pBuf = tmp113__; + tmp110__ = 0U; + tmp110__ |= ( pSrc->acbe_aifsn << 0 ); + tmp110__ |= ( pSrc->acbe_acm << 4 ); + tmp110__ |= ( pSrc->acbe_aci << 5 ); + tmp110__ |= ( pSrc->unused1 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp110__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp114__ = 0U; - tmp114__ |= ( pSrc->acbe_acwmin << 0 ); - tmp114__ |= ( pSrc->acbe_acwmax << 4 ); - *pBuf = tmp114__; + tmp111__ = 0U; + tmp111__ |= ( pSrc->acbe_acwmin << 0 ); + tmp111__ |= ( pSrc->acbe_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp111__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbe_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp115__ = 0U; - tmp115__ |= ( pSrc->acbk_aifsn << 0 ); - tmp115__ |= ( pSrc->acbk_acm << 4 ); - tmp115__ |= ( pSrc->acbk_aci << 5 ); - tmp115__ |= ( pSrc->unused2 << 7 ); - *pBuf = tmp115__; + tmp112__ = 0U; + tmp112__ |= ( pSrc->acbk_aifsn << 0 ); + tmp112__ |= ( pSrc->acbk_acm << 4 ); + tmp112__ |= ( pSrc->acbk_aci << 5 ); + tmp112__ |= ( pSrc->unused2 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp112__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp116__ = 0U; - tmp116__ |= ( pSrc->acbk_acwmin << 0 ); - tmp116__ |= ( pSrc->acbk_acwmax << 4 ); - *pBuf = tmp116__; + tmp113__ = 0U; + tmp113__ |= ( pSrc->acbk_acwmin << 0 ); + tmp113__ |= ( pSrc->acbk_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp113__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbk_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp117__ = 0U; - tmp117__ |= ( pSrc->acvi_aifsn << 0 ); - tmp117__ |= ( pSrc->acvi_acm << 4 ); - tmp117__ |= ( pSrc->acvi_aci << 5 ); - tmp117__ |= ( pSrc->unused3 << 7 ); - *pBuf = tmp117__; + tmp114__ = 0U; + tmp114__ |= ( pSrc->acvi_aifsn << 0 ); + tmp114__ |= ( pSrc->acvi_acm << 4 ); + tmp114__ |= ( pSrc->acvi_aci << 5 ); + tmp114__ |= ( pSrc->unused3 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp114__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp118__ = 0U; - tmp118__ |= ( pSrc->acvi_acwmin << 0 ); - tmp118__ |= ( pSrc->acvi_acwmax << 4 ); - *pBuf = tmp118__; + tmp115__ = 0U; + tmp115__ |= ( pSrc->acvi_acwmin << 0 ); + tmp115__ |= ( pSrc->acvi_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp115__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acvi_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp119__ = 0U; - tmp119__ |= ( pSrc->acvo_aifsn << 0 ); - tmp119__ |= ( pSrc->acvo_acm << 4 ); - tmp119__ |= ( pSrc->acvo_aci << 5 ); - tmp119__ |= ( pSrc->unused4 << 7 ); - *pBuf = tmp119__; + tmp116__ = 0U; + tmp116__ |= ( pSrc->acvo_aifsn << 0 ); + tmp116__ |= ( pSrc->acvo_acm << 4 ); + tmp116__ |= ( pSrc->acvo_aci << 5 ); + tmp116__ |= ( pSrc->unused4 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp116__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp120__ = 0U; - tmp120__ |= ( pSrc->acvo_acwmin << 0 ); - tmp120__ |= ( pSrc->acvo_acwmax << 4 ); - *pBuf = tmp120__; + tmp117__ = 0U; + tmp117__ |= ( pSrc->acvo_acwmin << 0 ); + tmp117__ |= ( pSrc->acvo_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp117__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -27820,7 +29404,7 @@ tANI_U32 dot11fPackIeERPInfo(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp121__; + tANI_U8 tmp118__; nNeeded += 1; while ( pSrc->present ) { @@ -27829,12 +29413,15 @@ tANI_U32 dot11fPackIeERPInfo(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp121__ = 0U; - tmp121__ |= ( pSrc->non_erp_present << 0 ); - tmp121__ |= ( pSrc->use_prot << 1 ); - tmp121__ |= ( pSrc->barker_preamble << 2 ); - tmp121__ |= ( pSrc->unused << 3 ); - *pBuf = tmp121__; + tmp118__ = 0U; + tmp118__ |= ( pSrc->non_erp_present << 0 ); + tmp118__ |= ( pSrc->use_prot << 1 ); + tmp118__ |= ( pSrc->barker_preamble << 2 ); + tmp118__ |= ( pSrc->unused << 3 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp118__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -27895,7 +29482,7 @@ tANI_U32 dot11fPackIeESERadMgmtCap(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp122__; + tANI_U8 tmp119__; nNeeded += 2; while ( pSrc->present ) { @@ -27915,10 +29502,13 @@ tANI_U32 dot11fPackIeESERadMgmtCap(tpAniSirGlobal pCtx, *pBuf = pSrc->mgmt_state; *pnConsumed += 1; pBuf += 1; - tmp122__ = 0U; - tmp122__ |= ( pSrc->mbssid_mask << 0 ); - tmp122__ |= ( pSrc->reserved << 3 ); - *pBuf = tmp122__; + tmp119__ = 0U; + tmp119__ |= ( pSrc->mbssid_mask << 0 ); + tmp119__ |= ( pSrc->reserved << 3 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp119__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -28105,10 +29695,7 @@ tANI_U32 dot11fPackIeExtCap(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U32 tmp123__; - tANI_U16 tmp124__; - tANI_U16 tmp125__; - nNeeded += 8; + nNeeded += pSrc->num_bytes; while ( pSrc->present ) { if ( nNeeded > nBuf ) return DOT11F_BUFFER_OVERFLOW; @@ -28116,72 +29703,9 @@ tANI_U32 dot11fPackIeExtCap(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp123__ = 0U; - tmp123__ |= ( pSrc->bssCoexistMgmtSupport << 0 ); - tmp123__ |= ( pSrc->reserved1 << 1 ); - tmp123__ |= ( pSrc->extChanSwitch << 2 ); - tmp123__ |= ( pSrc->reserved2 << 3 ); - tmp123__ |= ( pSrc->psmpCap << 4 ); - tmp123__ |= ( pSrc->reserved3 << 5 ); - tmp123__ |= ( pSrc->spsmpCap << 6 ); - tmp123__ |= ( pSrc->event << 7 ); - tmp123__ |= ( pSrc->diagnostics << 8 ); - tmp123__ |= ( pSrc->multiDiagnostics << 9 ); - tmp123__ |= ( pSrc->locTracking << 10 ); - tmp123__ |= ( pSrc->FMS << 11 ); - tmp123__ |= ( pSrc->proxyARPService << 12 ); - tmp123__ |= ( pSrc->coLocIntfReporting << 13 ); - tmp123__ |= ( pSrc->civicLoc << 14 ); - tmp123__ |= ( pSrc->geospatialLoc << 15 ); - tmp123__ |= ( pSrc->TFS << 16 ); - tmp123__ |= ( pSrc->wnmSleepMode << 17 ); - tmp123__ |= ( pSrc->timBroadcast << 18 ); - tmp123__ |= ( pSrc->bssTransition << 19 ); - tmp123__ |= ( pSrc->qosTrafficCap << 20 ); - tmp123__ |= ( pSrc->acStaCnt << 21 ); - tmp123__ |= ( pSrc->multiBSSID << 22 ); - tmp123__ |= ( pSrc->timingMeas << 23 ); - tmp123__ |= ( pSrc->chanUsage << 24 ); - tmp123__ |= ( pSrc->ssidList << 25 ); - tmp123__ |= ( pSrc->DMS << 26 ); - tmp123__ |= ( pSrc->UTCTSFOffset << 27 ); - tmp123__ |= ( pSrc->TDLSPeerUAPSDBufferSTA << 28 ); - tmp123__ |= ( pSrc->TDLSPeerPSMSupp << 29 ); - tmp123__ |= ( pSrc->TDLSChannelSwitching << 30 ); - tmp123__ |= ( pSrc->interworkingService << 31 ); - frameshtonl(pCtx, pBuf, tmp123__, 0); - *pnConsumed += 4; - pBuf += 4; - nBuf -= 4 ; - tmp124__ = 0U; - tmp124__ |= ( pSrc->qosMap << 0 ); - tmp124__ |= ( pSrc->EBR << 1 ); - tmp124__ |= ( pSrc->sspnInterface << 2 ); - tmp124__ |= ( pSrc->reserved4 << 3 ); - tmp124__ |= ( pSrc->msgCFCap << 4 ); - tmp124__ |= ( pSrc->TDLSSupport << 5 ); - tmp124__ |= ( pSrc->TDLSProhibited << 6 ); - tmp124__ |= ( pSrc->TDLSChanSwitProhibited << 7 ); - tmp124__ |= ( pSrc->rejectUnadmittedTraffic << 8 ); - tmp124__ |= ( pSrc->serviceIntervalGranularity << 9 ); - tmp124__ |= ( pSrc->identifierLoc << 12 ); - tmp124__ |= ( pSrc->uapsdCoexistence << 13 ); - tmp124__ |= ( pSrc->wnmNotification << 14 ); - tmp124__ |= ( pSrc->reserved5 << 15 ); - frameshtons(pCtx, pBuf, tmp124__, 0); - *pnConsumed += 2; - pBuf += 2; - nBuf -= 2 ; - tmp125__ = 0U; - tmp125__ |= ( pSrc->UTF8SSID << 0 ); - tmp125__ |= ( pSrc->reserved6 << 1 ); - tmp125__ |= ( pSrc->TDLSWiderBW << 13 ); - tmp125__ |= ( pSrc->operModeNotification << 14 ); - tmp125__ |= ( pSrc->reserved7 << 15 ); - frameshtons(pCtx, pBuf, tmp125__, 0); - *pnConsumed += 2; - // fieldsEndFlag = 1 - nBuf -= 2 ; + DOT11F_MEMCPY(pCtx, pBuf, &( pSrc->bytes ), pSrc->num_bytes); + *pnConsumed += pSrc->num_bytes; + // fieldsEndFlag = 1 break; } (void)pCtx; @@ -28375,7 +29899,7 @@ tANI_U32 dot11fPackIeFTInfo(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp126__; + tANI_U16 tmp120__; tANI_U32 status = DOT11F_PARSE_SUCCESS; status = dot11fGetPackedIEFTInfo(pCtx, pSrc, &nNeeded); if ( ! DOT11F_SUCCEEDED( status ) ) return status; @@ -28386,10 +29910,13 @@ tANI_U32 dot11fPackIeFTInfo(tpAniSirGlobal pCtx, ++pBuf; --nBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; --nBuf; ++(*pnConsumed); - tmp126__ = 0U; - tmp126__ |= ( pSrc->reserved << 0 ); - tmp126__ |= ( pSrc->IECount << 8 ); - frameshtons(pCtx, pBuf, tmp126__, 0); + tmp120__ = 0U; + tmp120__ |= ( pSrc->reserved << 0 ); + tmp120__ |= ( pSrc->IECount << 8 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp120__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -28428,7 +29955,7 @@ tANI_U32 dot11fPackIeHT2040BSSCoexistence(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp127__; + tANI_U8 tmp121__; nNeeded += 1; while ( pSrc->present ) { @@ -28437,14 +29964,17 @@ tANI_U32 dot11fPackIeHT2040BSSCoexistence(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp127__ = 0U; - tmp127__ |= ( pSrc->infoRequest << 0 ); - tmp127__ |= ( pSrc->fortyMHzIntolerant << 1 ); - tmp127__ |= ( pSrc->twentyMHzBssWidthReq << 2 ); - tmp127__ |= ( pSrc->obssScanExemptionReq << 3 ); - tmp127__ |= ( pSrc->obssScanExemptionGrant << 4 ); - tmp127__ |= ( pSrc->unused << 5 ); - *pBuf = tmp127__; + tmp121__ = 0U; + tmp121__ |= ( pSrc->infoRequest << 0 ); + tmp121__ |= ( pSrc->fortyMHzIntolerant << 1 ); + tmp121__ |= ( pSrc->twentyMHzBssWidthReq << 2 ); + tmp121__ |= ( pSrc->obssScanExemptionReq << 3 ); + tmp121__ |= ( pSrc->obssScanExemptionGrant << 4 ); + tmp121__ |= ( pSrc->unused << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp121__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -28500,11 +30030,11 @@ tANI_U32 dot11fPackIeHTCaps(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp128__; - tANI_U8 tmp129__; - tANI_U16 tmp130__; - tANI_U32 tmp131__; - tANI_U8 tmp132__; + tANI_U16 tmp122__; + tANI_U8 tmp123__; + tANI_U16 tmp124__; + tANI_U32 tmp125__; + tANI_U8 tmp126__; nNeeded += (pSrc->num_rsvd + 26); while ( pSrc->present ) { @@ -28513,77 +30043,92 @@ tANI_U32 dot11fPackIeHTCaps(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp128__ = 0U; - tmp128__ |= ( pSrc->advCodingCap << 0 ); - tmp128__ |= ( pSrc->supportedChannelWidthSet << 1 ); - tmp128__ |= ( pSrc->mimoPowerSave << 2 ); - tmp128__ |= ( pSrc->greenField << 4 ); - tmp128__ |= ( pSrc->shortGI20MHz << 5 ); - tmp128__ |= ( pSrc->shortGI40MHz << 6 ); - tmp128__ |= ( pSrc->txSTBC << 7 ); - tmp128__ |= ( pSrc->rxSTBC << 8 ); - tmp128__ |= ( pSrc->delayedBA << 10 ); - tmp128__ |= ( pSrc->maximalAMSDUsize << 11 ); - tmp128__ |= ( pSrc->dsssCckMode40MHz << 12 ); - tmp128__ |= ( pSrc->psmp << 13 ); - tmp128__ |= ( pSrc->stbcControlFrame << 14 ); - tmp128__ |= ( pSrc->lsigTXOPProtection << 15 ); - frameshtons(pCtx, pBuf, tmp128__, 0); + tmp122__ = 0U; + tmp122__ |= ( pSrc->advCodingCap << 0 ); + tmp122__ |= ( pSrc->supportedChannelWidthSet << 1 ); + tmp122__ |= ( pSrc->mimoPowerSave << 2 ); + tmp122__ |= ( pSrc->greenField << 4 ); + tmp122__ |= ( pSrc->shortGI20MHz << 5 ); + tmp122__ |= ( pSrc->shortGI40MHz << 6 ); + tmp122__ |= ( pSrc->txSTBC << 7 ); + tmp122__ |= ( pSrc->rxSTBC << 8 ); + tmp122__ |= ( pSrc->delayedBA << 10 ); + tmp122__ |= ( pSrc->maximalAMSDUsize << 11 ); + tmp122__ |= ( pSrc->dsssCckMode40MHz << 12 ); + tmp122__ |= ( pSrc->psmp << 13 ); + tmp122__ |= ( pSrc->stbcControlFrame << 14 ); + tmp122__ |= ( pSrc->lsigTXOPProtection << 15 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp122__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; - tmp129__ = 0U; - tmp129__ |= ( pSrc->maxRxAMPDUFactor << 0 ); - tmp129__ |= ( pSrc->mpduDensity << 2 ); - tmp129__ |= ( pSrc->reserved1 << 5 ); - *pBuf = tmp129__; + tmp123__ = 0U; + tmp123__ |= ( pSrc->maxRxAMPDUFactor << 0 ); + tmp123__ |= ( pSrc->mpduDensity << 2 ); + tmp123__ |= ( pSrc->reserved1 << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp123__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; DOT11F_MEMCPY(pCtx, pBuf, pSrc->supportedMCSSet, 16); *pnConsumed += 16; pBuf += 16; - tmp130__ = 0U; - tmp130__ |= ( pSrc->pco << 0 ); - tmp130__ |= ( pSrc->transitionTime << 1 ); - tmp130__ |= ( pSrc->reserved2 << 3 ); - tmp130__ |= ( pSrc->mcsFeedback << 8 ); - tmp130__ |= ( pSrc->reserved3 << 10 ); - frameshtons(pCtx, pBuf, tmp130__, 0); + tmp124__ = 0U; + tmp124__ |= ( pSrc->pco << 0 ); + tmp124__ |= ( pSrc->transitionTime << 1 ); + tmp124__ |= ( pSrc->reserved2 << 3 ); + tmp124__ |= ( pSrc->mcsFeedback << 8 ); + tmp124__ |= ( pSrc->reserved3 << 10 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp124__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; - tmp131__ = 0U; - tmp131__ |= ( pSrc->txBF << 0 ); - tmp131__ |= ( pSrc->rxStaggeredSounding << 1 ); - tmp131__ |= ( pSrc->txStaggeredSounding << 2 ); - tmp131__ |= ( pSrc->rxZLF << 3 ); - tmp131__ |= ( pSrc->txZLF << 4 ); - tmp131__ |= ( pSrc->implicitTxBF << 5 ); - tmp131__ |= ( pSrc->calibration << 6 ); - tmp131__ |= ( pSrc->explicitCSITxBF << 8 ); - tmp131__ |= ( pSrc->explicitUncompressedSteeringMatrix << 9 ); - tmp131__ |= ( pSrc->explicitBFCSIFeedback << 10 ); - tmp131__ |= ( pSrc->explicitUncompressedSteeringMatrixFeedback << 13 ); - tmp131__ |= ( pSrc->explicitCompressedSteeringMatrixFeedback << 16 ); - tmp131__ |= ( pSrc->csiNumBFAntennae << 19 ); - tmp131__ |= ( pSrc->uncompressedSteeringMatrixBFAntennae << 21 ); - tmp131__ |= ( pSrc->compressedSteeringMatrixBFAntennae << 23 ); - tmp131__ |= ( pSrc->reserved4 << 25 ); - frameshtonl(pCtx, pBuf, tmp131__, 0); + tmp125__ = 0U; + tmp125__ |= ( pSrc->txBF << 0 ); + tmp125__ |= ( pSrc->rxStaggeredSounding << 1 ); + tmp125__ |= ( pSrc->txStaggeredSounding << 2 ); + tmp125__ |= ( pSrc->rxZLF << 3 ); + tmp125__ |= ( pSrc->txZLF << 4 ); + tmp125__ |= ( pSrc->implicitTxBF << 5 ); + tmp125__ |= ( pSrc->calibration << 6 ); + tmp125__ |= ( pSrc->explicitCSITxBF << 8 ); + tmp125__ |= ( pSrc->explicitUncompressedSteeringMatrix << 9 ); + tmp125__ |= ( pSrc->explicitBFCSIFeedback << 10 ); + tmp125__ |= ( pSrc->explicitUncompressedSteeringMatrixFeedback << 13 ); + tmp125__ |= ( pSrc->explicitCompressedSteeringMatrixFeedback << 16 ); + tmp125__ |= ( pSrc->csiNumBFAntennae << 19 ); + tmp125__ |= ( pSrc->uncompressedSteeringMatrixBFAntennae << 21 ); + tmp125__ |= ( pSrc->compressedSteeringMatrixBFAntennae << 23 ); + tmp125__ |= ( pSrc->reserved4 << 25 ); + if (unlikely(nBuf < 4)) + return DOT11F_INCOMPLETE_IE; + + frameshtonl(pCtx, pBuf, tmp125__, 0); *pnConsumed += 4; pBuf += 4; nBuf -= 4 ; - tmp132__ = 0U; - tmp132__ |= ( pSrc->antennaSelection << 0 ); - tmp132__ |= ( pSrc->explicitCSIFeedbackTx << 1 ); - tmp132__ |= ( pSrc->antennaIndicesFeedbackTx << 2 ); - tmp132__ |= ( pSrc->explicitCSIFeedback << 3 ); - tmp132__ |= ( pSrc->antennaIndicesFeedback << 4 ); - tmp132__ |= ( pSrc->rxAS << 5 ); - tmp132__ |= ( pSrc->txSoundingPPDUs << 6 ); - tmp132__ |= ( pSrc->reserved5 << 7 ); - *pBuf = tmp132__; + tmp126__ = 0U; + tmp126__ |= ( pSrc->antennaSelection << 0 ); + tmp126__ |= ( pSrc->explicitCSIFeedbackTx << 1 ); + tmp126__ |= ( pSrc->antennaIndicesFeedbackTx << 2 ); + tmp126__ |= ( pSrc->explicitCSIFeedback << 3 ); + tmp126__ |= ( pSrc->antennaIndicesFeedback << 4 ); + tmp126__ |= ( pSrc->rxAS << 5 ); + tmp126__ |= ( pSrc->txSoundingPPDUs << 6 ); + tmp126__ |= ( pSrc->reserved5 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp126__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -28609,9 +30154,9 @@ tANI_U32 dot11fPackIeHTInfo(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp133__; - tANI_U16 tmp134__; - tANI_U16 tmp135__; + tANI_U8 tmp127__; + tANI_U16 tmp128__; + tANI_U16 tmp129__; nNeeded += (pSrc->num_rsvd + 22); while ( pSrc->present ) { @@ -28623,35 +30168,44 @@ tANI_U32 dot11fPackIeHTInfo(tpAniSirGlobal pCtx, *pBuf = pSrc->primaryChannel; *pnConsumed += 1; pBuf += 1; - tmp133__ = 0U; - tmp133__ |= ( pSrc->secondaryChannelOffset << 0 ); - tmp133__ |= ( pSrc->recommendedTxWidthSet << 2 ); - tmp133__ |= ( pSrc->rifsMode << 3 ); - tmp133__ |= ( pSrc->controlledAccessOnly << 4 ); - tmp133__ |= ( pSrc->serviceIntervalGranularity << 5 ); - *pBuf = tmp133__; + tmp127__ = 0U; + tmp127__ |= ( pSrc->secondaryChannelOffset << 0 ); + tmp127__ |= ( pSrc->recommendedTxWidthSet << 2 ); + tmp127__ |= ( pSrc->rifsMode << 3 ); + tmp127__ |= ( pSrc->controlledAccessOnly << 4 ); + tmp127__ |= ( pSrc->serviceIntervalGranularity << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp127__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp134__ = 0U; - tmp134__ |= ( pSrc->opMode << 0 ); - tmp134__ |= ( pSrc->nonGFDevicesPresent << 2 ); - tmp134__ |= ( pSrc->transmitBurstLimit << 3 ); - tmp134__ |= ( pSrc->obssNonHTStaPresent << 4 ); - tmp134__ |= ( pSrc->reserved << 5 ); - frameshtons(pCtx, pBuf, tmp134__, 0); + tmp128__ = 0U; + tmp128__ |= ( pSrc->opMode << 0 ); + tmp128__ |= ( pSrc->nonGFDevicesPresent << 2 ); + tmp128__ |= ( pSrc->transmitBurstLimit << 3 ); + tmp128__ |= ( pSrc->obssNonHTStaPresent << 4 ); + tmp128__ |= ( pSrc->reserved << 5 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp128__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; - tmp135__ = 0U; - tmp135__ |= ( pSrc->basicSTBCMCS << 0 ); - tmp135__ |= ( pSrc->dualCTSProtection << 7 ); - tmp135__ |= ( pSrc->secondaryBeacon << 8 ); - tmp135__ |= ( pSrc->lsigTXOPProtectionFullSupport << 9 ); - tmp135__ |= ( pSrc->pcoActive << 10 ); - tmp135__ |= ( pSrc->pcoPhase << 11 ); - tmp135__ |= ( pSrc->reserved2 << 12 ); - frameshtons(pCtx, pBuf, tmp135__, 0); + tmp129__ = 0U; + tmp129__ |= ( pSrc->basicSTBCMCS << 0 ); + tmp129__ |= ( pSrc->dualCTSProtection << 7 ); + tmp129__ |= ( pSrc->secondaryBeacon << 8 ); + tmp129__ |= ( pSrc->lsigTXOPProtectionFullSupport << 9 ); + tmp129__ |= ( pSrc->pcoActive << 10 ); + tmp129__ |= ( pSrc->pcoPhase << 11 ); + tmp129__ |= ( pSrc->reserved2 << 12 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp129__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -28746,9 +30300,9 @@ tANI_U32 dot11fPackIeMeasurementReport(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp136__; - tANI_U8 tmp137__; - tANI_U8 tmp138__; + tANI_U8 tmp130__; + tANI_U8 tmp131__; + tANI_U8 tmp132__; tANI_U32 status = DOT11F_PARSE_SUCCESS; status = dot11fGetPackedIEMeasurementReport(pCtx, pSrc, &nNeeded); if ( ! DOT11F_SUCCEEDED( status ) ) return status; @@ -28762,12 +30316,15 @@ tANI_U32 dot11fPackIeMeasurementReport(tpAniSirGlobal pCtx, *pBuf = pSrc->token; *pnConsumed += 1; pBuf += 1; - tmp136__ = 0U; - tmp136__ |= ( pSrc->late << 0 ); - tmp136__ |= ( pSrc->incapable << 1 ); - tmp136__ |= ( pSrc->refused << 2 ); - tmp136__ |= ( pSrc->unused << 3 ); - *pBuf = tmp136__; + tmp130__ = 0U; + tmp130__ |= ( pSrc->late << 0 ); + tmp130__ |= ( pSrc->incapable << 1 ); + tmp130__ |= ( pSrc->refused << 2 ); + tmp130__ |= ( pSrc->unused << 3 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp130__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -28787,14 +30344,17 @@ tANI_U32 dot11fPackIeMeasurementReport(tpAniSirGlobal pCtx, frameshtons(pCtx, pBuf, pSrc->report.Basic.meas_duration, 0); *pnConsumed += 2; pBuf += 2; - tmp137__ = 0U; - tmp137__ |= ( pSrc->report.Basic.bss << 0 ); - tmp137__ |= ( pSrc->report.Basic.ofdm_preamble << 1 ); - tmp137__ |= ( pSrc->report.Basic.unid_signal << 2 ); - tmp137__ |= ( pSrc->report.Basic.rader << 3 ); - tmp137__ |= ( pSrc->report.Basic.unmeasured << 4 ); - tmp137__ |= ( pSrc->report.Basic.unused << 5 ); - *pBuf = tmp137__; + tmp131__ = 0U; + tmp131__ |= ( pSrc->report.Basic.bss << 0 ); + tmp131__ |= ( pSrc->report.Basic.ofdm_preamble << 1 ); + tmp131__ |= ( pSrc->report.Basic.unid_signal << 2 ); + tmp131__ |= ( pSrc->report.Basic.rader << 3 ); + tmp131__ |= ( pSrc->report.Basic.unmeasured << 4 ); + tmp131__ |= ( pSrc->report.Basic.unused << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp131__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -28861,10 +30421,13 @@ tANI_U32 dot11fPackIeMeasurementReport(tpAniSirGlobal pCtx, frameshtons(pCtx, pBuf, pSrc->report.Beacon.meas_duration, 0); *pnConsumed += 2; pBuf += 2; - tmp138__ = 0U; - tmp138__ |= ( pSrc->report.Beacon.condensed_PHY << 0 ); - tmp138__ |= ( pSrc->report.Beacon.reported_frame_type << 7 ); - *pBuf = tmp138__; + tmp132__ = 0U; + tmp132__ |= ( pSrc->report.Beacon.condensed_PHY << 0 ); + tmp132__ |= ( pSrc->report.Beacon.reported_frame_type << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp132__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -28913,7 +30476,7 @@ tANI_U32 dot11fPackIeMeasurementRequest(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp139__; + tANI_U8 tmp133__; tANI_U32 status = DOT11F_PARSE_SUCCESS; status = dot11fGetPackedIEMeasurementRequest(pCtx, pSrc, &nNeeded); if ( ! DOT11F_SUCCEEDED( status ) ) return status; @@ -28927,14 +30490,17 @@ tANI_U32 dot11fPackIeMeasurementRequest(tpAniSirGlobal pCtx, *pBuf = pSrc->measurement_token; *pnConsumed += 1; pBuf += 1; - tmp139__ = 0U; - tmp139__ |= ( pSrc->parallel << 0 ); - tmp139__ |= ( pSrc->enable << 1 ); - tmp139__ |= ( pSrc->request << 2 ); - tmp139__ |= ( pSrc->report << 3 ); - tmp139__ |= ( pSrc->durationMandatory << 4 ); - tmp139__ |= ( pSrc->unused << 5 ); - *pBuf = tmp139__; + tmp133__ = 0U; + tmp133__ |= ( pSrc->parallel << 0 ); + tmp133__ |= ( pSrc->enable << 1 ); + tmp133__ |= ( pSrc->request << 2 ); + tmp133__ |= ( pSrc->report << 3 ); + tmp133__ |= ( pSrc->durationMandatory << 4 ); + tmp133__ |= ( pSrc->unused << 5 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp133__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -29023,7 +30589,7 @@ tANI_U32 dot11fPackIeMobilityDomain(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp140__; + tANI_U8 tmp134__; nNeeded += 3; while ( pSrc->present ) { @@ -29035,11 +30601,14 @@ tANI_U32 dot11fPackIeMobilityDomain(tpAniSirGlobal pCtx, frameshtons(pCtx, pBuf, pSrc->MDID, 0); *pnConsumed += 2; pBuf += 2; - tmp140__ = 0U; - tmp140__ |= ( pSrc->overDSCap << 0 ); - tmp140__ |= ( pSrc->resourceReqCap << 1 ); - tmp140__ |= ( pSrc->reserved << 2 ); - *pBuf = tmp140__; + tmp134__ = 0U; + tmp134__ |= ( pSrc->overDSCap << 0 ); + tmp134__ |= ( pSrc->resourceReqCap << 1 ); + tmp134__ |= ( pSrc->reserved << 2 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp134__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -29062,8 +30631,8 @@ tANI_U32 dot11fPackIeNeighborReport(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp141__; - tANI_U8 tmp142__; + tANI_U8 tmp135__; + tANI_U8 tmp136__; tANI_U32 status = DOT11F_PARSE_SUCCESS; status = dot11fGetPackedIENeighborReport(pCtx, pSrc, &nNeeded); if ( ! DOT11F_SUCCEEDED( status ) ) return status; @@ -29077,24 +30646,30 @@ tANI_U32 dot11fPackIeNeighborReport(tpAniSirGlobal pCtx, DOT11F_MEMCPY(pCtx, pBuf, pSrc->bssid, 6); *pnConsumed += 6; pBuf += 6; - tmp141__ = 0U; - tmp141__ |= ( pSrc->APReachability << 0 ); - tmp141__ |= ( pSrc->Security << 2 ); - tmp141__ |= ( pSrc->KeyScope << 3 ); - tmp141__ |= ( pSrc->SpecMgmtCap << 4 ); - tmp141__ |= ( pSrc->QosCap << 5 ); - tmp141__ |= ( pSrc->apsd << 6 ); - tmp141__ |= ( pSrc->rrm << 7 ); - *pBuf = tmp141__; + tmp135__ = 0U; + tmp135__ |= ( pSrc->APReachability << 0 ); + tmp135__ |= ( pSrc->Security << 2 ); + tmp135__ |= ( pSrc->KeyScope << 3 ); + tmp135__ |= ( pSrc->SpecMgmtCap << 4 ); + tmp135__ |= ( pSrc->QosCap << 5 ); + tmp135__ |= ( pSrc->apsd << 6 ); + tmp135__ |= ( pSrc->rrm << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp135__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp142__ = 0U; - tmp142__ |= ( pSrc->DelayedBA << 0 ); - tmp142__ |= ( pSrc->ImmBA << 1 ); - tmp142__ |= ( pSrc->MobilityDomain << 2 ); - tmp142__ |= ( pSrc->reserved << 3 ); - *pBuf = tmp142__; + tmp136__ = 0U; + tmp136__ |= ( pSrc->DelayedBA << 0 ); + tmp136__ |= ( pSrc->ImmBA << 1 ); + tmp136__ |= ( pSrc->MobilityDomain << 2 ); + tmp136__ |= ( pSrc->reserved << 3 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp136__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -29184,7 +30759,7 @@ tANI_U32 dot11fPackIeOperatingMode(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp143__; + tANI_U8 tmp137__; nNeeded += 1; while ( pSrc->present ) { @@ -29193,12 +30768,15 @@ tANI_U32 dot11fPackIeOperatingMode(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp143__ = 0U; - tmp143__ |= ( pSrc->chanWidth << 0 ); - tmp143__ |= ( pSrc->reserved << 2 ); - tmp143__ |= ( pSrc->rxNSS << 4 ); - tmp143__ |= ( pSrc->rxNSSType << 7 ); - *pBuf = tmp143__; + tmp137__ = 0U; + tmp137__ |= ( pSrc->chanWidth << 0 ); + tmp137__ |= ( pSrc->reserved << 2 ); + tmp137__ |= ( pSrc->rxNSS << 4 ); + tmp137__ |= ( pSrc->rxNSSType << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp137__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -30152,7 +31730,7 @@ tANI_U32 dot11fPackIePUBufferStatus(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp144__; + tANI_U8 tmp138__; nNeeded += 1; while ( pSrc->present ) { @@ -30161,13 +31739,16 @@ tANI_U32 dot11fPackIePUBufferStatus(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp144__ = 0U; - tmp144__ |= ( pSrc->ac_bk_traffic_aval << 0 ); - tmp144__ |= ( pSrc->ac_be_traffic_aval << 1 ); - tmp144__ |= ( pSrc->ac_vi_traffic_aval << 2 ); - tmp144__ |= ( pSrc->ac_vo_traffic_aval << 3 ); - tmp144__ |= ( pSrc->reserved << 4 ); - *pBuf = tmp144__; + tmp138__ = 0U; + tmp138__ |= ( pSrc->ac_bk_traffic_aval << 0 ); + tmp138__ |= ( pSrc->ac_be_traffic_aval << 1 ); + tmp138__ |= ( pSrc->ac_vi_traffic_aval << 2 ); + tmp138__ |= ( pSrc->ac_vo_traffic_aval << 3 ); + tmp138__ |= ( pSrc->reserved << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp138__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -30289,7 +31870,7 @@ tANI_U32 dot11fPackIeQOSCapsAp(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp145__; + tANI_U8 tmp139__; nNeeded += 1; while ( pSrc->present ) { @@ -30298,13 +31879,16 @@ tANI_U32 dot11fPackIeQOSCapsAp(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp145__ = 0U; - tmp145__ |= ( pSrc->count << 0 ); - tmp145__ |= ( pSrc->qack << 4 ); - tmp145__ |= ( pSrc->qreq << 5 ); - tmp145__ |= ( pSrc->txopreq << 6 ); - tmp145__ |= ( pSrc->reserved << 7 ); - *pBuf = tmp145__; + tmp139__ = 0U; + tmp139__ |= ( pSrc->count << 0 ); + tmp139__ |= ( pSrc->qack << 4 ); + tmp139__ |= ( pSrc->qreq << 5 ); + tmp139__ |= ( pSrc->txopreq << 6 ); + tmp139__ |= ( pSrc->reserved << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp139__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -30327,7 +31911,7 @@ tANI_U32 dot11fPackIeQOSCapsStation(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp146__; + tANI_U8 tmp140__; nNeeded += 1; while ( pSrc->present ) { @@ -30336,15 +31920,18 @@ tANI_U32 dot11fPackIeQOSCapsStation(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp146__ = 0U; - tmp146__ |= ( pSrc->acvo_uapsd << 0 ); - tmp146__ |= ( pSrc->acvi_uapsd << 1 ); - tmp146__ |= ( pSrc->acbk_uapsd << 2 ); - tmp146__ |= ( pSrc->acbe_uapsd << 3 ); - tmp146__ |= ( pSrc->qack << 4 ); - tmp146__ |= ( pSrc->max_sp_length << 5 ); - tmp146__ |= ( pSrc->more_data_ack << 7 ); - *pBuf = tmp146__; + tmp140__ = 0U; + tmp140__ |= ( pSrc->acvo_uapsd << 0 ); + tmp140__ |= ( pSrc->acvi_uapsd << 1 ); + tmp140__ |= ( pSrc->acbk_uapsd << 2 ); + tmp140__ |= ( pSrc->acbe_uapsd << 3 ); + tmp140__ |= ( pSrc->qack << 4 ); + tmp140__ |= ( pSrc->max_sp_length << 5 ); + tmp140__ |= ( pSrc->more_data_ack << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp140__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -30848,9 +32435,9 @@ tANI_U32 dot11fPackIeVHTCaps(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U32 tmp147__; - tANI_U16 tmp148__; - tANI_U16 tmp149__; + tANI_U32 tmp141__; + tANI_U16 tmp142__; + tANI_U16 tmp143__; nNeeded += 12; while ( pSrc->present ) { @@ -30859,48 +32446,57 @@ tANI_U32 dot11fPackIeVHTCaps(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); pIeLen = pBuf; ++pBuf; ++(*pnConsumed); - tmp147__ = 0U; - tmp147__ |= ( pSrc->maxMPDULen << 0 ); - tmp147__ |= ( pSrc->supportedChannelWidthSet << 2 ); - tmp147__ |= ( pSrc->ldpcCodingCap << 4 ); - tmp147__ |= ( pSrc->shortGI80MHz << 5 ); - tmp147__ |= ( pSrc->shortGI160and80plus80MHz << 6 ); - tmp147__ |= ( pSrc->txSTBC << 7 ); - tmp147__ |= ( pSrc->rxSTBC << 8 ); - tmp147__ |= ( pSrc->suBeamFormerCap << 11 ); - tmp147__ |= ( pSrc->suBeamformeeCap << 12 ); - tmp147__ |= ( pSrc->csnofBeamformerAntSup << 13 ); - tmp147__ |= ( pSrc->numSoundingDim << 16 ); - tmp147__ |= ( pSrc->muBeamformerCap << 19 ); - tmp147__ |= ( pSrc->muBeamformeeCap << 20 ); - tmp147__ |= ( pSrc->vhtTXOPPS << 21 ); - tmp147__ |= ( pSrc->htcVHTCap << 22 ); - tmp147__ |= ( pSrc->maxAMPDULenExp << 23 ); - tmp147__ |= ( pSrc->vhtLinkAdaptCap << 26 ); - tmp147__ |= ( pSrc->rxAntPattern << 28 ); - tmp147__ |= ( pSrc->txAntPattern << 29 ); - tmp147__ |= ( pSrc->reserved1 << 30 ); - frameshtonl(pCtx, pBuf, tmp147__, 0); + tmp141__ = 0U; + tmp141__ |= ( pSrc->maxMPDULen << 0 ); + tmp141__ |= ( pSrc->supportedChannelWidthSet << 2 ); + tmp141__ |= ( pSrc->ldpcCodingCap << 4 ); + tmp141__ |= ( pSrc->shortGI80MHz << 5 ); + tmp141__ |= ( pSrc->shortGI160and80plus80MHz << 6 ); + tmp141__ |= ( pSrc->txSTBC << 7 ); + tmp141__ |= ( pSrc->rxSTBC << 8 ); + tmp141__ |= ( pSrc->suBeamFormerCap << 11 ); + tmp141__ |= ( pSrc->suBeamformeeCap << 12 ); + tmp141__ |= ( pSrc->csnofBeamformerAntSup << 13 ); + tmp141__ |= ( pSrc->numSoundingDim << 16 ); + tmp141__ |= ( pSrc->muBeamformerCap << 19 ); + tmp141__ |= ( pSrc->muBeamformeeCap << 20 ); + tmp141__ |= ( pSrc->vhtTXOPPS << 21 ); + tmp141__ |= ( pSrc->htcVHTCap << 22 ); + tmp141__ |= ( pSrc->maxAMPDULenExp << 23 ); + tmp141__ |= ( pSrc->vhtLinkAdaptCap << 26 ); + tmp141__ |= ( pSrc->rxAntPattern << 28 ); + tmp141__ |= ( pSrc->txAntPattern << 29 ); + tmp141__ |= ( pSrc->reserved1 << 30 ); + if (unlikely(nBuf < 4)) + return DOT11F_INCOMPLETE_IE; + + frameshtonl(pCtx, pBuf, tmp141__, 0); *pnConsumed += 4; pBuf += 4; nBuf -= 4 ; frameshtons(pCtx, pBuf, pSrc->rxMCSMap, 0); *pnConsumed += 2; pBuf += 2; - tmp148__ = 0U; - tmp148__ |= ( pSrc->rxHighSupDataRate << 0 ); - tmp148__ |= ( pSrc->reserved2 << 13 ); - frameshtons(pCtx, pBuf, tmp148__, 0); + tmp142__ = 0U; + tmp142__ |= ( pSrc->rxHighSupDataRate << 0 ); + tmp142__ |= ( pSrc->reserved2 << 13 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp142__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; frameshtons(pCtx, pBuf, pSrc->txMCSMap, 0); *pnConsumed += 2; pBuf += 2; - tmp149__ = 0U; - tmp149__ |= ( pSrc->txSupDataRate << 0 ); - tmp149__ |= ( pSrc->reserved3 << 13 ); - frameshtons(pCtx, pBuf, tmp149__, 0); + tmp143__ = 0U; + tmp143__ |= ( pSrc->txSupDataRate << 0 ); + tmp143__ |= ( pSrc->reserved3 << 13 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp143__, 0); *pnConsumed += 2; // fieldsEndFlag = 1 nBuf -= 2 ; @@ -31004,7 +32600,7 @@ tANI_U32 dot11fPackIeWAPI(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U16 tmp150__; + tANI_U16 tmp144__; tANI_U32 status = DOT11F_PARSE_SUCCESS; status = dot11fGetPackedIEWAPI(pCtx, pSrc, &nNeeded); if ( ! DOT11F_SUCCEEDED( status ) ) return status; @@ -31033,10 +32629,13 @@ tANI_U32 dot11fPackIeWAPI(tpAniSirGlobal pCtx, DOT11F_MEMCPY(pCtx, pBuf, pSrc->multicast_cipher_suite, 4); *pnConsumed += 4; pBuf += 4; - tmp150__ = 0U; - tmp150__ |= ( pSrc->preauth << 0 ); - tmp150__ |= ( pSrc->reserved << 1 ); - frameshtons(pCtx, pBuf, tmp150__, 0); + tmp144__ = 0U; + tmp144__ |= ( pSrc->preauth << 0 ); + tmp144__ |= ( pSrc->reserved << 1 ); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + + frameshtons(pCtx, pBuf, tmp144__, 0); *pnConsumed += 2; pBuf += 2; nBuf -= 2 ; @@ -31179,7 +32778,7 @@ tANI_U32 dot11fPackIeWMMCaps(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp151__; + tANI_U8 tmp145__; nNeeded += 2; while ( pSrc->present ) { @@ -31201,13 +32800,16 @@ tANI_U32 dot11fPackIeWMMCaps(tpAniSirGlobal pCtx, *pBuf = pSrc->version; *pnConsumed += 1; pBuf += 1; - tmp151__ = 0U; - tmp151__ |= ( pSrc->reserved << 0 ); - tmp151__ |= ( pSrc->qack << 4 ); - tmp151__ |= ( pSrc->queue_request << 5 ); - tmp151__ |= ( pSrc->txop_request << 6 ); - tmp151__ |= ( pSrc->more_ack << 7 ); - *pBuf = tmp151__; + tmp145__ = 0U; + tmp145__ |= ( pSrc->reserved << 0 ); + tmp145__ |= ( pSrc->qack << 4 ); + tmp145__ |= ( pSrc->queue_request << 5 ); + tmp145__ |= ( pSrc->txop_request << 6 ); + tmp145__ |= ( pSrc->more_ack << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp145__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -31230,7 +32832,7 @@ tANI_U32 dot11fPackIeWMMInfoAp(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp152__; + tANI_U8 tmp146__; nNeeded += 2; while ( pSrc->present ) { @@ -31252,11 +32854,14 @@ tANI_U32 dot11fPackIeWMMInfoAp(tpAniSirGlobal pCtx, *pBuf = pSrc->version; *pnConsumed += 1; pBuf += 1; - tmp152__ = 0U; - tmp152__ |= ( pSrc->param_set_count << 0 ); - tmp152__ |= ( pSrc->reserved << 4 ); - tmp152__ |= ( pSrc->uapsd << 7 ); - *pBuf = tmp152__; + tmp146__ = 0U; + tmp146__ |= ( pSrc->param_set_count << 0 ); + tmp146__ |= ( pSrc->reserved << 4 ); + tmp146__ |= ( pSrc->uapsd << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp146__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -31279,7 +32884,7 @@ tANI_U32 dot11fPackIeWMMInfoStation(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; - tANI_U8 tmp153__; + tANI_U8 tmp147__; nNeeded += 2; while ( pSrc->present ) { @@ -31301,15 +32906,18 @@ tANI_U32 dot11fPackIeWMMInfoStation(tpAniSirGlobal pCtx, *pBuf = pSrc->version; *pnConsumed += 1; pBuf += 1; - tmp153__ = 0U; - tmp153__ |= ( pSrc->acvo_uapsd << 0 ); - tmp153__ |= ( pSrc->acvi_uapsd << 1 ); - tmp153__ |= ( pSrc->acbk_uapsd << 2 ); - tmp153__ |= ( pSrc->acbe_uapsd << 3 ); - tmp153__ |= ( pSrc->reserved1 << 4 ); - tmp153__ |= ( pSrc->max_sp_length << 5 ); - tmp153__ |= ( pSrc->reserved2 << 7 ); - *pBuf = tmp153__; + tmp147__ = 0U; + tmp147__ |= ( pSrc->acvo_uapsd << 0 ); + tmp147__ |= ( pSrc->acvi_uapsd << 1 ); + tmp147__ |= ( pSrc->acbk_uapsd << 2 ); + tmp147__ |= ( pSrc->acbe_uapsd << 3 ); + tmp147__ |= ( pSrc->reserved1 << 4 ); + tmp147__ |= ( pSrc->max_sp_length << 5 ); + tmp147__ |= ( pSrc->reserved2 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp147__; *pnConsumed += 1; // fieldsEndFlag = 1 nBuf -= 1 ; @@ -31332,14 +32940,14 @@ tANI_U32 dot11fPackIeWMMParams(tpAniSirGlobal pCtx, tANI_U8* pIeLen = 0; tANI_U32 nConsumedOnEntry = *pnConsumed; tANI_U32 nNeeded = 0U; + tANI_U8 tmp148__; + tANI_U8 tmp149__; + tANI_U8 tmp150__; + tANI_U8 tmp151__; + tANI_U8 tmp152__; + tANI_U8 tmp153__; tANI_U8 tmp154__; tANI_U8 tmp155__; - tANI_U8 tmp156__; - tANI_U8 tmp157__; - tANI_U8 tmp158__; - tANI_U8 tmp159__; - tANI_U8 tmp160__; - tANI_U8 tmp161__; nNeeded += 19; while ( pSrc->present ) { @@ -31367,76 +32975,100 @@ tANI_U32 dot11fPackIeWMMParams(tpAniSirGlobal pCtx, *pBuf = pSrc->reserved2; *pnConsumed += 1; pBuf += 1; - tmp154__ = 0U; - tmp154__ |= ( pSrc->acbe_aifsn << 0 ); - tmp154__ |= ( pSrc->acbe_acm << 4 ); - tmp154__ |= ( pSrc->acbe_aci << 5 ); - tmp154__ |= ( pSrc->unused1 << 7 ); - *pBuf = tmp154__; + tmp148__ = 0U; + tmp148__ |= ( pSrc->acbe_aifsn << 0 ); + tmp148__ |= ( pSrc->acbe_acm << 4 ); + tmp148__ |= ( pSrc->acbe_aci << 5 ); + tmp148__ |= ( pSrc->unused1 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp148__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp155__ = 0U; - tmp155__ |= ( pSrc->acbe_acwmin << 0 ); - tmp155__ |= ( pSrc->acbe_acwmax << 4 ); - *pBuf = tmp155__; + tmp149__ = 0U; + tmp149__ |= ( pSrc->acbe_acwmin << 0 ); + tmp149__ |= ( pSrc->acbe_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp149__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbe_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp156__ = 0U; - tmp156__ |= ( pSrc->acbk_aifsn << 0 ); - tmp156__ |= ( pSrc->acbk_acm << 4 ); - tmp156__ |= ( pSrc->acbk_aci << 5 ); - tmp156__ |= ( pSrc->unused2 << 7 ); - *pBuf = tmp156__; + tmp150__ = 0U; + tmp150__ |= ( pSrc->acbk_aifsn << 0 ); + tmp150__ |= ( pSrc->acbk_acm << 4 ); + tmp150__ |= ( pSrc->acbk_aci << 5 ); + tmp150__ |= ( pSrc->unused2 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp150__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp157__ = 0U; - tmp157__ |= ( pSrc->acbk_acwmin << 0 ); - tmp157__ |= ( pSrc->acbk_acwmax << 4 ); - *pBuf = tmp157__; + tmp151__ = 0U; + tmp151__ |= ( pSrc->acbk_acwmin << 0 ); + tmp151__ |= ( pSrc->acbk_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp151__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acbk_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp158__ = 0U; - tmp158__ |= ( pSrc->acvi_aifsn << 0 ); - tmp158__ |= ( pSrc->acvi_acm << 4 ); - tmp158__ |= ( pSrc->acvi_aci << 5 ); - tmp158__ |= ( pSrc->unused3 << 7 ); - *pBuf = tmp158__; + tmp152__ = 0U; + tmp152__ |= ( pSrc->acvi_aifsn << 0 ); + tmp152__ |= ( pSrc->acvi_acm << 4 ); + tmp152__ |= ( pSrc->acvi_aci << 5 ); + tmp152__ |= ( pSrc->unused3 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp152__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp159__ = 0U; - tmp159__ |= ( pSrc->acvi_acwmin << 0 ); - tmp159__ |= ( pSrc->acvi_acwmax << 4 ); - *pBuf = tmp159__; + tmp153__ = 0U; + tmp153__ |= ( pSrc->acvi_acwmin << 0 ); + tmp153__ |= ( pSrc->acvi_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp153__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; frameshtons(pCtx, pBuf, pSrc->acvi_txoplimit, 0); *pnConsumed += 2; pBuf += 2; - tmp160__ = 0U; - tmp160__ |= ( pSrc->acvo_aifsn << 0 ); - tmp160__ |= ( pSrc->acvo_acm << 4 ); - tmp160__ |= ( pSrc->acvo_aci << 5 ); - tmp160__ |= ( pSrc->unused4 << 7 ); - *pBuf = tmp160__; + tmp154__ = 0U; + tmp154__ |= ( pSrc->acvo_aifsn << 0 ); + tmp154__ |= ( pSrc->acvo_acm << 4 ); + tmp154__ |= ( pSrc->acvo_aci << 5 ); + tmp154__ |= ( pSrc->unused4 << 7 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp154__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; - tmp161__ = 0U; - tmp161__ |= ( pSrc->acvo_acwmin << 0 ); - tmp161__ |= ( pSrc->acvo_acwmax << 4 ); - *pBuf = tmp161__; + tmp155__ = 0U; + tmp155__ |= ( pSrc->acvo_acwmin << 0 ); + tmp155__ |= ( pSrc->acvo_acwmax << 4 ); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + + *pBuf = tmp155__; *pnConsumed += 1; pBuf += 1; nBuf -= 1 ; @@ -33108,57 +34740,8 @@ tANI_U32 dot11fPackAssocRequest(tpAniSirGlobal pCtx, tDot11fAssocRequest *pFrm, } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -34263,57 +35846,8 @@ tANI_U32 dot11fPackAssocResponse(tpAniSirGlobal pCtx, tDot11fAssocResponse *pFrm } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCRESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -35748,57 +37282,8 @@ tANI_U32 dot11fPackBeacon(tpAniSirGlobal pCtx, tDot11fBeacon *pFrm, tANI_U8 *pBu } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -36779,57 +38264,8 @@ tANI_U32 dot11fPackBeacon2(tpAniSirGlobal pCtx, tDot11fBeacon2 *pFrm, tANI_U8 *p } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACON2), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -37991,57 +39427,8 @@ tANI_U32 dot11fPackBeaconIEs(tpAniSirGlobal pCtx, tDot11fBeaconIEs *pFrm, tANI_U } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_BEACONIES), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -41172,57 +42559,8 @@ tANI_U32 dot11fPackProbeResponse(tpAniSirGlobal pCtx, tDot11fProbeResponse *pFrm } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_PROBERESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -42521,57 +43859,8 @@ tANI_U32 dot11fPackReAssocRequest(tpAniSirGlobal pCtx, tDot11fReAssocRequest *pF } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCREQUEST), FRFL("OperatingMode:\n")); if (!pFrm->OperatingMode.present) @@ -43683,57 +44972,8 @@ tANI_U32 dot11fPackReAssocResponse(tpAniSirGlobal pCtx, tDot11fReAssocResponse * } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_REASSOCRESPONSE), FRFL("OBSSScanParameters:\n")); if (!pFrm->OBSSScanParameters.present) @@ -43985,57 +45225,8 @@ tANI_U32 dot11fPackTDLSDisRsp(tpAniSirGlobal pCtx, tDot11fTDLSDisRsp *pFrm, tANI } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSDISRSP), FRFL("FTInfo:\n")); if (!pFrm->FTInfo.present) @@ -44707,57 +45898,8 @@ tANI_U32 dot11fPackTDLSSetupReq(tpAniSirGlobal pCtx, tDot11fTDLSSetupReq *pFrm, } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPREQ), FRFL("SuppOperatingClasses:\n")); if (!pFrm->SuppOperatingClasses.present) @@ -45115,57 +46257,8 @@ tANI_U32 dot11fPackTDLSSetupRsp(tpAniSirGlobal pCtx, tDot11fTDLSSetupRsp *pFrm, } else { - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("bssCoexistMgmtSupport (1): %d\n"), pFrm->ExtCap.bssCoexistMgmtSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved1 (1): %d\n"), pFrm->ExtCap.reserved1); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("extChanSwitch (1): %d\n"), pFrm->ExtCap.extChanSwitch); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved2 (1): %d\n"), pFrm->ExtCap.reserved2); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("psmpCap (1): %d\n"), pFrm->ExtCap.psmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved3 (1): %d\n"), pFrm->ExtCap.reserved3); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("spsmpCap (1): %d\n"), pFrm->ExtCap.spsmpCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("event (1): %d\n"), pFrm->ExtCap.event); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("diagnostics (1): %d\n"), pFrm->ExtCap.diagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("multiDiagnostics (1): %d\n"), pFrm->ExtCap.multiDiagnostics); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("locTracking (1): %d\n"), pFrm->ExtCap.locTracking); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("FMS (1): %d\n"), pFrm->ExtCap.FMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("proxyARPService (1): %d\n"), pFrm->ExtCap.proxyARPService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("coLocIntfReporting (1): %d\n"), pFrm->ExtCap.coLocIntfReporting); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("civicLoc (1): %d\n"), pFrm->ExtCap.civicLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("geospatialLoc (1): %d\n"), pFrm->ExtCap.geospatialLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TFS (1): %d\n"), pFrm->ExtCap.TFS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("wnmSleepMode (1): %d\n"), pFrm->ExtCap.wnmSleepMode); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("timBroadcast (1): %d\n"), pFrm->ExtCap.timBroadcast); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("bssTransition (1): %d\n"), pFrm->ExtCap.bssTransition); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("qosTrafficCap (1): %d\n"), pFrm->ExtCap.qosTrafficCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("acStaCnt (1): %d\n"), pFrm->ExtCap.acStaCnt); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("multiBSSID (1): %d\n"), pFrm->ExtCap.multiBSSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("timingMeas (1): %d\n"), pFrm->ExtCap.timingMeas); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("chanUsage (1): %d\n"), pFrm->ExtCap.chanUsage); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("ssidList (1): %d\n"), pFrm->ExtCap.ssidList); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("DMS (1): %d\n"), pFrm->ExtCap.DMS); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("UTCTSFOffset (1): %d\n"), pFrm->ExtCap.UTCTSFOffset); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSPeerUAPSDBufferSTA (1): %d\n"), pFrm->ExtCap.TDLSPeerUAPSDBufferSTA); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSPeerPSMSupp (1): %d\n"), pFrm->ExtCap.TDLSPeerPSMSupp); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSChannelSwitching (1): %d\n"), pFrm->ExtCap.TDLSChannelSwitching); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("interworkingService (1): %d\n"), pFrm->ExtCap.interworkingService); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("qosMap (1): %d\n"), pFrm->ExtCap.qosMap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("EBR (1): %d\n"), pFrm->ExtCap.EBR); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("sspnInterface (1): %d\n"), pFrm->ExtCap.sspnInterface); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved4 (1): %d\n"), pFrm->ExtCap.reserved4); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("msgCFCap (1): %d\n"), pFrm->ExtCap.msgCFCap); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSSupport (1): %d\n"), pFrm->ExtCap.TDLSSupport); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSProhibited (1): %d\n"), pFrm->ExtCap.TDLSProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSChanSwitProhibited (1): %d\n"), pFrm->ExtCap.TDLSChanSwitProhibited); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("rejectUnadmittedTraffic (1): %d\n"), pFrm->ExtCap.rejectUnadmittedTraffic); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("serviceIntervalGranularity (3): %d\n"), pFrm->ExtCap.serviceIntervalGranularity); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("identifierLoc (1): %d\n"), pFrm->ExtCap.identifierLoc); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("uapsdCoexistence (1): %d\n"), pFrm->ExtCap.uapsdCoexistence); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("wnmNotification (1): %d\n"), pFrm->ExtCap.wnmNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved5 (1): %d\n"), pFrm->ExtCap.reserved5); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("UTF8SSID (1): %d\n"), pFrm->ExtCap.UTF8SSID); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved6 (12): %d\n"), pFrm->ExtCap.reserved6); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("TDLSWiderBW (1): %d\n"), pFrm->ExtCap.TDLSWiderBW); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("operModeNotification (1): %d\n"), pFrm->ExtCap.operModeNotification); - FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("reserved7 (1): %d\n"), pFrm->ExtCap.reserved7); + FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("num_bytes: %d.\n"), pFrm->ExtCap.num_bytes); + FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), ( tANI_U8* ) pFrm->ExtCap.bytes, pFrm->ExtCap.num_bytes); } FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_TDLSSETUPRSP), FRFL("SuppOperatingClasses:\n")); if (!pFrm->SuppOperatingClasses.present) diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c index d28ac35aeb7b..04bae6cef9a4 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c @@ -164,6 +164,7 @@ static inline VOS_MODULE_ID getVosModuleId(tANI_U8 modId) switch(modId) { case SIR_HAL_MODULE_ID: + case SIR_HAL_EXT_MODULE_ID: case SIR_PHY_MODULE_ID: return VOS_MODULE_ID_WDA; case SIR_PMM_MODULE_ID: diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logDump.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logDump.c index 9569884cf3c8..3e6b1f98060c 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logDump.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logDump.c @@ -173,6 +173,7 @@ char* dumpLOG( tpAniSirGlobal pMac, char *p ) switch (i) { case SIR_HAL_MODULE_ID: p += log_sprintf( pMac, p, "HAL "); break; + case SIR_HAL_EXT_MODULE_ID: p += log_sprintf( pMac, p, "HAL "); break; case SIR_CFG_MODULE_ID: p += log_sprintf( pMac, p, "CFG "); break; case SIR_LIM_MODULE_ID: p += log_sprintf( pMac, p, "LIM "); break; case SIR_ARQ_MODULE_ID: p += log_sprintf( pMac, p, "ARQ "); break; @@ -414,7 +415,7 @@ int logRtaiDump( tpAniSirGlobal pMac, tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2 } if(cmd <= HAL_LOG_DUMP_CMD_END) { - WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, p); + WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, p, 0); } else { diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/macTrace.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/macTrace.c index b2572eef93f0..0003a526f7b4 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/macTrace.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/macTrace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ \author Sunit Bhatia - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -55,7 +52,9 @@ #include "csrNeighborRoam.h" #include "csrInternal.h" #include "limGlobal.h" +#include "limTypes.h" #include "wlan_qct_tl.h" +#include "wlan_qct_wda.h" #include "vos_trace.h" #ifdef TRACE_RECORD @@ -433,10 +432,10 @@ tANI_U8* macTraceGetSmeMsgString( tANI_U16 smeMsg ) CASE_RETURN_STRING(eWNI_SME_SET_APWPARSNIEs_REQ); CASE_RETURN_STRING(eWNI_SME_UPPER_LAYER_ASSOC_CNF); CASE_RETURN_STRING(eWNI_SME_HIDE_SSID_REQ); + CASE_RETURN_STRING(eWNI_SME_CHNG_MCC_BEACON_INTERVAL); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHANNEL_REQ); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_IND); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RSP); - CASE_RETURN_STRING(eWNI_SME_MGMT_FRM_IND); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RDY_IND); CASE_RETURN_STRING(eWNI_SME_SEND_ACTION_FRAME_IND); CASE_RETURN_STRING(eWNI_SME_ACTION_FRAME_SEND_CNF); @@ -445,6 +444,7 @@ tANI_U8* macTraceGetSmeMsgString( tANI_U16 smeMsg ) CASE_RETURN_STRING(eWNI_SME_CLEAR_DFS_CHANNEL_LIST); CASE_RETURN_STRING(eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); CASE_RETURN_STRING(eWNI_SME_GET_SNR_REQ); + CASE_RETURN_STRING(eWNI_SME_LOST_LINK_PARAMS_IND); CASE_RETURN_STRING(eWNI_PMC_MSG_TYPES_BEGIN); //General Power Save Messages @@ -516,18 +516,58 @@ tANI_U8* macTraceGetSmeMsgString( tANI_U16 smeMsg ) #ifdef WLAN_FEATURE_GTK_OFFLOAD CASE_RETURN_STRING(eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP); #endif // WLAN_FEATURE_GTK_OFFLOAD + CASE_RETURN_STRING(eWNI_SME_ROAM_SCAN_OFFLOAD_RSP); +#ifdef FEATURE_WLAN_LPHB + CASE_RETURN_STRING(eWNI_SME_LPHB_IND); +#endif /* FEATURE_WLAN_LPHB */ +#ifdef FEATURE_WLAN_CH_AVOID + CASE_RETURN_STRING(eWNI_SME_CH_AVOID_IND); +#endif /* FEATURE_WLAN_CH_AVOID */ #ifdef WLAN_WAKEUP_EVENTS CASE_RETURN_STRING(eWNI_SME_WAKE_REASON_IND); #endif // WLAN_WAKEUP_EVENTS CASE_RETURN_STRING(eWNI_SME_EXCLUDE_UNENCRYPTED); CASE_RETURN_STRING(eWNI_SME_RSSI_IND); //RSSI indication from TL to be serialized on MC thread - CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END); +#ifdef FEATURE_WLAN_TDLS + CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_REQ); + CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_RSP); + CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_REQ); + CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_RSP); + CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_REQ); + CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_RSP); + CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_IND); + CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_ALL_PEER_IND); + CASE_RETURN_STRING(eWNI_SME_MGMT_FRM_TX_COMPLETION_IND); + CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_REQ); + CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_RSP); + CASE_RETURN_STRING(eWNI_SME_TDLS_CHANNEL_SWITCH_REQ); + CASE_RETURN_STRING(eWNI_SME_TDLS_CHANNEL_SWITCH_RSP); +#endif + CASE_RETURN_STRING(eWNI_SME_SET_BCN_FILTER_REQ); + CASE_RETURN_STRING(eWNI_SME_RESET_AP_CAPS_CHANGED); +#ifdef WLAN_FEATURE_11W + CASE_RETURN_STRING(eWNI_SME_UNPROT_MGMT_FRM_IND); +#endif + CASE_RETURN_STRING(eWNI_SME_CANDIDATE_FOUND_IND); + CASE_RETURN_STRING(eWNI_SME_HANDOFF_REQ); CASE_RETURN_STRING(eWNI_SME_GET_ROAM_RSSI_REQ); CASE_RETURN_STRING(eWNI_SME_GET_ROAM_RSSI_RSP); CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_REQ); CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_RSP); + CASE_RETURN_STRING(eWNI_SME_TSM_IE_IND); CASE_RETURN_STRING(eWNI_SME_HT40_OBSS_SCAN_IND); CASE_RETURN_STRING(eWNI_SME_HT40_STOP_OBSS_SCAN_IND); + CASE_RETURN_STRING(eWNI_SME_NAN_EVENT); + CASE_RETURN_STRING(eWNI_SME_ENCRYPT_MSG_RSP); +#ifdef WLAN_FEATURE_AP_HT40_24G + CASE_RETURN_STRING(eWNI_SME_SET_HT_2040_MODE); + CASE_RETURN_STRING(eWNI_SME_2040_COEX_IND); +#endif + CASE_RETURN_STRING(eWNI_SME_MAC_SPOOF_ADDR_IND); + CASE_RETURN_STRING(eWNI_SME_UPDATE_MAX_RATE_IND); + CASE_RETURN_STRING(eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ); + CASE_RETURN_STRING(eWNI_SME_REGISTER_MGMT_FRAME_CB); + CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END); default: return( (tANI_U8*)"UNKNOWN" ); break; @@ -675,6 +715,9 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) CASE_RETURN_STRING(WDA_TIMER_CHIP_MONITOR_TIMEOUT); CASE_RETURN_STRING(WDA_TIMER_TRAFFIC_ACTIVITY_REQ); CASE_RETURN_STRING(WDA_TIMER_ADC_RSSI_STATS); +#ifdef WLAN_FEATURE_11W + CASE_RETURN_STRING(WDA_EXCLUDE_UNENCRYPTED_IND); +#endif #ifdef FEATURE_WLAN_ESE CASE_RETURN_STRING(WDA_TSM_STATS_REQ); CASE_RETURN_STRING(WDA_TSM_STATS_RSP); @@ -725,6 +768,8 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) #endif //SUPPORT_BEACON_FILTER CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_REQ); CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_RSP); + CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_PER_BAND_RSP); + CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_PER_BAND_REQ); CASE_RETURN_STRING(WDA_SEND_MSG_COMPLETE); CASE_RETURN_STRING(WDA_SET_HOST_OFFLOAD); CASE_RETURN_STRING(WDA_SET_KEEP_ALIVE); @@ -734,7 +779,10 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) CASE_RETURN_STRING(WDA_ADD_STA_SELF_REQ); CASE_RETURN_STRING(WDA_DEL_STA_SELF_REQ); CASE_RETURN_STRING(WDA_SET_P2P_GO_NOA_REQ); + CASE_RETURN_STRING(WDA_SET_TDLS_LINK_ESTABLISH_REQ); + CASE_RETURN_STRING(WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP); CASE_RETURN_STRING(WDA_TX_COMPLETE_TIMEOUT_IND); + CASE_RETURN_STRING(WDA_TIMER_TRAFFIC_STATS_IND); CASE_RETURN_STRING(WDA_WLAN_SUSPEND_IND); CASE_RETURN_STRING(WDA_WLAN_RESUME_REQ); CASE_RETURN_STRING(WDA_MSG_TYPES_END); @@ -755,6 +803,7 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) #endif // FEATURE_WLAN_SCAN_PNO #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD CASE_RETURN_STRING(WDA_ROAM_SCAN_OFFLOAD_REQ); + CASE_RETURN_STRING(WDA_ROAM_SCAN_OFFLOAD_RSP); #endif #ifdef WLAN_WAKEUP_EVENTS CASE_RETURN_STRING(WDA_WAKE_REASON_IND); @@ -775,11 +824,69 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) CASE_RETURN_STRING(WDA_SET_TM_LEVEL_REQ); #ifdef WLAN_FEATURE_11AC CASE_RETURN_STRING(WDA_UPDATE_OP_MODE); +#endif + CASE_RETURN_STRING(WDA_GET_ROAM_RSSI_REQ); + CASE_RETURN_STRING(WDA_GET_ROAM_RSSI_RSP); + CASE_RETURN_STRING(WDA_NAN_REQUEST); + CASE_RETURN_STRING(WDA_START_SCAN_OFFLOAD_REQ); + CASE_RETURN_STRING(WDA_START_SCAN_OFFLOAD_RSP); + CASE_RETURN_STRING(WDA_STOP_SCAN_OFFLOAD_REQ); + CASE_RETURN_STRING(WDA_STOP_SCAN_OFFLOAD_RSP); + CASE_RETURN_STRING(WDA_UPDATE_CHAN_LIST_RSP); + CASE_RETURN_STRING(WDA_RX_SCAN_EVENT); + CASE_RETURN_STRING(WDA_IBSS_PEER_INACTIVITY_IND); +#ifdef FEATURE_WLAN_LPHB + CASE_RETURN_STRING(WDA_LPHB_WAIT_EXPIRE_IND); #endif #ifdef FEATURE_WLAN_BATCH_SCAN CASE_RETURN_STRING(WDA_SET_BATCH_SCAN_REQ); + CASE_RETURN_STRING(WDA_SET_BATCH_SCAN_RSP); + CASE_RETURN_STRING(WDA_STOP_BATCH_SCAN_IND); CASE_RETURN_STRING(WDA_TRIGGER_BATCH_SCAN_RESULT_IND); #endif + CASE_RETURN_STRING(WDA_UPDATE_CHAN_LIST_REQ); + CASE_RETURN_STRING(WDA_GET_BCN_MISS_RATE_REQ); + CASE_RETURN_STRING(WDA_DHCP_START_IND); + CASE_RETURN_STRING(WDA_DHCP_STOP_IND); + CASE_RETURN_STRING(WDA_MGMT_LOGGING_INIT_REQ); +#ifdef FEATURE_WLAN_LPHB + CASE_RETURN_STRING(WDA_LPHB_CONF_REQ); +#endif /* FEATURE_WLAN_LPHB */ + CASE_RETURN_STRING(WDA_ADD_PERIODIC_TX_PTRN_IND); + CASE_RETURN_STRING(WDA_DEL_PERIODIC_TX_PTRN_IND); + CASE_RETURN_STRING(WDA_RATE_UPDATE_IND); +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + CASE_RETURN_STRING(WDA_LINK_LAYER_STATS_SET_REQ); + CASE_RETURN_STRING(WDA_LINK_LAYER_STATS_GET_REQ); + CASE_RETURN_STRING(WDA_LINK_LAYER_STATS_CLEAR_REQ); +#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +#ifdef WLAN_FEATURE_EXTSCAN + CASE_RETURN_STRING(WDA_EXTSCAN_GET_CAPABILITIES_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_START_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_STOP_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ); + CASE_RETURN_STRING(WDA_EXTSCAN_GET_CACHED_RESULTS_REQ); +#endif /* WLAN_FEATURE_EXTSCAN */ + CASE_RETURN_STRING(WDA_HT40_OBSS_SCAN_IND); + CASE_RETURN_STRING(WDA_HT40_OBSS_STOP_SCAN_IND); + CASE_RETURN_STRING(WDA_ENCRYPT_MSG_REQ); + CASE_RETURN_STRING(WDA_ENCRYPT_MSG_RSP); +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + CASE_RETURN_STRING(WDA_LINK_LAYER_STATS_RESULTS_RSP); +#endif +#ifdef FEATURE_WLAN_TDLS + CASE_RETURN_STRING(WDA_SET_TDLS_CHAN_SWITCH_REQ); + CASE_RETURN_STRING(WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP); +#endif + CASE_RETURN_STRING(WDA_FW_STATS_GET_REQ); + CASE_RETURN_STRING(WDA_SET_RTS_CTS_HTVHT); + CASE_RETURN_STRING(WDA_MON_START_REQ); + CASE_RETURN_STRING(WDA_MON_STOP_REQ); + CASE_RETURN_STRING(WDA_SPOOF_MAC_ADDR_REQ); + CASE_RETURN_STRING(WDA_LOST_LINK_PARAMS_IND); default: return((tANI_U8*) "UNKNOWN" ); break; @@ -841,8 +948,45 @@ tANI_U8* macTraceGetLimMsgString( tANI_U16 limMsg ) CASE_RETURN_STRING(SIR_LIM_DISASSOC_ACK_TIMEOUT); CASE_RETURN_STRING(SIR_LIM_DEAUTH_ACK_TIMEOUT); CASE_RETURN_STRING(SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT); + CASE_RETURN_STRING(SIR_LIM_AUTH_RETRY_TIMEOUT); CASE_RETURN_STRING(SIR_LIM_MSG_TYPES_END); - + CASE_RETURN_STRING(LIM_MLM_SCAN_REQ); + CASE_RETURN_STRING(LIM_MLM_SCAN_CNF); + CASE_RETURN_STRING(LIM_MLM_START_REQ); + CASE_RETURN_STRING(LIM_MLM_START_CNF); + CASE_RETURN_STRING(LIM_MLM_JOIN_REQ); + CASE_RETURN_STRING(LIM_MLM_JOIN_CNF); + CASE_RETURN_STRING(LIM_MLM_AUTH_REQ); + CASE_RETURN_STRING(LIM_MLM_AUTH_CNF); + CASE_RETURN_STRING(LIM_MLM_AUTH_IND); + CASE_RETURN_STRING(LIM_MLM_ASSOC_REQ); + CASE_RETURN_STRING(LIM_MLM_ASSOC_CNF); + CASE_RETURN_STRING(LIM_MLM_ASSOC_IND); + CASE_RETURN_STRING(LIM_MLM_DISASSOC_REQ); + CASE_RETURN_STRING(LIM_MLM_DISASSOC_CNF); + CASE_RETURN_STRING(LIM_MLM_DISASSOC_IND); + CASE_RETURN_STRING(LIM_MLM_REASSOC_REQ); + CASE_RETURN_STRING(LIM_MLM_REASSOC_CNF); + CASE_RETURN_STRING(LIM_MLM_REASSOC_IND); + CASE_RETURN_STRING(LIM_MLM_DEAUTH_REQ); + CASE_RETURN_STRING(LIM_MLM_DEAUTH_CNF); + CASE_RETURN_STRING(LIM_MLM_DEAUTH_IND); + CASE_RETURN_STRING(LIM_MLM_TSPEC_REQ); + CASE_RETURN_STRING(LIM_MLM_TSPEC_CNF); + CASE_RETURN_STRING(LIM_MLM_SETKEYS_REQ); + CASE_RETURN_STRING(LIM_MLM_SETKEYS_CNF); + CASE_RETURN_STRING(LIM_MLM_PURGE_STA_IND); + CASE_RETURN_STRING(LIM_MLM_ADDBA_REQ); + CASE_RETURN_STRING(LIM_MLM_ADDBA_CNF); + CASE_RETURN_STRING(LIM_MLM_ADDBA_RSP); + CASE_RETURN_STRING(LIM_MLM_DELBA_REQ); + CASE_RETURN_STRING(LIM_MLM_DELBA_CNF); + CASE_RETURN_STRING(LIM_MLM_REMOVEKEY_REQ); + CASE_RETURN_STRING(LIM_MLM_REMOVEKEY_CNF); +#ifdef FEATURE_OEM_DATA_SUPPORT + CASE_RETURN_STRING(LIM_MLM_OEM_DATA_REQ); + CASE_RETURN_STRING(LIM_MLM_OEM_DATA_CNF); +#endif default: return( (tANI_U8*)"UNKNOWN" ); break; @@ -860,7 +1004,9 @@ tANI_U8* macTraceGetCfgMsgString( tANI_U16 cfgMsg ) CASE_RETURN_STRING(WNI_CFG_SET_CNF); CASE_RETURN_STRING(SIR_CFG_PARAM_UPDATE_IND); CASE_RETURN_STRING(SIR_CFG_DOWNLOAD_COMPLETE_IND); - + CASE_RETURN_STRING(WNI_CFG_DNLD_RSP); + CASE_RETURN_STRING(WNI_CFG_GET_REQ); + CASE_RETURN_STRING(WNI_CFG_SET_REQ); CASE_RETURN_STRING(WNI_CFG_SET_REQ_NO_RSP); default: return( (tANI_U8*)"UNKNOWN" ); diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/parserApi.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/parserApi.c index a053a4665f17..7b0200da1397 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/parserApi.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/parserApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -141,17 +141,17 @@ swapBitField32(tANI_U32 in, tANI_U32 *out) inline static void __printWMMParams(tpAniSirGlobal pMac, tDot11fIEWMMParams *pWmm) { - limLog(pMac, LOG1, FL("WMM Parameters Received: \n")); - limLog(pMac, LOG1, FL("BE: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"), + limLog(pMac, LOG1, FL("WMM Parameters Received: ")); + limLog(pMac, LOG1, FL("BE: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), pWmm->acbe_aifsn, pWmm->acbe_acm, pWmm->acbe_aci, pWmm->acbe_acwmin, pWmm->acbe_acwmax, pWmm->acbe_txoplimit); - limLog(pMac, LOG1, FL("BK: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"), + limLog(pMac, LOG1, FL("BK: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), pWmm->acbk_aifsn, pWmm->acbk_acm, pWmm->acbk_aci, pWmm->acbk_acwmin, pWmm->acbk_acwmax, pWmm->acbk_txoplimit); - limLog(pMac, LOG1, FL("VI: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"), + limLog(pMac, LOG1, FL("VI: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), pWmm->acvi_aifsn, pWmm->acvi_acm, pWmm->acvi_aci, pWmm->acvi_acwmin, pWmm->acvi_acwmax, pWmm->acvi_txoplimit); - limLog(pMac, LOG1, FL("VO: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"), + limLog(pMac, LOG1, FL("VO: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), pWmm->acvo_aifsn, pWmm->acvo_acm, pWmm->acvo_aci, pWmm->acvo_acwmin, pWmm->acvo_acwmax, pWmm->acvo_txoplimit); return; @@ -204,7 +204,7 @@ int FindIELocation( tpAniSirGlobal pMac, // & if no more IE, bytesLeft <= (tANI_U16)( ieLen ) ) { - dot11fLog( pMac, LOG3, FL("No IE (%d) in FindIELocation.\n"), EID ); + dot11fLog( pMac, LOG3, FL("No IE (%d) in FindIELocation."), EID ); return ret_val; } bytesLeft -= ieLen; @@ -228,7 +228,7 @@ PopulateDot11fCapabilities(tpAniSirGlobal pMac, if ( eSIR_SUCCESS != nSirStatus ) { dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b" - "itfield from CFG (%d).\n"), nSirStatus ); + "itfield from CFG (%d)."), nSirStatus ); return nSirStatus; } @@ -255,7 +255,7 @@ PopulateDot11fCapabilities2(tpAniSirGlobal pMac, if ( eSIR_SUCCESS != nSirStatus ) { dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b" - "itfield from CFG (%d).\n"), nSirStatus ); + "itfield from CFG (%d)."), nSirStatus ); return nSirStatus; } @@ -349,7 +349,7 @@ PopulateDot11fCountry(tpAniSirGlobal pMac, if(len > MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE) { - dot11fLog( pMac, LOGE, FL("len:%d is out of bounds, resetting.\n"), len); + dot11fLog( pMac, LOGE, FL("len:%d is out of bounds, resetting."), len); len = MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE; } @@ -367,7 +367,7 @@ PopulateDot11fDSParams(tpAniSirGlobal pMac, tDot11fIEDSParams *pDot11f, tANI_U8 channel, tpPESession psessionEntry) { - if ((IS_24G_CH(channel)) || pMac->rrm.rrmPEContext.rrmEnable) + if (IS_24G_CH(channel)) { // .11b/g mode PHY => Include the DS Parameter Set IE: pDot11f->curr_channel = channel; @@ -441,7 +441,7 @@ PopulateDot11fERPInfo(tpAniSirGlobal pMac, val = psessionEntry->cfgProtection.fromllb; if(!val ){ - dot11fLog( pMac, LOGE, FL("11B protection not enabled. Not populating ERP IE %d\n" ),val ); + dot11fLog( pMac, LOGE, FL("11B protection not enabled. Not populating ERP IE %d" ),val ); return eSIR_SUCCESS; } @@ -484,7 +484,7 @@ PopulateDot11fExtSuppRates(tpAniSirGlobal pMac, tANI_U8 nChannelNum, { tSirRetStatus nSirStatus; tANI_U32 nRates = 0; - tANI_U8 rates[WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN]; + tANI_U8 rates[SIR_MAC_RATESET_EID_MAX]; /* Use the ext rates present in session entry whenever nChannelNum is set to OPERATIONAL else use the ext supported rate set from CFG, which is fixed and does not change dynamically and is used for @@ -501,7 +501,7 @@ PopulateDot11fExtSuppRates(tpAniSirGlobal pMac, tANI_U8 nChannelNum, else { dot11fLog( pMac, LOGE, FL("no session context exists while" - " populating Operational Rate Set\n")); + " populating Operational Rate Set")); } } else if ( HIGHEST_24GHZ_CHANNEL_NUM >= nChannelNum ) @@ -605,9 +605,6 @@ PopulateDot11fHTCaps(tpAniSirGlobal pMac, pDot11f->shortGI40MHz = 0; } - dot11fLog(pMac, LOG2, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d\n"), - pDot11f->supportedChannelWidthSet, pDot11f->mimoPowerSave, pDot11f->greenField, - pDot11f->shortGI20MHz, pDot11f->shortGI40MHz, pDot11f->dsssCckMode40MHz); CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_AMPDU_PARAMS, nCfgValue ); @@ -619,9 +616,6 @@ PopulateDot11fHTCaps(tpAniSirGlobal pMac, pDot11f->mpduDensity = pHTParametersInfo->mpduDensity; pDot11f->reserved1 = pHTParametersInfo->reserved; - dot11fLog( pMac, LOG2, FL( "AMPDU Param: %x\n" ), nCfgValue); - - CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_MCS_SET, pDot11f->supportedMCSSet, nCfgLen, SIZE_OF_SUPPORTED_MCS_SET ); @@ -679,32 +673,32 @@ void limLogVHTCap(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pDot11f) { #ifdef DUMP_MGMT_CNTNTS - limLog(pMac, LOG1, FL("maxMPDULen (2): %d\n"), pDot11f->maxMPDULen); - limLog(pMac, LOG1, FL("supportedChannelWidthSet (2): %d\n"), pDot11f->supportedChannelWidthSet); - limLog(pMac, LOG1, FL("ldpcCodingCap (1): %d\n"), pDot11f->ldpcCodingCap); - limLog(pMac, LOG1, FL("shortGI80MHz (1): %d\n"), pDot11f->shortGI80MHz); - limLog(pMac, LOG1, FL("shortGI160and80plus80MHz (1): %d\n"), pDot11f->shortGI160and80plus80MHz); - limLog(pMac, LOG1, FL("txSTBC (1): %d\n"), pDot11f->txSTBC); - limLog(pMac, LOG1, FL("rxSTBC (3): %d\n"), pDot11f->rxSTBC); - limLog(pMac, LOG1, FL("suBeamFormerCap (1): %d\n"), pDot11f->suBeamFormerCap); - limLog(pMac, LOG1, FL("suBeamformeeCap (1): %d\n"), pDot11f->suBeamformeeCap); - limLog(pMac, LOG1, FL("csnofBeamformerAntSup (3): %d\n"), pDot11f->csnofBeamformerAntSup); - limLog(pMac, LOG1, FL("numSoundingDim (3): %d\n"), pDot11f->numSoundingDim); - limLog(pMac, LOG1, FL("muBeamformerCap (1): %d\n"), pDot11f->muBeamformerCap); - limLog(pMac, LOG1, FL("muBeamformeeCap (1): %d\n"), pDot11f->muBeamformeeCap); - limLog(pMac, LOG1, FL("vhtTXOPPS (1): %d\n"), pDot11f->vhtTXOPPS); - limLog(pMac, LOG1, FL("htcVHTCap (1): %d\n"), pDot11f->htcVHTCap); - limLog(pMac, LOG1, FL("maxAMPDULenExp (3): %d\n"), pDot11f->maxAMPDULenExp); - limLog(pMac, LOG1, FL("vhtLinkAdaptCap (2): %d\n"), pDot11f->vhtLinkAdaptCap); - limLog(pMac, LOG1, FL("rxAntPattern (1): %d\n"), pDot11f->vhtLinkAdaptCap); - limLog(pMac, LOG1, FL("txAntPattern (1): %d\n"), pDot11f->vhtLinkAdaptCap); - limLog(pMac, LOG1, FL("reserved1 (2): %d\n"), pDot11f->reserved1); - limLog(pMac, LOG1, FL("rxMCSMap (16): %d\n"), pDot11f->rxMCSMap); - limLog(pMac, LOG1, FL("rxHighSupDataRate (13): %d\n"), pDot11f->rxHighSupDataRate); - limLog(pMac, LOG1, FL("reserve (3): %d\n"), pDot11f->reserved2); - limLog(pMac, LOG1, FL("txMCSMap (16): %d\n"), pDot11f->txMCSMap); - limLog(pMac, LOG1, FL("txSupDataRate (13): %d\n"), pDot11f->txSupDataRate); - limLog(pMac, LOG1, FL("reserv (3): %d\n"), pDot11f->reserved3); + limLog(pMac, LOG1, FL("maxMPDULen (2): %d"), pDot11f->maxMPDULen); + limLog(pMac, LOG1, FL("supportedChannelWidthSet (2): %d"), pDot11f->supportedChannelWidthSet); + limLog(pMac, LOG1, FL("ldpcCodingCap (1): %d"), pDot11f->ldpcCodingCap); + limLog(pMac, LOG1, FL("shortGI80MHz (1): %d"), pDot11f->shortGI80MHz); + limLog(pMac, LOG1, FL("shortGI160and80plus80MHz (1): %d"), pDot11f->shortGI160and80plus80MHz); + limLog(pMac, LOG1, FL("txSTBC (1): %d"), pDot11f->txSTBC); + limLog(pMac, LOG1, FL("rxSTBC (3): %d"), pDot11f->rxSTBC); + limLog(pMac, LOG1, FL("suBeamFormerCap (1): %d"), pDot11f->suBeamFormerCap); + limLog(pMac, LOG1, FL("suBeamformeeCap (1): %d"), pDot11f->suBeamformeeCap); + limLog(pMac, LOG1, FL("csnofBeamformerAntSup (3): %d"), pDot11f->csnofBeamformerAntSup); + limLog(pMac, LOG1, FL("numSoundingDim (3): %d"), pDot11f->numSoundingDim); + limLog(pMac, LOG1, FL("muBeamformerCap (1): %d"), pDot11f->muBeamformerCap); + limLog(pMac, LOG1, FL("muBeamformeeCap (1): %d"), pDot11f->muBeamformeeCap); + limLog(pMac, LOG1, FL("vhtTXOPPS (1): %d"), pDot11f->vhtTXOPPS); + limLog(pMac, LOG1, FL("htcVHTCap (1): %d"), pDot11f->htcVHTCap); + limLog(pMac, LOG1, FL("maxAMPDULenExp (3): %d"), pDot11f->maxAMPDULenExp); + limLog(pMac, LOG1, FL("vhtLinkAdaptCap (2): %d"), pDot11f->vhtLinkAdaptCap); + limLog(pMac, LOG1, FL("rxAntPattern (1): %d"), pDot11f->vhtLinkAdaptCap); + limLog(pMac, LOG1, FL("txAntPattern (1): %d"), pDot11f->vhtLinkAdaptCap); + limLog(pMac, LOG1, FL("reserved1 (2): %d"), pDot11f->reserved1); + limLog(pMac, LOG1, FL("rxMCSMap (16): %d"), pDot11f->rxMCSMap); + limLog(pMac, LOG1, FL("rxHighSupDataRate (13): %d"), pDot11f->rxHighSupDataRate); + limLog(pMac, LOG1, FL("reserve (3): %d"), pDot11f->reserved2); + limLog(pMac, LOG1, FL("txMCSMap (16): %d"), pDot11f->txMCSMap); + limLog(pMac, LOG1, FL("txSupDataRate (13): %d"), pDot11f->txSupDataRate); + limLog(pMac, LOG1, FL("reserv (3): %d"), pDot11f->reserved3); #endif /* DUMP_MGMT_CNTNTS */ } @@ -712,10 +706,10 @@ void limLogVHTOperation(tpAniSirGlobal pMac, tDot11fIEVHTOperation *pDot11f) { #ifdef DUMP_MGMT_CNTNTS - limLog(pMac, LOG1, FL("chanWidth : %d\n"), pDot11f->chanWidth); - limLog(pMac, LOG1, FL("chanCenterFreqSeg1: %d\n"), pDot11f->chanCenterFreqSeg1); - limLog(pMac, LOG1, FL("chanCenterFreqSeg2: %d\n"), pDot11f->chanCenterFreqSeg2); - limLog(pMac, LOG1, FL("basicMCSSet: %d\n"), pDot11f->basicMCSSet); + limLog(pMac, LOG1, FL("chanWidth : %d"), pDot11f->chanWidth); + limLog(pMac, LOG1, FL("chanCenterFreqSeg1: %d"), pDot11f->chanCenterFreqSeg1); + limLog(pMac, LOG1, FL("chanCenterFreqSeg2: %d"), pDot11f->chanCenterFreqSeg2); + limLog(pMac, LOG1, FL("basicMCSSet: %d"), pDot11f->basicMCSSet); #endif /* DUMP_MGMT_CNTNTS */ } @@ -723,11 +717,11 @@ void limLogVHTExtBssLoad(tpAniSirGlobal pMac, tDot11fIEVHTExtBssLoad *pDot11f) { #ifdef DUMP_MGMT_CNTNTS - limLog(pMac, LOG1, FL("muMIMOCapStaCount : %d\n"), pDot11f->muMIMOCapStaCount); - limLog(pMac, LOG1, FL("ssUnderUtil: %d\n"), pDot11f->ssUnderUtil); - limLog(pMac, LOG1, FL("FortyMHzUtil: %d\n"), pDot11f->FortyMHzUtil); - limLog(pMac, LOG1, FL("EightyMHzUtil: %d\n"), pDot11f->EightyMHzUtil); - limLog(pMac, LOG1, FL("OneSixtyMHzUtil: %d\n"), pDot11f->OneSixtyMHzUtil); + limLog(pMac, LOG1, FL("muMIMOCapStaCount : %d"), pDot11f->muMIMOCapStaCount); + limLog(pMac, LOG1, FL("ssUnderUtil: %d"), pDot11f->ssUnderUtil); + limLog(pMac, LOG1, FL("FortyMHzUtil: %d"), pDot11f->FortyMHzUtil); + limLog(pMac, LOG1, FL("EightyMHzUtil: %d"), pDot11f->EightyMHzUtil); + limLog(pMac, LOG1, FL("OneSixtyMHzUtil: %d"), pDot11f->OneSixtyMHzUtil); #endif /* DUMP_MGMT_CNTNTS */ } @@ -736,10 +730,10 @@ void limLogOperatingMode( tpAniSirGlobal pMac, tDot11fIEOperatingMode *pDot11f) { #ifdef DUMP_MGMT_CNTNTS - limLog(pMac, LOG1, FL("ChanWidth : %d\n"), pDot11f->chanWidth); - limLog(pMac, LOG1, FL("reserved: %d\n"), pDot11f->reserved); - limLog(pMac, LOG1, FL("rxNSS: %d\n"), pDot11f->rxNSS); - limLog(pMac, LOG1, FL("rxNSS Type: %d\n"), pDot11f->rxNSSType); + limLog(pMac, LOG1, FL("ChanWidth : %d"), pDot11f->chanWidth); + limLog(pMac, LOG1, FL("reserved: %d"), pDot11f->reserved); + limLog(pMac, LOG1, FL("rxNSS: %d"), pDot11f->rxNSS); + limLog(pMac, LOG1, FL("rxNSS Type: %d"), pDot11f->rxNSSType); #endif /* DUMP_MGMT_CNTNTS */ } @@ -767,11 +761,20 @@ void limLogQosMapSet(tpAniSirGlobal pMac, tSirQosMapSet *pQosMapSet) tSirRetStatus PopulateDot11fVHTCaps(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pDot11f, + tANI_U8 nChannelNum, tAniBool isProbeRspAssocRspBeacon) { tSirRetStatus nStatus; tANI_U32 nCfgValue=0; + tAniBool disableMcs9 = eSIR_FALSE; + if (nChannelNum <= SIR_11B_CHANNEL_END) + disableMcs9 = pMac->roam.configParam.channelBondingMode24GHz? + eSIR_FALSE:eSIR_TRUE; + else + disableMcs9 = + pMac->roam.configParam.channelBondingMode5GHz? + eSIR_FALSE: eSIR_TRUE; pDot11f->present = 1; CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MAX_MPDU_LENGTH, nCfgValue ); @@ -795,6 +798,12 @@ PopulateDot11fVHTCaps(tpAniSirGlobal pMac, nCfgValue ); pDot11f->shortGI160and80plus80MHz = (nCfgValue & 0x0001); + if (nChannelNum && (SIR_BAND_2_4_GHZ == limGetRFBand(nChannelNum))) + { + pDot11f->shortGI80MHz = 0; + pDot11f->shortGI160and80plus80MHz = 0; + } + nCfgValue = 0; CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TXSTBC, nCfgValue ); pDot11f->txSTBC = (nCfgValue & 0x0001); @@ -869,6 +878,9 @@ PopulateDot11fVHTCaps(tpAniSirGlobal pMac, nCfgValue = 0; CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_MCS_MAP, nCfgValue ); + + if (eSIR_TRUE == disableMcs9) + nCfgValue = (nCfgValue & 0xFFFC) | 0x1; pDot11f->rxMCSMap = (nCfgValue & 0x0000FFFF); nCfgValue = 0; @@ -880,6 +892,9 @@ PopulateDot11fVHTCaps(tpAniSirGlobal pMac, nCfgValue = 0; CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_MCS_MAP, nCfgValue ); + + if (eSIR_TRUE == disableMcs9) + nCfgValue = (nCfgValue & 0xFFFC) | 0x1; pDot11f->txMCSMap = (nCfgValue & 0x0000FFFF); nCfgValue = 0; @@ -897,10 +912,20 @@ PopulateDot11fVHTCaps(tpAniSirGlobal pMac, tSirRetStatus PopulateDot11fVHTOperation(tpAniSirGlobal pMac, - tDot11fIEVHTOperation *pDot11f) + tDot11fIEVHTOperation *pDot11f, + tANI_U8 nChannelNum) { tSirRetStatus nStatus; tANI_U32 nCfgValue=0; + tAniBool disableMcs9 = eSIR_FALSE; + + if (nChannelNum <= SIR_11B_CHANNEL_END) + disableMcs9 = pMac->roam.configParam.channelBondingMode24GHz? + eSIR_FALSE:eSIR_TRUE; + else + disableMcs9 = + pMac->roam.configParam.channelBondingMode5GHz? + eSIR_FALSE: eSIR_TRUE; pDot11f->present = 1; @@ -919,6 +944,9 @@ PopulateDot11fVHTOperation(tpAniSirGlobal pMac, nCfgValue = 0; CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_BASIC_MCS_SET,nCfgValue ); + + if (eSIR_TRUE == disableMcs9) + nCfgValue = (nCfgValue & 0xFFFC) | 0x1; pDot11f->basicMCSSet = (tANI_U16)nCfgValue; limLogVHTOperation(pMac,pDot11f); @@ -961,17 +989,51 @@ PopulateDot11fVHTExtBssLoad(tpAniSirGlobal pMac, return eSIR_SUCCESS; } +#ifdef WLAN_FEATURE_AP_HT40_24G +tSirRetStatus +PopulateDot11fOBSSScanParameters(tpAniSirGlobal pMac, + tDot11fIEOBSSScanParameters *pDot11f, + tpPESession psessionEntry) +{ + pDot11f->present = 1; + + pDot11f->obssScanPassiveDwell = + psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime; + + pDot11f->obssScanActiveDwell = + psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime; + + pDot11f->bssChannelWidthTriggerScanInterval = + psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval; + + pDot11f->obssScanPassiveTotalPerChannel = + psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel; + + pDot11f->obssScanActiveTotalPerChannel = + psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel; + + pDot11f->bssWidthChannelTransitionDelayFactor = + psessionEntry->obssHT40ScanParam.BSSWidthChannelTransitionDelayFactor; + + pDot11f->obssScanActivityThreshold = + psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold; + + return eSIR_SUCCESS; +} +#endif + tSirRetStatus PopulateDot11fExtCap(tpAniSirGlobal pMac, tDot11fIEExtCap *pDot11f, tpPESession psessionEntry) { - tANI_U32 val; + struct s_ext_cap *p_ext_cap = (struct s_ext_cap *)pDot11f->bytes; #ifdef WLAN_FEATURE_11AC - if (psessionEntry->vhtCapability) + if (psessionEntry->vhtCapability && + psessionEntry->limSystemRole != eLIM_STA_IN_IBSS_ROLE ) { - pDot11f->operModeNotification = 1; + p_ext_cap->operModeNotification = 1; pDot11f->present = 1; } #endif @@ -979,16 +1041,25 @@ PopulateDot11fExtCap(tpAniSirGlobal pMac, the bss co-ex capability*/ if (psessionEntry->currentOperChannel <= RF_CHAN_14) { - if (wlan_cfgGetInt(pMac, WNI_CFG_CHANNEL_BONDING_24G, &val) != - eSIR_SUCCESS) - PELOGE(limLog(pMac, LOGE, FL("could not retrieve " - "24G Chan bond Length \n"));) - if (TRUE == val) +#ifdef WLAN_FEATURE_AP_HT40_24G + if(((IS_HT40_OBSS_SCAN_FEATURE_ENABLE) + && pMac->roam.configParam.channelBondingMode24GHz) + || pMac->roam.configParam.apHT40_24GEnabled) +#else + if((IS_HT40_OBSS_SCAN_FEATURE_ENABLE) + && pMac->roam.configParam.channelBondingMode24GHz) +#endif { - pDot11f->bssCoexistMgmtSupport = 1; + p_ext_cap->bssCoexistMgmtSupport = 1; pDot11f->present = 1; } } + + if (pDot11f->present) + { + /* Need to compute the num_bytes based on bits set */ + pDot11f->num_bytes = lim_compute_ext_cap_ie_length(pDot11f); + } return eSIR_SUCCESS; } @@ -1035,7 +1106,7 @@ PopulateDot11fHTInfo(tpAniSirGlobal pMac, if (NULL == psessionEntry) { PELOGE(limLog(pMac, LOG1, - FL("Invalid session entry in PopulateDot11fHTInfo()\n"));) + FL("Invalid session entry in PopulateDot11fHTInfo()"));) return eSIR_FAILURE; } @@ -1052,7 +1123,7 @@ PopulateDot11fHTInfo(tpAniSirGlobal pMac, if (psessionEntry == NULL) { PELOGE(limLog(pMac, LOG1, - FL("Keep the value retrieved from cfg for secondary channel offset and recommended Tx Width set\n"));) + FL("Keep the value retrieved from cfg for secondary channel offset and recommended Tx Width set"));) } else { @@ -1249,7 +1320,7 @@ PopulateDot11fQOSCapsStation(tpAniSirGlobal pMac, tANI_U32 val = 0; if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) - PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length \n"));) + PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length "));) pDot11f->more_data_ack = 0; pDot11f->max_sp_length = (tANI_U8)val; @@ -1284,12 +1355,12 @@ PopulateDot11fRSN(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fRS" - "N (0x%08x).\n"), + "N (0x%08x)."), status ); return eSIR_FAILURE; } dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in " - "PopulateDot11fRSN.\n"), status ); + "PopulateDot11fRSN."), status ); } } @@ -1341,12 +1412,12 @@ PopulateDot11fWAPI(tpAniSirGlobal pMac, pDot11f ); if ( DOT11F_FAILED( status ) ) { - dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWAPI (0x%08x).\n"), + dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWAPI (0x%08x)."), status ); return eSIR_FAILURE; } dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in " - "PopulateDot11fWAPI.\n"), status ); + "PopulateDot11fWAPI."), status ); } } @@ -1476,7 +1547,7 @@ PopulateDot11fSuppRates(tpAniSirGlobal pMac, } else { - dot11fLog( pMac, LOGE, FL("no session context exists while populating Operational Rate Set\n")); + dot11fLog( pMac, LOGE, FL("no session context exists while populating Operational Rate Set")); nRates = 0; } } @@ -1502,6 +1573,120 @@ PopulateDot11fSuppRates(tpAniSirGlobal pMac, } // End PopulateDot11fSuppRates. +/** + * PopulateDot11fRatesTdls() - populate supported rates and + * extended supported rates IE. + * @p_mac gloabl - header. + * @p_supp_rates - pointer to supported rates IE + * @p_ext_supp_rates - pointer to extended supported rates IE + * + * This function populates the supported rates and extended supported + * rates IE based in the STA capability. If the number of rates + * supported is less than MAX_NUM_SUPPORTED_RATES, only supported rates + * IE is populated. + * + * Return: tSirRetStatus eSIR_SUCCESS on Success and eSIR_FAILURE + * on failure. + */ + +tSirRetStatus +PopulateDot11fRatesTdls(tpAniSirGlobal p_mac, + tDot11fIESuppRates *p_supp_rates, + tDot11fIEExtSuppRates *p_ext_supp_rates, + tANI_U8 curr_oper_channel) +{ + tSirMacRateSet temp_rateset; + tSirMacRateSet temp_rateset2; + uint32_t val, i; + uint32_t self_dot11mode = 0; + + wlan_cfgGetInt(p_mac, WNI_CFG_DOT11_MODE, &self_dot11mode); + + /** + * Include 11b rates only when the device configured + * in auto, 11a/b/g or 11b_only and also if current base + * channel is 5 GHz then no need to advertise the 11b rates. + * If devices to move 2.4GHz off-channel then they can communicate + * in 11g rates i.e. (6, 9, 12, 18, 24, 36 and 54). + */ + limLog(p_mac, LOG1, FL("Current operating channel %d self_dot11mode = %d"), + curr_oper_channel, self_dot11mode); + + if ((curr_oper_channel <= SIR_11B_CHANNEL_END) && + ((self_dot11mode == WNI_CFG_DOT11_MODE_ALL) || + (self_dot11mode == WNI_CFG_DOT11_MODE_11A) || + (self_dot11mode == WNI_CFG_DOT11_MODE_11AC) || + (self_dot11mode == WNI_CFG_DOT11_MODE_11N) || + (self_dot11mode == WNI_CFG_DOT11_MODE_11G) || + (self_dot11mode == WNI_CFG_DOT11_MODE_11B))) + { + val = WNI_CFG_SUPPORTED_RATES_11B_LEN; + wlan_cfgGetStr(p_mac, WNI_CFG_SUPPORTED_RATES_11B, + (tANI_U8 *)&temp_rateset.rate, &val); + temp_rateset.numRates = (tANI_U8) val; + } + else + { + temp_rateset.numRates = 0; + } + + /* Include 11a rates when the device configured in non-11b mode */ + if (!IS_DOT11_MODE_11B(self_dot11mode)) + { + val = WNI_CFG_SUPPORTED_RATES_11A_LEN; + wlan_cfgGetStr(p_mac, WNI_CFG_SUPPORTED_RATES_11A, + (tANI_U8 *)&temp_rateset2.rate, &val); + temp_rateset2.numRates = (tANI_U8) val; + } + else + { + temp_rateset2.numRates = 0; + } + + if ((temp_rateset.numRates + temp_rateset2.numRates) > + SIR_MAC_MAX_NUMBER_OF_RATES) + { + limLog(p_mac, LOGP, FL("more than %d rates in CFG"), + SIR_MAC_MAX_NUMBER_OF_RATES); + return eSIR_FAILURE; + } + + /** + * copy all rates in temp_rateset, + * there are SIR_MAC_MAX_NUMBER_OF_RATES rates max + */ + for (i = 0; i < temp_rateset2.numRates; i++) + temp_rateset.rate[i + temp_rateset.numRates] = + temp_rateset2.rate[i]; + + temp_rateset.numRates += temp_rateset2.numRates; + + if (temp_rateset.numRates <= MAX_NUM_SUPPORTED_RATES) + { + p_supp_rates->num_rates = temp_rateset.numRates; + vos_mem_copy(p_supp_rates->rates, temp_rateset.rate, + p_supp_rates->num_rates); + p_supp_rates->present = 1; + } + else /* Populate extended capability as well */ + { + p_supp_rates->num_rates = MAX_NUM_SUPPORTED_RATES; + vos_mem_copy(p_supp_rates->rates, temp_rateset.rate, + p_supp_rates->num_rates); + p_supp_rates->present = 1; + p_ext_supp_rates->num_rates = temp_rateset.numRates - + MAX_NUM_SUPPORTED_RATES; + vos_mem_copy(p_ext_supp_rates->rates, + (tANI_U8 *)temp_rateset.rate + + MAX_NUM_SUPPORTED_RATES, + p_ext_supp_rates->num_rates); + p_ext_supp_rates->present = 1; + } + + return eSIR_SUCCESS; + +} /* End PopulateDot11fRatesTdls */ + tSirRetStatus PopulateDot11fTPCReport(tpAniSirGlobal pMac, tDot11fIETPCReport *pDot11f, @@ -1515,7 +1700,7 @@ PopulateDot11fTPCReport(tpAniSirGlobal pMac, { dot11fLog( pMac, LOG1, FL("Failed to get the STAID in Populat" "eDot11fTPCReport; limGetMgmtStaid " - "returned status %d.\n"), + "returned status %d."), nSirStatus ); return eSIR_FAILURE; } @@ -1632,6 +1817,7 @@ void PopulateDot11fWMMInfoStation(tpAniSirGlobal pMac, tDot11fIEWMMInfoStation * { tANI_U32 val = 0; + limLog(pMac, LOG1, FL("populate WMM IE in Setup Request Frame")); pInfo->version = SIR_MAC_OUI_VERSION_1; pInfo->acvo_uapsd = LIM_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask); pInfo->acvi_uapsd = LIM_UAPSD_GET(ACVI, pMac->lim.gUapsdPerAcBitmask); @@ -1639,8 +1825,7 @@ void PopulateDot11fWMMInfoStation(tpAniSirGlobal pMac, tDot11fIEWMMInfoStation * pInfo->acbe_uapsd = LIM_UAPSD_GET(ACBE, pMac->lim.gUapsdPerAcBitmask); if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) - PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length \n"));) - + PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length "));) pInfo->max_sp_length = (tANI_U8)val; pInfo->present = 1; } @@ -1736,7 +1921,7 @@ PopulateDot11fWPA(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWP" - "A (0x%08x).\n"), + "A (0x%08x)."), status ); return eSIR_FAILURE; } @@ -1782,12 +1967,12 @@ sirGetCfgPropCaps(tpAniSirGlobal pMac, tANI_U16 *caps) if (wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, &val) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("could not retrieve PropFeature enabled flag\n")); + limLog(pMac, LOGP, FL("could not retrieve PropFeature enabled flag")); return eSIR_FAILURE; } if (wlan_cfgGetInt(pMac, WNI_CFG_PROP_CAPABILITY, &val) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("could not retrieve PROP_CAPABLITY flag\n")); + limLog(pMac, LOGP, FL("could not retrieve PROP_CAPABLITY flag")); return eSIR_FAILURE; } @@ -1812,14 +1997,14 @@ sirConvertProbeReqFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackProbeRequest(pMac, pFrame, nFrame, &pr); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse a Probe Request (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse a Probe Request (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Request (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Request (0x%08x, %d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -1827,7 +2012,7 @@ sirConvertProbeReqFrame2Struct(tpAniSirGlobal pMac, // & "transliterate" from a 'tDot11fProbeRequestto' a 'tSirProbeReq'... if ( ! pr.SSID.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) } else { @@ -1837,7 +2022,7 @@ sirConvertProbeReqFrame2Struct(tpAniSirGlobal pMac, if ( ! pr.SuppRates.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) return eSIR_FAILURE; } else @@ -1925,7 +2110,7 @@ tSirRetStatus ValidateAndRectifyIEs(tpAniSirGlobal pMac, RSNIE_CAPABILITY_LEN, DEFAULT_RSNIE_CAP_VAL ); *nMissingRsnBytes = RSNIE_CAPABILITY_LEN; limLog(pMac, LOG1, - FL("Added RSN Capability to the RSNIE as 0x00 0x00\n")); + FL("Added RSN Capability to the RSNIE as 0x00 0x00")); return eHAL_STATUS_SUCCESS; } @@ -1946,14 +2131,14 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, // Ok, zero-init our [out] parameter, vos_mem_set( ( tANI_U8* )pProbeResp, sizeof(tSirProbeRespBeacon), 0 ); - pr = vos_mem_malloc(sizeof(tDot11fProbeResponse)); + pr = vos_mem_vmalloc(sizeof(tDot11fProbeResponse)); if ( NULL == pr ) status = eHAL_STATUS_FAILURE; else status = eHAL_STATUS_SUCCESS; if (!HAL_STATUS_SUCCESS(status)) { - limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); + limLog(pMac, LOGE, FL("Failed to allocate memory") ); return eSIR_FAILURE; } @@ -1963,18 +2148,12 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackProbeResponse( pMac, pFrame, nFrame, pr ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse a Probe Response (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse a Probe Response (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) - vos_mem_free(pr); + vos_mem_vfree(pr); return eSIR_FAILURE; } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Response (0x%08x, %d bytes):\n"), - status, nFrame ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) - } // & "transliterate" from a 'tDot11fProbeResponse' to a 'tSirProbeRespBeacon'... @@ -2005,7 +2184,7 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, if ( ! pr->SSID.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) } else { @@ -2015,7 +2194,7 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, if ( ! pr->SuppRates.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) } else { @@ -2117,14 +2296,14 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, { pProbeResp->wmeEdcaPresent = 1; ConvertWMMParams( pMac, &pProbeResp->edcaParams, &pr->WMMParams ); - PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Probe Response Frame!\n")); + PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Probe Response Frame!")); __printWMMParams(pMac, &pr->WMMParams);) } if ( pr->WMMInfoAp.present ) { pProbeResp->wmeInfoPresent = 1; - PELOG1(limLog(pMac, LOG1, FL("WMM Information Element present in Probe Response Frame!\n"));) + PELOG1(limLog(pMac, LOG1, FL("WMM Information Element present in Probe Response Frame!"));) } if ( pr->WMMCaps.present ) @@ -2148,7 +2327,7 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, sizeof(tANI_U16) ); pProbeResp->mdie[2] = ((pr->MobilityDomain.overDSCap << 0) | (pr->MobilityDomain.resourceReqCap << 1)); #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG - limLog(pMac, LOG2, FL("mdie=%02x%02x%02x\n"), (unsigned int)pProbeResp->mdie[0], + limLog(pMac, LOG2, FL("mdie=%02x%02x%02x"), (unsigned int)pProbeResp->mdie[0], (unsigned int)pProbeResp->mdie[1], (unsigned int)pProbeResp->mdie[2]); #endif } @@ -2179,7 +2358,8 @@ tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, vos_mem_copy( &pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) ); } #endif - vos_mem_free(pr); + + vos_mem_vfree(pr); return eSIR_SUCCESS; } // End sirConvertProbeFrame2Struct. @@ -2200,7 +2380,7 @@ sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, status = eHAL_STATUS_SUCCESS; if (!HAL_STATUS_SUCCESS(status)) { - limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); + limLog(pMac, LOGE, FL("Failed to allocate memory") ); return eSIR_FAILURE; } // Zero-init our [out] parameter, @@ -2211,7 +2391,7 @@ sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackAssocRequest( pMac, pFrame, nFrame, ar ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse an Association Request (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse an Association Request (0x%08x, %d bytes):"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) vos_mem_free(ar); @@ -2219,7 +2399,7 @@ sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking an Assoication Request (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking an Assoication Request (0x%08x, %d bytes):"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -2345,14 +2525,14 @@ sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, if ( ! pAssocReq->ssidPresent ) { - PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));) + PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE."));) vos_mem_free(ar); return eSIR_FAILURE; } if ( !pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent ) { - PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));) + PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE."));) vos_mem_free(ar); return eSIR_FAILURE; } @@ -2361,13 +2541,13 @@ sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, if ( ar->VHTCaps.present ) { vos_mem_copy( &pAssocReq->VHTCaps, &ar->VHTCaps, sizeof( tDot11fIEVHTCaps ) ); - limLog( pMac, LOGW, FL("Received Assoc Req with VHT Cap\n")); + limLog( pMac, LOGW, FL("Received Assoc Req with VHT Cap")); limLogVHTCap( pMac, &pAssocReq->VHTCaps); } if ( ar->OperatingMode.present ) { vos_mem_copy( &pAssocReq->operMode, &ar->OperatingMode, sizeof (tDot11fIEOperatingMode)); - limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n")); + limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE")); limLogOperatingMode( pMac, &pAssocReq->operMode); } #endif @@ -2393,14 +2573,14 @@ sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackAssocResponse( pMac, pFrame, nFrame, &ar); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse an Association Response (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse an Association Response (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking an Association Response (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking an Association Response (0x%08x, %d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -2431,7 +2611,7 @@ sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, if ( ! ar.SuppRates.present ) { pAssocRsp->suppRatesPresent = 0; - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) } else { @@ -2452,10 +2632,13 @@ sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, } if (ar.ExtCap.present) { + struct s_ext_cap *p_ext_cap; vos_mem_copy(&pAssocRsp->ExtCap, &ar.ExtCap, sizeof(tDot11fIEExtCap)); + + p_ext_cap = (struct s_ext_cap *)&pAssocRsp->ExtCap.bytes; limLog(pMac, LOG1, FL("ExtCap is present, TDLSChanSwitProhibited: %d"), - ar.ExtCap.TDLSChanSwitProhibited); + p_ext_cap->TDLSChanSwitProhibited); } if ( ar.WMMParams.present ) { @@ -2467,11 +2650,12 @@ sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, if ( ar.HTCaps.present ) { + limLog(pMac, LOG1, FL("Received Assoc Response with HT Cap")); vos_mem_copy( &pAssocRsp->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) ); } if ( ar.HTInfo.present ) - { + { limLog(pMac, LOG1, FL("Received Assoc Response with HT Info")); vos_mem_copy( &pAssocRsp->HTInfo, &ar.HTInfo, sizeof( tDot11fIEHTInfo ) ); } @@ -2519,7 +2703,7 @@ sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, pAssocRsp->num_tspecs = ar.num_WMMTSPEC; for (cnt=0; cnt < ar.num_WMMTSPEC; cnt++) { vos_mem_copy( &pAssocRsp->TSPECInfo[cnt], &ar.WMMTSPEC[cnt], - (sizeof(tDot11fIEWMMTSPEC)*ar.num_WMMTSPEC)); + (sizeof(tDot11fIEWMMTSPEC))); } pAssocRsp->tspecPresent = TRUE; } @@ -2577,14 +2761,14 @@ sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackReAssocRequest( pMac, pFrame, nFrame, &ar ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse a Re-association Request (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse a Re-association Request (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -2690,13 +2874,13 @@ sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac, if ( ! pAssocReq->ssidPresent ) { - PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));) + PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE."));) return eSIR_FAILURE; } if ( ! pAssocReq->suppRatesPresent && ! pAssocReq->extendedRatesPresent ) { - PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));) + PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE."));) return eSIR_FAILURE; } @@ -2732,7 +2916,7 @@ sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac, if ( ar.OperatingMode.present ) { vos_mem_copy( &pAssocReq->operMode, &ar.OperatingMode, sizeof( tDot11fIEOperatingMode ) ); - limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n")); + limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE")); limLogOperatingMode( pMac, &pAssocReq->operMode); } #endif @@ -2768,22 +2952,24 @@ sirFillBeaconMandatoryIEforEseBcnReport(tpAniSirGlobal pMac, status = eHAL_STATUS_SUCCESS; if (!HAL_STATUS_SUCCESS(status)) { - limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); + limLog(pMac, LOGE, FL("Failed to allocate memory") ); return eSIR_FAILURE; } + vos_mem_zero(pBies, sizeof(tDot11fBeaconIEs)); + // delegate to the framesc-generated code, status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), status, nPayload); vos_mem_free(pBies); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes)"), status, nPayload ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) } @@ -2791,7 +2977,7 @@ sirFillBeaconMandatoryIEforEseBcnReport(tpAniSirGlobal pMac, // & "transliterate" from a 'tDot11fBeaconIEs' to a 'eseBcnReportMandatoryIe'... if ( !pBies->SSID.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) } else { @@ -2803,7 +2989,7 @@ sirFillBeaconMandatoryIEforEseBcnReport(tpAniSirGlobal pMac, if ( !pBies->SuppRates.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) } else { @@ -3062,15 +3248,17 @@ sirParseBeaconIE(tpAniSirGlobal pMac, status = eHAL_STATUS_SUCCESS; if (!HAL_STATUS_SUCCESS(status)) { - limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); + limLog(pMac, LOGE, FL("Failed to allocate memory") ); return eSIR_FAILURE; } + vos_mem_zero(pBies, sizeof(tDot11fBeaconIEs)); + // delegate to the framesc-generated code, status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), status, nPayload); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) vos_mem_free(pBies); @@ -3078,7 +3266,7 @@ sirParseBeaconIE(tpAniSirGlobal pMac, } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes)"), status, nPayload ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) } @@ -3086,7 +3274,7 @@ sirParseBeaconIE(tpAniSirGlobal pMac, // & "transliterate" from a 'tDot11fBeaconIEs' to a 'tSirProbeRespBeacon'... if ( ! pBies->SSID.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) } else { @@ -3096,7 +3284,7 @@ sirParseBeaconIE(tpAniSirGlobal pMac, if ( ! pBies->SuppRates.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) } else { @@ -3272,6 +3460,12 @@ sirParseBeaconIE(tpAniSirGlobal pMac, } #endif + if (pBies->ExtCap.present ) + { + pBeaconStruct->ExtCap.present = 1; + vos_mem_copy( &pBeaconStruct->ExtCap, &pBies->ExtCap, + sizeof(tDot11fIEExtCap)); + } vos_mem_free(pBies); @@ -3300,14 +3494,14 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, // Zero-init our [out] parameter, vos_mem_set( ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon), 0 ); - pBeacon = vos_mem_malloc(sizeof(tDot11fBeacon)); + pBeacon = vos_mem_vmalloc(sizeof(tDot11fBeacon)); if ( NULL == pBeacon ) status = eHAL_STATUS_FAILURE; else status = eHAL_STATUS_SUCCESS; if (!HAL_STATUS_SUCCESS(status)) { - limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); + limLog(pMac, LOGE, FL("Failed to allocate memory") ); return eSIR_FAILURE; } @@ -3320,18 +3514,12 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackBeacon( pMac, pPayload, nPayload, pBeacon ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), status, nPayload); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) - vos_mem_free(pBeacon); + vos_mem_vfree(pBeacon); return eSIR_FAILURE; } - else if ( DOT11F_WARNED( status ) ) - { - limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"), - status, nPayload ); - PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) - } // & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'... // Timestamp @@ -3361,7 +3549,7 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, if ( ! pBeacon->SSID.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) } else { @@ -3371,7 +3559,7 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, if ( ! pBeacon->SuppRates.present ) { - PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));) + PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) } else { @@ -3506,14 +3694,14 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, { pBeaconStruct->wmeEdcaPresent = 1; ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBeacon->WMMParams ); - PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!\n")); + PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!")); __printWMMParams(pMac, &pBeacon->WMMParams); ) } if ( pBeacon->WMMInfoAp.present ) { pBeaconStruct->wmeInfoPresent = 1; - PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!\n"));) + PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!"));) } if ( pBeacon->WMMCaps.present ) @@ -3583,7 +3771,8 @@ sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, &pBeacon->OBSSScanParameters, sizeof( tDot11fIEOBSSScanParameters)); } - vos_mem_free(pBeacon); + + vos_mem_vfree(pBeacon); return eSIR_SUCCESS; } // End sirConvertBeaconFrame2Struct. @@ -3604,14 +3793,14 @@ sirConvertAuthFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackAuthentication( pMac, pFrame, nFrame, &auth ); if ( DOT11F_FAILED( status ) ) { - limLog(pMac, LOGE, FL("Failed to parse an Authentication frame (0x%08x, %d bytes):\n"), + limLog(pMac, LOGE, FL("Failed to parse an Authentication frame (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while unpacking an Authentication frame (0x%08x, %d bytes):\n"), + limLog( pMac, LOGW, FL("There were warnings while unpacking an Authentication frame (0x%08x, %d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -3676,7 +3865,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { limLog(pMac, LOGE, FL("Failed to parse an Add TS Request f" - "rame (0x%08x, %d bytes):\n"), + "rame (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; @@ -3685,7 +3874,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, { limLog( pMac, LOGW, FL("There were warnings while unpackin" "g an Add TS Request frame (0x%08x," - "%d bytes):\n"), + "%d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -3702,7 +3891,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, } else { - limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Request.\n") ); + limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Request.") ); return eSIR_FAILURE; } @@ -3714,7 +3903,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, { if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) ) { - limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") ); + limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); return eSIR_FAILURE; } } @@ -3735,13 +3924,13 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, if ( addts.num_WMMTCLAS ) { j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS); - if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM; + if ( SIR_MAC_TCLASIE_MAXNUM < j ) j = SIR_MAC_TCLASIE_MAXNUM; for ( i = pAddTs->numTclas; i < j; ++i ) { if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) ) { - limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") ); + limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); return eSIR_FAILURE; } } @@ -3755,7 +3944,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) ) { - limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"), + limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE."), pAddTs->numTclas ); return eSIR_FAILURE; } @@ -3771,7 +3960,7 @@ sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, } else { - limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") ); + limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); return eSIR_FAILURE; } } @@ -3827,7 +4016,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { limLog(pMac, LOGE, FL("Failed to parse an Add TS Response f" - "rame (0x%08x, %d bytes):\n"), + "rame (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; @@ -3836,7 +4025,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, { limLog( pMac, LOGW, FL("There were warnings while unpackin" "g an Add TS Response frame (0x%08x," - "%d bytes):\n"), + "%d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -3856,7 +4045,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, // TS Delay is present iff status indicates its presence if ( eSIR_MAC_TS_NOT_CREATED_STATUS == pAddTs->status && ! addts.TSDelay.present ) { - limLog( pMac, LOGW, FL("Missing TSDelay IE.\n") ); + limLog( pMac, LOGW, FL("Missing TSDelay IE.") ); } if ( addts.TSPEC.present ) @@ -3865,7 +4054,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, } else { - limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Response.\n") ); + limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Response.") ); return eSIR_FAILURE; } @@ -3877,7 +4066,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, { if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) ) { - limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") ); + limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); return eSIR_FAILURE; } } @@ -3917,13 +4106,13 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, if ( addts.num_WMMTCLAS ) { j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS); - if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM; + if ( SIR_MAC_TCLASIE_MAXNUM < j ) j = SIR_MAC_TCLASIE_MAXNUM; for ( i = pAddTs->numTclas; i < j; ++i ) { if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) ) { - limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") ); + limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); return eSIR_FAILURE; } } @@ -3937,7 +4126,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) ) { - limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"), + limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE."), pAddTs->numTclas ); return eSIR_FAILURE; } @@ -3954,7 +4143,7 @@ sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, } else { - limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") ); + limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); return eSIR_FAILURE; } @@ -4015,7 +4204,7 @@ sirConvertDeltsReq2Struct(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { limLog(pMac, LOGE, FL("Failed to parse an Del TS Request f" - "rame (0x%08x, %d bytes):\n"), + "rame (0x%08x, %d bytes)"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; @@ -4024,7 +4213,7 @@ sirConvertDeltsReq2Struct(tpAniSirGlobal pMac, { dot11fLog( pMac, LOGW, FL("There were warnings while unpackin" "g an Del TS Request frame (0x%08x," - "%d bytes):\n"), + "%d bytes):"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -4053,7 +4242,7 @@ sirConvertDeltsReq2Struct(tpAniSirGlobal pMac, } else { - dot11fLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") ); + dot11fLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); return eSIR_FAILURE; } } @@ -4073,14 +4262,14 @@ sirConvertQosMapConfigureFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackQosMapConfigure(pMac, pFrame, nFrame, &mapConfigure); if ( DOT11F_FAILED( status ) ) { - dot11fLog(pMac, LOGE, FL("Failed to parse Qos Map Configure frame (0x%08x, %d bytes):\n"), + dot11fLog(pMac, LOGE, FL("Failed to parse Qos Map Configure frame (0x%08x, %d bytes):"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - dot11fLog( pMac, LOGW, FL("There were warnings while unpacking Qos Map Configure frame (0x%08x, %d bytes):\n"), + dot11fLog( pMac, LOGW, FL("There were warnings while unpacking Qos Map Configure frame (0x%08x, %d bytes):"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -4107,14 +4296,14 @@ sirConvertTpcReqFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackTPCRequest( pMac, pFrame, nFrame, &req ); if ( DOT11F_FAILED( status ) ) { - dot11fLog(pMac, LOGE, FL("Failed to parse a TPC Request frame (0x%08x, %d bytes):\n"), + dot11fLog(pMac, LOGE, FL("Failed to parse a TPC Request frame (0x%08x, %d bytes):"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a TPC Request frame (0x%08x, %d bytes):\n"), + dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a TPC Request frame (0x%08x, %d bytes):"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -4131,7 +4320,7 @@ sirConvertTpcReqFrame2Struct(tpAniSirGlobal pMac, } else { - dot11fLog( pMac, LOGW, FL("!!!Rcv TPC Req of inalid type!\n") ); + dot11fLog( pMac, LOGW, FL("!!!Rcv TPC Req of inalid type!") ); return eSIR_FAILURE; } @@ -4156,14 +4345,14 @@ sirConvertMeasReqFrame2Struct(tpAniSirGlobal pMac, status = dot11fUnpackMeasurementRequest( pMac, pFrame, nFrame, &mr ); if ( DOT11F_FAILED( status ) ) { - dot11fLog(pMac, LOGE, FL("Failed to parse a Measurement Request frame (0x%08x, %d bytes):\n"), + dot11fLog(pMac, LOGE, FL("Failed to parse a Measurement Request frame (0x%08x, %d bytes):"), status, nFrame); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a Measurement Request frame (0x%08x, %d bytes):\n"), + dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a Measurement Request frame (0x%08x, %d bytes)"), status, nFrame ); PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) } @@ -4176,7 +4365,7 @@ sirConvertMeasReqFrame2Struct(tpAniSirGlobal pMac, if ( 0 == mr.num_MeasurementRequest ) { - dot11fLog( pMac, LOGE, FL("Missing mandatory IE in Measurement Request Frame.\n") ); + dot11fLog( pMac, LOGE, FL("Missing mandatory IE in Measurement Request Frame.") ); return eSIR_FAILURE; } else if ( 1 < mr.num_MeasurementRequest ) @@ -4396,7 +4585,7 @@ PopulateDot11fTCLAS(tpAniSirGlobal pMac, pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag; break; default: - limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"), + limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS."), pDot11f->classifier_type ); return eSIR_FAILURE; } @@ -4468,7 +4657,7 @@ PopulateDot11fWMMTCLAS(tpAniSirGlobal pMac, pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag; break; default: - limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"), + limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS."), pDot11f->classifier_type ); return eSIR_FAILURE; } @@ -4491,7 +4680,7 @@ tSirRetStatus PopulateDot11fWsc(tpAniSirGlobal pMac, pDot11f->Version.minor = 0x00; if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS) - limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE ); + limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_STATE ); pDot11f->WPSState.present = 1; pDot11f->WPSState.state = (tANI_U8) wpsState; @@ -4526,7 +4715,7 @@ tSirRetStatus PopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac, pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar; if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS) - limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); + limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); pDot11f->DevicePasswordID.present = 1; pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId; @@ -4828,14 +5017,14 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_VERSION, &wpsVersion) != eSIR_SUCCESS) - limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_VERSION ); + limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_VERSION ); pDot11f->Version.present = 1; pDot11f->Version.major = (tANI_U8) ((wpsVersion & 0xF0)>>4); pDot11f->Version.minor = (tANI_U8) (wpsVersion & 0x0F); if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS) - limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE ); + limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_STATE ); pDot11f->WPSState.present = 1; pDot11f->WPSState.state = (tANI_U8) wpsState; @@ -4881,7 +5070,7 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, else { pDot11f->Manufacturer.num_name = (tANI_U8) (cfgStrLen & 0x000000FF); - pDot11f->Manufacturer.name[cfgStrLen] = '\0'; + pDot11f->Manufacturer.name[cfgStrLen - 1] = '\0'; } pDot11f->ModelName.present = 1; @@ -4897,7 +5086,7 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, else { pDot11f->ModelName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); - pDot11f->ModelName.text[cfgStrLen] = '\0'; + pDot11f->ModelName.text[cfgStrLen - 1] = '\0'; } pDot11f->ModelNumber.present = 1; @@ -4913,7 +5102,7 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, else { pDot11f->ModelNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); - pDot11f->ModelNumber.text[cfgStrLen] = '\0'; + pDot11f->ModelNumber.text[cfgStrLen - 1] = '\0'; } pDot11f->SerialNumber.present = 1; @@ -4929,21 +5118,21 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, else { pDot11f->SerialNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); - pDot11f->SerialNumber.text[cfgStrLen] = '\0'; + pDot11f->SerialNumber.text[cfgStrLen - 1] = '\0'; } pDot11f->PrimaryDeviceType.present = 1; if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, &val) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("cfg get prim device category failed\n")); + limLog(pMac, LOGP, FL("cfg get prim device category failed")); } else pDot11f->PrimaryDeviceType.primary_category = (tANI_U16) val; if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PIMARY_DEVICE_OUI, &val) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("cfg get prim device OUI failed\n")); + limLog(pMac, LOGP, FL("cfg get prim device OUI failed")); } else { @@ -4955,7 +5144,7 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_DEVICE_SUB_CATEGORY, &val) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("cfg get prim device sub category failed\n")); + limLog(pMac, LOGP, FL("cfg get prim device sub category failed")); } else pDot11f->PrimaryDeviceType.sub_category = (tANI_U16) val; @@ -4973,7 +5162,7 @@ tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, else { pDot11f->DeviceName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); - pDot11f->DeviceName.text[cfgStrLen] = '\0'; + pDot11f->DeviceName.text[cfgStrLen - 1] = '\0'; } if (wlan_cfgGetInt(pMac, @@ -5008,7 +5197,7 @@ tSirRetStatus PopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac, pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar; if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS) - limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); + limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); pDot11f->DevicePasswordID.present = 1; pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId; diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/utilsParser.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/utilsParser.c index 98b09b6db6c1..8ddc32adf846 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/utilsParser.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/utilsParser.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -136,7 +136,7 @@ tSirRetStatus ConvertWscOpaque( tpAniSirGlobal pMac, { // This is awful, I know, but the old code just rammed the IE into // an opaque array. Note that we need to explicitly add the vendorIE and OUI ! - tANI_U8 curAddIELen = pOld->length; + tANI_U16 curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[ curAddIELen++ ] = 0xdd; @@ -156,7 +156,7 @@ tSirRetStatus ConvertP2POpaque( tpAniSirGlobal pMac, { // This is awful, I know, but the old code just rammed the IE into // an opaque array. Note that we need to explicitly add the vendorIE and OUI ! - tANI_U8 curAddIELen = pOld->length; + tANI_U16 curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[ curAddIELen++ ] = 0xdd; @@ -177,7 +177,7 @@ tSirRetStatus ConvertWFDOpaque( tpAniSirGlobal pMac, { // This is awful, I know, but the old code just rammed the IE into // an opaque array. Note that we need to explicitly add the vendorIE and OUI ! - tANI_U8 curAddIELen = pOld->length; + tANI_U16 curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[ curAddIELen++ ] = 0xdd; diff --git a/drivers/staging/prima/CORE/TL/inc/wlan_qct_tl.h b/drivers/staging/prima/CORE/TL/inc/wlan_qct_tl.h index cbb2fa07109e..9dd518da7922 100644 --- a/drivers/staging/prima/CORE/TL/inc/wlan_qct_tl.h +++ b/drivers/staging/prima/CORE/TL/inc/wlan_qct_tl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -102,7 +102,10 @@ when who what, where, why #define WLANTL_LLC_SNAP_OFFSET 0 /*Size of the LLC/SNAP header*/ -#define WLANTL_LLC_SNAP_SIZE 8 +#define WLANTL_LLC_SNAP_SIZE 8 + +/* Number of Tx Queues, this should be same as NUM_TX_QUEUES in HDD */ +#define WLANTL_NUM_TX_QUEUES 5 /*============================================================================ * GENERIC STRUCTURES - not belonging to TL @@ -153,12 +156,26 @@ when who what, where, why --------------------------------------------------------------------------*/ typedef enum { + /* The values from 0-3 correspond both to the TL tx queue + * id and the also the AC corresponding to the packets queued + */ WLANTL_AC_BK = 0, WLANTL_AC_BE = 1, WLANTL_AC_VI = 2, - WLANTL_AC_VO = 3 + WLANTL_AC_VO = 3, + /* WLANTL_AC_HIGH_PRIO corresponds to the new queue + * added for handling eapol/wapi/dhcp packets. The AC for the + * packets in this queue has to be extracted separately + */ + WLANTL_AC_HIGH_PRIO = 4 }WLANTL_ACEnumType; +typedef struct +{ + v_MACADDR_t selfMac; + v_MACADDR_t spoofMac; +}WLANTL_SpoofMacAddr; + /*--------------------------------------------------------------------------- STA Type ---------------------------------------------------------------------------*/ @@ -302,7 +319,7 @@ typedef struct typedef struct { /*AC weight for WFQ*/ - v_U8_t ucAcWeights[WLANTL_MAX_AC]; + v_U8_t ucAcWeights[WLANTL_NUM_TX_QUEUES]; /*Delayed trigger frame timmer: - used by TL to send trigger frames less often when it has established that the App is suspended*/ @@ -389,6 +406,9 @@ typedef enum ---------------------------------------------------------------------------*/ typedef struct { + /* Save the AC of the packet */ + WLANTL_ACEnumType ac; + /* TID of the packet being sent */ v_U8_t ucTID; @@ -420,6 +440,7 @@ typedef struct v_BOOL_t bMorePackets; /* notifying TL if this is an ARP frame or not */ v_U8_t ucIsArp; + v_U32_t ucTxBdToken; }WLANTL_MetaInfoType; /*--------------------------------------------------------------------------- @@ -588,8 +609,8 @@ typedef tSap_SoftapStats WLANTL_TRANSFER_STA_TYPE; typedef enum { WLANTL_DEBUG_TX_SNAPSHOT = 1<<0, - WLANTL_DEBUG_FW_CLEANUP = 1<<1, + WLANTL_DEBUG_KICKDXE = 1<<2 }WLANTL_DebugFlags; /*---------------------------------------------------------------------------- @@ -670,6 +691,9 @@ typedef VOS_STATUS (*WLANTL_STAFetchPktCBType)( vos_pkt_t** vosDataBuff, WLANTL_MetaInfoType* tlMetaInfo); +typedef VOS_STATUS (*WLANTL_MonRxCBType)( v_PVOID_t pvosGCtx, + vos_pkt_t* vosDataBuff, + int conversion); /*---------------------------------------------------------------------------- DESCRIPTION @@ -1094,6 +1118,8 @@ WLANTL_ConfigureSwFrameTXXlationForAll v_BOOL_t enableFrameXlation ); +VOS_STATUS WLANTL_SetMonRxCbk(v_PVOID_t pvosGCtx, WLANTL_MonRxCBType pfnMonRx); +void WLANTL_SetIsConversionReq(v_PVOID_t pvosGCtx, v_BOOL_t isConversionReq); /*=========================================================================== FUNCTION WLANTL_RegisterSTAClient @@ -1808,6 +1834,42 @@ WLANTL_FlushStaTID INTERACTION WITH PE ---------------------------------------------------------------------------*/ +/*========================================================================== + + FUNCTION WLANTL_updateSpoofMacAddr + + DESCRIPTION + Called by HDD to update macaddr + + DEPENDENCIES + TL must be initialized before this API can be called. + + PARAMETERS + + IN + pvosGCtx: pointer to the global vos context; a handle to + TL's control block can be extracted from its context + spoofMacAddr: spoofed mac adderess + selfMacAddr: self Mac Address + + RETURN VALUE + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a + page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS + +============================================================================*/ +VOS_STATUS +WLANTL_updateSpoofMacAddr +( + v_PVOID_t pvosGCtx, + v_MACADDR_t* spoofMacAddr, + v_MACADDR_t* selfMacAddr +); /*========================================================================== FUNCTION WLANTL_RegisterMgmtFrmClient @@ -1946,7 +2008,8 @@ WLANTL_TxMgmtFrm v_U8_t tid, WLANTL_TxCompCBType pfnCompTxFunc, v_PVOID_t voosBDHeader, - v_U32_t ucAckResponse + v_U32_t ucAckResponse, + v_U32_t ucTxBdToken ); @@ -2161,6 +2224,41 @@ WLANTL_GetRxPktCount v_U32_t* puRxPktCount ); +/*========================================================================== + + FUNCTION WLANTL_IsEAPOLPending + + DESCRIPTION + + HDD calls this function when hdd_tx_timeout occurs. This checks whether + EAPOL is pending. + + DEPENDENCIES + + HDD must have registered with TL at least one STA before this function + can be called. + + PARAMETERS + + IN + pvosGCtx: pointer to the global vos context + + RETURN VALUE + + The result code associated with performing the operation + + Success : Indicates EAPOL frame is pending and sta is in connected state + + Failure : EAPOL frame is not pending + + SIDE EFFECTS +============================================================================*/ +VOS_STATUS +WLANTL_IsEAPOLPending +( + v_PVOID_t pvosGCtx +); + /*========================================================================== VOSS SCHEDULER INTERACTION ==========================================================================*/ @@ -2847,15 +2945,15 @@ void WLANTL_PostResNeeded(v_PVOID_t pvosGCtx); DESCRIPTION This function is used by HDD to notify TL to finish Upper layer authentication - incase the last EAPOL packet is pending in the TL queue. - To avoid the race condition between sme set key and the last EAPOL packet + incase the last EAPOL packet is pending in the TL queue. + To avoid the race condition between sme set key and the last EAPOL packet the HDD module calls this function just before calling the sme_RoamSetKey. - + DEPENDENCIES TL must have been initialized before this gets called. - + PARAMETERS callbackRoutine: HDD Callback function. @@ -2864,9 +2962,9 @@ void WLANTL_PostResNeeded(v_PVOID_t pvosGCtx); RETURN VALUE VOS_STATUS_SUCCESS/VOS_STATUS_FAILURE - + SIDE EFFECTS - + ============================================================================*/ VOS_STATUS WLANTL_Finish_ULA( void (*callbackRoutine) (void *callbackContext), @@ -3191,4 +3289,13 @@ WLANTL_FatalError v_VOID_t ); +/** + * WLANTL_SetKeySeqCounter() - set sequence key counter + * @pvosGCtx: global vos context + * @counter: key sequence counter + * @staid: station index + * + * Return: void + */ +void WLANTL_SetKeySeqCounter(void *pvosGCtx, u64 counter, uint8_t staid); #endif /* #ifndef WLAN_QCT_WLANTL_H */ diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c index 8b7247dc45f8..31e7ad982662 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,9 +45,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -141,6 +138,7 @@ #include "vos_trace.h" #include "wlan_qct_tl_trace.h" #include "tlDebug.h" +#include "cfgApi.h" #ifdef FEATURE_WLAN_WAPI /*Included to access WDI_RxBdType */ #include "wlan_qct_wdi_bd.h" @@ -204,6 +202,9 @@ int bdPduInterruptGetThreshold = WLANTL_BD_PDU_INTERRUPT_GET_THRESHOLD; ( ( WLANTL_80211_MGMT_ACTION_SUBTYPE == ( (_type_sub) & 0xF )) || \ ( WLANTL_80211_MGMT_ACTION_NO_ACK_SUBTYPE == ( (_type_sub) & 0xF )))) +#define WLANTL_IS_PROBE_REQ(_type_sub) \ + ( WLANTL_MGMT_PROBE_REQ_FRAME_TYPE == ( (_type_sub) & 0x3F )) + #define WLANTL_IS_CTRL_FRAME(_type_sub) \ ( WLANTL_CTRL_FRAME_TYPE == ( (_type_sub) & 0x30 )) @@ -215,7 +216,7 @@ int bdPduInterruptGetThreshold = WLANTL_BD_PDU_INTERRUPT_GET_THRESHOLD; /*MAX Allowed len processed by TL - MAx MTU + 802.3 header + BD+DXE+XTL*/ #define WLANTL_MAX_ALLOWED_LEN (1514 + 100) -#define WLANTL_MASK_AC 0x03 +#define WLANTL_DATA_FLOW_MASK 0x0F //some flow_control define //LWM mode will be enabled for this station if the egress/ingress falls below this ratio @@ -237,6 +238,10 @@ int bdPduInterruptGetThreshold = WLANTL_BD_PDU_INTERRUPT_GET_THRESHOLD; /* Maximum value of SNR that can be calculated by the HW */ #define WLANTL_MAX_HW_SNR 35 +#define DISABLE_ARP_TOGGLE 0 +#define ENABLE_ARP_TOGGLE 1 +#define SEND_ARP_ON_WQ5 2 + /*---------------------------------------------------------------------------- * Type Declarations * -------------------------------------------------------------------------*/ @@ -320,7 +325,7 @@ typedef struct do\ {\ _ucACMask = 0; \ - for ( i = 0; i < WLANTL_MAX_AC; i++ ) \ + for ( i = 0; i < WLANTL_NUM_TX_QUEUES; i++ ) \ { \ if ( 0 != (_pSTA)->aucACMask[i] ) \ { \ @@ -346,32 +351,6 @@ WLANTL_GetEtherType v_U16_t * usEtherType ); -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/* FIXME_MUST: during TDLS integration to main/latest, WLANTL_GetEtherType() conflicts. -But there is difference. existing WLANTL_GetEtherType() expects vosDataBuff->offset points to MPDU Header, -wherease TDLS expect vosDataBuff->offset should still points to RxBd. -So far, data frmae stripped RxBD and passed to data frame handler. -(RxBd should not be stripped in case TDLS, because it will be eventually routed to mgmt packet -handler, where RX BD should be preserved) -To avoid breaking existing functionality, for now, I temporarily rename to -WLANTL_GetEtherType_2(). Eventually this function should be removed and merged to WLANTL_GetEtherType() -*/ -static VOS_STATUS -WLANTL_GetEtherType_2 -( - v_U8_t * aucBDHeader, - vos_pkt_t * vosDataBuff, - v_U8_t ucMPDUHLen, - v_U16_t * usEtherType -); -#endif -#ifdef FEATURE_WLAN_WAPI -/*--------------------------------------------------------------------------- - * Adding a global variable to be used when doing frame translation in TxAuth - * state so as to not set the protected bit to 1 in the case of WAI frames - *---------------------------------------------------------------------------*/ -v_U8_t gUcIsWai; -#endif /*---------------------------------------------------------------------------- * Externalized Function Definitions @@ -471,7 +450,7 @@ WLANTL_Open if (( NULL == pTLCb ) || ( NULL == pTLConfig ) ) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_FATAL, - "WLAN TL: Invalid input pointer on WLANTL_Open TL %p Config %p", pTLCb, pTLConfig )); + "WLAN TL: Invalid input pointer on WLANTL_Open TL %pK Config %pK", pTLCb, pTLConfig )); return VOS_STATUS_E_FAULT; } @@ -516,7 +495,7 @@ WLANTL_Open } } - pTLCb->reorderBufferPool = vos_mem_malloc(sizeof(WLANTL_REORDER_BUFFER_T) * WLANTL_MAX_BA_SESSION); + pTLCb->reorderBufferPool = vos_mem_vmalloc(sizeof(WLANTL_REORDER_BUFFER_T) * WLANTL_MAX_BA_SESSION); if (NULL == pTLCb->reorderBufferPool) { TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "WLAN TL: Reorder buffer allocation failed")); @@ -529,7 +508,7 @@ WLANTL_Open WLANTL_CleanCB(pTLCb, 0 /*do not empty*/); - for ( ucIndex = 0; ucIndex < WLANTL_MAX_AC ; ucIndex++) + for ( ucIndex = 0; ucIndex < WLANTL_NUM_TX_QUEUES ; ucIndex++) { pTLCb->tlConfigInfo.ucAcWeights[ucIndex] = pTLConfig->ucAcWeights[ucIndex]; } @@ -578,7 +557,7 @@ WLANTL_Open TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "Handoff support module init fail")); WLANTL_FreeClientMemory(pTLCb->atlSTAClients); - vos_mem_free(pTLCb->reorderBufferPool); + vos_mem_vfree(pTLCb->reorderBufferPool); vos_free_context(pvosGCtx, VOS_MODULE_ID_TL, pTLCb); return status; } @@ -850,7 +829,7 @@ WLANTL_Close WLANTL_FreeClientMemory(pTLCb->atlSTAClients); - vos_mem_free(pTLCb->reorderBufferPool); + vos_mem_vfree(pTLCb->reorderBufferPool); /*------------------------------------------------------------------------ Free TL context from VOSS global @@ -1083,7 +1062,7 @@ void WLANTL_AssocFailed(v_U8_t staId) " %s fails to start forwarding (staId %d)", __func__, staId); } } - + /*=========================================================================== FUNCTION WLANTL_Finish_ULA @@ -1097,18 +1076,18 @@ void WLANTL_AssocFailed(v_U8_t staId) DEPENDENCIES TL must have been initialized before this gets called. - + PARAMETERS callbackRoutine: HDD Callback function. callbackContext : HDD userdata context. - + RETURN VALUE VOS_STATUS_SUCCESS/VOS_STATUS_FAILURE - + SIDE EFFECTS - + ============================================================================*/ VOS_STATUS WLANTL_Finish_ULA( void (*callbackRoutine) (void *callbackContext), @@ -1176,6 +1155,8 @@ WLANTL_RegisterSTAClient WLANTL_CbType* pTLCb = NULL; WLANTL_STAClientType* pClientSTA = NULL; v_U8_t ucTid = 0;/*Local variable to clear previous replay counters of STA on all TIDs*/ + v_U32_t istoggleArpEnb = 0; + tpAniSirGlobal pMac; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ @@ -1259,10 +1240,18 @@ WLANTL_RegisterSTAClient pClientSTA->wSTADesc.ucSTAId = pwSTADescType->ucSTAId; pClientSTA->ptkInstalled = 0; + pMac = vos_get_context(VOS_MODULE_ID_PE, pvosGCtx); + if ( NULL != pMac ) + { + wlan_cfgGetInt(pMac, WNI_CFG_TOGGLE_ARP_BDRATES, &istoggleArpEnb); + } + pClientSTA->arpRate = istoggleArpEnb ? ENABLE_ARP_TOGGLE : DISABLE_ARP_TOGGLE; + pClientSTA->arpOnWQ5 = istoggleArpEnb == SEND_ARP_ON_WQ5; + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN TL:Registering STA Client ID: %d with UC %d and BC %d", - pwSTADescType->ucSTAId, - pwSTADescType->ucUcastSig, pwSTADescType->ucBcastSig)); + "WLAN TL:Registering STA Client ID: %d with UC %d and BC %d toggleArp :%hhu", + pwSTADescType->ucSTAId, pwSTADescType->ucUcastSig, + pwSTADescType->ucBcastSig, pClientSTA->arpRate)); pClientSTA->wSTADesc.wSTAType = pwSTADescType->wSTAType; @@ -1332,7 +1321,7 @@ WLANTL_RegisterSTAClient made in the main TL loop after the supported mask is properly updated in the pending packets call --------------------------------------------------------------------*/ - pClientSTA->ucCurrentAC = WLANTL_AC_VO; + pClientSTA->ucCurrentAC = WLANTL_AC_HIGH_PRIO; pClientSTA->ucCurrentWeight = 0; pClientSTA->ucServicedAC = WLANTL_AC_BK; pClientSTA->ucEapolPktPending = 0; @@ -1384,6 +1373,7 @@ WLANTL_RegisterSTAClient data to calculate RSSI. So to avoid reporting zero, we are initializing RSSI with RSSI saved in BssDescription during scanning. */ pClientSTA->rssiAvg = rssi; + pClientSTA->rssiAvgBmps = rssi; #ifdef FEATURE_WLAN_TDLS if(WLAN_STA_TDLS == pClientSTA->wSTADesc.wSTAType) { @@ -1750,10 +1740,44 @@ WLANTL_UpdateTdlsSTAClient pClientSTA->wSTADesc.ucQosEnabled = pwSTADescType->ucQosEnabled; + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, + "WLAN TL: %s: ucQosEnabled of pwSTADescType: %d" + "pClientSTA->wSTADesc: %d", + __func__, pwSTADescType->ucQosEnabled, + pClientSTA->wSTADesc.ucQosEnabled)); + return VOS_STATUS_SUCCESS; } +VOS_STATUS WLANTL_SetMonRxCbk(v_PVOID_t pvosGCtx, WLANTL_MonRxCBType pfnMonRx) +{ + WLANTL_CbType* pTLCb = NULL ; + pTLCb = VOS_GET_TL_CB(pvosGCtx); + if ( NULL == pTLCb ) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL:Invalid TL pointer from pvosGCtx on WLANTL_RegisterSTAClient")); + return VOS_STATUS_E_FAULT; + } + pTLCb->pfnMonRx = pfnMonRx; + return VOS_STATUS_SUCCESS; +} + +void WLANTL_SetIsConversionReq(v_PVOID_t pvosGCtx, v_BOOL_t isConversionReq) +{ + WLANTL_CbType* pTLCb = NULL ; + pTLCb = VOS_GET_TL_CB(pvosGCtx); + if ( NULL == pTLCb ) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL:Invalid TL pointer from pvosGCtx on WLANTL_RegisterSTAClient")); + return; + } + pTLCb->isConversionReq = isConversionReq; + return; +} + /*=========================================================================== @@ -2155,8 +2179,6 @@ WLANTL_STAPktPending if (( pTLCb->uResCount >= WDA_TLI_MIN_RES_DATA ) && ( 0 == pTLCb->ucTxSuspended )) { - MTRACE(vos_trace(VOS_MODULE_ID_TL, TRACE_CODE_TL_STA_PKT_PENDING, - ucSTAId, pClientSTA->tlState )); TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, "Issuing Xmit start request to BAL")); @@ -2525,7 +2547,8 @@ WLANTL_TxBAPFrm ucWDSEnabled, extraHeadSpace, pMetaInfo->ucType, &pTLCb->atlSTAClients[ucStaId]->wSTADesc.vSelfMACAddress, pMetaInfo->ucTID, 0 /* No ACK */, pMetaInfo->usTimeStamp, - pMetaInfo->ucIsEapol || pMetaInfo->ucIsWai, pMetaInfo->ucUP ); + pMetaInfo->ucIsEapol || pMetaInfo->ucIsWai, pMetaInfo->ucUP, + pMetaInfo->ucTxBdToken); if ( VOS_STATUS_SUCCESS != vosStatus ) { @@ -3042,7 +3065,68 @@ WLANTL_FlushStaTID /*---------------------------------------------------------------------------- INTERACTION WITH PE ---------------------------------------------------------------------------*/ +/*========================================================================== + + FUNCTION WLANTL_updateSpoofMacAddr + + DESCRIPTION + Called by HDD to update macaddr + + DEPENDENCIES + TL must be initialized before this API can be called. + PARAMETERS + + IN + pvosGCtx: pointer to the global vos context; a handle to + TL's control block can be extracted from its context + spoofMacAddr: spoofed mac adderess + selfMacAddr: self Mac Address + + RETURN VALUE + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a + page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS + +============================================================================*/ +VOS_STATUS +WLANTL_updateSpoofMacAddr +( + v_PVOID_t pvosGCtx, + v_MACADDR_t* spoofMacAddr, + v_MACADDR_t* selfMacAddr +) +{ + WLANTL_CbType* pTLCb = NULL; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ + + /*------------------------------------------------------------------------ + Extract TL control block + ------------------------------------------------------------------------*/ + pTLCb = VOS_GET_TL_CB(pvosGCtx); + if ( NULL == pTLCb ) + { + VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL:Invalid TL pointer from pvosGCtx on WLANTL_ChangeSTAState"); + return VOS_STATUS_E_FAULT; + } + + vos_mem_copy(pTLCb->spoofMacAddr.selfMac.bytes, selfMacAddr, + VOS_MAC_ADDRESS_LEN); + vos_mem_copy(pTLCb->spoofMacAddr.spoofMac.bytes, spoofMacAddr, + VOS_MAC_ADDRESS_LEN); + + VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW, + "TL: SelfSTA mac Addr for current Scan "MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(pTLCb->spoofMacAddr.selfMac.bytes)); + + return VOS_STATUS_SUCCESS; +}/* WLANTL_updateSpoofMacAddr */ /*========================================================================== FUNCTION WLANTL_RegisterMgmtFrmClient @@ -3280,7 +3364,8 @@ WLANTL_TxMgmtFrm v_U8_t ucTid, WLANTL_TxCompCBType pfnCompTxFunc, v_PVOID_t pvBDHeader, - v_U32_t ucAckResponse + v_U32_t ucAckResponse, + v_U32_t ucTxBdToken ) { WLANTL_CbType* pTLCb = NULL; @@ -3385,13 +3470,26 @@ WLANTL_TxMgmtFrm { uQosHdr = VOS_TRUE; } + + if (WLANTL_IS_PROBE_REQ(wFrmType)) + { + if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pvAddr2MacAddr, + (v_VOID_t*) &pTLCb->spoofMacAddr.spoofMac, VOS_MAC_ADDRESS_LEN)) + { + pvAddr2MacAddr = (v_PVOID_t)pTLCb->spoofMacAddr.selfMac.bytes; + VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, + "TL: using self sta addr to get staidx for spoofed probe req " + MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pvAddr2MacAddr->bytes)); + } + } + /*---------------------------------------------------------------------- Call WDA to build TX header ----------------------------------------------------------------------*/ vosStatus = WDA_DS_BuildTxPacketInfo( pvosGCtx, vosFrmBuf , &vDestMacAddr, 1 /* always 802.11 frames*/, &usPktLen, uQosHdr /*qos not enabled !!!*/, - 0 /* WDS off */, 0, wFrmType, pvAddr2MacAddr, ucTid, - ucAckResponse, usTimeStamp, 0, 0 ); + 0 /* WDS off */, 0, wFrmType, pvAddr2MacAddr, ucTid, + ucAckResponse, usTimeStamp, 0, 0, ucTxBdToken); if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) @@ -4031,6 +4129,71 @@ WLANTL_TxFCFrame ( v_PVOID_t pvosGCtx ); + +/*========================================================================== + + FUNCTION WLANTL_IsEAPOLPending + + DESCRIPTION + + HDD calls this function when hdd_tx_timeout occurs. This checks whether + EAPOL is pending. + + DEPENDENCIES + + HDD must have registered with TL at least one STA before this function + can be called. + + PARAMETERS + + IN + pvosGCtx: pointer to the global vos context + + RETURN VALUE + + The result code associated with performing the operation + + Success : Indicates EAPOL frame is pending and sta is in connected state + + Failure : EAPOL frame is not pending + + SIDE EFFECTS +============================================================================*/ +VOS_STATUS +WLANTL_IsEAPOLPending +( + v_PVOID_t pvosGCtx +) +{ + WLANTL_CbType* pTLCb = NULL; + v_U32_t i = 0; + /*------------------------------------------------------------------------ + Sanity check + Extract TL control block + ------------------------------------------------------------------------*/ + pTLCb = VOS_GET_TL_CB(pvosGCtx); + if (NULL == pTLCb) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL:Invalid TL pointer for pvosGCtx")); + return VOS_STATUS_E_FAILURE; + } + /*--------------------------------------------------------------------- + Check to see if there was any EAPOL packet is pending + *--------------------------------------------------------------------*/ + for ( i = 0; i < WLAN_MAX_STA_COUNT; i++) + { + if ((NULL != pTLCb->atlSTAClients[i]) && + (pTLCb->atlSTAClients[i]->ucExists) && + (0 == pTLCb->atlSTAClients[i]->ucTxSuspended) && + (WLANTL_STA_CONNECTED == pTLCb->atlSTAClients[i]->tlState) && + (pTLCb->atlSTAClients[i]->ucPktPending) + ) + return VOS_STATUS_SUCCESS; + } + return VOS_STATUS_E_FAILURE; +} + /*============================================================================ TL INTERNAL API DEFINITION ============================================================================*/ @@ -4314,19 +4477,33 @@ WLANTL_GetFrames /* Serve EAPOL frame with HI_FLOW_MASK */ ucSTAId = i; + pClientSTA = pTLCb->atlSTAClients[ucSTAId]; + MTRACE(vos_trace(VOS_MODULE_ID_TL, - TRACE_CODE_TL_GET_FRAMES_EAPOL, ucSTAId, pTLCb->atlSTAClients[i]->tlState)); + TRACE_CODE_TL_GET_FRAMES_EAPOL, ucSTAId, pClientSTA->tlState)); - for (j = WLANTL_MAX_AC ; j > 0; j--) + if (pClientSTA->wSTADesc.wSTAType == WLAN_STA_INFRA) { - if (0 != pTLCb->atlSTAClients[ucSTAId]->aucACMask[j-1]) - { - pTLCb->atlSTAClients[ucSTAId]->ucCurrentAC = j-1; - pTLCb->uCurServedAC = j-1; - } + if(0 != pClientSTA->aucACMask[WLANTL_AC_HIGH_PRIO]) + { + pClientSTA->ucCurrentAC = WLANTL_AC_HIGH_PRIO; + pTLCb->uCurServedAC = WLANTL_AC_HIGH_PRIO; + } + else + break; + } + else + { + for (j = WLANTL_MAX_AC ; j > 0; j--) + { + if (0 != pClientSTA->aucACMask[j-1]) + { + pClientSTA->ucCurrentAC = j-1; + pTLCb->uCurServedAC = j-1; + break; + } + } } - - pClientSTA = pTLCb->atlSTAClients[ucSTAId]; wSTAEvent = WLANTL_TX_EVENT; @@ -4401,10 +4578,7 @@ WLANTL_GetFrames else if (( WDA_TLI_MIN_RES_DATA <= pTLCb->uResCount ) && ( 0 == pTLCb->ucTxSuspended ) && - (( uFlowMask & ( 1 << WDA_TXFLOW_AC_BK ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_BE ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_VI ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_VO ) )) ) + ( uFlowMask & WLANTL_DATA_FLOW_MASK)) { /*--------------------------------------------------------------------- Check to see if there was any packet left behind previously due to @@ -4514,7 +4688,7 @@ WLANTL_GetFrames if ( ( pTLCb->uResCount >= (uResLen + WDA_TLI_MIN_RES_BAP ) ) && ( uRemaining > uTotalPktLen ) && - ( uFlowMask & ( 1 << ucAC ) ) ) + ( uFlowMask & WLANTL_DATA_FLOW_MASK ) ) { TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, "WLAN TL:Chaining data frame on GetFrame")); @@ -4577,10 +4751,7 @@ WLANTL_GetFrames /* TL is starving even when DXE is not in low resource condition Return min resource number required and Let DXE deceide what to do */ if(( 0 == pTLCb->ucTxSuspended ) && - (( uFlowMask & ( 1 << WDA_TXFLOW_AC_BK ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_BE ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_VI ) ) || - ( uFlowMask & ( 1 << WDA_TXFLOW_AC_VO ) ))) + ( uFlowMask & WLANTL_DATA_FLOW_MASK ) ) { TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "WLAN TL:Returning from GetFrame: resources = %d", @@ -4701,7 +4872,7 @@ WLANTL_TxComp } TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN TL:Calling Tx complete for pkt %p in function %p", + "WLAN TL:Calling Tx complete for pkt %pK in function %pK", vosDataBuff, pfnTxComp)); vosTempTx = vosDataBuff; @@ -4779,8 +4950,8 @@ WLANTL_CacheSTAFrame if (( NULL == pTLCb ) || ( NULL == vosTempBuff ) ) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL: Invalid input pointer on WLANTL_CacheSTAFrame TL %p" - " Packet %p", pTLCb, vosTempBuff )); + "WLAN TL: Invalid input pointer on WLANTL_CacheSTAFrame TL %pK" + " Packet %pK", pTLCb, vosTempBuff )); return VOS_STATUS_E_FAULT; } @@ -4995,7 +5166,7 @@ WLANTL_ForwardSTAFrames if ( NULL == pTLCb ) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL: Invalid input pointer on WLANTL_ForwardSTAFrames TL %p", + "WLAN TL: Invalid input pointer on WLANTL_ForwardSTAFrames TL %pK", pTLCb )); return VOS_STATUS_E_FAULT; } @@ -5633,16 +5804,13 @@ WLANTL_RxFrames static v_U8_t first_data_pkt_arrived; v_U32_t uDPUSig; v_U16_t usPktLen; -#ifdef FEATURE_WLAN_TDLS_INTERNAL - v_U8_t ucMPDUHLen = 0 ; - v_U16_t usEtherType = 0; -#endif v_BOOL_t bForwardIAPPwithLLC = VOS_FALSE; #ifdef WLAN_FEATURE_LINK_LAYER_STATS v_S7_t currentAvgRSSI = 0; v_U8_t ac; #endif + u64 pn_num; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ @@ -5687,6 +5855,16 @@ WLANTL_RxFrames vos_pkt_walk_packet_chain( vosDataBuff, &vosDataBuff, 1/*true*/ ); + if( vos_get_conparam() == VOS_MONITOR_MODE ) + { + if( pTLCb->isConversionReq ) + WLANTL_MonTranslate80211To8023Header(vosTempBuff, pTLCb); + + pTLCb->pfnMonRx(pvosGCtx, vosTempBuff, pTLCb->isConversionReq); + vosTempBuff = vosDataBuff; + continue; + } + /*--------------------------------------------------------------------- Peek at BD header - do not remove !!! Optimize me: only part of header is needed; not entire one @@ -5743,24 +5921,13 @@ WLANTL_RxFrames continue; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL - if ( WLANTL_IS_DATA_FRAME(ucFrmType)) - { - ucMPDUHLen = (v_U8_t)WDA_GET_RX_MPDU_HEADER_LEN(pvBDHeader); - WLANTL_GetEtherType_2(pvBDHeader, vosTempBuff, ucMPDUHLen, &usEtherType) ; - } -#endif vos_pkt_get_packet_length(vosTempBuff, &usPktLen); /*--------------------------------------------------------------------- Check if management and send to PE ---------------------------------------------------------------------*/ - if ( WLANTL_IS_MGMT_FRAME(ucFrmType) -#ifdef FEATURE_WLAN_TDLS_INTERNAL - || (WLANTL_IS_TDLS_FRAME(usEtherType)) -#endif - ) + if ( WLANTL_IS_MGMT_FRAME(ucFrmType)) { TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, "WLAN TL:Sending packet to management client")); @@ -5822,9 +5989,9 @@ WLANTL_RxFrames { ucSTAId = (v_U8_t)WDA_GET_RX_STAID( pvBDHeader ); ucTid = (v_U8_t)WDA_GET_RX_TID( pvBDHeader ); -#ifdef WLAN_FEATURE_LINK_LAYER_STATS - ac = WLANTL_TID_2_AC[ucTid]; -#endif + pn_num = WDA_GET_RX_REPLAY_COUNT(pvBDHeader); + + vosTempBuff->pn_num = pn_num; TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, "WLAN TL:Data packet received for STA %d", ucSTAId)); @@ -5849,16 +6016,21 @@ WLANTL_RxFrames } }/*if bcast*/ - if ( WLANTL_STA_ID_INVALID(ucSTAId) ) + if ((WLANTL_STA_ID_INVALID(ucSTAId)) || (WLANTL_TID_INVALID(ucTid))) { TLLOGW(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_WARN, - "WLAN TL:STA ID invalid - dropping pkt")); + "WLAN TL:STAId %d, Tid %d. Invalid STA ID/TID- dropping pkt", + ucSTAId, ucTid)); /* Drop packet */ vos_pkt_return_packet(vosTempBuff); vosTempBuff = vosDataBuff; continue; } +#ifdef WLAN_FEATURE_LINK_LAYER_STATS + ac = WLANTL_TID_2_AC[ucTid]; +#endif + /*---------------------------------------------------------------------- No need to lock cache access because cache manipulation only happens in the transport thread/task context @@ -6889,13 +7061,12 @@ WLANTL_TxThreadDebugHandler WLANTL_CbType* pTLCb = NULL; WLANTL_STAClientType* pClientSTA = NULL; int i = 0; - tWDA_CbContext *pWDA = NULL; + v_U8_t uFlowMask; // TX FlowMask from WDA TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_FATAL, "WLAN TL: %s Enter ", __func__)); pTLCb = VOS_GET_TL_CB(pVosContext); - pWDA = (tWDA_CbContext *)vos_get_global_context(VOS_MODULE_ID_WDA, pVosContext); if ( NULL == pVosContext || NULL == pTLCb ) { @@ -6904,11 +7075,12 @@ WLANTL_TxThreadDebugHandler return; } - if (NULL != pWDA) + if (VOS_STATUS_SUCCESS == WDA_DS_GetTxFlowMask(pVosContext, &uFlowMask)) { TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WDA uTxFlowMask: %d", pWDA->uTxFlowMask)); + "WDA uTxFlowMask: 0x%x", uFlowMask)); } + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "************************TL DUMP INFORMATION**************")); @@ -6945,7 +7117,7 @@ WLANTL_TxThreadDebugHandler "TDLS Peer Count: %d", pTLCb->ucTdlsPeerCount)); #endif - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "++++++++++++++++++++Registerd Client Information++++++++++")); for ( i =0; iwSTADesc.ucSTAId, pClientSTA->wSTADesc.vSTAMACAddress.bytes)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "STA Type: %d\tProtectedFrame: %d", pClientSTA->wSTADesc.wSTAType, pClientSTA->wSTADesc.ucProtectedFrame)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "QoS: %d\tRxFrameTrans: %d\tTxFrameTrans: %d", pClientSTA->wSTADesc.ucQosEnabled, pClientSTA->wSTADesc.ucSwFrameRXXlation, pClientSTA->wSTADesc.ucSwFrameTXXlation)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "ucUcastSig: %d\tucBcastSig: %d", pClientSTA->wSTADesc.ucUcastSig, pClientSTA->wSTADesc.ucBcastSig)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "ClientIndex: %d\t Exists: %d", i, pClientSTA->ucExists)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "TL State: %d\t TL Priority: %d", pClientSTA->tlState, pClientSTA->tlPri)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "ucTxSuspended: %d\tucPktPending: %d", pClientSTA->ucTxSuspended, pClientSTA->ucPktPending)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "ucEAPOLPktPending: %d\tucNoMoreData: %d", pClientSTA->ucEapolPktPending, pClientSTA->ucNoMoreData)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "enableCaching: %d\t fcStaTxDisabled: %d", pClientSTA->enableCaching, pClientSTA->fcStaTxDisabled)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "ucCurrentAC: %d\tucServicedAC: %d", pClientSTA->ucCurrentAC, pClientSTA->ucServicedAC)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "TID: %d\tautTxCount[0]: %d\tauRxCount[0]: %d",0, pClientSTA->auTxCount[0], pClientSTA->auRxCount[0])); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "aucAcMask[0]: %d\taucAcMask[1]: %d\taucAcMask[2]: %d\taucAcMask[3]: %d\t", pClientSTA->aucACMask[0], pClientSTA->aucACMask[1], pClientSTA->aucACMask[2], pClientSTA->aucACMask[3])); TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "ucCurrentWeight: %d", pClientSTA->ucCurrentWeight)); if( WLAN_STA_SOFTAP == pClientSTA->wSTADesc.wSTAType) { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "TrafficStatistics for SOFTAP Station:")); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "RUF=%d\tRMF=%d\tRBF=%d", pClientSTA->trafficStatistics.rxUCFcnt, pClientSTA->trafficStatistics.rxMCFcnt, pClientSTA->trafficStatistics.rxBCFcnt)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "RUB=%d\tRMB=%d\tRBB=%d", pClientSTA->trafficStatistics.rxUCBcnt, pClientSTA->trafficStatistics.rxMCBcnt, pClientSTA->trafficStatistics.rxBCBcnt)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "TUF=%d\tTMF=%d\tTBF=%d", pClientSTA->trafficStatistics.txUCFcnt, pClientSTA->trafficStatistics.txMCFcnt, pClientSTA->trafficStatistics.txBCFcnt)); - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, "TUB=%d\tTMB=%d\tTBB=%d", pClientSTA->trafficStatistics.txUCBcnt, pClientSTA->trafficStatistics.txMCBcnt, pClientSTA->trafficStatistics.txBCBcnt)); } + } return; } @@ -7126,6 +7300,19 @@ WLANTL_TLDebugMessage return; } } + if(debugFlags & WLANTL_DEBUG_KICKDXE) + { + vosMsg.reserved = 0; + vosMsg.bodyptr = NULL; + vosMsg.type = WLANTL_TX_KICKDXE; + + status = vos_tx_mq_serialize( VOS_MODULE_ID_TL, &vosMsg); + if(status != VOS_STATUS_SUCCESS) + { + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "TX Msg Posting Failed with status: %d",status)); + return; + } + } return; } @@ -7352,7 +7539,7 @@ WLANTL_STATxConn Even if this AC is not supported by the station, correction will be made in the main TL loop --------------------------------------------------------------------*/ - pClientSTA->ucCurrentAC = WLANTL_AC_VO; + pClientSTA->ucCurrentAC = WLANTL_AC_HIGH_PRIO; pClientSTA->ucCurrentWeight = 0; VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, @@ -7489,7 +7676,8 @@ WLANTL_STATxConn extraHeadSpace, ucTypeSubtype, &pClientSTA->wSTADesc.vSelfMACAddress, ucTid, txFlag, - tlMetaInfo.usTimeStamp, tlMetaInfo.ucIsEapol || tlMetaInfo.ucIsWai, tlMetaInfo.ucUP ); + tlMetaInfo.usTimeStamp, tlMetaInfo.ucIsEapol || tlMetaInfo.ucIsWai, tlMetaInfo.ucUP, + tlMetaInfo.ucTxBdToken); if ( VOS_STATUS_SUCCESS != vosStatus ) { @@ -7581,7 +7769,7 @@ WLANTL_STATxAuth WLANTL_STAClientType *pStaClient = NULL; v_U8_t ucWDSEnabled = 0; v_U32_t ucTxFlag = 0; - v_U8_t ucACMask, i; + v_U8_t ucACMask, i; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ @@ -7592,7 +7780,7 @@ WLANTL_STATxAuth if (( NULL == pTLCb ) || ( NULL == pvosDataBuff )) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL:Invalid input params on WLANTL_STATxAuth TL %p DB %p", + "WLAN TL:Invalid input params on WLANTL_STATxAuth TL %pK DB %pK", pTLCb, pvosDataBuff)); if (NULL != pvosDataBuff) { @@ -7683,8 +7871,8 @@ WLANTL_STATxAuth { VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, - "WLAN TL:Failed while attempting to fetch pkt from HDD %d", - vosStatus); + "WLAN TL:Failed while attempting to fetch pkt from HDD QId:%d status:%d", + ucAC, vosStatus); *pvosDataBuff = NULL; /*-------------------------------------------------------------------- Reset AC for the serviced station to the highest priority AC @@ -7692,7 +7880,7 @@ WLANTL_STATxAuth Even if this AC is not supported by the station, correction will be made in the main TL loop --------------------------------------------------------------------*/ - pStaClient->ucCurrentAC = WLANTL_AC_VO; + pStaClient->ucCurrentAC = WLANTL_AC_HIGH_PRIO; pStaClient->ucCurrentWeight = 0; return vosStatus; @@ -7757,7 +7945,11 @@ WLANTL_STATxAuth -----------------------------------------------------------------------*/ while ( 0 != ucACMask ) { - ucNextAC = (WLANTL_ACEnumType)(( tempAC - 1 ) & WLANTL_MASK_AC); + if(tempAC == WLANTL_AC_BK) + ucNextAC = WLANTL_AC_HIGH_PRIO; + else + ucNextAC = (tempAC - 1); + if ( 0 != pStaClient->aucACMask[ucNextAC] ) { pStaClient->ucCurrentAC = ucNextAC; @@ -7838,10 +8030,6 @@ WLANTL_STATxAuth { /* SW based translation */ -#ifdef FEATURE_WLAN_WAPI - gUcIsWai = tlMetaInfo.ucIsWai, -#endif - vosStatus = WLANTL_Translate8023To80211Header( vosDataBuff, &vosStatus, pTLCb, &ucSTAId, &tlMetaInfo, &ucWDSEnabled, @@ -7881,7 +8069,11 @@ WLANTL_STATxAuth ucTypeSubtype |= (WLANTL_80211_DATA_QOS_SUBTYPE); } - ucTxFlag = (0 != pStaClient->wUAPSDInfo[ucAC].ucSet)? + /* ucAC now points to TL Q ID with a new queue added in TL, + * hence look for the uapsd info for the correct AC that + * this packet belongs to. + */ + ucTxFlag = (0 != pStaClient->wUAPSDInfo[tlMetaInfo.ac].ucSet)? HAL_TRIGGER_ENABLED_AC_MASK:0; #ifdef FEATURE_WLAN_WAPI @@ -7904,8 +8096,21 @@ WLANTL_STATxAuth #endif /* FEATURE_WLAN_TDLS */ if( tlMetaInfo.ucIsArp ) { - /*Send ARP at lowest Phy rate and through WQ5 */ - ucTxFlag |= HAL_USE_BD_RATE_MASK; + if (pStaClient->arpOnWQ5) + { + ucTxFlag |= HAL_USE_FW_IN_TX_PATH; + } + if (pStaClient->arpRate == 0) + { + ucTxFlag |= HAL_USE_BD_RATE_1_MASK; + } + else if (pStaClient->arpRate == 1 || pStaClient->arpRate == 3) + { + pStaClient->arpRate ^= 0x2; + ucTxFlag |= HAL_USE_BD_RATE_1_MASK<<(pStaClient->arpRate-1); + } + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, + "arp pkt sending on BD rate: %hhu", pStaClient->arpRate)); } vosStatus = (VOS_STATUS)WDA_DS_BuildTxPacketInfo( pvosGCtx, @@ -7915,7 +8120,8 @@ WLANTL_STATxAuth extraHeadSpace, ucTypeSubtype, &pStaClient->wSTADesc.vSelfMACAddress, ucTid, ucTxFlag, tlMetaInfo.usTimeStamp, - tlMetaInfo.ucIsEapol, tlMetaInfo.ucUP ); + tlMetaInfo.ucIsEapol, tlMetaInfo.ucUP, + tlMetaInfo.ucTxBdToken); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -8479,6 +8685,7 @@ WLANTL_STARxAuth v_U8_t ucTid; #ifdef FEATURE_WLAN_WAPI v_U16_t usEtherType = 0; + tSirMacMgmtHdr *hdr; #endif v_U16_t usPktLen; vos_pkt_t* vosDataBuff ; @@ -8598,15 +8805,16 @@ WLANTL_STARxAuth if( VOS_IS_STATUS_SUCCESS(vosStatus) ) { if ( WLANTL_LLC_WAI_TYPE == usEtherType ) - { - if ( !( WLANHAL_RX_IS_UNPROTECTED_WPI_FRAME(aucBDHeader)) ) + { + hdr = WDA_GET_RX_MAC_HEADER(aucBDHeader); + if ( hdr->fc.wep ) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "WLAN TL:WAI frame was received encrypted - dropping")); /* Drop packet */ /*Temporary fix added to fix wapi rekey issue*/ - //vos_pkt_return_packet(vosDataBuff); - //return vosStatus; //returning success + vos_pkt_return_packet(vosDataBuff); + return vosStatus; //returning success } } else @@ -8713,7 +8921,8 @@ WLANTL_STARxAuth WLANTL_MSDUReorder( pTLCb, &vosDataBuff, aucBDHeader, ucSTAId, ucTid ); } -if(0 == ucUnicastBroadcastType +if(WLANTL_IS_DATA_FRAME(WDA_GET_RX_TYPE_SUBTYPE(aucBDHeader)) && + (0 == ucUnicastBroadcastType) #ifdef FEATURE_ON_CHIP_REORDERING && (WLANHAL_IsOnChipReorderingEnabledForTID(pvosGCtx, ucSTAId, ucTid) != TRUE) #endif @@ -8790,30 +8999,36 @@ if(0 == ucUnicastBroadcastType /* It is not AMSDU frame so perform reaply check for each packet, as - each packet contains valid replay counter*/ - status = WLANTL_IsReplayPacket( ullcurrentReplayCounter, ullpreviousReplayCounter); - if(VOS_FALSE == status) - { - /* Not a replay paket, update previous replay counter in TL CB */ - pClientSTA->ullReplayCounter[ucTid] = ullcurrentReplayCounter; - } - else - { - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL: Non-AMSDU Drop the replay packet with PN : [0x%llX]",ullcurrentReplayCounter); - - pClientSTA->ulTotalReplayPacketsDetected++; - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL: Non-AMSDU total dropped replay packets on STA ID %X is [0x%X]", - ucSTAId, pClientSTA->ulTotalReplayPacketsDetected); - - /* Repaly packet, drop the packet */ - vos_pkt_return_packet(vosDataBuff); - return VOS_STATUS_SUCCESS; - } + each packet contains valid replay counter*/ + if (vosDataBuff != NULL) { + if (vos_is_pkt_chain(vosDataBuff)) { + WLANTL_ReorderReplayCheck(pClientSTA, &vosDataBuff, ucTid); + } else { + status = WLANTL_IsReplayPacket(ullcurrentReplayCounter, + ullpreviousReplayCounter); + if(VOS_FALSE == status) { + /* Not a replay paket, update previous replay counter in TL CB */ + pClientSTA->ullReplayCounter[ucTid] = ullcurrentReplayCounter; + } else { + VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: Non AMSDU Drop replay packet with PN: [0x%llX], prevPN: [0x%llx]", + ullcurrentReplayCounter, ullpreviousReplayCounter); + + pClientSTA->ulTotalReplayPacketsDetected++; + VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: Non AMSDU total dropped replay packets on STA ID %X is [0x%X]", + ucSTAId, pClientSTA->ulTotalReplayPacketsDetected); + + /* Repaly packet, drop the packet */ + vos_pkt_return_packet(vosDataBuff); + return VOS_STATUS_SUCCESS; + } + } + } } - } + } } + /*It is a broadast packet DPU has already done replay check for broadcast packets no need to do replay check of these packets*/ @@ -9003,7 +9218,7 @@ WLANTL_McProcessMsg // Free the PAL memory, we are done with it. TLLOG2(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, - "Flush complete received by TL: Freeing %p", FlushACRspPtr)); + "Flush complete received by TL: Freeing %pK", FlushACRspPtr)); vos_mem_free((v_VOID_t *)FlushACRspPtr); break; @@ -9251,7 +9466,11 @@ WLANTL_TxProcessMsg break; case WLANTL_TX_FW_DEBUG: - vos_fwDumpReq(274, 0, 0, 0, 0); + vos_fwDumpReq(274, 0, 0, 0, 0, 1); //Async event + break; + + case WLANTL_TX_KICKDXE: + WDA_TransportKickDxe(); break; default: @@ -9810,7 +10029,7 @@ if ((0 == w8023Header.usLenType) && (pClientSTA->wSTADesc.ucIsEseSta)) #ifdef FEATURE_WLAN_WAPI if (( WLANTL_STA_AUTHENTICATED == pClientSTA->tlState || - pClientSTA->ptkInstalled ) && gUcIsWai != 1) + pClientSTA->ptkInstalled ) && (tlMetaInfo->ucIsWai != 1)) #else if ( WLANTL_STA_AUTHENTICATED == pClientSTA->tlState || pClientSTA->ptkInstalled ) @@ -9837,6 +10056,8 @@ if ((0 == w8023Header.usLenType) && (pClientSTA->wSTADesc.ucIsEseSta)) else { pw80211Header->wFrmCtrl.subType = 0; + tlMetaInfo->ucUP = 0; + tlMetaInfo->ucTID = 0; // NO NO NO - there is not enough memory allocated to write the QOS ctrl // field, it will overwrite the first 2 bytes of the data packet(LLC header) @@ -9850,21 +10071,8 @@ if ((0 == w8023Header.usLenType) && (pClientSTA->wSTADesc.ucIsEseSta)) pw80211Header->wFrmCtrl.toDS = 0; pw80211Header->wFrmCtrl.fromDS = 0; - /* - * If the frame is a multicast frame, then, the Address1 - * should be the destination address filled in the packet. Which is - * the multicast address. Otherwise, set it to BSSID - */ - if (0 == tlMetaInfo->ucBcast && 1 == tlMetaInfo->ucMcast) - { - vos_copy_macaddr( (v_MACADDR_t*)&pw80211Header->vA1, + vos_copy_macaddr( (v_MACADDR_t*)&pw80211Header->vA1, (v_MACADDR_t*)&w8023Header.vDA); - } - else - { - vos_copy_macaddr( (v_MACADDR_t*)&pw80211Header->vA1, - &pClientSTA->wSTADesc.vSTAMACAddress); - } vos_mem_copy( pw80211Header->vA3, &pClientSTA->wSTADesc.vBSSIDforIBSS , VOS_MAC_ADDR_SIZE); @@ -9959,7 +10167,7 @@ static v_VOID_t WLANTL_DebugFrame numBytes = dataSize % WLANTL_DEBUG_FRAME_BYTE_PER_LINE; linePointer = (v_U8_t *)dataPointer; - TLLOGE(VOS_TRACE(VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_ERROR, "WLAN TL:Frame Debug Frame Size %d, Pointer 0x%p", dataSize, dataPointer)); + TLLOGE(VOS_TRACE(VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_ERROR, "WLAN TL:Frame Debug Frame Size %d, Pointer 0x%pK", dataSize, dataPointer)); for(idx = 0; idx < numLines; idx++) { memset(lineBuffer, 0, WLANTL_DEBUG_FRAME_BYTE_PER_LINE); @@ -10192,6 +10400,119 @@ WLANTL_Translate80211To8023Header return VOS_STATUS_SUCCESS; }/*WLANTL_Translate80211To8023Header*/ +VOS_STATUS +WLANTL_MonTranslate80211To8023Header +( + vos_pkt_t* vosDataBuff, + WLANTL_CbType* pTLCb +) +{ + v_U16_t usMPDUDOffset; + v_U8_t ucMPDUHOffset; + v_U8_t ucMPDUHLen; + v_U16_t usActualHLen = 0; + v_U16_t usDataStartOffset = 0; + v_PVOID_t aucBDHeader; + WLANTL_8023HeaderType w8023Header; + WLANTL_80211HeaderType w80211Header; + VOS_STATUS vosStatus; + v_U8_t aucLLCHeader[WLANTL_LLC_HEADER_LEN]; + + WDA_DS_PeekRxPacketInfo( vosDataBuff, (v_PVOID_t)&aucBDHeader, 0 ); + ucMPDUHOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(aucBDHeader); + usMPDUDOffset = (v_U16_t)WDA_GET_RX_MPDU_DATA_OFFSET(aucBDHeader); + ucMPDUHLen = (v_U8_t)WDA_GET_RX_MPDU_HEADER_LEN(aucBDHeader); + if (usMPDUDOffset > ucMPDUHOffset) + { + usActualHLen = usMPDUDOffset - ucMPDUHOffset; + } + + if ( sizeof(w80211Header) < ucMPDUHLen ) + { + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, + "Warning !: Check the header size for the Rx frame structure=%d received=%dn", + sizeof(w80211Header), ucMPDUHLen)); + ucMPDUHLen = sizeof(w80211Header); + } + + vosStatus = vos_pkt_pop_head( vosDataBuff, &w80211Header, ucMPDUHLen); + if ( VOS_STATUS_SUCCESS != vosStatus ) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: Failed to pop 80211 header from packet %d", + vosStatus)); + + return vosStatus; + } + switch ( w80211Header.wFrmCtrl.fromDS ) + { + case 0: + if ( w80211Header.wFrmCtrl.toDS ) + { + vos_mem_copy( w8023Header.vDA, w80211Header.vA3, VOS_MAC_ADDR_SIZE); + vos_mem_copy( w8023Header.vSA, w80211Header.vA2, VOS_MAC_ADDR_SIZE); + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, + "WLAN TL SoftAP: 802 3 DA %08x SA %08x", + w8023Header.vDA, w8023Header.vSA)); + } + else + { + vos_mem_copy( w8023Header.vDA, w80211Header.vA1, VOS_MAC_ADDR_SIZE); + vos_mem_copy( w8023Header.vSA, w80211Header.vA2, VOS_MAC_ADDR_SIZE); + } + break; + case 1: + if ( w80211Header.wFrmCtrl.toDS ) + { + vos_mem_copy( w8023Header.vDA, w80211Header.vA1, VOS_MAC_ADDR_SIZE); + vos_mem_copy( w8023Header.vSA, w80211Header.vA2, VOS_MAC_ADDR_SIZE); + } + else + { + vos_mem_copy( w8023Header.vDA, w80211Header.vA1, VOS_MAC_ADDR_SIZE); + vos_mem_copy( w8023Header.vSA, w80211Header.vA3, VOS_MAC_ADDR_SIZE); + } + break; + } + if( usActualHLen > ucMPDUHLen ) + { + usDataStartOffset = usActualHLen - ucMPDUHLen; + } + + if ( 0 < usDataStartOffset ) + { + vosStatus = vos_pkt_trim_head( vosDataBuff, usDataStartOffset ); + + if ( VOS_STATUS_SUCCESS != vosStatus ) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: Failed to trim header from packet %d", + vosStatus)); + return vosStatus; + } + } + // Extract the LLC header + vosStatus = vos_pkt_pop_head( vosDataBuff, aucLLCHeader, + WLANTL_LLC_HEADER_LEN); + + if ( VOS_STATUS_SUCCESS != vosStatus ) + { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_WARN, + "WLAN TL: Failed to pop LLC header from packet %d", + vosStatus)); + + return vosStatus; + } + + //Extract the length + vos_mem_copy(&w8023Header.usLenType, + &aucLLCHeader[WLANTL_LLC_HEADER_LEN - sizeof(w8023Header.usLenType)], + sizeof(w8023Header.usLenType) ); + + vos_pkt_push_head(vosDataBuff, &w8023Header, sizeof(w8023Header)); + return VOS_STATUS_SUCCESS; +} + /*========================================================================== FUNCTION WLANTL_FindFrameTypeBcMcUc @@ -10397,7 +10718,7 @@ WLANTL_FastHwFwdDataFrame if ( NULL == pucBuffPtr ) { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLAN TL:No enough space in VOSS packet %p for DxE/BD/WLAN header", vosDataBuff)); + "WLAN TL:No enough space in VOSS packet %pK for DxE/BD/WLAN header", vosDataBuff)); *pvosStatus = VOS_STATUS_E_INVAL; return; } @@ -10625,7 +10946,7 @@ WLAN_TLAPGetNextTxIds v_U8_t ucACFilter = 1; v_U8_t ucNextSTA ; v_BOOL_t isServed = TRUE; //current round has find a packet or not - v_U8_t ucACLoopNum = WLANTL_AC_VO + 1; //number of loop to go + v_U8_t ucACLoopNum = WLANTL_AC_HIGH_PRIO + 1; //number of loop to go v_U8_t uFlowMask; // TX FlowMask from WDA uint8 ucACMask; uint8 i = 0; @@ -10649,6 +10970,22 @@ WLAN_TLAPGetNextTxIds return VOS_STATUS_E_FAULT; } + /* The flow mask does not differentiate between different ACs/Qs + * since we use a single dxe channel for all ACs/Qs, hence it is + * enough to check that there are dxe resources on data channel + */ + uFlowMask &= WLANTL_DATA_FLOW_MASK; + + if (0 == uFlowMask) + { + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: No resources to send packets")); + + // Setting STA Id to invalid if mask is 0 + *pucSTAId = WLAN_MAX_STA_COUNT; + return VOS_STATUS_E_FAULT; + } + ucNextSTA = pTLCb->ucCurrentSTA; ++ucNextSTA; @@ -10665,7 +11002,7 @@ WLAN_TLAPGetNextTxIds if ( WLANTL_AC_BK == (WLANTL_ACEnumType)pTLCb->uCurServedAC ) { //end of current VO, VI, BE, BK loop. Reset priority. - pTLCb->uCurServedAC = WLANTL_AC_VO; + pTLCb->uCurServedAC = WLANTL_AC_HIGH_PRIO; } else { @@ -10692,7 +11029,7 @@ WLAN_TLAPGetNextTxIds ucACFilter = 1 << pTLCb->uCurServedAC; // pTLCb->ucCurLeftWeight keeps previous results. - for (; (pTLCb->ucCurLeftWeight > 0) && (uFlowMask & ucACFilter); pTLCb->ucCurLeftWeight-- ) + for (; (pTLCb->ucCurLeftWeight > 0) ; pTLCb->ucCurLeftWeight-- ) { for ( ; ucNextSTA < WLAN_MAX_STA_COUNT; ucNextSTA ++ ) @@ -10758,7 +11095,7 @@ WLAN_TLAPGetNextTxIds if (WLANTL_AC_BK == pTLCb->uCurServedAC) { - pTLCb->uCurServedAC = WLANTL_AC_VO; + pTLCb->uCurServedAC = WLANTL_AC_HIGH_PRIO; } else { @@ -10848,9 +11185,11 @@ WLAN_TLGetNextTxIds #ifdef FEATURE_WLAN_TDLS if ((eSYSTEM_AP_ROLE == systemRole) || + (eSYSTEM_STA_IN_IBSS_ROLE == systemRole) || (vos_concurrent_open_sessions_running()) || pTLCb->ucTdlsPeerCount) #else if ((eSYSTEM_AP_ROLE == systemRole) || + (eSYSTEM_STA_IN_IBSS_ROLE == systemRole) || (vos_concurrent_open_sessions_running())) #endif { @@ -10865,6 +11204,22 @@ WLAN_TLGetNextTxIds return VOS_STATUS_E_FAULT; } + /* The flow mask does not differentiate between different ACs/Qs + * since we use a single dxe channel for all ACs/Qs, hence it is + * enough to check that there are dxe resources on data channel + */ + uFlowMask &= WLANTL_DATA_FLOW_MASK; + + if (0 == uFlowMask) + { + TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "WLAN TL: No resources to send packets")); + + // Setting STA id to invalid if mask is 0 + *pucSTAId = WLAN_MAX_STA_COUNT; + return VOS_STATUS_E_FAULT; + } + /*STA id - no priority yet implemented */ /*----------------------------------------------------------------------- Choose the next STA for tx - for now go in a round robin fashion @@ -10954,7 +11309,7 @@ WLAN_TLGetNextTxIds " AC Mask: %d Next: %d Res : %d", ucACMask, ( 1 << ucNextAC ), ( ucACMask & ( 1 << ucNextAC )))); - if ( 0 != ( ucACMask & ( 1 << ucNextAC ) & uFlowMask )) + if ( 0 != ( ucACMask & ( 1 << ucNextAC ))) { pTLCb->atlSTAClients[*pucSTAId]->ucCurrentAC = (WLANTL_ACEnumType)ucNextAC; @@ -10968,11 +11323,13 @@ WLAN_TLGetNextTxIds break; } - ucNextAC = ( ucNextAC - 1 ) & WLANTL_MASK_AC; + if (ucNextAC == WLANTL_AC_BK) + ucNextAC = WLANTL_AC_HIGH_PRIO; + else + ucNextAC--; TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, "Next AC %d", ucNextAC)); - } TLLOG2(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, @@ -11401,7 +11758,7 @@ WLANTL_CleanSTA /*------------------------------------------------------------------------- QOS information for the STA -------------------------------------------------------------------------*/ - ptlSTAClient->ucCurrentAC = WLANTL_AC_VO; + ptlSTAClient->ucCurrentAC = WLANTL_AC_HIGH_PRIO; ptlSTAClient->ucCurrentWeight = 0; ptlSTAClient->ucServicedAC = WLANTL_AC_BK; @@ -11505,7 +11862,7 @@ WLANTL_EnableUAPSDForAC { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "WLAN TL:Invalid input params on WLANTL_EnableUAPSDForAC" - " TL: %p STA: %d AC: %d", + " TL: %pK STA: %d AC: %d", pTLCb, ucSTAId, ucAC)); return VOS_STATUS_E_FAULT; } @@ -11603,7 +11960,7 @@ WLANTL_DisableUAPSDForAC { TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "WLAN TL:Invalid input params on WLANTL_DisableUAPSDForAC" - " TL: %p STA: %d AC: %d", pTLCb, ucSTAId, ucAC )); + " TL: %pK STA: %d AC: %d", pTLCb, ucSTAId, ucAC )); return VOS_STATUS_E_FAULT; } @@ -12422,6 +12779,7 @@ WLANTL_SetACWeights pTLCb->tlConfigInfo.ucAcWeights[ucIndex] = pACWeights[ucIndex]; } + pTLCb->tlConfigInfo.ucAcWeights[WLANTL_AC_HIGH_PRIO] = pACWeights[WLANTL_AC_VO]; return VOS_STATUS_SUCCESS; } @@ -12637,83 +12995,6 @@ VOS_STATUS WLANTL_GetSoftAPStatistics(v_PVOID_t pAdapter, WLANTL_TRANSFER_STA_TY return vosStatus; } -#ifdef FEATURE_WLAN_TDLS_INTERNAL -/*========================================================================== - FUNCTION WLANTL_GetEtherType_2 - - DESCRIPTION Extract Ether type information from the BD - - DEPENDENCIES NONE - - PARAMETERS in aucBDHeader - BD header - in vosDataBuff - data buffer - in ucMPDUHLen - MPDU header length - out pUsEtherType - pointer to Ethertype - - RETURN VALUE VOS_STATUS_SUCCESS : if the EtherType is successfully extracted - VOS_STATUS_FAILURE : if the EtherType extraction failed and - the packet was dropped - - SIDE EFFECTS NONE - -============================================================================*/ -static VOS_STATUS WLANTL_GetEtherType_2 -( - v_U8_t * aucBDHeader, - vos_pkt_t * vosDataBuff, - v_U8_t ucMPDUHLen, - v_U16_t * pUsEtherType -) -{ - v_U8_t ucOffset; - v_U16_t usEtherType = *pUsEtherType; - v_SIZE_t usLLCSize = sizeof(usEtherType); - VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - //v_U8_t ucLLCHeader; - v_U8_t ucMPDUHOffset ; - /*------------------------------------------------------------------------ - Check if LLC is present - if not, TL is unable to determine type - ------------------------------------------------------------------------*/ - //ucMPDUHOffset = (v_U8_t)WLANHAL_RX_BD_GET_MPDU_H_OFFSET(aucBDHeader) ; - //ucLLCHeader = (v_U8_t)WLANHAL_RX_BD_GET_LLC(aucBDHeader); - ucMPDUHOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(aucBDHeader); - - if ( VOS_TRUE == WDA_IS_RX_LLC_PRESENT(aucBDHeader) ) - { - ucOffset = ucMPDUHOffset + WLANTL_802_3_HEADER_LEN - sizeof(usEtherType); - } - else - { - ucOffset = WLANHAL_RX_BD_HEADER_SIZE + ucMPDUHLen - + WLANTL_LLC_PROTO_TYPE_OFFSET; - } - - /*------------------------------------------------------------------------ - Extract LLC type - ------------------------------------------------------------------------*/ - vosStatus = vos_pkt_extract_data( vosDataBuff, ucOffset, - (v_PVOID_t)&usEtherType, &usLLCSize); - - /* TODO: Do it in better way */ - if(vos_be16_to_cpu(usEtherType) == 0x890d) - { - VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - ("TDLS frame llc %x"), vos_be16_to_cpu(usEtherType)) ; - } - - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN TL:Ether type retrieved before endianess conv: %d", - usEtherType); - - usEtherType = vos_be16_to_cpu(usEtherType); - *pUsEtherType = usEtherType; - - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_HIGH, - "WLAN TL:Ether type retrieved: %d", usEtherType); - - return vosStatus; -} -#endif /* FEATURE_WLAN_TDLS */ /*=============================================================================== FUNCTION WLANTL_IsReplayPacket @@ -13020,3 +13301,33 @@ WLANTL_GetSTALinkCapacity return VOS_STATUS_SUCCESS; }/* WLANTL_GetSTALinkCapacity */ + +void WLANTL_SetKeySeqCounter(void *pvosGCtx, u64 counter, uint8_t staid) +{ + WLANTL_CbType* pTLCb = NULL; + uint8_t i; + + pTLCb = VOS_GET_TL_CB(pvosGCtx); + if (NULL == pTLCb) { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid TL pointer from pvosGCtx", __func__)); + return; + } + + if (WLANTL_STA_ID_INVALID(staid)) { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid Sta id passed", __func__)); + return; + } + + if (NULL == pTLCb->atlSTAClients[staid]) { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "%s: Station context is NULL", __func__)); + return; + } + + for(i = 0; i < WLANTL_MAX_TID; i++) + pTLCb->atlSTAClients[staid]->ullReplayCounter[i] = counter; + +} + diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_ba.c b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_ba.c index a991a2bff385..44549570cda4 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_ba.c +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_ba.c @@ -220,66 +220,6 @@ v_VOID_t WLANTL_ReorderingAgingTimerExpierCB fwIdx = ReorderInfo->ucCIndex - 1; } - /* Do replay check before giving packets to upper layer - replay check code : check whether replay check is needed or not */ - if(VOS_TRUE == pClientSTA->ucIsReplayCheckValid) - { - v_U64_t ullpreviousReplayCounter = 0; - v_U64_t ullcurrentReplayCounter = 0; - v_U8_t ucloopCounter = 0; - v_BOOL_t status = 0; - - /*Do replay check for all packets which are in Reorder buffer */ - for(ucloopCounter = 0; ucloopCounter < WLANTL_MAX_WINSIZE; ucloopCounter++) - { - /*Get previous reply counter*/ - ullpreviousReplayCounter = pClientSTA->ullReplayCounter[ucTID]; - - /*Get current replay counter of packet in reorder buffer*/ - ullcurrentReplayCounter = ReorderInfo->reorderBuffer->ullReplayCounter[ucloopCounter]; - - /*Check for holes, if a hole is found in Reorder buffer then - no need to do replay check on it, skip the current - hole and do replay check on other packets*/ - if(NULL != (ReorderInfo->reorderBuffer->arrayBuffer[ucloopCounter])) - { - status = WLANTL_IsReplayPacket(ullcurrentReplayCounter, ullpreviousReplayCounter); - if(VOS_TRUE == status) - { - /*Increment the debug counter*/ - pClientSTA->ulTotalReplayPacketsDetected++; - - /*A replay packet found*/ - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLANTL_ReorderingAgingTimerExpierCB: total dropped replay packets on STA ID %X is [0x%X]", - ucSTAID, pClientSTA->ulTotalReplayPacketsDetected); - - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLANTL_ReorderingAgingTimerExpierCB: replay packet found with PN : [0x%llX]", - ullcurrentReplayCounter); - - VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "WLANTL_ReorderingAgingTimerExpierCB: Drop the replay packet with PN : [0x%llX]", - ullcurrentReplayCounter); - - ReorderInfo->reorderBuffer->arrayBuffer[ucloopCounter] = NULL; - ReorderInfo->reorderBuffer->ullReplayCounter[ucloopCounter] = 0; - } - else - { - /*Not a replay packet update previous replay counter*/ - pClientSTA->ullReplayCounter[ucTID] = ullcurrentReplayCounter; - } - } - else - { - /* A hole detected in Reorder buffer*/ - //BAMSGERROR("WLANTL_ReorderingAgingTimerExpierCB,hole detected\n",0,0,0); - - } - } - } - cIndex = ReorderInfo->ucCIndex; status = WLANTL_ChainFrontPkts(fwIdx, opCode, &vosDataBuff, ReorderInfo, NULL); @@ -314,6 +254,12 @@ v_VOID_t WLANTL_ReorderingAgingTimerExpierCB return; } + /* Do replay check before giving packets to upper layer + replay check code : check whether replay check is needed or not */ + if(VOS_TRUE == pClientSTA->ucIsReplayCheckValid) { + WLANTL_ReorderReplayCheck(pClientSTA, &vosDataBuff, ucTID); + } + pCurrent = vosDataBuff; while (pCurrent != NULL) @@ -525,7 +471,7 @@ WLANTL_BaSessionAdd pClientSTA->atlBAReorderInfo[ucTid].reorderBuffer = &(pTLCb->reorderBufferPool[idx]); pTLCb->reorderBufferPool[idx].isAvailable = VOS_FALSE; - TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"%dth buffer available, buffer PTR 0x%p", + TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"%dth buffer available, buffer PTR 0x%pK", idx, pClientSTA->atlBAReorderInfo[ucTid].reorderBuffer )); @@ -755,6 +701,12 @@ WLANTL_BaSessionDel "WLAN TL: Chaining was successful sending all pkts to HDD : %x", vosDataBuff )); + /* Do replay check before giving packets to upper layer + replay check code : check whether replay check is needed or not */ + if(VOS_TRUE == pClientSTA->ucIsReplayCheckValid) { + WLANTL_ReorderReplayCheck(pClientSTA, &vosDataBuff, ucTid); + } + if ( WLAN_STA_SOFTAP == pClientSTA->wSTADesc.wSTAType ) { WLANTL_FwdPktToHDD( pvosGCtx, vosDataBuff, ucSTAId); @@ -1096,7 +1048,7 @@ VOS_STATUS WLANTL_MSDUReorder v_U16_t reorderTime; if((NULL == pTLCb) || (*vosDataBuff == NULL)) { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR,"Invalid ARG pTLCb 0x%p, vosDataBuff 0x%p", + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR,"Invalid ARG pTLCb 0x%pK, vosDataBuff 0x%pK", pTLCb, *vosDataBuff)); return VOS_STATUS_E_INVAL; } @@ -1129,16 +1081,12 @@ VOS_STATUS WLANTL_MSDUReorder ucFwdIdx = (v_U8_t)WDA_GET_RX_REORDER_FWD_IDX(pvBDHeader); CSN = (v_U16_t)WDA_GET_RX_REORDER_CUR_PKT_SEQ_NO(pvBDHeader); - - -#ifdef WLANTL_HAL_VOLANS /* Replay check code : check whether replay check is needed or not */ if(VOS_TRUE == pClientSTA->ucIsReplayCheckValid) { /* Getting 48-bit replay counter from the RX BD */ - ullreplayCounter = WDA_DS_GetReplayCounter(aucBDHeader); + ullreplayCounter = WDA_DS_GetReplayCounter(pvBDHeader); } -#endif #ifdef WLANTL_REORDER_DEBUG_MSG_ENABLE TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR,"opCode %d SI %d, FI %d, CI %d seqNo %d", ucOpCode, ucSlotIdx, ucFwdIdx, currentReorderInfo->ucCIndex, CSN)); @@ -1710,7 +1658,7 @@ VOS_STATUS WLANTL_QueueCurrent { VOS_STATUS status = VOS_STATUS_SUCCESS; - TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"vos Packet has to be Qed 0x%p", + TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"vos Packet has to be Qed 0x%pK", *vosDataBuff)); if(NULL != pwBaReorder->reorderBuffer->arrayBuffer[ucSlotIndex]) { @@ -1791,7 +1739,7 @@ VOS_STATUS WLANTL_ChainFrontPkts fwdIndex = pwBaReorder->ucCIndex + pwBaReorder->winSize; } - TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"Current Index %d, FWD Index %d, reorderBuffer 0x%p", + TLLOG4(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,"Current Index %d, FWD Index %d, reorderBuffer 0x%pK", pwBaReorder->ucCIndex % pwBaReorder->winSize, fwdIndex % pwBaReorder->winSize, pwBaReorder->reorderBuffer)); @@ -1903,3 +1851,44 @@ void WLANTL_FillReplayCounter return; }/*WLANTL_FillReplayCounter*/ +void WLANTL_ReorderReplayCheck(WLANTL_STAClientType *pClientSTA, + vos_pkt_t **vosDataBuff, v_U8_t ucTid) +{ + vos_pkt_t *pVosCurPkt; + vos_pkt_t *pNextVosPkt; + vos_pkt_t *pVosHeadPkt = NULL; + vos_pkt_t *pfreeVosPkt = NULL; + v_U64_t prevReplayCounter = 0; + v_BOOL_t status; + + pVosCurPkt = *vosDataBuff; + + do { + vos_pkt_walk_packet_chain(pVosCurPkt, &pNextVosPkt, VOS_FALSE); + prevReplayCounter = pClientSTA->ullReplayCounter[ucTid]; + status = WLANTL_IsReplayPacket(pVosCurPkt->pn_num, + prevReplayCounter); + if(VOS_FALSE == status) { + pClientSTA->ullReplayCounter[ucTid] = pVosCurPkt->pn_num; + pVosHeadPkt = pVosCurPkt; + } else { + VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + "%s: Non-AMSDU Drop the replay packet PN: [0x%llX]", + __func__, pVosCurPkt->pn_num); + pClientSTA->ulTotalReplayPacketsDetected++; + + pfreeVosPkt = pVosCurPkt; + pfreeVosPkt->pNext = NULL; + vos_pkt_return_packet(pfreeVosPkt); + + if (pVosHeadPkt != NULL) { + pVosHeadPkt->pNext = pNextVosPkt; + } + else { + *vosDataBuff = pNextVosPkt; + } + } + + pVosCurPkt = pNextVosPkt; + } while (pVosCurPkt); +} diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.c b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.c index 03f213b4e5b1..338ab34169d3 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.c +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -360,14 +357,14 @@ void WLANTL_HSDebugDisplay { if(VOS_MODULE_ID_HDD == hoSupport->registeredInd[idx].whoIsClient[sIdx]) { - TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Client HDD pCB %p, triggerEvt %d, RSSI %d", + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Client HDD pCB %pK, triggerEvt %d, RSSI %d", hoSupport->registeredInd[idx].crossCBFunction[sIdx], hoSupport->registeredInd[idx].triggerEvent[sIdx], hoSupport->registeredInd[idx].rssiValue)); } else { - TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Client SME pCB %p, triggerEvt %d, RSSI %d", + TLLOG1(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Client SME pCB %pK, triggerEvt %d, RSSI %d", hoSupport->registeredInd[idx].crossCBFunction[sIdx], hoSupport->registeredInd[idx].triggerEvent[sIdx], hoSupport->registeredInd[idx].rssiValue)); @@ -380,12 +377,12 @@ void WLANTL_HSDebugDisplay { if(VOS_TRUE == tlCtxt->isBMPS) { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR," ----> CRegion %d, hRSSI:NA, BMPS, Alpha %d", + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO," ----> CRegion %d, hRSSI:NA, BMPS, Alpha %d", currentHO->regionNumber, currentHO->alpha)); } else { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR," ----> CRegion %d, hRSSI %d, Alpha %d", + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO," ----> CRegion %d, hRSSI %d, Alpha %d", currentHO->regionNumber, currentHO->historyRSSI, currentHO->alpha)); @@ -851,7 +848,7 @@ VOS_STATUS WLANTL_HSGetRSSI currentHO = &tlCtxt->hoSupport.currentHOState; currentRSSI0 = WLANTL_GETRSSI0(pBDHeader); - currentRSSI1 = WLANTL_GETRSSI0(pBDHeader); + currentRSSI1 = WLANTL_GETRSSI1(pBDHeader); currentRSSI = (currentRSSI0 > currentRSSI1) ? currentRSSI0 : currentRSSI1; if (0 == currentRSSI) @@ -1511,12 +1508,12 @@ VOS_STATUS WLANTL_HSRegRSSIIndicationCB { for(sIdx = 0; sIdx < WLANTL_HS_NUM_CLIENT; sIdx++) { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Reg CB P %p, registered CB P %p", + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Reg CB P %pK, registered CB P %pK", crossCBFunction, hoSupport->registeredInd[idx].crossCBFunction[sIdx])); if(crossCBFunction == hoSupport->registeredInd[idx].crossCBFunction[sIdx]) { - TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Same RSSI %d, Same CB %p already registered", + TLLOGE(VOS_TRACE(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO,"Same RSSI %d, Same CB %pK already registered", rssiValue, crossCBFunction)); WLANTL_HSDebugDisplay(pAdapter); THSRELEASELOCK("WLANTL_HSRegRSSIIndicationCB", &tlCtxt->hoSupport.hosLock); diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.h b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.h index fcffea7535e4..b2b0c693e68e 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.h +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_hosupport.h @@ -36,8 +36,6 @@ DESCRIPTION - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_trace.c b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_trace.c index 824167051561..39b4a5f469ad 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_trace.c +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -52,6 +52,10 @@ static v_U8_t* tlTraceGetEventString(v_U32_t code) CASE_RETURN_STRING(TRACE_CODE_TL_QUEUE_CURRENT); CASE_RETURN_STRING(TRACE_CODE_TL_REORDER_TIMER_EXP_CB); CASE_RETURN_STRING(TRACE_CODE_TL_BA_SESSION_DEL); + CASE_RETURN_STRING(TRACE_CODE_TL_ASSOC_FAILED); + CASE_RETURN_STRING(TRACE_CODE_TL_FORWARD_CACHED_FRAMES); + CASE_RETURN_STRING(TRACE_CODE_TL_FLUSH_CACHED_FRAMES); + CASE_RETURN_STRING(TRACE_CODE_TL_CACHE_FRAME); default: return ("UNKNOWN"); break; @@ -60,10 +64,12 @@ static v_U8_t* tlTraceGetEventString(v_U32_t code) void tlTraceDump(void *pMac, tpvosTraceRecord pRecord, v_U16_t recIndex) { - TLLOGE( VOS_TRACE (VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, - "%04d %012u S%-3d %-14s %-30s(0x%x)", - recIndex, pRecord->time, pRecord->session, " TL Event: ", - tlTraceGetEventString (pRecord->code), pRecord->data)); + TLLOGE( VOS_TRACE (VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO, + "%04d %012u S%-3d %-14s %-30s(0x%x)", + recIndex, pRecord->time, pRecord->session, + " TL Event: ", + tlTraceGetEventString (pRecord->code), + pRecord->data)); } void tlTraceInit() diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tli.h b/drivers/staging/prima/CORE/TL/src/wlan_qct_tli.h index f6349a5cb267..c59067c347d0 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tli.h +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -122,6 +122,7 @@ when who what, where, why /*WAPI protocol type */ #define WLANTL_LLC_WAI_TYPE 0x88b4 +#define WLANTL_ETHERTYPE_ARP 0x0806 #ifdef FEATURE_WLAN_TDLS #define WLANTL_LLC_TDLS_TYPE 0x890d @@ -168,6 +169,8 @@ when who what, where, why #define WLANTL_CTRL_FRAME_TYPE 0x10 #define WLANTL_DATA_FRAME_TYPE 0x20 +#define WLANTL_MGMT_PROBE_REQ_FRAME_TYPE 0x04 + /*Value of the data type field in the 802.11 frame */ #define WLANTL_80211_DATA_TYPE 0x02 #define WLANTL_80211_DATA_QOS_SUBTYPE 0x08 @@ -279,6 +282,8 @@ typedef enum WLANTL_TX_FW_DEBUG = 8, + WLANTL_TX_KICKDXE = 9, + WLANTL_TX_MAX }WLANTL_TxSignalsType; @@ -576,7 +581,7 @@ typedef struct v_U8_t ucMPDUHeaderLen; /* Enabled ACs currently serviced by TL (automatic setup in TL)*/ - v_U8_t aucACMask[WLANTL_MAX_AC]; + v_U8_t aucACMask[WLANTL_NUM_TX_QUEUES]; /* Current AC to be retrieved */ WLANTL_ACEnumType ucCurrentAC; @@ -693,6 +698,9 @@ typedef struct WLANTL_InterfaceStatsType interfaceStats; #endif + /* BD Rate for transmitting ARP packets */ + v_U8_t arpRate; + v_BOOL_t arpOnWQ5; }WLANTL_STAClientType; /*--------------------------------------------------------------------------- @@ -865,6 +873,8 @@ typedef struct /* Current served station ID in round-robin method to traverse all stations.*/ WLANTL_ACEnumType uCurServedAC; + WLANTL_SpoofMacAddr spoofMacAddr; + /* How many weights have not been served in current AC. */ v_U8_t ucCurLeftWeight; @@ -886,6 +896,9 @@ typedef struct v_BOOL_t isBMPS; /* Whether WDA_DS_TX_START_XMIT msg is pending or not */ v_BOOL_t isTxTranmitMsgPending; + WLANTL_MonRxCBType pfnMonRx; + v_BOOL_t isConversionReq; + }WLANTL_CbType; /*========================================================================== @@ -1382,9 +1395,15 @@ WLANTL_Translate80211To8023Header v_U8_t ucHeaderLen, WLANTL_CbType* pTLCb, v_U8_t ucSTAId, - v_BOOL_t bForwardIAPPwithLLC + v_BOOL_t bForwardIAPPwithLLC ); +VOS_STATUS +WLANTL_MonTranslate80211To8023Header +( + vos_pkt_t* vosDataBuff, + WLANTL_CbType* pTLCb +); /*========================================================================== FUNCTION WLANTL_FindFrameTypeBcMcUc diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tli_ba.h b/drivers/staging/prima/CORE/TL/src/wlan_qct_tli_ba.h index 0677b89a0f7c..e1d68e627d67 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tli_ba.h +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tli_ba.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013,2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -39,8 +39,6 @@ DESCRIPTION layer module for BA session support, AMSDU de-aggregation and MSDU reordering. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -396,4 +394,14 @@ void WLANTL_FillReplayCounter v_U8_t ucSlotIndex ); +/** + * WLANTL_ReorderReplayCheck - Do reorder PN replay check + * @pClientSTA: pointer to sta context + * @vosDataBuff: pointer to address of data buffer + * @ucTid: Tid value + * + * Return: None + */ +void WLANTL_ReorderReplayCheck(WLANTL_STAClientType *pClientSTA, + vos_pkt_t **vosDataBuff, v_U8_t ucTid); #endif /* #ifndef WLAN_QCT_TLI_H */ diff --git a/drivers/staging/prima/CORE/VOSS/inc/event_defs.h b/drivers/staging/prima/CORE/VOSS/inc/event_defs.h index ec792b342112..4d2ba20b93e5 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/event_defs.h +++ b/drivers/staging/prima/CORE/VOSS/inc/event_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1901,6 +1901,8 @@ typedef enum EVENT_FDPCH_CONFIG_ACTION = 0x766, EVENT_SNS_DRV_MOTION_DETECT_SIG = 0x767, EVENT_SNS_DRV_OPMODE_CHANGE = 0x768, + EVENT_WLAN_EAPOL = 0xA8D,/* 18 bytes payload */ + EVENT_WLAN_WAKE_LOCK = 0xAA2, /* 96 bytes payload */ EVENT_NEXT_UNUSED_EVENT, EVENT_RSVD_START = 0x0800, diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_event.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_event.h index 682a02e5c334..5d8bb09ad423 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_event.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_event.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ \brief Android specific definitions for vOSS DIAG events - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -90,6 +87,17 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ +#ifdef FEATURE_WLAN_DIAG_SUPPORT +void vos_log_wlock_diag(uint32_t reason, const char *wake_lock_name, + uint32_t timeout, uint32_t status); +#else +static inline void vos_log_wlock_diag(uint32_t reason, + const char *wake_lock_name, + uint32_t timeout, uint32_t status) +{ + +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ #ifdef __cplusplus } diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_log.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_log.h index 00e0ecb2438c..9851497a373a 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_log.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_diag_core_log.h @@ -34,9 +34,6 @@ \brief android-specific definitions for vOSS DIAG logs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_event.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_event.h index bf0c5df6e5da..a3f7ac95f4f5 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_event.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_event.h @@ -34,9 +34,6 @@ \brief Linux-specific definitions for vOSS Events - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_list.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_list.h index 3fd2bde20d7e..53b1d4bb15cd 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_list.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_list.h @@ -34,9 +34,6 @@ \brief Linux-specific definitions for vOSS lists - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_lock.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_lock.h index ddda19503ee9..0a6610318152 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_lock.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ \brief Linux-specific definitions for vOSS Locks - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -49,6 +46,10 @@ #include #include #include +#if defined(WLAN_OPEN_SOURCE) +#include +#endif + /*-------------------------------------------------------------------------- Preprocessor definitions and constants @@ -71,6 +72,13 @@ typedef struct vos_lock_s typedef spinlock_t vos_spin_lock_t; +#if defined(WLAN_OPEN_SOURCE) +typedef struct wake_lock vos_wake_lock_t; +#else +typedef int vos_wake_lock_t; +#endif + + /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_packet.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_packet.h index e114102d6984..173d792b77fa 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_packet.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_packet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013,2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Network Protocol packet/buffer internal include file - Copyright 2009 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -130,6 +127,8 @@ struct vos_pkt_t // user data pointers v_VOID_t *pvUserData[ VOS_PKT_USER_DATA_ID_MAX ]; + v_U64_t pn_num; + // magic number for verifying this is really a struct vos_pkt_t v_U32_t magic; }; diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_timer.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_timer.h index 775c0ea97924..e789af45d495 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_timer.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_timer.h @@ -34,9 +34,6 @@ \brief Linux-specific definitions for vOSS packets - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_trace.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_trace.h index 2f21b4626215..ccc4c770ce23 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_trace.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_trace.h @@ -38,9 +38,6 @@ \brief Linux-specific definitions for VOSS trace - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/i_vos_types.h b/drivers/staging/prima/CORE/VOSS/inc/i_vos_types.h index f8cfdbeef2df..72c7421a6527 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/i_vos_types.h +++ b/drivers/staging/prima/CORE/VOSS/inc/i_vos_types.h @@ -35,6 +35,7 @@ #include #include #include +#include #include /**========================================================================= @@ -45,9 +46,6 @@ Linux specific basic type definitions - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_api.h b/drivers/staging/prima/CORE/VOSS/inc/vos_api.h index 3744a8b22a98..e238a5553c26 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_api.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Header file that inludes all the vOSS API definitions. - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ /*=========================================================================== @@ -78,6 +75,83 @@ #include #include + +/** + * enum log_event_type - Type of event initiating bug report + * @WLAN_LOG_TYPE_NON_FATAL: Non fatal event + * @WLAN_LOG_TYPE_FATAL: Fatal event + * + * Enum indicating the type of event that is initiating the bug report + */ +enum log_event_type { + WLAN_LOG_TYPE_NON_FATAL, + WLAN_LOG_TYPE_FATAL, +}; + +/* 15 Min */ +#define WLAN_POWER_COLLAPSE_FAIL_THRESHOLD (1000 * 60 * 15) + +/** + * enum log_event_indicator - Module triggering bug report + * @WLAN_LOG_INDICATOR_UNUSED: Unused + * @WLAN_LOG_INDICATOR_FRAMEWORK: Framework triggers bug report + * @WLAN_LOG_INDICATOR_HOST_DRIVER: Host driver triggers bug report + * @WLAN_LOG_INDICATOR_FIRMWARE: FW initiates bug report + * + * Enum indicating the module that triggered the bug report + */ +enum log_event_indicator { + WLAN_LOG_INDICATOR_UNUSED, + WLAN_LOG_INDICATOR_FRAMEWORK, + WLAN_LOG_INDICATOR_HOST_DRIVER, + WLAN_LOG_INDICATOR_FIRMWARE, + WLAN_LOG_INDICATOR_IOCTL +}; + +/** + * enum log_event_host_reason_code - Reason code for bug report + * @WLAN_LOG_REASON_CODE_UNUSED: Unused + * @WLAN_LOG_REASON_COMMAND_UNSUCCESSFUL: Command response status from FW + * is error + * @WLAN_LOG_REASON_ROAM_FAIL: Driver initiated roam has failed + * @WLAN_LOG_REASON_THREAD_STUCK: Monitor Health of host threads and report + * fatal event if some thread is stuck + * @WLAN_LOG_REASON_DATA_STALL: Unable to send/receive data due to low resource + * scenario for a prolonged period + * @WLAN_LOG_REASON_SME_COMMAND_STUCK: SME command is stuck in SME active queue + * @WLAN_LOG_REASON_ZERO_SCAN_RESULTS: Full scan resulted in zero scan results + * @WLAN_LOG_REASON_QUEUE_FULL: Defer queue becomes full for a prolonged period + * @WLAN_LOG_REASON_POWER_COLLAPSE_FAIL: Unable to allow apps power collapse + * for a prolonged period + * @WLAN_LOG_REASON_SSR_FAIL: Unable to gracefully complete SSR + * @WLAN_LOG_REASON_DISCONNECT_FAIL: Disconnect from Supplicant is not + * successful + * @WLAN_LOG_REASON_CLEAN_UP_FAIL: Clean up of TDLS or Pre-Auth Sessions + * not successful + * @WLAN_LOG_REASON_MALLOC_FAIL: Memory allocation Fails + * @WLAN_LOG_REASON_VOS_MSG_UNDER_RUN: VOS Core runs out of message wrapper + * @WLAN_LOG_REASON_MSG_POST_FAIL: Unable to post msg + * + * This enum contains the different reason codes for bug report + */ +enum log_event_host_reason_code { + WLAN_LOG_REASON_CODE_UNUSED, + WLAN_LOG_REASON_COMMAND_UNSUCCESSFUL, + WLAN_LOG_REASON_ROAM_FAIL, + WLAN_LOG_REASON_THREAD_STUCK, + WLAN_LOG_REASON_DATA_STALL, + WLAN_LOG_REASON_SME_COMMAND_STUCK, + WLAN_LOG_REASON_ZERO_SCAN_RESULTS, + WLAN_LOG_REASON_QUEUE_FULL, + WLAN_LOG_REASON_POWER_COLLAPSE_FAIL, + WLAN_LOG_REASON_SSR_FAIL, + WLAN_LOG_REASON_DISCONNECT_FAIL, + WLAN_LOG_REASON_CLEAN_UP_FAIL, + WLAN_LOG_REASON_MALLOC_FAIL, + WLAN_LOG_REASON_VOS_MSG_UNDER_RUN, + WLAN_LOG_REASON_MSG_POST_FAIL, +}; + /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ @@ -114,7 +188,9 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext ); VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, void *devHandle ); +VOS_STATUS vos_mon_start( v_CONTEXT_t vosContext ); +VOS_STATUS vos_mon_stop( v_CONTEXT_t vosContext ); VOS_STATUS vos_start( v_CONTEXT_t vosContext ); @@ -178,6 +254,16 @@ void vos_set_load_unload_in_progress(VOS_MODULE_ID moduleId, v_U8_t value); v_U8_t vos_is_reinit_in_progress(VOS_MODULE_ID moduleId, v_VOID_t *moduleContext); void vos_set_reinit_in_progress(VOS_MODULE_ID moduleId, v_U8_t value); +VOS_STATUS vos_logger_pkt_serialize(vos_pkt_t *pPacket, uint32 pkt_type); +bool vos_is_log_report_in_progress(void); +void vos_reset_log_report_in_progress(void); +int vos_set_log_completion(uint32 is_fatal, uint32 indicator, uint32 reason_code); +void vos_get_log_completion(uint32 *is_fatal, uint32 *indicator, uint32 *reason_code); +VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal, uint32_t indicator, + uint32_t reason_code, bool waitRequired); +VOS_STATUS vos_process_done_indication(v_U8_t type, v_U32_t reason_code); +void vos_send_fatal_event_done(void); + /**--------------------------------------------------------------------------- @@ -254,9 +340,7 @@ VOS_STATUS vos_alloc_context( v_VOID_t *pVosContext, VOS_MODULE_ID moduleID, --------------------------------------------------------------------------*/ VOS_STATUS vos_free_context( v_VOID_t *pVosContext, VOS_MODULE_ID moduleID, v_VOID_t *pModuleContext ); - v_BOOL_t vos_is_apps_power_collapse_allowed(void* pHddCtx); -void vos_abort_mac_scan(tANI_U8 sessionId); /** @brief vos_wlanShutdown() - This API will shutdown WLAN driver @@ -316,19 +400,44 @@ VOS_STATUS vos_wlanRestart(void); This function is called to issue dump commands to Firmware @param - cmd - Command No. to execute - arg1 - argument 1 to cmd - arg2 - argument 2 to cmd - arg3 - argument 3 to cmd - arg4 - argument 4 to cmd + cmd - Command No. to execute + arg1 - argument 1 to cmd + arg2 - argument 2 to cmd + arg3 - argument 3 to cmd + arg4 - argument 4 to cmd + async - asynchronous event. Don't wait for completion. @return NONE */ v_VOID_t vos_fwDumpReq(tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2, - tANI_U32 arg3, tANI_U32 arg4); + tANI_U32 arg3, tANI_U32 arg4, tANI_U8 async); + +v_VOID_t vos_flush_work(struct work_struct *work); +v_VOID_t vos_flush_delayed_work(struct delayed_work *dwork); + +v_VOID_t vos_init_work(struct work_struct *work , void *callbackptr); +v_VOID_t vos_init_delayed_work(struct delayed_work *dwork , void *callbackptr); v_U64_t vos_get_monotonic_boottime(void); VOS_STATUS vos_randomize_n_bytes(void *mac_addr, tANI_U32 n); +v_BOOL_t vos_is_wlan_in_badState(VOS_MODULE_ID moduleId, + v_VOID_t *moduleContext); +v_VOID_t vos_set_roam_delay_stats_enabled(v_U8_t value); +v_U8_t vos_get_roam_delay_stats_enabled(v_VOID_t); +v_U32_t vos_get_dxeReplenishRXTimerVal(void); +v_BOOL_t vos_get_dxeSSREnable(void); + +v_U8_t vos_is_fw_logging_enabled(void); +v_U8_t vos_is_fw_ev_logging_enabled(void); + +v_U8_t vos_is_fw_logging_supported(void); +void vos_set_multicast_logging(uint8_t value); +v_U8_t vos_is_multicast_logging(void); +bool vos_is_wakelock_enabled(void); +v_BOOL_t vos_isUnloadInProgress(void); +v_BOOL_t vos_isLoadUnloadInProgress(void); + +void vos_probe_threads(void); #endif // if !defined __VOS_NVITEM_H diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_event.h b/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_event.h index a6dd932df3d9..715fbd2002a7 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_event.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_event.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Definitions for vOSS Events - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -58,6 +55,9 @@ extern "C" { #endif /* __cplusplus */ +#define WAKE_LOCK_NAME_LEN 80 + + /*------------------------------------------------------------------------- Event ID: EVENT_WLAN_SECURITY ------------------------------------------------------------------------*/ @@ -248,11 +248,71 @@ typedef struct v_U8_t mode; } vos_event_wlan_btc_type; +/*------------------------------------------------------------------------- + Event ID: EVENT_WLAN_EAPOL + ------------------------------------------------------------------------*/ +struct vos_event_wlan_eapol +{ + uint8_t event_sub_type; + uint8_t eapol_packet_type; + uint16_t eapol_key_info; + uint16_t eapol_rate; + uint8_t dest_addr[6]; + uint8_t src_addr[6]; +}; +/*------------------------------------------------------------------------- + Event ID: EVENT_WLAN_WAKE_LOCK + ------------------------------------------------------------------------*/ +/* + * struct vos_event_wlan_wake_lock - Structure holding the wakelock information + * @status: Whether the wakelock is taken/released + * @reason: Reason for taking this wakelock + * @timeout: Timeout value in case of timed wakelocks + * @name_len: Length of the name of the wakelock that will follow + * @name: Name of the wakelock + * + * This structure will hold the wakelock informations + */ +struct vos_event_wlan_wake_lock +{ + uint32_t status; + uint32_t reason; + uint32_t timeout; + uint32_t name_len; + char name[WAKE_LOCK_NAME_LEN]; +}; + + + /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ +enum wifi_connectivity_events { + WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED, + WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED, +}; +/* + * enum wake_lock_reason - Reason for taking wakelock +* @WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT: Driver initialization + * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT: Driver re-initialization + * @WIFI_POWER_EVENT_WAKELOCK_SCAN: Scan request/response handling + * @WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN: Driver resume + * @WIFI_POWER_EVENT_WAKELOCK_ROC: Remain on channel request/response handling + * @WIFI_POWER_EVENT_WAKELOCK_HOLD_RX: Wakelocks taken for receive + * @WIFI_POWER_EVENT_WAKELOCK_SAP: SoftAP related wakelocks + * This enum has the reason codes why the wakelocks were taken/released + */ +enum wake_lock_reason { + WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT, + WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT, + WIFI_POWER_EVENT_WAKELOCK_SCAN, + WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN, + WIFI_POWER_EVENT_WAKELOCK_ROC, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX, + WIFI_POWER_EVENT_WAKELOCK_SAP, +}; #ifdef __cplusplus } diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_log.h b/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_log.h index 20c37e8d1922..9a95c4a27407 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_log.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_diag_core_log.h @@ -36,9 +36,6 @@ Definitions for vOSS Events - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -357,7 +354,7 @@ typedef struct log_hdr_type hdr; v_U32_t PowerState; v_U32_t numFreeBd; - vos_log_data_stall_channel_type dxeChannelInfo[4]; + vos_log_data_stall_channel_type dxeChannelInfo[8]; } vos_log_data_stall_type; /*--------------------------------------------------------------------------- diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_event.h b/drivers/staging/prima/CORE/VOSS/inc/vos_event.h index d2480dac1749..c0394641a803 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_event.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_event.h @@ -36,9 +36,6 @@ Definitions for vOSS Events - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -58,6 +55,10 @@ extern "C" { #endif /* __cplusplus */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) +#define INIT_COMPLETION(event) reinit_completion(&event) +#endif + /*-------------------------------------------------------------------------- Type declarations ------------------------------------------------------------------------*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_list.h b/drivers/staging/prima/CORE/VOSS/inc/vos_list.h index cd599657044a..bc43d1bf0551 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_list.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_list.h @@ -61,9 +61,6 @@ This linked list API is implemented with appropriate locking mechanisms to assure operations on the list are thread safe. - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_lock.h b/drivers/staging/prima/CORE/VOSS/inc/vos_lock.h index c74e7612086b..9cce9503ac55 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_lock.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Definitions for vOSS Locks - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -251,5 +248,63 @@ VOS_STATUS vos_spin_lock_release(vos_spin_lock_t *pLock); ------------------------------------------------------------------------*/ VOS_STATUS vos_spin_lock_destroy(vos_spin_lock_t *pLock); +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_init() - initializes a vOSS wake lock + + \param pLock - the wake lock to initialize + name - wakelock name + + \return VOS_STATUS_SUCCESS - wake lock was successfully initialized and + is ready to be used. + --------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_init(vos_wake_lock_t *pLock, const char *name); + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_acquire() - acquires a wake lock + + \param pLock - the wake lock to acquire + reason - reason for taking wakelock + + \return VOS_STATUS_SUCCESS - the wake lock was successfully acquired + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_acquire(vos_wake_lock_t *pLock, uint32_t reason); +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_timeout_release() - release a wake lock with a timeout + + \param pLock - the wake lock to release + reason - reason for taking wakelock + + \return VOS_STATUS_SUCCESS - the wake lock was successfully released + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_timeout_release(vos_wake_lock_t *pLock, + v_U32_t msec, uint32_t reason); + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_release() - releases a wake lock + + \param pLock - the wake lock to release + reason - reason for taking wakelock + + \return VOS_STATUS_SUCCESS - the lock was successfully released + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_release(vos_wake_lock_t *pLock, uint32_t reason); + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_destroy() - destroys a wake lock + + \param pLock - the wake lock to destroy + + \return VOS_STATUS_SUCCESS - the lock was successfully destroyed + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_destroy(vos_wake_lock_t *pLock); #endif // __VOSS_LOCK_H diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_memory.h b/drivers/staging/prima/CORE/VOSS/inc/vos_memory.h index 85847d17e7b9..c6de77e1e898 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_memory.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_memory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Memory management functions - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -48,7 +45,7 @@ Include Files ------------------------------------------------------------------------*/ #include - +#include /*-------------------------------------------------------------------------- Preprocessor definitions and constants ------------------------------------------------------------------------*/ @@ -213,7 +210,18 @@ v_VOID_t vos_mem_move( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) locations are equal or not equal. -------------------------------------------------------------------------------*/ -v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ); +v_BOOL_t vos_mem_compare( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_VOID_t *pMemory1, +#else + v_VOID_t *pMemory1, +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_VOID_t *pMemory2, +#else + v_VOID_t *pMemory2, +#endif + v_U32_t numBytes); /** --------------------------------------------------------------------------- @@ -304,4 +312,32 @@ v_VOID_t vos_mem_dma_free( v_VOID_t *ptr ); --------------------------------------------------------------------------*/ v_VOID_t vos_mem_set_dma_ptr(unsigned char *dmaBuffer); #endif /* DMA_DIRECT_ACCESS */ + + +/*---------------------------------------------------------------------------- + + \brief vos_mem_vmalloc() - allocate memory which is virtually contiguous + + Wrapper function for vmalloc + + \param size memory size to be allocated + + \return on success returns starting address of allocated memory or NULL + + --------------------------------------------------------------------------*/ +v_VOID_t * vos_mem_vmalloc(v_SIZE_t size); + +/*---------------------------------------------------------------------------- + + \brief vos_mem_vfree() - free memory allocated by vmalloc + + Wrapper function for vfree + + \param address starting address of the memory to be freed + + \return Nothing + + --------------------------------------------------------------------------*/ +v_VOID_t vos_mem_vfree(void *addr); + #endif // __VOSS_LOCK_H diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_mq.h b/drivers/staging/prima/CORE/VOSS/inc/vos_mq.h index 7194e35d37fd..e82dd006ec80 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_mq.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_mq.h @@ -156,6 +156,43 @@ typedef enum --------------------------------------------------------------------------*/ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *message ); +/**-------------------------------------------------------------------------- + \brief vos_mq_post_message_high_pri() - posts a high priority message to + a message queue + + This API allows messages to be posted to the head of a specific message + queue. Messages can be posted to the following message queues: + +
    +
  • SME +
  • PE +
  • HAL +
  • TL +
+ + \param msgQueueId - identifies the message queue upon which the message + will be posted. + + \param message - a pointer to a message buffer. Memory for this message + buffer is allocated by the caller and free'd by the vOSS after the + message is posted to the message queue. If the consumer of the + message needs anything in this message, it needs to copy the contents + before returning from the message queue handler. + + \return VOS_STATUS_SUCCESS - the message has been successfully posted + to the message queue. + + VOS_STATUS_E_INVAL - The value specified by msgQueueId does not + refer to a valid Message Queue Id. + + VOS_STATUS_E_FAULT - message is an invalid pointer. + + VOS_STATUS_E_FAILURE - the message queue handler has reported + an unknown failure. + --------------------------------------------------------------------------*/ + +VOS_STATUS vos_mq_post_message_high_pri(VOS_MQ_ID msgQueueId, vos_msg_t *message); + /**--------------------------------------------------------------------------- diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h b/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h index 304803acf88a..c180d1ce3e00 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ \brief virtual Operating System Services (vOSS): Non-Volatile storage API - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -54,6 +51,8 @@ #define MAX_CHANNELS_IGNORE 10 #define MAX_COUNTRY_IGNORE 5 +#define TX_POWER_DEFAULT 30//in dbm + typedef struct sCsrIgnoreChannels { tANI_U8 countryCode[NV_FIELD_COUNTRY_CODE_SIZE]; @@ -132,6 +131,10 @@ ADD_VNV_ITEM( VNV_TABLE_VIRTUAL_RATE, 1, 4, VNV_TABLE_VIRTUAL_RATE_I ) \ * to esp_dpp.h where the WLAN_PROVISION_DATA is present. */ #define CLPC_PROVISION_DATA L"WLAN_CLPC.PROVISION" +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) +#define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR +#define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR +#endif /*-------------------------------------------------------------------------- Type declarations ------------------------------------------------------------------------*/ @@ -758,6 +761,14 @@ eNvVersionType vos_nv_getNvVersion -------------------------------------------------------------------------*/ v_U16_t vos_chan_to_freq(v_U8_t chanNum); +/**------------------------------------------------------------------------ + \brief vos_freq_to_chan - + \param - input channel frequency to know channel number + \return Channel frequency + \sa + -------------------------------------------------------------------------*/ +v_U8_t vos_freq_to_chan(v_U32_t freq); + /**------------------------------------------------------------------------ \brief vos_is_nv_country_non_zero - \param NONE @@ -770,6 +781,15 @@ v_BOOL_t vos_is_nv_country_non_zero void ); +/**------------------------------------------------------------------------ + \brief vos_is_channel_valid_for_vht80 - + \param chan + \return TRUE if channel is 80 mhz + \sa + -------------------------------------------------------------------------*/ + +v_BOOL_t vos_is_channel_valid_for_vht80(v_U32_t chan); + #ifdef CONFIG_ENABLE_LINUX_REG /**------------------------------------------------------------------------ \brief vos_getCurrentCountryCode - diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_pack_align.h b/drivers/staging/prima/CORE/VOSS/inc/vos_pack_align.h index 11229785038e..6dde5184a605 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_pack_align.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_pack_align.h @@ -37,9 +37,6 @@ Definitions for platform independent means of packing and aligning data structures - Copyright 2009 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_packet.h b/drivers/staging/prima/CORE/VOSS/inc/vos_packet.h index bedcd590be6a..73a5f40c5290 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_packet.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_packet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Network Protocol packet/buffer support interfaces - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -55,6 +52,7 @@ ------------------------------------------------------------------------*/ #define VOS_PKT_PROTO_TYPE_EAPOL 0x02 #define VOS_PKT_PROTO_TYPE_DHCP 0x04 +#define VOS_PKT_PROTO_TYPE_ARP 0x08 /*-------------------------------------------------------------------------- Type declarations ------------------------------------------------------------------------*/ @@ -567,6 +565,14 @@ VOS_STATUS vos_pkt_walk_packet_chain( vos_pkt_t *pPacket, vos_pkt_t **ppChainedP v_BOOL_t unchainPacket ); +/** + * vos_is_pkt_chain() - Check for chain of packets + * @pPacket: pointer to chain of packet list + * + * Return: true if chain of packets or false otherwise + */ +bool vos_is_pkt_chain(vos_pkt_t *pPacket); + /**-------------------------------------------------------------------------- \brief vos_pkt_get_data_vector() - Get data vectors from a voss Packet @@ -1136,4 +1142,40 @@ v_U8_t vos_pkt_get_proto_type void *pskb, v_U8_t tracking_map ); + +/** + @brief vos_get_pkt_head() - Get skb head pointer + + @param + pPacket - the voss Packet to operate on + @return + v_PVOID_t - skb head pointer + +*/ +v_PVOID_t vos_get_pkt_head(vos_pkt_t *pPacket); + +/** + + @brief vos_get_pkt_end() - Get skb end pointer + + @param + pPacket - the voss Packet to operate on + @return + v_PVOID_t - skb end pointer + +*/ +v_PVOID_t vos_get_pkt_end(vos_pkt_t *pPacket); + +/** + + @brief vos_recover_tail() - Recover corrupted tail of skb + + @param + pPacket - the voss Packet to operate on + @return + v_VOID_t - None + +*/ +v_VOID_t vos_recover_tail(vos_pkt_t *pPacket); + #endif // !defined( __VOS_PKT_H ) diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_status.h b/drivers/staging/prima/CORE/VOSS/inc/vos_status.h index 8ef75180a888..b41f56d3a93c 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_status.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_status.h @@ -36,9 +36,6 @@ Basic status codes/definitions used by vOSS - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_threads.h b/drivers/staging/prima/CORE/VOSS/inc/vos_threads.h index a87067c5150d..2b3bdd7af955 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_threads.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_threads.h @@ -34,9 +34,6 @@ \brief virtual Operating System Services (vOSS) Threading APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_timer.h b/drivers/staging/prima/CORE/VOSS/inc/vos_timer.h index 6e9da655ec1d..67a0d6b8c060 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_timer.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Definitions for vOSS Timer services - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -195,13 +192,26 @@ VOS_TIMER_STATE vos_timer_getCurrentState( vos_timer_t *pTimer ); ---------------------------------------------------------------------------*/ #ifdef TIMER_MANAGER #define vos_timer_init(timer, timerType, callback, userdata) \ - vos_timer_init_debug(timer, timerType, callback, userdata, __FILE__, __LINE__) - -VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, - vos_timer_callback_t callback, v_PVOID_t userData, - char* fileName, v_U32_t lineNum ); + vos_timer_init_debug(timer, timerType, callback, userdata, \ + __FILE__, __LINE__) + +VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, v_PVOID_t userData, + char* fileName, v_U32_t lineNum ); + +#define vos_timer_init_deferrable(timer, timerType, callback, userdata) \ + vos_timer_init_deferrable_debug(timer, timerType, \ + callback, userdata, __FILE__, __LINE__) + +VOS_STATUS vos_timer_init_deferrable_debug( vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, v_PVOID_t userData, + char* fileName, v_U32_t lineNum ); #else -VOS_STATUS vos_timer_init( vos_timer_t *timer, VOS_TIMER_TYPE timerType, +VOS_STATUS vos_timer_init( vos_timer_t *timer, VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, v_PVOID_t userData ); +VOS_STATUS vos_timer_init_deferrable( vos_timer_t *timer, + VOS_TIMER_TYPE timerType, vos_timer_callback_t callback, v_PVOID_t userData ); #endif @@ -331,6 +341,6 @@ v_TIME_t vos_timer_get_system_ticks( v_VOID_t ); ------------------------------------------------------------------------*/ v_TIME_t vos_timer_get_system_time( v_VOID_t ); - +v_BOOL_t vos_timer_is_initialized(vos_timer_t *timer); #endif // #if !defined __VOSS_TIMER_H diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h b/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h index 2f3fd2b67d24..a0c32f79ac76 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h @@ -81,6 +81,22 @@ typedef enum } VOS_TRACE_LEVEL; +enum { + LOG_PKT_TYPE_DATA_MGMT = 0x1, + LOG_PKT_TYPE_FW_LOG = 0x2 +}; + + + +/* Log types. These types are defined in mailbox*/ +typedef enum +{ + WLAN_MGMT_FRAME_LOGS = 0, + WLAN_QXDM_LOGGING = 1, + WLAN_FW_MEMORY_DUMP = 2 +}FrameLoggingType; + + /*-------------------------------------------------------------------------- Preprocessor definitions and constants ------------------------------------------------------------------------*/ diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_types.h b/drivers/staging/prima/CORE/VOSS/inc/vos_types.h index 20da1fb81062..20002e9f26ea 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_types.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_types.h @@ -105,8 +105,8 @@ typedef enum VOS_MODULE_ID_BAP = 0, VOS_MODULE_ID_TL = 1, VOS_MODULE_ID_WDI = 2, - // 3 & 4 are unused for historical purposes - VOS_MODULE_ID_RSV3 = 3, + VOS_MODULE_ID_SVC = 3, + // 4 is unused for historical purposes VOS_MODULE_ID_RSV4 = 4, VOS_MODULE_ID_HDD = 5, VOS_MODULE_ID_SME = 6, diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_utils.h b/drivers/staging/prima/CORE/VOSS/inc/vos_utils.h index 03968a6b4c52..57553363c68e 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_utils.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_utils.h @@ -37,9 +37,6 @@ Various utility functions - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -50,6 +47,7 @@ ------------------------------------------------------------------------*/ #include #include +#include //#include /*-------------------------------------------------------------------------- @@ -164,9 +162,10 @@ VOS_STATUS vos_decrypt_AES(v_U32_t cryptHandle, /* Handle */ v_U8_t *pKey); /* pointer to authentication key */ v_U8_t vos_chan_to_band(v_U32_t chan); +void vos_get_wlan_unsafe_channel(v_U16_t *unsafeChannelList, + v_U16_t buffer_size, v_U16_t *unsafeChannelCount); -#ifdef DEBUG_ROAM_DELAY -#define ROAM_DELAY_TABLE_SIZE 30 +#define ROAM_DELAY_TABLE_SIZE 10 enum e_roaming_event { @@ -223,10 +222,10 @@ typedef enum eVOS_AUTH_TYPE_WAPI_WAI_CERTIFICATE, eVOS_AUTH_TYPE_WAPI_WAI_PSK, #endif /* FEATURE_WLAN_WAPI */ -#ifdef FEATURE_WLAN_CCX +#ifdef FEATURE_WLAN_ESE eVOS_AUTH_TYPE_CCKM_WPA, eVOS_AUTH_TYPE_CCKM_RSN, -#endif /* FEATURE_WLAN_CCX */ +#endif /* FEATURE_WLAN_ESE */ #ifdef WLAN_FEATURE_11W eVOS_AUTH_TYPE_RSN_PSK_SHA256, #endif @@ -286,11 +285,12 @@ typedef struct sRoamDelayMetaInfo } tRoamDelayMetaInfo, *tpRoamDelayMetaInfo; extern tRoamDelayMetaInfo gRoamDelayMetaInfo; -extern tRoamDelayMetaInfo gRoamDelayTable[ROAM_DELAY_TABLE_SIZE]; +extern tRoamDelayMetaInfo *gpRoamDelayTable; extern v_BOOL_t gRoamDelayCurrentIndex; +v_BOOL_t vos_roam_delay_stats_init(void); +v_BOOL_t vos_roam_delay_stats_deinit(void); void vos_reset_roam_timer_log(void); void vos_dump_roam_time_log_service(void); void vos_record_roam_event(enum e_roaming_event, void *pBuff, v_ULONG_t buff_len); -#endif //#ifdef DEBUG_ROAM_DELAY #endif // #if !defined __VOSS_UTILS_H diff --git a/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h b/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h index 6df2665f4d46..7c2d62ad86c3 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h +++ b/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,7 +34,7 @@ #define WLAN_CFG_FILE "wlan/prima/WCNSS_cfg.dat" #define WLAN_FW_FILE "" #define WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv.bin" -#define WLAN_DICT_FILE "wlan/prima/WCNSS_qcom_wlan_dictionary.dat" +#define WLAN_DICT_FILE "wlan/prima/WCNSS_wlan_dictionary.dat" #define WLAN_COUNTRY_INFO_FILE "wlan/prima/WCNSS_wlan_country_info.dat" #define WLAN_HO_CFG_FILE "wlan/prima/WCNSS_wlan_ho_config" #else diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_api.c b/drivers/staging/prima/CORE/VOSS/src/vos_api.c index 8165e2a634fc..bdd075d0e59f 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_api.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -74,8 +74,8 @@ #include "sapApi.h" #include "vos_trace.h" - - +#include "vos_utils.h" +#include #ifdef WLAN_BTAMP_FEATURE #include "bapApi.h" @@ -104,6 +104,7 @@ * ------------------------------------------------------------------------*/ static VosContextType gVosContext; static pVosContextType gpVosContext; +static v_U8_t vos_multicast_logging; /*--------------------------------------------------------------------------- * Forward declaration @@ -283,6 +284,14 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, void *devHandle ) goto err_probe_event; } + if (vos_event_init( &(gpVosContext->fwLogsComplete) ) != VOS_STATUS_SUCCESS ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: Unable to init fwLogsComplete", __func__); + VOS_ASSERT(0); + + goto err_wda_complete_event; + } /* Initialize the free message queue */ vStatus = vos_mq_init(&gpVosContext->freeVosMq); @@ -293,7 +302,7 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, void *devHandle ) VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Failed to initialize VOS free message queue", __func__); VOS_ASSERT(0); - goto err_wda_complete_event; + goto err_fw_logs_complete_event; } for (iter = 0; iter < VOS_CORE_MAX_MESSAGES; iter++) @@ -421,6 +430,13 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, void *devHandle ) goto err_sme_close; } + if (gpVosContext->roamDelayStatsEnabled && + !vos_roam_delay_stats_init()) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Could not init roamDelayStats", __func__); + } + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, "%s: VOSS successfully Opened", __func__); @@ -458,6 +474,9 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, void *devHandle ) err_msg_queue: vos_mq_deinit(&gpVosContext->freeVosMq); +err_fw_logs_complete_event: + vos_event_destroy( &gpVosContext->fwLogsComplete); + err_wda_complete_event: vos_event_destroy( &gpVosContext->wdaCompleteEvent ); @@ -582,6 +601,179 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext ) return VOS_STATUS_SUCCESS; } +VOS_STATUS vos_mon_start( v_CONTEXT_t vosContext ) +{ + VOS_STATUS vStatus = VOS_STATUS_SUCCESS; + pVosContextType pVosContext = (pVosContextType)vosContext; + + if (pVosContext == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: mismatch in context",__func__); + return VOS_STATUS_E_FAILURE; + } + + if (( pVosContext->pWDAContext == NULL) || ( pVosContext->pTLContext == NULL)) + { + if (pVosContext->pWDAContext == NULL) + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA NULL context", __func__); + else + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: TL NULL context", __func__); + + return VOS_STATUS_E_FAILURE; + } + + /* Reset wda wait event */ + vos_event_reset(&pVosContext->wdaCompleteEvent); + + /*call WDA pre start*/ + vStatus = WDA_preStart(pVosContext); + if (!VOS_IS_STATUS_SUCCESS(vStatus)) + { + VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, + "Failed to WDA prestart "); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + /* Need to update time out of complete */ + vStatus = vos_wait_single_event( &pVosContext->wdaCompleteEvent, 1000); + if ( vStatus != VOS_STATUS_SUCCESS ) + { + if ( vStatus == VOS_STATUS_E_TIMEOUT ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before WDA complete",__func__); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA_preStart reporting other error",__func__); + } + VOS_ASSERT( 0 ); + return VOS_STATUS_E_FAILURE; + } + + vStatus = WDA_NVDownload_Start(pVosContext); + + if ( vStatus != VOS_STATUS_SUCCESS ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to start NV Download",__func__); + return VOS_STATUS_E_FAILURE; + } + + vStatus = vos_wait_single_event(&(pVosContext->wdaCompleteEvent), 1000 * 30); + + if ( vStatus != VOS_STATUS_SUCCESS ) + { + if ( vStatus == VOS_STATUS_E_TIMEOUT ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before WDA_NVDownload_Start complete",__func__); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA_NVDownload_Start reporting other error",__func__); + } + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + vStatus = WDA_start(pVosContext); + if (vStatus != VOS_STATUS_SUCCESS) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to start WDA",__func__); + return VOS_STATUS_E_FAILURE; + } + + /** START TL */ + vStatus = WLANTL_Start(pVosContext); + if (!VOS_IS_STATUS_SUCCESS(vStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: Failed to start TL", __func__); + goto err_wda_stop; + } + + return VOS_STATUS_SUCCESS; + +err_wda_stop: + vos_event_reset(&(pVosContext->wdaCompleteEvent)); + WDA_stop(pVosContext, HAL_STOP_TYPE_RF_KILL); + vStatus = vos_wait_single_event(&(pVosContext->wdaCompleteEvent), 1000); + if(vStatus != VOS_STATUS_SUCCESS) + { + if(vStatus == VOS_STATUS_E_TIMEOUT) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before WDA_stop complete",__func__); + + } + else + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA_stop reporting other error",__func__); + } + VOS_ASSERT(0); + } + return VOS_STATUS_E_FAILURE; +} + +VOS_STATUS vos_mon_stop( v_CONTEXT_t vosContext ) +{ + VOS_STATUS vosStatus; + + vos_event_reset( &(gpVosContext->wdaCompleteEvent) ); + + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: HAL_STOP is requested", __func__); + + vosStatus = WDA_stop( vosContext, HAL_STOP_TYPE_RF_KILL ); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to stop WDA", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + WDA_setNeedShutdown(vosContext); + } + else + { + vosStatus = vos_wait_single_event( &(gpVosContext->wdaCompleteEvent), + VOS_WDA_STOP_TIMEOUT ); + + if ( vosStatus != VOS_STATUS_SUCCESS ) + { + if ( vosStatus == VOS_STATUS_E_TIMEOUT ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before WDA complete", __func__); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA_stop reporting other error", __func__ ); + } + WDA_setNeedShutdown(vosContext); + } + } + + vosStatus = WLANTL_Stop( vosContext ); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to stop TL", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + + return VOS_STATUS_SUCCESS; +} + /*--------------------------------------------------------------------------- \brief vos_start() - Start the Libra SW Modules @@ -699,11 +891,13 @@ VOS_STATUS vos_start( v_CONTEXT_t vosContext ) if ( vStatus != VOS_STATUS_SUCCESS ) { VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to start WDA - WDA_shutdown needed", __func__); + "%s: Failed to start WDA - WDA_shutdown needed %d ", + __func__, vStatus); if ( vStatus == VOS_STATUS_E_TIMEOUT ) - { + { WDA_setNeedShutdown(vosContext); - } + } + VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; } VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, @@ -818,8 +1012,18 @@ VOS_STATUS vos_stop( v_CONTEXT_t vosContext ) } else { - vosStatus = vos_wait_single_event( &(gpVosContext->wdaCompleteEvent), + if(wcnss_device_is_shutdown()) + { + vosStatus = VOS_STATUS_E_TIMEOUT; + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Wait for WDA_Stop complete event not needed due to SSR", + __func__); + } + else + { + vosStatus = vos_wait_single_event( &(gpVosContext->wdaCompleteEvent), VOS_WDA_STOP_TIMEOUT ); + } if ( vosStatus != VOS_STATUS_SUCCESS ) { @@ -960,6 +1164,14 @@ VOS_STATUS vos_close( v_CONTEXT_t vosContext ) vos_mq_deinit(&((pVosContextType)vosContext)->freeVosMq); + vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: failed to destroy fwLogsComplete", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + vosStatus = vos_event_destroy(&gpVosContext->wdaCompleteEvent); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -968,6 +1180,7 @@ VOS_STATUS vos_close( v_CONTEXT_t vosContext ) VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } + vosStatus = vos_event_destroy(&gpVosContext->ProbeEvent); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -976,6 +1189,13 @@ VOS_STATUS vos_close( v_CONTEXT_t vosContext ) VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } + if (gpVosContext->roamDelayStatsEnabled && + !vos_roam_delay_stats_deinit()) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Could not deinit roamDelayStats", __func__); + } + return VOS_STATUS_SUCCESS; } @@ -1446,7 +1666,194 @@ VOS_STATUS vos_free_context( v_VOID_t *pVosContext, VOS_MODULE_ID moduleID, return VOS_STATUS_SUCCESS; } /* vos_free_context() */ - + + +bool vos_is_log_report_in_progress(void) +{ + return wlan_is_log_report_in_progress(); +} + +void vos_reset_log_report_in_progress(void) +{ + return wlan_reset_log_report_in_progress(); +} + + + + +int vos_set_log_completion(uint32 is_fatal, + uint32 indicator, + uint32 reason_code) +{ + return wlan_set_log_completion(is_fatal, + indicator,reason_code); +} + +void vos_get_log_completion(uint32 *is_fatal, + uint32 *indicator, + uint32 *reason_code) +{ + wlan_get_log_completion(is_fatal, indicator, reason_code); +} + + + +void vos_send_fatal_event_done(void) +{ + /*Complete the fwLogsComplete Event*/ + VosContextType *vos_context; + uint32_t is_fatal, indicator, reason_code; + + vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!vos_context) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is Invalid", __func__); + return; + } + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "%s: vos_event_set for fwLogsComplete", __func__); + if (vos_event_set(&vos_context->fwLogsComplete)!= VOS_STATUS_SUCCESS) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: vos_event_set failed for fwLogsComplete", __func__); + return; + } + /*The below API will reset is_report_in_progress flag*/ + vos_get_log_completion(&is_fatal, &indicator, &reason_code); + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "%s: is_fatal : %d, indicator: %d, reason_code=%d", + __func__, is_fatal, indicator, reason_code); +} + + + +/**--------------------------------------------------------------------------- + + \brief vos_fatal_event_logs_req() - used to send flush command to FW + + This API is wrapper to SME flush API. + + \param is_fatal - fatal or non fatal event + indicator - Tyoe of indicator framework/Host/FW + reason_code - reason code for flush logs + + \return VOS_STATUS_SUCCESS - if command is sent successfully. + VOS_STATUS_E_FAILURE - if command is not sent successfully. + --------------------------------------------------------------------------*/ +VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal, + uint32_t indicator, + uint32_t reason_code, + bool waitRequired) +{ + VOS_STATUS vosStatus; + eHalStatus status; + VosContextType *vos_context; + + vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!vos_context) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is Invalid", __func__); + return eHAL_STATUS_FAILURE; + } + + + if (vos_is_log_report_in_progress() == true) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Fatal Event Req already in progress - dropping! type:%d, indicator=%d reason_code=%d", + __func__, is_fatal, indicator, reason_code); + return VOS_STATUS_E_FAILURE; + } + + vosStatus = vos_set_log_completion(is_fatal, indicator, reason_code); + if (VOS_STATUS_SUCCESS != vosStatus) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to set log trigger params for fatalEvent", __func__); + return VOS_STATUS_E_FAILURE; + } + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "%s: Triggering fatal Event: type:%d, indicator=%d reason_code=%d", + __func__, is_fatal, indicator, reason_code); + + vos_event_reset(&gpVosContext->fwLogsComplete); + status = sme_fatal_event_logs_req(vos_context->pMACContext, + is_fatal, indicator, + reason_code); + + if (HAL_STATUS_SUCCESS(status) && (waitRequired == TRUE)) + { + + /* Need to update time out of complete */ + vosStatus = vos_wait_single_event(&gpVosContext->fwLogsComplete, + WAIT_TIME_FW_LOGS); + if ( vosStatus != VOS_STATUS_SUCCESS ) + { + if ( vosStatus == VOS_STATUS_E_TIMEOUT ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before fwLogsComplete", __func__); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: fwLogsComplete reporting other error", __func__); + } + /*Done indication is not received.So reset the bug report in progress*/ + vos_reset_log_report_in_progress(); + return VOS_STATUS_E_FAILURE; + } + } + if (HAL_STATUS_SUCCESS( status )) + return VOS_STATUS_SUCCESS; + else + return VOS_STATUS_E_FAILURE; +} + +/**--------------------------------------------------------------------------- + + \brief vos_process_done_indication() - Process the done indication for fatal event, + FW memory dump + + This API processes the done indication and wakeup the logger thread accordingly. + + \param type - Type for which done indication is received. + + + \return VOS_STATUS_SUCCESS - the pkt has been successfully queued. + VOS_STATUS_E_FAILURE - the pkt queue handler has reported + a failure. + --------------------------------------------------------------------------*/ + +VOS_STATUS vos_process_done_indication(v_U8_t type, v_U32_t reason_code) +{ + wlan_process_done_indication(type, reason_code); + return VOS_STATUS_SUCCESS; +} + +/**--------------------------------------------------------------------------- + + \brief vos_logger_pkt_serialize() - queue a logging vos pkt + + This API allows single vos pkt to be queued and later sent to userspace by + logger thread. + + \param pPacket - a pointer to a vos pkt to be queued + pkt_type - type of pkt to be queued + LOG_PKT_TYPE_DATA_MGMT - frame log i.e data/mgmt pkts + + \return VOS_STATUS_SUCCESS - the pkt has been successfully queued. + VOS_STATUS_E_FAILURE - the pkt queue handler has reported + a failure. + --------------------------------------------------------------------------*/ +VOS_STATUS vos_logger_pkt_serialize( vos_pkt_t *pPacket, uint32 pkt_type) +{ +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + return wlan_queue_logpkt_for_app(pPacket, pkt_type); +#else + return vos_pkt_return_packet(pPacket); +#endif +} /**--------------------------------------------------------------------------- @@ -1580,7 +1987,7 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) vos_mq_put(pTargetMq, pMsgWrapper); - set_bit(MC_POST_EVENT_MASK, &gpVosContext->vosSched.mcEventFlag); + set_bit(MC_POST_EVENT, &gpVosContext->vosSched.mcEventFlag); wake_up_interruptible(&gpVosContext->vosSched.mcWaitQueue); return VOS_STATUS_SUCCESS; @@ -1588,23 +1995,160 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) } /* vos_mq_post_message()*/ -/**--------------------------------------------------------------------------- - - \brief vos_tx_mq_serialize() - serialize a message to the Tx execution flow +/**-------------------------------------------------------------------------- + \brief vos_mq_post_message_high_pri() - posts a high priority message to + a message queue + + This API allows messages to be posted to the head of a specific message + queue. Messages can be posted to the following message queues: - This API allows messages to be posted to a specific message queue in the - Tx excution flow. Messages for the Tx execution flow can be posted only - to the following queue. -
    +
  • SME +
  • PE +
  • HAL
  • TL -
  • SSC/WDI
- + \param msgQueueId - identifies the message queue upon which the message will be posted. - - \param message - a pointer to a message buffer. Body memory for this message + + \param message - a pointer to a message buffer. Memory for this message + buffer is allocated by the caller and free'd by the vOSS after the + message is posted to the message queue. If the consumer of the + message needs anything in this message, it needs to copy the contents + before returning from the message queue handler. + + \return VOS_STATUS_SUCCESS - the message has been successfully posted + to the message queue. + + VOS_STATUS_E_INVAL - The value specified by msgQueueId does not + refer to a valid Message Queue Id. + + VOS_STATUS_E_FAULT - message is an invalid pointer. + + VOS_STATUS_E_FAILURE - the message queue handler has reported + an unknown failure. + --------------------------------------------------------------------------*/ +VOS_STATUS vos_mq_post_message_high_pri(VOS_MQ_ID msgQueueId, vos_msg_t *pMsg) +{ + pVosMqType pTargetMq = NULL; + pVosMsgWrapper pMsgWrapper = NULL; + + if ((gpVosContext == NULL) || (pMsg == NULL)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Null params or global vos context is null", __func__); + VOS_ASSERT(0); + return VOS_STATUS_E_FAILURE; + } + + switch (msgQueueId) + { + /// Message Queue ID for messages bound for SME + case VOS_MQ_ID_SME: + { + pTargetMq = &(gpVosContext->vosSched.smeMcMq); + break; + } + + /// Message Queue ID for messages bound for PE + case VOS_MQ_ID_PE: + { + pTargetMq = &(gpVosContext->vosSched.peMcMq); + break; + } + + /// Message Queue ID for messages bound for WDA + case VOS_MQ_ID_WDA: + { + pTargetMq = &(gpVosContext->vosSched.wdaMcMq); + break; + } + + /// Message Queue ID for messages bound for WDI + case VOS_MQ_ID_WDI: + { + pTargetMq = &(gpVosContext->vosSched.wdiMcMq); + break; + } + + /// Message Queue ID for messages bound for TL + case VOS_MQ_ID_TL: + { + pTargetMq = &(gpVosContext->vosSched.tlMcMq); + break; + } + + /// Message Queue ID for messages bound for the SYS module + case VOS_MQ_ID_SYS: + { + pTargetMq = &(gpVosContext->vosSched.sysMcMq); + break; + } + + default: + + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + ("%s: Trying to queue msg into unknown MC Msg queue ID %d"), + __func__, msgQueueId); + + return VOS_STATUS_E_FAILURE; + } + + VOS_ASSERT(NULL !=pTargetMq); + if (pTargetMq == NULL) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: pTargetMq == NULL", __func__); + return VOS_STATUS_E_FAILURE; + } + + /* + ** Try and get a free Msg wrapper + */ + pMsgWrapper = vos_mq_get(&gpVosContext->freeVosMq); + + if (NULL == pMsgWrapper) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: VOS Core run out of message wrapper", __func__); + return VOS_STATUS_E_RESOURCES; + } + + /* + ** Copy the message now + */ + vos_mem_copy( (v_VOID_t*)pMsgWrapper->pVosMsg, + (v_VOID_t*)pMsg, sizeof(vos_msg_t)); + + vos_mq_put_front(pTargetMq, pMsgWrapper); + + set_bit(MC_POST_EVENT, &gpVosContext->vosSched.mcEventFlag); + wake_up_interruptible(&gpVosContext->vosSched.mcWaitQueue); + + return VOS_STATUS_SUCCESS; + +} /* vos_mq_post_message_high_pri()*/ + + + +/**--------------------------------------------------------------------------- + + \brief vos_tx_mq_serialize() - serialize a message to the Tx execution flow + + This API allows messages to be posted to a specific message queue in the + Tx excution flow. Messages for the Tx execution flow can be posted only + to the following queue. + +
    +
  • TL +
  • SSC/WDI +
+ + \param msgQueueId - identifies the message queue upon which the message + will be posted. + + \param message - a pointer to a message buffer. Body memory for this message buffer is allocated by the caller and free'd by the vOSS after the message is dispacthed to the appropriate component. If the consumer of the message needs to keep anything in the body, it needs to copy @@ -1698,7 +2242,7 @@ VOS_STATUS vos_tx_mq_serialize( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) vos_mq_put(pTargetMq, pMsgWrapper); - set_bit(TX_POST_EVENT_MASK, &gpVosContext->vosSched.txEventFlag); + set_bit(TX_POST_EVENT, &gpVosContext->vosSched.txEventFlag); wake_up_interruptible(&gpVosContext->vosSched.txWaitQueue); return VOS_STATUS_SUCCESS; @@ -1813,7 +2357,7 @@ VOS_STATUS vos_rx_mq_serialize( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) vos_mq_put(pTargetMq, pMsgWrapper); - set_bit(RX_POST_EVENT_MASK, &gpVosContext->vosSched.rxEventFlag); + set_bit(RX_POST_EVENT, &gpVosContext->vosSched.rxEventFlag); wake_up_interruptible(&gpVosContext->vosSched.rxWaitQueue); return VOS_STATUS_SUCCESS; @@ -1926,6 +2470,7 @@ vos_fetch_tl_cfg_parms pTLConfig->ucAcWeights[1] = pConfig->WfqBeWeight; pTLConfig->ucAcWeights[2] = pConfig->WfqViWeight; pTLConfig->ucAcWeights[3] = pConfig->WfqVoWeight; + pTLConfig->ucAcWeights[4] = pConfig->WfqVoWeight; pTLConfig->ucReorderAgingTime[0] = pConfig->BkReorderAgingTime;/*WLANTL_AC_BK*/ pTLConfig->ucReorderAgingTime[1] = pConfig->BeReorderAgingTime;/*WLANTL_AC_BE*/ pTLConfig->ucReorderAgingTime[2] = pConfig->ViReorderAgingTime;/*WLANTL_AC_VI*/ @@ -1940,28 +2485,6 @@ v_BOOL_t vos_is_apps_power_collapse_allowed(void* pHddCtx) return hdd_is_apps_power_collapse_allowed((hdd_context_t*) pHddCtx); } -void vos_abort_mac_scan(v_U8_t sessionId) -{ - hdd_context_t *pHddCtx = NULL; - v_CONTEXT_t pVosContext = NULL; - - /* Get the Global VOSS Context */ - pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); - if(!pVosContext) { - hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Global VOS context is Null", __func__); - return; - } - - /* Get the HDD context */ - pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext ); - if(!pHddCtx) { - hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HDD context is Null", __func__); - return; - } - - hdd_abort_mac_scan(pHddCtx, sessionId, eCSR_SCAN_ABORT_DEFAULT); - return; -} /*--------------------------------------------------------------------------- \brief vos_shutdown() - shutdown VOS @@ -2039,6 +2562,15 @@ VOS_STATUS vos_shutdown(v_CONTEXT_t vosContext) vos_mq_deinit(&((pVosContextType)vosContext)->freeVosMq); + vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: failed to destroy fwLogsComplete", __func__); + VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); + } + + vosStatus = vos_event_destroy(&gpVosContext->wdaCompleteEvent); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -2189,18 +2721,19 @@ VOS_STATUS vos_wlanRestart(void) This function is called to issue dump commands to Firmware @param - cmd - Command No. to execute - arg1 - argument 1 to cmd - arg2 - argument 2 to cmd - arg3 - argument 3 to cmd - arg4 - argument 4 to cmd + cmd - Command No. to execute + arg1 - argument 1 to cmd + arg2 - argument 2 to cmd + arg3 - argument 3 to cmd + arg4 - argument 4 to cmd + async - asynchronous event. Don't wait for completion. @return NONE */ v_VOID_t vos_fwDumpReq(tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2, - tANI_U32 arg3, tANI_U32 arg4) + tANI_U32 arg3, tANI_U32 arg4, tANI_U8 async) { - WDA_HALDumpCmdReq(NULL, cmd, arg1, arg2, arg3, arg4, NULL); + WDA_HALDumpCmdReq(NULL, cmd, arg1, arg2, arg3, arg4, NULL, async); } v_U64_t vos_get_monotonic_boottime(void) @@ -2232,3 +2765,312 @@ VOS_STATUS vos_randomize_n_bytes(void *start_addr, tANI_U32 n) return eHAL_STATUS_SUCCESS; } + +/**--------------------------------------------------------------------------- + + \brief vos_is_wlan_in_badState() - get isFatalError flag from WD Ctx + + \param - VOS_MODULE_ID - module id + - moduleContext - module context + + \return - isFatalError value if WDCtx is valid otherwise true + + --------------------------------------------------------------------------*/ +v_BOOL_t vos_is_wlan_in_badState(VOS_MODULE_ID moduleId, + v_VOID_t *moduleContext) +{ + struct _VosWatchdogContext *pVosWDCtx = get_vos_watchdog_ctxt(); + + if (pVosWDCtx == NULL){ + VOS_TRACE(moduleId, VOS_TRACE_LEVEL_ERROR, + "%s: global wd context is null", __func__); + + return TRUE; + } + return pVosWDCtx->isFatalError; +} + +/**--------------------------------------------------------------------------- + + \brief vos_is_fw_logging_enabled() - + + API to check if firmware is configured to send logs using DXE channel + + \param - None + + \return - 0: firmware logging is not enabled (it may or may not + be supported) + 1: firmware logging is enabled + + --------------------------------------------------------------------------*/ +v_U8_t vos_is_fw_logging_enabled(void) +{ + return hdd_is_fw_logging_enabled(); +} + +/**--------------------------------------------------------------------------- + + \brief vos_is_fw_ev_logging_enabled() - + + API to check if firmware is configured to send live logs using DXE channel + + \param - None + + \return - 0: firmware logging is not enabled (it may or may not + be supported) + 1: firmware logging is enabled + + --------------------------------------------------------------------------*/ +v_U8_t vos_is_fw_ev_logging_enabled(void) +{ + return hdd_is_fw_ev_logging_enabled(); +} + +/**--------------------------------------------------------------------------- + + \brief vos_is_fw_logging_supported() - + + API to check if firmware supports to send logs using DXE channel + + \param - None + + \return - 0: firmware logging is not supported + 1: firmware logging is supported + + --------------------------------------------------------------------------*/ +v_U8_t vos_is_fw_logging_supported(void) +{ + return IS_FRAME_LOGGING_SUPPORTED_BY_FW; +} +/**--------------------------------------------------------------------------- + + \brief vos_set_roam_delay_stats_enabled() - + + API to set value of roamDelayStatsEnabled in vos context + + \param - value to be updated + + \return - NONE + + --------------------------------------------------------------------------*/ + +v_VOID_t vos_set_roam_delay_stats_enabled(v_U8_t value) +{ + gpVosContext->roamDelayStatsEnabled = value; +} + + +/**--------------------------------------------------------------------------- + + \brief vos_get_roam_delay_stats_enabled() - + + API to get value of roamDelayStatsEnabled from vos context + + \param - NONE + + \return - value of roamDelayStatsEnabled + + --------------------------------------------------------------------------*/ + +v_U8_t vos_get_roam_delay_stats_enabled(v_VOID_t) +{ + return gpVosContext->roamDelayStatsEnabled; +} + +v_U32_t vos_get_dxeReplenishRXTimerVal(void) +{ + hdd_context_t *pHddCtx = NULL; + v_CONTEXT_t pVosContext = NULL; + + /* Get the Global VOSS Context */ + pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if(!pVosContext) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Global VOS context is Null", __func__); + return 0; + } + + /* Get the HDD context */ + pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext ); + if(!pHddCtx) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HDD context is Null", __func__); + return 0; + } + + return pHddCtx->cfg_ini->dxeReplenishRXTimerVal; +} + +v_BOOL_t vos_get_dxeSSREnable(void) +{ + hdd_context_t *pHddCtx = NULL; + v_CONTEXT_t pVosContext = NULL; + + /* Get the Global VOSS Context */ + pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if(!pVosContext) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Global VOS context is Null", __func__); + return FALSE; + } + + /* Get the HDD context */ + pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext ); + if(!pHddCtx) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HDD context is Null", __func__); + return FALSE; + } + + return pHddCtx->cfg_ini->dxeSSREnable; +} + +v_VOID_t vos_flush_work(struct work_struct *work) +{ +#if defined (WLAN_OPEN_SOURCE) + cancel_work_sync(work); +#else + wcnss_flush_work(work); +#endif +} + +v_VOID_t vos_flush_delayed_work(struct delayed_work *dwork) +{ +#if defined (WLAN_OPEN_SOURCE) + cancel_delayed_work_sync(dwork); +#else + wcnss_flush_delayed_work(dwork); +#endif +} + +v_VOID_t vos_init_work(struct work_struct *work , void *callbackptr) +{ +#if defined (WLAN_OPEN_SOURCE) + INIT_WORK(work,callbackptr); +#else + wcnss_init_work(work, callbackptr); +#endif +} + +v_VOID_t vos_init_delayed_work(struct delayed_work *dwork , void *callbackptr) +{ +#if defined (WLAN_OPEN_SOURCE) + INIT_DELAYED_WORK(dwork,callbackptr); +#else + wcnss_init_delayed_work(dwork, callbackptr); +#endif +} + +/** + * vos_set_multicast_logging() - Set mutlicast logging value + * @value: Value of multicast logging + * + * Set the multicast logging value which will indicate + * whether to multicast host and fw messages even + * without any registration by userspace entity + * + * Return: None + */ +void vos_set_multicast_logging(uint8_t value) +{ + vos_multicast_logging = value; +} + +/** + * vos_is_multicast_logging() - Get multicast logging value + * + * Get the multicast logging value which will indicate + * whether to multicast host and fw messages even + * without any registration by userspace entity + * + * Return: 0 - Multicast logging disabled, 1 - Multicast logging enabled + */ +v_U8_t vos_is_multicast_logging(void) +{ + return vos_multicast_logging; +} + +/** + * vos_isLoadUnloadInProgress() + * + * Return TRUE if load/unload is in progress. + * + */ +v_BOOL_t vos_isLoadUnloadInProgress(void) +{ + hdd_context_t *pHddCtx = NULL; + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if(!pVosContext) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Global VOS context is Null", __func__); + return FALSE; + } + + pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext ); + if(!pHddCtx) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: HDD context is Null", __func__); + return FALSE; + } + + return ( 0 != pHddCtx->isLoadUnloadInProgress); +} + +/** + * vos_isUnloadInProgress() + * + * Return TRUE if unload is in progress. + * + */ +v_BOOL_t vos_isUnloadInProgress(void) +{ + hdd_context_t *pHddCtx = NULL; + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if(!pVosContext) + { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Global VOS context is Null", __func__); + return FALSE; + } + + pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext ); + if(!pHddCtx) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "%s: HDD context is Null", __func__); + return FALSE; + } + + return (WLAN_HDD_UNLOAD_IN_PROGRESS == pHddCtx->isLoadUnloadInProgress); +} + +/** + * vos_probe_threads() - VOS API to post messages + * to all the threads to detect if they are active or not + * + * Return none. + * + */ +void vos_probe_threads(void) +{ + vos_msg_t msg; + + msg.callback = vos_wd_reset_thread_stuck_count; + /* Post Message to MC Thread */ + sysBuildMessageHeader(SYS_MSG_ID_MC_THR_PROBE, &msg); + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SYS, &msg)) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + FL("Unable to post SYS_MSG_ID_MC_THR_PROBE message to MC thread")); + } + + /* Post Message to Tx Thread */ + sysBuildMessageHeader(SYS_MSG_ID_TX_THR_PROBE, &msg); + if (VOS_STATUS_SUCCESS != vos_tx_mq_serialize(VOS_MQ_ID_SYS, &msg)) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + FL("Unable to post SYS_MSG_ID_TX_THR_PROBE message to TX thread")); + } + + /* Post Message to Rx Thread */ + sysBuildMessageHeader(SYS_MSG_ID_RX_THR_PROBE, &msg); + if (VOS_STATUS_SUCCESS != vos_rx_mq_serialize(VOS_MQ_ID_SYS, &msg)) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + FL("Unable to post SYS_MSG_ID_RX_THR_PROBE message to RX thread")); + } +} + diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_diag.c b/drivers/staging/prima/CORE/VOSS/src/vos_diag.c index d9c63b71280c..285581d09cea 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_diag.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_diag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -40,6 +40,7 @@ #include "wlan_nlink_common.h" #include "vos_sched.h" #include "wlan_ptt_sock_svc.h" +#include "wlan_nlink_srv.h" #define PTT_MSG_DIAG_CMDS_TYPE 0x5050 @@ -149,8 +150,11 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr) } #endif /* WLAN_KD_READY_NOTIFIER */ + if (nl_srv_is_initialized() != 0) + return; + /* Send the log data to the ptt app only if it is registered with the wlan driver*/ - if(pHddCtx->ptt_pid) + if(vos_is_multicast_logging()) { data_len = pHdr->len; @@ -179,24 +183,52 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr) vos_mem_copy(pBuf, pHdr,data_len); - - if(pHddCtx->ptt_pid) + + if (ptt_sock_send_msg_to_app(wmsg, 0, + ANI_NL_MSG_PUMAC, INVALID_PID, MSG_DONTWAIT) < 0) { - if( ptt_sock_send_msg_to_app(wmsg, 0, - ANI_NL_MSG_PUMAC, pHddCtx->ptt_pid, MSG_DONTWAIT) < 0) { - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - ("Ptt Socket error sending message to the app!!")); - vos_mem_free((v_VOID_t *)wmsg); - return; - } - + vos_mem_free((v_VOID_t *)wmsg); + return; } + vos_mem_free((v_VOID_t*)wmsg); } return; } +/** + * vos_log_wlock_diag() - This function is used to send wake lock diag events + * @reason: Reason why the wakelock was taken or released + * @wake_lock_name: Function in which the wakelock was taken or released + * @timeout: Timeout value in case of timed wakelocks + * @status: Status field indicating whether the wake lock was taken/released + * + * This function is used to send wake lock diag events to user space + * + * Return: None + * + */ +void vos_log_wlock_diag(uint32_t reason, const char *wake_lock_name, + uint32_t timeout, uint32_t status) +{ + WLAN_VOS_DIAG_EVENT_DEF(wlan_diag_event, + struct vos_event_wlan_wake_lock); + + if (nl_srv_is_initialized() != 0) + return; + + wlan_diag_event.status = status; + wlan_diag_event.reason = reason; + wlan_diag_event.timeout = timeout; + wlan_diag_event.name_len = strlen(wake_lock_name); + strlcpy(&wlan_diag_event.name[0], + wake_lock_name, + wlan_diag_event.name_len+1); + + WLAN_VOS_DIAG_EVENT_REPORT(&wlan_diag_event, EVENT_WLAN_WAKE_LOCK); +} + + /**--------------------------------------------------------------------------- \brief vos_event_report_payload() - @@ -222,9 +254,21 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!pVosContext) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is NULL", __func__); + return; + } /*Get the Hdd Context */ pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext; + if (!pHddCtx) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: hdd context is NULL", __func__); + return; + } #ifdef WLAN_KD_READY_NOTIFIER /* NL is not ready yet, WLAN KO started first */ @@ -234,8 +278,11 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo } #endif /* WLAN_KD_READY_NOTIFIER */ + if (nl_srv_is_initialized() != 0) + return; + /* Send the log data to the ptt app only if it is registered with the wlan driver*/ - if(pHddCtx->ptt_pid) + if(vos_is_multicast_logging()) { total_len = sizeof(tAniHdr)+sizeof(event_report_t)+length; @@ -262,7 +309,7 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo vos_mem_copy(pBuf, pPayload,length); if( ptt_sock_send_msg_to_app(wmsg, 0, - ANI_NL_MSG_PUMAC, pHddCtx->ptt_pid, MSG_DONTWAIT) < 0) { + ANI_NL_MSG_PUMAC, INVALID_PID, MSG_DONTWAIT) < 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t*)wmsg); diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_event.c b/drivers/staging/prima/CORE/VOSS/src/vos_event.c index 74324847b39f..505455e23798 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_event.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_event.c @@ -35,9 +35,6 @@ DEPENDENCIES: - Copyright (c) 2007 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /*============================================================================ diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_list.c b/drivers/staging/prima/CORE/VOSS/src/vos_list.c index 693ea7bb9d82..66fbda7d7fbc 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_list.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_list.c @@ -34,9 +34,6 @@ Description... - Copyright 2008 (c) Qualcomm, Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary. ==============================================================================**/ /* $HEADER$ */ diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_lock.c b/drivers/staging/prima/CORE/VOSS/src/vos_lock.c index 8011bcfdfec3..60e0c3dae140 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_lock.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_lock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,9 +35,6 @@ DEPENDENCIES: - Copyright (c) 2007 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /*============================================================================ @@ -52,12 +49,19 @@ #include "vos_lock.h" #include "vos_memory.h" #include "vos_trace.h" +#include "i_vos_diag_core_event.h" +#include "vos_diag_core_event.h" +#include /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants * -------------------------------------------------------------------------*/ +#define WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT 0 +#define WIFI_POWER_EVENT_WAKELOCK_TAKEN 0 +#define WIFI_POWER_EVENT_WAKELOCK_RELEASED 1 + /*---------------------------------------------------------------------------- * Type Declarations * -------------------------------------------------------------------------*/ @@ -477,3 +481,142 @@ VOS_STATUS vos_spin_lock_destroy(vos_spin_lock_t *pLock) return VOS_STATUS_SUCCESS; } + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_init() - initializes a vOSS wake lock + + \param pLock - the wake lock to initialize + name - wakelock name + + \return VOS_STATUS_SUCCESS - wake lock was successfully initialized and + is ready to be used. + --------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_init(vos_wake_lock_t *pLock, const char *name) +{ +#if defined(WLAN_OPEN_SOURCE) + wake_lock_init(pLock, WAKE_LOCK_SUSPEND, name); +#endif + return VOS_STATUS_SUCCESS; +} + + +/*-------------------------------------------------------------------------- + * vos_wake_lock_name() - This function returns the name of the wakelock + * @pLock: Pointer to the wakelock + * + * This function returns the name of the wakelock + * + * Return: Pointer to the name if it is valid or a default string + * + --------------------------------------------------------------------------*/ +static const char* vos_wake_lock_name(vos_wake_lock_t *pLock) +{ +#if !(defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)) + return "UNNAMED_WAKELOCK"; +#else + if (pLock->ws.name) + return pLock->ws.name; + else + return "UNNAMED_WAKELOCK"; +#endif +} + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_acquire() - acquires a wake lock + + \param pLock - the wake lock to acquire + + \return VOS_STATUS_SUCCESS - the wake lock was successfully acquired + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_acquire(vos_wake_lock_t *pLock, + uint32_t reason) +{ + vos_log_wlock_diag(reason, vos_wake_lock_name(pLock), + WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT, + WIFI_POWER_EVENT_WAKELOCK_TAKEN); +#if defined(WLAN_OPEN_SOURCE) + wake_lock(pLock); +#else + wcnss_prevent_suspend(); +#endif + return VOS_STATUS_SUCCESS; + +} + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_timeout_release() - release a wake lock with a timeout + + \param pLock - the wake lock to release + reason - reason for taking wakelock + + \return VOS_STATUS_SUCCESS - the wake lock was successfully released + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_timeout_release(vos_wake_lock_t *pLock, + v_U32_t msec, uint32_t reason) +{ + /* Avoid reporting rx and tx wavelocks + * event to diag as it may cause performance + * issues. + */ + if (WIFI_POWER_EVENT_WAKELOCK_HOLD_RX != reason) + { + vos_log_wlock_diag(reason, vos_wake_lock_name(pLock), msec, + WIFI_POWER_EVENT_WAKELOCK_TAKEN); + } + +#if defined(WLAN_OPEN_SOURCE) + wake_lock_timeout(pLock, msecs_to_jiffies(msec)); +#else + /* Do nothing as there is no API in wcnss for timeout*/ +#endif + return VOS_STATUS_SUCCESS; + +} + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_release() - releases a wake lock + + \param pLock - the wake lock to release + + \return VOS_STATUS_SUCCESS - the lock was successfully released + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_release(vos_wake_lock_t *pLock, uint32_t reason) +{ + vos_log_wlock_diag(reason, vos_wake_lock_name(pLock), + WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT, + WIFI_POWER_EVENT_WAKELOCK_RELEASED); + +#if defined(WLAN_OPEN_SOURCE) + wake_unlock(pLock); +#else + wcnss_allow_suspend(); +#endif + return VOS_STATUS_SUCCESS; + + +} + +/*-------------------------------------------------------------------------- + + \brief vos_wake_lock_destroy() - destroys a wake lock + + \param pLock - the wake lock to destroy + + \return VOS_STATUS_SUCCESS - the lock was successfully destroyed + + ------------------------------------------------------------------------*/ +VOS_STATUS vos_wake_lock_destroy(vos_wake_lock_t *pLock) +{ + +#if defined(WLAN_OPEN_SOURCE) + wake_lock_destroy(pLock); +#endif + return VOS_STATUS_SUCCESS; +} diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_memory.c b/drivers/staging/prima/CORE/VOSS/src/vos_memory.c index 7690c1beb957..1f3c8f1b08a4 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_memory.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_memory.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,9 +31,6 @@ @brief Virtual Operating System Services Memory API - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -58,11 +55,14 @@ * ------------------------------------------------------------------------*/ #include "vos_memory.h" #include "vos_trace.h" +#include "vos_api.h" +#include #ifdef CONFIG_WCNSS_MEM_PRE_ALLOC #include #define WCNSS_PRE_ALLOC_GET_THRESHOLD (4*1024) #endif +#define VOS_GET_MEMORY_TIME_THRESHOLD 300 #ifdef MEMORY_DEBUG #include "wlan_hdd_dp_utils.h" @@ -191,16 +191,17 @@ v_VOID_t * vos_mem_malloc_debug( v_SIZE_t size, char* fileName, v_U32_t lineNum) v_SIZE_t new_size; int flags = GFP_KERNEL; unsigned long IrqFlags; + unsigned long time_before_kmalloc; - if (size > (1024*1024)) + if (size > (1024*1024) || size == 0) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: called with arg > 1024K; passed in %d !!!", __func__,size); + "%s: called with invalid arg %u !!!", __func__, size); return NULL; } - if (in_interrupt()) + if (in_interrupt() || irqs_disabled() || in_atomic()) { flags = GFP_ATOMIC; } @@ -216,12 +217,30 @@ v_VOID_t * vos_mem_malloc_debug( v_SIZE_t size, char* fileName, v_U32_t lineNum) return pmem; } #endif - return kmalloc(size, flags); + time_before_kmalloc = vos_timer_get_system_time(); + memPtr = kmalloc(size, flags); + + /* If time taken by kmalloc is greater than VOS_GET_MEMORY_TIME_THRESHOLD + * msec */ + if (vos_timer_get_system_time() - time_before_kmalloc >= + VOS_GET_MEMORY_TIME_THRESHOLD) + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: kmalloc took %lu msec", __func__, + vos_timer_get_system_time() - time_before_kmalloc); + return memPtr; } new_size = size + sizeof(struct s_vos_mem_struct) + 8; + time_before_kmalloc = vos_timer_get_system_time(); memStruct = (struct s_vos_mem_struct*)kmalloc(new_size, flags); + /* If time taken by kmalloc is greater than VOS_GET_MEMORY_TIME_THRESHOLD + * msec */ + if (vos_timer_get_system_time() - time_before_kmalloc >= + VOS_GET_MEMORY_TIME_THRESHOLD) + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: kmalloc took %lu msec", __func__, + vos_timer_get_system_time() - time_before_kmalloc); if(memStruct != NULL) { @@ -300,12 +319,16 @@ v_VOID_t vos_mem_free( v_VOID_t *ptr ) v_VOID_t * vos_mem_malloc( v_SIZE_t size ) { int flags = GFP_KERNEL; + v_VOID_t* memPtr = NULL; #ifdef CONFIG_WCNSS_MEM_PRE_ALLOC v_VOID_t* pmem; #endif - if (size > (1024*1024)) + unsigned long time_before_kmalloc; + + if (size > (1024*1024) || size == 0) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: called with arg > 1024K; passed in %d !!!", __func__,size); + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: called with invalid arg %u !!!", __func__, size); return NULL; } if (in_interrupt() || irqs_disabled() || in_atomic()) @@ -320,8 +343,19 @@ v_VOID_t * vos_mem_malloc( v_SIZE_t size ) return pmem; } #endif - return kmalloc(size, flags); -} + time_before_kmalloc = vos_timer_get_system_time(); + memPtr = kmalloc(size, flags); + /* If time taken by kmalloc is greater than VOS_GET_MEMORY_TIME_THRESHOLD + * msec */ + if (vos_timer_get_system_time() - time_before_kmalloc >= + VOS_GET_MEMORY_TIME_THRESHOLD) + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: kmalloc took %lu msec", __func__, + vos_timer_get_system_time() - time_before_kmalloc); + + return memPtr; + +} v_VOID_t vos_mem_free( v_VOID_t *ptr ) { @@ -337,6 +371,45 @@ v_VOID_t vos_mem_free( v_VOID_t *ptr ) } #endif +v_VOID_t * vos_mem_vmalloc(v_SIZE_t size) +{ + v_VOID_t* memPtr = NULL; + unsigned long time_before_vmalloc; + + if (size == 0 || size >= (1024*1024)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s invalid size: %u", __func__, size); + return NULL; + } + time_before_vmalloc = vos_timer_get_system_time(); + memPtr = vmalloc(size); + /* If time taken by vmalloc is greater than VOS_GET_MEMORY_TIME_THRESHOLD + * msec + */ + if (vos_timer_get_system_time() - time_before_vmalloc >= + VOS_GET_MEMORY_TIME_THRESHOLD) + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: vmalloc took %lu msec for size %d from %pS", + __func__, + vos_timer_get_system_time() - time_before_vmalloc, + size, (void *)_RET_IP_); + return memPtr; +} + +v_VOID_t vos_mem_vfree(void *addr) +{ + if (addr == NULL) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s NULL address passed to free", __func__); + return; + } + + vfree(addr); + return; +} + v_VOID_t vos_mem_set( v_VOID_t *ptr, v_SIZE_t numBytes, v_BYTE_t value ) { if (ptr == NULL) @@ -375,7 +448,7 @@ v_VOID_t vos_mem_copy( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) if ((pDst == NULL) || (pSrc==NULL)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s called with NULL parameter, source:%p destination:%p", + "%s called with NULL parameter, source:%pK destination:%pK", __func__, pSrc, pDst); VOS_ASSERT(0); return; @@ -394,7 +467,7 @@ v_VOID_t vos_mem_move( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) if ((pDst == NULL) || (pSrc==NULL)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s called with NULL parameter, source:%p destination:%p", + "%s called with NULL parameter, source:%pK destination:%pK", __func__, pSrc, pDst); VOS_ASSERT(0); return; @@ -402,7 +475,18 @@ v_VOID_t vos_mem_move( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) memmove(pDst, pSrc, numBytes); } -v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ) +v_BOOL_t vos_mem_compare( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_VOID_t *pMemory1, +#else + v_VOID_t *pMemory1, +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) + const v_VOID_t *pMemory2, +#else + v_VOID_t *pMemory2, +#endif + v_U32_t numBytes ) { if (0 == numBytes) { @@ -413,7 +497,7 @@ v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numByt if ((pMemory1 == NULL) || (pMemory2==NULL)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s called with NULL parameter, p1:%p p2:%p", + "%s called with NULL parameter, p1:%pK p2:%pK", __func__, pMemory1, pMemory2); VOS_ASSERT(0); return VOS_FALSE; diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_mq.c b/drivers/staging/prima/CORE/VOSS/src/vos_mq.c index 8928df06f303..91ed20674001 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_mq.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_mq.c @@ -33,9 +33,6 @@ Message Queue Definitions and API - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -166,6 +163,42 @@ __inline void vos_mq_put(pVosMqType pMq, pVosMsgWrapper pMsgWrapper) } /* vos_mq_put() */ +/*--------------------------------------------------------------------------- + + \brief vos_mq_put_front() - Add a message to the head of message queue + + The \a vos_mq_put_front() function add a message to the head of Message queue. + + \param pMq - pointer to the message queue + + \param pMsgWrapper - Msg Wrapper containing the message + + \return None + + \sa vos_mq_put() + +---------------------------------------------------------------------------*/ +void vos_mq_put_front(pVosMqType pMq, pVosMsgWrapper pMsgWrapper) +{ + unsigned long flags; + + /* + ** Some quick sanity check + */ + if ((pMq == NULL) || (pMsgWrapper == NULL)) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: NULL pointer passed",__func__); + return ; + } + + spin_lock_irqsave(&pMq->mqLock, flags); + + list_add(&pMsgWrapper->msgNode, &pMq->mqList); + + spin_unlock_irqrestore(&pMq->mqLock, flags); + +} /* vos_mq_put_front() */ + /*--------------------------------------------------------------------------- diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c index b7363308eee2..c7ce970594ee 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -32,9 +32,6 @@ FILE: vos_nvitem.c OVERVIEW: This source file contains definitions for vOS NV Item APIs DEPENDENCIES: NV, remote API client, WinCE REX - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /*============================================================================ EDIT HISTORY FOR MODULE @@ -56,6 +53,8 @@ #include "wlan_nv_parser.h" #include "wlan_hdd_main.h" #include +#include +#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) #define IEEE80211_CHAN_NO_80MHZ 1<<7 @@ -92,6 +91,8 @@ static v_BOOL_t crda_regulatory_run_time_entry_valid = VOS_FALSE; #define MAGIC_NUMBER 0xCAFEBABE #define MIN(a, b) (a > b ? b : a) +#define MAX(a, b) (a > b ? a : b) + /*---------------------------------------------------------------------------- * Type Declarations * -------------------------------------------------------------------------*/ @@ -129,139 +130,139 @@ static CountryInfoTable_t countryInfoTable = 138, { {REGDOMAIN_WORLD, {'0', '0'}}, // WORLD DOMAIN - {REGDOMAIN_FCC, {'A', 'D'}}, // ANDORRA + {REGDOMAIN_ETSI, {'A', 'D'}}, // ANDORRA {REGDOMAIN_ETSI, {'A', 'E'}}, //UAE {REGDOMAIN_ETSI, {'A', 'L'}}, //ALBANIA {REGDOMAIN_ETSI, {'A', 'M'}}, //ARMENIA {REGDOMAIN_ETSI, {'A', 'N'}}, //NETHERLANDS ANTILLES - {REGDOMAIN_FCC, {'A', 'R'}}, //ARGENTINA + {REGDOMAIN_WORLD, {'A', 'R'}}, //ARGENTINA {REGDOMAIN_FCC, {'A', 'S'}}, //AMERICAN SOMOA {REGDOMAIN_ETSI, {'A', 'T'}}, //AUSTRIA - {REGDOMAIN_FCC, {'A', 'U'}}, //AUSTRALIA + {REGDOMAIN_ETSI, {'A', 'U'}}, //AUSTRALIA {REGDOMAIN_ETSI , {'A', 'W'}}, //ARUBA {REGDOMAIN_ETSI, {'A', 'Z'}}, //AZERBAIJAN {REGDOMAIN_ETSI, {'B', 'A'}}, //BOSNIA AND HERZEGOVINA - {REGDOMAIN_FCC, {'B', 'B'}}, //BARBADOS + {REGDOMAIN_APAC, {'B', 'B'}}, //BARBADOS {REGDOMAIN_ETSI, {'B', 'D'}}, //BANGLADESH {REGDOMAIN_ETSI, { 'B', 'E'}}, //BELGIUM {REGDOMAIN_ETSI, {'B', 'G'}}, //BULGARIA - {REGDOMAIN_ETSI, {'B', 'H'}}, //BAHRAIN + {REGDOMAIN_APAC, {'B', 'H'}}, //BAHRAIN {REGDOMAIN_ETSI, {'B', 'L'}}, // {REGDOMAIN_FCC, {'B', 'M'}}, //BERMUDA - {REGDOMAIN_ETSI, {'B', 'N'}}, //BRUNEI DARUSSALAM + {REGDOMAIN_APAC, {'B', 'N'}}, //BRUNEI DARUSSALAM {REGDOMAIN_ETSI, {'B', 'O'}}, //BOLIVIA - {REGDOMAIN_ETSI, {'B', 'R'}}, //BRAZIL - {REGDOMAIN_FCC, {'B', 'S'}}, //BAHAMAS + {REGDOMAIN_WORLD, {'B', 'R'}}, //BRAZIL + {REGDOMAIN_APAC, {'B', 'S'}}, //BAHAMAS {REGDOMAIN_ETSI, {'B', 'Y'}}, //BELARUS {REGDOMAIN_ETSI, {'B', 'Z'}}, //BELIZE {REGDOMAIN_FCC, {'C', 'A'}}, //CANADA {REGDOMAIN_ETSI, {'C', 'H'}}, //SWITZERLAND - {REGDOMAIN_ETSI, {'C', 'L'}}, //CHILE - {REGDOMAIN_FCC, {'C', 'N'}}, //CHINA - {REGDOMAIN_FCC, {'C', 'O'}}, //COLOMBIA - {REGDOMAIN_ETSI, {'C', 'R'}}, //COSTA RICA + {REGDOMAIN_APAC, {'C', 'L'}}, //CHILE + {REGDOMAIN_APAC, {'C', 'N'}}, //CHINA + {REGDOMAIN_APAC, {'C', 'O'}}, //COLOMBIA + {REGDOMAIN_APAC, {'C', 'R'}}, //COSTA RICA {REGDOMAIN_ETSI, {'C', 'S'}}, {REGDOMAIN_ETSI, {'C', 'Y'}}, //CYPRUS {REGDOMAIN_ETSI, {'C', 'Z'}}, //CZECH REPUBLIC {REGDOMAIN_ETSI, {'D', 'E'}}, //GERMANY {REGDOMAIN_ETSI, {'D', 'K'}}, //DENMARK - {REGDOMAIN_FCC, {'D', 'O'}}, //DOMINICAN REPUBLIC + {REGDOMAIN_APAC, {'D', 'O'}}, //DOMINICAN REPUBLIC {REGDOMAIN_ETSI, {'D', 'Z'}}, //ALGERIA - {REGDOMAIN_ETSI, {'E', 'C'}}, //ECUADOR + {REGDOMAIN_APAC, {'E', 'C'}}, //ECUADOR {REGDOMAIN_ETSI, {'E', 'E'}}, //ESTONIA {REGDOMAIN_ETSI, {'E', 'G'}}, //EGYPT {REGDOMAIN_ETSI, {'E', 'S'}}, //SPAIN {REGDOMAIN_ETSI, {'F', 'I'}}, //FINLAND {REGDOMAIN_ETSI, {'F', 'R'}}, //FRANCE {REGDOMAIN_ETSI, {'G', 'B'}}, //UNITED KINGDOM - {REGDOMAIN_FCC, {'G', 'D'}}, //GRENADA + {REGDOMAIN_WORLD, {'G', 'D'}}, //GRENADA {REGDOMAIN_ETSI, {'G', 'E'}}, //GEORGIA {REGDOMAIN_ETSI, {'G', 'F'}}, //FRENCH GUIANA {REGDOMAIN_ETSI, {'G', 'L'}}, //GREENLAND {REGDOMAIN_ETSI, {'G', 'P'}}, //GUADELOUPE {REGDOMAIN_ETSI, {'G', 'R'}}, //GREECE - {REGDOMAIN_FCC, {'G', 'T'}}, //GUATEMALA + {REGDOMAIN_APAC, {'G', 'T'}}, //GUATEMALA {REGDOMAIN_FCC, {'G', 'U'}}, //GUAM {REGDOMAIN_ETSI, {'H', 'U'}}, //HUNGARY {REGDOMAIN_FCC, {'I', 'D'}}, //INDONESIA {REGDOMAIN_ETSI, {'I', 'E'}}, //IRELAND {REGDOMAIN_ETSI, {'I', 'L'}}, //ISRAEL - {REGDOMAIN_ETSI, {'I', 'N'}}, //INDIA + {REGDOMAIN_APAC, {'I', 'N'}}, //INDIA {REGDOMAIN_ETSI, {'I', 'R'}}, //IRAN, ISLAMIC REPUBLIC OF {REGDOMAIN_ETSI, {'I', 'S'}}, //ICELNAD {REGDOMAIN_ETSI, {'I', 'T'}}, //ITALY - {REGDOMAIN_FCC, {'J', 'M'}}, //JAMAICA + {REGDOMAIN_WORLD, {'J', 'M'}}, //JAMAICA {REGDOMAIN_JAPAN, {'J', 'P'}}, //JAPAN - {REGDOMAIN_ETSI, {'J', 'O'}}, //JORDAN + {REGDOMAIN_APAC, {'J', 'O'}}, //JORDAN {REGDOMAIN_ETSI, {'K', 'E'}}, //KENYA {REGDOMAIN_ETSI, {'K', 'H'}}, //CAMBODIA - {REGDOMAIN_ETSI, {'K', 'P'}}, //KOREA, DEMOCRATIC PEOPLE's REPUBLIC OF - {REGDOMAIN_ETSI, {'K', 'R'}}, //KOREA, REPUBLIC OF + {REGDOMAIN_WORLD, {'K', 'P'}}, //KOREA, DEMOCRATIC PEOPLE's REPUBLIC OF + {REGDOMAIN_KOREA, {'K', 'R'}}, //KOREA, REPUBLIC OF {REGDOMAIN_ETSI, {'K', 'W'}}, //KUWAIT - {REGDOMAIN_ETSI, {'K', 'Z'}}, //KAZAKHSTAN - {REGDOMAIN_ETSI, {'L', 'B'}}, //LEBANON + {REGDOMAIN_WORLD, {'K', 'Z'}}, //KAZAKHSTAN + {REGDOMAIN_WORLD, {'L', 'B'}}, //LEBANON {REGDOMAIN_ETSI, {'L', 'I'}}, //LIECHTENSTEIN - {REGDOMAIN_ETSI, {'L', 'K'}}, //SRI-LANKA + {REGDOMAIN_WORLD, {'L', 'K'}}, //SRI-LANKA {REGDOMAIN_ETSI, {'L', 'T'}}, //LITHUANIA {REGDOMAIN_ETSI, {'L', 'U'}}, //LUXEMBOURG {REGDOMAIN_ETSI, {'L','V'}}, //LATVIA {REGDOMAIN_ETSI, {'M', 'A'}}, //MOROCCO {REGDOMAIN_ETSI, {'M', 'C'}}, //MONACO {REGDOMAIN_ETSI, {'M', 'K'}}, //MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF - {REGDOMAIN_FCC, {'M','N'}}, //MONGOLIA - {REGDOMAIN_FCC, {'M', 'O'}}, //MACAO + {REGDOMAIN_WORLD, {'M','N'}}, //MONGOLIA + {REGDOMAIN_APAC, {'M', 'O'}}, //MACAO {REGDOMAIN_FCC, {'M', 'P'}}, //NORTHERN MARIANA ISLANDS {REGDOMAIN_ETSI, {'M', 'Q'}}, //MARTINIQUE - {REGDOMAIN_FCC, {'M', 'T'}}, //MALTA + {REGDOMAIN_ETSI, {'M', 'T'}}, //MALTA {REGDOMAIN_ETSI, {'M', 'U'}}, //MAURITIUS {REGDOMAIN_ETSI, {'M', 'W'}}, //MALAWI - {REGDOMAIN_FCC, {'M', 'X'}}, //MEXICO - {REGDOMAIN_ETSI, {'M', 'Y'}}, //MALAYSIA - {REGDOMAIN_ETSI, {'N', 'G'}}, //NIGERIA - {REGDOMAIN_FCC, {'N', 'I'}}, //NICARAGUA + {REGDOMAIN_APAC, {'M', 'X'}}, //MEXICO + {REGDOMAIN_APAC, {'M', 'Y'}}, //MALAYSIA + {REGDOMAIN_WORLD, {'N', 'G'}}, //NIGERIA + {REGDOMAIN_WORLD, {'N', 'I'}}, //NICARAGUA {REGDOMAIN_ETSI, {'N', 'L'}}, //NETHERLANDS {REGDOMAIN_ETSI, {'N', 'O'}}, //NORWAY - {REGDOMAIN_ETSI, {'N', 'P'}}, //NEPAL - {REGDOMAIN_FCC, {'N', 'Z'}}, //NEW-ZEALAND - {REGDOMAIN_FCC, {'O', 'M'}}, //OMAN - {REGDOMAIN_FCC, {'P', 'A'}}, //PANAMA - {REGDOMAIN_ETSI, {'P', 'E'}}, //PERU + {REGDOMAIN_APAC, {'N', 'P'}}, //NEPAL + {REGDOMAIN_APAC, {'N', 'Z'}}, //NEW-ZEALAND + {REGDOMAIN_ETSI, {'O', 'M'}}, //OMAN + {REGDOMAIN_APAC, {'P', 'A'}}, //PANAMA + {REGDOMAIN_WORLD, {'P', 'E'}}, //PERU {REGDOMAIN_ETSI, {'P', 'F'}}, //FRENCH POLYNESIA - {REGDOMAIN_ETSI, {'P', 'G'}}, //PAPUA NEW GUINEA - {REGDOMAIN_FCC, {'P', 'H'}}, //PHILIPPINES + {REGDOMAIN_WORLD, {'P', 'G'}}, //PAPUA NEW GUINEA + {REGDOMAIN_WORLD, {'P', 'H'}}, //PHILIPPINES {REGDOMAIN_ETSI, {'P', 'K'}}, //PAKISTAN {REGDOMAIN_ETSI, {'P', 'L'}}, //POLAND {REGDOMAIN_FCC, {'P', 'R'}}, //PUERTO RICO - {REGDOMAIN_FCC, {'P', 'S'}}, //PALESTINIAN TERRITORY, OCCUPIED + {REGDOMAIN_WORLD, {'P', 'S'}}, //PALESTINIAN TERRITORY, OCCUPIED {REGDOMAIN_ETSI, {'P', 'T'}}, //PORTUGAL - {REGDOMAIN_FCC, {'P', 'Y'}}, //PARAGUAY + {REGDOMAIN_WORLD, {'P', 'Y'}}, //PARAGUAY {REGDOMAIN_ETSI, {'Q', 'A'}}, //QATAR {REGDOMAIN_ETSI, {'R', 'E'}}, //REUNION {REGDOMAIN_ETSI, {'R', 'O'}}, //ROMAINIA {REGDOMAIN_ETSI, {'R', 'S'}}, //SERBIA - {REGDOMAIN_ETSI, {'R', 'U'}}, //RUSSIA - {REGDOMAIN_FCC, {'R', 'W'}}, //RWANDA - {REGDOMAIN_ETSI, {'S', 'A'}}, //SAUDI ARABIA + {REGDOMAIN_APAC, {'R', 'U'}}, //RUSSIA + {REGDOMAIN_WORLD, {'R', 'W'}}, //RWANDA + {REGDOMAIN_WORLD, {'S', 'A'}}, //SAUDI ARABIA {REGDOMAIN_ETSI, {'S', 'E'}}, //SWEDEN - {REGDOMAIN_ETSI, {'S', 'G'}}, //SINGAPORE + {REGDOMAIN_APAC, {'S', 'G'}}, //SINGAPORE {REGDOMAIN_ETSI, {'S', 'I'}}, //SLOVENNIA {REGDOMAIN_ETSI, {'S', 'K'}}, //SLOVAKIA - {REGDOMAIN_ETSI, {'S', 'V'}}, //EL SALVADOR + {REGDOMAIN_APAC, {'S', 'V'}}, //EL SALVADOR {REGDOMAIN_ETSI, {'S', 'Y'}}, //SYRIAN ARAB REPUBLIC - {REGDOMAIN_ETSI, {'T', 'H'}}, //THAILAND + {REGDOMAIN_WORLD, {'T', 'H'}}, //THAILAND {REGDOMAIN_ETSI, {'T', 'N'}}, //TUNISIA {REGDOMAIN_ETSI, {'T', 'R'}}, //TURKEY - {REGDOMAIN_ETSI, {'T', 'T'}}, //TRINIDAD AND TOBAGO + {REGDOMAIN_WORLD, {'T', 'T'}}, //TRINIDAD AND TOBAGO {REGDOMAIN_FCC, {'T', 'W'}}, //TAIWAN, PRIVINCE OF CHINA {REGDOMAIN_FCC, {'T', 'Z'}}, //TANZANIA, UNITED REPUBLIC OF - {REGDOMAIN_ETSI, {'U', 'A'}}, //UKRAINE - {REGDOMAIN_ETSI, {'U', 'G'}}, //UGANDA + {REGDOMAIN_WORLD, {'U', 'A'}}, //UKRAINE + {REGDOMAIN_KOREA, {'U', 'G'}}, //UGANDA {REGDOMAIN_FCC, {'U', 'S'}}, //USA - {REGDOMAIN_ETSI, {'U', 'Y'}}, //URUGUAY + {REGDOMAIN_WORLD, {'U', 'Y'}}, //URUGUAY {REGDOMAIN_FCC, {'U', 'Z'}}, //UZBEKISTAN {REGDOMAIN_ETSI, {'V', 'E'}}, //VENEZUELA {REGDOMAIN_FCC, {'V', 'I'}}, //VIRGIN ISLANDS, US - {REGDOMAIN_ETSI, {'V', 'N'}}, //VIETNAM + {REGDOMAIN_FCC, {'V', 'N'}}, //VIETNAM {REGDOMAIN_ETSI, {'Y', 'E'}}, //YEMEN {REGDOMAIN_ETSI, {'Y', 'T'}}, //MAYOTTE {REGDOMAIN_ETSI, {'Z', 'A'}}, //SOUTH AFRICA @@ -547,6 +548,7 @@ nvEFSTable_t *gnvEFSTable; /* EFS Table to send the NV structure to HAL*/ static nvEFSTable_t *pnvEFSTable; static v_U8_t *pnvEncodedBuf; +static v_U8_t *pnvtmpBuf; static v_U8_t *pDictFile; static v_U8_t *pEncodedBuf; static v_SIZE_t nvReadEncodeBufSize; @@ -1115,9 +1117,9 @@ VOS_STATUS vos_nv_open(void) status = hdd_request_firmware(WLAN_NV_FILE, ((VosContextType*)(pVosContext))->pHDDContext, - (v_VOID_t**)&pnvEncodedBuf, &nvReadBufSize); + (v_VOID_t**)&pnvtmpBuf, &nvReadBufSize); - if ((!VOS_IS_STATUS_SUCCESS( status )) || (!pnvEncodedBuf)) + if ((!VOS_IS_STATUS_SUCCESS( status )) || (!pnvtmpBuf)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: unable to download NV file %s", @@ -1125,26 +1127,40 @@ VOS_STATUS vos_nv_open(void) return VOS_STATUS_E_RESOURCES; } + pnvEncodedBuf = (v_U8_t *)vos_mem_vmalloc(nvReadBufSize); + + if (NULL == pnvEncodedBuf) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s : failed to allocate memory for NV", __func__); + return VOS_STATUS_E_NOMEM; + } + vos_mem_copy(pnvEncodedBuf, pnvtmpBuf, nvReadBufSize); + release_firmware(((hdd_context_t*)((VosContextType*) + (pVosContext))->pHDDContext)->nv); + vos_mem_copy(&magicNumber, &pnvEncodedBuf[sizeof(v_U32_t)], sizeof(v_U32_t)); /// Allocate buffer with maximum length.. - pEncodedBuf = (v_U8_t *)vos_mem_malloc(nvReadBufSize); + pEncodedBuf = (v_U8_t *)vos_mem_vmalloc(nvReadBufSize); if (NULL == pEncodedBuf) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s : failed to allocate memory for NV", __func__); + vos_mem_vfree(pnvEncodedBuf); return VOS_STATUS_E_NOMEM; } VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "NV Table Size %zu", sizeof(nvEFSTable_t)); - pnvEFSTable = (nvEFSTable_t *)vos_mem_malloc(sizeof(nvEFSTable_t)); + pnvEFSTable = (nvEFSTable_t *)vos_mem_vmalloc(sizeof(nvEFSTable_t)); if (NULL == pnvEFSTable) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s : failed to allocate memory for NV", __func__); + vos_mem_vfree(pnvEncodedBuf); + vos_mem_vfree(pEncodedBuf); return VOS_STATUS_E_NOMEM; } vos_mem_zero((void *)pnvEFSTable, sizeof(nvEFSTable_t)); @@ -1161,6 +1177,9 @@ VOS_STATUS vos_nv_open(void) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s : failed to allocate memory for NV", __func__); + vos_mem_vfree(pnvEncodedBuf); + vos_mem_vfree(pEncodedBuf); + vos_mem_vfree(pnvEFSTable); return VOS_STATUS_E_NOMEM; } @@ -1182,7 +1201,7 @@ VOS_STATUS vos_nv_open(void) "readEncodeBufSize %d",nvReadEncodeBufSize); if (VOS_STATUS_SUCCESS == status) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "Embedded NV parsed success !!productId %d couple Type %d wlan RevId %d", pnvData->fields.productId, pnvData->fields.couplerType, @@ -1197,6 +1216,20 @@ VOS_STATUS vos_nv_open(void) VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "nvParser failed %d",status); + if (nvReadBufSize != sizeof(sHalNv)) { + vos_mem_vfree(pEncodedBuf); + pEncodedBuf = (v_U8_t *)vos_mem_vmalloc(sizeof(sHalNv)); + + if (!pEncodedBuf) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s : failed to allocate memory for NV", __func__); + vos_mem_free(pnvData); + vos_mem_vfree(pnvEncodedBuf); + vos_mem_vfree(pnvEFSTable); + return VOS_STATUS_E_NOMEM; + } + } + nvReadBufSize = 0; vos_mem_copy(pEncodedBuf, &nvDefaults, sizeof(sHalNv)); @@ -1225,6 +1258,9 @@ VOS_STATUS vos_nv_open(void) VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "Size mismatch INVALID NV FILE %d %d!!!", nvReadBufSize, bufSize); + vos_mem_vfree(pnvEncodedBuf); + vos_mem_vfree(pEncodedBuf); + vos_mem_vfree(pnvEFSTable); return VOS_STATUS_E_FAILURE; } @@ -1235,6 +1271,19 @@ VOS_STATUS vos_nv_open(void) /* From here, NV2 will be stored into NV3 structure */ dataOffset = sizeof(v_U32_t); nvReadEncodeBufSize = sizeof(sHalNvV2); + if (nvReadBufSize != nvReadEncodeBufSize) + { + vos_mem_vfree(pEncodedBuf); + pEncodedBuf = (v_U8_t *)vos_mem_vmalloc(nvReadEncodeBufSize); + if (!pEncodedBuf) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s : failed to allocate memory for NV", __func__); + vos_mem_vfree(pnvEncodedBuf); + vos_mem_vfree(pnvEFSTable); + return VOS_STATUS_E_NOMEM; + } + } vos_mem_copy(pEncodedBuf, &pnvEncodedBuf[dataOffset], nvReadBufSize - dataOffset); @@ -1500,27 +1549,23 @@ VOS_STATUS vos_nv_open(void) return VOS_STATUS_SUCCESS; error: - vos_mem_free(pnvEFSTable); - vos_mem_free(pEncodedBuf); + vos_mem_vfree(pnvEFSTable); + vos_mem_vfree(pEncodedBuf); + vos_mem_vfree(pnvEncodedBuf); return eHAL_STATUS_FAILURE ; } VOS_STATUS vos_nv_close(void) { - VOS_STATUS status = VOS_STATUS_SUCCESS; v_CONTEXT_t pVosContext= NULL; /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); - status = hdd_release_firmware(WLAN_NV_FILE, ((VosContextType*)(pVosContext))->pHDDContext); - if ( !VOS_IS_STATUS_SUCCESS( status )) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s : vos_open failed",__func__); - return VOS_STATUS_E_FAILURE; - } - vos_mem_free(pnvEFSTable); - vos_mem_free(pEncodedBuf); + + ((hdd_context_t*)((VosContextType*)(pVosContext))->pHDDContext)->nv = NULL; + vos_mem_vfree(pnvEFSTable); + vos_mem_vfree(pEncodedBuf); vos_mem_free(pDictFile); + vos_mem_vfree(pnvEncodedBuf); gnvEFSTable=NULL; return VOS_STATUS_SUCCESS; @@ -1653,7 +1698,7 @@ VOS_STATUS vos_nv_readMultiMacAddress( v_U8_t *pMacAddress, (NULL == pMacAddress)) { VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - " Invalid Parameter from NV Client macCount %d, pMacAddress %p", + " Invalid Parameter from NV Client macCount %d, pMacAddress %pK", macCount, pMacAddress); } @@ -2721,7 +2766,6 @@ static int create_crda_regulatory_entry(struct wiphy *wiphy, continue; if (wiphy->bands[i] == NULL) { - pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); return -1; } // internal channels[] is one continous array for both 2G and 5G bands @@ -3123,6 +3167,28 @@ v_U16_t vos_chan_to_freq(v_U8_t chanNum) return (0); } + +/**------------------------------------------------------------------------ + \brief vos_freq_to_chan - + \param - input frequency to know channel number + \return Channel frequency + \sa + -------------------------------------------------------------------------*/ +v_U8_t vos_freq_to_chan(v_U32_t freq) +{ + int i; + + for (i = 0; i < NUM_RF_CHANNELS; i++) + { + if (rfChannels[i].targetFreq == freq) + { + return rfChannels[i].channelNum; + } + } + + return (0); +} + /* function to tell about if Default country is Non-Zero */ v_BOOL_t vos_is_nv_country_non_zero() { @@ -3138,8 +3204,134 @@ v_BOOL_t vos_is_nv_country_non_zero() return status ; } +v_BOOL_t vos_is_channel_valid_for_vht80(v_U32_t chan) +{ + v_CONTEXT_t pVosContext = NULL; + hdd_context_t *pHddCtx = NULL; + v_U16_t freq; + v_U32_t i, band; + struct wiphy *wiphy; + + pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if (NULL != pVosContext) + { + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (NULL == pHddCtx) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + ("Invalid pHddCtx pointer") ); + return VOS_FALSE; + } + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + ("Invalid pVosContext pointer") ); + return VOS_FALSE; + } + /* no 80Mhz in 2.4 GHz*/ + if (chan <= RF_CHAN_14) + return VOS_FALSE; + + band = IEEE80211_BAND_5GHZ; + freq = vos_chan_to_freq(chan); + wiphy = pHddCtx->wiphy; + + for (i = 0; i < wiphy->bands[band]->n_channels; i++) + { + if (freq == + wiphy->bands[band]->channels[i].center_freq) + { + if (wiphy->bands[band]->channels[i].flags & + IEEE80211_CHAN_NO_80MHZ) + { + return VOS_FALSE; + } + return VOS_TRUE; + } + } + return VOS_FALSE; +} + #ifdef CONFIG_ENABLE_LINUX_REG +static int bw20_ch_index_to_bw40_plus_minus_ch_index(int k, + eChannnelBondingTypes cbflag ) +{ + int m = INVALID_RF_CHANNEL; + if (k >= RF_CHAN_1 && k <= RF_CHAN_14) + { + if(RF_CHAN_BOND_HT40_PLUS == cbflag) + m = k - RF_CHAN_1 + RF_CHAN_BOND_3 ; + else + m = k - RF_CHAN_1 + RF_CHAN_BOND_3 - HT_40MINUS_INDEX ; + + if (m > RF_CHAN_BOND_11) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_3) + m = INVALID_RF_CHANNEL; + } + else if (k >= RF_CHAN_240 && k <= RF_CHAN_216) + { + if(RF_CHAN_BOND_HT40_PLUS == cbflag) + m = k - RF_CHAN_240 + RF_CHAN_BOND_242 ; + else + m = k - RF_CHAN_240 + RF_CHAN_BOND_242 - HT_40MINUS_INDEX; + + if (m > RF_CHAN_BOND_214) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_242) + m = INVALID_RF_CHANNEL; + } + else if (k >= RF_CHAN_36 && k <= RF_CHAN_64) + { + if(RF_CHAN_BOND_HT40_PLUS == cbflag) + m = k - RF_CHAN_36 + RF_CHAN_BOND_38; + else + m = k - RF_CHAN_36 + RF_CHAN_BOND_38 - HT_40MINUS_INDEX; + + if (m > RF_CHAN_BOND_62) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_38) + m = INVALID_RF_CHANNEL; + } +#ifdef FEATURE_WLAN_CH144 + else if (k >= RF_CHAN_100 && k <= RF_CHAN_144) +#else + else if (k >= RF_CHAN_100 && k <= RF_CHAN_140) +#endif /* FEATURE_WLAN_CH144 */ + { + if(RF_CHAN_BOND_HT40_PLUS == cbflag) + m = k - RF_CHAN_100 + RF_CHAN_BOND_102; + else + m = k - RF_CHAN_100 + RF_CHAN_BOND_102 - HT_40MINUS_INDEX; +#ifdef FEATURE_WLAN_CH144 + if (m > RF_CHAN_BOND_142) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_102) + m = INVALID_RF_CHANNEL; +#else + if (m > RF_CHAN_BOND_138) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_102) + m = INVALID_RF_CHANNEL; +#endif /* FEATURE_WLAN_CH144 */ + } + else if (k >= RF_CHAN_149 && k <= RF_CHAN_165) + { + if(RF_CHAN_BOND_HT40_PLUS == cbflag) + m = k - RF_CHAN_149 + RF_CHAN_BOND_151; + else + m = k - RF_CHAN_149 + RF_CHAN_BOND_151 - HT_40MINUS_INDEX; + + if (m > RF_CHAN_BOND_163) + m = INVALID_RF_CHANNEL; + if (m < RF_CHAN_BOND_151) + m = INVALID_RF_CHANNEL; + } + return m; +} /**------------------------------------------------------------------------ \brief vos_nv_setRegDomain - \param clientCtxt - Client Context, Not used for PRIMA @@ -3344,12 +3536,36 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, } else if (COUNTRY_IE == source || COUNTRY_USER == source) { + INIT_COMPLETION(pHddCtx->linux_reg_req); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) regulatory_hint_user(country_code,NL80211_USER_REG_HINT_USER); #else regulatory_hint_user(country_code); #endif - *pRegDomain = temp_reg_domain; + wait_result = wait_for_completion_interruptible_timeout( + &pHddCtx->linux_reg_req, + msecs_to_jiffies(LINUX_REG_WAIT_TIME)); + + /* if the country information does not exist with the kernel, + then the driver callback would not be called */ + + if (wait_result >= 0) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "runtime country code : %c%c is found in kernel db", + country_code[0], country_code[1]); + *pRegDomain = temp_reg_domain; + } + + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, + "runtime country code : %c%c is not found" + " in kernel db", + country_code[0], country_code[1]); + + return VOS_STATUS_E_EXISTS; + } } } @@ -3375,7 +3591,7 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, if (wiphy->bands[i] == NULL) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "error: wiphy->bands is NULL, i = %d", i); continue; } @@ -3399,10 +3615,6 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, n is internal channel index for corresponding 40MHz channel */ k = m + j; - n = bw20_ch_index_to_bw40_ch_index(k); - - if (n == -1) - return -1; /* If the regulatory rules for a country do not explicilty * require a passive scan on a frequency, lift the passive @@ -3429,7 +3641,11 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, * will not change channel to active. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + if (!(wiphy->regulatory_flags & REGULATORY_STRICT_REG)) +#else if (!(wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY )) +#endif { if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) { @@ -3454,8 +3670,18 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, } pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].enabled = NV_CHANNEL_DISABLE; - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = - NV_CHANNEL_DISABLE; + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k , RF_CHAN_BOND_HT40_MINUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DISABLE; + } + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k , RF_CHAN_BOND_HT40_PLUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DISABLE; + } } /* nv cannot distinguish between DFS and passive channels */ else if (wiphy->bands[i]->channels[j].flags & @@ -3473,8 +3699,26 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, channels[k].enabled = NV_CHANNEL_DFS; } + if (!gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + && !wiphy->bands[i]->channels[j].max_power) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + FL("Both NV and DB.txt power limit is zero." + "Setting default value %d"),TX_POWER_DEFAULT); + wiphy->bands[i]->channels[j].max_power = TX_POWER_DEFAULT; + } + + else if (!gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + || !wiphy->bands[i]->channels[j].max_power) + { + wiphy->bands[i]->channels[j].max_power = + MAX(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit, + ((wiphy->bands[i]->channels[j].max_power))); + } + // Cap the TX power by the power limits specified in NV for the regdomain - if (gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit) + if (gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + && wiphy->bands[i]->channels[j].max_power) { wiphy->bands[i]->channels[j].max_power = MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit, @@ -3489,22 +3733,55 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40) == IEEE80211_CHAN_NO_HT40 ) { - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + if ( INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_MINUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = NV_CHANNEL_DISABLE; + } + if ( INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_PLUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DISABLE; + } } else { - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = - NV_CHANNEL_DFS; - - /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from - * wiphy limits, since wiphy has same limits for 20MHz and 40MHz - * channels - */ - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = - MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, + if (!(wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40PLUS)) + { + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_PLUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DFS; + + /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from + * wiphy limits, since wiphy has same limits for 20MHz and 40MHz + * channels + */ + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = + MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, (tANI_S8) ((wiphy->bands[i]->channels[j].max_power-3))); - + } + } + if (!(wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40MINUS)) + { + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_MINUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DFS; + + /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from + * wiphy limits, since wiphy has same limits for 20MHz and 40MHz + * channels + */ + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = + MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, + (tANI_S8) ((wiphy->bands[i]->channels[j].max_power-3))); + } + } } if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_80MHZ) == 0) { @@ -3533,8 +3810,26 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, channels[k].enabled = NV_CHANNEL_ENABLE; } + if (!gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + && !wiphy->bands[i]->channels[j].max_power) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + FL("Both NV and DB.txt power limit is zero." + "Setting default value %d"),TX_POWER_DEFAULT); + wiphy->bands[i]->channels[j].max_power = TX_POWER_DEFAULT; + } + + else if (!gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + || !wiphy->bands[i]->channels[j].max_power) + { + wiphy->bands[i]->channels[j].max_power = + MAX(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit, + ((wiphy->bands[i]->channels[j].max_power))); + } + // Cap the TX power by the power limits specified in NV for the regdomain - if (gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit) + if (gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit + && wiphy->bands[i]->channels[j].max_power) { wiphy->bands[i]->channels[j].max_power = MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].pwrLimit, @@ -3550,21 +3845,55 @@ int vos_update_nv_table_from_wiphy_band(void *hdd_ctx, if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40) == IEEE80211_CHAN_NO_HT40 ) { - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + if ( INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_MINUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = NV_CHANNEL_DISABLE; + } + if ( INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_PLUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_DISABLE; + } } else { - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = - NV_CHANNEL_ENABLE; - - /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from - * wiphy limits, since wiphy has same limits for 20MHz and 40MHz - * channels - */ - pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = - MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, + if (!(wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40PLUS)) + { + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_PLUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_ENABLE; + + /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from + * wiphy limits, since wiphy has same limits for 20MHz and 40MHz + * channels + */ + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = + MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, (tANI_S8) ((wiphy->bands[i]->channels[j].max_power-3))); + } + } + if (!(wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40MINUS)) + { + if (INVALID_RF_CHANNEL != + (n = bw20_ch_index_to_bw40_plus_minus_ch_index( k, RF_CHAN_BOND_HT40_MINUS))) + { + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].enabled = + NV_CHANNEL_ENABLE; + + /* 40MHz channel power is half of 20MHz (-3dB), so subtract 3dB from + * wiphy limits, since wiphy has same limits for 20MHz and 40MHz + * channels + */ + pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit = + MIN(gnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[n].pwrLimit, + (tANI_S8) ((wiphy->bands[i]->channels[j].max_power-3))); + } + } } if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_80MHZ) == 0) { @@ -3637,10 +3966,10 @@ static int create_linux_regulatory_entry(struct wiphy *wiphy, * regulatory setting table. */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -void wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, +void __wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) #else -int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, +int __wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) #endif { @@ -3653,10 +3982,10 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "cfg80211 reg notifier callback for country for initiator %d", request->initiator); - if (TRUE == isWDresetInProgress()) + if (NULL == pHddCtx) { VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("SSR is in progress") ); + ("Invalid pHddCtx pointer") ); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) return; #else @@ -3664,26 +3993,18 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, #endif } - if (NULL == pHddCtx) + if (vos_is_logp_in_progress(VOS_MODULE_ID_VOSS, NULL)) { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("Invalid pHddCtx pointer") ); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + ("SSR is in progress") ); + goto do_comp; } if (WLAN_HDD_IS_UNLOAD_IN_PROGRESS(pHddCtx)) { VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, ("%s Unload is in progress"), __func__ ); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif + goto do_comp; } VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, @@ -3710,7 +4031,6 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, linux_reg_cc[0] = request->alpha2[0]; linux_reg_cc[1] = request->alpha2[1]; - complete(&pHddCtx->linux_reg_req); } else if (request->initiator == NL80211_REGDOM_SET_BY_USER || @@ -3810,7 +4130,12 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, } } } - +do_comp: + if ((request->initiator == NL80211_REGDOM_SET_BY_DRIVER) || + (request->initiator == NL80211_REGDOM_SET_BY_USER)) + { + complete(&pHddCtx->linux_reg_req); + } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) return; #else @@ -3818,6 +4143,26 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, #endif } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +void wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + vos_ssr_protect(__func__); + __wlan_hdd_linux_reg_notifier(wiphy, request); + vos_ssr_unprotect(__func__); + return; +} +#else +int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_linux_reg_notifier(wiphy, request); + vos_ssr_unprotect(__func__); + return ret; +} +#endif /* initialize wiphy from NV.bin */ VOS_STATUS vos_init_wiphy_from_nv_bin(void) @@ -3852,7 +4197,11 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) /* default country is world roaming */ reg_domain = REGDOMAIN_WORLD; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; +#else wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; +#endif } else if (REGDOMAIN_WORLD == pnvEFSTable->halnv.tables.defaultCountryTable.regDomain) { @@ -3862,7 +4211,11 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) else { reg_domain = pnvEFSTable->halnv.tables.defaultCountryTable.regDomain; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + wiphy->regulatory_flags |= REGULATORY_STRICT_REG; +#else wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; +#endif } temp_reg_domain = cur_reg_domain = reg_domain; @@ -3873,7 +4226,6 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) if (wiphy->bands[i] == NULL) { - pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); continue; } @@ -4122,10 +4474,10 @@ void* vos_nv_change_country_code_cb(void *pAdapter) * regulatory setting table. */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -void wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, +void __wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) #else -int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, +int __wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) #endif { @@ -4279,7 +4631,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, { if (NULL == wiphy->bands[i]) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "error: wiphy->bands[i] is NULL, i = %d", i); continue; } @@ -4428,4 +4780,25 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, #endif } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +void wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + vos_ssr_protect(__func__); + __wlan_hdd_crda_reg_notifier(wiphy, request); + vos_ssr_unprotect(__func__); + return; +} +#else +int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_crda_reg_notifier(wiphy, request); + vos_ssr_unprotect(__func__); + return ret; +} +#endif + #endif diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_packet.c b/drivers/staging/prima/CORE/VOSS/src/vos_packet.c index ce4501b9dbb7..097a8deec52a 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_packet.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_packet.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ Network Protocol packet/buffer support interfaces - Copyright 2009 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -61,6 +58,9 @@ #define VOS_PKT_PROT_DHCP_SRV_PORT 67 #define VOS_PKT_PROT_DHCP_CLI_PORT 68 #define VOS_PKT_PROT_EAPOL_ETH_TYPE 0x888E +#define VOS_PKT_PROT_ARP_ETH_TYPE 0x0806 +#define VOS_PKT_GET_HEAD(skb) (skb->head) +#define VOS_PKT_GET_END(skb) (skb->end) /*-------------------------------------------------------------------------- Type declarations @@ -230,7 +230,7 @@ static void vos_pkti_replenish_raw_pool(void) didOne = VOS_TRUE; VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet replenished", + "VPKT [%d]: [%pK] Packet replenished", __LINE__, pVosPacket); } @@ -256,7 +256,7 @@ static void vos_pkti_replenish_raw_pool(void) pVosPacket->timestamp = vos_timer_get_system_ticks(); VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet replenish callback", + "VPKT [%d]: [%pK] Packet replenish callback", __LINE__, pVosPacket); callback = gpVosPacketContext->rxRawLowResourceInfo.callback; @@ -775,7 +775,7 @@ VOS_STATUS vos_pkt_get_packet( vos_pkt_t **ppPacket, } VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet allocated, type %d[%s]", + "VPKT [%d]: [%pK] Packet allocated, type %d[%s]", __LINE__, pVosPacket, pktType, vos_pkti_packet_type_str(pktType)); *ppPacket = pVosPacket; @@ -959,7 +959,7 @@ VOS_STATUS vos_pkt_wrap_data_packet( vos_pkt_t **ppPacket, pVosPacket->timestamp = vos_timer_get_system_ticks(); VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet allocated, type %s", + "VPKT [%d]: [%pK] Packet allocated, type %s", __LINE__, pVosPacket, vos_pkti_packet_type_str(pktType)); *ppPacket = pVosPacket; @@ -1393,12 +1393,12 @@ VOS_STATUS vos_pkt_return_packet( vos_pkt_t *pPacket ) if(callback) { // [DEBUG] - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,"VPKT [%d]: recycle %p", __LINE__, pPacket); + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,"VPKT [%d]: recycle %pK", __LINE__, pPacket); // yes, so rather than placing the packet back in the free pool // we will invoke the low resource callback VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet recycled, type %d[%s]", + "VPKT [%d]: [%pK] Packet recycled, type %d[%s]", __LINE__, pPacket, pPacket->packetType, vos_pkti_packet_type_str(pPacket->packetType)); @@ -1424,7 +1424,7 @@ VOS_STATUS vos_pkt_return_packet( vos_pkt_t *pPacket ) // this packet does not satisfy a low resource condition // so put it back in the appropriate free pool VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "VPKT [%d]: [%p] Packet returned, type %d[%s]", + "VPKT [%d]: [%pK] Packet returned, type %d[%s]", __LINE__, pPacket, pPacket->packetType, vos_pkti_packet_type_str(pPacket->packetType)); mutex_lock(mlock); @@ -1597,6 +1597,15 @@ VOS_STATUS vos_pkt_walk_packet_chain( vos_pkt_t *pPacket, } } + +bool vos_is_pkt_chain(vos_pkt_t *pPacket) +{ + if (pPacket->pNext != NULL) + return true; + else + return false; +} + /**-------------------------------------------------------------------------- \brief vos_pkt_get_data_vector() - Get data vectors from a voss Packet @@ -2137,7 +2146,7 @@ VOS_STATUS vos_pkt_push_head( vos_pkt_t *pPacket, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "VPKT [%d]: Insufficient headroom, " - "head[%p], data[%p], req[%d]", + "head[%pK], data[%pK], req[%d]", __LINE__, skb->head, skb->data, dataSize); return VOS_STATUS_E_INVAL; } @@ -2219,7 +2228,7 @@ VOS_STATUS vos_pkt_reserve_head( vos_pkt_t *pPacket, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, "VPKT [%d]: Insufficient headroom, " - "head[%p], data[%p], req[%d]", + "head[%pK], data[%pK], req[%d]", __LINE__, skb->head, skb->data, dataSize); if ((newskb = skb_realloc_headroom(skb, dataSize)) == NULL) { @@ -2301,7 +2310,7 @@ VOS_STATUS vos_pkt_reserve_head_fast( vos_pkt_t *pPacket, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, "VPKT [%d]: Insufficient headroom, " - "head[%p], data[%p], req[%d]", + "head[%pK], data[%pK], req[%d]", __LINE__, skb->head, skb->data, dataSize); if ((newskb = skb_realloc_headroom(skb, dataSize)) == NULL) { @@ -2528,7 +2537,7 @@ VOS_STATUS vos_pkt_push_tail( vos_pkt_t *pPacket, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "VPKT [%d]: Insufficient tailroom, " - "tail[%p], end[%p], req[%d]", + "tail[%pK], end[%pK], req[%d]", __LINE__, skb_tail_pointer(skb), skb_end_pointer(skb), dataSize); return VOS_STATUS_E_INVAL; @@ -2609,7 +2618,7 @@ VOS_STATUS vos_pkt_reserve_tail( vos_pkt_t *pPacket, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "VPKT [%d]: Insufficient tailroom, " - "tail[%p], end[%p], req[%d]", + "tail[%pK], end[%pK], req[%d]", __LINE__, skb_tail_pointer(skb), skb_end_pointer(skb), dataSize); return VOS_STATUS_E_INVAL; @@ -3070,6 +3079,16 @@ v_U8_t vos_pkt_get_proto_type } } + /* ARP Tracking Enabled */ + if (VOS_PKT_PROTO_TYPE_ARP & tracking_map) + { + ether_type = (v_U16_t)(*(v_U16_t *)(skb->data + VOS_PKT_PROT_ETH_TYPE_OFFSET)); + if (VOS_PKT_PROT_ARP_ETH_TYPE == VOS_SWAP_U16(ether_type)) + { + pkt_proto_type |= VOS_PKT_PROTO_TYPE_ARP; + } + } + /* DHCP Tracking enabled */ if (VOS_PKT_PROTO_TYPE_DHCP & tracking_map) { @@ -3089,6 +3108,87 @@ v_U8_t vos_pkt_get_proto_type /* Protocol type map */ return pkt_proto_type; } + +v_PVOID_t vos_get_pkt_head(vos_pkt_t *pPacket) +{ + struct sk_buff *skb; + + // Validate the parameter pointers + if (unlikely(NULL == pPacket)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "VPKT [%d]: NULL pointer", __LINE__); + return NULL; + } + + if ( VOS_STATUS_SUCCESS != + vos_pkt_get_os_packet(pPacket, (void**)&skb, VOS_FALSE )) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "OS-PKT [%d]: OS PKT pointer is NULL", __LINE__); + return NULL; + } + + return VOS_PKT_GET_HEAD(skb); +} + +v_PVOID_t vos_get_pkt_end(vos_pkt_t *pPacket) +{ + struct sk_buff *skb; + + // Validate the parameter pointers + if (unlikely(NULL == pPacket)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "VPKT [%d]: NULL pointer", __LINE__); + return NULL; + } + + if ( VOS_STATUS_SUCCESS != + vos_pkt_get_os_packet(pPacket, (void**)&skb, VOS_FALSE )) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "OS-PKT [%d]: OS PKT pointer is NULL", __LINE__); + return NULL; + } + + /* find end point if skb->end is an offset */ +#ifdef NET_SKBUFF_DATA_USES_OFFSET + return VOS_PKT_GET_HEAD(skb) + VOS_PKT_GET_END(skb); +#else + return VOS_PKT_GET_END(skb); +#endif +} + +v_VOID_t vos_recover_tail(vos_pkt_t *pPacket) +{ + struct skb_shared_info *shinfo; + struct sk_buff *skb; + + // Validate the parameter pointers + if (unlikely(NULL == pPacket)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "VPKT [%d]: NULL pointer", __LINE__); + return; + } + + if ( VOS_STATUS_SUCCESS != + vos_pkt_get_os_packet(pPacket, (void**)&skb, VOS_FALSE )) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, + "OS-PKT [%d]: OS PKT pointer is NULL", __LINE__); + return; + } + + shinfo = skb_shinfo(skb); + memset(shinfo, 0, sizeof(struct skb_shared_info)); + atomic_set(&shinfo->dataref, 1); + kmemcheck_annotate_variable(shinfo->destructor_arg); + + return; +} + #ifdef VOS_PACKET_UNIT_TEST #include "vos_packet_test.c" #endif diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_sched.c b/drivers/staging/prima/CORE/VOSS/src/vos_sched.c index ee08a8688cb1..fc1aea4613d2 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_sched.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_sched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -29,9 +29,6 @@ @file vos_sched.c @brief VOS Scheduler Implementation - Copyright (c) 2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== EDIT HISTORY FOR FILE @@ -62,6 +59,8 @@ #include "wlan_qct_pal_msg.h" #include #include +#include + /*--------------------------------------------------------------------------- * Preprocessor Definitions and Constants * ------------------------------------------------------------------------*/ @@ -72,6 +71,12 @@ * we proceed with SSR in WD Thread */ #define MAX_SSR_WAIT_ITERATIONS 200 +/* Timer value for detecting thread stuck issues */ +#define THREAD_STUCK_TIMER_VAL 5000 // 5 seconds + +#define MC_Thread 0 +#define TX_Thread 1 +#define RX_Thread 2 static atomic_t ssr_protect_entry_count; @@ -246,16 +251,16 @@ vos_sched_open RX_THREAD_START_FAILURE: //Try and force the Tx thread controller to exit - set_bit(MC_SHUTDOWN_EVENT_MASK, &pSchedContext->txEventFlag); - set_bit(MC_POST_EVENT_MASK, &pSchedContext->txEventFlag); + set_bit(MC_SHUTDOWN_EVENT, &pSchedContext->txEventFlag); + set_bit(MC_POST_EVENT, &pSchedContext->txEventFlag); wake_up_interruptible(&pSchedContext->txWaitQueue); //Wait for TX to exit wait_for_completion_interruptible(&pSchedContext->TxShutdown); TX_THREAD_START_FAILURE: //Try and force the Main thread controller to exit - set_bit(MC_SHUTDOWN_EVENT_MASK, &pSchedContext->mcEventFlag); - set_bit(MC_POST_EVENT_MASK, &pSchedContext->mcEventFlag); + set_bit(MC_SHUTDOWN_EVENT, &pSchedContext->mcEventFlag); + set_bit(MC_POST_EVENT, &pSchedContext->mcEventFlag); wake_up_interruptible(&pSchedContext->mcWaitQueue); //Wait for MC to exit wait_for_completion_interruptible(&pSchedContext->McShutdown); @@ -301,6 +306,7 @@ VOS_STATUS vos_watchdog_open // Initialize the lock spin_lock_init(&pWdContext->wdLock); + spin_lock_init(&pWdContext->thread_stuck_lock); //Create the Watchdog thread pWdContext->WdThread = kthread_create(VosWDThread, pWdContext,"VosWDThread"); @@ -385,8 +391,8 @@ VosMCThread { // This implements the execution model algorithm retWaitStatus = wait_event_interruptible(pSchedContext->mcWaitQueue, - test_bit(MC_POST_EVENT_MASK, &pSchedContext->mcEventFlag) || - test_bit(MC_SUSPEND_EVENT_MASK, &pSchedContext->mcEventFlag)); + test_bit(MC_POST_EVENT, &pSchedContext->mcEventFlag) || + test_bit(MC_SUSPEND_EVENT, &pSchedContext->mcEventFlag)); if(retWaitStatus == -ERESTARTSYS) { @@ -394,18 +400,18 @@ VosMCThread "%s: wait_event_interruptible returned -ERESTARTSYS", __func__); break; } - clear_bit(MC_POST_EVENT_MASK, &pSchedContext->mcEventFlag); + clear_bit(MC_POST_EVENT, &pSchedContext->mcEventFlag); while(1) { // Check if MC needs to shutdown - if(test_bit(MC_SHUTDOWN_EVENT_MASK, &pSchedContext->mcEventFlag)) + if(test_bit(MC_SHUTDOWN_EVENT, &pSchedContext->mcEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: MC thread signaled to shutdown", __func__); shutdown = VOS_TRUE; /* Check for any Suspend Indication */ - if (test_and_clear_bit(MC_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(MC_SUSPEND_EVENT, &pSchedContext->mcEventFlag)) { /* Unblock anyone waiting on suspend */ @@ -423,9 +429,6 @@ VosMCThread /* ** Service the WDI message queue */ - VOS_TRACE(VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, - ("Servicing the VOS MC WDI Message queue")); - pMsgWrapper = vos_mq_get(&pSchedContext->wdiMcMq); if (pMsgWrapper == NULL) @@ -601,15 +604,13 @@ VosMCThread continue; } /* Check for any Suspend Indication */ - if (test_and_clear_bit(MC_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(MC_SUSPEND_EVENT, &pSchedContext->mcEventFlag)) { spin_lock(&pSchedContext->McThreadLock); - + INIT_COMPLETION(pSchedContext->ResumeMcEvent); /* Mc Thread Suspended */ complete(&pHddCtx->mc_sus_event_var); - - INIT_COMPLETION(pSchedContext->ResumeMcEvent); spin_unlock(&pSchedContext->McThreadLock); /* Wait foe Resume Indication */ @@ -624,20 +625,6 @@ VosMCThread complete_and_exit(&pSchedContext->McShutdown, 0); } /* VosMCThread() */ -v_BOOL_t isWDresetInProgress(void) -{ - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "%s: Reset is in Progress...",__func__); - if(gpVosWatchdogContext!=NULL) - { - return gpVosWatchdogContext->resetInProgress; - } - else - { - return FALSE; - } -} - v_BOOL_t isSsrPanicOnFailure(void) { hdd_context_t *pHddCtx = NULL; @@ -661,6 +648,115 @@ v_BOOL_t isSsrPanicOnFailure(void) return (pHddCtx->cfg_ini->fIsSsrPanicOnFailure); } +/** + * vos_wd_detect_thread_stuck()- Detect thread stuck + * by probing the MC, TX, RX threads and take action if + * Thread doesnt respond. + * + * This function is called to detect thread stuck + * and probe threads. + * + * Return: void + */ +static void vos_wd_detect_thread_stuck(void) +{ + unsigned long flags; + + spin_lock_irqsave(&gpVosWatchdogContext->thread_stuck_lock, flags); + + if (gpVosWatchdogContext->mcThreadStuckCount || + gpVosWatchdogContext->txThreadStuckCount || + gpVosWatchdogContext->rxThreadStuckCount) + { + spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock, flags); + + hddLog(LOG1, FL("MC Count %d RX count %d TX count %d"), + gpVosWatchdogContext->mcThreadStuckCount, + gpVosWatchdogContext->rxThreadStuckCount, + gpVosWatchdogContext->txThreadStuckCount); + + if (gpVosWatchdogContext->mcThreadStuckCount) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Invoking dump stack for MC thread",__func__); + vos_dump_stack(MC_Thread); + } + if (gpVosWatchdogContext->txThreadStuckCount) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Invoking dump stack for TX thread",__func__); + vos_dump_stack(TX_Thread); + } + if (gpVosWatchdogContext->rxThreadStuckCount) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Invoking dump stack for RX thread",__func__); + vos_dump_stack(RX_Thread); + } + + spin_lock_irqsave(&gpVosWatchdogContext->thread_stuck_lock, flags); + } + + /* Increment the thread stuck count for all threads */ + gpVosWatchdogContext->mcThreadStuckCount++; + gpVosWatchdogContext->txThreadStuckCount++; + gpVosWatchdogContext->rxThreadStuckCount++; + + spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock, flags); + vos_probe_threads(); + + /* Restart the timer */ + if (VOS_STATUS_SUCCESS != + vos_timer_start(&gpVosWatchdogContext->threadStuckTimer, + THREAD_STUCK_TIMER_VAL)) + hddLog(LOGE, FL("Unable to start thread stuck timer")); +} + +/** + * wlan_wd_detect_thread_stuck_cb()- Call back of the + * thread stuck timer. + * @priv: timer data. + * This function is called when the thread stuck timer + * expire to detect thread stuck and probe threads. + * + * Return: void + */ +static void vos_wd_detect_thread_stuck_cb(void *priv) +{ + if (!(vos_is_logp_in_progress(VOS_MODULE_ID_SYS, NULL) || + vos_is_load_unload_in_progress(VOS_MODULE_ID_SYS, NULL))) + { + set_bit(WD_WLAN_DETECT_THREAD_STUCK, + &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_POST_EVENT, &gpVosWatchdogContext->wdEventFlag); + wake_up_interruptible(&gpVosWatchdogContext->wdWaitQueue); + } +} + +/** + * wlan_logging_reset_thread_stuck_count()- Callback to + * probe msg sent to Threads. + * + * @threadId: passed threadid + * + * This function is called to by the thread after + * processing the probe msg, with their own thread id. + * + * Return: void. + */ +void vos_wd_reset_thread_stuck_count(int threadId) +{ + unsigned long flags; + + spin_lock_irqsave(&gpVosWatchdogContext->thread_stuck_lock, flags); + if (vos_sched_is_mc_thread(threadId)) + gpVosWatchdogContext->mcThreadStuckCount = 0; + else if (vos_sched_is_tx_thread(threadId)) + gpVosWatchdogContext->txThreadStuckCount = 0; + else if (vos_sched_is_rx_thread(threadId)) + gpVosWatchdogContext->rxThreadStuckCount = 0; + spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock, flags); +} /*--------------------------------------------------------------------------- \brief VosWdThread() - The VOSS Watchdog thread @@ -712,6 +808,21 @@ VosWDThread #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) daemonize("WD_Thread"); #endif + /* Initialize the timer to detect thread stuck issues */ + if (vos_timer_init_deferrable(&pWdContext->threadStuckTimer, + VOS_TIMER_TYPE_SW, + vos_wd_detect_thread_stuck_cb, NULL)) { + hddLog(LOGE, FL("Unable to initialize thread stuck timer")); + } + else + { + if (VOS_STATUS_SUCCESS != + vos_timer_start(&pWdContext->threadStuckTimer, + THREAD_STUCK_TIMER_VAL)) + hddLog(LOGE, FL("Unable to start thread stuck timer")); + else + hddLog(LOG1, FL("Successfully started thread stuck timer")); + } /* ** Ack back to the context from which the Watchdog thread has been @@ -725,14 +836,14 @@ VosWDThread { // This implements the Watchdog execution model algorithm retWaitStatus = wait_event_interruptible(pWdContext->wdWaitQueue, - test_bit(WD_POST_EVENT_MASK, &pWdContext->wdEventFlag)); + test_bit(WD_POST_EVENT, &pWdContext->wdEventFlag)); if(retWaitStatus == -ERESTARTSYS) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: wait_event_interruptible returned -ERESTARTSYS", __func__); break; } - clear_bit(WD_POST_EVENT_MASK, &pWdContext->wdEventFlag); + clear_bit(WD_POST_EVENT, &pWdContext->wdEventFlag); while(1) { /* Check for any Active Entry Points @@ -763,21 +874,20 @@ VosWDThread __func__, atomic_read(&ssr_protect_entry_count)); } // Check if Watchdog needs to shutdown - if(test_bit(WD_SHUTDOWN_EVENT_MASK, &pWdContext->wdEventFlag)) + if(test_bit(WD_SHUTDOWN_EVENT, &pWdContext->wdEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: Watchdog thread signaled to shutdown", __func__); - - clear_bit(WD_SHUTDOWN_EVENT_MASK, &pWdContext->wdEventFlag); + clear_bit(WD_SHUTDOWN_EVENT, &pWdContext->wdEventFlag); shutdown = VOS_TRUE; break; } /* subsystem restart: shutdown event handler */ - else if(test_bit(WD_WLAN_SHUTDOWN_EVENT_MASK, &pWdContext->wdEventFlag)) + else if(test_bit(WD_WLAN_SHUTDOWN_EVENT, &pWdContext->wdEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Watchdog thread signaled to perform WLAN shutdown",__func__); - clear_bit(WD_WLAN_SHUTDOWN_EVENT_MASK, &pWdContext->wdEventFlag); + clear_bit(WD_WLAN_SHUTDOWN_EVENT, &pWdContext->wdEventFlag); //Perform WLAN shutdown if(!pWdContext->resetInProgress) @@ -795,11 +905,11 @@ VosWDThread } } /* subsystem restart: re-init event handler */ - else if(test_bit(WD_WLAN_REINIT_EVENT_MASK, &pWdContext->wdEventFlag)) + else if(test_bit(WD_WLAN_REINIT_EVENT, &pWdContext->wdEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Watchdog thread signaled to perform WLAN re-init",__func__); - clear_bit(WD_WLAN_REINIT_EVENT_MASK, &pWdContext->wdEventFlag); + clear_bit(WD_WLAN_REINIT_EVENT, &pWdContext->wdEventFlag); //Perform WLAN re-init if(!pWdContext->resetInProgress) @@ -820,11 +930,19 @@ VosWDThread else { pWdContext->isFatalError = false; + pHddCtx->isLogpInProgress = FALSE; + vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); } atomic_set(&pHddCtx->isRestartInProgress, 0); pWdContext->resetInProgress = false; complete(&pHddCtx->ssr_comp_var); } + /* Post Msg to detect thread stuck */ + else if(test_and_clear_bit(WD_WLAN_DETECT_THREAD_STUCK, + &pWdContext->wdEventFlag)) + { + vos_wd_detect_thread_stuck(); + } else { //Unnecessary wakeup - Should never happen!! @@ -835,6 +953,7 @@ VosWDThread } // while message loop processing } // while shutdown + vos_timer_destroy(&pWdContext->threadStuckTimer); // If we get here the Watchdog thread must exit VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: Watchdog Thread exiting !!!!", __func__); @@ -909,8 +1028,8 @@ static int VosTXThread ( void * Arg ) { // This implements the execution model algorithm retWaitStatus = wait_event_interruptible(pSchedContext->txWaitQueue, - test_bit(TX_POST_EVENT_MASK, &pSchedContext->txEventFlag) || - test_bit(TX_SUSPEND_EVENT_MASK, &pSchedContext->txEventFlag)); + test_bit(TX_POST_EVENT, &pSchedContext->txEventFlag) || + test_bit(TX_SUSPEND_EVENT, &pSchedContext->txEventFlag)); if(retWaitStatus == -ERESTARTSYS) @@ -919,17 +1038,17 @@ static int VosTXThread ( void * Arg ) "%s: wait_event_interruptible returned -ERESTARTSYS", __func__); break; } - clear_bit(TX_POST_EVENT_MASK, &pSchedContext->txEventFlag); + clear_bit(TX_POST_EVENT, &pSchedContext->txEventFlag); while(1) { - if(test_bit(TX_SHUTDOWN_EVENT_MASK, &pSchedContext->txEventFlag)) + if(test_bit(TX_SHUTDOWN_EVENT, &pSchedContext->txEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: TX thread signaled to shutdown", __func__); shutdown = VOS_TRUE; /* Check for any Suspend Indication */ - if (test_and_clear_bit(TX_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(TX_SUSPEND_EVENT, &pSchedContext->txEventFlag)) { /* Unblock anyone waiting on suspend */ @@ -1019,17 +1138,14 @@ static int VosTXThread ( void * Arg ) continue; } /* Check for any Suspend Indication */ - if (test_and_clear_bit(TX_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(TX_SUSPEND_EVENT, &pSchedContext->txEventFlag)) { spin_lock(&pSchedContext->TxThreadLock); - + INIT_COMPLETION(pSchedContext->ResumeTxEvent); /* Tx Thread Suspended */ complete(&pHddCtx->tx_sus_event_var); - - INIT_COMPLETION(pSchedContext->ResumeTxEvent); spin_unlock(&pSchedContext->TxThreadLock); - /* Wait foe Resume Indication */ wait_for_completion_interruptible(&pSchedContext->ResumeTxEvent); } @@ -1105,8 +1221,8 @@ static int VosRXThread ( void * Arg ) { // This implements the execution model algorithm retWaitStatus = wait_event_interruptible(pSchedContext->rxWaitQueue, - test_bit(RX_POST_EVENT_MASK, &pSchedContext->rxEventFlag) || - test_bit(RX_SUSPEND_EVENT_MASK, &pSchedContext->rxEventFlag)); + test_bit(RX_POST_EVENT, &pSchedContext->rxEventFlag) || + test_bit(RX_SUSPEND_EVENT, &pSchedContext->rxEventFlag)); if(retWaitStatus == -ERESTARTSYS) @@ -1115,17 +1231,17 @@ static int VosRXThread ( void * Arg ) "%s: wait_event_interruptible returned -ERESTARTSYS", __func__); break; } - clear_bit(RX_POST_EVENT_MASK, &pSchedContext->rxEventFlag); + clear_bit(RX_POST_EVENT, &pSchedContext->rxEventFlag); while(1) { - if(test_bit(RX_SHUTDOWN_EVENT_MASK, &pSchedContext->rxEventFlag)) + if(test_bit(RX_SHUTDOWN_EVENT, &pSchedContext->rxEventFlag)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: RX thread signaled to shutdown", __func__); shutdown = VOS_TRUE; /* Check for any Suspend Indication */ - if (test_and_clear_bit(RX_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(RX_SUSPEND_EVENT, &pSchedContext->rxEventFlag)) { /* Unblock anyone waiting on suspend */ @@ -1221,15 +1337,13 @@ static int VosRXThread ( void * Arg ) } /* Check for any Suspend Indication */ - if (test_and_clear_bit(RX_SUSPEND_EVENT_MASK, + if (test_and_clear_bit(RX_SUSPEND_EVENT, &pSchedContext->rxEventFlag)) { spin_lock(&pSchedContext->RxThreadLock); - + INIT_COMPLETION(pSchedContext->ResumeRxEvent); /* Rx Thread Suspended */ complete(&pHddCtx->rx_sus_event_var); - - INIT_COMPLETION(pSchedContext->ResumeRxEvent); spin_unlock(&pSchedContext->RxThreadLock); /* Wait for Resume Indication */ @@ -1273,24 +1387,24 @@ VOS_STATUS vos_sched_close ( v_PVOID_t pVosContext ) } // shut down MC Thread - set_bit(MC_SHUTDOWN_EVENT_MASK, &gpVosSchedContext->mcEventFlag); - set_bit(MC_POST_EVENT_MASK, &gpVosSchedContext->mcEventFlag); + set_bit(MC_SHUTDOWN_EVENT, &gpVosSchedContext->mcEventFlag); + set_bit(MC_POST_EVENT, &gpVosSchedContext->mcEventFlag); wake_up_interruptible(&gpVosSchedContext->mcWaitQueue); //Wait for MC to exit wait_for_completion(&gpVosSchedContext->McShutdown); gpVosSchedContext->McThread = 0; // shut down TX Thread - set_bit(TX_SHUTDOWN_EVENT_MASK, &gpVosSchedContext->txEventFlag); - set_bit(TX_POST_EVENT_MASK, &gpVosSchedContext->txEventFlag); + set_bit(TX_SHUTDOWN_EVENT, &gpVosSchedContext->txEventFlag); + set_bit(TX_POST_EVENT, &gpVosSchedContext->txEventFlag); wake_up_interruptible(&gpVosSchedContext->txWaitQueue); //Wait for TX to exit wait_for_completion(&gpVosSchedContext->TxShutdown); gpVosSchedContext->TxThread = 0; // shut down RX Thread - set_bit(RX_SHUTDOWN_EVENT_MASK, &gpVosSchedContext->rxEventFlag); - set_bit(RX_POST_EVENT_MASK, &gpVosSchedContext->rxEventFlag); + set_bit(RX_SHUTDOWN_EVENT, &gpVosSchedContext->rxEventFlag); + set_bit(RX_POST_EVENT, &gpVosSchedContext->rxEventFlag); wake_up_interruptible(&gpVosSchedContext->rxWaitQueue); //Wait for RX to exit wait_for_completion(&gpVosSchedContext->RxShutdown); @@ -1317,8 +1431,8 @@ VOS_STATUS vos_watchdog_close ( v_PVOID_t pVosContext ) "%s: gpVosWatchdogContext is NULL",__func__); return VOS_STATUS_E_FAILURE; } - set_bit(WD_SHUTDOWN_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); - set_bit(WD_POST_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_SHUTDOWN_EVENT, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_POST_EVENT, &gpVosWatchdogContext->wdEventFlag); wake_up_interruptible(&gpVosWatchdogContext->wdWaitQueue); //Wait for Watchdog thread to exit wait_for_completion(&gpVosWatchdogContext->WdShutdown); @@ -1575,7 +1689,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) while( NULL != (pMsgWrapper = vos_mq_get(&pSchedContext->sysMcMq) )) { VOS_TRACE( VOS_MODULE_ID_VOSS, - VOS_TRACE_LEVEL_ERROR, + VOS_TRACE_LEVEL_INFO, "%s: Freeing MC SYS message type %d ",__func__, pMsgWrapper->pVosMsg->type ); sysMcFreeMsg(pSchedContext->pVContext, pMsgWrapper->pVosMsg); @@ -1586,7 +1700,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) { if(pMsgWrapper->pVosMsg != NULL) { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: Freeing MC WDA MSG message type %d", __func__, pMsgWrapper->pVosMsg->type ); if (pMsgWrapper->pVosMsg->bodyptr) { @@ -1605,7 +1719,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) { if(pMsgWrapper->pVosMsg != NULL) { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: Freeing MC WDI MSG message type %d", __func__, pMsgWrapper->pVosMsg->type ); @@ -1638,7 +1752,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) while( NULL != (pMsgWrapper = vos_mq_get(&pSchedContext->peMcMq) )) { VOS_TRACE( VOS_MODULE_ID_VOSS, - VOS_TRACE_LEVEL_ERROR, + VOS_TRACE_LEVEL_INFO, "%s: Freeing MC PE MSG message type %d",__func__, pMsgWrapper->pVosMsg->type ); peFreeMsg(vosCtx->pMACContext, (tSirMsgQ*)pMsgWrapper->pVosMsg); @@ -1648,7 +1762,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) while( NULL != (pMsgWrapper = vos_mq_get(&pSchedContext->smeMcMq) )) { VOS_TRACE( VOS_MODULE_ID_VOSS, - VOS_TRACE_LEVEL_ERROR, + VOS_TRACE_LEVEL_INFO, "%s: Freeing MC SME MSG message type %d", __func__, pMsgWrapper->pVosMsg->type ); sme_FreeMsg(vosCtx->pMACContext, pMsgWrapper->pVosMsg); @@ -1658,7 +1772,7 @@ void vos_sched_flush_mc_mqs ( pVosSchedContext pSchedContext ) while( NULL != (pMsgWrapper = vos_mq_get(&pSchedContext->tlMcMq) )) { VOS_TRACE( VOS_MODULE_ID_VOSS, - VOS_TRACE_LEVEL_ERROR, + VOS_TRACE_LEVEL_INFO, "%s: Freeing MC TL message type %d",__func__, pMsgWrapper->pVosMsg->type ); WLANTL_McFreeMsg(pSchedContext->pVContext, pMsgWrapper->pVosMsg); @@ -1800,6 +1914,24 @@ int vos_sched_is_rx_thread(int threadID) } return ((gpVosSchedContext->RxThread) && (threadID == gpVosSchedContext->RxThread->pid)); } + +/*------------------------------------------------------------------------- + This helper function helps determine if thread id is of MC thread + ------------------------------------------------------------------------*/ +int vos_sched_is_mc_thread(int threadID) +{ + // Make sure that Vos Scheduler context has been initialized + VOS_ASSERT( NULL != gpVosSchedContext); + if (gpVosSchedContext == NULL) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: gpVosSchedContext == NULL",__func__); + return 0; + } + return ((gpVosSchedContext->McThread) && + (threadID == gpVosSchedContext->McThread->pid)); +} + /*------------------------------------------------------------------------- Helper function to get the scheduler context ------------------------------------------------------------------------*/ @@ -1907,6 +2039,7 @@ VOS_STATUS vos_watchdog_wlan_shutdown(void) /* wcnss has crashed, and SSR has alredy been started by Kernel driver. * So disable SSR from WLAN driver */ hdd_set_ssr_required( HDD_SSR_DISABLED ); + /* Release the lock here before returning */ spin_unlock(&gpVosWatchdogContext->wdLock); return VOS_STATUS_E_FAILURE; @@ -1928,8 +2061,8 @@ VOS_STATUS vos_watchdog_wlan_shutdown(void) } #endif - set_bit(WD_WLAN_SHUTDOWN_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); - set_bit(WD_POST_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_WLAN_SHUTDOWN_EVENT, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_POST_EVENT, &gpVosWatchdogContext->wdEventFlag); wake_up_interruptible(&gpVosWatchdogContext->wdWaitQueue); return VOS_STATUS_SUCCESS; @@ -1951,8 +2084,8 @@ VOS_STATUS vos_watchdog_wlan_shutdown(void) VOS_STATUS vos_watchdog_wlan_re_init(void) { /* watchdog task is still running, it is not closed in shutdown */ - set_bit(WD_WLAN_REINIT_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); - set_bit(WD_POST_EVENT_MASK, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_WLAN_REINIT_EVENT, &gpVosWatchdogContext->wdEventFlag); + set_bit(WD_POST_EVENT, &gpVosWatchdogContext->wdEventFlag); wake_up_interruptible(&gpVosWatchdogContext->wdWaitQueue); return VOS_STATUS_SUCCESS; @@ -1972,8 +2105,6 @@ void vos_ssr_protect(const char *caller_func) { int count; count = atomic_inc_return(&ssr_protect_entry_count); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: ENTRY ACTIVE %d", caller_func, count); } /** @@ -1988,6 +2119,36 @@ void vos_ssr_unprotect(const char *caller_func) { int count; count = atomic_dec_return(&ssr_protect_entry_count); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: ENTRY INACTIVE %d", caller_func, count); +} +/** + * vos_is_wd_thread()- Check if threadid is + * of Watchdog thread + * + * @threadId: passed threadid + * + * This function is called to check if threadid is + * of wd thread. + * + * Return: true if threadid is of wd thread. + */ +bool vos_is_wd_thread(int threadId) +{ + return ((gpVosWatchdogContext->WdThread) && + (threadId == gpVosWatchdogContext->WdThread->pid)); +} + +void vos_dump_stack(uint8_t thread_id) +{ + switch (thread_id) + { + case MC_Thread: + wcnss_dump_stack(gpVosSchedContext->McThread); + case TX_Thread: + wcnss_dump_stack(gpVosSchedContext->TxThread); + case RX_Thread: + wcnss_dump_stack(gpVosSchedContext->RxThread); + default: + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid thread invoked",__func__); + } } diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_sched.h b/drivers/staging/prima/CORE/VOSS/src/vos_sched.h index 5e4da95b29a5..f1b680e9e291 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_sched.h +++ b/drivers/staging/prima/CORE/VOSS/src/vos_sched.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ by vOSS. - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -77,21 +74,26 @@ #include "i_vos_packet.h" #include #include +#include + + +#define TX_POST_EVENT 0x000 +#define TX_SUSPEND_EVENT 0x001 +#define MC_POST_EVENT 0x000 +#define MC_SUSPEND_EVENT 0x001 +#define RX_POST_EVENT 0x000 +#define RX_SUSPEND_EVENT 0x001 +#define TX_SHUTDOWN_EVENT 0x002 +#define MC_SHUTDOWN_EVENT 0x002 +#define RX_SHUTDOWN_EVENT 0x002 + +#define WD_POST_EVENT 0x000 +#define WD_SHUTDOWN_EVENT 0x001 +#define WD_CHIP_RESET_EVENT 0x002 +#define WD_WLAN_SHUTDOWN_EVENT 0x003 +#define WD_WLAN_REINIT_EVENT 0x004 +#define WD_WLAN_DETECT_THREAD_STUCK 0x005 -#define TX_POST_EVENT_MASK 0x001 -#define TX_SUSPEND_EVENT_MASK 0x002 -#define MC_POST_EVENT_MASK 0x001 -#define MC_SUSPEND_EVENT_MASK 0x002 -#define RX_POST_EVENT_MASK 0x001 -#define RX_SUSPEND_EVENT_MASK 0x002 -#define TX_SHUTDOWN_EVENT_MASK 0x010 -#define MC_SHUTDOWN_EVENT_MASK 0x010 -#define RX_SHUTDOWN_EVENT_MASK 0x010 -#define WD_POST_EVENT_MASK 0x001 -#define WD_SHUTDOWN_EVENT_MASK 0x002 -#define WD_CHIP_RESET_EVENT_MASK 0x004 -#define WD_WLAN_SHUTDOWN_EVENT_MASK 0x008 -#define WD_WLAN_REINIT_EVENT_MASK 0x010 @@ -263,6 +265,14 @@ typedef struct _VosWatchdogContext /* Lock for preventing multiple reset being triggered simultaneously */ spinlock_t wdLock; + /* Timer to detect thread stuck issue */ + vos_timer_t threadStuckTimer; + /* Count for each thread to determine thread stuck */ + unsigned int mcThreadStuckCount; + unsigned int txThreadStuckCount; + unsigned int rxThreadStuckCount; + /* lock to synchronize access to the thread stuck counts */ + spinlock_t thread_stuck_lock; } VosWatchdogContext, *pVosWatchdogContext; @@ -337,6 +347,11 @@ typedef struct _VosContextType /* NV BIN Version */ eNvVersionType nvVersion; + /* Roam delay statistic enabled in ini*/ + v_U8_t roamDelayStatsEnabled; + + /*Fw log complete Event*/ + vos_event_t fwLogsComplete; } VosContextType, *pVosContextType; @@ -347,6 +362,7 @@ typedef struct _VosContextType int vos_sched_is_tx_thread(int threadID); int vos_sched_is_rx_thread(int threadID); +int vos_sched_is_mc_thread(int threadID); /*--------------------------------------------------------------------------- \brief vos_sched_open() - initialize the vOSS Scheduler @@ -485,6 +501,7 @@ VOS_STATUS vos_watchdog_close ( v_PVOID_t pVosContext ); VOS_STATUS vos_mq_init(pVosMqType pMq); void vos_mq_deinit(pVosMqType pMq); void vos_mq_put(pVosMqType pMq, pVosMsgWrapper pMsgWrapper); +void vos_mq_put_front(pVosMqType pMq, pVosMsgWrapper pMsgWrapper); pVosMsgWrapper vos_mq_get(pVosMqType pMq); v_BOOL_t vos_is_mq_empty(pVosMqType pMq); pVosSchedContext get_vos_sched_ctxt(void); @@ -499,9 +516,12 @@ void clearWlanResetReason(void); void vos_timer_module_init( void ); VOS_STATUS vos_watchdog_wlan_shutdown(void); VOS_STATUS vos_watchdog_wlan_re_init(void); -v_BOOL_t isWDresetInProgress(void); v_BOOL_t isSsrPanicOnFailure(void); void vos_ssr_protect(const char *caller_func); void vos_ssr_unprotect(const char *caller_func); +void vos_wd_reset_thread_stuck_count(int threadId); +bool vos_is_wd_thread(int threadId); +void vos_dump_stack(uint8_t value); + #endif // #if !defined __VOSS_SCHED_H diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_threads.c b/drivers/staging/prima/CORE/VOSS/src/vos_threads.c index cec787b7af20..df6f7beaeb83 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_threads.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_threads.c @@ -31,9 +31,6 @@ \brief virtual Operating System Services (vOSS) Threading APIs - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_timer.c b/drivers/staging/prima/CORE/VOSS/src/vos_timer.c index 73f80bd5b46c..b0305a8521db 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_timer.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2015-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -215,7 +215,16 @@ static void vos_linux_timer_callback (unsigned long data) if(vos_rx_mq_serialize( VOS_MQ_ID_SYS, &msg ) == VOS_STATUS_SUCCESS) return; } - else +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE + else if (vos_is_wd_thread(threadId)) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, + "TIMER callback: running on wd thread"); + callback(NULL); + return; + } +#endif + else { VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "TIMER callback: running on MC thread"); @@ -228,7 +237,7 @@ static void vos_linux_timer_callback (unsigned long data) if(vos_mq_post_message( VOS_MQ_ID_SYS, &msg ) == VOS_STATUS_SUCCESS) return; - } + } VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: Could not enqueue timer to any queue", __func__); @@ -400,16 +409,20 @@ void vos_timer_exit() ---------------------------------------------------------------------------*/ #ifdef TIMER_MANAGER -VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, - vos_timer_callback_t callback, v_PVOID_t userData, - char* fileName, v_U32_t lineNum ) +static inline VOS_STATUS __vos_timer_init_debug(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData, + bool deferrable, + char* fileName, + v_U32_t lineNum) { VOS_STATUS vosStatus; unsigned long flags; // Check for invalid pointer - if ((timer == NULL) || (callback == NULL)) + if ((timer == NULL) || (callback == NULL)) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: Null params being passed",__func__); VOS_ASSERT(0); return VOS_STATUS_E_FAULT; @@ -417,10 +430,11 @@ VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, timer->ptimerNode = vos_mem_malloc(sizeof(timer_node_t)); - if(timer->ptimerNode == NULL) + if (timer->ptimerNode == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Not able to allocate memory for timeNode",__func__); + "%s: Not able to allocate memory for timeNode", + __func__); VOS_ASSERT(0); return VOS_STATUS_E_FAULT; } @@ -434,16 +448,21 @@ VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, spin_lock_irqsave(&vosTimerList.lock, flags); vosStatus = hdd_list_insert_front(&vosTimerList, &timer->ptimerNode->pNode); spin_unlock_irqrestore(&vosTimerList.lock, flags); - if(VOS_STATUS_SUCCESS != vosStatus) + if (VOS_STATUS_SUCCESS != vosStatus) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Unable to insert node into List vosStatus %d", __func__, vosStatus); + "%s: Unable to insert node into List vosStatus %d", + __func__, vosStatus); } - - // set the various members of the timer structure - // with arguments passed or with default values + + /* set the various members of the timer structure + * with arguments passed or with default values + */ spin_lock_init(&timer->platformInfo.spinlock); - init_timer(&(timer->platformInfo.Timer)); + if(deferrable) + init_timer_deferrable(&(timer->platformInfo.Timer)); + else + init_timer(&(timer->platformInfo.Timer)); timer->platformInfo.Timer.function = vos_linux_timer_callback; timer->platformInfo.Timer.data = (unsigned long)timer; timer->callback = callback; @@ -452,26 +471,55 @@ VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType, timer->platformInfo.cookie = LINUX_TIMER_COOKIE; timer->platformInfo.threadID = 0; timer->state = VOS_TIMER_STATE_STOPPED; - + return VOS_STATUS_SUCCESS; } + +VOS_STATUS vos_timer_init_debug(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData, + char* fileName, + v_U32_t lineNum) +{ + return __vos_timer_init_debug(timer, timerType, + callback, userData, false, fileName, lineNum); +} + +VOS_STATUS vos_timer_init_deferrable_debug(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData, + char* fileName, + v_U32_t lineNum) +{ + return __vos_timer_init_debug(timer, timerType, + callback, userData, true, fileName, lineNum); +} #else -VOS_STATUS vos_timer_init( vos_timer_t *timer, VOS_TIMER_TYPE timerType, - vos_timer_callback_t callback, v_PVOID_t userData ) +static inline VOS_STATUS __vos_timer_init(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData, + bool deferrable) { - // Check for invalid pointer - if ((timer == NULL) || (callback == NULL)) + /* Check for invalid pointer */ + if ((timer == NULL) || (callback == NULL)) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: Null params being passed",__func__); VOS_ASSERT(0); return VOS_STATUS_E_FAULT; } - - // set the various members of the timer structure - // with arguments passed or with default values + + /* set the various members of the timer structure + * with arguments passed or with default values + */ spin_lock_init(&timer->platformInfo.spinlock); - init_timer(&(timer->platformInfo.Timer)); + if(deferrable) + init_timer_deferrable(&(timer->platformInfo.Timer)); + else + init_timer(&(timer->platformInfo.Timer)); timer->platformInfo.Timer.function = vos_linux_timer_callback; timer->platformInfo.Timer.data = (unsigned long)timer; timer->callback = callback; @@ -483,6 +531,24 @@ VOS_STATUS vos_timer_init( vos_timer_t *timer, VOS_TIMER_TYPE timerType, return VOS_STATUS_SUCCESS; } +VOS_STATUS vos_timer_init(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData) +{ + return __vos_timer_init(timer, timerType, + callback, userData, false); + +} + +VOS_STATUS vos_timer_init_deferrable(vos_timer_t *timer, + VOS_TIMER_TYPE timerType, + vos_timer_callback_t callback, + v_PVOID_t userData) +{ + return __vos_timer_init(timer, timerType, + callback, userData, true); +} #endif @@ -689,7 +755,7 @@ VOS_STATUS vos_timer_start( vos_timer_t *timer, v_U32_t expirationTime ) unsigned long flags; VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "Timer Addr inside voss_start : 0x%p ", timer ); + "Timer Addr inside voss_start : 0x%pK ", timer ); // Check for invalid pointer if ( NULL == timer ) @@ -784,7 +850,7 @@ VOS_STATUS vos_timer_stop ( vos_timer_t *timer ) unsigned long flags; VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: Timer Addr inside voss_stop : 0x%p",__func__,timer ); + "%s: Timer Addr inside voss_stop : 0x%pK",__func__,timer ); // Check for invalid pointer if ( NULL == timer ) @@ -870,3 +936,24 @@ v_TIME_t vos_timer_get_system_time( v_VOID_t ) do_gettimeofday(&tv); return tv.tv_sec*1000 + tv.tv_usec/1000; } + +/*-------------------------------------------------------------------------- + + \brief vos_timer_is_initialized() - check if timer is initialized or not + + The \a vos_timer_is_initialized() function returns VOS_TRUE if timer is + initialized and VOS_FALSE if timer is not initialized + + \returns - VOS_TRUE or VOS_FALSE + + \sa + + ------------------------------------------------------------------------*/ +v_BOOL_t vos_timer_is_initialized(vos_timer_t *timer) +{ + if (LINUX_TIMER_COOKIE == timer->platformInfo.cookie) + return VOS_TRUE; + else + return VOS_FALSE; +} + diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_trace.c b/drivers/staging/prima/CORE/VOSS/src/vos_trace.c index 253d1330114f..8c8beea965e1 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_trace.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_trace.c @@ -33,9 +33,6 @@ Trace, logging, and debugging definitions and APIs - Copyright 2008,2011 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -102,6 +99,8 @@ moduleTraceInfo gVosTraceInfo[ VOS_MODULE_ID_MAX ] = [VOS_MODULE_ID_BAP] = { VOS_DEFAULT_TRACE_LEVEL, "BAP" }, [VOS_MODULE_ID_TL] = { VOS_DEFAULT_TRACE_LEVEL, "TL " }, [VOS_MODULE_ID_WDI] = { VOS_DEFAULT_TRACE_LEVEL, "WDI" }, + [VOS_MODULE_ID_SVC] = { VOS_DEFAULT_TRACE_LEVEL, "SVC" }, + [VOS_MODULE_ID_RSV4] = { VOS_DEFAULT_TRACE_LEVEL, "RS4" }, [VOS_MODULE_ID_HDD] = { VOS_DEFAULT_TRACE_LEVEL, "HDD" }, [VOS_MODULE_ID_SME] = { VOS_DEFAULT_TRACE_LEVEL, "SME" }, [VOS_MODULE_ID_PE] = { VOS_DEFAULT_TRACE_LEVEL, "PE " }, @@ -269,8 +268,7 @@ void vos_trace_msg( VOS_MODULE_ID module, VOS_TRACE_LEVEL level, char *strFormat va_start(val, strFormat); // print the prefix string into the string buffer... - n = snprintf(strBuffer, VOS_TRACE_BUFFER_SIZE, "wlan: [%d:%2s:%3s] ", - in_interrupt() ? 0 : current->pid, + n = snprintf(strBuffer, VOS_TRACE_BUFFER_SIZE, "wlan: [%2s:%3s] ", (char *) TRACE_LEVEL_STR[ level ], (char *) gVosTraceInfo[ module ].moduleNameStr ); @@ -591,7 +589,7 @@ void vosTraceDumpAll(void *pMac, v_U8_t code, v_U8_t session, return; } - VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO, "Total Records: %d, Head: %d, Tail: %d", gvosTraceData.num, gvosTraceData.head, gvosTraceData.tail); diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_types.c b/drivers/staging/prima/CORE/VOSS/src/vos_types.c index 6445b4729053..52de3ad8e7f7 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_types.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_types.c @@ -33,9 +33,6 @@ Basic type definitions - Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_utils.c b/drivers/staging/prima/CORE/VOSS/src/vos_utils.c index 58f12c504b41..834b21b9b164 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_utils.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_utils.c @@ -44,9 +44,6 @@ DEPENDENCIES: - Copyright (c) 2007 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ============================================================================*/ /*============================================================================ @@ -61,12 +58,14 @@ #include "vos_trace.h" #include "vos_utils.h" #include "vos_memory.h" +#include #include #include #include #include #include +#include #include /*---------------------------------------------------------------------------- @@ -726,7 +725,14 @@ v_U8_t vos_chan_to_band(v_U32_t chan) return VOS_BAND_5GHZ; } -#ifdef DEBUG_ROAM_DELAY +void vos_get_wlan_unsafe_channel(v_U16_t *unsafeChannelList, + v_U16_t buffer_size, v_U16_t *unsafeChannelCount) +{ + /* Get unsafe channel list from cached location */ + wcnss_get_wlan_unsafe_channel(unsafeChannelList, buffer_size, + unsafeChannelCount); +} + #include #include "vos_timer.h" @@ -739,7 +745,7 @@ v_U8_t vos_chan_to_band(v_U32_t chan) //Define gRoamDelayMetaInfo tRoamDelayMetaInfo gRoamDelayMetaInfo = {0}; -tRoamDelayMetaInfo gRoamDelayTable[ROAM_DELAY_TABLE_SIZE]; +tRoamDelayMetaInfo *gpRoamDelayTable = NULL; v_BOOL_t gRoamDelayCurrentIndex = 0; #define VOS_ETHERTYPE_802_1_X ( 0x888E ) @@ -806,8 +812,51 @@ v_BOOL_t vos_skb_is_eapol(struct sk_buff *skb, return fEAPOL; } +v_BOOL_t vos_roam_delay_stats_init(void) +{ + if (gpRoamDelayTable == NULL) + { + gpRoamDelayTable = vmalloc(sizeof(tRoamDelayMetaInfo) * ROAM_DELAY_TABLE_SIZE); + if (gpRoamDelayTable == NULL) + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "Memory allocation failed"); + return VOS_FALSE; + } + } + else + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "Memory is already allocated"); + return VOS_FALSE; + } + + return VOS_TRUE; +} + + +v_BOOL_t vos_roam_delay_stats_deinit(void) +{ + if (gpRoamDelayTable != NULL) + { + vfree(gpRoamDelayTable); + gpRoamDelayTable = NULL; + } + else + { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "Memory is already freed"); + return VOS_FALSE; + } + + return VOS_TRUE; +} + void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG_t buff_len) { + if (gpRoamDelayTable == NULL) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "Roam delay table is not initialized\n"); + return; + } switch(roam_event) { case e_HDD_DISABLE_TX_QUEUE: @@ -893,14 +942,14 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG { if(gRoamDelayMetaInfo.hdd_eapol_m2 == 0) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"HDD XMIT m2"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"HDD XMIT m2"); gRoamDelayMetaInfo.hdd_eapol_m2 = vos_timer_get_system_time(); gRoamDelayMetaInfo.dxe_monitor_tx = MONITOR_START; } else if((gRoamDelayMetaInfo.hdd_eapol_m2) && (gRoamDelayMetaInfo.hdd_eapol_m4 == 0)) { gRoamDelayMetaInfo.hdd_eapol_m4 = vos_timer_get_system_time(); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"HDD XMIT m4"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"HDD XMIT m4"); gRoamDelayMetaInfo.hdd_monitor_tx = MONITOR_EAPOL_DONE; //We should return from here so can cache the time for first data pkt return; @@ -946,13 +995,13 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG { if(gRoamDelayMetaInfo.hdd_eapol_m1 == 0) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"HDD recv m1"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"HDD recv m1"); gRoamDelayMetaInfo.hdd_eapol_m1 = vos_timer_get_system_time(); } else if((gRoamDelayMetaInfo.hdd_eapol_m1) && (gRoamDelayMetaInfo.hdd_eapol_m3 == 0)) { gRoamDelayMetaInfo.hdd_eapol_m3 = vos_timer_get_system_time(); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"HDD recv m3"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"HDD recv m3"); gRoamDelayMetaInfo.hdd_monitor_rx = MONITOR_EAPOL_DONE; } } @@ -997,13 +1046,13 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG { if(gRoamDelayMetaInfo.dxe_eapol_m1 == 0) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"DXE recv m1"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"DXE recv m1"); gRoamDelayMetaInfo.dxe_eapol_m1 = vos_timer_get_system_time(); } else if((gRoamDelayMetaInfo.dxe_eapol_m1) && (gRoamDelayMetaInfo.dxe_eapol_m3 == 0)) { gRoamDelayMetaInfo.dxe_eapol_m3 = vos_timer_get_system_time(); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"DXE recv m3"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"DXE recv m3"); gRoamDelayMetaInfo.dxe_monitor_rx = MONITOR_EAPOL_DONE; } } @@ -1056,13 +1105,13 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG { if(gRoamDelayMetaInfo.dxe_eapol_m2 == 0) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"DXE XMIT m2"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"DXE XMIT m2"); gRoamDelayMetaInfo.dxe_eapol_m2 = vos_timer_get_system_time(); } else if((gRoamDelayMetaInfo.dxe_eapol_m2) && (gRoamDelayMetaInfo.dxe_eapol_m4 == 0)) { gRoamDelayMetaInfo.dxe_eapol_m4 = vos_timer_get_system_time(); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,"DXE XMIT m4"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"DXE XMIT m4"); gRoamDelayMetaInfo.dxe_monitor_tx = MONITOR_EAPOL_DONE; //We should return from here so can cache the time for first data pkt return; @@ -1105,7 +1154,7 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG //Let us copy roam meta info if(gRoamDelayCurrentIndex > ROAM_DELAY_TABLE_SIZE) gRoamDelayCurrentIndex = 0; - vos_mem_copy(&gRoamDelayTable[gRoamDelayCurrentIndex++], + vos_mem_copy(&gpRoamDelayTable[gRoamDelayCurrentIndex++], &gRoamDelayMetaInfo, sizeof(gRoamDelayMetaInfo)); vos_mem_set(&gRoamDelayMetaInfo, sizeof(gRoamDelayMetaInfo), 0); break; @@ -1118,46 +1167,55 @@ void vos_record_roam_event(enum e_roaming_event roam_event, void *pBuff, v_ULONG void vos_reset_roam_timer_log(void) { - //Set zero to whole gRoamDelayTable - vos_mem_set(&gRoamDelayTable, (sizeof(gRoamDelayMetaInfo) * ROAM_DELAY_TABLE_SIZE), 0); + if (gpRoamDelayTable != NULL) + { + //Set zero to whole gpRoamDelayTable + vos_mem_set(gpRoamDelayTable, (sizeof(tRoamDelayMetaInfo) * ROAM_DELAY_TABLE_SIZE), 0); + } } void vos_dump_roam_time_log_service(void) { v_SLONG_t slA, slB, slC, slD, slE, slF, slG, slH, slI, slJ, slK, slL, slM, slRoamDelay; tRoamDelayMetaInfo currentRoamDelayInfo; - v_ULONG_t index = 0; + v_ULONG_t index = 0,i=0; - //Let us first copy the current gRoamDelayMetaInfo into gRoamDelayTable + if (gpRoamDelayTable == NULL) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "Roam delay table is not initialized\n"); + return; + } + //Let us first copy the current gRoamDelayMetaInfo into gpRoamDelayTable if(gRoamDelayCurrentIndex > ROAM_DELAY_TABLE_SIZE) gRoamDelayCurrentIndex = 0; - vos_mem_copy(&gRoamDelayTable[gRoamDelayCurrentIndex++], &gRoamDelayMetaInfo, sizeof(gRoamDelayMetaInfo)); + vos_mem_copy(&gpRoamDelayTable[gRoamDelayCurrentIndex++], &gRoamDelayMetaInfo, sizeof(gRoamDelayMetaInfo)); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "** RoamDelay = ( B + C + D + E + ABS(F) + H + J + L + M )\n"); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "** RoamDelay = ( dxe_first_tx_time - disable_tx_queues_time)\n"); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||========================" "===============|====== A ======|====== B ======|====== C ======|" "====== D ======|====== E ======|====== F ======|====== G ======|" "====== H ======|====== I ======|====== J ======|====== K ======|" "====== L ======|====== M ======||\n"); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||Sl | Peer MAC address |" " **RoamDelay** | PreAuth Timer | Disassoc Issue| Add BSS Req |" " AddBssRsp to | ReassocReq to | ReassocRsp to | Disable to |" " M1-M2 DXE SW | M1-M2 HDD SW | M3-M4 DXE SW | M3-M4 HDD SW |" " ReassocRsp to | HDD to DXE ||\n"); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||No.| |" " ************* | to Roam Start | to Complete | to Rsp time |" " Reassoc Req | ReassocRsp | Enable Tx Que | Enable Tx Que |" " | | | |" " Set GTK | 1st data frame||\n"); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||========================" "================================================================" "================================================================" @@ -1166,7 +1224,7 @@ void vos_dump_roam_time_log_service(void) for (index = 0; index < gRoamDelayCurrentIndex; index++) { - currentRoamDelayInfo = gRoamDelayTable[index]; + currentRoamDelayInfo = gpRoamDelayTable[index]; /* PreAuth Timer to Roam Start */ slA = (currentRoamDelayInfo.preauth_cb_time - currentRoamDelayInfo.preauth_reassoc_start_time); @@ -1220,10 +1278,10 @@ void vos_dump_roam_time_log_service(void) currentRoamDelayInfo.hdd_first_xmit_time); /* Calculate roam delay */ - slRoamDelay= slB + slC + slD + slE + ((slF<0)?-slF:slF) + - slH + slJ + slL + slM; + slRoamDelay = (currentRoamDelayInfo.dxe_first_tx_time - + currentRoamDelayInfo.disable_tx_queues_time); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||%2ld:|<"MAC_ADDRESS_STR">|" "%14ld |%14ld |%14ld |%14ld |" "%14ld |%14ld |%14ld |%14ld |" @@ -1236,13 +1294,177 @@ void vos_dump_roam_time_log_service(void) slL, slM ); } - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "||========================" "================================================================" "================================================================" "================================================================" "===============================||\n"); -} -#endif /* DEBUG_ROAM_DELAY */ + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||== More Details =====================" + "===============================||\n"); + + for (index = 0; index < gRoamDelayCurrentIndex; index++) + { + currentRoamDelayInfo = gpRoamDelayTable[index]; + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||%2ld: Peer Mac: <"MAC_ADDRESS_STR">\n", + (index+1), MAC_ADDR_ARRAY(currentRoamDelayInfo.peer_mac_addr) + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||preauth_reassoc_start_time : %14ld\n", + currentRoamDelayInfo.preauth_reassoc_start_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||preauth_cb_time : %14ld\n", + currentRoamDelayInfo.preauth_cb_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||disable_tx_queues_time : %14ld\n", + currentRoamDelayInfo.disable_tx_queues_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||disassoc_issue_time : %14ld\n", + currentRoamDelayInfo.disassoc_issue_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||lim_add_bss_req_time : %14ld\n", + currentRoamDelayInfo.lim_add_bss_req_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||lim_add_bss_rsp_time : %14ld\n", + currentRoamDelayInfo.lim_add_bss_rsp_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||disassoc_comp_time : %14ld\n", + currentRoamDelayInfo.disassoc_comp_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||send_reassoc_req_time : %14ld\n", + currentRoamDelayInfo.send_reassoc_req_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_sendassoc_rsp_time : %14ld\n", + currentRoamDelayInfo.hdd_sendassoc_rsp_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||enable_tx_queues_time : %14ld\n", + currentRoamDelayInfo.enable_tx_queues_reassoc_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_eapol_m1 : %14ld\n", + currentRoamDelayInfo.hdd_eapol_m1 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_eapol_m2 : %14ld\n", + currentRoamDelayInfo.hdd_eapol_m2 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_eapol_m3 : %14ld\n", + currentRoamDelayInfo.hdd_eapol_m3 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_eapol_m4 : %14ld\n", + currentRoamDelayInfo.hdd_eapol_m4 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||dxe_eapol_m1 : %14ld\n", + currentRoamDelayInfo.dxe_eapol_m1 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||dxe_eapol_m2 : %14ld\n", + currentRoamDelayInfo.dxe_eapol_m2 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||dxe_eapol_m3 : %14ld\n", + currentRoamDelayInfo.dxe_eapol_m3 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||dxe_eapol_m4 : %14ld\n", + currentRoamDelayInfo.dxe_eapol_m4 + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||set_ptk_roam_key_time : %14ld\n", + currentRoamDelayInfo.set_ptk_roam_key_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||set_gtk_roam_key_time : %14ld\n", + currentRoamDelayInfo.set_gtk_roam_key_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||tl_fetch_pkt_time : %14ld\n", + currentRoamDelayInfo.tl_fetch_pkt_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_first_xmit_time : %14ld\n", + currentRoamDelayInfo.hdd_first_xmit_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||dxe_first_tx_time : %14ld\n", + currentRoamDelayInfo.dxe_first_tx_time + ); + + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "||hdd_first_pkt_data : \n" + ); + + + for (i=0; idpuFeedback) + (DPU_FEEDBACK_WPI_UNPROTECTED == ((WDI_DS_RxMetaInfoType *)_pvBDHeader)->dpuFeedback) /*========================================================================== @@ -341,7 +341,9 @@ tANI_U8 WLANHAL_RxBD_GetFrameTypeSubType(v_PVOID_t _pvBDHeader, tANI_U16 usFrmCt #define HAL_RELIABLE_MCAST_REQUESTED_MASK 0x100 -#define HAL_USE_BD_RATE_MASK 0x1000 +#define HAL_USE_BD_RATE_1_MASK 0x1000 // bit 12 for BD RATE 1 +#define HAL_USE_BD_RATE_2_MASK 0x2000 // bit 13 for BD RATE 1 +#define HAL_USE_BD_RATE_3_MASK 0x4000 // bit 14 for BD RATE 1 #define HAL_USE_FW_IN_TX_PATH 0x200 //bit 9 to send via WQ5 /*========================================================================== diff --git a/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda.h b/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda.h index 536c8ae006da..69ae3e88e2a2 100644 --- a/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda.h +++ b/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -124,17 +124,14 @@ typedef enum eWDA_AUTH_TYPE_WAPI_WAI_PSK, eWDA_AUTH_TYPE_CCKM_WPA, eWDA_AUTH_TYPE_CCKM_RSN, - eWDA_AUTH_TYPE_WPA_NONE, - eWDA_AUTH_TYPE_AUTOSWITCH, - eWDA_AUTH_TYPE_SHARED_KEY, - eWDA_NUM_OF_SUPPORT_AUTH_TYPE, - eWDA_AUTH_TYPE_FAILED = 0xff, - eWDA_AUTH_TYPE_UNKNOWN = eCSR_AUTH_TYPE_FAILED, + eWDA_AUTH_TYPE_RSN_PSK_SHA256, + eWDA_AUTH_TYPE_RSN_8021X_SHA256, }WDA_AuthType; #define IS_FW_IN_TX_PATH_FEATURE_ENABLE ((WDI_getHostWlanFeatCaps(FW_IN_TX_PATH)) & (WDA_getFwWlanFeatCaps(FW_IN_TX_PATH))) #define IS_MUMIMO_BFORMEE_CAPABLE ((WDI_getHostWlanFeatCaps(MU_MIMO)) & (WDA_getFwWlanFeatCaps(MU_MIMO))) #define IS_FEATURE_BCN_FLT_DELTA_ENABLE ((WDI_getHostWlanFeatCaps(BCN_IE_FLT_DELTA)) & (WDA_getFwWlanFeatCaps(BCN_IE_FLT_DELTA))) +#define IS_FEATURE_FW_STATS_ENABLE ((WDI_getHostWlanFeatCaps(FW_STATS)) & (WDA_getFwWlanFeatCaps(FW_STATS))) /*-------------------------------------------------------------------------- Utilities --------------------------------------------------------------------------*/ @@ -171,6 +168,7 @@ typedef enum #define IS_ADVANCE_TDLS_ENABLE 0 #endif #define IS_HT40_OBSS_SCAN_FEATURE_ENABLE ((WDA_getFwWlanFeatCaps(HT40_OBSS_SCAN)) & (WDI_getHostWlanFeatCaps(HT40_OBSS_SCAN))) +#define IS_FRAME_LOGGING_SUPPORTED_BY_FW WDA_getFwWlanFeatCaps(MGMT_FRAME_LOGGING) typedef enum { MODE_11A = 0, /* 11a Mode */ @@ -218,6 +216,10 @@ typedef enum { (pwda_channel)->reg_info_1 &= 0xff00ffff; \ (pwda_channel)->reg_info_1 |= ((val&0xff) << 16); \ } while(0) +#define WDA_SET_CUURENT_REG_DOMAIN(pwda_channel, val) do { \ + (pwda_channel)->reg_info_2 |= ((val&0x7) << 24); \ + (pwda_channel)->reg_info_2 |= 0x80000000; \ + } while(0) #define WDA_SET_CHANNEL_MIN_POWER(pwlan_hal_update_channel,val) do { \ (pwlan_hal_update_channel)->reg_info_1 &= 0xffffff00; \ (pwlan_hal_update_channel)->reg_info_1 |= (val&0xff); \ @@ -377,7 +379,7 @@ typedef void (*pWDATxRxCompFunc)( v_PVOID_t pContext, void *pData ); //callback function for TX complete //parameter 1 - global pMac pointer //parameter 2 - txComplete status : 1- success, 0 - failure. -typedef eHalStatus (*pWDAAckFnTxComp)(tpAniSirGlobal, tANI_U32); +typedef eHalStatus (*pWDAAckFnTxComp)(tpAniSirGlobal, void *pData); typedef struct { @@ -429,6 +431,8 @@ typedef struct wpt_uint8 wdaAddSelfStaFailReason; } tWDA_AddSelfStaDebugParams; +#define BMPS_IMPS_FAILURE_REPORT_THRESHOLD 10 + typedef struct { v_PVOID_t pVosContext; /* global VOSS context*/ @@ -497,6 +501,7 @@ typedef struct vos_event_t ftmStopDoneEvent; tWDA_AddSelfStaDebugParams wdaAddSelfStaParams; + wpt_uint8 mgmtTxfailureCnt; } tWDA_CbContext ; @@ -507,6 +512,15 @@ typedef struct v_PVOID_t wdaWdiApiMsgParam; /* WDI API paramter tracking */ } tWDA_ReqParams; +typedef struct +{ + v_PVOID_t pWdaContext; /* pointer to WDA context*/ + v_PVOID_t wdaMsgParam; /* PE parameter tracking */ + v_PVOID_t wdaWdiApiMsgParam; /* WDI API paramter tracking */ + v_BOOL_t wdaHALDumpAsync; /* Async Request */ + +} tWDA_HalDumpReqParams; + /* * FUNCTION: WDA_open * open WDA context @@ -590,7 +604,9 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, pWDATxRxCompFunc pCompFunc, void *pData, pWDAAckFnTxComp pAckTxComp, - tANI_U32 txFlag); + tANI_U32 txFlag, + tANI_U32 txBdToken + ); /* * FUNCTION: WDA_PostMsgApi @@ -619,9 +635,6 @@ tBssSystemRole wdaGetGlobalSystemRole(tpAniSirGlobal pMac); #define WDA_TL_TX_SUSPEND_SUCCESS 0 #define WDA_TL_TX_SUSPEND_FAILURE 1 -// FIXME Temporary value for R33D integaration -//#define WDA_TL_TX_FRAME_TIMEOUT 20000 /* in msec a very high upper limit */ - #define DPU_FEEDBACK_UNPROTECTED_ERROR 0x0F @@ -751,9 +764,15 @@ tBssSystemRole wdaGetGlobalSystemRole(tpAniSirGlobal pMac); # define WDA_IS_RX_LLC_PRESENT(pRxMeta) \ ( (0 == ((WDI_DS_RxMetaInfoType*)(pRxMeta))->llcr) ? VOS_TRUE : VOS_FALSE ) +# define WDA_IS_LOGGING_DATA(pRxMeta) \ + ((0 == ((WDI_DS_RxMetaInfoType*)(pRxMeta))->loggingData) ? VOS_FALSE \ + : VOS_TRUE) + #define WLANWDA_HO_IS_AN_AMPDU 0x4000 #define WLANWDA_HO_LAST_MPDU_OF_AMPDU 0x400 +#define WDA_MAX_MGMT_MPDU_LEN 2000 + /* WDA_IS_RX_AN_AMPDU ********************************************************/ # define WDA_IS_RX_AN_AMPDU(pRxMeta) \ ( ((WDI_DS_RxMetaInfoType*)(pRxMeta))->rxpFlags & WLANWDA_HO_IS_AN_AMPDU ) @@ -891,6 +910,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_TL_FLUSH_AC_RSP SIR_HAL_TL_FLUSH_AC_RSP #define WDA_MSG_TYPES_BEGIN SIR_HAL_MSG_TYPES_BEGIN +#define WDA_EXT_MSG_TYPES_BEGIN SIR_HAL_EXT_MSG_TYPES_BEGIN #define WDA_ITC_MSG_TYPES_BEGIN SIR_HAL_ITC_MSG_TYPES_BEGIN #define WDA_RADAR_DETECTED_IND SIR_HAL_RADAR_DETECTED_IND #define WDA_WDT_KAM_RSP SIR_HAL_WDT_KAM_RSP @@ -987,6 +1007,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_DELBA_IND SIR_HAL_DELBA_IND #define WDA_DEL_BA_IND SIR_HAL_DEL_BA_IND #define WDA_MIC_FAILURE_IND SIR_HAL_MIC_FAILURE_IND +#define WDA_LOST_LINK_PARAMS_IND SIR_HAL_LOST_LINK_PARAMS_IND //message from sme to initiate delete block ack session. #define WDA_DELBA_REQ SIR_HAL_DELBA_REQ @@ -1179,6 +1200,8 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_GET_ROAM_RSSI_REQ SIR_HAL_GET_ROAM_RSSI_REQ #define WDA_GET_ROAM_RSSI_RSP SIR_HAL_GET_ROAM_RSSI_RSP +#define WDA_NAN_REQUEST SIR_HAL_NAN_REQUEST + #define WDA_START_SCAN_OFFLOAD_REQ SIR_HAL_START_SCAN_OFFLOAD_REQ #define WDA_START_SCAN_OFFLOAD_RSP SIR_HAL_START_SCAN_OFFLOAD_RSP #define WDA_STOP_SCAN_OFFLOAD_REQ SIR_HAL_STOP_SCAN_OFFLOAD_REQ @@ -1224,6 +1247,12 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_SET_TDLS_CHAN_SWITCH_REQ SIR_HAL_TDLS_CHAN_SWITCH_REQ #define WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP SIR_HAL_TDLS_CHAN_SWITCH_REQ_RSP #endif + +#define WDA_FW_STATS_GET_REQ SIR_HAL_FW_STATS_GET_REQ +#define WDA_SET_RTS_CTS_HTVHT SIR_HAL_SET_RTS_CTS_HTVHT +#define WDA_MON_START_REQ SIR_HAL_MON_START_REQ +#define WDA_MON_STOP_REQ SIR_HAL_MON_STOP_REQ + tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); eHalStatus WDA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, @@ -1255,6 +1284,16 @@ eHalStatus WDA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, #endif /* WLAN_FEATURE_EXTSCAN */ #define WDA_SPOOF_MAC_ADDR_REQ SIR_HAL_SPOOF_MAC_ADDR_REQ +#define WDA_SPOOF_MAC_ADDR_RSP SIR_HAL_SPOOF_MAC_ADDR_RSP + +#define WDA_MGMT_LOGGING_INIT_REQ SIR_HAL_MGMT_LOGGING_INIT_REQ +#define WDA_GET_FRAME_LOG_REQ SIR_HAL_GET_FRAME_LOG_REQ +#define WDA_SEND_LOG_DONE_IND SIR_HAL_SEND_LOG_DONE_IND + +#define WDA_FATAL_EVENT_LOGS_REQ SIR_HAL_FATAL_EVENT_LOGS_REQ + +#define WDA_SEND_FREQ_RANGE_CONTROL_IND SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND + #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames @@ -1269,9 +1308,10 @@ eHalStatus WDA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, (pCompFunc),\ (pData),\ (NULL), \ - (txFlag)) ) + (txFlag), \ + (0)) ) -#define halTxFrameWithTxComplete(hHal, pFrmBuf, frmLen, frmType, txDir, tid, pCompFunc, pData, pCBackFnTxComp, txFlag) \ +#define halTxFrameWithTxComplete(hHal, pFrmBuf, frmLen, frmType, txDir, tid, pCompFunc, pData, pCBackFnTxComp, txFlag, txBdToken) \ (eHalStatus)( WDA_TxPacket(\ vos_get_context(VOS_MODULE_ID_WDA, vos_get_global_context(VOS_MODULE_ID_WDA, (hHal))),\ (pFrmBuf),\ @@ -1282,7 +1322,8 @@ eHalStatus WDA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, (pCompFunc),\ (pData),\ (pCBackFnTxComp), \ - (txFlag)) ) + (txFlag), \ + (txBdToken)) ) /* ----------------------------------------------------------------- WDA data path API's for TL @@ -1529,7 +1570,8 @@ WDA_DS_BuildTxPacketInfo v_U32_t txFlag, v_U32_t timeStamp, v_U8_t ucIsEapol, - v_U8_t ucUP + v_U8_t ucUP, + v_U32_t ucTxBdToken ); /*========================================================================== @@ -1900,11 +1942,12 @@ WDA_DS_GetTxFlowMask IN pMac MAC global pointer - cmd Hal dump command - arg1 Dump command argument 1 - arg2 Dump command argument 2 - arg3 Dump command argument 3 - arg4 Dump command argument 4 + cmd Hal dump command + arg1 Dump command argument 1 + arg2 Dump command argument 2 + arg3 Dump command argument 3 + arg4 Dump command argument 4 + async Asynchronous event. Doesn't wait for rsp. OUT pBuffer Dump command Response buffer @@ -1918,7 +1961,7 @@ WDA_DS_GetTxFlowMask ============================================================================*/ VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac,tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, - tANI_U32 arg4, tANI_U8 *pBuffer); + tANI_U32 arg4, tANI_U8 *pBuffer, wpt_boolean async); /*========================================================================== FUNCTION WDA_featureCapsExchange @@ -2021,6 +2064,22 @@ void WDA_TransportChannelDebug v_U8_t debugFlags ); +/*========================================================================== + FUNCTION WDA_TransportKickDxe + + DESCRIPTION + Request Kick DXE when first hdd TX time out + happens + + PARAMETERS + NONE + + RETURN VALUE + NONE + +===========================================================================*/ +void WDA_TransportKickDxe(void); + /*========================================================================== FUNCTION WDA_TrafficStatsTimerActivate @@ -2049,4 +2108,7 @@ void WDA_TrafficStatsTimerActivate(wpt_boolean activate); ===========================================================================*/ void WDA_SetEnableSSR(v_BOOL_t enableSSR); + + +void WDA_FWLoggingDXEdoneInd(void); #endif diff --git a/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda_msg.h b/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda_msg.h index a670b7c2268f..67d2666d0b0c 100644 --- a/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda_msg.h +++ b/drivers/staging/prima/CORE/WDA/inc/wlan_qct_wda_msg.h @@ -38,8 +38,6 @@ DESCRIPTION This file contains the external API exposed by the wlan adaptation layer - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c index 58e71f1e0f3e..0817a5ca4c24 100644 --- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c +++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -37,9 +37,6 @@ DEPENDENCIES: Are listed for each API below. - Copyright (c) 2010-2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== EDIT HISTORY FOR FILE @@ -88,6 +85,13 @@ #define CONVERT_WDI2SIR_STATUS(x) \ ((WDI_STATUS_SUCCESS != (x)) ? eSIR_FAILURE : eSIR_SUCCESS) +/* Threshold to print tx time taken in ms*/ +#define WDA_TX_TIME_THRESHOLD 1000 +/* Recover with ssr if tx timeouts continuously + * for threshold number of times. + */ +#define WDA_TX_FAILURE_RECOVERY_THRESHOLD 3 + #define IS_WDI_STATUS_FAILURE(status) \ ((WDI_STATUS_SUCCESS != (status)) && (WDI_STATUS_PENDING != (status))) #define CONVERT_WDI2VOS_STATUS(x) \ @@ -253,8 +257,84 @@ VOS_STATUS WDA_ProcessLLStatsClearReq(tWDA_CbContext *pWDA, tSirLLStatsClearReq *wdaRequest); #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +v_VOID_t WDA_ProcessFWStatsGetReq(tWDA_CbContext *pWDA, + tSirFWStatsGetReq *wdaRequest); + VOS_STATUS WDA_ProcessEncryptMsgReq(tWDA_CbContext *pWDA, u8 *wdaRequest); +VOS_STATUS +WDA_ProcessSetRtsCtsHTVhtInd(tWDA_CbContext *pWDA, + tANI_U32 val); + + +VOS_STATUS WDA_ProcessMonStartReq( tWDA_CbContext *pWDA, void* wdaRequest); +VOS_STATUS WDA_ProcessMonStopReq( tWDA_CbContext *pWDA, void* wdaRequest); +VOS_STATUS WDA_ProcessEnableDisableCAEventInd(tWDA_CbContext *pWDA, tANI_U8 val); +/* + * FUNCTION: WDA_ProcessNanRequest + * Process NAN request + */ +VOS_STATUS WDA_ProcessNanRequest(tWDA_CbContext *pWDA, + tNanRequest *wdaRequest) +{ + WDI_Status status = WDI_STATUS_SUCCESS; + tWDA_ReqParams *pWdaParams; + WDI_NanRequestType *wdiRequest = NULL; + size_t wdiReqLength = sizeof(WDI_NanRequestType) + - sizeof(wdiRequest->request_data) + + wdaRequest->request_data_len; + + wdiRequest = (WDI_NanRequestType *)vos_mem_malloc(wdiReqLength); + + if (NULL == wdiRequest) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure, size : %zu", __func__, + wdiReqLength); + vos_mem_free(wdaRequest); + return VOS_STATUS_E_NOMEM; + } + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "WDA: Process Nan Request length: %zu", wdiReqLength); + + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure for tWDA_ReqParams", __func__); + VOS_ASSERT(0); + vos_mem_free(wdaRequest); + vos_mem_free(wdiRequest); + return VOS_STATUS_E_NOMEM; + } + + wdiRequest->request_data_len = wdaRequest->request_data_len; + + vos_mem_copy( wdiRequest->request_data, + wdaRequest->request_data, + wdaRequest->request_data_len); + + vos_mem_free(wdaRequest); + + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = NULL; + pWdaParams->wdaWdiApiMsgParam = wdiRequest; + + status = WDI_NanRequest(wdiRequest, pWdaParams); + + if (IS_WDI_STATUS_FAILURE(status)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure to request. Free all the memory " ); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams); + } + + return CONVERT_WDI2VOS_STATUS(status) ; +} + + /* * FUNCTION: WDA_open @@ -267,10 +347,12 @@ VOS_STATUS WDA_open(v_PVOID_t pVosContext, v_PVOID_t devHandle, VOS_STATUS status; WDI_DeviceCapabilityType wdiDevCapability = {0} ; /* Allocate WDA context */ - status = vos_alloc_context(pVosContext, VOS_MODULE_ID_WDA, + status = vos_alloc_context(pVosContext, VOS_MODULE_ID_WDA, (v_VOID_t **)&wdaContext, sizeof(tWDA_CbContext)) ; if(!VOS_IS_STATUS_SUCCESS(status)) { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: Failed to " + "allocate context for WDA - status = %d",__func__, status); return VOS_STATUS_E_NOMEM; } /*__asm int 3;*/ @@ -527,6 +609,11 @@ VOS_STATUS WDA_start(v_PVOID_t pVosContext) { wdaContext->wdaTimersCreated = VOS_TRUE; } + else + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + FL("wda create timers failed")); + } } else { @@ -2069,6 +2156,156 @@ VOS_STATUS WDA_prepareConfigTLV(v_PVOID_t pVosContext, tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + sizeof(tHalCfg) + tlvStruct->length) ; + /* QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF */ + tlvStruct->type = QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_BTC_FAST_WLAN_CONN_PREF, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_BTC_FAST_WLAN_CONN_PREF"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT */ + tlvStruct->type = QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_RTSCTS_HTVHT, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_ENABLE_RTSCTS_HTVHT"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + + /* QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN */ + tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN */ + tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_LINK_FAIL_TIMEOUT */ + tlvStruct->type = QWLAN_HAL_CFG_LINK_FAIL_TIMEOUT ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_LINK_FAIL_TIMEOUT, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_LINK_FAIL_TIMEOUT"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_LINK_FAIL_TX_CNT */ + tlvStruct->type = QWLAN_HAL_CFG_LINK_FAIL_TX_CNT ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_LINK_FAIL_TX_CNT, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_LINK_FAIL_TX_CNT"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT */ + tlvStruct->type = QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT ; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + if (wlan_cfgGetInt(pMac, WNI_CFG_OPTIMIZE_CA_EVENT, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_OPTIMIZE_CA_EVENT"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES */ + tlvStruct->type = QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_TOGGLE_ARP_BDRATES, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_TOGGLE_ARP_BDRATES"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE */ + tlvStruct->type = QWLAN_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_SAR_BOFFSET_SET_CORRECTION, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_SAR_BOFFSET_SET_CORRECTION"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + + /* QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE */ + tlvStruct->type = QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE; + tlvStruct->length = sizeof(tANI_U32); + configDataValue = (tANI_U32 *)(tlvStruct + 1); + + if (wlan_cfgGetInt(pMac, WNI_CFG_DISABLE_BAR_WAKE_UP_HOST, + configDataValue ) != eSIR_SUCCESS) + { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_DISABLE_BAR_WAKE_UP_HOST"); + goto handle_failure; + } + tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct + + sizeof(tHalCfg) + tlvStruct->length) ; + wdiStartParams->usConfigBufferLen = (tANI_U8 *)tlvStruct - tlvStructStart ; #ifdef WLAN_DEBUG @@ -2210,7 +2447,7 @@ VOS_STATUS WDA_stop(v_PVOID_t pVosContext, tANI_U8 reason) wdiStopReq->wdiStopReason = reason; wdiStopReq->wdiReqStatusCB = NULL; - + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; if(NULL == pWdaParams) { @@ -2264,7 +2501,7 @@ VOS_STATUS WDA_stop(v_PVOID_t pVosContext, tANI_U8 reason) /* * FUNCTION: WDA_close * call WDI_close and free the WDA context - */ + */ VOS_STATUS WDA_close(v_PVOID_t pVosContext) { VOS_STATUS status = VOS_STATUS_SUCCESS; @@ -2374,7 +2611,7 @@ uint8 WDA_IsWcnssWlanReportedVersionGreaterThanOrEqual(uint8 major, uint8 minor, VOS_STATUS WDA_GetWcnssWlanCompiledVersion(v_PVOID_t pvosGCtx, tSirVersionType *pVersion) { - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; if ((NULL == pvosGCtx) || (NULL == pVersion)) { VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -2401,7 +2638,7 @@ VOS_STATUS WDA_GetWcnssWlanCompiledVersion(v_PVOID_t pvosGCtx, VOS_STATUS WDA_GetWcnssWlanReportedVersion(v_PVOID_t pvosGCtx, tSirVersionType *pVersion) { - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; if ((NULL == pvosGCtx) || (NULL == pVersion)) { VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -2428,7 +2665,7 @@ VOS_STATUS WDA_GetWcnssSoftwareVersion(v_PVOID_t pvosGCtx, tANI_U8 *pVersion, tANI_U32 versionBufferSize) { - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "%s: Entered", __func__); if ((NULL == pvosGCtx) || (NULL == pVersion)) @@ -2457,7 +2694,7 @@ VOS_STATUS WDA_GetWcnssHardwareVersion(v_PVOID_t pvosGCtx, tANI_U8 *pVersion, tANI_U32 versionBufferSize) { - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "%s: Entered", __func__); if ((NULL == pvosGCtx) || (NULL == pVersion)) @@ -2660,8 +2897,8 @@ void WDA_InitScanReqCallback(WDI_Status wdiStatus, void* pUserData) /* free WDI command buffer */ vos_mem_free(pWdaParams->wdaWdiApiMsgParam); vos_mem_free(pWdaParams) ; - - + + /* assign status to scan params */ /* without converting the Status to Failure or Success Just pass the same status to lim */ @@ -3471,10 +3708,10 @@ VOS_STATUS WDA_ProcessChannelSwitchReq_V1(tWDA_CbContext *pWDA, } /* - * FUNCTION: WDA_ConfigBssReqCallback + * FUNCTION: WDA_ConfigBssRspCallback * config BSS Req Callback, called by WDI */ -void WDA_ConfigBssReqCallback(WDI_ConfigBSSRspParamsType *wdiConfigBssRsp +void WDA_ConfigBssRspCallback(WDI_ConfigBSSRspParamsType *wdiConfigBssRsp ,void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; @@ -3609,6 +3846,40 @@ void WDA_UpdateEdcaParamsForAC(tWDA_CbContext *pWDA, wdiEdcaParam->wdiCW.max = macEdcaParam->cw.max; wdiEdcaParam->usTXOPLimit = macEdcaParam->txoplimit; } +void WDA_ConfigBssReqCallback(WDI_Status wdiStatus, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA; + tAddBssParams *addBssParams; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", + __func__, wdiStatus); + + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid pWdaParams pointer", __func__); + VOS_ASSERT(0); + return; + } + + pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + addBssParams = (tAddBssParams *)pWdaParams->wdaMsgParam; + + addBssParams->status = wdiStatus; + + if (IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + WDA_SendMsg(pWDA, WDA_ADD_BSS_RSP, (void *)addBssParams , 0); + } + + return ; +} + /* * FUNCTION: WDA_ProcessConfigBssReq * Configure BSS before starting Assoc with AP @@ -3652,13 +3923,15 @@ VOS_STATUS WDA_ProcessConfigBssReq(tWDA_CbContext *pWDA, vos_mem_set(wdiConfigBssReqParam, sizeof(WDI_ConfigBSSReqParamsType), 0); WDA_UpdateBSSParams(pWDA, &wdiConfigBssReqParam->wdiReqInfo, configBssReqParam) ; + wdiConfigBssReqParam->wdiReqStatusCB = WDA_ConfigBssReqCallback; + wdiConfigBssReqParam->pUserData = pWdaParams; /* Store Init Req pointer, as this will be used for response */ /* store Params pass it to WDI */ pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = configBssReqParam; pWdaParams->wdaWdiApiMsgParam = wdiConfigBssReqParam; status = WDI_ConfigBSSReq(wdiConfigBssReqParam, - (WDI_ConfigBSSRspCb )WDA_ConfigBssReqCallback, pWdaParams) ; + (WDI_ConfigBSSRspCb )WDA_ConfigBssRspCallback, pWdaParams) ; if(IS_WDI_STATUS_FAILURE(status)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -3780,10 +4053,10 @@ VOS_STATUS WDA_ProcessPostAssocReq(tWDA_CbContext *pWDA, } #endif /* - * FUNCTION: WDA_AddStaReqCallback + * FUNCTION: WDA_AddStaRspCallback * ADD STA req callback, send RSP back to PE */ -void WDA_AddStaReqCallback(WDI_ConfigSTARspParamsType *wdiConfigStaRsp, +void WDA_AddStaRspCallback(WDI_ConfigSTARspParamsType *wdiConfigStaRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; @@ -3838,11 +4111,45 @@ void WDA_AddStaReqCallback(WDI_ConfigSTARspParamsType *wdiConfigStaRsp, WDA_SendMsg(pWDA, WDA_ADD_STA_RSP, (void *)addStaReqParam, 0) ; return ; } +void WDA_AddStaReqCallback(WDI_Status wdiStatus, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA; + tAddStaParams *addStaParams; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", + __func__, wdiStatus); + + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid pWdaParams pointer", __func__); + VOS_ASSERT(0); + return; + } + + pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + addStaParams = (tAddStaParams *)pWdaParams->wdaMsgParam; + + addStaParams->status = wdiStatus; + + if (IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + WDA_SendMsg(pWDA, WDA_ADD_STA_RSP, (void *)addStaParams , 0); + } + + return ; +} + /* * FUNCTION: WDA_ConfigStaReq * Trigger Config STA processing in WDI */ -VOS_STATUS WDA_ProcessAddStaReq(tWDA_CbContext *pWDA, +VOS_STATUS WDA_ProcessAddStaReq(tWDA_CbContext *pWDA, tAddStaParams *addStaReqParam) { WDI_Status status = WDI_STATUS_SUCCESS ; @@ -3872,13 +4179,16 @@ VOS_STATUS WDA_ProcessAddStaReq(tWDA_CbContext *pWDA, /* update STA params into WDI structure */ WDA_UpdateSTAParams(pWDA, &wdiConfigStaReqParam->wdiReqInfo, addStaReqParam) ; + wdiConfigStaReqParam->wdiReqStatusCB = WDA_AddStaReqCallback; + wdiConfigStaReqParam->pUserData = pWdaParams; /* Store Init Req pointer, as this will be used for response */ /* store Params pass it to WDI */ pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = addStaReqParam; pWdaParams->wdaWdiApiMsgParam = wdiConfigStaReqParam; + status = WDI_ConfigSTAReq(wdiConfigStaReqParam, - (WDI_ConfigSTARspCb )WDA_AddStaReqCallback, pWdaParams) ; + (WDI_ConfigSTARspCb )WDA_AddStaRspCallback, pWdaParams) ; if(IS_WDI_STATUS_FAILURE(status)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -3890,11 +4200,12 @@ VOS_STATUS WDA_ProcessAddStaReq(tWDA_CbContext *pWDA, } return CONVERT_WDI2VOS_STATUS(status) ; } + /* - * FUNCTION: WDA_DelBSSReqCallback + * FUNCTION: WDA_DelBSSRspCallback * Dens DEL BSS RSP back to PE - */ -void WDA_DelBSSReqCallback(WDI_DelBSSRspParamsType *wdiDelBssRsp, + */ +void WDA_DelBSSRspCallback(WDI_DelBSSRspParamsType *wdiDelBssRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; @@ -3962,25 +4273,58 @@ void WDA_DelBSSReqCallback(WDI_DelBSSRspParamsType *wdiDelBssRsp, WDA_SendMsg(pWDA, WDA_DELETE_BSS_RSP, (void *)delBssReqParam , 0) ; return ; } - -/* - * FUNCTION: WDA_ProcessDelBssReq - * Init DEL BSS req with WDI - */ -VOS_STATUS WDA_ProcessDelBssReq(tWDA_CbContext *pWDA, - tDeleteBssParams *delBssParam) +void WDA_DelBSSReqCallback(WDI_Status wdiStatus, + void* pUserData) { - WDI_Status status = WDI_STATUS_SUCCESS ; - WDI_DelBSSReqParamsType *wdiDelBssReqParam = - (WDI_DelBSSReqParamsType *)vos_mem_malloc( - sizeof(WDI_DelBSSReqParamsType)) ; - tWDA_ReqParams *pWdaParams ; - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, - "------> %s " ,__func__); - if(NULL == wdiDelBssReqParam) + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA; + tDeleteBssParams *delbssParams; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", + __func__, wdiStatus); + + if (NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: VOS MEM Alloc Failure", __func__); + "%s: Invalid pWdaParams pointer", __func__); + VOS_ASSERT(0); + return; + } + + pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + delbssParams = (tDeleteBssParams *)pWdaParams->wdaMsgParam; + + delbssParams->status = wdiStatus ; + + if (IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + WDA_SendMsg(pWDA, WDA_DELETE_BSS_RSP, (void *)delbssParams , 0) ; + } + + return ; +} + +/* + * FUNCTION: WDA_ProcessDelBssReq + * Init DEL BSS req with WDI + */ +VOS_STATUS WDA_ProcessDelBssReq(tWDA_CbContext *pWDA, + tDeleteBssParams *delBssParam) +{ + WDI_Status status = WDI_STATUS_SUCCESS ; + WDI_DelBSSReqParamsType *wdiDelBssReqParam = + (WDI_DelBSSReqParamsType *)vos_mem_malloc( + sizeof(WDI_DelBSSReqParamsType)) ; + tWDA_ReqParams *pWdaParams ; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s " ,__func__); + if(NULL == wdiDelBssReqParam) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -3994,15 +4338,17 @@ VOS_STATUS WDA_ProcessDelBssReq(tWDA_CbContext *pWDA, return VOS_STATUS_E_NOMEM; } wdiDelBssReqParam->ucBssIdx = delBssParam->bssIdx; - wdiDelBssReqParam->wdiReqStatusCB = NULL ; - + wdiDelBssReqParam->wdiReqStatusCB = WDA_DelBSSReqCallback ; + wdiDelBssReqParam->pUserData = pWdaParams; + /* Store Init Req pointer, as this will be used for response */ /* store Params pass it to WDI */ pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = delBssParam; pWdaParams->wdaWdiApiMsgParam = wdiDelBssReqParam; + status = WDI_DelBSSReq(wdiDelBssReqParam, - (WDI_DelBSSRspCb )WDA_DelBSSReqCallback, pWdaParams) ; + (WDI_DelBSSRspCb )WDA_DelBSSRspCallback, pWdaParams) ; if(IS_WDI_STATUS_FAILURE(status)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -4015,10 +4361,10 @@ VOS_STATUS WDA_ProcessDelBssReq(tWDA_CbContext *pWDA, return CONVERT_WDI2VOS_STATUS(status) ; } /* - * FUNCTION: WDA_DelSTAReqCallback + * FUNCTION: WDA_DelSTARspCallback * Dens DEL STA RSP back to PE - */ -void WDA_DelSTAReqCallback(WDI_DelSTARspParamsType *wdiDelStaRsp, + */ +void WDA_DelSTARspCallback(WDI_DelSTARspParamsType *wdiDelStaRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; @@ -4030,7 +4376,7 @@ void WDA_DelSTAReqCallback(WDI_DelSTARspParamsType *wdiDelStaRsp, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: pWdaParams received NULL", __func__); - VOS_ASSERT(0) ; + VOS_ASSERT(0); return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; @@ -4057,6 +4403,40 @@ void WDA_DelSTAReqCallback(WDI_DelSTARspParamsType *wdiDelStaRsp, WDA_SendMsg(pWDA, WDA_DELETE_STA_RSP, (void *)delStaReqParam , 0) ; return ; } +void WDA_DelSTAReqCallback(WDI_Status wdiStatus, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA; + tDeleteStaParams *delStaParams; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", + __func__, wdiStatus); + + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid pWdaParams pointer", __func__); + VOS_ASSERT(0); + return; + } + + pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + delStaParams = (tDeleteStaParams *)pWdaParams->wdaMsgParam; + + delStaParams->status = wdiStatus ; + + if (IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + WDA_SendMsg(pWDA, WDA_DELETE_STA_RSP, (void *)delStaParams , 0) ; + } + + return ; +} + /* * FUNCTION: WDA_ProcessDelStaReq * Init DEL STA req with WDI @@ -4088,14 +4468,16 @@ VOS_STATUS WDA_ProcessDelStaReq(tWDA_CbContext *pWDA, return VOS_STATUS_E_NOMEM; } wdiDelStaReqParam->ucSTAIdx = delStaParam->staIdx ; - wdiDelStaReqParam->wdiReqStatusCB = NULL ; + wdiDelStaReqParam->wdiReqStatusCB = WDA_DelSTAReqCallback ; + wdiDelStaReqParam->pUserData = pWdaParams; /* Store Init Req pointer, as this will be used for response */ /* store Params pass it to WDI */ pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = delStaParam; pWdaParams->wdaWdiApiMsgParam = wdiDelStaReqParam; + status = WDI_DelSTAReq(wdiDelStaReqParam, - (WDI_DelSTARspCb )WDA_DelSTAReqCallback, pWdaParams) ; + (WDI_DelSTARspCb )WDA_DelSTARspCallback, pWdaParams) ; if(IS_WDI_STATUS_FAILURE(status)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -4108,7 +4490,7 @@ VOS_STATUS WDA_ProcessDelStaReq(tWDA_CbContext *pWDA, } return CONVERT_WDI2VOS_STATUS(status) ; } -void WDA_ProcessAddStaSelfRsp(WDI_AddSTASelfRspParamsType* pwdiAddSTASelfRsp, void* pUserData) +void WDA_ProcessAddStaSelfRspCallback(WDI_AddSTASelfRspParamsType* pwdiAddSTASelfRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; tWDA_CbContext *pWDA; @@ -4140,6 +4522,42 @@ void WDA_ProcessAddStaSelfRsp(WDI_AddSTASelfRspParamsType* pwdiAddSTASelfRsp, vo WDA_SendMsg( pWDA, WDA_ADD_STA_SELF_RSP, (void *)pAddStaSelfRsp, 0) ; return ; } +void WDA_ProcessAddStaSelfReqCallback(WDI_Status wdiStatus, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA; + tAddStaSelfParams *addStaSelfParams; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", + __func__, wdiStatus); + + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid pWdaParams pointer", __func__); + VOS_ASSERT(0); + return; + } + + pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + addStaSelfParams = (tAddStaSelfParams *)pWdaParams->wdaMsgParam; + + addStaSelfParams->status = wdiStatus ; + + if (IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + pWDA->wdaAddSelfStaParams.wdaAddSelfStaFailReason + = WDA_ADDSTA_REQ_WDI_FAIL; + pWDA->wdaAddSelfStaParams.wdiAddStaSelfStaFailCounter++; + WDA_SendMsg(pWDA, WDA_ADD_STA_SELF_RSP, (void *)addStaSelfParams , 0); + } + + return ; +} /* * FUNCTION: WDA_ProcessAddStaSelfReq @@ -4176,15 +4594,18 @@ VOS_STATUS WDA_ProcessAddStaSelfReq( tWDA_CbContext *pWDA, tpAddStaSelfParams pA vos_mem_free(wdiAddStaSelfReq) ; return( VOS_STATUS_E_NOMEM ); } - wdiAddStaSelfReq->wdiReqStatusCB = NULL; + wdiAddStaSelfReq->wdiReqStatusCB = WDA_ProcessAddStaSelfReqCallback; + wdiAddStaSelfReq->pUserData = pWdaParams; vos_mem_copy( wdiAddStaSelfReq->wdiAddSTASelfInfo.selfMacAddr, pAddStaSelfReq->selfMacAddr, 6); wdiAddStaSelfReq->wdiAddSTASelfInfo.currDeviceMode = pAddStaSelfReq->currDeviceMode; /* Store Init Req pointer, as this will be used for response */ /* store Params pass it to WDI */ pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = pAddStaSelfReq; - pWdaParams->wdaWdiApiMsgParam = wdiAddStaSelfReq; - wstatus = WDI_AddSTASelfReq( wdiAddStaSelfReq, WDA_ProcessAddStaSelfRsp, pWdaParams); + pWdaParams->wdaWdiApiMsgParam = wdiAddStaSelfReq; + + wstatus = WDI_AddSTASelfReq( wdiAddStaSelfReq, + WDA_ProcessAddStaSelfRspCallback, pWdaParams); if(IS_WDI_STATUS_FAILURE(wstatus)) { @@ -4243,7 +4664,7 @@ void WDA_DelSTASelfReqCallback(WDI_Status wdiStatus, tDelStaSelfParams *delStaSelfParams; VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, - "<------ %s, wdiStatus: %d pWdaParams: %p", + "<------ %s, wdiStatus: %d pWdaParams: %pK", __func__, wdiStatus, pWdaParams); if (NULL == pWdaParams) @@ -4705,6 +5126,8 @@ static inline v_U8_t WDA_ConvertWniCfgIdToHALCfgId(v_U32_t wniCfgId) return QWLAN_HAL_CFG_ENABLE_CLOSE_LOOP; case WNI_CFG_ENABLE_LPWR_IMG_TRANSITION: return QWLAN_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION; + case WNI_CFG_ENABLE_RTSCTS_HTVHT: + return QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT; default: { VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -5043,6 +5466,114 @@ void WDA_RemoveBssKeyReqCallback(WDI_Status status, void* pUserData) return ; } +/* + * FUNCTION: WDA_GetFrameLogRspCallback + * recieves get frame log response from FW + */ +void WDA_GetFrameLogRspCallback(WDI_GetFrameLogRspParamType* wdiRsp, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_CbContext *pWDA = NULL; + tAniGetFrameLogReq *pGetFrameLogReqParams = NULL; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ Entering: %s " ,__func__); + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0) ; + return ; + } + + pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams); + return ; + } + + pGetFrameLogReqParams = (tAniGetFrameLogReq *)pWdaParams->wdaMsgParam; + if(NULL == pGetFrameLogReqParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pGetFrameLogReqParams received NULL", __func__); + VOS_ASSERT(0); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams); + return; + } + + if (wdiRsp->wdiStatus != WDI_STATUS_SUCCESS) { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:GetFrameLog with rsp status %d flag %d", __func__, + wdiRsp->wdiStatus,pGetFrameLogReqParams->getFrameLogCmdFlag); + } + + /* free WDI command buffer only */ + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + return ; + +} +/* + * FUNCTION: WDA_FWLoggingInitRspCallback + * recieves Mgmt Logging init response from FW + */ +void WDA_FWLoggingInitRspCallback(WDI_FWLoggingInitRspParamType* wdiRsp, + void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tSirFWLoggingInitParam *pFWLoggingInitParams; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s " ,__func__); + + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0); + return ; + } + + if(NULL == pWdaParams->wdaMsgParam) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams->wdaMsgParam is NULL", __func__); + VOS_ASSERT(0); + vos_mem_free(pWdaParams); + return ; + } + + pFWLoggingInitParams = (tSirFWLoggingInitParam *)pWdaParams->wdaMsgParam; + + if(pFWLoggingInitParams->fwlogInitCallback) + { + pFWLoggingInitParams->fwlogInitCallback( + pFWLoggingInitParams->fwlogInitCbContext, + CONVERT_WDI2VOS_STATUS(wdiRsp->status)); + } + else + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pFWLoggingInitParams callback is NULL", __func__); + } + + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + return; +} + /* * FUNCTION: WDA_SpoofMacAddrRspCallback * recieves spoof mac addr response from FW @@ -5051,30 +5582,31 @@ void WDA_SpoofMacAddrRspCallback(WDI_SpoofMacAddrRspParamType* wdiRsp, void* pUs { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; tWDA_CbContext *pWDA; - tSirSpoofMacAddrReq *spoofMacAddrReq; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); + if(NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: pWdaParams received NULL", __func__); - VOS_ASSERT(0) ; + VOS_ASSERT(0); return ; } - pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; - spoofMacAddrReq = (tSirSpoofMacAddrReq *)pWdaParams->wdaMsgParam ; - if(wdiRsp->wdiStatus != WDI_STATUS_SUCCESS ) - { + if (wdiRsp->wdiStatus != WDI_STATUS_SUCCESS) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: Unable to set Random Mac Addr in FW", __func__); + "%s:Spoofing with rsp status %d", __func__, wdiRsp->wdiStatus); } + WDA_SendMsg(pWDA, WDA_SPOOF_MAC_ADDR_RSP, NULL, + CONVERT_WDI2SIR_STATUS(wdiRsp->wdiStatus)); - vos_mem_free(spoofMacAddrReq); vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); vos_mem_free(pWdaParams); - return ; + + return; } /* @@ -5537,12 +6069,12 @@ WDA_processSetLinkStateStatus WDA_IsHandleSetLinkStateReq( */ void WDA_SetLinkStateCallback(WDI_Status status, void* pUserData) { - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tLinkStateParams *linkStateParams; tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); - if(NULL == pWdaParams) + if (NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: pWdaParams received NULL", __func__); @@ -5550,6 +6082,18 @@ void WDA_SetLinkStateCallback(WDI_Status status, void* pUserData) return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + linkStateParams = (tLinkStateParams *)pWdaParams->wdaMsgParam ; /* * In STA mode start the BA activity check timer after association @@ -5567,14 +6111,9 @@ void WDA_SetLinkStateCallback(WDI_Status status, void* pUserData) * No respone required for WDA_SET_LINK_STATE so free the request * param here */ - if( pWdaParams != NULL ) - { - if( pWdaParams->wdaWdiApiMsgParam != NULL ) - { - vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; - } - vos_mem_free(pWdaParams); - } + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams); + return ; } /* @@ -5668,8 +6207,8 @@ void WDA_GetStatsReqParamsCallback( WDI_GetStatsRspParamsType *wdiGetStatsRsp, void* pUserData) { - tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; tAniGetPEStatsRsp *pGetPEStatsRspParams; + vos_msg_t vosMsg; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); @@ -5685,7 +6224,7 @@ void WDA_GetStatsReqParamsCallback( return; } vos_mem_set(pGetPEStatsRspParams, wdiGetStatsRsp->usMsgLen, 0); - pGetPEStatsRspParams->msgType = wdiGetStatsRsp->usMsgType; + pGetPEStatsRspParams->msgType = eWNI_SME_GET_STATISTICS_RSP; pGetPEStatsRspParams->msgLen = sizeof(tAniGetPEStatsRsp) + (wdiGetStatsRsp->usMsgLen - sizeof(WDI_GetStatsRspParamsType)); @@ -5698,8 +6237,17 @@ void WDA_GetStatsReqParamsCallback( vos_mem_copy( pGetPEStatsRspParams + 1, wdiGetStatsRsp + 1, wdiGetStatsRsp->usMsgLen - sizeof(WDI_GetStatsRspParamsType)); - /* send response to UMAC*/ - WDA_SendMsg(pWDA, WDA_GET_STATISTICS_RSP, pGetPEStatsRspParams , 0) ; + + vosMsg.type = eWNI_SME_GET_STATISTICS_RSP; + vosMsg.bodyptr = (void *)pGetPEStatsRspParams; + vosMsg.bodyval = 0; + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, + (vos_msg_t*)&vosMsg)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: fail to post eWNI_SME_GET_STATISTICS_RSP", __func__); + vos_mem_free(pGetPEStatsRspParams); + } return; } @@ -5714,6 +6262,8 @@ VOS_STATUS WDA_ProcessGetStatsReq(tWDA_CbContext *pWDA, WDI_Status status = WDI_STATUS_SUCCESS ; WDI_GetStatsReqParamsType wdiGetStatsParam; tAniGetPEStatsRsp *pGetPEStatsRspParams; + vos_msg_t vosMsg; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "------> %s " ,__func__); wdiGetStatsParam.wdiGetStatsParamsInfo.ucSTAIdx = @@ -5737,12 +6287,21 @@ VOS_STATUS WDA_ProcessGetStatsReq(tWDA_CbContext *pWDA, vos_mem_free(pGetStatsParams); return VOS_STATUS_E_NOMEM; } - pGetPEStatsRspParams->msgType = WDA_GET_STATISTICS_RSP; + pGetPEStatsRspParams->msgType = eWNI_SME_GET_STATISTICS_RSP; pGetPEStatsRspParams->msgLen = sizeof(tAniGetPEStatsRsp); pGetPEStatsRspParams->staId = pGetStatsParams->staId; pGetPEStatsRspParams->rc = eSIR_FAILURE; - WDA_SendMsg(pWDA, WDA_GET_STATISTICS_RSP, - (void *)pGetPEStatsRspParams, 0) ; + + vosMsg.type = eWNI_SME_GET_STATISTICS_RSP; + vosMsg.bodyptr = (void *)pGetPEStatsRspParams; + vosMsg.bodyval = 0; + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, + (vos_msg_t*)&vosMsg)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: fail to post eWNI_SME_GET_STATISTICS_RSP", __func__); + vos_mem_free(pGetPEStatsRspParams); + } } /* Free the request message */ vos_mem_free(pGetStatsParams); @@ -5837,6 +6396,7 @@ VOS_STATUS WDA_ProcessGetRoamRssiReq(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(pGetRoamRssiParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -5983,7 +6543,7 @@ void WDA_AddBAReqCallback(WDI_AddBARspinfoType *pAddBARspParams, tAddBAParams *pAddBAReqParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); - if(NULL == pWdaParams) + if (NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: pWdaParams received NULL", __func__); @@ -5991,6 +6551,18 @@ void WDA_AddBAReqCallback(WDI_AddBARspinfoType *pAddBARspParams, return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pAddBAReqParams = (tAddBAParams *)pWdaParams->wdaMsgParam; vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; vos_mem_free(pWdaParams); @@ -6065,7 +6637,7 @@ void WDA_AddBASessionReqCallback( { VOS_STATUS status = VOS_STATUS_SUCCESS ; tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tAddBAParams *pAddBAReqParams ; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); @@ -6077,6 +6649,17 @@ void WDA_AddBASessionReqCallback( return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; + } + pAddBAReqParams = (tAddBAParams *)pWdaParams->wdaMsgParam; if( NULL == pAddBAReqParams ) { @@ -6090,12 +6673,12 @@ void WDA_AddBASessionReqCallback( vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; vos_mem_free(pWdaParams); /* - * if WDA in update TL state, update TL with BA session parama and send + * if BA direction is for recipient, update TL with BA session params and send * another request to HAL(/WDI) (ADD_BA_REQ) */ if((VOS_STATUS_SUCCESS == CONVERT_WDI2VOS_STATUS(wdiAddBaSession->wdiStatus)) && - (WDA_BA_UPDATE_TL_STATE == pWDA->wdaState)) + (eBA_RECIPIENT == pAddBAReqParams->baDirection)) { /* Update TL with BA info received from HAL/WDI */ status = WDA_TL_BA_SESSION_ADD(pWDA->pVosContext, @@ -6181,11 +6764,7 @@ VOS_STATUS WDA_ProcessAddBASessionReq(tWDA_CbContext *pWDA, wdiBAInfoType->usBaTimeout = pAddBAReqParams->baTimeout; wdiBAInfoType->usBaSSN = pAddBAReqParams->baSSN; wdiBAInfoType->ucBaDirection = pAddBAReqParams->baDirection; - /* check the BA direction and update state accordingly */ - (eBA_RECIPIENT == wdiBAInfoType->ucBaDirection) - ? (pWDA->wdaState = WDA_BA_UPDATE_TL_STATE) - : (pWDA->wdaState = WDA_BA_UPDATE_LIM_STATE); - + }while(0) ; wdiAddBASessionReqParam->wdiReqStatusCB = NULL ; pWdaParams->pWdaContext = pWDA; @@ -6283,6 +6862,7 @@ void WDA_DelBAReqCallback(WDI_Status status, void* pUserData) return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + pDelBAReqParams = (tDelBAParams *)pWdaParams->wdaMsgParam ; /* Notify TL about DEL BA in case of recipinet */ if((VOS_STATUS_SUCCESS == CONVERT_WDI2VOS_STATUS(status)) && @@ -6426,7 +7006,7 @@ VOS_STATUS WDA_ProcessUpdateChannelList(tWDA_CbContext *pWDA, if(!WDA_getFwWlanFeatCaps(UPDATE_CHANNEL_LIST)) { - VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "Update channel list capability Not Supported"); vos_mem_free(pChanList); return VOS_STATUS_E_INVAL; @@ -6504,10 +7084,9 @@ VOS_STATUS WDA_ProcessUpdateChannelList(tWDA_CbContext *pWDA, WDA_SET_CHANNEL_MAX_POWER(pChanInfoType, pChanList->chanParam[i].pwr); WDA_SET_CHANNEL_REG_POWER(pChanInfoType, pChanList->chanParam[i].pwr); - + WDA_SET_CUURENT_REG_DOMAIN(pChanInfoType, pChanList->regId); pChanInfoType++; } - pwdiUpdateChReqParam->wdiReqStatusCB = NULL; pWdaParams->pWdaContext = pWDA; pWdaParams->wdaMsgParam = (void *)pChanList; @@ -6534,7 +7113,7 @@ VOS_STATUS WDA_ProcessUpdateChannelList(tWDA_CbContext *pWDA, void WDA_AddTSReqCallback(WDI_Status status, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tAddTsParams *pAddTsReqParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -6547,6 +7126,18 @@ void WDA_AddTSReqCallback(WDI_Status status, void* pUserData) return ; } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pAddTsReqParams = (tAddTsParams *)pWdaParams->wdaMsgParam ; vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; vos_mem_free(pWdaParams); @@ -6867,6 +7458,14 @@ void WDA_TSMStatsReqCallback(WDI_TSMStatsRspParamsType *pwdiTSMStatsRspParams, v return ; } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pGetTsmStatsReqParams = (tAniGetTsmStatsReq *)pWdaParams->wdaMsgParam; if(NULL == pGetTsmStatsReqParams) @@ -7020,6 +7619,7 @@ VOS_STATUS WDA_ProcessSendBeacon(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "Invalid p2pIeOffset = %hu ", pSendbeaconParams->p2pIeOffset); + vos_mem_free(pSendbeaconParams); VOS_ASSERT( 0 ); return WDI_STATUS_E_FAILURE; } @@ -7066,7 +7666,10 @@ VOS_STATUS WDA_ProcessUpdateProbeRspTemplate(tWDA_CbContext *pWDA, "------> %s " ,__func__); if (!wdiSendProbeRspParam) + { + vos_mem_free(pSendProbeRspParams); return CONVERT_WDI2VOS_STATUS(WDI_STATUS_MEM_FAILURE); + } /*Copy update probe response parameters*/ vos_mem_copy(wdiSendProbeRspParam->wdiProbeRspTemplateInfo.macBSSID, @@ -7118,6 +7721,17 @@ void WDA_SetMaxTxPowerCallBack(WDI_SetMaxTxPowerRspMsg * pwdiSetMaxTxPowerRsp, return ; } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; + } + pMaxTxPowerParams = (tMaxTxPowerParams *)pWdaParams->wdaMsgParam ; if( NULL == pMaxTxPowerParams ) { @@ -7226,6 +7840,17 @@ void WDA_SetMaxTxPowerPerBandCallBack(WDI_SetMaxTxPowerPerBandRspMsg return ; } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; + } + pMxTxPwrPerBandParams = (tMaxTxPowerPerBandParams*)pWdaParams->wdaMsgParam; if ( NULL == pMxTxPwrPerBandParams ) { @@ -7333,6 +7958,17 @@ void WDA_SetTxPowerCallBack(WDI_SetTxPowerRspMsg * pwdiSetMaxTxPowerRsp, return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; + } + pTxPowerParams = (tSirSetTxPowerReq *)pWdaParams->wdaMsgParam; if(NULL == pTxPowerParams) { @@ -7458,6 +8094,7 @@ VOS_STATUS WDA_ProcessSetP2PGONOAReq(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(pP2pPsConfigParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -7535,13 +8172,17 @@ void WDA_SetTDLSLinkEstablishReqParamsCallback(WDI_SetTdlsLinkEstablishReqResp * } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; - if(NULL == pWdaParams) + if (NULL == pWDA) { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: pWdaParams received NULL", __func__); - VOS_ASSERT(0) ; - return ; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; } + pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams *)pWdaParams->wdaMsgParam ; if( NULL == pTdlsLinkEstablishParams ) { @@ -7577,6 +8218,7 @@ VOS_STATUS WDA_ProcessSetTdlsLinkEstablishReq(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(pTdlsLinkEstablishParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -7658,13 +8300,17 @@ void WDA_SetTDLSChanSwitchReqParamsCallback(WDI_SetTdlsChanSwitchReqResp *wdiSet } pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; - if(NULL == pWdaParams) + if (NULL == pWDA) { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: pWdaParams received NULL", __func__); - VOS_ASSERT(0) ; - return ; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; } + pTdlsChanSwitchParams = (tTdlsChanSwitchParams *)pWdaParams->wdaMsgParam ; if( NULL == pTdlsChanSwitchParams ) { @@ -7700,6 +8346,7 @@ VOS_STATUS WDA_ProcessSetTdlsChanSwitchReq(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(pTdlsChanSwitchParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -7756,7 +8403,7 @@ VOS_STATUS WDA_ProcessSetTdlsChanSwitchReq(tWDA_CbContext *pWDA, void WDA_AggrAddTSReqCallback(WDI_Status status, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tAggrAddTsParams *pAggrAddTsReqParams; int i; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -7770,6 +8417,18 @@ void WDA_AggrAddTSReqCallback(WDI_Status status, void* pUserData) } pWDA = pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pAggrAddTsReqParams = (tAggrAddTsParams *)pWdaParams->wdaMsgParam ; for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) @@ -7803,6 +8462,7 @@ VOS_STATUS WDA_ProcessAggrAddTSReq(tWDA_CbContext *pWDA, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(pAggrAddTsReqParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -7921,7 +8581,7 @@ VOS_STATUS WDA_ProcessAggrAddTSReq(tWDA_CbContext *pWDA, void WDA_EnterImpsRspCallback(WDI_Status status, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s status=%d" ,__func__,status); @@ -7934,6 +8594,16 @@ void WDA_EnterImpsRspCallback(WDI_Status status, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + VOS_ASSERT(0); + return ; + } vos_mem_free(pWdaParams->wdaWdiApiMsgParam); vos_mem_free(pWdaParams); @@ -7950,7 +8620,7 @@ void WDA_EnterImpsRspCallback(WDI_Status status, void* pUserData) void WDA_EnterImpsReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s, wdiStatus: %d", __func__, wdiStatus); @@ -7964,6 +8634,18 @@ void WDA_EnterImpsReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + if(IS_WDI_STATUS_FAILURE(wdiStatus)) { @@ -7984,6 +8666,7 @@ VOS_STATUS WDA_ProcessEnterImpsReq(tWDA_CbContext *pWDA) WDI_Status status = WDI_STATUS_SUCCESS ; WDI_EnterImpsReqParamsType *wdiEnterImpsReqParams; tWDA_ReqParams *pWdaParams; + static int failcnt = 0; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "------> %s " ,__func__); @@ -8023,8 +8706,10 @@ VOS_STATUS WDA_ProcessEnterImpsReq(tWDA_CbContext *pWDA) pWdaParams); if(IS_WDI_STATUS_FAILURE(status)) { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "Failure in Enter IMPS REQ WDI API, free all the memory " ); + if (! (failcnt & 0xF)) + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure in Enter IMPS REQ WDI API, free all the memory " ); + failcnt++; vos_mem_free(wdiEnterImpsReqParams); vos_mem_free(pWdaParams); WDA_SendMsg(pWDA, WDA_ENTER_IMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; @@ -8148,7 +8833,7 @@ VOS_STATUS WDA_ProcessExitImpsReq(tWDA_CbContext *pWDA) void WDA_EnterBmpsRespCallback(WDI_EnterBmpsRspParamsType *pwdiEnterBmpsRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tEnterBmpsParams *pEnterBmpsRspParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -8162,6 +8847,21 @@ void WDA_EnterBmpsRespCallback(WDI_EnterBmpsRspParamsType *pwdiEnterBmpsRsp, voi } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pEnterBmpsRspParams = (tEnterBmpsParams *)pWdaParams->wdaMsgParam; pEnterBmpsRspParams->bssIdx = pwdiEnterBmpsRsp->bssIdx; @@ -8181,7 +8881,7 @@ void WDA_EnterBmpsRespCallback(WDI_EnterBmpsRspParamsType *pwdiEnterBmpsRsp, voi void WDA_EnterBmpsReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tEnterBmpsParams *pEnterBmpsRspParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -8196,6 +8896,14 @@ void WDA_EnterBmpsReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pEnterBmpsRspParams = (tEnterBmpsParams *)pWdaParams->wdaMsgParam; pEnterBmpsRspParams->status = wdiStatus; @@ -8296,7 +9004,7 @@ static void WDA_SendExitBmpsRsp(tWDA_CbContext *pWDA, void WDA_ExitBmpsRespCallback(WDI_ExitBmpsRspParamsType *pwdiExitBmpsRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tExitBmpsParams *pExitBmpsRspParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -8310,6 +9018,21 @@ void WDA_ExitBmpsRespCallback(WDI_ExitBmpsRspParamsType *pwdiExitBmpsRsp, void* } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pExitBmpsRspParams = (tExitBmpsParams *)pWdaParams->wdaMsgParam; pExitBmpsRspParams->bssIdx = pwdiExitBmpsRsp->bssIdx; @@ -8329,7 +9052,7 @@ void WDA_ExitBmpsRespCallback(WDI_ExitBmpsRspParamsType *pwdiExitBmpsRsp, void* void WDA_ExitBmpsReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tExitBmpsParams *pExitBmpsRspParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -8344,6 +9067,14 @@ void WDA_ExitBmpsReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pExitBmpsRspParams = (tExitBmpsParams *)pWdaParams->wdaMsgParam; pExitBmpsRspParams->status = wdiStatus; @@ -8418,7 +9149,7 @@ VOS_STATUS WDA_ProcessExitBmpsReq(tWDA_CbContext *pWDA, void WDA_EnterUapsdRespCallback( WDI_EnterUapsdRspParamsType *pwdiEnterUapsdRspParams, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tUapsdParams *pEnterUapsdRsqParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); @@ -8431,6 +9162,21 @@ void WDA_EnterUapsdRespCallback( WDI_EnterUapsdRspParamsType *pwdiEnterUapsdRsp } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pEnterUapsdRsqParams = (tUapsdParams *)pWdaParams->wdaMsgParam; pEnterUapsdRsqParams->bssIdx = pwdiEnterUapsdRspParams->bssIdx; @@ -8464,6 +9210,14 @@ void WDA_EnterUapsdReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pEnterUapsdRsqParams = (tUapsdParams *)pWdaParams->wdaMsgParam; pEnterUapsdRsqParams->status = wdiStatus; @@ -8585,7 +9339,7 @@ void WDA_ExitUapsdRespCallback(WDI_ExitUapsdRspParamsType *pwdiExitRspParam, voi void WDA_ExitUapsdReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tExitUapsdParams *pExitUapsdRspParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -8600,6 +9354,14 @@ void WDA_ExitUapsdReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pExitUapsdRspParams = (tExitUapsdParams *)pWdaParams->wdaMsgParam; pExitUapsdRspParams->status = wdiStatus; @@ -9125,101 +9887,362 @@ void WDA_ConfigureRxpFilterRespCallback(WDI_Status wdiStatus, void* pUserData) return ; } /* - * FUNCTION: WDA_ConfigureRxpFilterReqCallback - * Free memory. - * Invoked when ConfigureRXPFilter REQ failed in WDI and no RSP callback is generated. + * FUNCTION: WDA_ConfigureRxpFilterReqCallback + * Free memory. + * Invoked when ConfigureRXPFilter REQ failed in WDI and no RSP callback is generated. + */ +void WDA_ConfigureRxpFilterReqCallback(WDI_Status wdiStatus, void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s, wdiStatus: %d", __func__, wdiStatus); + + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0); + return; + } + + if(IS_WDI_STATUS_FAILURE(wdiStatus)) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + } + + return; +} +/* + * FUNCTION: WDA_ProcessConfigureRxpFilterReq + * + */ +VOS_STATUS WDA_ProcessConfigureRxpFilterReq(tWDA_CbContext *pWDA, + tSirWlanSetRxpFilters *pWlanSuspendParam) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + WDI_Status wstatus; + WDI_ConfigureRxpFilterReqParamsType *wdiRxpFilterParams; + tWDA_ReqParams *pWdaParams ; + /* Sanity Check + * This is very unlikely and add assert to collect more info next time */ + if(NULL == pWlanSuspendParam) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWlanSuspendParam received NULL", __func__); + VOS_ASSERT(0) ; + return VOS_STATUS_E_FAULT; + } + wdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType *)vos_mem_malloc( + sizeof(WDI_ConfigureRxpFilterReqParamsType)) ; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s " ,__func__); + if(NULL == wdiRxpFilterParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(pWlanSuspendParam); + return VOS_STATUS_E_NOMEM; + } + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(wdiRxpFilterParams); + vos_mem_free(pWlanSuspendParam); + return VOS_STATUS_E_NOMEM; + } + wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter = + pWlanSuspendParam->setMcstBcstFilter; + wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting = + pWlanSuspendParam->configuredMcstBcstFilterSetting; + + wdiRxpFilterParams->wdiReqStatusCB = WDA_ConfigureRxpFilterReqCallback; + wdiRxpFilterParams->pUserData = pWdaParams; + + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = pWlanSuspendParam; + pWdaParams->wdaWdiApiMsgParam = (void *)wdiRxpFilterParams; + wstatus = WDI_ConfigureRxpFilterReq(wdiRxpFilterParams, + (WDI_ConfigureRxpFilterCb)WDA_ConfigureRxpFilterRespCallback, + pWdaParams); + if(IS_WDI_STATUS_FAILURE(wstatus)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure in configure RXP filter REQ WDI API, free all the memory " ); + status = CONVERT_WDI2VOS_STATUS(wstatus); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + } + return status; +} + +/* + * FUNCTION: WDA_ProcessGetFrameLogReq + * Request to WDI to get the Frame Log. + */ +VOS_STATUS WDA_ProcessGetFrameLogReq(tWDA_CbContext *pWDA, + tAniGetFrameLogReq *pGetFrameLog) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + WDI_Status wstatus; + WDI_GetFrameLogReqInfoType *wdiGetFrameLogInfo; + tWDA_ReqParams *pWdaParams ; + + /* Sanity Check*/ + if(NULL == pGetFrameLog) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pFWLoggingInitParam received NULL", __func__); + VOS_ASSERT(0) ; + return VOS_STATUS_E_FAULT; + } + + wdiGetFrameLogInfo = (WDI_GetFrameLogReqInfoType *)vos_mem_malloc( + sizeof(WDI_GetFrameLogReqInfoType)); + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s " ,__func__); + + if(NULL == wdiGetFrameLogInfo) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(pGetFrameLog); + return VOS_STATUS_E_NOMEM; + } + + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)); + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(wdiGetFrameLogInfo); + vos_mem_free(pGetFrameLog); + return VOS_STATUS_E_NOMEM; + } + + wdiGetFrameLogInfo->flags = pGetFrameLog->getFrameLogCmdFlag; + + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = pGetFrameLog; + pWdaParams->wdaWdiApiMsgParam = (void *)wdiGetFrameLogInfo; + + wstatus = WDI_GetFrameLogReq(wdiGetFrameLogInfo, + (WDI_GetFrameLogRspCb)WDA_GetFrameLogRspCallback, + pWdaParams); + if(IS_WDI_STATUS_FAILURE(wstatus)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure in get frame log REQ WDI API, free all the memory" ); + status = CONVERT_WDI2VOS_STATUS(wstatus); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + } + return status; +} + + +/* + * FUNCTION: WDA_FatalEventLogsRspCallback + * recieves Flush Logs response from FW */ -void WDA_ConfigureRxpFilterReqCallback(WDI_Status wdiStatus, void* pUserData) + +void WDA_FatalEventLogsRspCallback(WDI_FatalEventLogsRspParamType* wdiRsp, + void* pUserData) { - tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, - "<------ %s, wdiStatus: %d", __func__, wdiStatus); + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s,wdiStatus:%d " , + __func__, wdiRsp->wdiStatus); + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0); + return ; + } - if(NULL == pWdaParams) - { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: pWdaParams received NULL", __func__); - VOS_ASSERT(0); - return; - } + if(NULL == pWdaParams->wdaMsgParam) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams->wdaMsgParam is NULL", __func__); + VOS_ASSERT(0); + vos_mem_free(pWdaParams); + return ; + } - if(IS_WDI_STATUS_FAILURE(wdiStatus)) + if(IS_WDI_STATUS_FAILURE(wdiRsp->wdiStatus)) + { + /* + * If it is failure, it means JOb is already posted by FW + * for logging, so for failure scenario also we will get the + * done indication + */ + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Fatal Event Rsp Failure,wdiStatus : %d ", + __func__, wdiRsp->wdiStatus); + } + + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + + return; + +} + +/* + * FUNCTION: WDA_ProcessFatalEventLogsReq + * Request to WDI to send the fatal Event Logs Req. + */ + +VOS_STATUS WDA_ProcessFatalEventLogsReq(tWDA_CbContext *pWDA, + tSirFatalEventLogsReqParam *pFatalEventLogsReqParam) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + WDI_FatalEventLogsReqInfoType *wdiFatalEventLogsReqInfo; + tWDA_ReqParams *pWdaParams ; + WDI_Status wstatus; + + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s " ,__func__); + if (NULL == pFatalEventLogsReqParam) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pMgmtLoggingInitParam received NULL", __func__); + VOS_ASSERT(0) ; + return VOS_STATUS_E_FAULT; + } + wdiFatalEventLogsReqInfo = (WDI_FatalEventLogsReqInfoType *)vos_mem_malloc( + sizeof(WDI_FatalEventLogsReqInfoType)); + if(NULL == wdiFatalEventLogsReqInfo) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(pFatalEventLogsReqParam); + return VOS_STATUS_E_NOMEM; + } + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; + if(NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(wdiFatalEventLogsReqInfo); + vos_mem_free(pFatalEventLogsReqParam); + return VOS_STATUS_E_NOMEM; + } + wdiFatalEventLogsReqInfo->reason_code = pFatalEventLogsReqParam->reason_code; + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = pFatalEventLogsReqParam; + pWdaParams->wdaWdiApiMsgParam = (void *)wdiFatalEventLogsReqInfo; + + wstatus = WDI_FatalEventLogsReq(wdiFatalEventLogsReqInfo, + (WDI_FatalEventLogsRspCb)WDA_FatalEventLogsRspCallback, + pWdaParams); + if(IS_WDI_STATUS_FAILURE(wstatus)) { - vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure in Mgmt Logging init REQ WDI API, free all the memory" ); + status = CONVERT_WDI2VOS_STATUS(wstatus); + vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; vos_mem_free(pWdaParams->wdaMsgParam); vos_mem_free(pWdaParams); } - return; + return status; + } + /* - * FUNCTION: WDA_ProcessConfigureRxpFilterReq - * - */ -VOS_STATUS WDA_ProcessConfigureRxpFilterReq(tWDA_CbContext *pWDA, - tSirWlanSetRxpFilters *pWlanSuspendParam) + * FUNCTION: WDA_ProcessFWLoggingInitReq + * + */ +VOS_STATUS WDA_ProcessFWLoggingInitReq(tWDA_CbContext *pWDA, + tSirFWLoggingInitParam *pFWLoggingInitParam) { VOS_STATUS status = VOS_STATUS_SUCCESS; WDI_Status wstatus; - WDI_ConfigureRxpFilterReqParamsType *wdiRxpFilterParams; + WDI_FWLoggingInitReqInfoType *wdiFWLoggingInitInfo; tWDA_ReqParams *pWdaParams ; - /* Sanity Check - * This is very unlikely and add assert to collect more info next time */ - if(NULL == pWlanSuspendParam) + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s " ,__func__); + + /* Sanity Check*/ + if(NULL == pFWLoggingInitParam) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: pWlanSuspendParam received NULL", __func__); + "%s: pFWLoggingInitParam received NULL", __func__); VOS_ASSERT(0) ; return VOS_STATUS_E_FAULT; } - wdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType *)vos_mem_malloc( - sizeof(WDI_ConfigureRxpFilterReqParamsType)) ; - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, - "------> %s " ,__func__); - if(NULL == wdiRxpFilterParams) + + wdiFWLoggingInitInfo = (WDI_FWLoggingInitReqInfoType *)vos_mem_malloc( + sizeof(WDI_FWLoggingInitReqInfoType)); + if(NULL == wdiFWLoggingInitInfo) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: VOS MEM Alloc Failure", __func__); + "%s: VOS MEM Alloc Failure", __func__); VOS_ASSERT(0); - vos_mem_free(pWlanSuspendParam); + vos_mem_free(pFWLoggingInitParam); return VOS_STATUS_E_NOMEM; } + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; if(NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s: VOS MEM Alloc Failure", __func__); + "%s: VOS MEM Alloc Failure", __func__); VOS_ASSERT(0); - vos_mem_free(wdiRxpFilterParams); - vos_mem_free(pWlanSuspendParam); + vos_mem_free(wdiFWLoggingInitInfo); + vos_mem_free(pFWLoggingInitParam); return VOS_STATUS_E_NOMEM; } - wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter = - pWlanSuspendParam->setMcstBcstFilter; - wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting = - pWlanSuspendParam->configuredMcstBcstFilterSetting; - - wdiRxpFilterParams->wdiReqStatusCB = WDA_ConfigureRxpFilterReqCallback; - wdiRxpFilterParams->pUserData = pWdaParams; + + wdiFWLoggingInitInfo->enableFlag = pFWLoggingInitParam->enableFlag; + wdiFWLoggingInitInfo->frameType = pFWLoggingInitParam->frameType; + wdiFWLoggingInitInfo->frameSize = pFWLoggingInitParam->frameSize; + wdiFWLoggingInitInfo->bufferMode = pFWLoggingInitParam->bufferMode; + wdiFWLoggingInitInfo->continuousFrameLogging = + pFWLoggingInitParam->continuousFrameLogging; + wdiFWLoggingInitInfo->minLogBufferSize= + pFWLoggingInitParam->minLogBufferSize; + wdiFWLoggingInitInfo->maxLogBufferSize= + pFWLoggingInitParam->maxLogBufferSize; pWdaParams->pWdaContext = pWDA; - pWdaParams->wdaMsgParam = pWlanSuspendParam; - pWdaParams->wdaWdiApiMsgParam = (void *)wdiRxpFilterParams; - wstatus = WDI_ConfigureRxpFilterReq(wdiRxpFilterParams, - (WDI_ConfigureRxpFilterCb)WDA_ConfigureRxpFilterRespCallback, - pWdaParams); + pWdaParams->wdaMsgParam = pFWLoggingInitParam; + pWdaParams->wdaWdiApiMsgParam = (void *)wdiFWLoggingInitInfo; + + wstatus = WDI_FWLoggingInitReq(wdiFWLoggingInitInfo, + (WDI_FWLoggingInitRspCb)WDA_FWLoggingInitRspCallback, + pWdaParams); if(IS_WDI_STATUS_FAILURE(wstatus)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "Failure in configure RXP filter REQ WDI API, free all the memory " ); + "Failure in Mgmt Logging init REQ WDI API, free all the memory" ); status = CONVERT_WDI2VOS_STATUS(wstatus); vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; vos_mem_free(pWdaParams->wdaMsgParam); vos_mem_free(pWdaParams); } + return status; } + /* * FUNCTION: WDA_WdiIndicationCallback * @@ -10376,7 +11399,7 @@ VOS_STATUS WDA_ProcessWowlDelBcPtrnReq(tWDA_CbContext *pWDA, void WDA_WowlEnterRespCallback(WDI_WowlEnterRspParamsType *pwdiWowlEnterRspParam, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tSirHalWowlEnterParams *pWowlEnterParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); @@ -10388,6 +11411,21 @@ void WDA_WowlEnterRespCallback(WDI_WowlEnterRspParamsType *pwdiWowlEnterRspParam return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pWowlEnterParams = (tSirHalWowlEnterParams *)pWdaParams->wdaMsgParam ; pWowlEnterParams->bssIdx = pwdiWowlEnterRspParam->bssIdx; @@ -10408,7 +11446,7 @@ void WDA_WowlEnterRespCallback(WDI_WowlEnterRspParamsType *pwdiWowlEnterRspParam void WDA_WowlEnterReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tSirHalWowlEnterParams *pWowlEnterParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -10423,6 +11461,14 @@ void WDA_WowlEnterReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pWowlEnterParams = (tSirHalWowlEnterParams *)pWdaParams->wdaMsgParam; pWowlEnterParams->status = wdiStatus; @@ -10536,7 +11582,7 @@ VOS_STATUS WDA_ProcessWowlEnterReq(tWDA_CbContext *pWDA, void WDA_WowlExitRespCallback( WDI_WowlExitRspParamsType *pwdiWowlExitRsp, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tSirHalWowlExitParams *pWowlExitParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "<------ %s " ,__func__); @@ -10548,6 +11594,21 @@ void WDA_WowlExitRespCallback( WDI_WowlExitRspParamsType *pwdiWowlExitRsp, void* return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } + pWowlExitParams = (tSirHalWowlExitParams *)pWdaParams->wdaMsgParam ; pWowlExitParams->bssIdx = pwdiWowlExitRsp->bssIdx; @@ -10569,7 +11630,7 @@ void WDA_WowlExitRespCallback( WDI_WowlExitRspParamsType *pwdiWowlExitRsp, void* void WDA_WowlExitReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tSirHalWowlExitParams *pWowlExitParams; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -10584,6 +11645,14 @@ void WDA_WowlExitReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + pWowlExitParams = (tSirHalWowlExitParams *)pWdaParams->wdaMsgParam; pWowlExitParams->status = wdiStatus; @@ -10689,7 +11758,7 @@ void WDA_NvDownloadReqCallback(WDI_NvDownloadRspInfoType *pNvDownloadRspParams, { tWDA_ReqParams *pWdaParams= ( tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "<------ %s " ,__func__); @@ -10703,6 +11772,20 @@ void WDA_NvDownloadReqCallback(WDI_NvDownloadRspInfoType *pNvDownloadRspParams, } pWDA = pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + + if(pWdaParams->wdaWdiApiMsgParam) + { + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + } + vos_mem_free(pWdaParams); + + VOS_ASSERT(0); + return ; + } /*Cleaning */ vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; @@ -10727,14 +11810,14 @@ VOS_STATUS WDA_NVDownload_Start(v_PVOID_t pVosContext) VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "------> %s " ,__func__); - if(NULL == pWDA) + if (NULL == pWDA) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA is NULL", __func__); + "%s:pWDA is NULL", __func__); VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; } - + /* Get the NV structure base address and size from VOS */ vos_nv_getNVEncodedBuffer(&pNvBuffer,&bufferSize); @@ -10886,7 +11969,7 @@ VOS_STATUS WDA_ProcessFlushAcReq(tWDA_CbContext *pWDA, void WDA_BtAmpEventRespCallback(WDI_Status status, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; WDI_BtAmpEventParamsType *wdiBtAmpEventParam; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -10899,6 +11982,18 @@ void WDA_BtAmpEventRespCallback(WDI_Status status, void* pUserData) return ; } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + vos_mem_free(pWdaParams->wdaMsgParam) ; + vos_mem_free(pWdaParams->wdaWdiApiMsgParam); + vos_mem_free(pWdaParams) ; + + VOS_ASSERT(0); + return ; + } + wdiBtAmpEventParam = (WDI_BtAmpEventParamsType *)pWdaParams->wdaWdiApiMsgParam; if(BTAMP_EVENT_CONNECTION_TERMINATED == wdiBtAmpEventParam->wdiBtAmpEventInfo.ucBtAmpEventType) @@ -10922,7 +12017,7 @@ void WDA_BtAmpEventRespCallback(WDI_Status status, void* pUserData) void WDA_BtAmpEventReqCallback(WDI_Status wdiStatus, void* pUserData) { tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; WDI_BtAmpEventParamsType *wdiBtAmpEventParam; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -10937,6 +12032,14 @@ void WDA_BtAmpEventReqCallback(WDI_Status wdiStatus, void* pUserData) } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; + if (NULL == pWDA) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s:pWDA is NULL", __func__); + VOS_ASSERT(0); + return ; + } + wdiBtAmpEventParam = (WDI_BtAmpEventParamsType *)pWdaParams->wdaWdiApiMsgParam; if(BTAMP_EVENT_CONNECTION_TERMINATED == @@ -11022,7 +12125,7 @@ void WDA_FTMCommandReqCallback(void *ftmCmdRspData, if((NULL == pWDA) || (NULL == ftmCmdRspData)) { VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s, invalid input %p, %p",__func__, pWDA, ftmCmdRspData); + "%s, invalid input %pK, %pK",__func__, pWDA, ftmCmdRspData); return; } /* Release Current FTM Command Request */ @@ -11067,7 +12170,7 @@ void WDA_StartOemDataReqCallback( { VOS_STATUS status = VOS_STATUS_E_FAILURE; tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; - tWDA_CbContext *pWDA; + tWDA_CbContext *pWDA = NULL; tStartOemDataRsp *pOemDataRspParams = NULL ; VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -11082,14 +12185,14 @@ void WDA_StartOemDataReqCallback( } pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; - if(NULL == pWDA) + if (NULL == pWDA) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA is NULL", __func__); + "%s:pWDA is NULL", __func__); VOS_ASSERT(0); return ; } - + /* * Allocate memory for response params sent to PE */ @@ -11553,7 +12656,7 @@ void WDA_HALDumpCmdCallback(WDI_HALDumpCmdRspParamsType *wdiRspParams, { tANI_U8 *buffer = NULL; tWDA_CbContext *pWDA = NULL; - tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tWDA_HalDumpReqParams *pWdaParams = (tWDA_HalDumpReqParams *)pUserData; if(NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -11569,11 +12672,13 @@ void WDA_HALDumpCmdCallback(WDI_HALDumpCmdRspParamsType *wdiRspParams, /*Copy the Resp data to UMAC supplied buffer*/ vos_mem_copy(buffer, wdiRspParams->pBuffer, wdiRspParams->usBufferLen); } + + if (!pWdaParams->wdaHALDumpAsync) + {/* Indicate VOSS about the start complete */ + vos_WDAComplete_cback(pWDA->pVosContext); + } vos_mem_free(pWdaParams->wdaWdiApiMsgParam); vos_mem_free(pWdaParams); - - /* Indicate VOSS about the start complete */ - vos_WDAComplete_cback(pWDA->pVosContext); return ; } @@ -11583,12 +12688,13 @@ void WDA_HALDumpCmdCallback(WDI_HALDumpCmdRspParamsType *wdiRspParams, */ VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac, tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, - tANI_U32 arg4, tANI_U8 *pBuffer) + tANI_U32 arg4, tANI_U8 *pBuffer, wpt_boolean async) { WDI_Status status = WDI_STATUS_SUCCESS; WDI_HALDumpCmdReqParamsType *wdiHALDumpCmdReqParam = NULL; WDI_HALDumpCmdReqInfoType *wdiHalDumpCmdInfo = NULL ; - tWDA_ReqParams *pWdaParams ; + tWDA_HalDumpReqParams *pWdaParams ; + pVosContextType pVosContext = NULL; VOS_STATUS vStatus; pVosContext = (pVosContextType)vos_get_global_context(VOS_MODULE_ID_PE, @@ -11609,7 +12715,13 @@ VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac, tANI_U32 cmd, return VOS_STATUS_E_RESOURCES; } - pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; + if (NULL == pVosContext->pWDAContext) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: WDA Context Null", __func__); + return VOS_STATUS_E_RESOURCES; + } + pWdaParams = (tWDA_HalDumpReqParams *)vos_mem_malloc(sizeof(tWDA_HalDumpReqParams)) ; if(NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, @@ -11635,6 +12747,7 @@ VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac, tANI_U32 cmd, wdiHalDumpCmdInfo->argument4 = arg4; wdiHALDumpCmdReqParam->wdiReqStatusCB = NULL ; pWdaParams->pWdaContext = pVosContext->pWDAContext; + pWdaParams->wdaHALDumpAsync = async; /* Response message will be passed through the buffer */ pWdaParams->wdaMsgParam = (void *)pBuffer; @@ -11642,21 +12755,27 @@ VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac, tANI_U32 cmd, /* store Params pass it to WDI */ pWdaParams->wdaWdiApiMsgParam = (void *)wdiHALDumpCmdReqParam ; /* Send command to WDI */ - status = WDI_HALDumpCmdReq(wdiHALDumpCmdReqParam, WDA_HALDumpCmdCallback, pWdaParams); - vStatus = vos_wait_single_event( &(pVosContext->wdaCompleteEvent), WDA_DUMPCMD_WAIT_TIMEOUT ); - if ( vStatus != VOS_STATUS_SUCCESS ) - { - if ( vStatus == VOS_STATUS_E_TIMEOUT ) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout occurred before WDA_HALDUMP complete",__func__); - } - else + status = WDI_HALDumpCmdReq(wdiHALDumpCmdReqParam, WDA_HALDumpCmdCallback, + pWdaParams); + /* For Sync event only wait for rsp until completion of wdaCompleteEvent*/ + if (!async) + { + vStatus = vos_wait_single_event( &(pVosContext->wdaCompleteEvent), + WDA_DUMPCMD_WAIT_TIMEOUT ); + if ( vStatus != VOS_STATUS_SUCCESS ) { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: WDA_HALDUMP reporting other error",__func__); + if ( vStatus == VOS_STATUS_E_TIMEOUT ) + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: Timeout occurred before WDA_HALDUMP complete",__func__); + } + else + { + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: WDA_HALDUMP reporting other error",__func__); + } + VOS_ASSERT(0); } - VOS_ASSERT(0); } return status; } @@ -12205,7 +13324,9 @@ VOS_STATUS WDA_TxComplete( v_PVOID_t pVosContext, vos_pkt_t *pData, tWDA_CbContext *wdaContext= (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); tpAniSirGlobal pMac = (tpAniSirGlobal)VOS_GET_MAC_CTXT((void *)pVosContext) ; - tANI_U32 uUserData; + tANI_U64 uUserData; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "Enter:%s", __func__); if(NULL == wdaContext) { @@ -12213,6 +13334,7 @@ VOS_STATUS WDA_TxComplete( v_PVOID_t pVosContext, vos_pkt_t *pData, "%s:pWDA is NULL", __func__); VOS_ASSERT(0); + vos_pkt_return_packet(pData); return VOS_STATUS_E_FAILURE; } @@ -12223,6 +13345,9 @@ VOS_STATUS WDA_TxComplete( v_PVOID_t pVosContext, vos_pkt_t *pData, if ( WDA_TL_TX_MGMT_TIMED_OUT == uUserData ) { /*Discard frame - no further processing is needed*/ + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, + "%s: MGMT Frame Tx timed out", + __func__); vos_pkt_return_packet(pData); return VOS_STATUS_SUCCESS; } @@ -12238,13 +13363,12 @@ VOS_STATUS WDA_TxComplete( v_PVOID_t pVosContext, vos_pkt_t *pData, else { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, - "%s:packet (%p) is already freed", + "%s:packet (%pK) is already freed", __func__, pData); //Return from here since we reaching here because the packet already timeout return status; } } - /* * Trigger the event to bring the HAL TL Tx complete function to come * out of wait @@ -12273,7 +13397,9 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, pWDATxRxCompFunc pCompFunc, void *pData, pWDAAckFnTxComp pAckTxComp, - tANI_U32 txFlag) + tANI_U32 txFlag, + tANI_U32 txBdToken + ) { VOS_STATUS status = VOS_STATUS_SUCCESS ; tpSirMacFrameCtl pFc = (tpSirMacFrameCtl ) pData; @@ -12281,17 +13407,21 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, tANI_U8 eventIdx = 0; tBssSystemRole systemRole = eSYSTEM_UNKNOWN_ROLE; tpAniSirGlobal pMac; + tpSirTxBdStatus txBdStatus = {0}; + v_TIME_t time_snapshot; + if((NULL == pWDA)||(NULL == pFrmBuf)) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA %p or pFrmBuf %p is NULL", + "%s:pWDA %pK or pFrmBuf %pK is NULL", __func__,pWDA,pFrmBuf); VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; } - + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, - "Tx Mgmt Frame Subtype: %d alloc(%p)", pFc->subType, pFrmBuf); + "Tx Mgmt Frame Subtype: %d alloc(%pK) txBdToken = %u", + pFc->subType, pFrmBuf, txBdToken); pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); if(NULL == pMac) { @@ -12300,9 +13430,7 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; } - - - + /* store the call back function in WDA context */ pWDA->pTxCbFunc = pCompFunc; /* store the call back for the function of ackTxComplete */ @@ -12311,9 +13439,9 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, if( NULL != pWDA->pAckTxCbFunc ) { /* Already TxComp is active no need to active again */ - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "There is already one request pending for tx complete"); - pWDA->pAckTxCbFunc( pMac, 0); + pWDA->pAckTxCbFunc( pMac, &txBdStatus); pWDA->pAckTxCbFunc = NULL; if( VOS_STATUS_SUCCESS != @@ -12324,7 +13452,7 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, } else { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "Tx Complete timeout Timer Stop Success "); } } @@ -12402,6 +13530,15 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } } +#ifdef FEATURE_WLAN_TDLS + /* TDLS Management frames are sent using Peer Sta mask */ + else if ((pFc->type == SIR_MAC_DATA_FRAME) && + (txFlag & HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME)) + { + txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; + + } +#endif vos_atomic_set((uintptr_t*)&pWDA->VosPacketToFree, (uintptr_t)pFrmBuf);/*set VosPacket_freed to pFrmBuf*/ /*Set frame tag to 0 @@ -12411,8 +13548,8 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, if((status = WLANTL_TxMgmtFrm(pWDA->pVosContext, (vos_pkt_t *)pFrmBuf, - frmLen, ucTypeSubType, tid, - WDA_TxComplete, NULL, txFlag)) != VOS_STATUS_SUCCESS) + frmLen, ucTypeSubType, tid, WDA_TxComplete, NULL, txFlag, + txBdToken))!= VOS_STATUS_SUCCESS) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "Sending Mgmt Frame failed - status = %d", status); @@ -12430,6 +13567,7 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, } return VOS_STATUS_E_FAILURE; } + time_snapshot = vos_timer_get_system_time(); /* * Wait for the event to be set by the TL, to get the response of TX * complete, this event should be set by the Callback function called by TL @@ -12441,15 +13579,15 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: Status %d when waiting for TX Frame Event", __func__, status); - pWDA->pTxCbFunc = NULL; /*To stop the limTxComplete being called again , - after the packet gets completed(packet freed once)*/ - - /* TX MGMT fail with COMP timeout, try to detect DXE stall */ - WDA_TransportChannelDebug(pMac, 1, 0); /*Tag Frame as timed out for later deletion*/ - vos_pkt_set_user_data_ptr( (vos_pkt_t *)pFrmBuf, VOS_PKT_USER_DATA_ID_WDA, + vos_pkt_set_user_data_ptr( (vos_pkt_t *)pFrmBuf, VOS_PKT_USER_DATA_ID_WDA, (v_PVOID_t)WDA_TL_TX_MGMT_TIMED_OUT); + pWDA->pTxCbFunc = NULL; /*To stop the limTxComplete being called again , + after the packet gets completed(packet freed once)*/ + + /* TX MGMT fail with COMP timeout, try to detect DXE stall */ + WDA_TransportChannelDebug(pMac, 1, 0); /* check whether the packet was freed already,so need not free again when * TL calls the WDA_Txcomplete routine @@ -12460,6 +13598,8 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, pCompFunc(VOS_GET_MAC_CTXT(pWDA->pVosContext), (vos_pkt_t *)pFrmBuf); } */ + WLANTL_TLDebugMessage(WLANTL_DEBUG_FW_CLEANUP); + if( pAckTxComp ) { pWDA->pAckTxCbFunc = NULL; @@ -12470,8 +13610,19 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, "Tx Complete timeout Timer Stop Failed "); } } + pWDA->mgmtTxfailureCnt++; + + /* SSR if timeout continously for + * WDA_TX_FAILURE_RECOVERY_THRESHOLD times. + */ + if (WDA_TX_FAILURE_RECOVERY_THRESHOLD == + pWDA->mgmtTxfailureCnt) + { + vos_wlanRestart(); + } status = VOS_STATUS_E_FAILURE; } + #ifdef WLAN_DUMP_MGMTFRAMES if (VOS_IS_STATUS_SUCCESS(status)) { @@ -12484,6 +13635,15 @@ VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, if (VOS_IS_STATUS_SUCCESS(status)) { + pWDA->mgmtTxfailureCnt = 0; + if ((vos_timer_get_system_time() - time_snapshot) >= + WDA_TX_TIME_THRESHOLD) + { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Tx Complete took %lu ms", + vos_timer_get_system_time() - time_snapshot); + } + if (pMac->fEnableDebugLog & 0x1) { if ((pFc->type == SIR_MAC_MGMT_FRAME) && @@ -12589,6 +13749,7 @@ VOS_STATUS WDA_ProcessSetSpoofMacAddrReq(tWDA_CbContext *pWDA, if(NULL == pWdaParams) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s: VOS MEM Alloc Failure", __func__); + vos_mem_free(WDI_SpoofMacAddrInfoParams); VOS_ASSERT(0); return VOS_STATUS_E_NOMEM; } @@ -12598,13 +13759,17 @@ VOS_STATUS WDA_ProcessSetSpoofMacAddrReq(tWDA_CbContext *pWDA, pWdaParams->pWdaContext = pWDA; /* Store Upper layer req pointer, as this will be used for response */ - pWdaParams->wdaMsgParam = (void *)pReq ; + pWdaParams->wdaMsgParam = (void *)pReq; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, WDA_MAC_ADDRESS_STR, + WDA_MAC_ADDR_ARRAY(WDI_SpoofMacAddrInfoParams->macAddr)); + /* store Params pass it to WDI */ pWdaParams->wdaWdiApiMsgParam = (void *)WDI_SpoofMacAddrInfoParams ; wdiStatus = WDI_SetSpoofMacAddrReq(WDI_SpoofMacAddrInfoParams, - (WDI_SetSpoofMacAddrRspCb) WDA_SpoofMacAddrRspCallback, - pWdaParams ); + (WDI_SetSpoofMacAddrRspCb) WDA_SpoofMacAddrRspCallback, + pWdaParams ); if(IS_WDI_STATUS_FAILURE(wdiStatus)) { @@ -12626,7 +13791,7 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) { VOS_STATUS status = VOS_STATUS_SUCCESS; tWDA_CbContext *pWDA = NULL ; - if(NULL == pMsg) + if(NULL == pMsg) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "%s:pMsg is NULL", __func__); @@ -12641,7 +13806,7 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) if(NULL == pWDA ) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA is NULL", __func__); + "%s:pWDA is NULL", __func__); VOS_ASSERT(0); vos_mem_free(pMsg->bodyptr); return VOS_STATUS_E_FAILURE; @@ -12999,6 +14164,29 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) (tSirWlanSetRxpFilters *)pMsg->bodyptr); break; } + case WDA_MGMT_LOGGING_INIT_REQ: + { + WDA_ProcessFWLoggingInitReq(pWDA, + (tSirFWLoggingInitParam *)pMsg->bodyptr); + break; + } + case WDA_GET_FRAME_LOG_REQ: + { + WDA_ProcessGetFrameLogReq(pWDA, + (tAniGetFrameLogReq *)pMsg->bodyptr); + break; + } + case WDA_SEND_LOG_DONE_IND: + { + WDA_FWLoggingDXEdoneInd(); + break; + } + case WDA_FATAL_EVENT_LOGS_REQ: + { + WDA_ProcessFatalEventLogsReq(pWDA, + (tSirFatalEventLogsReqParam *)pMsg->bodyptr); + break; + } case WDA_SET_HOST_OFFLOAD: { WDA_ProcessHostOffloadReq(pWDA, (tSirHostOffloadReq *)pMsg->bodyptr); @@ -13056,6 +14244,12 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) WDA_ProcessBtAmpEventReq(pWDA, (tSmeBtAmpEvent *)pMsg->bodyptr); break; } + case WDA_FW_STATS_GET_REQ: + { + WDA_ProcessFWStatsGetReq(pWDA, + (tSirFWStatsGetReq *)pMsg->bodyptr); + break; + } #ifdef WLAN_FEATURE_LINK_LAYER_STATS case WDA_LINK_LAYER_STATS_SET_REQ: { @@ -13438,6 +14632,33 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) WDA_ProcessEncryptMsgReq(pWDA, (u8 *)pMsg->bodyptr); break; } + + case WDA_NAN_REQUEST: + { + WDA_ProcessNanRequest( pWDA, (tNanRequest *)pMsg->bodyptr); + break; + } + case WDA_SET_RTS_CTS_HTVHT: + { + WDA_ProcessSetRtsCtsHTVhtInd( pWDA, pMsg->bodyval); + break; + } + + case WDA_MON_START_REQ: + { + WDA_ProcessMonStartReq(pWDA,(v_PVOID_t)pMsg->bodyptr); + break; + } + case WDA_MON_STOP_REQ: + { + WDA_ProcessMonStopReq(pWDA, (v_PVOID_t)pMsg->bodyptr); + break; + } + case WDA_SEND_FREQ_RANGE_CONTROL_IND: + { + WDA_ProcessEnableDisableCAEventInd(pWDA, pMsg->bodyval); + break; + } default: { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -13465,10 +14686,10 @@ void WDA_lowLevelIndCallback(WDI_LowLevelIndType *wdiLowLevelInd, #if defined WLAN_FEATURE_NEIGHBOR_ROAMING tSirRSSINotification rssiNotification; #endif - if(NULL == pWDA) + if (NULL == pWDA) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA is NULL", __func__); + "%s:pWDA is NULL", __func__); VOS_ASSERT(0); return ; } @@ -13688,13 +14909,16 @@ void WDA_lowLevelIndCallback(WDI_LowLevelIndType *wdiLowLevelInd, { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "Tx Complete timeout Timer Stop Failed "); - } - pWDA->pAckTxCbFunc( pMac, wdiLowLevelInd->wdiIndicationData.tx_complete_status); + } + if (!IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) + pWDA->pAckTxCbFunc( pMac, &wdiLowLevelInd->wdiIndicationData.tx_complete_status); + else + pWDA->pAckTxCbFunc( pMac, &wdiLowLevelInd->wdiIndicationData.wdiTxBdInd); pWDA->pAckTxCbFunc = NULL; } else { - VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "Tx Complete Indication is received after timeout "); } break; @@ -14287,7 +15511,88 @@ void WDA_lowLevelIndCallback(WDI_LowLevelIndType *wdiLowLevelInd, (void *)pDelBAInd , 0) ; break; } + case WDI_NAN_EVENT_IND: + { + vos_msg_t vosMsg; + tpSirNanEvent pSirNanEvent = NULL; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "Received WDI_NAN_EVENT"); + + pSirNanEvent = (tpSirNanEvent)vos_mem_malloc( sizeof( tSirNanEvent ) + - sizeof( pSirNanEvent->event_data) + + wdiLowLevelInd->wdiIndicationData.wdiNanEvent.event_data_len); + + if (NULL == pSirNanEvent) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0) ; + break; + } + + pSirNanEvent->event_data_len = + wdiLowLevelInd->wdiIndicationData.wdiNanEvent.event_data_len; + + if (wdiLowLevelInd->wdiIndicationData.wdiNanEvent.event_data_len) + { + vos_mem_copy( pSirNanEvent->event_data, + wdiLowLevelInd->wdiIndicationData.wdiNanEvent.event_data, + wdiLowLevelInd->wdiIndicationData.wdiNanEvent.event_data_len); + } + + /* VOS message wrapper */ + vosMsg.type = eWNI_SME_NAN_EVENT; + vosMsg.bodyptr = pSirNanEvent; + vosMsg.bodyval = 0; + + /* Send message to SME */ + if (VOS_STATUS_SUCCESS + != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) + { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, + "post eWNI_SME_NAN_EVENT to SME Failed"); + vos_mem_free(pSirNanEvent); + } + break; + } + case WDI_LOST_LINK_PARAMS_IND: + { + tpSirSmeLostLinkParamsInd pLostLinkParamInd = + (tpSirSmeLostLinkParamsInd)vos_mem_malloc(sizeof(tSirSmeLostLinkParamsInd)); + if (NULL == pLostLinkParamInd) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + break; + } + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "Received WDI_LOST_LINK_PARAMS_IND from WDI "); + + pLostLinkParamInd->messageType = eWNI_SME_LOST_LINK_PARAMS_IND; + pLostLinkParamInd->length = sizeof(tSirSmeMicFailureInd); + pLostLinkParamInd->info.bssIdx = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.bssIdx; + pLostLinkParamInd->info.rssi = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.rssi; + vos_mem_copy(pLostLinkParamInd->info.selfMacAddr, + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.selfMacAddr, + sizeof(tSirMacAddr)); + pLostLinkParamInd->info.linkFlCnt = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.linkFlCnt; + pLostLinkParamInd->info.linkFlTx = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.linkFlTx; + pLostLinkParamInd->info.lastDataRate = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.lastDataRate; + pLostLinkParamInd->info.rsvd1 = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.rsvd1; + pLostLinkParamInd->info.rsvd2 = + wdiLowLevelInd->wdiIndicationData.wdiLostLinkParamsInd.rsvd2; + WDA_SendMsg(pWDA, SIR_HAL_LOST_LINK_PARAMS_IND, + (void *)pLostLinkParamInd , 0) ; + break; + } default: { /* TODO error */ @@ -14523,10 +15828,10 @@ void WDA_BaCheckActivity(tWDA_CbContext *pWDA) WDI_TriggerBAReqCandidateType baCandidate[WDA_MAX_STA] = {{0}} ; tpAniSirGlobal pMac; - if(NULL == pWDA) + if (NULL == pWDA) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, - "%s:pWDA is NULL", __func__); + "%s:pWDA is NULL", __func__); VOS_ASSERT(0); return ; } @@ -14597,8 +15902,10 @@ void WDA_BaCheckActivity(tWDA_CbContext *pWDA) } else if(!WDA_GET_BA_TXFLAG(pWDA, curSta, tid) && (WLANTL_STA_AUTHENTICATED == tlSTAState) - && (txPktCount >= WDA_LAST_POLLED_THRESHOLD(pWDA, - curSta, tid))) + && (((eSYSTEM_STA_IN_IBSS_ROLE == + pWDA->wdaGlobalSystemRole) && txPktCount ) + || (txPktCount >= WDA_LAST_POLLED_THRESHOLD(pWDA, + curSta, tid)))) { /* get prepare for sending message to HAL */ //baCandidate[baCandidateCount].staIdx = curSta ; @@ -14829,11 +16136,14 @@ void WDA_TimerHandler(v_VOID_t* pContext, tANI_U32 timerInfo) void WDA_ProcessTxCompleteTimeOutInd(tWDA_CbContext* pWDA) { tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext) ; + tpSirTxBdStatus txBdStatus = {0}; + if( pWDA->pAckTxCbFunc ) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, "TxComplete timer expired"); - pWDA->pAckTxCbFunc( pMac, 0); + /*Indicate failure*/ + pWDA->pAckTxCbFunc( pMac, &txBdStatus); pWDA->pAckTxCbFunc = NULL; } else @@ -15147,12 +16457,13 @@ void WDA_ConvertSirAuthToWDIAuth(WDI_AuthType *AuthType, v_U8_t csrAuthType) case eCSR_AUTH_TYPE_AUTOSWITCH: *AuthType = eWDA_AUTH_TYPE_OPEN_SYSTEM; break; -#if 0 - case eCSR_AUTH_TYPE_SHARED_KEY: - *AuthType = eWDA_AUTH_TYPE_SHARED_KEY; +#ifdef WLAN_FEATURE_11W + case eCSR_AUTH_TYPE_RSN_PSK_SHA256: + *AuthType = eWDA_AUTH_TYPE_RSN_PSK_SHA256; + break; + case eCSR_AUTH_TYPE_RSN_8021X_SHA256: + *AuthType = eWDA_AUTH_TYPE_RSN_8021X_SHA256; break; - case eCSR_AUTH_TYPE_AUTOSWITCH: - *AuthType = eWDA_AUTH_TYPE_AUTOSWITCH; #endif default: VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, @@ -15389,7 +16700,7 @@ void WDA_RssiFilterReqCallback(WDI_Status wdiStatus, void* pUserData) return; } /* - * FUNCTION: WDA_ProcessSetPreferredNetworkList + * FUNCTION: WDA_ProcessSetRssiFilterReq * Request to WDI to set Preferred Network List.Offload */ VOS_STATUS WDA_ProcessSetRssiFilterReq(tWDA_CbContext *pWDA, @@ -16412,6 +17723,11 @@ VOS_STATUS WDA_ProcessTxControlInd(tWDA_CbContext *pWDA, return wdaStatus; } +void WDA_FWLoggingDXEdoneInd(void) +{ + WDI_FWLoggingDXEdoneInd(NULL); +} + /* FUNCTION WDA_featureCapsExchange * WDA API to invoke capability exchange between host and FW. */ @@ -16483,16 +17799,18 @@ VOS_STATUS WDA_shutdown(v_PVOID_t pVosContext, wpt_boolean closeTransport) VOS_ASSERT(0); } - if ( (eDRIVER_TYPE_MFG != pWDA->driverMode) && - (VOS_TRUE == pWDA->wdaTimersCreated)) + if (eDRIVER_TYPE_MFG != pWDA->driverMode) { - wdaDestroyTimers(pWDA); - pWDA->wdaTimersCreated = VOS_FALSE; + if(VOS_TRUE == pWDA->wdaTimersCreated) + { + wdaDestroyTimers(pWDA); + pWDA->wdaTimersCreated = VOS_FALSE; + } } else { vos_event_destroy(&pWDA->ftmStopDoneEvent); - } + } /* call WDI shutdown */ wdiStatus = WDI_Shutdown(closeTransport); @@ -16681,6 +17999,27 @@ void WDA_TransportChannelDebug return; } +/*========================================================================== + FUNCTION WDA_TransportKickDxe + + DESCRIPTION + Request Kick Dxe when first hdd TX time out + happens + + PARAMETERS + NONE + + RETURN VALUE + NONE + +===========================================================================*/ +void WDA_TransportKickDxe() +{ + WDI_TransportKickDxe(); + return; +} + + /*========================================================================== FUNCTION WDA_SetEnableSSR @@ -18057,6 +19396,71 @@ VOS_STATUS WDA_ProcessLLStatsClearReq(tWDA_CbContext *pWDA, #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +void WDA_FWStatsGetRspCallback(WDI_Status status,void *fwStatsResp,void *pUserData) +{ + tSirFWStatsInfo *fwStatsinfo = (tSirFWStatsInfo *)pUserData; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s " ,__func__); + if (NULL == fwStatsinfo) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0); + return; + } + + if(fwStatsinfo->callback) + fwStatsinfo->callback(status, fwStatsResp, fwStatsinfo->data); + + vos_mem_free(pUserData); + return; +} + + +v_VOID_t WDA_ProcessFWStatsGetReq(tWDA_CbContext *pWDA, + tSirFWStatsGetReq *pData) +{ + + WDI_Status wdiStatus; + tSirFWStatsInfo *fwStatsinfo; + + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "------> %s" , __func__); + + fwStatsinfo = + (tSirFWStatsInfo *)vos_mem_malloc(sizeof(tSirFWStatsInfo)); + if (NULL == fwStatsinfo) + { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: VOS MEM Alloc Failure", __func__); + VOS_ASSERT(0); + vos_mem_free(pData); + return; + } + + fwStatsinfo->callback = (tSirFWStatsCallback)(pData->callback); + fwStatsinfo->data = pData->data; + + wdiStatus = WDI_FWStatsGetReq(fwStatsinfo, + WDA_FWStatsGetRspCallback, + pData->stats); + if (WDI_STATUS_PENDING == wdiStatus) + { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "Pending received for %s:%d ", __func__, __LINE__); + } + else if (WDI_STATUS_SUCCESS != wdiStatus) + { + if (fwStatsinfo->callback) + { + fwStatsinfo->callback(WDI_STATUS_E_FAILURE, NULL ,fwStatsinfo->data); + } + vos_mem_free(fwStatsinfo); + } + vos_mem_free(pData); +} + /*========================================================================== FUNCTION WDA_EncryptMsgRspCallback @@ -18193,3 +19597,146 @@ VOS_STATUS WDA_ProcessEncryptMsgReq(tWDA_CbContext *pWDA, } return CONVERT_WDI2VOS_STATUS(status); } +/*========================================================================== + FUNCTION WDA_ProcessSetRtsCtsHTVhtInd + + DESCRIPTION + API to enable/disable RTS/CTS for different modes. + + PARAMETERS + pWDA: Pointer to WDA context + rtsCtsVal : Bit mask value to enable RTS/CTS for different modes +===========================================================================*/ + +VOS_STATUS +WDA_ProcessSetRtsCtsHTVhtInd(tWDA_CbContext *pWDA, + tANI_U32 rtsCtsVal) +{ + WDI_Status status; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("---> %s"), __func__); + status = WDI_SetRtsCtsHTVhtInd(rtsCtsVal); + if (WDI_STATUS_PENDING == status) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("pending status received ")); + } + else if (WDI_STATUS_SUCCESS_SYNC != status) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + FL("Failure status %d"), status); + } + return CONVERT_WDI2VOS_STATUS(status) ; +} + +void WDA_MonModeRspCallback(void *pEventData, void* pUserData) +{ + tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; + tSirMonModeReq *pData; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + "<------ %s " ,__func__); + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: pWdaParams received NULL", __func__); + VOS_ASSERT(0) ; + return ; + } + pData = (tSirMonModeReq *)pWdaParams->wdaMsgParam; + if (pData != NULL && pData->callback != NULL) { + pData->callback(pData->context); + vos_mem_free(pWdaParams->wdaMsgParam); + } + vos_mem_free(pWdaParams) ; + + return; +} + +VOS_STATUS WDA_ProcessMonStartReq( tWDA_CbContext *pWDA, void *wdaRequest) +{ + + WDI_Status status = WDI_STATUS_SUCCESS; + tWDA_ReqParams *pWdaParams; + tSirMonModeReq *pMonModeData = (tSirMonModeReq *)wdaRequest; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("%s: "), __func__); + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)); + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + FL("%s: VOS MEM Alloc Failure"), __func__); + VOS_ASSERT(0); + return VOS_STATUS_E_NOMEM; + } + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = wdaRequest; + pWdaParams->wdaWdiApiMsgParam = NULL; + + status = WDI_MonStartReq(pMonModeData->data, + (WDI_MonModeRspCb)WDA_MonModeRspCallback, + (void *)pWdaParams); + if (IS_WDI_STATUS_FAILURE(status)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure to request. Free all the memory " ); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + } + return CONVERT_WDI2VOS_STATUS(status); +} + +VOS_STATUS WDA_ProcessMonStopReq( tWDA_CbContext *pWDA, void* wdaRequest) +{ + + WDI_Status status = WDI_STATUS_SUCCESS; + tWDA_ReqParams *pWdaParams; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("%s: "), __func__); + pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)); + if (NULL == pWdaParams) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + FL("%s: VOS MEM Alloc Failure"), __func__); + VOS_ASSERT(0); + return VOS_STATUS_E_NOMEM; + } + pWdaParams->pWdaContext = pWDA; + pWdaParams->wdaMsgParam = wdaRequest; + pWdaParams->wdaWdiApiMsgParam = NULL; + + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "%s: Processing Mon stop request", __func__); + status = WDI_MonStopReq((WDI_MonModeRspCb)WDA_MonModeRspCallback, + (void *)pWdaParams); + + if (IS_WDI_STATUS_FAILURE(status)) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failure to request. Free all the memory " ); + vos_mem_free(pWdaParams->wdaMsgParam); + vos_mem_free(pWdaParams); + } + return CONVERT_WDI2VOS_STATUS(status); +} + +VOS_STATUS WDA_ProcessEnableDisableCAEventInd(tWDA_CbContext *pWDA, tANI_U8 val) +{ + WDI_Status status; + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("---> %s"), __func__); + status = WDI_EnableDisableCAEventInd(val); + if (WDI_STATUS_PENDING == status) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, + FL("pending status received ")); + } + else if (WDI_STATUS_SUCCESS_SYNC != status) + { + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + FL("Failure status %d"), status); + } + return CONVERT_WDI2VOS_STATUS(status) ; +} diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_debug.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_debug.c index 3e0b97dfaf0a..5f3cabc5c22c 100644 --- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_debug.c +++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_debug.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_ds.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_ds.c index 71dc706b0f64..5f3dfba1e26b 100644 --- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_ds.c +++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_ds.c @@ -43,9 +43,6 @@ Are listed for each API below. - Copyright (c) 2010-2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -142,6 +139,19 @@ void WDA_TLI_FastHwFwdDataFrame } #endif /*WLAN_PERF*/ +void WDA_DS_RxLogCallback(void) +{ + vos_msg_t vosMessage; + + vosMessage.bodyptr = NULL; + vosMessage.reserved = 0; + vosMessage.type = WDA_SEND_LOG_DONE_IND; + if (VOS_STATUS_SUCCESS != vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage )) + VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "WLAN WDA:Posting DXE logging done indication failed" ); + return; +} + /*========================================================================== FUNCTION WDA_DS_Register @@ -238,6 +248,7 @@ VOS_STATUS WDA_DS_Register (WDI_DS_TxCompleteCallback)WDA_DS_TxCompleteCB, (WDI_DS_RxPacketCallback)pfnRxPacketCallback, WDA_DS_TxFlowControlCallback, + WDA_DS_RxLogCallback, pvosGCtx ); if ( WDI_STATUS_SUCCESS != wdiStatus ) @@ -424,7 +435,8 @@ WDA_DS_BuildTxPacketInfo v_U32_t txFlag, v_U32_t timeStamp, v_U8_t ucIsEapol, - v_U8_t ucUP + v_U8_t ucUP, + v_U32_t ucTxBdToken ) { VOS_STATUS vosStatus; @@ -469,7 +481,7 @@ WDA_DS_BuildTxPacketInfo pTxMetaInfo->fdisableFrmXlt = ucDisableFrmXtl; pTxMetaInfo->frmType = ( ( typeSubtype & 0x30 ) >> 4 ); pTxMetaInfo->typeSubtype = typeSubtype; - + pTxMetaInfo->txBdToken = ucTxBdToken; /* Length = MAC header + payload */ vos_pkt_get_packet_length( vosDataBuff, pusPktLen); pTxMetaInfo->fPktlen = *pusPktLen; diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_legacy.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_legacy.c index 6cb08e5ca0c7..176aabf90e98 100644 --- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_legacy.c +++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda_legacy.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /* Standard include files */ @@ -178,6 +175,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb) switch (msg.type & HAL_MMH_MB_MSG_TYPE_MASK) { case WDA_MSG_TYPES_BEGIN: // Posts a message to the HAL MsgQ + case WDA_EXT_MSG_TYPES_BEGIN: wdaPostCtrlMsg(pMac, &msg); break; diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi.h index 306d6e1863cf..0b614bd2f730 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ DESCRIPTION module. - Copyright (c) 2010-2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -155,6 +152,9 @@ of NV fragment is nt possbile.The next multiple of 1Kb is 3K */ #define PERIODIC_TX_PTRN_MAX_SIZE 1536 #define MAXNUM_PERIODIC_TX_PTRNS 6 #define WDI_DISA_MAX_PAYLOAD_SIZE 1600 +#define MAX_NUM_OF_BUFFER 3 +#define VALID_FW_LOG_TYPES 2 +#define MAX_LOG_BUFFER_LENGTH 128 * 1024 /*============================================================================ * GENERIC STRUCTURES @@ -417,7 +417,8 @@ typedef enum #endif /*Delete BA Ind*/ WDI_DEL_BA_IND, - + WDI_NAN_EVENT_IND, + WDI_LOST_LINK_PARAMS_IND, WDI_MAX_IND }WDI_LowLevelIndEnumType; @@ -618,6 +619,13 @@ typedef struct } WDI_WakeReasonIndType; #endif // WLAN_WAKEUP_EVENTS +typedef struct +{ + wpt_uint16 event_data_len; + wpt_uint8* event_data; +} WDI_NanEventType; + + /*--------------------------------------------------------------------------- WDI_MissedBeaconIndType -----------------------------------------------------------------------------*/ @@ -728,6 +736,19 @@ typedef struct #endif +typedef struct +{ + wpt_uint8 bssIdx; + wpt_uint8 rssi; + wpt_uint8 selfMacAddr[WDI_MAC_ADDR_LEN]; + wpt_uint32 linkFlCnt; + wpt_uint32 linkFlTx; + wpt_uint32 lastDataRate; + wpt_uint32 rsvd1; + wpt_uint32 rsvd2; + +}WDI_LostLinkParamsIndType; + /*--------------------------------------------------------------------------- WDI_IbssPeerInactivityIndType -----------------------------------------------------------------------------*/ @@ -812,8 +833,23 @@ typedef struct } WDI_RateUpdateIndParams; +typedef struct +{ + wpt_uint32 ubsp_enter_cnt; + wpt_uint32 ubsp_jump_ddr_cnt; +}ubspFwStats; + +typedef struct +{ + wpt_uint32 type; + /*data*/ + union{ + ubspFwStats ubspStats; + }wdiFwStatsData; +} WDI_FWStatsResults; + #ifdef FEATURE_WLAN_CH_AVOID -#define WDI_CH_AVOID_MAX_RANGE 4 +#define WDI_CH_AVOID_MAX_RANGE 15 typedef struct { @@ -856,6 +892,11 @@ typedef struct wpt_macAddr bssId; // TO SUPPORT BT-AMP } WDI_DeleteBAIndType; +typedef struct +{ + wpt_uint32 tx_complete_status; + wpt_uint32 tx_bd_token; +} WDI_TxBDStatus; /*--------------------------------------------------------------------------- WDI_LowLevelIndType Inidcation type and information about the indication being carried @@ -934,6 +975,11 @@ typedef struct void *pEXTScanIndData; #endif WDI_DeleteBAIndType wdiDeleteBAInd; + + WDI_NanEventType wdiNanEvent; + + WDI_TxBDStatus wdiTxBdInd; + WDI_LostLinkParamsIndType wdiLostLinkParamsInd; } wdiIndicationData; }WDI_LowLevelIndType; @@ -2637,6 +2683,42 @@ typedef struct wpt_uint32 reserved; }WDI_SpoofMacAddrRspParamType; +/*--------------------------------------------------------------------------- + WDI_GetFrameLogRspParamType +---------------------------------------------------------------------------*/ +typedef struct +{ + /* wdi status */ + wpt_uint32 wdiStatus; +}WDI_GetFrameLogRspParamType; +/*--------------------------------------------------------------------------- + WDI_FWLoggingInitRspParamType +---------------------------------------------------------------------------*/ +typedef struct +{ + //FW mail box address + wpt_uint64 logMailBoxAddr; + wpt_uint32 status; + //Logging mail box version + wpt_uint8 logMailBoxVer; + //Qshrink is enabled + wpt_boolean logCompressEnabled; + //Reserved for future purpose + wpt_uint32 reserved0; + wpt_uint32 reserved1; + wpt_uint32 reserved2; +}WDI_FWLoggingInitRspParamType; + + +/*--------------------------------------------------------------------------- + WDI_FatalEventLogsRspParamType +---------------------------------------------------------------------------*/ +typedef struct +{ + /* wdi status */ + wpt_uint32 wdiStatus; +}WDI_FatalEventLogsRspParamType; + /*--------------------------------------------------------------------------- WDI_AddBAReqinfoType ---------------------------------------------------------------------------*/ @@ -4009,6 +4091,35 @@ typedef struct void* pUserData; }WDI_ConfigureRxpFilterReqParamsType; +typedef struct +{ + wpt_uint8 enableFlag; + wpt_uint8 frameType; + wpt_uint8 frameSize; + wpt_uint8 bufferMode; + wpt_uint8 continuousFrameLogging; + wpt_uint8 minLogBufferSize; + wpt_uint8 maxLogBufferSize; +}WDI_FWLoggingInitReqInfoType; + +typedef struct +{ + wpt_uint32 reason_code; +}WDI_FatalEventLogsReqInfoType; + + +typedef struct +{ + wpt_uint8 flags; +}WDI_GetFrameLogReqInfoType; + +typedef struct +{ + wpt_uint64 logBuffAddress[MAX_NUM_OF_BUFFER]; + wpt_uint32 status; + wpt_uint32 logBuffLength[MAX_NUM_OF_BUFFER]; +}WDI_FWLoggingDXEdoneIndInfoType; + /*--------------------------------------------------------------------------- WDI_BeaconFilterInfoType Beacon Filtering data structures passed to WDA form UMAC @@ -5699,6 +5810,16 @@ typedef struct void* pUserData; } WDI_AddPeriodicTxPtrnParamsType; +/*--------------------------------------------------------------------------- + WDI_NanRequestType +---------------------------------------------------------------------------*/ +typedef struct +{ + wpt_uint16 request_data_len; + wpt_uint8 request_data[1]; +} WDI_NanRequestType; + + /*--------------------------------------------------------------------------- WDI_DelPeriodicTxPtrnParamsType ---------------------------------------------------------------------------*/ @@ -5922,6 +6043,7 @@ typedef enum /* Max key size including the WAPI and TKIP */ #define WLAN_MAX_KEY_RSC_LEN 16 // Definition for Encryption Keys +//typedef struct sSirKeys typedef struct { wpt_uint8 keyId; @@ -5995,6 +6117,31 @@ typedef struct wpt_payload data; }wpt_pkt80211; +#define NUM_FILTERS_SUPPORTED 1 +typedef struct +{ + wpt_macAddr macAddr; + wpt_uint8 isA1filter; + wpt_uint8 isA2filter; + wpt_uint8 isA3filter; +}WDI_filter; + +typedef struct +{ + /* start or stop */ + wpt_uint8 state; + /*Conversion of packet required or not*/ + wpt_uint8 is80211to803ConReq; + wpt_uint32 ChannelNo; + wpt_uint32 ChannelBW; + wpt_uint8 crcCheckEnabled; + wpt_uint8 numOfMacFilters; + WDI_filter mmFilters[NUM_FILTERS_SUPPORTED]; + wpt_uint64 typeSubtypeBitmap; + wpt_uint64 rsvd; + +}WDI_MonStartReqType; + /*---------------------------------------------------------------------------- * WDI callback types *--------------------------------------------------------------------------*/ @@ -7903,7 +8050,18 @@ typedef void (*WDI_LLStatsClearRspCb)(void *pEventData, typedef void (*WDI_SetSpoofMacAddrRspCb)( WDI_SpoofMacAddrRspParamType* wdiRsp, void *pUserData); +typedef void (*WDI_FWStatsGetRspCb)(WDI_Status status,void *fwStatsResp, + void *pUserData); + typedef void (*WDI_EncryptMsgRspCb)(wpt_uint8 status, void *pEventData, void* pUserData); +typedef void (*WDI_FWLoggingInitRspCb)( + WDI_FWLoggingInitRspParamType *wdiRsp, void *pUserData); +typedef void (*WDI_GetFrameLogRspCb)( + WDI_GetFrameLogRspParamType *wdiRsp, void *pUserData); +typedef void (*WDI_FatalEventLogsRspCb)( + WDI_FatalEventLogsRspParamType *wdiRsp, void *pUserData); + +typedef void (*WDI_MonModeRspCb)(void *pEventData,void *pUserData); /*======================================================================== * Function Declarations and Documentation @@ -9333,6 +9491,100 @@ WDI_SetUapsdAcParamsReq void* pUserData ); + +/** + @brief WDI_FatalEventLogsReq will be called when the upper + MAC wants to send the fatal event req. Upon the call of + this API the WLAN DAL will pack and send a HAL + Fatal event request message to the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiFatalEventLogsReqInfo: the Fatal event logs params + as specified by the Device Interface + + wdiFatalEventLogsRspCb: callback for passing back the + response of the fatal event operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ + +WDI_Status +WDI_FatalEventLogsReq +( + WDI_FatalEventLogsReqInfoType *pwdiFatalEventLogsReqInfo, + WDI_FatalEventLogsRspCb wdiFatalEventLogsRspCb, + void* pUserData +); + +/** + @brief WDI_GetFrameLogReq will be called when the upper + MAC wants to initialize frame logging. Upon the call of + this API the WLAN DAL will pack and send a HAL + Frame logging init request message to + the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiGetFrameLogReqInfo: the Frame Logging params + as specified by the Device Interface + + wdiGetFrameLogReqCb: callback for passing back the + response of the frame logging init operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ +WDI_Status +WDI_GetFrameLogReq +( + WDI_GetFrameLogReqInfoType *pwdiGetFrameLogReqInfo, + WDI_GetFrameLogRspCb wdiGetFrameLogReqCb, + void* pUserData +); + +/** + @brief WDI_FWLoggingInitReq will be called when the upper + MAC wants to initialize frame logging. Upon the call of + this API the WLAN DAL will pack and send a HAL + Frame logging init request message to + the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiFWLoggingInitReqParams: the Frame Logging params + as specified by the Device Interface + + wdiFWLoggingInitReqCb: callback for passing back the + response of the frame logging init operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ +WDI_Status +WDI_FWLoggingInitReq +( + WDI_FWLoggingInitReqInfoType *pwdiFWLoggingInitReqInfo, + WDI_FWLoggingInitRspCb wdiFWLoggingInitReqCb, + void* pUserData +); + /** @brief WDI_ConfigureRxpFilterReq will be called when the upper MAC wants to set/reset the RXP filters for received pkts @@ -10948,6 +11200,16 @@ void WDI_TransportChannelDebug wpt_uint8 debugFlags ); +/** + @brief WDI_TransportKickDxe - + Request Kick DXE when first HDD TX time out + happens + @param none + @see + @return none +*/ +void WDI_TransportKickDxe(void); + /** @brief WDI_SsrTimerCB Callback function for SSR timer, if this is called then the graceful @@ -11187,6 +11449,26 @@ WDI_Status WDI_LLStatsClearReq ); #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +WDI_Status WDI_FWStatsGetReq +( + void* pwdiFWStatsGetReqParams, + WDI_FWStatsGetRspCb wdiFWStatsGetRspCb, + wpt_uint32 pUserData +); + +WDI_Status WDI_MonStartReq +( + WDI_MonStartReqType* pwdiMonStartReqParams, + WDI_MonModeRspCb wdiMonModeRspCb, + void* pUserData +); + +WDI_Status WDI_MonStopReq +( + WDI_MonModeRspCb wdiMonModeRspCb, + void* pUserData +); + #ifdef FEATURE_WLAN_BATCH_SCAN /** @brief WDI_SetBatchScanReq @@ -11273,6 +11555,63 @@ WDI_EncryptMsgReq(void* pwdiEncryptMsgParams, WDI_EncryptMsgRspCb wdiEncryptMsgCbRsp, void* pUserData ); + +/** + @brief WDI_NanRequest + NAN request + + @param pwdiNanRequest: data + + pwdiNanCb: callback + + usrData: user data will be passed back with the + callback + + @return Result of the function call +*/ +WDI_Status +WDI_NanRequest +( + WDI_NanRequestType *pwdiNanRequest, + void *usrData +); + +/** + @brief WDI_SetRtsCtsHTVhtInd + Set RTS/CTS indication for diff modes. + + @param rtsCtsVal: Bit mask value to enable RTS/CTS for different modes + + @return Result of the function call +*/ + +WDI_Status +WDI_SetRtsCtsHTVhtInd +( + wpt_uint32 rtsCtsVal +); + +WDI_Status +WDI_FWLoggingDXEdoneInd +( + WDI_FWLoggingDXEdoneIndInfoType* pwdiFWLoggingDXEdoneInd +); + +/** + @brief WDI_EnableDisableCAEventInd + Enable/Disable Chan Avoidance indication + + @param val: Enable/Disable Chan Avoidance indication + + @return Result of the function call +*/ + +WDI_Status +WDI_EnableDisableCAEventInd +( +wpt_uint32 val +); + #ifdef __cplusplus } #endif diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_bd.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_bd.h index 560b8485ec44..59de6aa99467 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_bd.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_bd.h @@ -1151,6 +1151,7 @@ typedef struct wpt_uint32 csuTcpUdpStartOffset:10; #endif #endif /*WCN_PRONTO*/ + wpt_uint32 txBdToken; } WDI_TxBdType; diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_cfg.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_cfg.h index 7db17ae07566..90e7bce6712d 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_cfg.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_cfg.h @@ -42,8 +42,6 @@ DESCRIPTION by the same name !! - Copyright (c) 2010 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h index 6e00dfa7d94b..76b3395a04ed 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h @@ -43,8 +43,6 @@ DESCRIPTION module to be used by the DAL Data Path Core. - Copyright (c) 2010 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ @@ -126,7 +124,9 @@ when who what, where, why This dynamically changes ACK_POLICY = TRUE for multicast frames */ #define WDI_RELIABLE_MCAST_REQUESTED_MASK 0x100 -#define WDI_USE_BD_RATE_MASK 0x1000 +#define WDI_USE_BD_RATE_1_MASK 0x1000 +#define WDI_USE_BD_RATE_2_MASK 0x2000 +#define WDI_USE_BD_RATE_3_MASK 0x4000 #define WDI_USE_FW_IN_TX_PATH 0x200 //bit 9 used to route the frames to Work Queue 5 /*Macro for getting the size of the TX BD*/ @@ -428,7 +428,8 @@ WDI_FillTxBd wpt_uint8 ucProtMgmtFrame, wpt_uint32 uTimeStamp, wpt_uint8 isEapol, - wpt_uint8* staIndex + wpt_uint8* staIndex, + wpt_uint32 txBdToken ); /** diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_i.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_i.h index 6f1f68564285..d921d371255b 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_i.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_i.h @@ -465,8 +465,20 @@ typedef enum WDI_SPOOF_MAC_ADDR_REQ = 101, + WDI_GET_FW_STATS_REQ = 102, + /* Send command to encrypt the given message */ - WDI_ENCRYPT_MSG_REQ = 102, + WDI_ENCRYPT_MSG_REQ = 103, + + WDI_FW_LOGGING_INIT_REQ = 104, + WDI_GET_FRAME_LOG_REQ = 105, + + /* NAN Request */ + WDI_NAN_REQUEST = 106, + + WDI_MON_START_REQ = 107, + WDI_MON_STOP_REQ = 108, + WDI_FATAL_EVENT_LOGGING_REQ = 109, WDI_MAX_REQ, @@ -506,9 +518,12 @@ typedef enum /* csa channel switch req*/ WDI_CH_SWITCH_REQ_V1, WDI_TDLS_CHAN_SWITCH_REQ, + WDI_SET_RTS_CTS_HTVHT_IND, + WDI_FW_LOGGING_DXE_DONE_IND, + WDI_SEND_FREQ_RANGE_CONTROL_IND, /*Keep adding the indications to the max request - such that we keep them sepparate */ + such that we keep them separate */ WDI_MAX_UMAC_IND }WDI_RequestEnumType; @@ -793,9 +808,20 @@ typedef enum WDI_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_RSP = 100, #endif WDI_SPOOF_MAC_ADDR_RSP = 101, + WDI_GET_FW_STATS_RSP = 102, /* Send command to encrypt the given message */ - WDI_ENCRYPT_MSG_RSP = 102, + WDI_ENCRYPT_MSG_RSP = 103, + + WDI_FW_LOGGING_INIT_RSP = 104, + WDI_GET_FRAME_LOG_RSP = 105, + + WDI_NAN_RESPONSE = 106, + + WDI_MON_START_RSP = 107, + WDI_MON_STOP_RSP = 108, + WDI_FATAL_EVENT_LOGGING_RSP = 109, + /*------------------------------------------------------------------------- Indications !! Keep these last in the enum if possible @@ -874,6 +900,8 @@ typedef enum #endif WDI_TDLS_CHAN_SWITCH_REQ_RESP = WDI_HAL_IND_MIN + 26, WDI_HAL_DEL_BA_IND = WDI_HAL_IND_MIN + 27, + WDI_HAL_NAN_EVENT = WDI_HAL_IND_MIN + 28, + WDI_HAL_LOST_LINK_PARAMS_IND = WDI_HAL_IND_MIN + 29, WDI_MAX_RESP }WDI_ResponseEnumType; @@ -1234,6 +1262,9 @@ typedef struct /* reason for WDI_DetectedDeviceError */ void * DeviceErrorReason; + + /* Roam delay statistic enabled in ini*/ + wpt_uint8 roamDelayStatsEnabled; }WDI_ControlBlockType; @@ -5831,6 +5862,20 @@ WDI_ProcessBatchScanResultInd #endif /* FEATURE_WLAN_BATCH_SCAN */ +WDI_Status +WDI_ProcessGetFwStatsReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessGetFwStatsRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + #ifdef FEATURE_WLAN_CH_AVOID /** @brief v - @@ -6083,6 +6128,55 @@ WDI_ProcessSpoofMacAddrRsp WDI_EventInfoType* pEventData ); +WDI_Status +WDI_ProcessGetFrameLogRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); +WDI_Status +WDI_ProcessGetFrameLogReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessFWLoggingDXEdoneInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessFatalEventLogsReq + +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessFatalEventLogsRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessFWLoggingInitReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessFWFrameLoggingInitRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + WDI_Status WDI_ProcessEncryptMsgReq ( @@ -6096,5 +6190,130 @@ WDI_ProcessEncryptMsgRsp WDI_ControlBlockType* pWDICtx, WDI_EventInfoType* pEventData ); + +/** + @brief Process NAN Request + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessNanRequest +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +/** + @brief Process NAN Response + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessNanResponse +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +/** +*@brief Process NAN Event function (called when + an indication is being received over the + bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessNanEvent +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + + +/** +*@brief Process Lost Link param function (called when + an indication is being received over the + bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ + +WDI_Status +WDI_Process_LostLinkParamInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + + +/** + @brief WDI_ProcessSetRtsCtsHtvhtInd + Set RTS/CTS indication for diff modes. + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @return Result of the function call +*/ + + +WDI_Status +WDI_ProcessSetRtsCtsHtvhtInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessMonStartReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessMonStartRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessMonStopReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessMonStopRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + +WDI_Status +WDI_ProcessEnableDisableCAEventInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +); + #endif /*WLAN_QCT_WDI_I_H*/ diff --git a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h index 565cd505789f..44cd97dc6f96 100644 --- a/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h +++ b/drivers/staging/prima/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h @@ -40,8 +40,6 @@ DESCRIPTION be used by the DAL Control Path Core . - Copyright (c) 2010 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi.c b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi.c index f9c303e1ce7a..182bfbae3185 100644 --- a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi.c +++ b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,9 +45,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -94,6 +91,8 @@ #include "pttMsgApi.h" #include "vos_trace.h" +#include "vos_api.h" + /*=========================================================================== WLAN DAL Control Path Internal Data Definitions and Declarations ===========================================================================*/ @@ -103,7 +102,7 @@ #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" #define FEATURE_NOT_SUPPORTED 127 - +#define MAX_FW_HOST_CAP_SIZE 1024 #ifdef FEATURE_WLAN_SCAN_PNO #define WDI_PNO_VERSION_MASK 0x8000 #endif @@ -195,6 +194,16 @@ static placeHolderInCapBitmap supportEnabledFeatures[] = ,FW_STATS //47 ,WPS_PRBRSP_TMPL //48 ,BCN_IE_FLT_DELTA //49 + ,FEATURE_NOT_SUPPORTED //50 +#ifdef FEATURE_WLAN_TDLS + ,TDLS_OFF_CHANNEL //51 +#else + ,FEATURE_NOT_SUPPORTED //51 +#endif + ,FEATURE_NOT_SUPPORTED //52 + ,MGMT_FRAME_LOGGING //53 + ,ENHANCED_TXBD_COMPLETION //54 + ,LOGGING_ENHANCEMENT //55 }; /*-------------------------------------------------------------------------- @@ -458,8 +467,19 @@ WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = NULL, #endif /* WLAN_FEATURE_EXTSCAN */ WDI_ProcessSpoofMacAddrReq, /* WDI_SPOOF_MAC_ADDR_REQ */ + + WDI_ProcessGetFwStatsReq, /*WDI_GET_FW_STATS_REQ*/ + WDI_ProcessEncryptMsgReq, /* WDI_ENCRYPT_MSG_REQ*/ + WDI_ProcessFWLoggingInitReq, /* WDI_FW_LOGGING_INIT_REQ*/ + WDI_ProcessGetFrameLogReq, /* WDI_GET_FRAME_LOG_REQ*/ + + WDI_ProcessNanRequest, /* WDI_NAN_REQUEST*/ + + WDI_ProcessMonStartReq, /* WDI_MON_START_REQ */ + WDI_ProcessMonStopReq, /* WDI_MON_STOP_REQ */ + WDI_ProcessFatalEventLogsReq, /*WDI_FATAL_EVENT_LOGGING_REQ*/ /*------------------------------------------------------------------------- Indications -------------------------------------------------------------------------*/ @@ -492,7 +512,9 @@ WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = #else NULL, #endif - + WDI_ProcessSetRtsCtsHtvhtInd, /* WDI_SET_RTS_CTS_HTVHT_IND */ + WDI_ProcessFWLoggingDXEdoneInd, /* WDI_FW_LOGGING_DXE_DONE_IND */ + WDI_ProcessEnableDisableCAEventInd, /* WDI_SEND_FREQ_RANGE_CONTROL_IND */ }; @@ -611,7 +633,6 @@ WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = #endif // FEATURE_WLAN_SCAN_PNO WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */ - /*--------------------------------------------------------------------- Indications ---------------------------------------------------------------------*/ @@ -720,8 +741,18 @@ WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = NULL, #endif /* WLAN_FEATURE_EXTSCAN */ WDI_ProcessSpoofMacAddrRsp, /* WDI_SPOOF_MAC_ADDR_RSP */ + + WDI_ProcessGetFwStatsRsp, /*WDI_GET_FW_STATS_RSP*/ + WDI_ProcessEncryptMsgRsp, /* WDI_ENCRYPT_MSG_RSP*/ + WDI_ProcessFWFrameLoggingInitRsp, /* WDI_FW_LOGGING_INIT_RSP*/ + WDI_ProcessGetFrameLogRsp, /* WDI_GET_FRAME_LOG_RSP*/ + WDI_ProcessNanResponse, /* WDI_NAN_RESPONSE */ + + WDI_ProcessMonStartRsp, /* WDI_MON_START_RSP*/ + WDI_ProcessMonStopRsp, /* WDI_MON_STOP_RSP*/ + WDI_ProcessFatalEventLogsRsp, /*WDI_FATAL_EVENT_LOGGING_RSP*/ /*--------------------------------------------------------------------- Indications ---------------------------------------------------------------------*/ @@ -806,6 +837,8 @@ WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = NULL, #endif WDI_delBaInd, /* WDI_HAL_DEL_BA_IND*/ + WDI_ProcessNanEvent, /* WDI_HAL_NAN_EVENT */ + WDI_Process_LostLinkParamInd, /* WDI_HAL_LOST_LINK_PARAMS_IND*/ }; @@ -1140,7 +1173,16 @@ static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId) CASE_RETURN_STRING( WDI_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ); #endif /* WLAN_FEATURE_EXTSCAN */ CASE_RETURN_STRING( WDI_SPOOF_MAC_ADDR_REQ); + CASE_RETURN_STRING( WDI_GET_FW_STATS_REQ); CASE_RETURN_STRING( WDI_ENCRYPT_MSG_REQ); + CASE_RETURN_STRING( WDI_FW_LOGGING_INIT_REQ); + CASE_RETURN_STRING( WDI_GET_FRAME_LOG_REQ); + CASE_RETURN_STRING( WDI_NAN_REQUEST ); + CASE_RETURN_STRING( WDI_SET_RTS_CTS_HTVHT_IND ); + CASE_RETURN_STRING( WDI_MON_START_REQ ); + CASE_RETURN_STRING( WDI_MON_STOP_REQ ); + CASE_RETURN_STRING( WDI_FATAL_EVENT_LOGGING_REQ ); + CASE_RETURN_STRING( WDI_SEND_FREQ_RANGE_CONTROL_IND ); default: return "Unknown WDI MessageId"; } @@ -1272,7 +1314,11 @@ static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) CASE_RETURN_STRING( WDI_HAL_EXTSCAN_SIG_RSSI_RESULT_IND); #endif /* WLAN_FEATURE_EXTSCAN */ + CASE_RETURN_STRING( WDI_GET_FW_STATS_RSP); CASE_RETURN_STRING( WDI_ENCRYPT_MSG_RSP); + CASE_RETURN_STRING( WDI_FW_LOGGING_INIT_RSP); + CASE_RETURN_STRING( WDI_GET_FRAME_LOG_RSP); + CASE_RETURN_STRING (WDI_FATAL_EVENT_LOGGING_RSP); default: return "Unknown WDI MessageId"; } @@ -1289,8 +1335,17 @@ static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) void WDI_TraceHostFWCapabilities(tANI_U32 *capabilityBitmap) { int i,j; - char capStr[512]; - char *pCapStr = capStr; + char *pTempCapStr = NULL; + char *pCapStr = NULL; + pTempCapStr = vos_mem_malloc(MAX_FW_HOST_CAP_SIZE); + if (NULL == pTempCapStr) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "Memory allocation failed for CapStr"); + return; + } + + pCapStr = pTempCapStr; for (j = 0; j < 4; j++) { for (i = 0; i < 32; i++) { if ((*(capabilityBitmap + j) & (1 << i))) { @@ -1400,7 +1455,9 @@ void WDI_TraceHostFWCapabilities(tANI_U32 *capabilityBitmap) case DYNAMIC_WMM_PS: snprintf(pCapStr, sizeof("DYNAMIC_WMM_PS"), "%s", "DYNAMIC_WMM_PS"); pCapStr += strlen("DYNAMIC_WMM_PS"); break; - + case FW_STATS: snprintf(pCapStr, sizeof("FW_STATS"), "%s", "FW_STATS"); + pCapStr += strlen("FW_STATS"); + break; case MAC_SPOOFED_SCAN: snprintf(pCapStr, sizeof("MAC_SPOOFED_SCAN"), "%s", "MAC_SPOOFED_SCAN"); pCapStr += strlen("MAC_SPOOFED_SCAN"); break; @@ -1410,8 +1467,9 @@ void WDI_TraceHostFWCapabilities(tANI_U32 *capabilityBitmap) case BCN_IE_FLT_DELTA: snprintf(pCapStr, sizeof("BCN_IE_FLT_DELTA"), "%s", "BCN_IE_FLT_DELTA"); pCapStr += strlen("BCN_IE_FLT_DELTA"); break; - - + case MGMT_FRAME_LOGGING: snprintf(pCapStr, sizeof("MGMT_FRAME_LOGGING"), "%s", "MGMT_FRAME_LOGGING"); + pCapStr += strlen("MGMT_FRAME_LOGGING"); + break; case BMU_ERROR_GENERIC_RECOVERY: snprintf(pCapStr, sizeof("BMU_ERROR_GENERIC_RECOVERY"), "%s", "BMU_ERROR_GENERIC_RECOVERY"); pCapStr += strlen("BMU_ERROR_GENERIC_RECOVERY"); break; @@ -1420,6 +1478,14 @@ void WDI_TraceHostFWCapabilities(tANI_U32 *capabilityBitmap) pCapStr += strlen("DISA"); break; + case TDLS_OFF_CHANNEL: snprintf(pCapStr, sizeof("TDLS_OFF_CHANNEL"), "%s", "TDLS_OFF_CHANNEL"); + pCapStr += strlen("TDLS_OFF_CHANNEL"); + break; + case LOGGING_ENHANCEMENT: snprintf(pCapStr, sizeof("LOGGING_ENHANCEMENT"), "%s", "LOGGING_ENHANCEMENT"); + pCapStr += strlen("LOGGING_ENHANCEMENT"); + break; + + } *pCapStr++ = ','; *pCapStr++ = ' '; @@ -1428,8 +1494,12 @@ void WDI_TraceHostFWCapabilities(tANI_U32 *capabilityBitmap) } pCapStr -= 2; *pCapStr = '\0'; - pCapStr = capStr; - WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, "\t\t%s", pCapStr); + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "\t\t%s", pTempCapStr); + if (pTempCapStr) + { + vos_mem_free(pTempCapStr); + pTempCapStr = NULL; + } } /** @@ -1709,7 +1779,7 @@ WDI_Init /*The WDI is initialized - set state to init */ gWDICb.uGlobalState = WDI_INIT_ST; - + gWDICb.roamDelayStatsEnabled = vos_get_roam_delay_stats_enabled(); /*Send the context as a ptr to the global WDI Control Block*/ *ppWDIGlobalCtx = &gWDICb; @@ -4160,6 +4230,224 @@ WDI_SetUapsdAcParamsReq }/*WDI_SetUapsdAcParamsReq*/ +/** + @brief WDI_FWLoggingDXEdoneInd + + FW Logging DXE done Indication from the upper layer will be sent + down to HAL + + @param WDI_FWLoggingDXEdoneIndInfoType + + @see + + @return Status of the request +*/ +WDI_Status +WDI_FWLoggingDXEdoneInd +( + WDI_FWLoggingDXEdoneIndInfoType* pwdiFWLoggingDXEdoneInd +) +{ + + WDI_EventInfoType wdiEventData; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_FW_LOGGING_DXE_DONE_IND; + wdiEventData.pEventData = pwdiFWLoggingDXEdoneInd; + wdiEventData.uEventDataSize = sizeof(*pwdiFWLoggingDXEdoneInd); + wdiEventData.pCBfnc = NULL; + wdiEventData.pUserData = NULL; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); + +}/*WDI_FWLoggingDXEdoneInd*/ + +/** + @brief WDI_GetFrameLogReq will be called when the upper + MAC wants to initialize frame logging. Upon the call of + this API the WLAN DAL will pack and send a HAL + Frame logging init request message to + the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiGetFrameLogReqInfo: the Frame Logging params + as specified by the Device Interface + + wdiGetFrameLogRspCb: callback for passing back the + response of the frame logging init operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ +WDI_Status +WDI_GetFrameLogReq +( + WDI_GetFrameLogReqInfoType *pwdiGetFrameLogReqInfo, + WDI_GetFrameLogRspCb wdiGetFrameLogRspCb, + void* pUserData +) +{ + WDI_EventInfoType wdiEventData; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_GET_FRAME_LOG_REQ; + wdiEventData.pEventData = pwdiGetFrameLogReqInfo; + wdiEventData.uEventDataSize = sizeof(*pwdiGetFrameLogReqInfo); + wdiEventData.pCBfnc = wdiGetFrameLogRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); +} + + +/** + @brief WDI_FatalEventLogsReq will be called when the upper + MAC wants to send the flush command. Upon the call of + this API the WLAN DAL will pack and send a HAL + Fatal Event Req message to the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiFlushLogsReqInfo: the Flush Logs params + as specified by the Device Interface + + wdiFlushLogsRspCb: callback for passing back the + response of the Flush Logs operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ + +WDI_Status +WDI_FatalEventLogsReq +( + WDI_FatalEventLogsReqInfoType *pwdiFatalEventLogsReqInfo, + WDI_FatalEventLogsRspCb wdiFatalEventLogsRspCb, + void* pUserData +) +{ + WDI_EventInfoType wdiEventData; + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_FATAL_EVENT_LOGGING_REQ; + wdiEventData.pEventData = pwdiFatalEventLogsReqInfo; + wdiEventData.uEventDataSize = sizeof(*pwdiFatalEventLogsReqInfo); + wdiEventData.pCBfnc = wdiFatalEventLogsRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); + +} + + +/** + @brief WDI_FWLoggingInitReq will be called when the upper + MAC wants to initialize frame logging. Upon the call of + this API the WLAN DAL will pack and send a HAL + Frame logging init request message to + the lower RIVA sub-system. + + In state BUSY this request will be queued. Request won't + be allowed in any other state. + + + @param pwdiFWLoggingInitReqParams: the Frame Logging params + as specified by the Device Interface + + wdiFWLoggingInitReqCb: callback for passing back the + response of the frame logging init operation received + from the device + + pUserData: user data will be passed back with the + callback + + @return Result of the function call +*/ +WDI_Status +WDI_FWLoggingInitReq +( + WDI_FWLoggingInitReqInfoType *pwdiFWLoggingInitReqInfo, + WDI_FWLoggingInitRspCb wdiFWLoggingInitRspCb, + void* pUserData +) +{ + WDI_EventInfoType wdiEventData; + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_FW_LOGGING_INIT_REQ; + wdiEventData.pEventData = pwdiFWLoggingInitReqInfo; + wdiEventData.uEventDataSize = sizeof(*pwdiFWLoggingInitReqInfo); + wdiEventData.pCBfnc = wdiFWLoggingInitRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); +} + /** @brief WDI_ConfigureRxpFilterReq will be called when the upper MAC wants to set/reset the RXP filters for received pkts @@ -6673,6 +6961,7 @@ WDI_PostMainEvent WDI_Status wdiStatus; WDI_MainFuncType pfnWDIMainEvHdlr; WDI_MainStateType wdiOldState; + static int failCnt = 0; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /*------------------------------------------------------------------------- @@ -6721,9 +7010,11 @@ WDI_PostMainEvent } else { - WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + if (!(failCnt & 0xF)) + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, "Unexpected event %d in state: %d", wdiEV, wdiOldState); + failCnt++; wdiStatus = WDI_STATUS_E_NOT_ALLOWED; } @@ -6933,7 +7224,7 @@ WDI_MainStartStarted wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; /*Notify UMAC*/ - wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); + wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pEventData->pUserData); /*Return Success*/ return WDI_STATUS_SUCCESS; @@ -13829,6 +14120,7 @@ WDI_ProcessEnterImpsReq WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, "WDI Init failed to wait on an event"); + WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); WDI_ASSERT(0); goto fail; } @@ -14007,6 +14299,7 @@ WDI_ProcessEnterBmpsReq WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, "WDI Init failed to wait on an event"); + WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); WDI_ASSERT(0); goto fail; } @@ -16096,7 +16389,7 @@ WDI_ProcessInitScanRsp wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); - if ( pWDICtx->bInBmps ) + if (pWDICtx->bInBmps && (WDI_STATUS_SUCCESS == wdiStatus)) { // notify DTS that we are entering Full power wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); @@ -16106,6 +16399,12 @@ WDI_ProcessInitScanRsp WDI_ASSERT(0); } } + else + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "Error returned WDI_ProcessInitScanRspi:%d BMPS%d", + wdiStatus, pWDICtx->bInBmps); + } /*Notify UMAC*/ wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); @@ -18121,8 +18420,12 @@ WDI_ProcessStartOemDataRsp return WDI_STATUS_E_FAILURE; } + wpalMemoryZero(wdiOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); + /* Populate WDI structure members */ - wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); + wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, + halStartOemDataRspParams->oemDataRsp, + pEventData->uEventDataSize); /*Notify UMAC*/ wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); @@ -21231,8 +21534,10 @@ WDI_ProcessTxCompleteInd /*Fill in the indication parameters*/ wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; - wdiInd.wdiIndicationData.tx_complete_status - = halTxComplIndMsg.txComplParams.status; + + wpalMemoryCopy( &wdiInd.wdiIndicationData, + &halTxComplIndMsg.txComplParams, + sizeof(WDI_TxBDStatus) ); if ( pWDICtx->wdiLowLevelIndCB ) { @@ -22431,7 +22736,7 @@ WDI_ResponseTimerCB } #ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT wpalWcnssResetIntr(); - if(wpalIsWDresetInProgress()) + if(wpalIslogPInProgress()) { if(wpalIsSsrPanicOnFailure()) wpalDevicePanic(); @@ -22615,12 +22920,14 @@ WDI_PALCtrlMsgCB return; } + /*Access to the global state must be locked */ + wpalMutexAcquire(&pWDICtx->wptMutex); + /*Transition back to the state that we had before serialization - serialization transitions us to BUSY to stop any incomming requests - ! TO DO L: possible race condition here if a request comes in between the - state transition and the post function*/ - + */ WDI_STATE_TRANSITION( pWDICtx, pMsg->val); + wpalMutexRelease(&pWDICtx->wptMutex); /*----------------------------------------------------------------------- Check to see what type of event we are serializing @@ -22654,7 +22961,8 @@ WDI_PALCtrlMsgCB break; }/*switch ( pEventData->wdiRequest )*/ - if ( WDI_STATUS_SUCCESS != wdiStatus ) + if (!(WDI_STATUS_SUCCESS == wdiStatus || WDI_STATUS_PENDING == wdiStatus + || WDI_STATUS_SUCCESS_SYNC == wdiStatus)) { WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); @@ -23957,8 +24265,28 @@ WDI_2_HAL_REQ_TYPE #endif /* WLAN_FEATURE_EXTSCAN */ case WDI_SPOOF_MAC_ADDR_REQ: return WLAN_HAL_MAC_SPOOFED_SCAN_REQ; + case WDI_GET_FW_STATS_REQ: + return WLAN_HAL_FW_STATS_REQ; case WDI_ENCRYPT_MSG_REQ: return WLAN_HAL_ENCRYPT_DATA_REQ; + case WDI_FW_LOGGING_INIT_REQ: + return WLAN_HAL_FW_LOGGING_INIT_REQ; + case WDI_GET_FRAME_LOG_REQ: + return WLAN_HAL_GET_FRAME_LOG_REQ; + case WDI_NAN_REQUEST: + return WLAN_HAL_NAN_REQ; + case WDI_SET_RTS_CTS_HTVHT_IND: + return WLAN_HAL_SET_RTS_CTS_HTVHT_IND; + case WDI_MON_START_REQ: + return WLAN_HAL_ENABLE_MONITOR_MODE_REQ; + case WDI_MON_STOP_REQ: + return WLAN_HAL_DISABLE_MONITOR_MODE_REQ; + case WDI_FW_LOGGING_DXE_DONE_IND: + return WLAN_HAL_FW_LOGGING_DXE_DONE_IND; + case WDI_FATAL_EVENT_LOGGING_REQ: + return WLAN_HAL_FATAL_EVENT_LOGGING_REQ; + case WDI_SEND_FREQ_RANGE_CONTROL_IND: + return WLAN_HAL_SEND_FREQ_RANGE_CONTROL_IND; default: return WLAN_HAL_MSG_MAX; } @@ -24272,9 +24600,26 @@ case WLAN_HAL_DEL_STA_SELF_RSP: #endif /* WLAN_FEATURE_EXTSCAN */ case WLAN_HAL_MAC_SPOOFED_SCAN_RSP: return WDI_SPOOF_MAC_ADDR_RSP; + case WLAN_HAL_FW_STATS_RSP: + return WDI_GET_FW_STATS_RSP; case WLAN_HAL_ENCRYPT_DATA_RSP: return WDI_ENCRYPT_MSG_RSP; - + case WLAN_HAL_FW_LOGGING_INIT_RSP: + return WDI_FW_LOGGING_INIT_RSP; + case WLAN_HAL_GET_FRAME_LOG_RSP: + return WDI_GET_FRAME_LOG_RSP; + case WLAN_HAL_NAN_RSP: + return WDI_NAN_RESPONSE; + case WLAN_HAL_NAN_EVT: + return WDI_HAL_NAN_EVENT; + case WLAN_HAL_LOST_LINK_PARAMETERS_IND: + return WDI_HAL_LOST_LINK_PARAMS_IND; + case WLAN_HAL_ENABLE_MONITOR_MODE_RSP: + return WDI_MON_START_RSP; + case WLAN_HAL_DISABLE_MONITOR_MODE_RSP: + return WDI_MON_STOP_RSP; + case WLAN_HAL_FATAL_EVENT_LOGGING_RSP: + return WDI_FATAL_EVENT_LOGGING_RSP; default: return eDRIVER_TYPE_MAX; } @@ -25066,6 +25411,12 @@ WDI_ExtractRequestCBFromEvent *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; break; + + case WDI_ADD_STA_SELF_REQ: + *ppfnReqCB = ((WDI_AddSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; + *ppUserData = ((WDI_AddSTASelfReqParamsType*)pEvent->pEventData)->pUserData; + break; + case WDI_DEL_STA_SELF_REQ: *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; @@ -25290,10 +25641,6 @@ WDI_ExtractRequestCBFromEvent break; #endif - case WDI_SPOOF_MAC_ADDR_REQ: - *ppfnReqCB = ((WDI_GtkOffloadGetInfoReqMsg*)pEvent->pEventData)->wdiReqStatusCB; - *ppUserData = ((WDI_GtkOffloadGetInfoReqMsg*)pEvent->pEventData)->pUserData; - break; default: *ppfnReqCB = NULL; *ppUserData = NULL; @@ -25953,7 +26300,7 @@ WDI_ProcessSetRssiFilterReq /*----------------------------------------------------------------------- Get message buffer -----------------------------------------------------------------------*/ - if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_FILTER_REQ, sizeof(ucRssiThreshold), &pSendBuffer, &usDataOffset, &usSendSize))|| ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) @@ -29038,14 +29385,14 @@ WDI_featureCapsExchangeReq ------------------------------------------------------------------------*/ FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); - WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "Host caps %x %x %x %x", gpHostWlanFeatCaps->featCaps[0], gpHostWlanFeatCaps->featCaps[1], gpHostWlanFeatCaps->featCaps[2], gpHostWlanFeatCaps->featCaps[3] ); - WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, "Host Capability"); + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "Host Capability"); WDI_TraceHostFWCapabilities(gpHostWlanFeatCaps->featCaps); wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; wdiEventData.pEventData = gpHostWlanFeatCaps; @@ -29206,14 +29553,14 @@ WDI_ProcessFeatureCapsExchangeRsp wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, fCapsStructSize); - WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "FW caps %x %x %x %x", gpFwWlanFeatCaps->featCaps[0], gpFwWlanFeatCaps->featCaps[1], gpFwWlanFeatCaps->featCaps[2], gpFwWlanFeatCaps->featCaps[3] ); - WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, "Firmware Capability"); + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "Firmware Capability"); WDI_TraceHostFWCapabilities(gpFwWlanFeatCaps->featCaps); wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; @@ -29328,6 +29675,75 @@ wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) return featSupported; } +wpt_uint8 WDI_selectCbMode( wpt_uint8 channel, wpt_uint8 ChannelBW ) +{ + /* 5gHz Channel */ + if( channel >= 34 && channel <= 165 ) + { + if( ChannelBW == 80 && WDI_getFwWlanFeatCaps(DOT11AC) ) + { + if ( channel== 36 || channel == 52 || channel == 100 || + channel == 116 || channel == 149 ) + { + return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; + } + else if ( channel == 40 || channel == 56 || channel == 104 || + channel == 120 || channel == 153 ) + { + return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; + } + else if ( channel == 44 || channel == 60 || channel == 108 || + channel == 124 || channel == 157 ) + { + return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; + } + else if ( channel == 48 || channel == 64 || channel == 112 || + channel == 128 || channel == 144 || channel == 161 ) + { + return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; + } + else if ( channel == 165 ) + { + return PHY_SINGLE_CHANNEL_CENTERED; + } + } + + else + { + if ( channel== 40 || channel == 48 || channel == 56 || + channel == 64 || channel == 104 || channel == 112 || + channel == 120 || channel == 128 || channel == 136 || + channel == 144 || channel == 153 || channel == 161 ) + { + return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + } + else if ( channel== 36 || channel == 44 || channel == 52 || + channel == 60 || channel == 100 || channel == 108 || + channel == 116 || channel == 124 || channel == 132 || + channel == 140 || channel == 149 || channel == 157 ) + { + return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + } + else if ( channel == 165 ) + { + return PHY_SINGLE_CHANNEL_CENTERED; + } + } + } + + /* 2.4Ghz Channel */ + if( ChannelBW == 40 && WDI_getFwWlanFeatCaps(HT40_OBSS_SCAN) ) + { + if (channel >= 1 && channel <= 7) + return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + else if (channel >= 8 && channel <= 13) + return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + else if (channel ==14) + return PHY_SINGLE_CHANNEL_CENTERED; + } + return PHY_SINGLE_CHANNEL_CENTERED; +} + #ifdef WLAN_FEATURE_11AC WDI_Status WDI_ProcessUpdateVHTOpModeReq @@ -29450,6 +29866,21 @@ void WDI_TransportChannelDebug WDTS_ChannelDebug(displaySnapshot, debugFlags); return; } + +/** + @brief WDI_TransportKickDxe - + Request Kick DXE when HDD TX time out happen + + @param none + @see + @return none +*/ +void WDI_TransportKickDxe() +{ + WDTS_ChannelKickDxe(); + return; +} + /** @brief WDI_SsrTimerCB Callback function for SSR timer, if this is called then the graceful @@ -30607,6 +31038,7 @@ WDI_ProcessChAvoidInd WDI_LowLevelIndType wdiInd; tHalAvoidFreqRangeIndParams chAvoidIndicationParam; wpt_uint16 rangeLoop; + wpt_uint32 dataSize; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /*------------------------------------------------------------------------- @@ -30621,12 +31053,20 @@ WDI_ProcessChAvoidInd return WDI_STATUS_E_FAILURE; } + dataSize = sizeof(tHalAvoidFreqRangeIndParams); + if (dataSize > pEventData->uEventDataSize) + dataSize = pEventData->uEventDataSize; + /*------------------------------------------------------------------------- Extract indication and send it to UMAC -------------------------------------------------------------------------*/ wpalMemoryCopy(&chAvoidIndicationParam, pEventData->pEventData, - sizeof(tHalAvoidFreqRangeIndParams)); + dataSize); + + /* Avoid Over flow */ + if (WLAN_HAL_MAX_AVOID_FREQ_RANGE < chAvoidIndicationParam.avoidCnt) + chAvoidIndicationParam.avoidCnt = WLAN_HAL_MAX_AVOID_FREQ_RANGE; wdiInd.wdiIndicationType = WDI_CH_AVOID_IND; wdiInd.wdiIndicationData.wdiChAvoidInd.avoidRangeCount = @@ -30684,7 +31124,7 @@ WDI_ProcessHT40OBSSScanInd /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "%s", __func__); /*------------------------------------------------------------------------- @@ -31188,6 +31628,140 @@ WDI_Status WDI_GetBcnMissRate( void *pUserData, return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); } + +/* + * FUNCTION: WDI_ProcessGetFwStatsRsp + * send the response with FW stats asked. + */ +WDI_Status + WDI_ProcessGetFwStatsRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_FWStatsGetRspCb wdiGetFwstatsCb; + tpHalfwStatsRspParams pHalFwstatsRsp; + WDI_FWStatsResults fwStats; + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + pHalFwstatsRsp = (tHalfwStatsRspParams *)pEventData->pEventData; + wdiGetFwstatsCb = (WDI_FWStatsGetRspCb) pWDICtx->pfncRspCB; + + if(pHalFwstatsRsp->length) + { + switch( pHalFwstatsRsp->type ) + { + case FW_UBSP_STATS: + { + ubspFwStats *ubspStatsfromFw; + + fwStats.type = pHalFwstatsRsp->type; + ubspStatsfromFw = (ubspFwStats *) pHalFwstatsRsp->data; + fwStats.wdiFwStatsData.ubspStats.ubsp_enter_cnt = + ubspStatsfromFw->ubsp_enter_cnt; + fwStats.wdiFwStatsData.ubspStats.ubsp_jump_ddr_cnt = + ubspStatsfromFw->ubsp_jump_ddr_cnt; + } + break; + default: + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: No handling for stats type %d", __func__, + pHalFwstatsRsp->type); + wdiGetFwstatsCb(WDI_STATUS_E_FAILURE, + NULL, pWDICtx->pRspCBUserData); + return WDI_STATUS_E_FAILURE; + } + } + wdiGetFwstatsCb(WDI_STATUS_SUCCESS, &fwStats , pWDICtx->pRspCBUserData); + } + else + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Length = 0 for type %d return failure ", __func__, + pHalFwstatsRsp->type); + wdiGetFwstatsCb(WDI_STATUS_E_FAILURE, + NULL, pWDICtx->pRspCBUserData); + return WDI_STATUS_E_FAILURE; + } + return WDI_STATUS_SUCCESS; +} + +/* + * FUNCTION: WDI_ProcessGetFwStatsReq + * Request to WDI to get FW Stats. + */ +WDI_Status + WDI_ProcessGetFwStatsReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + WDI_FWStatsGetRspCb *wdiGetFwstatsCb; + tHalfwStatsReqParams halFwStatsReq; + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || + ( NULL == pEventData->pCBfnc ) ) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiGetFwstatsCb = (WDI_FWStatsGetRspCb *)pEventData->pCBfnc; + + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( + pWDICtx, WDI_GET_FW_STATS_REQ, + sizeof(tHalfwStatsReqParams), + &pSendBuffer, &usDataOffset, &usSendSize)) || + ( usSendSize < (usDataOffset + sizeof(tHalfwStatsReqParams)))) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "Unable to get send buffer in get WDI_GET_FW_STAS_REQ %p", + pEventData); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + pWDICtx->wdiReqStatusCB = NULL; + pWDICtx->pReqStatusUserData = pEventData->pEventData; + halFwStatsReq.type = *((wpt_uint32 *)(pEventData->pEventData)); + wpalMemoryCopy( pSendBuffer+usDataOffset, + &halFwStatsReq, + sizeof(tHalfwStatsReqParams)); + /*------------------------------------------------------------------------- + Send Get STA Request to HAL + -------------------------------------------------------------------------*/ + return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, wdiGetFwstatsCb, + pEventData->pUserData, WDI_GET_FW_STATS_RSP); +} + #ifdef WLAN_FEATURE_LINK_LAYER_STATS /** @@ -31603,6 +32177,276 @@ WDI_ProcessLLStatsClearReq } #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +WDI_Status WDI_FWStatsGetReq( void* pUserData, + WDI_FWStatsGetRspCb wdiFWStatsGetRspCb, + wpt_uint32 stats) +{ + WDI_EventInfoType wdiEventData; + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + return WDI_STATUS_E_NOT_ALLOWED; + } + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_GET_FW_STATS_REQ; + wdiEventData.pEventData = (void *)&stats; + wdiEventData.uEventDataSize = sizeof(wpt_uint32); + wdiEventData.pCBfnc = wdiFWStatsGetRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); + +} + +WDI_Status +WDI_MonStartReq(WDI_MonStartReqType* pwdiMonStartReqParams, + WDI_MonModeRspCb wdiMonModeRspCb, + void* pUserData) +{ + WDI_EventInfoType wdiEventData; + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + wdiEventData.wdiRequest = WDI_MON_START_REQ; + wdiEventData.pEventData = pwdiMonStartReqParams; + wdiEventData.uEventDataSize = sizeof(*pwdiMonStartReqParams); + wdiEventData.pCBfnc = wdiMonModeRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); +} + +WDI_Status +WDI_ProcessMonStartReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_MonStartReqType* pwdiMonStartReqParams; + WDI_MonModeRspCb wdiMonStartCb; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usSendSize = 0; + wpt_uint16 usDataOffset = 0; + tHalEnableMonitorModeReqParams halEnableMonitorModeParams; + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || + ( NULL == pEventData->pCBfnc )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + pwdiMonStartReqParams = (WDI_MonStartReqType*)pEventData->pEventData; + wdiMonStartCb = (WDI_MonModeRspCb)pEventData->pCBfnc; + + /*----------------------------------------------------------------------- + Get message buffer + ! TO DO : proper conversion into the HAL Message Request Format + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( + pWDICtx, + WDI_MON_START_REQ, + sizeof(tHalEnableMonitorModeReqParams), + &pSendBuffer, &usDataOffset, + &usSendSize))|| + ( usSendSize < (usDataOffset + sizeof(halEnableMonitorModeParams) ))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "Unable to get send buffer in %s %p %p %p", __func__, + pEventData, pwdiMonStartReqParams, wdiMonStartCb); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + halEnableMonitorModeParams.channelNumber = pwdiMonStartReqParams->ChannelNo; + halEnableMonitorModeParams.cbState = WDI_selectCbMode(pwdiMonStartReqParams->ChannelNo, + pwdiMonStartReqParams->ChannelBW); + halEnableMonitorModeParams.maxAmpduLen = 0x1FFFF; + halEnableMonitorModeParams.maxMpduInAmpduLen = 0xF20-0x4C; + halEnableMonitorModeParams.crcCheckEnabled = pwdiMonStartReqParams->crcCheckEnabled; + halEnableMonitorModeParams.numMacFilters = pwdiMonStartReqParams->numOfMacFilters; + wpalMemoryCopy(halEnableMonitorModeParams.macFilters[0].macAddr, + pwdiMonStartReqParams->mmFilters[0].macAddr, + sizeof( wpt_macAddr )); + halEnableMonitorModeParams.macFilters[0].isA1filteringNeeded = pwdiMonStartReqParams->mmFilters[0].isA1filter; + halEnableMonitorModeParams.macFilters[0].isA2filteringNeeded = pwdiMonStartReqParams->mmFilters[0].isA2filter; + halEnableMonitorModeParams.macFilters[0].isA3filteringNeeded = pwdiMonStartReqParams->mmFilters[0].isA3filter; + halEnableMonitorModeParams.typeSubtypeBitmap = pwdiMonStartReqParams->typeSubtypeBitmap; + + wpalMemoryCopy(pSendBuffer+usDataOffset, + &halEnableMonitorModeParams, + sizeof(halEnableMonitorModeParams)); + + pWDICtx->pReqStatusUserData = pEventData->pUserData; + + return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, + wdiMonStartCb, pEventData->pUserData, + WDI_MON_START_RSP); +} + +WDI_Status +WDI_ProcessMonStartRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_MonModeRspCb wdiMonStartRspCb; + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Enter ", __func__); + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiMonStartRspCb = (WDI_MonModeRspCb)pWDICtx->pfncRspCB; + + wdiMonStartRspCb((void *) pEventData->pEventData, pWDICtx->pRspCBUserData); + + return WDI_STATUS_SUCCESS; +} + +WDI_Status +WDI_MonStopReq(WDI_MonModeRspCb wdiMonModeRspCb, + void* pUserData) +{ + WDI_EventInfoType wdiEventData; + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + wdiEventData.wdiRequest = WDI_MON_STOP_REQ; + wdiEventData.pEventData = NULL; + wdiEventData.uEventDataSize = sizeof(NULL); + wdiEventData.pCBfnc = wdiMonModeRspCb; + wdiEventData.pUserData = pUserData; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); +} + +WDI_Status +WDI_ProcessMonStopReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_MonModeRspCb wdiMonStopCb; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usSendSize = 0; + wpt_uint16 usDataOffset = 0; + wpt_uint8 resetConfiguration; + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + if (( NULL == pEventData ) || ( NULL == pEventData->pCBfnc )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiMonStopCb = (WDI_MonModeRspCb)pEventData->pCBfnc; + + /*----------------------------------------------------------------------- + Get message buffer + ! TO DO : proper conversion into the HAL Message Request Format + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( + pWDICtx, + WDI_MON_STOP_REQ, + sizeof(wpt_uint8), + &pSendBuffer, &usDataOffset, + &usSendSize))|| + ( usSendSize < (usDataOffset + sizeof(wpt_uint8) ))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "Unable to get send buffer in %s %p %p", __func__, + pEventData, wdiMonStopCb); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wpalMemoryCopy(pSendBuffer+usDataOffset, + &resetConfiguration, + sizeof(wpt_uint8)); + + pWDICtx->pReqStatusUserData = pEventData->pUserData; + + return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, + wdiMonStopCb, pEventData->pUserData, + WDI_MON_STOP_RSP); +} + +WDI_Status +WDI_ProcessMonStopRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_MonModeRspCb wdiMonStopRspCb; + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s: Enter ", __func__); + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiMonStopRspCb = (WDI_MonModeRspCb)pWDICtx->pfncRspCB; + + wdiMonStopRspCb(pWDICtx->pRspCBUserData, pWDICtx->pRspCBUserData); + + return WDI_STATUS_SUCCESS; +} + #ifdef WLAN_FEATURE_EXTSCAN /** @@ -33574,6 +34418,479 @@ WDI_ProcessSpoofMacAddrRsp return WDI_STATUS_SUCCESS; } +/** + @brief Process Get Frame Log Rsp function + (called when a response is being received over the bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessGetFrameLogRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + tGetFrameLogResp halRsp; + WDI_GetFrameLogRspCb wdiGetFrameLogRspCb; + WDI_GetFrameLogRspParamType wdiGetFrameLogRsp; + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiGetFrameLogRspCb = (WDI_GetFrameLogRspCb)pWDICtx->pfncRspCB; + + /*------------------------------------------------------------------------- + Extract response and send it to UMAC + -------------------------------------------------------------------------*/ + wpalMemoryCopy( &halRsp, + pEventData->pEventData, sizeof(halRsp)); + + wdiGetFrameLogRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halRsp.status); + + /*Notify UMAC*/ + wdiGetFrameLogRspCb( &wdiGetFrameLogRsp, pWDICtx->pRspCBUserData ); + + return WDI_STATUS_SUCCESS; +} +/** + @brief Process FWLoggingInit Request + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessGetFrameLogReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_GetFrameLogReqInfoType* wdiGetFrameLogReq; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + WDI_Status wdiStatus; + tGetFrameLogReqMsg halGetFrameLogReq; + WDI_FWLoggingInitRspCb wdiGetFrameLogRspCb; + + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + ------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wdiGetFrameLogReq = (WDI_GetFrameLogReqInfoType *)pEventData->pEventData; + + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_GET_FRAME_LOG_REQ, + sizeof(halGetFrameLogReq.tGetFrameLogReqParams), + &pSendBuffer, &usDataOffset, &usSendSize))|| + (usSendSize < (usDataOffset + + sizeof(halGetFrameLogReq.tGetFrameLogReqParams)))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in GetFrameLog Req"); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + halGetFrameLogReq.tGetFrameLogReqParams.flags = + wdiGetFrameLogReq->flags; + + wdiGetFrameLogRspCb = (WDI_FWLoggingInitRspCb)pEventData->pCBfnc; + + wpalMemoryCopy( pSendBuffer+usDataOffset, + &halGetFrameLogReq.tGetFrameLogReqParams, + sizeof(halGetFrameLogReq.tGetFrameLogReqParams)); + + /*------------------------------------------------------------------------- + Send Suspend Request to HAL + ------------------------------------------------------------------------*/ + wdiStatus = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, + wdiGetFrameLogRspCb, pEventData->pUserData, WDI_GET_FRAME_LOG_RSP); + + return wdiStatus; +} +/** + @brief Process MgmtFrame Logging Init Rsp function + (called when a response is being received over the bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessFWFrameLoggingInitRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + tFWLoggingInitResp halRsp; + WDI_FWLoggingInitRspCb wdiFWFrameLoggingInitRspCb; + WDI_FWLoggingInitRspParamType wdiFWLogginginitRsp; + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + wdiFWFrameLoggingInitRspCb = (WDI_FWLoggingInitRspCb)pWDICtx->pfncRspCB; + + /*------------------------------------------------------------------------- + Extract response and send it to UMAC + -------------------------------------------------------------------------*/ + wpalMemoryCopy( &halRsp, pEventData->pEventData, sizeof(halRsp)); + + wdiFWLogginginitRsp.status = WDI_HAL_2_WDI_STATUS(halRsp.status); + + /*Notify UMAC*/ + wdiFWFrameLoggingInitRspCb( &wdiFWLogginginitRsp, pWDICtx->pRspCBUserData); + + return WDI_STATUS_SUCCESS; +} + +WDI_Status +WDI_ProcessFWLoggingDXEdoneInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + tFWLoggingDxeDoneInd *FWLoggingDxeDoneIndParams; + WDI_DS_LoggingSessionType *pLoggingSession; + WDI_Status wdiStatus = WDI_STATUS_SUCCESS; + + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (NULL == pEventData) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + pLoggingSession = (WDI_DS_LoggingSessionType *) + WDI_DS_GetLoggingSession(WDI_DS_GetDatapathContext( + (void *)pWDICtx)); + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_FW_LOGGING_DXE_DONE_IND, + sizeof(tFWLoggingDxeDoneInd), + &pSendBuffer, &usDataOffset, &usSendSize))|| + ( usSendSize < (usDataOffset + sizeof(tFWLoggingDxeDoneInd) ))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in RTS CTS ind %p ", + pEventData); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + FWLoggingDxeDoneIndParams = + (tFWLoggingDxeDoneInd*)(pSendBuffer + usDataOffset); + + wpalMemoryCopy(&FWLoggingDxeDoneIndParams->logBuffAddress, + &pLoggingSession->logBuffAddress, MAX_NUM_OF_BUFFER * + sizeof(FWLoggingDxeDoneIndParams->logBuffAddress[0])); + + FWLoggingDxeDoneIndParams->status = eHAL_STATUS_SUCCESS; + + wpalMemoryCopy(&FWLoggingDxeDoneIndParams->logBuffLength, + &pLoggingSession->logBuffLength, MAX_NUM_OF_BUFFER * + sizeof(FWLoggingDxeDoneIndParams->logBuffLength[0])); + + pWDICtx->pReqStatusUserData = NULL; + pWDICtx->pfncRspCB = NULL; + /*------------------------------------------------------------------------- + Send FW_LOGGING_DXE_DONE_IND Indication to HAL + -------------------------------------------------------------------------*/ + wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); + return (wdiStatus != WDI_STATUS_SUCCESS) ? wdiStatus:WDI_STATUS_SUCCESS_SYNC; +} + + +/** + @brief Process Fatal Event Logs Rsp function + (called when a response is being received over the bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessFatalEventLogsRsp +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + tHalFatalEventLoggingRspParams halRsp; + WDI_FatalEventLogsRspCb wdiFatalEventLogsRspCb; + WDI_FatalEventLogsRspParamType wdiFatalEventLogsRsp; + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + wdiFatalEventLogsRspCb = (WDI_FatalEventLogsRspCb)pWDICtx->pfncRspCB; + + /*------------------------------------------------------------------------- + Extract response and send it to UMAC + -------------------------------------------------------------------------*/ + wpalMemoryCopy( &halRsp, pEventData->pEventData, sizeof(halRsp)); + + wdiFatalEventLogsRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halRsp.status); + + /*Notify UMAC*/ + wdiFatalEventLogsRspCb( &wdiFatalEventLogsRsp, + pWDICtx->pRspCBUserData); + + return WDI_STATUS_SUCCESS; +} + +/** + @brief Process FatalEventLogs Request + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ + +WDI_Status +WDI_ProcessFatalEventLogsReq + +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_FatalEventLogsReqInfoType* wdiFatalEventLogsReq; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + WDI_Status wdiStatus; + tHalFatalEventLoggingReqMsg halFatalEventLoggingReq; + WDI_FatalEventLogsRspCb wdiFatalEventLogsRspCb; + + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + ------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + wdiFatalEventLogsReq = + (WDI_FatalEventLogsReqInfoType *)pEventData->pEventData; + + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_FATAL_EVENT_LOGGING_REQ, + sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams), + &pSendBuffer, &usDataOffset, &usSendSize))|| + (usSendSize < (usDataOffset + + sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams)))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in Fatal Event Req"); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + halFatalEventLoggingReq.tFatalEventLoggingReqParams.reasonCode = + wdiFatalEventLogsReq->reason_code; + + wdiFatalEventLogsRspCb = (WDI_FatalEventLogsRspCb)pEventData->pCBfnc; + + wpalMemoryCopy( pSendBuffer+usDataOffset, + &halFatalEventLoggingReq.tFatalEventLoggingReqParams, + sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams)); + + /*------------------------------------------------------------------------- + Send Mgmt Logging Init Request to HAL + ------------------------------------------------------------------------*/ + wdiStatus = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, + wdiFatalEventLogsRspCb, pEventData->pUserData, + WDI_FATAL_EVENT_LOGGING_RSP); + + return wdiStatus; + + +} + + +/** + @brief Process FWLoggingInit Request + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessFWLoggingInitReq +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_FWLoggingInitReqInfoType* wdiFWLoggingInitReq; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + WDI_Status wdiStatus; + tHalFWLoggingInitReqMsg halFWLoggingInitReq; + WDI_FWLoggingInitRspCb wdiFWLoggingInitRspCb; + + + VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: %d Enter",__func__, __LINE__); + + /*------------------------------------------------------------------------- + Sanity check + ------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + wdiFWLoggingInitReq = + (WDI_FWLoggingInitReqInfoType *)pEventData->pEventData; + + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_FW_LOGGING_INIT_REQ, + sizeof(halFWLoggingInitReq.tFWLoggingInitReqParams), + &pSendBuffer, &usDataOffset, &usSendSize))|| + (usSendSize < (usDataOffset + + sizeof(halFWLoggingInitReq.tFWLoggingInitReqParams)))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in Process Mgmt Logging Init Req"); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + halFWLoggingInitReq.tFWLoggingInitReqParams.enableFlag= + wdiFWLoggingInitReq->enableFlag; + halFWLoggingInitReq.tFWLoggingInitReqParams.frameSize= + wdiFWLoggingInitReq->frameSize; + halFWLoggingInitReq.tFWLoggingInitReqParams.frameType= + wdiFWLoggingInitReq->frameType; + halFWLoggingInitReq.tFWLoggingInitReqParams.bufferMode= + wdiFWLoggingInitReq->bufferMode; + halFWLoggingInitReq.tFWLoggingInitReqParams.continuousFrameLogging= + wdiFWLoggingInitReq->continuousFrameLogging; + halFWLoggingInitReq.tFWLoggingInitReqParams.minLogBuffSize= + wdiFWLoggingInitReq->minLogBufferSize; + halFWLoggingInitReq.tFWLoggingInitReqParams.maxLogBuffSize= + wdiFWLoggingInitReq->maxLogBufferSize; + halFWLoggingInitReq.tFWLoggingInitReqParams.logMailBoxAddr= + (tANI_U64)(uintptr_t)(WDI_DS_GetLoggingMbPhyAddr(pWDICtx)); + halFWLoggingInitReq.tFWLoggingInitReqParams.logMailBoxVer= + MAILBOX_VERSION_V1; + + wdiFWLoggingInitRspCb = (WDI_FWLoggingInitRspCb)pEventData->pCBfnc; + + wpalMemoryCopy( pSendBuffer+usDataOffset, + &halFWLoggingInitReq.tFWLoggingInitReqParams, + sizeof(halFWLoggingInitReq.tFWLoggingInitReqParams)); + + /*------------------------------------------------------------------------- + Send Mgmt Logging Init Request to HAL + ------------------------------------------------------------------------*/ + wdiStatus = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, + wdiFWLoggingInitRspCb, pEventData->pUserData, + WDI_FW_LOGGING_INIT_RSP); + + return wdiStatus; +} + /** @brief WDI_EncryptMsgReq @@ -33736,3 +35053,437 @@ WDI_ProcessEncryptMsgRsp pWDICtx->pRspCBUserData); return WDI_STATUS_SUCCESS; } + +WDI_Status +WDI_NanRequest +( + WDI_NanRequestType *pwdiNanRequest, + void *usrData +) +{ + WDI_EventInfoType wdiEventData; + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + + return WDI_STATUS_E_NOT_ALLOWED; + } + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "WDI_NanRequest %zu %d", sizeof(*pwdiNanRequest), + pwdiNanRequest->request_data_len); + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_NAN_REQUEST; + wdiEventData.pEventData = pwdiNanRequest; + wdiEventData.uEventDataSize = sizeof(*pwdiNanRequest) + + pwdiNanRequest->request_data_len; + wdiEventData.pUserData = usrData; + wdiEventData.pCBfnc = NULL; + + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); +} + +WDI_Status +WDI_ProcessNanRequest +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_NanRequestType *pwdiNanRequest = NULL; + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "WDI_ProcessNanRequest"); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pEventData ) || + ( NULL == (pwdiNanRequest = (WDI_NanRequestType*)pEventData->pEventData))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __FUNCTION__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + if (( WDI_STATUS_SUCCESS + != WDI_GetMessageBuffer( pWDICtx, + WDI_NAN_REQUEST, + pwdiNanRequest->request_data_len, + &pSendBuffer, + &usDataOffset, + &usSendSize))|| + ( usSendSize < (usDataOffset + pwdiNanRequest->request_data_len))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "Unable to get send buffer in NAN request %p %p", + pEventData, pwdiNanRequest); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + wpalMemoryCopy( pSendBuffer+usDataOffset, + pwdiNanRequest->request_data, + pwdiNanRequest->request_data_len); + + pWDICtx->pReqStatusUserData = NULL; + pWDICtx->pfncRspCB = NULL; + vos_mem_free( pEventData->pUserData); + + /*------------------------------------------------------------------------- + Send NAN Request to HAL + -------------------------------------------------------------------------*/ + return WDI_SendMsg( pWDICtx, + pSendBuffer, + usSendSize, + NULL, + NULL, + WDI_NAN_RESPONSE); +} + +/** + @brief Process NAN Response function (called when a + response is being received over the bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessNanResponse +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_Status wdiStatus; + eHalStatus halStatus; + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + halStatus = *((eHalStatus*)pEventData->pEventData); + wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s : Received NAN response, status : %d", __FUNCTION__, wdiStatus); + + return WDI_STATUS_SUCCESS; +}/*WDI_ProcessNanResponse*/ + + +/** + @brief Process NAN Event function (called when + an indication is being received over the + bus from HAL) + + @param pWDICtx: pointer to the WLAN DAL context + pEventData: pointer to the event information structure + + @see + @return Result of the function call +*/ +WDI_Status +WDI_ProcessNanEvent +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_LowLevelIndType wdiInd; + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT( 0 ); + return WDI_STATUS_E_FAILURE; + } + + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s: Received NAN event", __func__); + /*------------------------------------------------------------------------- + Extract indication and send it to UMAC + -------------------------------------------------------------------------*/ + wdiInd.wdiIndicationType = WDI_NAN_EVENT_IND; + wdiInd.wdiIndicationData.wdiNanEvent.event_data_len = + pEventData->uEventDataSize; + wdiInd.wdiIndicationData.wdiNanEvent.event_data = + pEventData->pEventData; + + /*Notify UMAC*/ + pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); + + return WDI_STATUS_SUCCESS; +}/*WDI_ProcessNanEvent*/ + + + +WDI_Status +WDI_Process_LostLinkParamInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + WDI_LowLevelIndType wdiInd; + tHalLostLinkParametersIndParams halLostLinkParamInd; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pWDICtx ) || ( NULL == pEventData ) || + ( NULL == pEventData->pEventData)) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + + /*------------------------------------------------------------------------- + Extract indication and send it to UMAC + -------------------------------------------------------------------------*/ + wpalMemoryCopy( (void *)&halLostLinkParamInd, + pEventData->pEventData, + sizeof(tHalLostLinkParametersIndParams)); + + + /*Fill in the indication parameters*/ + wdiInd.wdiIndicationType = WDI_LOST_LINK_PARAMS_IND; + wpalMemoryCopy((void *)&wdiInd.wdiIndicationData.wdiLostLinkParamsInd, + (void *)&halLostLinkParamInd, + sizeof(WDI_LostLinkParamsIndType)); + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s: bssIdx %d, rssi : %d, selfMacAddr: " MAC_ADDRESS_STR", linkFlCnt: %d," + "linkFlTx : %d,lastDataRate : %d", __func__, + wdiInd.wdiIndicationData.wdiLostLinkParamsInd.bssIdx, + wdiInd.wdiIndicationData.wdiLostLinkParamsInd.rssi, + MAC_ADDR_ARRAY(wdiInd.wdiIndicationData.wdiLostLinkParamsInd.selfMacAddr), + wdiInd.wdiIndicationData.wdiLostLinkParamsInd.linkFlCnt, + wdiInd.wdiIndicationData.wdiLostLinkParamsInd.linkFlTx, + wdiInd.wdiIndicationData.wdiLostLinkParamsInd.lastDataRate); + /*Notify UMAC*/ + if (pWDICtx->wdiLowLevelIndCB) + { + pWDICtx->wdiLowLevelIndCB(&wdiInd, pWDICtx->pIndUserData); + } + + return WDI_STATUS_SUCCESS; + +} + +WDI_Status +WDI_ProcessSetRtsCtsHtvhtInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + wpt_uint32 *rtsCtsVal; + tHalRtsCtsHtvhtIndParams *rtsCtsHtvhtIndParams; + WDI_Status wdiStatus = WDI_STATUS_SUCCESS; + + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + rtsCtsVal = (wpt_uint32*)pEventData->pEventData; + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_SET_RTS_CTS_HTVHT_IND, + sizeof(tHalRtsCtsHtvhtIndParams), + &pSendBuffer, &usDataOffset, &usSendSize))|| + ( usSendSize < (usDataOffset + sizeof(tHalRtsCtsHtvhtIndParams) ))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in RTS CTS ind %p ", + pEventData); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + rtsCtsHtvhtIndParams = + (tHalRtsCtsHtvhtIndParams*)(pSendBuffer + usDataOffset); + rtsCtsHtvhtIndParams->rtsCtsValue = *rtsCtsVal; + + pWDICtx->pReqStatusUserData = NULL; + pWDICtx->pfncRspCB = NULL; + /*------------------------------------------------------------------------- + Send SET_RTS_CTS_HTVHT Indication to HAL + -------------------------------------------------------------------------*/ + wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); + return (wdiStatus != WDI_STATUS_SUCCESS) ? wdiStatus:WDI_STATUS_SUCCESS_SYNC; +} + +WDI_Status +WDI_SetRtsCtsHTVhtInd +( + wpt_uint32 rtsCtsVal +) +{ + WDI_EventInfoType wdiEventData; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_SET_RTS_CTS_HTVHT_IND; + wdiEventData.pEventData = (void *) &rtsCtsVal; + wdiEventData.uEventDataSize = sizeof(wpt_uint32); + wdiEventData.pCBfnc = NULL; + wdiEventData.pUserData = NULL; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); + +}/* WDI_SetRtsCtsHTVhtInd */ + +WDI_Status +WDI_ProcessEnableDisableCAEventInd +( + WDI_ControlBlockType* pWDICtx, + WDI_EventInfoType* pEventData +) +{ + wpt_uint8* pSendBuffer = NULL; + wpt_uint16 usDataOffset = 0; + wpt_uint16 usSendSize = 0; + wpt_uint32 *val; + tHalAvoidFreqRangeCtrlParam *avoidFreqRangeCtrlParam; + WDI_Status wdiStatus = WDI_STATUS_SUCCESS; + + + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, + "%s", __func__); + + /*------------------------------------------------------------------------- + Sanity check + -------------------------------------------------------------------------*/ + if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "%s: Invalid parameters", __func__); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + val = (wpt_uint32*)pEventData->pEventData; + /*----------------------------------------------------------------------- + Get message buffer + -----------------------------------------------------------------------*/ + + if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, + WDI_SEND_FREQ_RANGE_CONTROL_IND, + sizeof(tHalAvoidFreqRangeCtrlParam), + &pSendBuffer, &usDataOffset, &usSendSize))|| + ( usSendSize < (usDataOffset + sizeof(tHalAvoidFreqRangeCtrlParam) ))) + { + WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Unable to get send buffer in Channel Avoidance Ind %p ", + pEventData); + WDI_ASSERT(0); + return WDI_STATUS_E_FAILURE; + } + avoidFreqRangeCtrlParam = + (tHalAvoidFreqRangeCtrlParam*)(pSendBuffer + usDataOffset); + avoidFreqRangeCtrlParam->status = *val; + + pWDICtx->pReqStatusUserData = NULL; + pWDICtx->pfncRspCB = NULL; + /*------------------------------------------------------------------------- + Send AVOID_FREQ_RANGE_CONTROL_IND Indication to HAL + -------------------------------------------------------------------------*/ + wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); + return (wdiStatus != WDI_STATUS_SUCCESS) ? wdiStatus:WDI_STATUS_SUCCESS_SYNC; +} + +WDI_Status +WDI_EnableDisableCAEventInd +( + wpt_uint32 val +) +{ + WDI_EventInfoType wdiEventData; + /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + /*------------------------------------------------------------------------ + Sanity Check + ------------------------------------------------------------------------*/ + if ( eWLAN_PAL_FALSE == gWDIInitialized ) + { + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "WDI API call before module is initialized - Fail request"); + return WDI_STATUS_E_NOT_ALLOWED; + } + + /*------------------------------------------------------------------------ + Fill in Event data and post to the Main FSM + ------------------------------------------------------------------------*/ + wdiEventData.wdiRequest = WDI_SEND_FREQ_RANGE_CONTROL_IND; + wdiEventData.pEventData = (void *) &val; + wdiEventData.uEventDataSize = sizeof(wpt_uint32); + wdiEventData.pCBfnc = NULL; + wdiEventData.pUserData = NULL; + + return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); + +} /* WDI_EnableDisableCAEventInd */ diff --git a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_dp.c b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_dp.c index 00ab8118ef5d..9355787abede 100644 --- a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_dp.c +++ b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_dp.c @@ -48,9 +48,6 @@ Are listed for each API below. - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -389,7 +386,8 @@ WDI_FillTxBd wpt_uint8 ucProtMgmtFrame, wpt_uint32 uTimeStamp, wpt_uint8 isEapol, - wpt_uint8* staIndex + wpt_uint8* staIndex, + wpt_uint32 txBdToken ) { wpt_uint8 ucTid = *pTid; @@ -410,6 +408,7 @@ WDI_FillTxBd /*------------------------------------------------------------------------ Get type and subtype of the frame first ------------------------------------------------------------------------*/ + pBd->txBdToken = txBdToken; ucType = (ucTypeSubtype & WDI_FRAME_TYPE_MASK) >> WDI_FRAME_TYPE_OFFSET; ucSubType = (ucTypeSubtype & WDI_FRAME_SUBTYPE_MASK); @@ -553,10 +552,18 @@ WDI_FillTxBd } #endif - if(ucTxFlag & WDI_USE_BD_RATE_MASK) + if(ucTxFlag & WDI_USE_BD_RATE_1_MASK) { pBd->bdRate = WDI_BDRATE_BCDATA_FRAME; } + else if(ucTxFlag & WDI_USE_BD_RATE_2_MASK) + { + pBd->bdRate = WDI_BDRATE_BCMGMT_FRAME; + } + else if(ucTxFlag & WDI_USE_BD_RATE_3_MASK) + { + pBd->bdRate = WDI_BDRATE_CTRL_FRAME; + } pBd->rmf = WDI_RMF_DISABLED; diff --git a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_sta.c b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_sta.c index 8f0190cc12e6..9b8aa788bf83 100644 --- a/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_sta.c +++ b/drivers/staging/prima/CORE/WDI/CP/src/wlan_qct_wdi_sta.c @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2008 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== diff --git a/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h b/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h index 9bebb4413b87..fea8be8717f9 100644 --- a/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h +++ b/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h @@ -39,8 +39,6 @@ * This file contains the external API exposed by the * wlan device abstarction layer module. * - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary */ @@ -70,6 +68,7 @@ typedef struct wpt_uint16 fPktlen; wpt_status txCompleteStatus; wpt_uint8 staIdx; + wpt_uint32 txBdToken; } WDI_DS_TxMetaInfoType; @@ -88,6 +87,20 @@ typedef enum WDI_DS_OPCODE_MAX }WDI_DS_BAOpCodeEnumType; +#define WDI_DS_LOG_PKT_TYPE_LEN 4 +typedef enum +{ + WDI_DS_PACKET_LOG = 1<<0, + + // Insert new values before this + + // If the value of WDI_DS_MAX LOG is increased please + // make sure to change the data type of + // WDI_DS_RxMetaInfoType.loggingData from wpt_uint8 + // to accommodate more values + WDI_DS_MAX_LOG = 1<<31 +}WDI_DS_LoggingDataEnumType; + typedef struct { wpt_uint8 staId; @@ -159,6 +172,7 @@ typedef struct #ifdef WLAN_FEATURE_EXTSCAN wpt_uint32 extscanBuffer; #endif + wpt_uint32 loggingData; } WDI_DS_RxMetaInfoType; typedef struct sPktMetaInfo @@ -170,6 +184,17 @@ typedef struct sPktMetaInfo } u; } WDI_DS_MetaInfoType; +typedef struct +{ + wpt_boolean active; + wpt_uint64 logBuffAddress[MAX_NUM_OF_BUFFER]; + wpt_uint32 logBuffLength[MAX_NUM_OF_BUFFER]; + /* Log type i.e. Mgmt frame = 0, QXDM = 1, FW Mem dump = 2 */ + wpt_uint8 logType; + /* Indicate if Last segment of log is received*/ + wpt_boolean done; +} WDI_DS_LoggingSessionType; + WPT_STATIC WPT_INLINE WDI_DS_RxMetaInfoType* WDI_DS_ExtractRxMetaData (wpt_packet *pFrame) { WDI_DS_RxMetaInfoType * pRxMetadata = @@ -189,6 +214,7 @@ WPT_STATIC WPT_INLINE WDI_DS_TxMetaInfoType* WDI_DS_ExtractTxMetaData (wpt_packe typedef void (*WDI_DS_TxCompleteCallback)(void *pContext, wpt_packet *pFrame); typedef void (*WDI_DS_RxPacketCallback) (void *pContext, wpt_packet *pFrame); typedef void (*WDI_DS_TxFlowControlCallback)(void *pContext, wpt_uint8 ac_mask); +typedef void (*WDI_DS_RxLogCallback)(void); @@ -211,6 +237,7 @@ WDI_Status WDI_DS_Register( void *pContext, WDI_DS_TxCompleteCallback pfnTxCompleteCallback, WDI_DS_RxPacketCallback pfnRxPacketCallback, WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback, + WDI_DS_RxLogCallback pfnRxLogCallback, void *pCallbackContext); @@ -356,4 +383,7 @@ void WDI_DS_ActivateTrafficStats(void); */ void WDI_DS_ClearTrafficStats(void); +void *WDI_DS_GetLoggingMbPhyAddr(void *pContext); +void *WDI_DS_GetLoggingMbAddr(void *pContext); +void *WDI_DS_GetLoggingSession(void *pContext); #endif diff --git a/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h b/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h index b6bf52fde1df..3a5f53d7fda3 100644 --- a/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h +++ b/drivers/staging/prima/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h @@ -39,8 +39,6 @@ * This file contains the external API exposed by the * wlan device abstarction layer module. * - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary */ #include "wlan_qct_pal_type.h" @@ -49,7 +47,7 @@ #include "wlan_qct_pal_trace.h" #include "wlan_qct_wdi_ds.h" #include "wlan_qct_dxe.h" - +#include "wlan_hal_msg.h" #define WDI_DS_MAX_CHUNK_SIZE 128 #define WDI_802_11_MAX_HEADER_LEN 40 @@ -147,11 +145,21 @@ typedef struct wpt_uint8 staIdx; } WDI_DS_staIdxPerBssIdxType; +typedef struct +{ + void * pLoggingMbVirtAddress; + void * pLoggingMbPhysAddress; + WDI_DS_LoggingSessionType loggingSession; +} WDI_DS_LoggingMbType; + WDI_Status WDI_DS_MemPoolCreate(WDI_DS_BdMemPoolType *memPool, wpt_uint8 chunkSize, wpt_uint8 numChunks); void *WDI_DS_MemPoolAlloc(WDI_DS_BdMemPoolType *memPool, void **pPhysAddress, WDI_ResPoolType wdiResPool); void WDI_DS_MemPoolFree(WDI_DS_BdMemPoolType *memPool, void *pVirtAddress, void *pPhysAddress); void WDI_DS_MemPoolDestroy(WDI_DS_BdMemPoolType *memPool); +WDI_Status WDI_DS_LoggingMbCreate(WDI_DS_LoggingMbType *pLoggingMailbox, wpt_uint8 size); +void WDI_DS_LoggingMbDestroy(WDI_DS_LoggingMbType *pLoggingMailbox); + typedef struct { void *pcontext; @@ -162,7 +170,9 @@ typedef struct WDI_DS_RxPacketCallback receiveFrameCB; WDI_DS_TxCompleteCallback txCompleteCB; WDI_DS_TxFlowControlCallback txResourceCB; + WDI_DS_RxLogCallback rxLogCB; WDI_DS_staIdxPerBssIdxType staIdxPerBssIdxTable[WDI_DS_MAX_SUPPORTED_BSS]; + WDI_DS_LoggingMbType loggingMbContext; } WDI_DS_ClientDataType; WPT_STATIC WPT_INLINE void WDI_GetBDPointers(wpt_packet *pFrame, void **pVirt, void **pPhys) diff --git a/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_bd.c b/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_bd.c index 4284658f9054..b29efa728395 100644 --- a/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_bd.c +++ b/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_bd.c @@ -36,8 +36,6 @@ * This file contains the external API implemntation exposed by the * wlan device abstarction layer module. * - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary */ #include "wlan_qct_wdi.h" @@ -193,6 +191,42 @@ void WDI_DS_MemPoolDestroy(WDI_DS_BdMemPoolType *memPool) wpalMemoryFree(memPool->AllocationBitmap); wpalMemoryZero(memPool, sizeof(*memPool)); } + +WDI_Status WDI_DS_LoggingMbCreate(WDI_DS_LoggingMbType *pLoggingMailbox, wpt_uint8 size) +{ + pLoggingMailbox->pLoggingMbVirtAddress = wpalDmaMemoryAllocate(size, + &(pLoggingMailbox->pLoggingMbPhysAddress)); + if (pLoggingMailbox->pLoggingMbVirtAddress == 0) + return WDI_STATUS_E_FAILURE; + return WDI_STATUS_SUCCESS; +} + +void *WDI_DS_GetLoggingMbPhyAddr(void *pContext) +{ + WDI_DS_ClientDataType *pClientData = WDI_DS_GetDatapathContext(pContext); + + return pClientData->loggingMbContext.pLoggingMbPhysAddress; +} + +void *WDI_DS_GetLoggingMbAddr(void *pContext) +{ + WDI_DS_ClientDataType *pClientData = pContext; + + return pClientData->loggingMbContext.pLoggingMbVirtAddress; +} + +void*WDI_DS_GetLoggingSession(void *pContext) +{ + WDI_DS_ClientDataType *pClientData = pContext; + + return &pClientData->loggingMbContext.loggingSession; +} + +void WDI_DS_LoggingMbDestroy(WDI_DS_LoggingMbType *pLoggingMailbox) +{ + wpalDmaMemoryFree(pLoggingMailbox->pLoggingMbVirtAddress); +} + /* * Allocate chunk memory */ diff --git a/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_ds.c b/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_ds.c index 572cd18d7c59..902c0de1f596 100644 --- a/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_ds.c +++ b/drivers/staging/prima/CORE/WDI/DP/src/wlan_qct_wdi_ds.c @@ -36,8 +36,6 @@ * This file contains the external API implemntation exposed by the * wlan device abstarction layer module. * - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary */ @@ -71,6 +69,7 @@ WDI_Status WDI_DS_Register( void *pContext, WDI_DS_TxCompleteCallback pfnTxCompleteCallback, WDI_DS_RxPacketCallback pfnRxPacketCallback, WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback, + WDI_DS_RxLogCallback pfnRxLogCallback, void *pCallbackContext) { WDI_DS_ClientDataType *pClientData; @@ -96,6 +95,7 @@ WDI_Status WDI_DS_Register( void *pContext, pClientData->receiveFrameCB = pfnRxPacketCallback; pClientData->txCompleteCB = pfnTxCompleteCallback; pClientData->txResourceCB = pfnTxFlowControlCallback; + pClientData->rxLogCB = pfnRxLogCallback; pClientData->pCallbackContext = pCallbackContext; for(bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++) @@ -212,7 +212,8 @@ WDI_Status WDI_DS_TxPacket(void *pContext, "Packet Length is %d\n", pTxMetadata->fPktlen); } wdiStatus = WDI_FillTxBd(pContext, ucTypeSubtype, pSTAMACAddress, pAddr2MACAddress, - &ucUP, 1, pvBDHeader, ucTxFlag /* No ACK */, ucProtMgmtFrame, 0, isEapol, &staId); + &ucUP, 1, pvBDHeader, ucTxFlag /* No ACK */, ucProtMgmtFrame, 0, isEapol, &staId, + pTxMetadata->txBdToken); if(WDI_STATUS_SUCCESS != wdiStatus) { diff --git a/drivers/staging/prima/CORE/WDI/TRP/CTS/inc/wlan_qct_wdi_cts.h b/drivers/staging/prima/CORE/WDI/TRP/CTS/inc/wlan_qct_wdi_cts.h index 8ca124081775..16bfad0d3b94 100644 --- a/drivers/staging/prima/CORE/WDI/TRP/CTS/inc/wlan_qct_wdi_cts.h +++ b/drivers/staging/prima/CORE/WDI/TRP/CTS/inc/wlan_qct_wdi_cts.h @@ -39,8 +39,6 @@ DESCRIPTION service module. - Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c b/drivers/staging/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c index 41b6e375e99a..9c04d8827b43 100644 --- a/drivers/staging/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c +++ b/drivers/staging/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,9 +42,6 @@ Are listed for each API below. - Copyright (c) 2010-2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ===========================================================================*/ /*=========================================================================== @@ -137,6 +134,7 @@ typedef struct WCTS_RxMsgCBType wctsRxMsgCB; void* wctsRxMsgCBData; WCTS_StateType wctsState; + vos_spin_lock_t wctsStateLock; smd_channel_t* wctsChannel; wpt_list wctsPendingQueue; wpt_uint32 wctsMagic; @@ -168,15 +166,7 @@ typedef struct /*---------------------------------------------------------------------------- * Static Variable Definitions * -------------------------------------------------------------------------*/ -#ifdef FEATURE_R33D -/* R33D will not close SMD port - * If receive close request from WDI, just pretend as port closed, - * Store control block info static memory, and reuse next open */ -static WCTS_ControlBlockType *ctsCB; - -/* If port open once, not try to actual open next time */ -static int port_open; -#endif /* FEATURE_R33D */ + /*---------------------------------------------------------------------------- * Static Function Declarations and Definitions * -------------------------------------------------------------------------*/ @@ -561,10 +551,13 @@ WCTS_NotifyCallback /* SMD channel was closed from the remote side, * this would happen only when Riva crashed and SMD is * closing the channel on behalf of Riva */ + vos_spin_lock_acquire(&pWCTSCb->wctsStateLock); pWCTSCb->wctsState = WCTS_STATE_REM_CLOSED; WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "%s: received SMD_EVENT_CLOSE WLAN driver going down now", __func__); + vos_spin_lock_release(&pWCTSCb->wctsStateLock); + /* subsystem restart: shutdown */ wpalDriverShutdown(); return; @@ -575,7 +568,7 @@ WCTS_NotifyCallback return; case SMD_EVENT_REOPEN_READY: - WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, + WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, "%s: received SMD_EVENT_REOPEN_READY from SMD", __func__); /* unlike other events which occur when our kernel threads are @@ -672,19 +665,6 @@ WCTS_OpenTransport return (WCTS_HandleType)pWCTSCb; } -#ifdef FEATURE_R33D - if(port_open) - { - /* Port open before, not need to open again */ - /* notified registered client that the channel is open */ - ctsCB->wctsState = WCTS_STATE_OPEN; - ctsCB->wctsNotifyCB((WCTS_HandleType)ctsCB, - WCTS_EVENT_OPEN, - ctsCB->wctsNotifyCBData); - return (WCTS_HandleType)ctsCB; - } -#endif /* FEATURE_R33D */ - /* allocate a ControlBlock to hold all context */ pWCTSCb = wpalMemoryAllocate(sizeof(*pWCTSCb)); if (NULL == pWCTSCb) { @@ -699,12 +679,6 @@ WCTS_OpenTransport values */ wpalMemoryZero(pWCTSCb, sizeof(*pWCTSCb)); -#ifdef FEATURE_R33D - smd_init(0); - port_open = 1; - ctsCB = pWCTSCb; -#endif /* FEATURE_R33D */ - /*Initialise the event*/ wpalEventInit(&pWCTSCb->wctsEvent); @@ -717,6 +691,7 @@ WCTS_OpenTransport /* initialize the remaining fields */ wpal_list_init(&pWCTSCb->wctsPendingQueue); pWCTSCb->wctsMagic = WCTS_CB_MAGIC; + vos_spin_lock_init(&pWCTSCb->wctsStateLock); pWCTSCb->wctsState = WCTS_STATE_OPEN_PENDING; pWCTSCb->wctsChannel = NULL; @@ -817,18 +792,6 @@ WCTS_CloseTransport return eWLAN_PAL_STATUS_E_INVAL; } -#ifdef FEATURE_R33D - /* Not actually close port, just pretend */ - /* notified registered client that the channel is closed */ - pWCTSCb->wctsState = WCTS_STATE_CLOSED; - pWCTSCb->wctsNotifyCB((WCTS_HandleType)pWCTSCb, - WCTS_EVENT_CLOSE, - pWCTSCb->wctsNotifyCBData); - - printk(KERN_ERR "R33D Not need to close"); - return eWLAN_PAL_STATUS_SUCCESS; -#endif /* FEATURE_R33D */ - /*Free the buffers in the pending queue.*/ while (eWLAN_PAL_STATUS_SUCCESS == wpal_list_remove_front(&pWCTSCb->wctsPendingQueue, &pNode)) { @@ -874,7 +837,7 @@ WCTS_CloseTransport pWCTSCb->wctsNotifyCB((WCTS_HandleType)pWCTSCb, WCTS_EVENT_CLOSE, pWCTSCb->wctsNotifyCBData); - + vos_spin_lock_destroy(&pWCTSCb->wctsStateLock); /* release the resource */ pWCTSCb->wctsMagic = 0; wpalMemoryFree(pWCTSCb); @@ -996,14 +959,16 @@ WCTS_SendMessage to that state. when we do so, we enable the remote read interrupt so that we'll be notified when messages are read from the remote end */ - if (WCTS_STATE_DEFERRED != pWCTSCb->wctsState) { + vos_spin_lock_acquire(&pWCTSCb->wctsStateLock); + if ((WCTS_STATE_DEFERRED != pWCTSCb->wctsState) && + (WCTS_STATE_REM_CLOSED != pWCTSCb->wctsState)) { - /* Mark the state as deferred. - Later: We may need to protect wctsState by locks*/ + /* Mark the state as deferred.*/ pWCTSCb->wctsState = WCTS_STATE_DEFERRED; smd_enable_read_intr(pWCTSCb->wctsChannel); } + vos_spin_lock_release(&pWCTSCb->wctsStateLock); /*indicate to client that message was placed in deferred queue*/ return eWLAN_PAL_STATUS_E_RESOURCES; diff --git a/drivers/staging/prima/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h b/drivers/staging/prima/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h index 657ca86f31fd..f7e74d1bb87e 100644 --- a/drivers/staging/prima/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h +++ b/drivers/staging/prima/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,8 +41,6 @@ * This file contains the API exposed by the * wlan device abstarction layer module for abstracting DXE/SDIO. * - * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. - * Qualcomm Confidential and Proprietary * * Example usage for DXE. * ---------------------- @@ -74,9 +72,18 @@ typedef enum WDTS_CHANNEL_TX_HIGH_PRI, WDTS_CHANNEL_RX_LOW_PRI, WDTS_CHANNEL_RX_HIGH_PRI, + WDTS_CHANNEL_RX_LOG, + WDTS_CHANNEL_RX_FW_LOG, WDTS_CHANNEL_MAX } WDTS_ChannelType; +#define WDTS_TRANSPORT_CHANNELS_MASK \ + (1<mgmtMemPool), pvBDHeader, physBDHeader); + VOS_TRACE(VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO, + "%s: Management frame Tx complete status: %d", __func__, status); break; } WDI_SetBDPointers(pFrame, 0, 0); @@ -511,6 +534,56 @@ WDTS_GetReplayCounterFromRxBD #endif } +/* Store RXBD, skb lenght, skb head, and skb end offset to global buffer. + * This function should be invoked when MPDU lenght + MPDU herader Offset + * if higher then 3872 bytes. + * Parameters: + * pFrame:Refernce to PAL frame. + * pBDHeader: BD header for PAL Frame. + * Return Value: v_VOID_t + * + */ +v_VOID_t +WDTS_StoreMetaInfo(wpt_packet *pFrame, wpt_uint8 *pBDHeader) +{ + wpt_uint8 usMPDUHLen; + wpt_boolean usAsf, usAef, usLsf, usESF; + wpt_uint16 usMPDULen; + wpt_uint32 usPmiCmd24to25; + struct WDTS_RxPktInfo *current_data = + &WDTS_Pkt_Data_Buff.PktInfo[WDTS_Pkt_Data_Buff.current_position]; + + vos_mem_copy(current_data->rx_bd, (void*)wpalPacketGetRawBuf(pFrame), + WDTS_MAX_RXDB_DATA_SIZE); + + usMPDULen = (wpt_uint16)WDI_RX_BD_GET_MPDU_LEN(pBDHeader); + usMPDUHLen = (wpt_uint8)WDI_RX_BD_GET_MPDU_H_LEN(pBDHeader); + usAsf = (wpt_boolean)WDI_RX_BD_GET_ASF(pBDHeader); + usAef = (wpt_boolean)WDI_RX_BD_GET_AEF(pBDHeader); + usLsf = (wpt_boolean)WDI_RX_BD_GET_LSF(pBDHeader); + usESF = (wpt_boolean)WDI_RX_BD_GET_ESF(pBDHeader); + usPmiCmd24to25 = (wpt_uint32)WDI_RX_BD_GET_PMICMD_24TO25(pBDHeader); + + current_data->pFrame_head = wpalGetOSPktHead(pFrame); + current_data->pFrame_tail = wpalGetOSPktend(pFrame); + current_data->pFrame_len = wpalPacketGetLength(pFrame); + + WDTS_Pkt_Data_Buff.current_count++; + + /* Dump packet info */ + VOS_TRACE(VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR, + "count: %d usMPDULen: 0x%x, usMPDUHLen: 0x%x, usAsf: %x," + "usAef: %x, usLsf: 0x%x, usESF: 0x%x, usPmiCmd24to25: 0x%x," + "skb_len: 0x%x",WDTS_Pkt_Data_Buff.current_count, usMPDULen, + usMPDUHLen, usAsf, usAef, usLsf, usESF, usPmiCmd24to25, + current_data->pFrame_len); + + WDTS_Pkt_Data_Buff.current_position++; + if(WDTS_Pkt_Data_Buff.current_position >= WDTS_MAX_NUMBER_OF_RX_PKT) + WDTS_Pkt_Data_Buff.current_position = 0; + + return; +} /* DTS Rx packet function. * This function should be invoked by the transport device to indicate @@ -539,6 +612,14 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c return eWLAN_PAL_STATUS_E_FAILURE; } + // Normal DMA transfer does not contain RxBD + if (WDTS_CHANNEL_RX_FW_LOG == channel) + { + wpalFwLogPktSerialize(pFrame); + + return eWLAN_PAL_STATUS_SUCCESS; + } + /*------------------------------------------------------------------------ Extract BD header and check if valid ------------------------------------------------------------------------*/ @@ -585,6 +666,53 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c ucMPDUHOffset, usMPDUDOffset, usMPDULen, ucMPDUHLen, ucTid, WDI_RX_BD_HEADER_SIZE); + pRxMetadata = WDI_DS_ExtractRxMetaData(pFrame); + + // Special handling for frames which contain logging information + if (WDTS_CHANNEL_RX_LOG == channel) + { + if (VPKT_SIZE_BUFFER_ALIGNED < (usMPDULen+ucMPDUHOffset)) + { + /* Size of the packet tranferred by the DMA engine is + * greater than the the memory allocated for the skb + * Recover the SKB case of length is in same memory page + */ + WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + "Invalid Frame size, might memory corrupted(%d+%d/%d)", + usMPDULen, ucMPDUHOffset, VPKT_SIZE_BUFFER_ALIGNED); + + // Store RXBD, skb head, tail and skb lenght in circular buffer + WDTS_StoreMetaInfo(pFrame, pBDHeader); + + if ((usMPDULen+ucMPDUHOffset) <= WDTS_MAX_PAGE_SIZE) + { + wpalRecoverTail(pFrame); + wpalPacketFree(pFrame); + } else { + //Recovery may cause adjoining buffer corruption + WPAL_BUG(0); + } + + return eWLAN_PAL_STATUS_SUCCESS; + } + + /* Firmware should send the Header offset as length + * of RxBd and data length should be populated to + * the length of total data being sent + */ + wpalPacketSetRxLength(pFrame, usMPDULen+ucMPDUHOffset); + wpalPacketRawTrimHead(pFrame, ucMPDUHOffset); + + // Invoke Rx complete callback + wpalLogPktSerialize(pFrame); + + return eWLAN_PAL_STATUS_SUCCESS; + } + else + { + pRxMetadata->loggingData = 0; + } + if(!isFcBd) { if(usMPDUDOffset <= ucMPDUHOffset || usMPDULen < ucMPDUHLen) { @@ -609,19 +737,31 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c ucMPDUHOffset = usMPDUDOffset; } - if(VPKT_SIZE_BUFFER_ALIGNED < (usMPDULen+ucMPDUHOffset)){ - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, + if (VPKT_SIZE_BUFFER_ALIGNED < (usMPDULen+ucMPDUHOffset)) + { + /* Size of the packet tranferred by the DMA engine is + * greater than the the memory allocated for the skb + * Recover the SKB case of length is in same memory page + */ + WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL, "Invalid Frame size, might memory corrupted(%d+%d/%d)", usMPDULen, ucMPDUHOffset, VPKT_SIZE_BUFFER_ALIGNED); - /* Size of the packet tranferred by the DMA engine is - * greater than the the memory allocated for the skb - */ - WPAL_BUG(0); + // Store RXBD, skb head, tail and skb lenght in circular buffer + WDTS_StoreMetaInfo(pFrame, pBDHeader); - wpalPacketFree(pFrame); - return eWLAN_PAL_STATUS_SUCCESS; + if ((usMPDULen+ucMPDUHOffset) <= WDTS_MAX_PAGE_SIZE) + { + wpalRecoverTail(pFrame); + wpalPacketFree(pFrame); + } else { + //Recovery may cause adjoining buffer corruption + WPAL_BUG(0); + } + + return eWLAN_PAL_STATUS_SUCCESS; } + if(eWLAN_PAL_STATUS_SUCCESS != wpalPacketSetRxLength(pFrame, usMPDULen+ucMPDUHOffset)) { DTI_TRACE( DTI_TRACE_LEVEL_ERROR, "Invalid Frame Length, Frame dropped.."); @@ -634,9 +774,6 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c wpalPacketFree(pFrame); return eWLAN_PAL_STATUS_SUCCESS; } - - - pRxMetadata = WDI_DS_ExtractRxMetaData(pFrame); pRxMetadata->fc = isFcBd; pRxMetadata->staId = WDI_RX_BD_GET_STA_ID(pBDHeader); @@ -730,16 +867,10 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c WPAL_PACKET_SET_BD_POINTER(pFrame, pBDHeader); WPAL_PACKET_SET_BD_LENGTH(pFrame, sizeof(WDI_RxBdType)); -#ifdef DEBUG_ROAM_DELAY - //Hack we need to send the frame type, so we are using bufflen as frametype - vos_record_roam_event(e_DXE_RX_PKT_TIME, (void *)pFrame, pRxMetadata->type); - //Should we use the below check to avoid funciton calls - /* - if(gRoamDelayMetaInfo.dxe_monitor_tx) + if (((WDI_ControlBlockType *)pClientData->pcontext)->roamDelayStatsEnabled) { + vos_record_roam_event(e_DXE_RX_PKT_TIME, (void *)pFrame, pRxMetadata->type); } - */ -#endif // Invoke Rx complete callback pClientData->receiveFrameCB(pClientData->pCallbackContext, pFrame); } @@ -748,7 +879,6 @@ wpt_status WDTS_RxPacket (void *pContext, wpt_packet *pFrame, WDTS_ChannelType c wpalPacketSetRxLength(pFrame, usMPDULen+ucMPDUHOffset); wpalPacketRawTrimHead(pFrame, ucMPDUHOffset); - pRxMetadata = WDI_DS_ExtractRxMetaData(pFrame); //flow control related pRxMetadata->fc = isFcBd; pRxMetadata->mclkRxTimestamp = WDI_RX_BD_GET_TIMESTAMP(pBDHeader); @@ -809,6 +939,76 @@ wpt_status WDTS_OOResourceNotification(void *pContext, WDTS_ChannelType channel, } +void WDTS_MbReceiveMsg(void *pContext) +{ + tpLoggingMailBox pLoggingMb; + WDI_DS_LoggingSessionType *pLoggingSession; + wpt_int8 i, noMem = 0; + wpt_uint32 totalLen = 0; + + pLoggingMb = (tpLoggingMailBox)WDI_DS_GetLoggingMbAddr(pContext); + pLoggingSession = (WDI_DS_LoggingSessionType *) + WDI_DS_GetLoggingSession(pContext); + + for(i = 0; i < MAX_NUM_OF_BUFFER; i++) + { + pLoggingSession->logBuffAddress[i] = pLoggingMb->logBuffAddress[i]; + if (!noMem && (pLoggingMb->logBuffLength[i] <= MAX_LOG_BUFFER_LENGTH)) + { + pLoggingSession->logBuffLength[i] = gTransportDriver.setupLogTransfer( + pLoggingMb->logBuffAddress[i], + pLoggingMb->logBuffLength[i]); + } + else + { + pLoggingSession->logBuffLength[i] = 0; + continue; + } + + totalLen += pLoggingSession->logBuffLength[i]; + + if (pLoggingSession->logBuffLength[i] < pLoggingMb->logBuffLength[i]) + { + noMem = 1; + } + } + + pLoggingSession->done = pLoggingMb->done; + pLoggingSession->logType = pLoggingMb->logType; + // Done using Mailbox, zero out the memory. + wpalMemoryZero(pLoggingMb, sizeof(tLoggingMailBox)); + + if (totalLen) + { + if (gTransportDriver.startLogTransfer() == eWLAN_PAL_STATUS_SUCCESS) + return; + } + + // Send Done event to upper layers, since we wont be getting any from DXE +} + +void WDTS_LogRxDone(void *pContext) +{ + WDI_DS_LoggingSessionType *pLoggingSession; + + pLoggingSession = (WDI_DS_LoggingSessionType *) + WDI_DS_GetLoggingSession(pContext); + + if (NULL == pContext || pLoggingSession == NULL) + { + return; + } + /* check for done and Log type Mgmt frame = 0, QXDM = 1, FW Mem dump = 2 */ + if (pLoggingSession->done && pLoggingSession->logType <= VALID_FW_LOG_TYPES) + vos_process_done_indication(pLoggingSession->logType, 0); + + pLoggingSession->done = 0; + pLoggingSession->logType = 0; + ((WDI_DS_ClientDataType *)(pContext))->rxLogCB(); + + return; +} + /* DTS open function. * On open the transport device should initialize itself. * Parameters: @@ -824,6 +1024,7 @@ wpt_status WDTS_openTransport( void *pContext) void *pDTDriverContext; WDI_DS_ClientDataType *pClientData; WDI_Status sWdiStatus = WDI_STATUS_SUCCESS; + WDTS_ClientCallbacks WDTSCb; pClientData = (WDI_DS_ClientDataType*) wpalMemoryAllocate(sizeof(WDI_DS_ClientDataType)); if (!pClientData){ @@ -840,8 +1041,13 @@ wpt_status WDTS_openTransport( void *pContext) return eWLAN_PAL_STATUS_E_FAILURE; } WDT_AssignTransportDriverContext(pContext, pDTDriverContext); - gTransportDriver.register_client(pDTDriverContext, WDTS_RxPacket, WDTS_TxPacketComplete, - WDTS_OOResourceNotification, (void*)pClientData); + + WDTSCb.rxFrameReadyCB = WDTS_RxPacket; + WDTSCb.txCompleteCB = WDTS_TxPacketComplete; + WDTSCb.lowResourceCB = WDTS_OOResourceNotification; + WDTSCb.receiveMbMsgCB = WDTS_MbReceiveMsg; + WDTSCb.receiveLogCompleteCB = WDTS_LogRxDone; + gTransportDriver.register_client(pDTDriverContext, WDTSCb, (void*)pClientData); /* Create a memory pool for Mgmt BDheaders.*/ sWdiStatus = WDI_DS_MemPoolCreate(&pClientData->mgmtMemPool, WDI_DS_MAX_CHUNK_SIZE, @@ -859,6 +1065,10 @@ wpt_status WDTS_openTransport( void *pContext) wpalMemoryZero(&gDsTrafficStats, sizeof(gDsTrafficStats)); + sWdiStatus = WDI_DS_LoggingMbCreate(&pClientData->loggingMbContext, sizeof(tLoggingMailBox)); + if (WDI_STATUS_SUCCESS != sWdiStatus) + return eWLAN_PAL_STATUS_E_NOMEM; + return eWLAN_PAL_STATUS_SUCCESS; } @@ -933,16 +1143,10 @@ wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame) #endif // Send packet to Transport Driver. status = gTransportDriver.xmit(pDTDriverContext, pFrame, channel); -#ifdef DEBUG_ROAM_DELAY - //Hack we need to send the frame type, so we are using bufflen as frametype - vos_record_roam_event(e_DXE_FIRST_XMIT_TIME, (void *)pFrame, pTxMetadata->frmType); - //Should we use the below check to avoid funciton calls - /* - if(gRoamDelayMetaInfo.dxe_monitor_tx) - { - } - */ -#endif + if (((WDI_ControlBlockType *)pContext)->roamDelayStatsEnabled) + { + vos_record_roam_event(e_DXE_FIRST_XMIT_TIME, (void *)pFrame, pTxMetadata->frmType); + } return status; } @@ -1031,6 +1235,19 @@ void WDTS_ChannelDebug(wpt_boolean displaySnapshot, wpt_uint8 debugFlags) return; } +/* DTS Transport Channel Kick Dxe + * Request Kick DXE when HDD TX time out happen + * + * Parameters : NONE + * Return Value: NONE + * + */ +void WDTS_ChannelKickDxe() +{ + gTransportDriver.kickDxe(); + return; +} + /* DTS Stop function. * Stop Transport driver, ie DXE, SDIO * Parameters: @@ -1070,7 +1287,9 @@ wpt_status WDTS_Close(void *pContext) /*Destroy the mem pool for mgmt BD headers*/ WDI_DS_MemPoolDestroy(&pClientData->dataMemPool); - + + WDI_DS_LoggingMbDestroy(&pClientData->loggingMbContext); + status = gTransportDriver.close(pDTDriverContext); wpalMemoryFree(pClientData); diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_list.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_list.h index 357c43251e3a..bbbf4928a8e5 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_list.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_list.h @@ -36,9 +36,6 @@ Definitions for platform dependent. It is with VOSS support. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_status.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_status.h index 68c86bb5c248..01eac26bedf4 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_status.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_status.h @@ -36,9 +36,6 @@ Definitions for platform dependent(Windows XP). - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_sync.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_sync.h index 326d8c3db6a0..ae762321ab3a 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_sync.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_sync.h @@ -36,9 +36,6 @@ Definitions for platform dependent(LA). - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_timer.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_timer.h index a694530cf3e5..162c2ca8a04b 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_timer.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_timer.h @@ -36,9 +36,6 @@ Definitions for platform dependent (Linux Android). - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_type.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_type.h index eb44872e8ad9..a9a724e2c6aa 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_type.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_os_type.h @@ -36,9 +36,6 @@ Definitions for platform dependent. This is for Linux/Android - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pack_align.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pack_align.h index c94af62382ac..f0c6045d935a 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pack_align.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pack_align.h @@ -37,9 +37,6 @@ Definitions for platform independent means of packing and aligning data structures - Copyright 2009 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_api.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_api.h index 6c26f5906273..c1a8d181233c 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_api.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -36,9 +36,6 @@ Definitions for platform independent - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -328,20 +325,31 @@ void wpalWlanReload(void); ---------------------------------------------------------------------------*/ void wpalWcnssResetIntr(void); +/*--------------------------------------------------------------------------- + wpalWcnssIsProntoHwVer3 - Check for Pronto ver3 HW + + Param: + None + Return: + TRUE if Ponto Hw Ver 3 + Therefore use WQ6 instead of WQ23 for TX Low/High Priority Channel +---------------------------------------------------------------------------*/ +int wpalWcnssIsProntoHwVer3(void); /*--------------------------------------------------------------------------- wpalFwDumpReq - Trigger the dump commands to Firmware Param: - cmd - Command No. to execute - arg1 - argument 1 to cmd - arg2 - argument 2 to cmd - arg3 - argument 3 to cmd - arg4 - argument 4 to cmd + cmd - Command No. to execute + arg1 - argument 1 to cmd + arg2 - argument 2 to cmd + arg3 - argument 3 to cmd + arg4 - argument 4 to cmd + async -asynchronous event. Don't wait for completion. Return: NONE ---------------------------------------------------------------------------*/ void wpalFwDumpReq(wpt_uint32 cmd, wpt_uint32 arg1, wpt_uint32 arg2, - wpt_uint32 arg3, wpt_uint32 arg4); + wpt_uint32 arg3, wpt_uint32 arg4, wpt_boolean async); /*--------------------------------------------------------------------------- wpalDevicePanic - Trigger Device Panic @@ -356,14 +364,14 @@ void wpalFwDumpReq(wpt_uint32 cmd, wpt_uint32 arg1, wpt_uint32 arg2, void wpalDevicePanic(void); /*--------------------------------------------------------------------------- - wpalIsWDresetInProgress - calls vos API isWDresetInProgress() + wpalIslogPInProgress - calls vos API vos_is_logp_in_progress() Param: NONE Return: STATUS --------------------------------------------------------------------------*/ -int wpalIsWDresetInProgress(void); +int wpalIslogPInProgress(void); /*--------------------------------------------------------------------------- wpalIsSsrPanicOnFailure - calls vos API isSsrPanicOnFailure() @@ -374,4 +382,11 @@ int wpalIsWDresetInProgress(void); STATUS --------------------------------------------------------------------------*/ int wpalIsSsrPanicOnFailure(void); + +int wpalGetDxeReplenishRXTimerVal(void); +int wpalIsDxeSSREnable(void); + +wpt_uint8 wpalIsFwLoggingEnabled(void); +wpt_uint8 wpalIsFwLoggingSupported(void); +wpt_uint8 wpalIsFwEvLoggingEnabled(void); #endif // __WLAN_QCT_PAL_API_H diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_list.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_list.h index 0d852ac0a77f..4645c72ec974 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_list.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_list.h @@ -36,9 +36,6 @@ Definitions for platform independent. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_msg.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_msg.h index 5e4219ffb20a..a059769790a0 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_msg.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_msg.h @@ -37,9 +37,6 @@ Definitions for platform dependent. Only work with legacy UMAC. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h index 917dfd5a5664..027d966fec47 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h @@ -76,7 +76,7 @@ #define VPKT_SIZE_BUFFER ((30 * 128) + 32) /* Transport channel count to report DIAG */ -#define WPT_NUM_TRPT_CHANNEL 4 +#define WPT_NUM_TRPT_CHANNEL 8 /* Transport channel name string size */ #define WPT_TRPT_CHANNEL_NAME 4 @@ -412,4 +412,71 @@ void wpalPacketStallDumpLog ); #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +/*--------------------------------------------------------------------------- + wpalLogPktSerialize - Serialize Logging data to logger thread + + Param: + wpt_packet pFrame - The packet which contains the logging data. + This packet has to be a VALID packet, as this + API will not do any checks on the validity of + the packet. + + Return: + NONE + +---------------------------------------------------------------------------*/ +void wpalLogPktSerialize +( + wpt_packet *pFrame +); + + +/*--------------------------------------------------------------------------- + wpalFwLogPktSerialize - Serialize Logging data to logger thread + + Param: + wpt_packet pFrame - The packet which contains the logging data. + This packet has to be a VALID packet, as this + API will not do any checks on the validity of + the packet. + + Return: + NONE + +---------------------------------------------------------------------------*/ +void wpalFwLogPktSerialize +( + wpt_packet *pFrame +); + +/*--------------------------------------------------------------------------- + wpalGetOSPktHead – Get the head of OS spacific socket buffer + Param: + pPacket – pointer to a wpt_packet + + Return: + void* - success +---------------------------------------------------------------------------*/ +void* wpalGetOSPktHead( wpt_packet *pPacket); + +/*--------------------------------------------------------------------------- + wpalGetOSPktend – Get end pointer of OS spacific socket buffer + Param: + pPacket – pointer to a wpt_packet + + Return: + void* - success +---------------------------------------------------------------------------*/ +void* wpalGetOSPktend( wpt_packet *pPacket); + +/*--------------------------------------------------------------------------- + wpalRecoverTail – recover currupted skb tail. + Param: + pPacket – pointer to a wpt_packet + + Return: + void - success +---------------------------------------------------------------------------*/ +void wpalRecoverTail( wpt_packet *pPacket); + #endif // __WLAN_QCT_PAL_PACKET_H diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_status.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_status.h index 6535a5146e65..99821f206e53 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_status.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_status.h @@ -36,9 +36,6 @@ Definitions for platform independent. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_sync.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_sync.h index 99ceaa073813..314263a7abd9 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_sync.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_sync.h @@ -36,9 +36,6 @@ Definitions for platform independent. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h index 0aa37f6fa6b7..c1750f5e551d 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h @@ -36,9 +36,6 @@ Definitions for platform independent. - Copyright 2010-2011 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h index 15d8b4bd76ee..88caff9e0cca 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h @@ -36,9 +36,6 @@ Definitions for platform independent - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_type.h b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_type.h index 586288d39f5f..45046acd977b 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_type.h +++ b/drivers/staging/prima/CORE/WDI/WPAL/inc/wlan_qct_pal_type.h @@ -36,9 +36,6 @@ Definitions for platform independent. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ #include "wlan_qct_os_type.h" diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c index 8ad374b9e318..9e0f047fea41 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012,2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012,2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ Definitions for platform Windows. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -413,27 +410,84 @@ void wpalWlanReload(void) void wpalWcnssResetIntr(void) { #ifdef HAVE_WCNSS_RESET_INTR - wcnss_reset_intr(); + wcnss_reset_fiq(true); #endif return; } +/*--------------------------------------------------------------------------- + wpalWcnssIsProntoHwVer3 - Check if Pronto Hw ver3 + + Param: + None + Return: + TRUE if Ponto Hw Ver 3 + Therefore use WQ6 instead of WQ23 for TX Low/High Priority Channel +---------------------------------------------------------------------------*/ +int wpalWcnssIsProntoHwVer3(void) +{ + return wcnss_is_hw_pronto_ver3(); +} + +/*--------------------------------------------------------------------------- + wpalIsFwLoggingEnabled - Check if Firmware will send logs using DXE + + Param: + None + Return: + Check the documentation of vos_is_fw_logging_enabled +---------------------------------------------------------------------------*/ +wpt_uint8 wpalIsFwLoggingEnabled(void) +{ + return vos_is_fw_logging_enabled(); +} + +/*--------------------------------------------------------------------------- + wpalIsFwLoggingEnabled - Check if Firmware will send running + logs using DXE + + Param: + None + Return: + Check the documentation of vos_is_fw_logging_enabled +---------------------------------------------------------------------------*/ +wpt_uint8 wpalIsFwEvLoggingEnabled(void) +{ + return vos_is_fw_ev_logging_enabled(); +} +/*--------------------------------------------------------------------------- + wpalIsFwLoggingSupported - Check if Firmware supports the fw->host + logging infrastructure + This API can only be called after fw caps + are exchanged. + + Param: + None + Return: + Check the documentation of vos_is_fw_logging_supported +---------------------------------------------------------------------------*/ +wpt_uint8 wpalIsFwLoggingSupported(void) +{ + return vos_is_fw_logging_supported(); +} + /*--------------------------------------------------------------------------- wpalFwDumpReq - Trigger the dump commands to Firmware Param: - cmd - Command No. to execute - arg1 - argument 1 to cmd - arg2 - argument 2 to cmd - arg3 - argument 3 to cmd - arg4 - argument 4 to cmd + cmd - Command No. to execute + arg1 - argument 1 to cmd + arg2 - argument 2 to cmd + arg3 - argument 3 to cmd + arg4 - argument 4 to cmd + async -asynchronous event. Don't wait for completion. Return: NONE ---------------------------------------------------------------------------*/ void wpalFwDumpReq(wpt_uint32 cmd, wpt_uint32 arg1, wpt_uint32 arg2, - wpt_uint32 arg3, wpt_uint32 arg4) + wpt_uint32 arg3, wpt_uint32 arg4, wpt_boolean async) { - vos_fwDumpReq(cmd, arg1, arg2, arg3, arg4); + vos_fwDumpReq(cmd, arg1, arg2, arg3, arg4, async); return; } @@ -453,16 +507,16 @@ void wpalDevicePanic(void) return; } /*--------------------------------------------------------------------------- - wpalIsWDresetInProgress - calls vos API isWDresetInProgress() + wpalIslogPInProgress - calls vos API vos_is_logp_in_progress() Param: NONE Return: STATUS ---------------------------------------------------------------------------*/ -int wpalIsWDresetInProgress(void) +int wpalIslogPInProgress(void) { - return isWDresetInProgress(); + return vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL); } /*--------------------------------------------------------------------------- @@ -478,3 +532,13 @@ int wpalIsSsrPanicOnFailure(void) return isSsrPanicOnFailure(); } +int wpalGetDxeReplenishRXTimerVal(void) +{ + return vos_get_dxeReplenishRXTimerVal(); +} + +int wpalIsDxeSSREnable(void) +{ + return vos_get_dxeSSREnable(); +} + diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c index 7932752c681a..1c0837174aee 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -34,9 +34,6 @@ This file implements the device specific HW access interface required by the WLAN Platform Abstraction Layer (WPAL) - Copyright (c) 2011 QUALCOMM Incorporated. - All Rights Reserved. - Qualcomm Confidential and Proprietary ========================================================================*/ /*=========================================================================== @@ -106,6 +103,7 @@ typedef struct { u64 *rx_enable_return; u8 rx_isr_enable_failure; u8 rx_isr_enable_partial_failure; + u8 tx_isr_enabled; } wcnss_env; static wcnss_env gEnv; @@ -335,6 +333,7 @@ wpt_status wpalEnableInterrupt ) { int ret; + wpt_status status = eWLAN_PAL_STATUS_SUCCESS; switch (intType) { @@ -362,13 +361,12 @@ wpt_status wpalEnableInterrupt gpEnv->rx_isr_enable_partial_failure = 1; /* not fatal -- keep on going */ } - gpEnv->rx_isr_enabled = 1; } else { enable_irq(gpEnv->rx_irq); - gpEnv->rx_isr_enabled = 1; } + gpEnv->rx_isr_enabled = 1; break; case DXE_INTERRUPT_TX_COMPLE: if (!gpEnv->tx_registered) @@ -396,16 +394,18 @@ wpt_status wpalEnableInterrupt { enable_irq(gpEnv->tx_irq); } + gpEnv->tx_isr_enabled = 1; break; default: WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s: unknown interrupt: %d", __func__, (int)intType); + status = eWLAN_PAL_STATUS_E_INVAL; break; } /* on the integrated platform there is no platform-specific interrupt control */ - return eWLAN_PAL_STATUS_SUCCESS; + return status; } /** @@ -428,7 +428,9 @@ wpt_status wpalDisableInterrupt wpt_uint32 intType ) { - switch (intType) + wpt_status status = eWLAN_PAL_STATUS_SUCCESS; + + switch (intType) { case DXE_INTERRUPT_RX_READY: gpEnv->rx_disable_return = VOS_RETURN_ADDRESS; @@ -437,17 +439,19 @@ wpt_status wpalDisableInterrupt break; case DXE_INTERRUPT_TX_COMPLE: disable_irq_nosync(gpEnv->tx_irq); + gpEnv->tx_isr_enabled = 0; break; default: WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s: unknown interrupt: %d", __func__, (int)intType); + status = eWLAN_PAL_STATUS_E_INVAL; break; } /* on the integrated platform there is no platform-specific interrupt control */ - return eWLAN_PAL_STATUS_SUCCESS; + return status; } /** diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c index b49849dd640f..e99b61e35797 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c @@ -33,9 +33,6 @@ Definitions for platform with legacy UMAC support. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c index f99751e46575..e5b310bca7a8 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,9 +33,6 @@ Definitions for platform with VOSS packet support and LA. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ @@ -46,6 +43,7 @@ #include "vos_packet.h" #include "vos_trace.h" #include "vos_list.h" +#include "vos_api.h" #include #include "dma-mapping.h" @@ -180,14 +178,13 @@ wpt_packet * wpalPacketAlloc(wpt_packet_type pktType, wpt_uint32 nPktSize, nPktSize, 1, VOS_FALSE, wpalPacketRXLowResourceCB, usrData); -#ifndef FEATURE_R33D /* Reserve the entire raw rx buffer for DXE */ if( vosStatus == VOS_STATUS_SUCCESS ) { wpalPacketAvailableCB = NULL; vosStatus = vos_pkt_reserve_head_fast( pVosPkt, &pData, nPktSize ); } -#endif /* FEATURE_R33D */ + if((NULL != pVosPkt) && (VOS_STATUS_E_RESOURCES != vosStatus)) { vos_pkt_get_packet_length(pVosPkt, &allocLen); @@ -444,6 +441,45 @@ wpt_status wpalPacketSetRxLength(wpt_packet *pPkt, wpt_uint32 len) } }/*wpalPacketSetRxLength*/ +void wpalRecoverTail(wpt_packet *pFrame) +{ + // Validate the parameter pointers + if (unlikely(NULL == pFrame)) + { + WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s : NULL packet pointer", __func__); + return; + } + + return vos_recover_tail(WPAL_TO_VOS_PKT(pFrame)); +} + +void* wpalGetOSPktHead(wpt_packet *pFrame) +{ + // Validate the parameter pointers + if (unlikely(NULL == pFrame)) + { + WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s : NULL packet pointer", __func__); + return NULL; + } + + return vos_get_pkt_head(WPAL_TO_VOS_PKT(pFrame)); +} + +void* wpalGetOSPktend(wpt_packet *pFrame) +{ + // Validate the parameter pointers + if (unlikely(NULL == pFrame)) + { + WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, + "%s : NULL packet pointer", __func__); + return 0; + } + + return vos_get_pkt_end(WPAL_TO_VOS_PKT(pFrame)); +} + /* Set of helper functions that will prepare packet for DMA transfer, based on the type of transfer : - to and from the device @@ -976,3 +1012,65 @@ void wpalPacketStallDumpLog return; } #endif /* FEATURE_WLAN_DIAG_SUPPORT */ + +/*--------------------------------------------------------------------------- + wpalLogPktSerialize - Serialize Logging data to logger thread + + Param: + wpt_packet pFrame - The packet which contains the logging data. + This packet has to be a VALID packet, as this + API will not do any checks on the validity of + the packet. + + Return: + NONE + +---------------------------------------------------------------------------*/ +void wpalLogPktSerialize +( + wpt_packet *pFrame +) +{ + WDI_DS_RxMetaInfoType *pRxMetadata; + void *pBuffer; + VOS_STATUS vosStatus; + + vosStatus = vos_pkt_peek_data(WPAL_TO_VOS_PKT(pFrame), 0, &pBuffer, + WDI_DS_LOG_PKT_TYPE_LEN); + + if (VOS_IS_STATUS_SUCCESS(vosStatus)) + { + // a VALID packet implies non NULL meta-data + pRxMetadata = WDI_DS_ExtractRxMetaData(pFrame); + pRxMetadata->loggingData = *((wpt_uint32 *)pBuffer); + + wpalPacketRawTrimHead(pFrame, WDI_DS_LOG_PKT_TYPE_LEN); + + vos_logger_pkt_serialize(WPAL_TO_VOS_PKT(pFrame), pRxMetadata->loggingData); + } + else + { + vos_pkt_return_packet(WPAL_TO_VOS_PKT(pFrame)); + } +} + +/*--------------------------------------------------------------------------- + wpalFwLogPktSerialize - Serialize Logging data to logger thread + + Param: + wpt_packet pFrame - The packet which contains the logging data. + This packet has to be a VALID packet, as this + API will not do any checks on the validity of + the packet. + + Return: + NONE + +---------------------------------------------------------------------------*/ +void wpalFwLogPktSerialize +( + wpt_packet *pFrame +) +{ + vos_logger_pkt_serialize(WPAL_TO_VOS_PKT(pFrame),LOG_PKT_TYPE_FW_LOG); +} diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c index 5e74261fa453..8dc369a31afd 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c @@ -33,9 +33,6 @@ Definitions for platform Windows and with legacy UMAC. - Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c index d38dd757a4d4..8bb86a12c18a 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c @@ -33,9 +33,6 @@ Definitions for platform Windows. - Copyright 2010-2011 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c index 83871cd61efe..91df19ecbcf0 100644 --- a/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c +++ b/drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c @@ -33,9 +33,6 @@ Definitions for Linux/Android platform - Copyright 2010-2011 (c) Qualcomm, Incorporated. All Rights Reserved. - - Qualcomm Confidential and Proprietary. ========================================================================*/ diff --git a/drivers/staging/prima/Kbuild b/drivers/staging/prima/Kbuild index ccb1f7ec6449..46ef90a74cd2 100644 --- a/drivers/staging/prima/Kbuild +++ b/drivers/staging/prima/Kbuild @@ -64,9 +64,6 @@ PANIC_ON_BUG := 1 #Re-enable wifi on WDI timeout RE_ENABLE_WIFI_ON_WDI_TIMEOUT := 0 -#Measure Roam Delay -MEASURE_ROAM_TIME_DELAY := 0 - ifeq ($(CONFIG_CFG80211),y) HAVE_CFG80211 := 1 else @@ -137,6 +134,7 @@ HDD_OBJS := $(HDD_SRC_DIR)/bap_hdd_main.o \ $(HDD_SRC_DIR)/wlan_hdd_main.o \ $(HDD_SRC_DIR)/wlan_hdd_mib.o \ $(HDD_SRC_DIR)/wlan_hdd_oemdata.o \ + $(HDD_SRC_DIR)/wlan_hdd_request_manager.o \ $(HDD_SRC_DIR)/wlan_hdd_scan.o \ $(HDD_SRC_DIR)/wlan_hdd_softap_tx_rx.o \ $(HDD_SRC_DIR)/wlan_hdd_tx_rx.o \ @@ -303,6 +301,9 @@ SME_P2P_OBJS = $(SME_SRC_DIR)/p2p/p2p_Api.o SME_RRM_OBJS := $(SME_SRC_DIR)/rrm/sme_rrm.o +SME_NAN_OBJS = $(SME_SRC_DIR)/nan/nan_Api.o + + SME_OBJS := $(SME_BTC_OBJS) \ $(SME_CCM_OBJS) \ $(SME_CMN_OBJS) \ @@ -311,7 +312,8 @@ SME_OBJS := $(SME_BTC_OBJS) \ $(SME_P2P_OBJS) \ $(SME_PMC_OBJS) \ $(SME_QOS_OBJS) \ - $(SME_RRM_OBJS) + $(SME_RRM_OBJS) \ + $(SME_NAN_OBJS) ############ SVC ############ SVC_DIR := CORE/SVC @@ -505,6 +507,7 @@ OBJS := $(BAP_OBJS) \ $(WDI_OBJS) EXTRA_CFLAGS += $(INCS) +EXTRA_CFLAGS += -fno-pic CDEFINES := -DANI_BUS_TYPE_PLATFORM=1 \ -DANI_LITTLE_BYTE_ENDIAN \ @@ -550,6 +553,7 @@ CDEFINES := -DANI_BUS_TYPE_PLATFORM=1 \ -DFEATURE_WLAN_LPHB \ -DFEATURE_WLAN_PAL_TIMER_DISABLE \ -DFEATURE_WLAN_PAL_MEM_DISABLE \ + -DFEATURE_WLAN_CH144 \ -DWLAN_BUG_ON_SKB_ERROR \ -DWLAN_DXE_LOW_RESOURCE_TIMER \ -DWLAN_LOGGING_SOCK_SVC_ENABLE \ @@ -595,15 +599,7 @@ endif #normally, TDLS negative behavior is not needed ifeq ($(CONFIG_QCOM_TDLS),y) CDEFINES += -DFEATURE_WLAN_TDLS -ifeq ($(BUILD_DEBUG_VERSION),1) -CDEFINES += -DWLAN_FEATURE_TDLS_DEBUG -endif CDEFINES += -DCONFIG_TDLS_IMPLICIT -#CDEFINES += -DFEATURE_WLAN_TDLS_NEGATIVE -#Code under FEATURE_WLAN_TDLS_INTERNAL is ported from volans, This code -#is not tested only verifed that it compiles. This is not required for -#supplicant based implementation -#CDEFINES += -DFEATURE_WLAN_TDLS_INTERNAL endif ifeq ($(CONFIG_PRIMA_WLAN_BTAMP),y) @@ -655,11 +651,8 @@ ifeq ($(CONFIG_ENABLE_LINUX_REG), y) CDEFINES += -DCONFIG_ENABLE_LINUX_REG endif -ifeq ($(MEASURE_ROAM_TIME_DELAY),1) -CDEFINES += -DDEBUG_ROAM_DELAY -endif - CDEFINES += -DFEATURE_WLAN_CH_AVOID +CDEFINES += -DWLAN_FEATURE_AP_HT40_24G # Some kernel include files are being moved. Check to see if # the old version of the files are present diff --git a/drivers/staging/prima/riva/inc/halLegacyPalTypes.h b/drivers/staging/prima/riva/inc/halLegacyPalTypes.h index 3dd3f3354f3b..75808b6bf9d6 100644 --- a/drivers/staging/prima/riva/inc/halLegacyPalTypes.h +++ b/drivers/staging/prima/riva/inc/halLegacyPalTypes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -55,6 +55,6 @@ typedef uint64 tANI_U64; typedef byte tANI_BYTE; typedef boolean tANI_BOOLEAN; -typedef uint32 tANI_TIMESTAMP; +typedef unsigned long tANI_TIMESTAMP; #endif /*__LEGACYPALTYPES_H__*/ diff --git a/drivers/staging/prima/riva/inc/wlan_hal_cfg.h b/drivers/staging/prima/riva/inc/wlan_hal_cfg.h index d2f42c1f71a0..d1e06039f8e1 100644 --- a/drivers/staging/prima/riva/inc/wlan_hal_cfg.h +++ b/drivers/staging/prima/riva/inc/wlan_hal_cfg.h @@ -266,13 +266,21 @@ #define QWLAN_HAL_CFG_ENABLE_DYNAMIC_WMMPS 208 #define QWLAN_HAL_CFG_BURST_MODE_BE_TXOP_VALUE 209 #define QWLAN_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE 210 +#define QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF 211 +#define QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT 212 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN 213 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN 214 +#define QWLAN_HAL_CFG_LINK_FAIL_TX_CNT 215 +#define QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES 216 +#define QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT 217 +#define QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE 219 +#define QWLAN_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE 220 - -#define QWLAN_HAL_CFG_MAX_PARAMS 211 +#define QWLAN_HAL_CFG_MAX_PARAMS 220 /* Total number of Integer CFGs. This is used while allocating the memory for TLV */ -#define QWLAN_HAL_CFG_INTEGER_PARAM 211 +#define QWLAN_HAL_CFG_INTEGER_PARAM 220 /*------------------------------------------------------------------------- Configuration Parameter min, max, defaults @@ -1041,5 +1049,47 @@ #define QWLAN_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE_MIN 0 #define QWLAN_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE_MAX 300 +/* QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF */ +#define QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF_DEF 1 +#define QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF_MIN 0 +#define QWLAN_HAL_CFG_BTC_FAST_WLAN_CONN_PREF_MAX 1 + +/* QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT */ +/* Bit mask value to enable RTS/CTS for different modes + * for 2.4 GHz, HT20 - 0x0001, for 2.4 GHz, HT40 - 0x0002 + * for 2.4 GHz, VHT20 - 0x0004, for 2.4 GHz, VHT40 - 0x0008 + * for 5 GHz, HT20 - 0x0100, for 5 GHz, HT40 - 0x0200 + * for 5 GHz, VHT20 - 0x0400, for 5 GHz, VHT40 - 0x0800 + * for 5 GHz, VHT80 - 0x1000 + */ +#define QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT_MIN 0x0000 +#define QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT_MAX 0x1f0f +#define QWLAN_HAL_CFG_ENABLE_RTSCTS_HTVHT_DEF 0x0000 + +/* QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN */ +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MIN 0 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_MAX 250000 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN_DEF 40000 +/* QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN */ +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MIN 0 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_MAX 250000 +#define QWLAN_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN_DEF 40000 +/* QWLAN_HAL_CFG_LINK_FAIL_TX_CNT */ +#define QWLAN_HAL_CFG_LINK_FAIL_TX_CNT_MIN 50 +#define QWLAN_HAL_CFG_LINK_FAIL_TX_CNT_MAX 1000 +#define QWLAN_HAL_CFG_LINK_FAIL_TX_CNT_DEF 200 +/*QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES*/ +#define QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES_MIN 0 +#define QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES_MAX 1 +#define QWLAN_HAL_CFG_TOGGLE_ARP_BDRATES_DEF 0 +/* QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT */ +#define QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT_DISABLE 0 +#define QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT_ENABLE 1 +#define QWLAN_HAL_CFG_OPTIMIZE_CA_EVENT_DEFAULT 0 + +/* QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE */ +#define QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE_MIN 0 +#define QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE_MAX 1 +#define QWLAN_HAL_CFG_BAR_WAKEUP_HOST_DISABLE_DEF 0 #endif //__WLAN_HAL_CFG_H__ diff --git a/drivers/staging/prima/riva/inc/wlan_hal_msg.h b/drivers/staging/prima/riva/inc/wlan_hal_msg.h index b0307b1a727f..581ad449b4b7 100644 --- a/drivers/staging/prima/riva/inc/wlan_hal_msg.h +++ b/drivers/staging/prima/riva/inc/wlan_hal_msg.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -130,6 +130,30 @@ typedef tANI_U8 tHalIpv4Addr[4]; #define WLAN_HAL_EXT_SCAN_MAX_SIG_CHANGE_APS 64 #define WLAN_HAL_EXT_SCAN_MAX_RSSI_SAMPLE_SIZE 8 +/* For Logging enhancement feature currently max 2 address will be passed */ +/* In future we may pass 3 address and length in suspend mode corner case */ +#define MAX_NUM_OF_BUFFER 3 + +/* Log types */ +typedef enum +{ + MGMT_FRAME_LOGS = 0, + QXDM_LOGGING = 1, + FW_MEMORY_DUMP = 2 +}tHalFrameLoggingType; + +/* Log size */ +typedef enum +{ + LOG_SIZE_4K = 0, + LOG_SIZE_8K = 1, + LOG_SIZE_12K = 2, + LOG_SIZE_16K = 3, + LOG_SIZE_32K = 4, + LOG_SIZE_64K = 5, + LOG_SIZE_96K = 6 +}tHalLogBuffSize; + /* Message types for messages exchanged between WDI and HAL */ typedef enum { @@ -523,6 +547,29 @@ typedef enum WLAN_HAL_FW_STATS_REQ = 296, WLAN_HAL_FW_STATS_RSP = 297, + WLAN_HAL_FW_LOGGING_INIT_REQ = 298, + WLAN_HAL_FW_LOGGING_INIT_RSP = 299, + WLAN_HAL_GET_FRAME_LOG_REQ = 300, + WLAN_HAL_GET_FRAME_LOG_RSP = 301, + + /* Monitor Mode */ + WLAN_HAL_ENABLE_MONITOR_MODE_REQ = 302, + WLAN_HAL_ENABLE_MONITOR_MODE_RSP = 303, + + WLAN_HAL_DISABLE_MONITOR_MODE_REQ = 304, + WLAN_HAL_DISABLE_MONITOR_MODE_RSP = 305, + + WLAN_HAL_SET_RTS_CTS_HTVHT_IND = 306, + // FW Logging + WLAN_HAL_FATAL_EVENT_LOGGING_REQ = 307, + WLAN_HAL_FATAL_EVENT_LOGGING_RSP = 308, + WLAN_HAL_FW_MEMORY_DUMP_REQ = 309, + WLAN_HAL_FW_MEMORY_DUMP_RSP = 310, + WLAN_HAL_FW_LOGGING_DXE_DONE_IND = 311, + WLAN_HAL_LOST_LINK_PARAMETERS_IND = 312, + WLAN_HAL_SEND_FREQ_RANGE_CONTROL_IND = 313, + + WLAN_HAL_SET_ALLOWED_ACTION_FRAMES_IND = 333, WLAN_HAL_MSG_MAX = WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE }tHalHostMsgType; @@ -3186,6 +3233,20 @@ typedef PACKED_PRE struct PACKED_POST tHalStatsRspParams statsRspParams; } tHalStatsRspMsg, *tpHalStatsRspMsg; + /*--------------------------------------------------------------------------- + * WLAN_HAL_SET_RTS_CTS_HTVHT_IND + *---------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 rtsCtsValue; +}tHalRtsCtsHtvhtIndParams, *tpHalRtsCtsHtvhtIndParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalRtsCtsHtvhtIndParams rtsCtsHtvhtIndParams; +} tHalRtsCtsHtvhtIndMsg, *tpHalRtsCtsHtvhtIndMsg; + /*--------------------------------------------------------------------------- * WLAN_HAL_FW_STATS_REQ *---------------------------------------------------------------------------*/ @@ -5764,6 +5825,8 @@ typedef PACKED_PRE struct PACKED_POST { /*Tx Complete Indication Success or Failure*/ tANI_U32 status; + /* Dialog token */ + tANI_U32 dialogToken; }tTxComplParams,*tpTxComplParams; typedef PACKED_PRE struct PACKED_POST @@ -5960,6 +6023,8 @@ typedef enum eAUTH_TYPE_WAPI_WAI_PSK = 9, eAUTH_TYPE_CCKM_WPA = 10, eAUTH_TYPE_CCKM_RSN = 11, + eAUTH_TYPE_RSN_PSK_SHA256 = 12, + eAUTH_TYPE_RSN_8021X_SHA256 = 13, eAUTH_TYPE_MAX = WLAN_HAL_MAX_ENUM_SIZE @@ -6707,6 +6772,10 @@ typedef enum { FW_STATS = 47, WPS_PRBRSP_TMPL = 48, BCN_IE_FLT_DELTA = 49, + TDLS_OFF_CHANNEL = 51, + MGMT_FRAME_LOGGING = 53, + ENHANCED_TXBD_COMPLETION = 54, + LOGGING_ENHANCEMENT = 55, MAX_FEATURE_SUPPORTED = 128, } placeHolderInCapBitmap; @@ -6734,6 +6803,7 @@ typedef PACKED_PRE struct PACKED_POST{ #define IS_DYNAMIC_WMM_PS_SUPPORTED_BY_HOST ((!!(halMsg_GetHostWlanFeatCaps(DYNAMIC_WMM_PS)))) #define IS_MAC_SPOOF_SCAN_SUPPORTED_BY_HOST ((!!(halMsg_GetHostWlanFeatCaps(MAC_SPOOFED_SCAN)))) #define IS_NEW_BMU_ERROR_RECOVERY_SUPPORTED_BY_HOST ((!!(halMsg_GetHostWlanFeatCaps(BMU_ERROR_GENERIC_RECOVERY)))) +#define IS_ENHANCED_TXBD_COMPLETION_SUPPORTED_BY_HOST ((!!(halMsg_GetHostWlanFeatCaps(ENHANCED_TXBD_COMPLETION)))) tANI_U8 halMsg_GetHostWlanFeatCaps(tANI_U8 feat_enum_value); @@ -7720,7 +7790,7 @@ typedef PACKED_PRE struct PACKED_POST * WLAN_HAL_AVOID_FREQ_RANGE_IND *-------------------------------------------------------------------------*/ -#define WLAN_HAL_MAX_AVOID_FREQ_RANGE 4 +#define WLAN_HAL_MAX_AVOID_FREQ_RANGE 15 typedef PACKED_PRE struct PACKED_POST { @@ -7823,6 +7893,22 @@ typedef PACKED_PRE struct PACKED_POST tHalBcnMissRateRspParams bcnMissRateRspParams; }tHalBcnMissRateRspMsg, *tpHalBcnMissRateRspMsg; +/*--------------------------------------------------------------------------- + * WLAN_HAL_SET_ALLOWED_ACTION_FRAMES_IND + *-------------------------------------------------------------------------*/ + +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 actionFramesBitMask; + tANI_U32 reserved; +}tHalAllowedActionFrames, *tpHalAllowedActionFrames; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalAllowedActionFrames allowedActionFrames; +}tHalAllowedActionFramesReqInd, *tpHalAllowedActionFramesReqInd; + /*-------------------------------------------------------------------------- * WLAN_HAL_LL_SET_STATS_REQ *---------------------------------------------------------------------------*/ @@ -8434,6 +8520,270 @@ typedef PACKED_PRE struct PACKED_POST tHalMsgHeader header; tMacSpoofedScanResp tMacSpoofedScanRespParams; } tMacSpoofedScanRespMsg, * tpMacSpoofedScanRespMsg; +/*--------------------------------------------------------------------------- + *WLAN_HAL_GET_FRAME_LOG_REQ + *--------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U8 flags; +}tGetFrameLogReqType, * tpGetFrameLogReqType; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tGetFrameLogReqType tGetFrameLogReqParams; +} tGetFrameLogReqMsg, * tpGetFrameLogReqMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_GET_FRAME_LOG_RSP + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 status; +} tGetFrameLogResp, * tpGetFrameLogResp; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tGetFrameLogResp tGetFrameLogRespParams; +} tGetFrameLogRespMsg, * tpGetFrameLogRespMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_FATAL_EVENT_LOGGING_REQ + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 reasonCode; +}tHalFatalEventLoggingReqParams, *tpHalFatalEventLoggingReqParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalFatalEventLoggingReqParams tFatalEventLoggingReqParams; +}tHalFatalEventLoggingReqMsg, *tpHalFatalEventLoggingReqMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_FATAL_EVENT_LOGGING_RSP + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ tANI_U32 status; +}tHalFatalEventLoggingRspParams, *tpHalFatalEventLoggingRspParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalFatalEventLoggingRspParams tFatalEventLoggingRspParams; +}tHalFatalEventLoggingRspMsg, *tpHalFatalEventLoggingRspMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_LOST_LINK_PARAMETERS_IND + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U8 bssIdx; + tANI_U8 rssi; + tSirMacAddr selfMacAddr; + tANI_U32 linkFlCnt; + tANI_U32 linkFlTx; + tANI_U32 lastDataRate; + tANI_U32 rsvd1; + tANI_U32 rsvd2; +}tHalLostLinkParametersIndParams, *tpHalLostLinkParametersIndParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalLostLinkParametersIndParams lostLinkParameters; +}tHalLostLinkParametersIndMsg, *tpHalLostLinkParametersIndMsg; + + +/*--------------------------------------------------------------------------- + *WLAN_HAL_FW_LOGGING_INIT_REQ + *--------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + /* BIT0 - enable frame logging + * BIT1 - enableBMUHWtracing + * BIT2 - enableQXDMlogging + * BIT3 - enableUElogDpuTxp + */ + tANI_U8 enableFlag; + tANI_U8 frameType; + tANI_U8 frameSize; + tANI_U8 bufferMode; + /* Host mem address to be used as logmailbox */ + tANI_U64 logMailBoxAddr; + /* firmware will wakeup the host to send logs always */ + tANI_U8 continuousFrameLogging; + /* Logging mail box version */ + tANI_U8 logMailBoxVer; + /* Max ring size in firmware to log msgs when host is suspended state */ + tANI_U8 maxLogBuffSize; + /* when firmware log reaches this threshold and + * if host is awake it will push the logs. + */ + tANI_U8 minLogBuffSize; + /* Reserved for future purpose */ + tANI_U32 reserved0; + tANI_U32 reserved1; + tANI_U32 reserved2; +}tFWLoggingInitReqType, * tpFWLoggingInitReqType; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tFWLoggingInitReqType tFWLoggingInitReqParams; +} tHalFWLoggingInitReqMsg, * tpHalFWLoggingInitReqMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_FW_LOGGING_INIT_RSP + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 status; + /* FW mail box address */ + tANI_U64 logMailBoxAddr; + /* Logging mail box version */ + tANI_U8 logMailBoxVer; + /* Qshrink is enabled */ + tANI_BOOLEAN logCompressEnabled; + /* Reserved for future purpose */ + tANI_U32 reserved0; + tANI_U32 reserved1; + tANI_U32 reserved2; +} tFWLoggingInitResp, * tpFWLoggingInitResp; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tFWLoggingInitResp tFWLoggingInitRespParams; +} tFWLoggingInitRespMsg, * tpFWLoggingInitRespMsg; + +/*--------------------------------------------------------------------------- + * WLAN_HAL_FW_LOGGING_DXE_DONE_IND + *-------------------------------------------------------------------------*/ +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 status; + tANI_U32 logBuffLength[MAX_NUM_OF_BUFFER]; + tANI_U64 logBuffAddress[MAX_NUM_OF_BUFFER]; +} tFWLoggingDxeDoneInd, * tpFWLoggingDxeDoneInd; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tFWLoggingDxeDoneInd tFWLoggingDxeDoneIndParams; +} tFWLoggingDxeDoneIndMsg, * tpFWLoggingDxeDoneIndMsg; + +/*--------------------------------------------------------------------------- + * Logging mail box structure + *-------------------------------------------------------------------------*/ + +#define MAILBOX_VERSION_V1 0x1 + +typedef PACKED_PRE struct PACKED_POST +{ + /* Logging mail box version */ + tANI_U8 logMbVersion; + /* Current logging buffer address */ + tANI_U64 logBuffAddress[MAX_NUM_OF_BUFFER]; + /* Current logging buffer length */ + tANI_U32 logBuffLength[MAX_NUM_OF_BUFFER]; + /* Flush reason code 0: Host requested Non zero FW FATAL event*/ + tANI_U16 reasonCode; + /* Log type i.e. Mgmt frame = 0, QXDM = 1, FW Mem dump = 2 */ + tANI_U8 logType; + /* Indicate if Last segment of log is received*/ + tANI_BOOLEAN done; +}tLoggingMailBox, *tpLoggingMailBox; + +/*--------------------------------------------------------------------------- +* WLAN_HAL_ENABLE_MONITOR_MODE_REQ +*-------------------------------------------------------------------------*/ + +/* only 1 filter is supported as of now */ +#define NUM_FILTERS_SUPPORTED 1 + +typedef PACKED_PRE struct PACKED_POST +{ + tSirMacAddr macAddr; + tANI_U8 isA1filteringNeeded; + tANI_U8 isA2filteringNeeded; + tANI_U8 isA3filteringNeeded; +}tHalMacFilter, *tpHalMacFilter; + +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U8 channelNumber; + ePhyChanBondState cbState; + + tANI_U32 maxAmpduLen; + tANI_U32 maxMpduInAmpduLen; + + tANI_U8 crcCheckEnabled; + + /* value is "1" for this FR. "0" means no filter, RECEIVE ALL PACKETS */ + tANI_U8 numMacFilters; + tHalMacFilter macFilters[NUM_FILTERS_SUPPORTED]; + + /* Each bit position maps to IEEE convention of typeSubtype */ + tANI_U64 typeSubtypeBitmap; + + tANI_U64 reserved; + +}tHalEnableMonitorModeReqParams, *tpHalEnableMonitorModeReqParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalEnableMonitorModeReqParams enableMonitorModeReqParams; +}tHalEnableMonitorModeReqMsg, *tpHalEnableMonitorModeReqMsg; + + +/*--------------------------------------------------------------------------- +* WLAN_HAL_ENABLE_MONITOR_MODE_RSP +*-------------------------------------------------------------------------*/ + +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 status; +}tHalEnableMonitorModeRspParams, *tpHalEnableMonitorModeRspParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalEnableMonitorModeRspParams enableMonitorModeRspParams; +}tHalEnableMonitorModeRspMsg, *tpHalEnableMonitorModeRspMsg; + +/*--------------------------------------------------------------------------- +* WLAN_HAL_DISABLE_MONITOR_MODE_REQ +*-------------------------------------------------------------------------*/ + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tANI_U8 resetConfiguration; +}tHalDisableMonitorModeReqMsg, *tpHalDisableMonitorModeReqMsg; + +/*--------------------------------------------------------------------------- +* WLAN_HAL_DISABLE_MONITOR_MODE_RSP +*-------------------------------------------------------------------------*/ + +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U32 status; +}tHalDisableMonitorModeRspParams, *tpHalDisableMonitorModeRspParams; + +typedef PACKED_PRE struct PACKED_POST +{ + tHalMsgHeader header; + tHalDisableMonitorModeRspParams disableMonitorModeRspParams; +}tHalDisableMonitorModeRspMsg, *tpHalDisableMonitorModeRspMsg; + +typedef PACKED_PRE struct PACKED_POST +{ + tANI_U8 status; +}tHalAvoidFreqRangeCtrlParam, *tpHalAvoidFreqRangeCtrlParam; #if defined(__ANI_COMPILER_PRAGMA_PACK_STACK) #pragma pack(pop) diff --git a/drivers/staging/prima/riva/inc/wlan_nv.h b/drivers/staging/prima/riva/inc/wlan_nv.h index 5eeca4bade69..e0f9d52a2dcd 100644 --- a/drivers/staging/prima/riva/inc/wlan_nv.h +++ b/drivers/staging/prima/riva/inc/wlan_nv.h @@ -229,6 +229,14 @@ typedef enum RF_SUBBAND_INVALID = 0x7FFFFFFF /* define as 4 bytes data */ }eRfSubBand; +#define HT_40MINUS_INDEX 4 + +typedef enum +{ + RF_CHAN_BOND_HT40_MINUS = 0, + RF_CHAN_BOND_HT40_PLUS +}eChannnelBondingTypes; + typedef enum { //2.4GHz Band diff --git a/drivers/staging/prima/riva/inc/wlan_phy.h b/drivers/staging/prima/riva/inc/wlan_phy.h index 058e70870a2a..59ba019494b6 100644 --- a/drivers/staging/prima/riva/inc/wlan_phy.h +++ b/drivers/staging/prima/riva/inc/wlan_phy.h @@ -744,6 +744,9 @@ typedef enum MAX_PHY_CHAIN_SEL, INVALID_PHY_CHAIN_SEL, + PHY_CHAIN_SEL_ANT_0, //append for antenna 0 selection + PHY_CHAIN_SEL_ANT_1, //append for antenna 1 selection + PHY_MAX_CHAIN_SELECT = 0x7FFFFFFF /* define as 4 bytes data */ }ePhyChainSelect; diff --git a/include/linux/wcnss_wlan.h b/include/linux/wcnss_wlan.h index 55d6b1ed152a..01d080acbc94 100644 --- a/include/linux/wcnss_wlan.h +++ b/include/linux/wcnss_wlan.h @@ -29,6 +29,7 @@ enum wcnss_hw_type { struct wcnss_wlan_config { int use_48mhz_xo; int is_pronto_v3; + int iris_id; }; enum { @@ -69,6 +70,7 @@ int wcnss_req_power_on_lock(char *driver_name); int wcnss_free_power_on_lock(char *driver_name); unsigned int wcnss_get_serial_number(void); void wcnss_flush_delayed_boot_votes(void); +int wcnss_get_iris_name(char *iris_version); int wcnss_get_wlan_mac_address(char mac_addr[WLAN_MAC_ADDR_SIZE]); void wcnss_allow_suspend(void); void wcnss_prevent_suspend(void); @@ -76,6 +78,7 @@ int wcnss_hardware_type(void); void *wcnss_prealloc_get(unsigned int size); int wcnss_prealloc_put(void *ptr); void wcnss_reset_intr(void); +void wcnss_reset_fiq(bool clk_chk_en); void wcnss_suspend_notify(void); void wcnss_resume_notify(void); void wcnss_riva_log_debug_regs(void); @@ -87,6 +90,7 @@ void wcnss_riva_dump_pmic_regs(void); int wcnss_xo_auto_detect_enabled(void); u32 wcnss_get_wlan_rx_buff_count(void); int wcnss_wlan_iris_xo_mode(void); +void wcnss_dump_stack(struct task_struct *task); #ifdef CONFIG_WCNSS_REGISTER_DUMP_ON_BITE void wcnss_log_debug_regs_on_bite(void); #else