[openib-general] [PATCH] ib_verbs.h: Move struct ib_device up in file

Hal Rosenstock halr at voltaire.com
Wed Aug 11 09:38:15 PDT 2004


Move definition of struct ib_device earlier in ib_verbs.h so it is
defined prior to it's use in functions

Index: ib_verbs.h
===================================================================
--- ib_verbs.h	(revision 631)
+++ ib_verbs.h	(working copy)
@@ -30,7 +30,6 @@
 #include <linux/device.h>
 #include <linux/types.h>
 
-struct ib_device;
 struct ib_mad;
 
 enum ib_event_type {
@@ -599,6 +598,128 @@
 	IB_CQ_NEXT_COMP
 };
 
+enum ib_process_mad_flags {
+	IB_MAD_IGNORE_MKEY	= 1
+};
+
+#define IB_DEVICE_NAME_MAX	64
+
+struct ib_device {
+	struct module	 *owner;
+	struct pci_dev	 *dma_device;
+
+	char		 name[IB_DEVICE_NAME_MAX];
+	char		 *provider;
+	void		 *private;
+	struct list_head core_list;
+	void		 *core;
+	void		 *mad;
+	u32		 flags;
+
+	int		 (*query_device)(struct ib_device *device,
+					 struct ib_device_cap *device_cap);
+	int		 (*query_port)(struct ib_device *device, 
+				       u8 port_num, struct ib_port *port);
+	int		 (*query_gid)(struct ib_device *device,
+				      u8 port_num, int index,
+				      union ib_gid *gid);
+	int		 (*query_pkey)(struct ib_device *device,
+				       u8 port_num, u16 index, u16 *pkey);
+	int		 (*modify_device)(struct ib_device *device,
+					  u8 port_num, int device_attr_flags);
+	struct ib_pd *	 (*alloc_pd)(struct ib_device *device);
+	int		 (*dealloc_pd)(struct ib_pd *pd);
+	struct ib_ah *	 (*create_ah)(struct ib_pd *pd,
+				      struct ib_ah_attr *ah_attr);
+	int		 (*modify_ah)(struct ib_ah *ah,
+				      struct ib_ah_attr *ah_attr);
+	int		 (*query_ah)(struct ib_ah *ah,
+				     struct ib_ah_attr *ah_attr);
+	int		 (*destroy_ah)(struct ib_ah *ah);
+	struct ib_qp *	 (*create_qp)(struct ib_pd *pd,
+				      struct ib_qp_init_attr *qp_init_attr,
+				      struct ib_qp_cap *qp_cap);
+	int		 (*modify_qp)(struct ib_qp *qp,
+				      struct ib_qp_attr *qp_attr,
+				      int qp_attr_mask,
+				      struct ib_qp_cap *qp_cap);
+	int		 (*query_qp)(struct ib_qp *qp,
+				    struct ib_qp_attr *qp_attr,
+				    int qp_attr_mask,
+				    struct ib_qp_init_attr *qp_init_attr);
+	int		 (*destroy_qp)(struct ib_qp *qp);
+	struct ib_srq *	 (*create_srq)(struct ib_pd *pd,
+				       void *srq_context,
+				       struct ib_srq_attr *srq_attr);
+	int		 (*query_srq)(struct ib_srq *srq,
+				      struct ib_srq_attr *srq_attr);
+	int		 (*modify_srq)(struct ib_srq *srq,
+				       struct ib_pd *pd,
+				       struct ib_srq_attr *srq_attr,
+				       int srq_attr_mask);
+	int		 (*destroy_srq)(struct ib_srq *srq);
+	int		 (*post_srq)(struct ib_srq *srq,
+				     struct ib_recv_wr *recv_wr,
+				     struct ib_recv_wr **bad_recv_wr);
+	struct ib_cq *	 (*create_cq)(struct ib_device *device,
+				      ib_comp_handler comp_handler,
+				      void *cq_context, int cqe);
+	int		 (*resize_cq)(struct ib_cq *cq, int cqe);
+	int		 (*destroy_cq)(struct ib_cq *cq);
+	struct ib_mr *	 (*reg_phys_mr)(struct ib_pd *pd,
+					struct ib_phys_buf *phys_buf_array,
+					int num_phys_buf,
+					int mr_access_flags,
+					u64 *iova_start);
+	int		 (*query_mr)(struct ib_mr *mr,
+				     struct ib_mr_attr *mr_attr);
+	int		 (*dereg_mr)(struct ib_mr *mr);
+	int		 (*rereg_phys_mr)(struct ib_mr *mr,
+					  int mr_rereg_mask,
+					  struct ib_pd *pd,
+					  struct ib_phys_buf *phys_buf_array,
+					  int num_phys_buf,
+					  int mr_access_flags,
+					  u64 *iova_start);
+	struct ib_mw *	 (*alloc_mw)(struct ib_pd *pd);
+	int		 (*bind_mw)(struct ib_qp *qp,
+				    struct ib_mw *mw,
+				    struct ib_mw_bind *mw_bind);
+	int		 (*dealloc_mw)(struct ib_mw *mw);
+	struct ib_fmr *	 (*alloc_fmr)(struct ib_pd *pd,
+				      int mr_access_flags,
+				      struct ib_fmr_attr *fmr_attr);
+	int		 (*map_fmr)(struct ib_fmr *fmr, void *addr, u64 size);
+	int		 (*map_phys_fmr)(struct ib_fmr *fmr,
+					 struct ib_phys_buf *phys_buf_array,
+					 int num_phys_buf);
+	int		 (*unmap_fmr)(struct ib_fmr **fmr_array, int fmr_cnt);
+	int		 (*free_fmr)(struct ib_fmr *fmr);
+	int		 (*attach_mcast)(struct ib_qp *qp, union ib_gid *gid,
+					 u16 lid);
+	int		 (*detach_mcast)(struct ib_qp *qp, union ib_gid *gid,
+					 u16 lid);
+	int		 (*post_send)(struct ib_qp *qp,
+				      struct ib_send_wr *send_wr,
+				      struct ib_send_wr **bad_send_wr);
+	int		 (*post_recv)(struct ib_qp *qp,
+				      struct ib_recv_wr *recv_wr,
+				      struct ib_recv_wr **bad_recv_wr);
+	int		 (*poll_cq)(struct ib_cq *cq,
+				    int num_entries,
+				    struct ib_wc *wc_array);
+	int		 (*peek_cq)(struct ib_cq *cq, int wc_cnt);
+	int		 (*req_notify_cq)(struct ib_cq *cq,
+					  enum ib_cq_notify cq_notify);
+	int		 (*req_n_notify_cq)(struct ib_cq *cq, int wc_cnt);
+	int		 (*process_mad)(struct ib_device *device,
+					int process_mad_flags,
+					struct ib_mad *in_mad,
+					struct ib_mad *out_mad);
+
+	struct class_device	class_dev;
+};
+
 static inline int ib_query_device(struct ib_device *device,
 				  struct ib_device_cap *device_cap)
 {
@@ -904,126 +1025,4 @@
 	return cq->device->req_n_notify_cq(cq, wc_cnt);
 }
 
