wlan: Abort Scan for Miracast session
Currently if split scan is going on and Miracast
session is started in between. Miracast session
doesn't allow scan on DFS channel and if before
Miracast starts as part of split scan if the
channel on which scan is intended is DFS , then
Channel number 0 is passed to lim. Since Channel
number is 0, lim issue full scan. As a part of fix,
abort any scan when Miracast Session is started.
Change-Id: I97d77772dbd2efdb4f07f84faa255686a2e8281f
CRs-Fixed: 740241
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index ee13203..18575c4 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -261,8 +261,10 @@
hdd_priv_data_t *priv_data)
{
tANI_U8 *command = NULL;
+ hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ hdd_scaninfo_t *pScanInfo = NULL;
int ret = 0;
-
+ int status;
/*
* Note that valid pointers are provided by caller
*/
@@ -278,6 +280,14 @@
ret = -EFAULT;
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;
+ }
/* Allocate +1 for '\0' */
command = kmalloc((priv_data->total_len + 1), GFP_KERNEL);
@@ -356,6 +366,16 @@
}
//Filtertype value should be either 0-Disabled, 1-Source, 2-sink
pHddCtx->drvr_miracast = filterType;
+ pScanInfo = &pHddCtx->scan_info;
+ if (filterType && pScanInfo != NULL &&
+ pHddCtx->scan_info.mScanPending)
+ {
+ /*Miracast Session started. Abort Scan */
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "%s, Aborting Scan For Miracast",__func__);
+ hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId,
+ eCSR_SCAN_ABORT_DEFAULT);
+ }
hdd_tx_rx_pkt_cnt_stat_timer_handler(pHddCtx);
sme_SetMiracastMode(pHddCtx->hHal, pHddCtx->drvr_miracast);
}
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index a06e497..cad14b5 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -2124,8 +2124,10 @@
{
hdd_priv_data_t priv_data;
tANI_U8 *command = NULL;
+ hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ hdd_scaninfo_t *pScanInfo = NULL;
int ret = 0;
-
+ int status;
/*
* Note that valid pointers are provided by caller
*/
@@ -2142,7 +2144,13 @@
ret = -EINVAL;
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;
+ }
/* Allocate +1 for '\0' */
command = kmalloc(priv_data.total_len + 1, GFP_KERNEL);
if (!command)
@@ -3764,6 +3772,16 @@
}
//Filtertype value should be either 0-Disabled, 1-Source, 2-sink
pHddCtx->drvr_miracast = filterType;
+ pScanInfo = &pHddCtx->scan_info;
+ if (filterType && pScanInfo != NULL &&
+ pHddCtx->scan_info.mScanPending)
+ {
+ /*Miracast Session started. Abort Scan */
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "%s, Aborting Scan For Miracast",__func__);
+ hdd_abort_mac_scan(pHddCtx, pScanInfo->sessionId,
+ eCSR_SCAN_ABORT_DEFAULT);
+ }
hdd_tx_rx_pkt_cnt_stat_timer_handler(pHddCtx);
sme_SetMiracastMode(pHddCtx->hHal, pHddCtx->drvr_miracast);
}