diff options
Diffstat (limited to 'include/linux/mlx4/device.h')
-rw-r--r-- | include/linux/mlx4/device.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index ff7df1a2222f..9fa1a8002ce2 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -208,6 +208,38 @@ struct mlx4_mtt { | |||
208 | int page_shift; | 208 | int page_shift; |
209 | }; | 209 | }; |
210 | 210 | ||
211 | enum { | ||
212 | MLX4_DB_PER_PAGE = PAGE_SIZE / 4 | ||
213 | }; | ||
214 | |||
215 | struct mlx4_db_pgdir { | ||
216 | struct list_head list; | ||
217 | DECLARE_BITMAP(order0, MLX4_DB_PER_PAGE); | ||
218 | DECLARE_BITMAP(order1, MLX4_DB_PER_PAGE / 2); | ||
219 | unsigned long *bits[2]; | ||
220 | __be32 *db_page; | ||
221 | dma_addr_t db_dma; | ||
222 | }; | ||
223 | |||
224 | struct mlx4_ib_user_db_page; | ||
225 | |||
226 | struct mlx4_db { | ||
227 | __be32 *db; | ||
228 | union { | ||
229 | struct mlx4_db_pgdir *pgdir; | ||
230 | struct mlx4_ib_user_db_page *user_page; | ||
231 | } u; | ||
232 | dma_addr_t dma; | ||
233 | int index; | ||
234 | int order; | ||
235 | }; | ||
236 | |||
237 | struct mlx4_hwq_resources { | ||
238 | struct mlx4_db db; | ||
239 | struct mlx4_mtt mtt; | ||
240 | struct mlx4_buf buf; | ||
241 | }; | ||
242 | |||
211 | struct mlx4_mr { | 243 | struct mlx4_mr { |
212 | struct mlx4_mtt mtt; | 244 | struct mlx4_mtt mtt; |
213 | u64 iova; | 245 | u64 iova; |
@@ -341,6 +373,14 @@ int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
341 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 373 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
342 | struct mlx4_buf *buf); | 374 | struct mlx4_buf *buf); |
343 | 375 | ||
376 | int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order); | ||
377 | void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db); | ||
378 | |||
379 | int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres, | ||
380 | int size, int max_direct); | ||
381 | void mlx4_free_hwq_res(struct mlx4_dev *mdev, struct mlx4_hwq_resources *wqres, | ||
382 | int size); | ||
383 | |||
344 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, | 384 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, |
345 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq); | 385 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq); |
346 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); | 386 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); |