-enum ib_process_mad_flags {
-	IB_MAD_IGNORE_MKEY	= 1
-};
-
-#define IB_DEVICE_NAME_MAX	64
-
-struct ib_device {
-	struct module	 *owner;
-	struct pci_dev	 *dma_device;
-
-	char		 name[IB_DEVICE_NAME_MAX];
-	char		 *provider;
-	void		 *private;
-	struct list_head core_list;
-	void		 *core;
-	void		 *mad;
-	u32		 flags;
-
-	int		 (*query_device)(struct ib_device *device,
-					 struct ib_device_cap *device_cap);
-	int		 (*query_port)(struct ib_device *device, 
-				       u8 port_num, struct ib_port *port);
-	int		 (*query_gid)(struct ib_device *device,
-				      u8 port_num, int index,
-				      union ib_gid *gid);
-	int		 (*query_pkey)(struct ib_device *device,
-				       u8 port_num, u16 index, u16 *pkey);
-	int		 (*modify_device)(struct ib_device *device,
-					  u8 port_num, int device_attr_flags);
-	struct ib_pd *	 (*alloc_pd)(struct ib_device *device);
-	int		 (*dealloc_pd)(struct ib_pd *pd);
-	struct ib_ah *	 (*create_ah)(struct ib_pd *pd,
-				      struct ib_ah_attr *ah_attr);
-	int		 (*modify_ah)(struct ib_ah *ah,
-				      struct ib_ah_attr *ah_attr);
-	int		 (*query_ah)(struct ib_ah *ah,
-				     struct ib_ah_attr *ah_attr);
-	int		 (*destroy_ah)(struct ib_ah *ah);
-	struct ib_qp *	 (*create_qp)(struct ib_pd *pd,
-				      struct ib_qp_init_attr *qp_init_attr,
-				      struct ib_qp_cap *qp_cap);
-	int		 (*modify_qp)(struct ib_qp *qp,
-				      struct ib_qp_attr *qp_attr,
-				      int qp_attr_mask,
-				      struct ib_qp_cap *qp_cap );
-	int		 (*query_qp)(struct ib_qp *qp,
-				    struct ib_qp_attr *qp_attr,
-				    int qp_attr_mask,
-				    struct ib_qp_init_attr *qp_init_attr);
-	int		 (*destroy_qp)(struct ib_qp *qp);
-	struct ib_srq *	 (*create_srq)(struct ib_pd *pd,
-				       void *srq_context,
-				       struct ib_srq_attr *srq_attr);
-	int		 (*query_srq)(struct ib_srq *srq,
-				      struct ib_srq_attr *srq_attr);
-	int		 (*modify_srq)(struct ib_srq *srq,
-				       struct ib_pd *pd,
-				       struct ib_srq_attr *srq_attr,
-				       int srq_attr_mask);
-	int		 (*destroy_srq)(struct ib_srq *srq);
-	int		 (*post_srq)(struct ib_srq *srq,
-				     struct ib_recv_wr *recv_wr,
-				     struct ib_recv_wr **bad_recv_wr);
-	struct ib_cq *	 (*create_cq)(struct ib_device *device,
-				      ib_comp_handler comp_handler,
-				      void *cq_context, int cqe);
-	int		 (*resize_cq)(struct ib_cq *cq, int cqe);
-	int		 (*destroy_cq)(struct ib_cq *cq);
-	struct ib_mr *	 (*reg_phys_mr)(struct ib_pd *pd,
-					struct ib_phys_buf *phys_buf_array,
-					int num_phys_buf,
-					int mr_access_flags,
-					u64 *iova_start);
-	int		 (*query_mr)(struct ib_mr *mr,
-				     struct ib_mr_attr *mr_attr);
-	int		 (*dereg_mr)(struct ib_mr *mr);
-	int		 (*rereg_phys_mr)(struct ib_mr *mr,
-					  int mr_rereg_mask,
-					  struct ib_pd *pd,
-					  struct ib_phys_buf *phys_buf_array,
-					  int num_phys_buf,
-					  int mr_access_flags,
-					  u64 *iova_start);
-	struct ib_mw *	 (*alloc_mw)(struct ib_pd *pd);
-	int		 (*bind_mw)(struct ib_qp *qp,
-				    struct ib_mw *mw,
-				    struct ib_mw_bind *mw_bind);
-	int		 (*dealloc_mw)(struct ib_mw *mw);
-	struct ib_fmr *	 (*alloc_fmr)(struct ib_pd *pd,
-				      int mr_access_flags,
-				      struct ib_fmr_attr *fmr_attr);
-	int		 (*map_fmr)(struct ib_fmr *fmr, void *addr, u64 size);
-	int		 (*map_phys_fmr)(struct ib_fmr *fmr,
-					 struct ib_phys_buf *phys_buf_array,
-					 int num_phys_buf);
-	int		 (*unmap_fmr)(struct ib_fmr **fmr_array, int fmr_cnt);
-	int		 (*free_fmr)(struct ib_fmr *fmr);
-	int		 (*attach_mcast)(struct ib_qp *qp, union ib_gid *gid,
-					 u16 lid);
-	int		 (*detach_mcast)(struct ib_qp *qp, union ib_gid *gid,
-					 u16 lid);
-	int		 (*post_send)(struct ib_qp *qp,
-				      struct ib_send_wr *send_wr,
-				      struct ib_send_wr **bad_send_wr);
-	int		 (*post_recv)(struct ib_qp *qp,
-				      struct ib_recv_wr *recv_wr,
-				      struct ib_recv_wr **bad_recv_wr);
-	int		 (*poll_cq)(struct ib_cq *cq,
-				    int num_entries,
-				    struct ib_wc *wc_array);
-	int		 (*peek_cq)(struct ib_cq *cq, int wc_cnt);
-	int		 (*req_notify_cq)(struct ib_cq *cq,
-					  enum ib_cq_notify cq_notify);
-	int		 (*req_n_notify_cq)(struct ib_cq *cq, int wc_cnt);
-	int		 (*process_mad)(struct ib_device *device,
-					int process_mad_flags,
-					struct ib_mad *in_mad,
-					struct ib_mad *out_mad);
-
-	struct class_device	class_dev;
-};
-
 #endif /* IB_VERBS_H */






More information about the general mailing list