summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mthca/mthca_provider.h
diff options
context:
space:
mode:
authorRoland Dreier <roland@eddore.topspincom.com>2005-08-18 13:39:31 -0700
committerRoland Dreier <rolandd@cisco.com>2005-08-26 20:37:37 -0700
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 {
DECLARE_PCI_UNMAP_ADDR(mapping)
};
+union mthca_buf {
+ struct mthca_buf_list direct;
+ struct mthca_buf_list *page_list;
+};
+
struct mthca_uar {
unsigned long pfn;
int index;
@@ -187,10 +192,7 @@ struct mthca_cq {
__be32 *arm_db;
int arm_sn;
- union {
- struct mthca_buf_list direct;
- struct mthca_buf_list *page_list;
- } queue;
+ union mthca_buf queue;
struct mthca_mr mr;
wait_queue_head_t wait;
};
@@ -228,10 +230,7 @@ struct mthca_qp {
int send_wqe_offset;
u64 *wrid;
- union {
- struct mthca_buf_list direct;
- struct mthca_buf_list *page_list;
- } queue;
+ union mthca_buf queue;
wait_queue_head_t wait;
};