hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/net/hwbm.h
....@@ -12,18 +12,22 @@
1212 /* constructor called during alocation */
1313 int (*construct)(struct hwbm_pool *bm_pool, void *buf);
1414 /* protect acces to the buffer counter*/
15
- spinlock_t lock;
15
+ struct mutex buf_lock;
1616 /* private data */
1717 void *priv;
1818 };
1919 #ifdef CONFIG_HWBM
2020 void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf);
2121 int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp);
22
-int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp);
22
+int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num);
2323 #else
24
-void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
25
-int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; }
26
-int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp)
24
+static inline void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
25
+
26
+static inline int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp)
27
+{ return 0; }
28
+
29
+static inline int hwbm_pool_add(struct hwbm_pool *bm_pool,
30
+ unsigned int buf_num)
2731 { return 0; }
2832 #endif /* CONFIG_HWBM */
2933 #endif /* _HWBM_H */