
CNSS prealloc maintains various prealloc pools of 8Kb, 16Kb, 32Kb and so on, and allocates buffer from the pool for wlan driver. When wlan driver requests to free the memory buffer then CNSS prealloc needs to first find out mempool id from which this buffer was allocated. Use slab_cache from slab struct to identify memory pool id. Until kernel 5.16, slab_cache was part of page struct but in kernel 5.17, slab_cache is moved out to mm/slab.h file. Also change WCNSS_PRE_ALLOC_GET_THRESHOLD to 8Kb to match with cnss_pool_alloc_threshold. Change-Id: I4e34d8f0b855c210cc9af30c1f4a0d6c7e43ab00 CRs-Fixed: 3414037
20 lines
548 B
C
20 lines
548 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2015-2016,2019 The Linux Foundation. All rights reserved.
|
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _NET_CNSS_PREALLOC_H_
|
|
#define _NET_CNSS_PREALLOC_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#define WCNSS_PRE_ALLOC_GET_THRESHOLD (8*1024)
|
|
|
|
extern void *wcnss_prealloc_get(size_t size);
|
|
extern int wcnss_prealloc_put(void *ptr);
|
|
extern int wcnss_pre_alloc_reset(void);
|
|
void wcnss_prealloc_check_memory_leak(void);
|
|
|
|
#endif /* _NET_CNSS__PREALLOC_H_ */
|