| 1 |
|
| 2 | #ifndef _HWBM_H
|
| 3 | #define _HWBM_H
|
| 4 |
|
| 5 | #include <linux/mutex.h>
|
| 6 |
|
| 7 | struct hwbm_pool {
|
| 8 |
|
| 9 | int size;
|
| 10 |
|
| 11 | int frag_size;
|
| 12 |
|
| 13 | int buf_num;
|
| 14 |
|
| 15 | int (*construct)(struct hwbm_pool *bm_pool, void *buf);
|
| 16 |
|
| 17 | struct mutex buf_lock;
|
| 18 |
|
| 19 | void *priv;
|
| 20 | };
|
| 21 | #ifdef CONFIG_HWBM
|
| 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);
|
| 25 | #else
|
| 26 | static inline void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
|
| 27 |
|
| 28 | static inline int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp)
|
| 29 | { return 0; }
|
| 30 |
|
| 31 | static inline int hwbm_pool_add(struct hwbm_pool *bm_pool,
|
| 32 | unsigned int buf_num)
|
| 33 | { return 0; }
|
| 34 | #endif
|
| 35 | #endif
|