wlan: VOS ASSERT in wlan_hdd_cfg80211_stop_ap while removing P2P GO
Currently abortscan_event_var is maintained per adapter. I have
moved abortscan_event_var to hdd_scaninfo_t structure so that it
will be common for all the adapters.
Root cause: In the failure scenario while removing P2P GO
hdd_abort_mac_scan() API (which cancels all the scans) is initiated from
the wlan_hdd_cfg80211_del_beacon() API and it will wait on the Station
adapter for the abort scan completion notification but the completion
event is received on the P2P adapter.
Change-Id: If7ae6deead11276a6496b87b6769b0b99586c95c
CR-Fixed: 417218
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 2c9f173..8f6d253 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -597,6 +597,9 @@
/* Scan Completion Event */
struct completion scan_req_completion_event;
+ /* completion variable for abortscan */
+ struct completion abortscan_event_var;
+
vos_event_t scan_finished_event;
hdd_scan_pending_option_e scan_pending_option;
@@ -660,9 +663,6 @@
/* completion variable for Linkup Event */
struct completion linkup_event_var;
-
- /* completion variable for abortscan */
- struct completion abortscan_event_var;
#ifdef CONFIG_CFG80211
/* completion variable for cancel remain on channel Event */
struct completion cancel_rem_on_chan_var;
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index acc5533..db5f0d6 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -1780,10 +1780,10 @@
if ((pScanInfo != NULL) && pScanInfo->mScanPending)
{
- INIT_COMPLETION(staAdapter->abortscan_event_var);
+ INIT_COMPLETION(pScanInfo->abortscan_event_var);
hdd_abort_mac_scan(staAdapter->pHddCtx);
status = wait_for_completion_interruptible_timeout(
- &staAdapter->abortscan_event_var,
+ &pScanInfo->abortscan_event_var,
msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN));
if (!status)
{
@@ -3681,7 +3681,7 @@
* of scanning
*/
cfg80211_scan_done(req, false);
- complete(&pAdapter->abortscan_event_var);
+ complete(&pScanInfo->abortscan_event_var);
#ifdef WLAN_FEATURE_P2P
/* Flush out scan result after p2p_serach is done */
if(pScanInfo->flushP2pScanResults)
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 7f0ce1b..014ddcd 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -230,10 +230,10 @@
if( pHddCtx->scan_info.mScanPending != FALSE )
{
int result;
- INIT_COMPLETION(pAdapter->abortscan_event_var);
+ INIT_COMPLETION(pHddCtx->scan_info.abortscan_event_var);
hdd_abort_mac_scan(pAdapter->pHddCtx);
result = wait_for_completion_interruptible_timeout(
- &pAdapter->abortscan_event_var,
+ &pHddCtx->scan_info.abortscan_event_var,
msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN));
if(!result)
{
@@ -1127,7 +1127,6 @@
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->abortscan_event_var);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
init_completion(&pAdapter->offchannel_tx_event);
#endif
@@ -3415,6 +3414,7 @@
init_completion(&pHddCtx->standby_comp_var);
init_completion(&pHddCtx->req_bmps_comp_var);
init_completion(&pHddCtx->scan_info.scan_req_completion_event);
+ init_completion(&pHddCtx->scan_info.abortscan_event_var);
hdd_list_init( &pHddCtx->hddAdapters, MAX_NUMBER_OF_ADAPTERS );