PERFORCE change 127532 for review
Kip Macy
kmacy at FreeBSD.org
Sun Oct 14 16:33:07 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=127532
Change 127532 by kmacy at kmacy_home:ethng on 2007/10/14 23:32:13
convert items with linux analogues - ifdef out dma routines
Affected files ...
.. //depot/projects/ethng/src/sys/contrib/rdma/ib_verbs.h#2 edit
Differences ...
==== //depot/projects/ethng/src/sys/contrib/rdma/ib_verbs.h#2 (text+ko) ====
@@ -38,19 +38,12 @@
* $Id: ib_verbs.h 1349 2004-12-16 21:09:43Z roland $
*/
+
#if !defined(IB_VERBS_H)
#define IB_VERBS_H
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/mm.h>
-#include <linux/dma-mapping.h>
-#include <linux/kref.h>
+#include <sys/linux_compat.h>
-#include <asm/atomic.h>
-#include <asm/scatterlist.h>
-#include <asm/uaccess.h>
-
union ib_gid {
u8 raw[16];
struct {
@@ -73,7 +66,7 @@
};
enum rdma_transport_type
-rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__;
+rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__ ;
enum ib_device_cap_flags {
IB_DEVICE_RESIZE_MAX_WR = 1,
@@ -294,7 +287,7 @@
struct ib_event_handler {
struct ib_device *device;
void (*handler)(struct ib_event_handler *, struct ib_event *);
- struct list_head list;
+ TAILQ_ENTRY(ib_event_handler) entry;
};
#define INIT_IB_EVENT_HANDLER(_ptr, _device, _handler) \
@@ -701,15 +694,19 @@
u8 page_shift;
};
+/*
+ * XXX can this really be on 7 different lists at once?
+ *
+ */
struct ib_ucontext {
struct ib_device *device;
- struct list_head pd_list;
- struct list_head mr_list;
- struct list_head mw_list;
- struct list_head cq_list;
- struct list_head qp_list;
- struct list_head srq_list;
- struct list_head ah_list;
+ TAILQ_ENTRY(ib_ucontext) pd_list;
+ TAILQ_ENTRY(ib_ucontext) mr_list;
+ TAILQ_ENTRY(ib_ucontext) mw_list;
+ TAILQ_ENTRY(ib_ucontext) cq_list;
+ TAILQ_ENTRY(ib_ucontext) qp_list;
+ TAILQ_ENTRY(ib_ucontext) srq_list;
+ TAILQ_ENTRY(ib_ucontext) ah_list;
int closing;
};
@@ -717,9 +714,9 @@
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 */
+ TAILQ_ENTRY(ib_uobject) entry; /* link to context's list */
u32 id; /* index into kernel idr */
- struct kref ref;
+ atomic_t ref;
struct rw_semaphore mutex; /* protects .live */
int live;
};
@@ -798,14 +795,17 @@
u32 rkey;
};
+
struct ib_fmr {
struct ib_device *device;
struct ib_pd *pd;
- struct list_head list;
+ TAILQ_ENTRY(ib_fmr) entry;
u32 lkey;
u32 rkey;
};
+TAILQ_HEAD(ib_fmr_list_head, ib_fmr);
+
struct ib_mad;
struct ib_grh;
@@ -882,11 +882,11 @@
char name[IB_DEVICE_NAME_MAX];
- struct list_head event_handler_list;
+ TAILQ_ENTRY(ib_device) event_handler_entry;
spinlock_t event_handler_lock;
- struct list_head core_list;
- struct list_head client_data_list;
+ TAILQ_ENTRY(ib_device) core_entry;
+ TAILQ_ENTRY(ib_device) client_data_entry;
spinlock_t client_data_lock;
struct ib_cache cache;
@@ -919,7 +919,7 @@
struct ib_udata *udata);
int (*dealloc_ucontext)(struct ib_ucontext *context);
int (*mmap)(struct ib_ucontext *context,
- struct vm_area_struct *vma);
+ struct vm_object *vma);
struct ib_pd * (*alloc_pd)(struct ib_device *device,
struct ib_ucontext *context,
struct ib_udata *udata);
@@ -1009,7 +1009,7 @@
int (*map_phys_fmr)(struct ib_fmr *fmr,
u64 *page_list, int list_len,
u64 iova);
- int (*unmap_fmr)(struct list_head *fmr_list);
+ int (*unmap_fmr)(struct ib_fmr_list_head *fmr_list);
int (*dealloc_fmr)(struct ib_fmr *fmr);
int (*attach_mcast)(struct ib_qp *qp,
union ib_gid *gid,
@@ -1028,10 +1028,11 @@
struct ib_dma_mapping_ops *dma_ops;
struct module *owner;
+#ifdef notyet
struct class_device class_dev;
struct kobject ports_parent;
struct list_head port_list;
-
+#endif
enum {
IB_DEV_UNINITIALIZED,
IB_DEV_REGISTERED,
@@ -1051,8 +1052,7 @@
char *name;
void (*add) (struct ib_device *);
void (*remove)(struct ib_device *);
-
- struct list_head list;
+ TAILQ_ENTRY(ib_client) entry;
};
struct ib_device *ib_alloc_device(size_t size);
@@ -1070,12 +1070,12 @@
static inline int ib_copy_from_udata(void *dest, struct ib_udata *udata, size_t len)
{
- return copy_from_user(dest, udata->inbuf, len) ? -EFAULT : 0;
+ return copyin(udata->inbuf, dest, len) ? -EFAULT : 0;
}
static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len)
{
- return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0;
+ return copyout(src, udata->outbuf, len) ? -EFAULT : 0;
}
/**
@@ -1464,7 +1464,7 @@
* by ib_get_dma_mr().
*/
struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags);
-
+#ifdef notyet
/**
* ib_dma_mapping_error - check a DMA addr for error
* @dev: The device for which the dma_addr was created
@@ -1681,7 +1681,7 @@
else
dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle);
}
-
+#endif
/**
* ib_reg_phys_mr - Prepares a virtually addressed memory region for use
* by an HCA.
@@ -1804,7 +1804,7 @@
* ib_unmap_fmr - Removes the mapping from a list of fast memory regions.
* @fmr_list: A linked list of fast memory regions to unmap.
*/
-int ib_unmap_fmr(struct list_head *fmr_list);
+int ib_unmap_fmr(struct ib_fmr_list_head *fmr_list);
/**
* ib_dealloc_fmr - Deallocates a fast memory region.
More information about the p4-projects
mailing list