mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-11 13:22:39 -05:00
qcacld-3.0: Allocate scan filter memory from dynamic memory pool
csr_scan_get_result API defined 'struct scan_filter' of size
800bytes on stack and larger size memory blocks on stack is not
preferred because the stack size is limited.
Modified the memory allocation to dyanmic for scan filter.
Change-Id: I40cb0d97e0451d50aca3e9485327a4ce709e6020
CRs-Fixed: 2332496
This commit is contained in:
parent
c171324c3d
commit
8345f3d0ec
1 changed files with 35 additions and 12 deletions
|
|
@ -2950,7 +2950,7 @@ QDF_STATUS csr_scan_get_result(tpAniSirGlobal mac_ctx,
|
|||
QDF_STATUS status;
|
||||
struct scan_result_list *ret_list = NULL;
|
||||
qdf_list_t *list = NULL;
|
||||
struct scan_filter filter = {0};
|
||||
struct scan_filter *filter = NULL;
|
||||
struct wlan_objmgr_pdev *pdev = NULL;
|
||||
|
||||
if (results)
|
||||
|
|
@ -2958,14 +2958,19 @@ QDF_STATUS csr_scan_get_result(tpAniSirGlobal mac_ctx,
|
|||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(mac_ctx->psoc,
|
||||
0, WLAN_LEGACY_MAC_ID);
|
||||
|
||||
if (!pdev) {
|
||||
sme_err("pdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (pFilter) {
|
||||
status = csr_prepare_scan_filter(mac_ctx, pFilter, &filter);
|
||||
filter = qdf_mem_malloc(sizeof(*filter));
|
||||
if (!filter) {
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
status = csr_prepare_scan_filter(mac_ctx, pFilter, filter);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
sme_err("Prepare filter failed");
|
||||
goto error;
|
||||
|
|
@ -2973,7 +2978,7 @@ QDF_STATUS csr_scan_get_result(tpAniSirGlobal mac_ctx,
|
|||
}
|
||||
|
||||
list = ucfg_scan_get_result(pdev,
|
||||
pFilter ? &filter : NULL);
|
||||
pFilter ? filter : NULL);
|
||||
if (list)
|
||||
sme_debug("num_entries %d", qdf_list_size(list));
|
||||
|
||||
|
|
@ -3012,6 +3017,8 @@ QDF_STATUS csr_scan_get_result(tpAniSirGlobal mac_ctx,
|
|||
}
|
||||
|
||||
error:
|
||||
if (filter)
|
||||
qdf_mem_free(filter);
|
||||
if (list)
|
||||
ucfg_scan_purge_results(list);
|
||||
if (pdev)
|
||||
|
|
@ -3114,23 +3121,39 @@ QDF_STATUS csr_scan_flush_result(tpAniSirGlobal mac_ctx)
|
|||
QDF_STATUS csr_scan_flush_selective_result(tpAniSirGlobal mac_ctx,
|
||||
bool flush_p2p)
|
||||
{
|
||||
struct scan_filter filter = {0};
|
||||
struct scan_filter *filter;
|
||||
QDF_STATUS status;
|
||||
|
||||
filter.p2p_results = flush_p2p;
|
||||
return csr_flush_scan_results(mac_ctx, &filter);
|
||||
filter = qdf_mem_malloc(sizeof(*filter));
|
||||
if (!filter) {
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto end;
|
||||
}
|
||||
filter->p2p_results = flush_p2p;
|
||||
status = csr_flush_scan_results(mac_ctx, filter);
|
||||
if (filter)
|
||||
qdf_mem_free(filter);
|
||||
end:
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline void csr_flush_bssid(tpAniSirGlobal mac_ctx,
|
||||
uint8_t *bssid)
|
||||
{
|
||||
struct scan_filter filter = {0};
|
||||
struct scan_filter *filter;
|
||||
|
||||
filter.num_of_bssid = 1;
|
||||
qdf_mem_copy(filter.bssid_list[0].bytes,
|
||||
bssid, QDF_MAC_ADDR_SIZE);
|
||||
filter = qdf_mem_malloc(sizeof(*filter));
|
||||
if (!filter)
|
||||
return;
|
||||
|
||||
csr_flush_scan_results(mac_ctx, &filter);
|
||||
filter->num_of_bssid = 1;
|
||||
qdf_mem_copy(filter->bssid_list[0].bytes,
|
||||
bssid, QDF_MAC_ADDR_SIZE);
|
||||
|
||||
csr_flush_scan_results(mac_ctx, filter);
|
||||
sme_debug("Removed BSS entry:%pM", bssid);
|
||||
if (filter)
|
||||
qdf_mem_free(filter);
|
||||
}
|
||||
|
||||
void csr_scan_flush_bss_entry(tpAniSirGlobal mac_ctx,
|
||||
|
|
|
|||
Loading…
Reference in a new issue