aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/mlx4_ib.h
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2008-04-23 14:55:45 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-23 14:55:45 -0400
commit6296883ca4cd52dafb45f191d24102e28ded38f2 (patch)
tree341e90a9560d8cf6b498d249a6ac81aeea97dd7b /drivers/infiniband/hw/mlx4/mlx4_ib.h
parent14fb05b3497351fbeb514381bcd227d84e115bd9 (diff)
mlx4_core: Move kernel doorbell management into core
In addition to mlx4_ib, there will be ethernet and FC consumers of mlx4_core, so move the code for managing kernel doorbells into the core module to avoid having to duplicate this multiple times. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/mlx4_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index 9e637323c155..5cf994794d25 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -43,24 +43,6 @@
43#include <linux/mlx4/device.h> 43#include <linux/mlx4/device.h>
44#include <linux/mlx4/doorbell.h> 44#include <linux/mlx4/doorbell.h>
45 45
46enum {
47 MLX4_IB_DB_PER_PAGE = PAGE_SIZE / 4
48};
49
50struct mlx4_ib_db_pgdir;
51struct mlx4_ib_user_db_page;
52
53struct mlx4_ib_db {
54 __be32 *db;
55 union {
56 struct mlx4_ib_db_pgdir *pgdir;
57 struct mlx4_ib_user_db_page *user_page;
58 } u;
59 dma_addr_t dma;
60 int index;
61 int order;
62};
63
64struct mlx4_ib_ucontext { 46struct mlx4_ib_ucontext {
65 struct ib_ucontext ibucontext; 47 struct ib_ucontext ibucontext;
66 struct mlx4_uar uar; 48 struct mlx4_uar uar;
@@ -88,7 +70,7 @@ struct mlx4_ib_cq {
88 struct mlx4_cq mcq; 70 struct mlx4_cq mcq;
89 struct mlx4_ib_cq_buf buf; 71 struct mlx4_ib_cq_buf buf;
90 struct mlx4_ib_cq_resize *resize_buf; 72 struct mlx4_ib_cq_resize *resize_buf;
91 struct mlx4_ib_db db; 73 struct mlx4_db db;
92 spinlock_t lock; 74 spinlock_t lock;
93 struct mutex resize_mutex; 75 struct mutex resize_mutex;
94 struct ib_umem *umem; 76 struct ib_umem *umem;
@@ -127,7 +109,7 @@ struct mlx4_ib_qp {
127 struct mlx4_qp mqp; 109 struct mlx4_qp mqp;
128 struct mlx4_buf buf; 110 struct mlx4_buf buf;
129 111
130 struct mlx4_ib_db db; 112 struct mlx4_db db;
131 struct mlx4_ib_wq rq; 113 struct mlx4_ib_wq rq;
132 114
133 u32 doorbell_qpn; 115 u32 doorbell_qpn;
@@ -154,7 +136,7 @@ struct mlx4_ib_srq {
154 struct ib_srq ibsrq; 136 struct ib_srq ibsrq;
155 struct mlx4_srq msrq; 137 struct mlx4_srq msrq;
156 struct mlx4_buf buf; 138 struct mlx4_buf buf;
157 struct mlx4_ib_db db; 139 struct mlx4_db db;
158 u64 *wrid; 140 u64 *wrid;
159 spinlock_t lock; 141 spinlock_t lock;
160 int head; 142 int head;
@@ -175,9 +157,6 @@ struct mlx4_ib_dev {
175 struct mlx4_dev *dev; 157 struct mlx4_dev *dev;
176 void __iomem *uar_map; 158 void __iomem *uar_map;
177 159
178 struct list_head pgdir_list;
179 struct mutex pgdir_mutex;
180
181 struct mlx4_uar priv_uar; 160 struct mlx4_uar priv_uar;
182 u32 priv_pdn; 161 u32 priv_pdn;
183 MLX4_DECLARE_DOORBELL_LOCK(uar_lock); 162 MLX4_DECLARE_DOORBELL_LOCK(uar_lock);
@@ -248,11 +227,9 @@ static inline struct mlx4_ib_ah *to_mah(struct ib_ah *ibah)
248 return container_of(ibah, struct mlx4_ib_ah, ibah); 227 return container_of(ibah, struct mlx4_ib_ah, ibah);
249} 228}
250 229
251int mlx4_ib_db_alloc(struct mlx4_ib_dev *dev, struct mlx4_ib_db *db, int order);
252void mlx4_ib_db_free(struct mlx4_ib_dev *dev, struct mlx4_ib_db *db);
253int mlx4_ib_db_map_user(struct mlx4_ib_ucontext *context, unsigned long virt, 230int mlx4_ib_db_map_user(struct mlx4_ib_ucontext *context, unsigned long virt,
254 struct mlx4_ib_db *db); 231 struct mlx4_db *db);
255void mlx4_ib_db_unmap_user(struct mlx4_ib_ucontext *context, struct mlx4_ib_db *db); 232void mlx4_ib_db_unmap_user(struct mlx4_ib_ucontext *context, struct mlx4_db *db);
256 233
257struct ib_mr *mlx4_ib_get_dma_mr(struct ib_pd *pd, int acc); 234struct ib_mr *mlx4_ib_get_dma_mr(struct ib_pd *pd, int acc);
258int mlx4_ib_umem_write_mtt(struct mlx4_ib_dev *dev, struct mlx4_mtt *mtt, 235int mlx4_ib_umem_write_mtt(struct mlx4_ib_dev *dev, struct mlx4_mtt *mtt,