[openib-general] [PATCH] Changes for async events to openib-candidate branch

Hal Rosenstock halr at voltaire.com
Tue Sep 14 11:05:08 PDT 2004


Changes for async events to openib-candidate branch

Index: access/ib_verbs_priv.h
===================================================================
--- access/ib_verbs_priv.h	(revision 823)
+++ access/ib_verbs_priv.h	(working copy)
@@ -26,21 +26,6 @@
 #if !defined( IB_VERBS_PRIV_H )
 #define IB_VERBS_PRIV_H
 
-struct ib_client {
-	char  *name;
-	void (*add)   (struct ib_device *);
-	void (*remove)(struct ib_device *);
-
-	struct list_head list;
-};
-
-int ib_register_client   (struct ib_client *client);
-void ib_unregister_client(struct ib_client *client);
-
-void *ib_get_client_data(struct ib_device *device, struct ib_client
*client);
-int   ib_set_client_data(struct ib_device *device, struct ib_client
*client,
-			 void *data);
-
 struct ib_mad;
 
 static inline int ib_process_mad(struct ib_device *device,
Index: access/ib_mad.c
===================================================================
--- access/ib_mad.c	(revision 823)
+++ access/ib_mad.c	(working copy)
@@ -1277,7 +1277,7 @@
 	cq_size = IB_MAD_QP_SEND_SIZE + IB_MAD_QP_RECV_SIZE;
 	port_priv->cq = ib_create_cq(port_priv->device,
 				     (ib_comp_handler) ib_mad_thread_completion_handler,
-				     port_priv, cq_size);
+				     NULL, port_priv, cq_size);
 	if (IS_ERR(port_priv->cq)) {
 		printk(KERN_ERR "Could not create ib_mad CQ\n");
 		ret = PTR_ERR(port_priv->cq);
Index: access/ib_verbs.c
===================================================================
--- access/ib_verbs.c	(revision 823)
+++ access/ib_verbs.c	(working copy)
@@ -268,16 +268,18 @@
 
 struct ib_cq *ib_create_cq(struct ib_device *device,
 			   ib_comp_handler comp_handler,
+			   void (*event_handler)(struct ib_event *, void *),
 			   void *cq_context,
 			   int cqe)
 {
 	struct ib_cq *cq;
 
-	cq = device->create_cq(device, comp_handler, cq_context, cqe);
+	cq = device->create_cq(device, cqe);
 
 	if (!IS_ERR(cq)) {
 		cq->device	 = device;
 		cq->comp_handler = comp_handler;
+		cq->event_handler = event_handler;
 		cq->cq_context	 = cq_context;
 		atomic_set(&cq->usecnt, 0);
 	}
Index: include/ib_verbs.h
===================================================================
--- include/ib_verbs.h	(revision 823)
+++ include/ib_verbs.h	(working copy)
@@ -78,6 +78,7 @@
 struct ib_cq {
 	struct ib_device	*device;
 	ib_comp_handler		comp_handler;
+	void			(*event_handler)(struct ib_event *, void *);
 	void			*cq_context;
 	int			cqe;
 	atomic_t		usecnt;
@@ -702,9 +703,7 @@
 	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);
+	struct ib_cq *	 (*create_cq)(struct ib_device *device, 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,
@@ -764,6 +763,21 @@
 	u8			node_type;
 };
 
+struct ib_client {
+	char  *name;
+	void (*add)   (struct ib_device *);
+	void (*remove)(struct ib_device *);
+
+	struct list_head list;
+};
+
+int ib_register_client   (struct ib_client *client);
+void ib_unregister_client(struct ib_client *client);
+
+void *ib_get_client_data(struct ib_device *device, struct ib_client
*client);
+void  ib_set_client_data(struct ib_device *device, struct ib_client
*client,
+			 void *data);
+
 static inline int ib_query_device(struct ib_device *device,
 				  struct ib_device_attr *device_attr)
 {
@@ -859,6 +873,7 @@
 
 struct ib_cq *ib_create_cq(struct ib_device *device,
 			   ib_comp_handler comp_handler,
+			   void (*event_handler)(struct ib_event *, void *),
 			   void *cq_context,
 			   int cqe);
 





More information about the general mailing list