|
@@ -53,6 +53,7 @@
|
|
|
#include "cds_concurrency.h"
|
|
|
#include "wlan_hdd_main.h"
|
|
|
#include "pld_common.h"
|
|
|
+#include "csr_internal.h"
|
|
|
|
|
|
#define MIN_CHN_TIME_TO_FIND_GO 100
|
|
|
#define MAX_CHN_TIME_TO_FIND_GO 100
|
|
@@ -4635,6 +4636,25 @@ static bool csr_scan_process_scan_results(tpAniSirGlobal pMac, tSmeCmd *pCommand
|
|
|
return fRet;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * csr_scan_get_session_id() - Get session id
|
|
|
+ * @mac_ctx: Pointer to global mac
|
|
|
+ *
|
|
|
+ * This function returns a valid session id
|
|
|
+ *
|
|
|
+ * Return: session id
|
|
|
+ */
|
|
|
+static uint8_t csr_scan_get_session_id(tpAniSirGlobal mac_ctx)
|
|
|
+{
|
|
|
+ uint8_t i;
|
|
|
+
|
|
|
+ for (i = 0; i < CSR_ROAM_SESSION_MAX; i++)
|
|
|
+ if (CSR_IS_SESSION_VALID(mac_ctx, i))
|
|
|
+ return i;
|
|
|
+
|
|
|
+ return CSR_SESSION_ID_INVALID;
|
|
|
+}
|
|
|
+
|
|
|
/* csr_scan_process_single_bssdescr() - Add a bssdescriptor to scan table
|
|
|
*
|
|
|
* @mac_ctx - MAC context
|
|
@@ -4662,6 +4682,7 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal mac_ctx,
|
|
|
uint8_t cnt_channels = 0;
|
|
|
uint32_t len = sizeof(mac_ctx->roam.validChannelList);
|
|
|
tCsrRoamInfo *roam_info;
|
|
|
+ uint8_t session_id;
|
|
|
|
|
|
sms_log(mac_ctx, LOG4, "CSR: Processing single bssdescr");
|
|
|
if (QDF_IS_STATUS_SUCCESS(
|
|
@@ -4684,9 +4705,16 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal mac_ctx,
|
|
|
qdf_mem_zero(roam_info, sizeof(*roam_info));
|
|
|
roam_info->pBssDesc = bssdescr;
|
|
|
|
|
|
- csr_roam_call_callback(mac_ctx, 0, roam_info, 0,
|
|
|
- eCSR_ROAM_UPDATE_SCAN_RESULT,
|
|
|
- eCSR_ROAM_RESULT_NONE);
|
|
|
+ session_id = csr_scan_get_session_id(mac_ctx);
|
|
|
+ if (session_id == CSR_SESSION_ID_INVALID) {
|
|
|
+ if (ies != NULL)
|
|
|
+ qdf_mem_free(ies);
|
|
|
+ qdf_mem_free(roam_info);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+ csr_roam_call_callback(mac_ctx, session_id, roam_info,
|
|
|
+ 0, eCSR_ROAM_UPDATE_SCAN_RESULT,
|
|
|
+ eCSR_ROAM_RESULT_NONE);
|
|
|
qdf_mem_free(roam_info);
|
|
|
} else {
|
|
|
sms_log(mac_ctx, LOG1, "qdf_mem_malloc failed");
|