]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/cxgb3/iwch_provider.h
IB/ehca: Refactor hvcall tracing
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / cxgb3 / iwch_provider.h
index 61e3278fd7a88dd0cb5dc18f86399c0bbe9d7163..48833f3f3bd03779e4139b6db8e91166af0fff04 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -74,6 +73,7 @@ struct tpt_attributes {
 
 struct iwch_mr {
        struct ib_mr ibmr;
+       struct ib_umem *umem;
        struct iwch_dev *rhp;
        u64 kva;
        struct tpt_attributes attr;
@@ -179,7 +179,6 @@ static inline struct iwch_qp *to_iwch_qp(struct ib_qp *ibqp)
 
 void iwch_qp_add_ref(struct ib_qp *qp);
 void iwch_qp_rem_ref(struct ib_qp *qp);
-struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn);
 
 struct iwch_ucontext {
        struct ib_ucontext ibucontext;
@@ -288,27 +287,20 @@ static inline int iwch_convert_state(enum ib_qp_state ib_state)
        }
 }
 
-enum iwch_mem_perms {
-       IWCH_MEM_ACCESS_LOCAL_READ = 1 << 0,
-       IWCH_MEM_ACCESS_LOCAL_WRITE = 1 << 1,
-       IWCH_MEM_ACCESS_REMOTE_READ = 1 << 2,
-       IWCH_MEM_ACCESS_REMOTE_WRITE = 1 << 3,
-       IWCH_MEM_ACCESS_ATOMICS = 1 << 4,
-       IWCH_MEM_ACCESS_BINDING = 1 << 5,
-       IWCH_MEM_ACCESS_LOCAL =
-           (IWCH_MEM_ACCESS_LOCAL_READ | IWCH_MEM_ACCESS_LOCAL_WRITE),
-       IWCH_MEM_ACCESS_REMOTE =
-           (IWCH_MEM_ACCESS_REMOTE_WRITE | IWCH_MEM_ACCESS_REMOTE_READ)
-           /* cannot go beyond 1 << 31 */
-} __attribute__ ((packed));
-
-static inline u32 iwch_convert_access(int acc)
+static inline u32 iwch_ib_to_tpt_access(int acc)
 {
-       return (acc & IB_ACCESS_REMOTE_WRITE ? IWCH_MEM_ACCESS_REMOTE_WRITE : 0)
-           | (acc & IB_ACCESS_REMOTE_READ ? IWCH_MEM_ACCESS_REMOTE_READ : 0) |
-           (acc & IB_ACCESS_LOCAL_WRITE ? IWCH_MEM_ACCESS_LOCAL_WRITE : 0) |
-           (acc & IB_ACCESS_MW_BIND ? IWCH_MEM_ACCESS_BINDING : 0) |
-           IWCH_MEM_ACCESS_LOCAL_READ;
+       return (acc & IB_ACCESS_REMOTE_WRITE ? TPT_REMOTE_WRITE : 0) |
+              (acc & IB_ACCESS_REMOTE_READ ? TPT_REMOTE_READ : 0) |
+              (acc & IB_ACCESS_LOCAL_WRITE ? TPT_LOCAL_WRITE : 0) |
+              TPT_LOCAL_READ;
+}
+
+static inline u32 iwch_ib_to_mwbind_access(int acc)
+{
+       return (acc & IB_ACCESS_REMOTE_WRITE ? T3_MEM_ACCESS_REM_WRITE : 0) |
+              (acc & IB_ACCESS_REMOTE_READ ? T3_MEM_ACCESS_REM_READ : 0) |
+              (acc & IB_ACCESS_LOCAL_WRITE ? T3_MEM_ACCESS_LOCAL_WRITE : 0) |
+              T3_MEM_ACCESS_LOCAL_READ;
 }
 
 enum iwch_mmid_state {