Merge "wlan: Do not allow NoA setting in non P2P GO mode"
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index 34845b9..0c789a9 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -1542,6 +1542,16 @@
#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){
@@ -3046,6 +3056,7 @@
v_U32_t linkFailTxCnt;
v_BOOL_t ignorePeerHTopMode;
v_U8_t gOptimizeCAevent;
+ v_BOOL_t crash_inject_enabled;
} hdd_config_t;
/*---------------------------------------------------------------------------
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 982f69f..3a7a9da 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1703,6 +1703,7 @@
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
/**
@@ -1724,5 +1725,5 @@
return;
}
#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-
+void hdd_wlan_free_wiphy_channels(struct wiphy *wiphy);
#endif // end #if !defined( WLAN_HDD_MAIN_H )
diff --git a/CORE/HDD/inc/wlan_hdd_p2p.h b/CORE/HDD/inc/wlan_hdd_p2p.h
index b21ade7..b39f5aa 100644
--- a/CORE/HDD/inc/wlan_hdd_p2p.h
+++ b/CORE/HDD/inc/wlan_hdd_p2p.h
@@ -129,11 +129,10 @@
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);
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index dd5bbc5..09fb7d4 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -3352,7 +3352,6 @@
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))
{
@@ -3450,15 +3449,6 @@
}
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;
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index b775c61..5f5d258 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -3395,6 +3395,12 @@
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),
};
@@ -3819,6 +3825,7 @@
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);
}
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 9a39089..9898832 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -204,7 +204,7 @@
(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) ,
@@ -229,7 +229,7 @@
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) ,
@@ -297,7 +297,7 @@
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,
@@ -335,7 +335,7 @@
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,
@@ -5760,12 +5760,44 @@
{
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++)
{
@@ -5865,16 +5897,15 @@
}
}
}
-
/* 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 */
@@ -12212,12 +12243,11 @@
{
return status;
}
-
- if (pHddStaCtx->conn_info.connState == eConnectionState_Connecting)
- {
- sme_abortConnection(WLAN_HDD_GET_HAL_CTX(pAdapter),
+ /* 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
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 9c4f047..d761113 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -2329,6 +2329,7 @@
pHddCtx->cfg_ini= NULL;
wiphy_unregister(pHddCtx->wiphy);
+ hdd_wlan_free_wiphy_channels(pHddCtx->wiphy);
wiphy_free(pHddCtx->wiphy);
}
vos_preClose(&pVosContext);
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 2cc6251..02513b8 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1179,13 +1179,6 @@
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;
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 438e743..64264ee 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -3706,22 +3706,14 @@
if (VOS_TRUE == vos_mem_compare(targetApBssid,
pHddStaCtx->conn_info.bssId, sizeof(tSirMacAddr)))
{
- /* Reassoc to same AP, only supported for Open Security*/
- if ((pHddStaCtx->conn_info.ucEncryptionType ||
- pHddStaCtx->conn_info.mcEncryptionType))
- {
- hddLog(LOGE,
- FL("Reassoc to same AP, only supported for Open Security"));
- ret = -ENOTSUPP;
- goto exit;
- }
- hddLog(LOG1,
- FL("11r Reassoc BSSID is same as currently associated AP bssid"));
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "%s:11r Reassoc BSSID is same as currently associated AP bssid",
+ __func__);
sme_GetModifyProfileFields(hHal, pAdapter->sessionId,
&modProfileFields);
sme_RoamReassoc(hHal, pAdapter->sessionId,
NULL, modProfileFields, &roamId, 1);
- goto exit;
+ return 0;
}
/* Check channel number is a valid channel number */
@@ -3730,8 +3722,7 @@
{
hddLog(VOS_TRACE_LEVEL_ERROR,
"%s: Invalid Channel [%d]", __func__, channel);
- ret = -EINVAL;
- goto exit;
+ return -EINVAL;
}
trigger = eSME_ROAM_TRIGGER_SCAN;
@@ -6698,7 +6689,9 @@
/* 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;
@@ -8543,6 +8536,25 @@
wiphy_free(wiphy) ;
}
+/**
+ * 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
@@ -8883,6 +8895,7 @@
if (VOS_FTM_MODE != hdd_get_conparam())
{
wiphy_unregister(wiphy) ;
+ hdd_wlan_free_wiphy_channels(wiphy);
}
wiphy_free(wiphy) ;
if (hdd_is_ssr_required())
@@ -10409,6 +10422,8 @@
err_unregister_wiphy:
#endif
wiphy_unregister(wiphy) ;
+ hdd_wlan_free_wiphy_channels(wiphy);
+
err_vosstop:
vos_stop(pVosContext);
@@ -11578,6 +11593,52 @@
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;
+
+ /* 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;
+ }
+ 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;
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index d59e8d1..076bf8c 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -2231,12 +2231,12 @@
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;
@@ -2342,7 +2342,6 @@
}
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))
@@ -2389,6 +2388,9 @@
}
}
#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))
{
@@ -2439,6 +2441,7 @@
"Frames are pending. dropping frame !!!",
__func__);
}
+ mutex_unlock(&pHddCtx->roc_lock);
return;
}
}
@@ -2449,15 +2452,17 @@
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)
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index bba8bca..f567fd0 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -7061,20 +7061,8 @@
tpAniSirGlobal pMac = WLAN_HDD_GET_HAL_CTX(pAdapter);
v_U32_t roamId = 0;
tCsrRoamModifyProfileFields modProfileFields;
- hdd_station_ctx_t *pHddStaCtx =
- WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- /* Reassoc to same AP, only supported for Open Security*/
- if ((pHddStaCtx->conn_info.ucEncryptionType ||
- pHddStaCtx->conn_info.mcEncryptionType))
- {
- hddLog(LOGE,
- FL("Reassoc to same AP, only supported for Open Security"));
- return -ENOTSUPP;
- }
- sme_GetModifyProfileFields(pMac,
- pAdapter->sessionId, &modProfileFields);
- sme_RoamReassoc(pMac, pAdapter->sessionId,
- NULL, modProfileFields, &roamId, 1);
+ sme_GetModifyProfileFields(pMac, pAdapter->sessionId, &modProfileFields);
+ sme_RoamReassoc(pMac, pAdapter->sessionId, NULL, modProfileFields, &roamId, 1);
return 0;
}
@@ -7310,6 +7298,12 @@
{
case WE_LOG_DUMP_CMD:
{
+ 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]);
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h
index 0623873..be90e1f 100644
--- a/CORE/MAC/inc/aniGlobal.h
+++ b/CORE/MAC/inc/aniGlobal.h
@@ -1067,6 +1067,7 @@
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/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index cb9af1a..08291c8 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -3676,8 +3676,7 @@
typedef struct sSirSmeMgmtFrameInd
{
- tANI_U16 mesgType;
- tANI_U16 mesgLen;
+ tANI_U16 frameLen;
tANI_U32 rxChan;
tANI_U8 sessionId;
tANI_U8 frameType;
@@ -4701,6 +4700,23 @@
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
{
tANI_U32 msgLen;
diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h
index 014b0c4..97d127c 100644
--- a/CORE/MAC/inc/wniApi.h
+++ b/CORE/MAC/inc/wniApi.h
@@ -225,7 +225,6 @@
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,
@@ -379,6 +378,7 @@
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/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index 36af979..8a94e6c 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -359,6 +359,7 @@
tANI_U8 isKeyInstalled;
tANI_BOOLEAN is11Gonly;
tANI_BOOLEAN is_ext_caps_present;
+ tANI_BOOLEAN addBssfailed;
}tPESession, *tpPESession;
#define LIM_MAX_ACTIVE_SESSIONS 4
diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c
index e439e90..3bce9f4 100644
--- a/CORE/MAC/src/pe/lim/limAssocUtils.c
+++ b/CORE/MAC/src/pe/lim/limAssocUtils.c
@@ -743,12 +743,15 @@
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() ***/
diff --git a/CORE/MAC/src/pe/lim/limP2P.c b/CORE/MAC/src/pe/lim/limP2P.c
index ecfa883..6952d81 100644
--- a/CORE/MAC/src/pe/lim/limP2P.c
+++ b/CORE/MAC/src/pe/lim/limP2P.c
@@ -745,7 +745,6 @@
tANI_U8 *pRxPacketInfo, tpPESession psessionEntry,
tANI_S8 rxRssi)
{
- tSirMsgQ mmhMsg;
tpSirSmeMgmtFrameInd pSirSmeMgmtFrame = NULL;
tANI_U16 length;
tANI_U8 frameType;
@@ -770,8 +769,7 @@
}
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;
@@ -831,11 +829,14 @@
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() ***/
diff --git a/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
index ce2fff9..869b30f 100644
--- a/CORE/MAC/src/pe/lim/limProcessActionFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
@@ -2277,7 +2277,9 @@
__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 ;
@@ -2319,7 +2321,9 @@
}
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;
@@ -2350,7 +2354,8 @@
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;
@@ -2387,7 +2392,9 @@
__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;
@@ -2439,7 +2446,8 @@
__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;
}
@@ -2447,7 +2455,8 @@
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
@@ -2477,13 +2486,14 @@
}
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;
@@ -2506,8 +2516,10 @@
}
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;
@@ -2542,7 +2554,8 @@
#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;
@@ -2589,7 +2602,8 @@
}
#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;
}
}
@@ -2639,19 +2653,24 @@
}
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/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index ebb2e1b..62c1b81 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -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
@@ -1565,6 +1565,7 @@
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;
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index 9756c1c..d1316b2 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -1826,12 +1826,20 @@
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.
@@ -1895,10 +1903,17 @@
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)
{
@@ -3271,6 +3286,7 @@
mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_FT_REASSOC_FAILURE;
else
mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED;
+ psessionEntry->addBssfailed = true;
}
if(mlmAssocCnf.resultCode != eSIR_SME_SUCCESS)
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 09d1105..aa98b10 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -5475,6 +5475,35 @@
}
/**
+ * 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()
*
*FUNCTION:
@@ -5807,7 +5836,9 @@
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/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h
index f8d1bec..32bde8f 100644
--- a/CORE/SAP/inc/sapApi.h
+++ b/CORE/SAP/inc/sapApi.h
@@ -187,7 +187,6 @@
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,
@@ -394,7 +393,6 @@
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 */
diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c
index d51daba..631df4d 100644
--- a/CORE/SAP/src/sapApiLinkCntl.c
+++ b/CORE/SAP/src/sapApiLinkCntl.c
@@ -1269,15 +1269,6 @@
FL("CSR roamStatus = %s (%d)"),
"eCSR_ROAM_WPS_PBC_PROBE_REQ_IND", roamStatus);
break;
-
- case eCSR_ROAM_INDICATE_MGMT_FRAME:
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- FL("CSR roamStatus = %s (%d)"),
- "eCSR_ROAM_INDICATE_MGMT_FRAME", roamStatus);
- 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)"),
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 98c0aac..6381bb1 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -904,22 +904,6 @@
pCsrRoamInfo->u.pWPSPBCProbeReq,
sizeof(tSirWPSPBCProbeReq));
break;
-
- case eSAP_INDICATE_MGMT_FRAME:
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- FL("SAP event callback event = %s"),
- "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,
FL("SAP event callback event = %s"),
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index 490e16c..c2320b1 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -474,7 +474,6 @@
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.
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 564aedb..5b0d819 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -2156,6 +2156,9 @@
-------------------------------------------------------------------------------*/
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
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index fb5a300..b365122 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -6740,6 +6740,11 @@
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),
@@ -6753,6 +6758,8 @@
pProfile->operationChannel);
return status;
}
+ /* Reset abortConnection for the fresh connection */
+ pSession->abortConnection = FALSE;
csrRoamCancelRoaming(pMac, sessionId);
csrScanRemoveFreshScanCommand(pMac, sessionId);
csrScanCancelIdleScan(pMac);
@@ -7256,7 +7263,7 @@
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
- tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_FALSE;
+
do
{
pCommand = csrGetCommandBuffer( pMac );
@@ -7285,7 +7292,6 @@
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:
@@ -7301,7 +7307,7 @@
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 );
@@ -16420,7 +16426,7 @@
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;
@@ -16475,12 +16481,11 @@
* 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,
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index c5cdba5..19bd0de 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -1076,7 +1076,7 @@
VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
eHalStatus preauthProcessed = eHAL_STATUS_SUCCESS;
tpCsrNeighborRoamBSSInfo pPreauthRspNode = NULL;
-
+ tCsrRoamSession *pSession;
#ifdef FEATURE_WLAN_LFR_METRICS
tCsrRoamInfo *roamInfo;
#endif
@@ -1204,11 +1204,18 @@
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))
{
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 052d863..3e2732f 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -1268,7 +1268,6 @@
CASE_RETURN_STR(eCSR_ROAM_FT_RESPONSE);
#endif
CASE_RETURN_STR(eCSR_ROAM_FT_START);
- CASE_RETURN_STR(eCSR_ROAM_INDICATE_MGMT_FRAME);
CASE_RETURN_STR(eCSR_ROAM_REMAIN_CHAN_READY);
CASE_RETURN_STR(eCSR_ROAM_SEND_ACTION_CNF);
CASE_RETURN_STR(eCSR_ROAM_SESSION_OPENED);
diff --git a/CORE/SME/src/p2p/p2p_Api.c b/CORE/SME/src/p2p/p2p_Api.c
index 020d1c8..58bb906 100644
--- a/CORE/SME/src/p2p/p2p_Api.c
+++ b/CORE/SME/src/p2p/p2p_Api.c
@@ -216,60 +216,6 @@
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
diff --git a/CORE/SME/src/pmc/pmcApi.c b/CORE/SME/src/pmc/pmcApi.c
index 8499506..d0017f4 100644
--- a/CORE/SME/src/pmc/pmcApi.c
+++ b/CORE/SME/src/pmc/pmcApi.c
@@ -2203,12 +2203,18 @@
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;
}
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index b341b54..92d15f7 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -92,7 +92,6 @@
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);
@@ -2280,17 +2279,6 @@
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:
- if(pMsg->bodyptr)
- {
- sme_mgmtFrmInd(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");
- }
- break;
#ifdef WLAN_FEATURE_AP_HT40_24G
case eWNI_SME_2040_COEX_IND:
if(pMsg->bodyptr)
@@ -7255,6 +7243,48 @@
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
diff --git a/CORE/SVC/inc/wlan_logging_sock_svc.h b/CORE/SVC/inc/wlan_logging_sock_svc.h
index 2cd6745..52d1959 100644
--- a/CORE/SVC/inc/wlan_logging_sock_svc.h
+++ b/CORE/SVC/inc/wlan_logging_sock_svc.h
@@ -63,5 +63,5 @@
void wlan_logging_set_log_level(void);
-
+bool wlan_is_logger_thread(int threadId);
#endif /* WLAN_LOGGING_SOCK_SVC_H */
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
index 6fa1b6d..1c71310 100644
--- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c
+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
@@ -42,6 +42,7 @@
#include "vos_memory.h"
#include <linux/ratelimit.h>
#include <asm/arch_timer.h>
+#include <vos_utils.h>
#define LOGGING_TRACE(level, args...) \
VOS_TRACE(VOS_MODULE_ID_SVC, level, ## args)
@@ -729,15 +730,17 @@
#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,
(test_bit(HOST_LOG_POST_MASK, &gwlan_logging.event_flag) ||
gwlan_logging.exit ||
- test_bit(LOGGER_MGMT_DATA_PKT_POST_MASK,&gwlan_logging.event_flag) ||
- test_bit(LOGGER_FW_LOG_PKT_POST_MASK, &gwlan_logging.event_flag) ||
- test_bit(LOGGER_FATAL_EVENT_POST_MASK, &gwlan_logging.event_flag)));
+ test_bit(LOGGER_MGMT_DATA_PKT_POST_MASK,
+ &gwlan_logging.event_flag) ||
+ test_bit(LOGGER_FW_LOG_PKT_POST_MASK,
+ &gwlan_logging.event_flag) ||
+ test_bit(LOGGER_FATAL_EVENT_POST_MASK,
+ &gwlan_logging.event_flag)));
if (ret_wait_status == -ERESTARTSYS) {
pr_err("%s: wait_event return -ERESTARTSYS", __func__);
@@ -1206,7 +1209,6 @@
return status;
}
-
void wlan_process_done_indication(uint8 type, uint32 reason_code)
{
if ((type == WLAN_QXDM_LOGGING) && (wlan_is_log_report_in_progress() == TRUE))
@@ -1217,4 +1219,20 @@
}
}
+/**
+ * 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/CORE/SYS/common/inc/wlan_qct_sys.h b/CORE/SYS/common/inc/wlan_qct_sys.h
index 038aa6d..f85d29d 100644
--- a/CORE/SYS/common/inc/wlan_qct_sys.h
+++ b/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 @@
SYS_MSG_ID_MC_STOP,
SYS_MSG_ID_FTM_RSP,
+ SYS_MSG_ID_RX_THR_PROBE,
} SYS_MSG_ID;
/*---------------------------------------------------------------------------
diff --git a/CORE/SYS/common/src/wlan_qct_sys.c b/CORE/SYS/common/src/wlan_qct_sys.c
index 8bdef80..f55bd8c 100644
--- a/CORE/SYS/common/src/wlan_qct_sys.c
+++ b/CORE/SYS/common/src/wlan_qct_sys.c
@@ -382,9 +382,10 @@
// 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;
}
@@ -405,7 +406,6 @@
WLANFTM_McProcessMsg((v_VOID_t *)pMsg->bodyptr);
break;
}
-
default:
{
VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
@@ -471,13 +471,10 @@
// 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;
}
@@ -550,6 +547,15 @@
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/CORE/SYS/legacy/src/utils/src/macTrace.c b/CORE/SYS/legacy/src/utils/src/macTrace.c
index 7f2a442..0003a52 100644
--- a/CORE/SYS/legacy/src/utils/src/macTrace.c
+++ b/CORE/SYS/legacy/src/utils/src/macTrace.c
@@ -436,7 +436,6 @@
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);
@@ -567,6 +566,7 @@
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" );
diff --git a/CORE/VOSS/inc/vos_api.h b/CORE/VOSS/inc/vos_api.h
index 100ac75..7e5d0da 100644
--- a/CORE/VOSS/inc/vos_api.h
+++ b/CORE/VOSS/inc/vos_api.h
@@ -436,4 +436,5 @@
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/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index 21484db..9304923 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -2903,3 +2903,37 @@
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/CORE/VOSS/src/vos_memory.c b/CORE/VOSS/src/vos_memory.c
index 3b304c1..c63feb4 100644
--- a/CORE/VOSS/src/vos_memory.c
+++ b/CORE/VOSS/src/vos_memory.c
@@ -55,12 +55,14 @@
* ------------------------------------------------------------------------*/
#include "vos_memory.h"
#include "vos_trace.h"
+#include "vos_api.h"
#include <vmalloc.h>
#ifdef CONFIG_WCNSS_MEM_PRE_ALLOC
#include <linux/wcnss_wlan.h>
#define WCNSS_PRE_ALLOC_GET_THRESHOLD (4*1024)
#endif
+#define VOS_GET_MEMORY_TIME_THRESHOLD 3000
#ifdef MEMORY_DEBUG
#include "wlan_hdd_dp_utils.h"
@@ -189,6 +191,7 @@
v_SIZE_t new_size;
int flags = GFP_KERNEL;
unsigned long IrqFlags;
+ unsigned long time_before_kmalloc;
if (size > (1024*1024) || size == 0)
@@ -214,12 +217,30 @@
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)
{
@@ -298,9 +319,12 @@
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
+ unsigned long time_before_kmalloc;
+
if (size > (1024*1024) || size == 0)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
@@ -319,8 +343,19 @@
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 )
{
diff --git a/CORE/VOSS/src/vos_sched.c b/CORE/VOSS/src/vos_sched.c
index 27a4dbe..8bcf8b9 100644
--- a/CORE/VOSS/src/vos_sched.c
+++ b/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.
*
@@ -69,6 +69,10 @@
* 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 THREAD_STUCK_COUNT 3
+
static atomic_t ssr_protect_entry_count;
@@ -298,6 +302,7 @@
// 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");
@@ -641,6 +646,109 @@
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 == THREAD_STUCK_COUNT) ||
+ (gpVosWatchdogContext->txThreadStuckCount == THREAD_STUCK_COUNT) ||
+ (gpVosWatchdogContext->rxThreadStuckCount == THREAD_STUCK_COUNT))
+ {
+ spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock, flags);
+ hddLog(LOGE, FL("Thread Stuck !!! MC Count %d RX count %d TX count %d"),
+ gpVosWatchdogContext->mcThreadStuckCount,
+ gpVosWatchdogContext->rxThreadStuckCount,
+ gpVosWatchdogContext->txThreadStuckCount);
+ vos_wlanRestart();
+ return;
+ }
+
+ 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);
+
+ 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_MASK,
+ &gpVosWatchdogContext->wdEventFlag);
+ set_bit(WD_POST_EVENT_MASK, &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
@@ -692,6 +800,20 @@
#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(&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
@@ -747,7 +869,6 @@
{
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);
shutdown = VOS_TRUE;
break;
@@ -807,6 +928,12 @@
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_MASK,
+ &pWdContext->wdEventFlag))
+ {
+ vos_wd_detect_thread_stuck();
+ }
else
{
//Unnecessary wakeup - Should never happen!!
@@ -817,6 +944,7 @@
} // 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__);
@@ -1782,6 +1910,24 @@
}
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
------------------------------------------------------------------------*/
@@ -1970,3 +2116,20 @@
int count;
count = atomic_dec_return(&ssr_protect_entry_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));
+}
+
diff --git a/CORE/VOSS/src/vos_sched.h b/CORE/VOSS/src/vos_sched.h
index f9c3b65..361f874 100644
--- a/CORE/VOSS/src/vos_sched.h
+++ b/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.
*
@@ -74,6 +74,8 @@
#include "i_vos_packet.h"
#include <linux/wait.h>
#include <linux/wakelock.h>
+#include <vos_timer.h>
+
#define TX_POST_EVENT_MASK 0x001
#define TX_SUSPEND_EVENT_MASK 0x002
@@ -89,6 +91,8 @@
#define WD_CHIP_RESET_EVENT_MASK 0x004
#define WD_WLAN_SHUTDOWN_EVENT_MASK 0x008
#define WD_WLAN_REINIT_EVENT_MASK 0x010
+#define WD_WLAN_DETECT_THREAD_STUCK_MASK 0x020
+
@@ -260,6 +264,14 @@
/* 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;
@@ -349,6 +361,7 @@
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
@@ -504,5 +517,9 @@
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);
+
+
#endif // #if !defined __VOSS_SCHED_H
diff --git a/CORE/VOSS/src/vos_timer.c b/CORE/VOSS/src/vos_timer.c
index bcfff7d..a6b1ec4 100644
--- a/CORE/VOSS/src/vos_timer.c
+++ b/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 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -215,7 +215,16 @@
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 @@
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__);
@@ -443,7 +452,10 @@
// 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 (VOS_TIMER_TYPE_SW == timerType)
+ 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;
@@ -471,7 +483,10 @@
// 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 (VOS_TIMER_TYPE_SW == timerType)
+ 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;
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 06d2839..25a7146 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -501,6 +501,7 @@
vos_event_t ftmStopDoneEvent;
tWDA_AddSelfStaDebugParams wdaAddSelfStaParams;
+ wpt_uint8 mgmtTxfailureCnt;
} tWDA_CbContext ;
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index e748a0b..89fa89f 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -85,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) \
@@ -13351,6 +13358,7 @@
tBssSystemRole systemRole = eSYSTEM_UNKNOWN_ROLE;
tpAniSirGlobal pMac;
tpSirTxBdStatus txBdStatus = {0};
+ v_TIME_t time_snapshot;
if((NULL == pWDA)||(NULL == pFrmBuf))
{
@@ -13509,6 +13517,7 @@
}
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
@@ -13539,6 +13548,8 @@
pCompFunc(VOS_GET_MAC_CTXT(pWDA->pVosContext), (vos_pkt_t *)pFrmBuf);
} */
+ WLANTL_TLDebugMessage(WLANTL_DEBUG_FW_CLEANUP);
+
if( pAckTxComp )
{
pWDA->pAckTxCbFunc = NULL;
@@ -13549,8 +13560,19 @@
"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))
{
@@ -13563,6 +13585,15 @@
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) &&