Linux 4.6-rc6
[cris-mirror.git] / include / net / hwbm.h
blob47d08662501b7225bca6c17e4738ef0fa21f2264
1 #ifndef _HWBM_H
2 #define _HWBM_H
4 struct hwbm_pool {
5 /* Capacity of the pool */
6 int size;
7 /* Size of the buffers managed */
8 int frag_size;
9 /* Number of buffers currently used by this pool */
10 int buf_num;
11 /* constructor called during alocation */
12 int (*construct)(struct hwbm_pool *bm_pool, void *buf);
13 /* protect acces to the buffer counter*/
14 spinlock_t lock;
15 /* private data */
16 void *priv;
18 #ifdef CONFIG_HWBM
19 void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf);
20 int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp);
21 int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp);
22 #else
23 void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
24 int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; }
25 int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp)
26 { return 0; }
27 #endif /* CONFIG_HWBM */
28 #endif /* _HWBM_H */