]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/rdma/ib_verbs.h
ocfs2: mle ref counting fixes
[linux-2.6-omap-h63xx.git] / include / rdma / ib_verbs.h
index c1ad6273ac6ca5f5fcb20d9dfd7f1bdcc08ccd6b..ee1f3a355666dbddaa388fc3d613bc329c24c9d3 100644 (file)
@@ -260,7 +260,8 @@ enum ib_event_type {
        IB_EVENT_SM_CHANGE,
        IB_EVENT_SRQ_ERR,
        IB_EVENT_SRQ_LIMIT_REACHED,
-       IB_EVENT_QP_LAST_WQE_REACHED
+       IB_EVENT_QP_LAST_WQE_REACHED,
+       IB_EVENT_CLIENT_REREGISTER
 };
 
 struct ib_event {
@@ -314,6 +315,34 @@ enum ib_ah_flags {
        IB_AH_GRH       = 1
 };
 
+enum ib_rate {
+       IB_RATE_PORT_CURRENT = 0,
+       IB_RATE_2_5_GBPS = 2,
+       IB_RATE_5_GBPS   = 5,
+       IB_RATE_10_GBPS  = 3,
+       IB_RATE_20_GBPS  = 6,
+       IB_RATE_30_GBPS  = 4,
+       IB_RATE_40_GBPS  = 7,
+       IB_RATE_60_GBPS  = 8,
+       IB_RATE_80_GBPS  = 9,
+       IB_RATE_120_GBPS = 10
+};
+
+/**
+ * ib_rate_to_mult - Convert the IB rate enum to a multiple of the
+ * base rate of 2.5 Gbit/sec.  For example, IB_RATE_5_GBPS will be
+ * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec.
+ * @rate: rate to convert.
+ */
+int ib_rate_to_mult(enum ib_rate rate) __attribute_const__;
+
+/**
+ * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate
+ * enum.
+ * @mult: multiple to convert.
+ */
+enum ib_rate mult_to_ib_rate(int mult) __attribute_const__;
+
 struct ib_ah_attr {
        struct ib_global_route  grh;
        u16                     dlid;
@@ -668,8 +697,12 @@ struct ib_ucontext {
 struct ib_uobject {
        u64                     user_handle;    /* handle given to us by userspace */
        struct ib_ucontext     *context;        /* associated user context */
+       void                   *object;         /* containing object */
        struct list_head        list;           /* link to context's list */
        u32                     id;             /* index into kernel idr */
+       struct kref             ref;
+       struct rw_semaphore     mutex;          /* protects .live */
+       int                     live;
 };
 
 struct ib_umem {
@@ -799,6 +832,7 @@ struct ib_cache {
        struct ib_event_handler event_handler;
        struct ib_pkey_cache  **pkey_cache;
        struct ib_gid_cache   **gid_cache;
+       u8                     *lmc_cache;
 };
 
 struct ib_device {
@@ -1057,6 +1091,20 @@ int ib_dealloc_pd(struct ib_pd *pd);
  */
 struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
 
+/**
+ * ib_init_ah_from_wc - Initializes address handle attributes from a
+ *   work completion.
+ * @device: Device on which the received message arrived.
+ * @port_num: Port on which the received message arrived.
+ * @wc: Work completion associated with the received message.
+ * @grh: References the received global route header.  This parameter is
+ *   ignored unless the work completion indicates that the GRH is valid.
+ * @ah_attr: Returned attributes that can be used when creating an address
+ *   handle for replying to the message.
+ */
+int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
+                      struct ib_grh *grh, struct ib_ah_attr *ah_attr);
+
 /**
  * ib_create_ah_from_wc - Creates an address handle associated with the
  *   sender of the specified work completion.