1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/mutex.h>
8 /* Capacity of the pool */
10 /* Size of the buffers managed */
12 /* Number of buffers currently used by this pool */
14 /* constructor called during allocation */
15 int (*construct
)(struct hwbm_pool
*bm_pool
, void *buf
);
16 /* protect access to the buffer counter*/
17 struct mutex buf_lock
;
22 void hwbm_buf_free(struct hwbm_pool
*bm_pool
, void *buf
);
23 int hwbm_pool_refill(struct hwbm_pool
*bm_pool
, gfp_t gfp
);
24 int hwbm_pool_add(struct hwbm_pool
*bm_pool
, unsigned int buf_num
);
26 static inline void hwbm_buf_free(struct hwbm_pool
*bm_pool
, void *buf
) {}
28 static inline int hwbm_pool_refill(struct hwbm_pool
*bm_pool
, gfp_t gfp
)
31 static inline int hwbm_pool_add(struct hwbm_pool
*bm_pool
,
34 #endif /* CONFIG_HWBM */