aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_provider.h
diff options
context:
space:
mode:
authorRoland Dreier <roland@eddore.topspincom.com>2005-08-18 16:39:31 -0400
committerRoland Dreier <rolandd@cisco.com>2005-08-26 23:37:37 -0400
commit87b816706bb2b79fbaff8e0b8e279e783273383e (patch)
tree94e9a87fd5cbf1f069cba4e8a766ef718d18e5e4 /drivers/infiniband/hw/mthca/mthca_provider.h
parentf520ba5aa48e2891c3fb3e364eeaaab4212c7c45 (diff)
[PATCH] IB/mthca: Factor out common queue alloc code
Clean up the allocation of memory for queues by factoring out the common code into mthca_buf_alloc() and mthca_buf_free(). Now CQs and QPs share the same queue allocation code, which we'll also use for SRQs. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.h')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h
index 624651edf577..b95249ee46cf 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.h
+++ b/drivers/infiniband/hw/mthca/mthca_provider.h
@@ -51,6 +51,11 @@ struct mthca_buf_list {
51 DECLARE_PCI_UNMAP_ADDR(mapping) 51 DECLARE_PCI_UNMAP_ADDR(mapping)
52}; 52};
53 53
54union mthca_buf {
55 struct mthca_buf_list direct;
56 struct mthca_buf_list *page_list;
57};
58
54struct mthca_uar { 59struct mthca_uar {
55 unsigned long pfn; 60 unsigned long pfn;
56 int index; 61 int index;
@@ -187,10 +192,7 @@ struct mthca_cq {
187 __be32 *arm_db; 192 __be32 *arm_db;
188 int arm_sn; 193 int arm_sn;
189 194
190 union { 195 union mthca_buf queue;
191 struct mthca_buf_list direct;
192 struct mthca_buf_list *page_list;
193 } queue;
194 struct mthca_mr mr; 196 struct mthca_mr mr;
195 wait_queue_head_t wait; 197 wait_queue_head_t wait;
196}; 198};
@@ -228,10 +230,7 @@ struct mthca_qp {
228 int send_wqe_offset; 230 int send_wqe_offset;
229 231
230 u64 *wrid; 232 u64 *wrid;
231 union { 233 union mthca_buf queue;
232 struct mthca_buf_list direct;
233 struct mthca_buf_list *page_list;
234 } queue;
235 234
236 wait_queue_head_t wait; 235 wait_queue_head_t wait;
237}; 236};