[openib-general] [PATCH] renaming of MAD APIs

Sean Hefty mshefty at ichips.intel.com
Mon Sep 13 13:51:44 PDT 2004


This patch changes the names of the MAD routines as suggested by Roland.

This change is made to the files in gen2/branches/openib-candidate/src/linux-kernel/infiniband.  I would like to avoid further updates to the files in trunk/contrib/intel, to keep everyone's life a little simpler.

- Sean

-- 

Index: access/ib_mad.c
===================================================================
--- access/ib_mad.c	(revision 806)
+++ access/ib_mad.c	(working copy)
@@ -94,16 +94,16 @@
 
 
 /*
- * ib_mad_reg - Register to send/receive MADs
+ * ib_register_mad_agent eg - Register to send/receive MADs
  */
-struct ib_mad_agent *ib_mad_reg(struct ib_device *device,
-				u8 port,
-				enum ib_qp_type qp_type,
-				struct ib_mad_reg_req *mad_reg_req,
-				u8 rmpp_version,
-				ib_mad_send_handler send_handler,
-				ib_mad_recv_handler recv_handler,
-				void *context)
+struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
+					   u8 port,
+					   enum ib_qp_type qp_type,
+					   struct ib_mad_reg_req *mad_reg_req,
+					   u8 rmpp_version,
+					   ib_mad_send_handler send_handler,
+					   ib_mad_recv_handler recv_handler,
+					   void *context)
 {
 	struct ib_mad_port_private *entry, *priv = NULL;
 	struct ib_mad_agent *mad_agent, *ret;
@@ -252,12 +252,12 @@
 error1:
 	return ret;	
 }
-EXPORT_SYMBOL(ib_mad_reg);
+EXPORT_SYMBOL(ib_register_mad_agent);
 
 /*
- * ib_mad_dereg - Deregisters a client from using MAD services
+ * ib_unregister_mad_agent - Unregisters a client from using MAD services
  */
-int ib_mad_dereg(struct ib_mad_agent *mad_agent)
+int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent)
 {
 	int i;
 	unsigned long flags;
@@ -280,13 +280,13 @@
 
 	return 0;
 }
-EXPORT_SYMBOL(ib_mad_dereg);
+EXPORT_SYMBOL(ib_unregister_mad_agent);
 
 /*
- * ib_mad_post_send - Posts MAD(s) to the send queue of the QP associated
+ * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated
  *  with the registered client
  */
-int ib_mad_post_send(struct ib_mad_agent *mad_agent,
+int ib_post_send_mad(struct ib_mad_agent *mad_agent,
 		     struct ib_send_wr *send_wr,
 		     struct ib_send_wr **bad_send_wr)
 {
@@ -349,7 +349,7 @@
 			((struct ib_mad_port_private *)mad_agent->device->mad)->send_posted_mad_count--;
 			spin_unlock_irqrestore(&((struct ib_mad_port_private *)mad_agent->device->mad)->send_list_lock, flags);
 			*bad_send_wr = cur_send_wr;
-			printk(KERN_NOTICE "ib_mad_post_send failed\n");
+			printk(KERN_NOTICE "ib_post_mad_send failed\n");
 			return ret;		
 		}
 		cur_send_wr= next_send_wr;
@@ -357,7 +357,7 @@
 
 	return 0;	
 }
-EXPORT_SYMBOL(ib_mad_post_send);
+EXPORT_SYMBOL(ib_post_send_mad);
 
 static inline u8 convert_mgmt_class(struct ib_mad_reg_req *mad_reg_req)
 {
Index: include/ib_mad.h
===================================================================
--- include/ib_mad.h	(revision 804)
+++ include/ib_mad.h	(working copy)
@@ -189,7 +189,7 @@
 };
 
 /**
- * ib_mad_reg - Register to send/receive MADs.
+ * ib_register_mad_agent - Register to send/receive MADs.
  * @device - The device to register with.
  * @port - The port on the specified device to use.
  * @qp_type - Specifies which QP to access.  Must be either
@@ -206,37 +206,37 @@
  *   MAD.
  * @context - User specified context associated with the registration.
  */
-struct ib_mad_agent *ib_mad_reg(struct ib_device *device,
-				u8 port,
-				enum ib_qp_type qp_type,
-				struct ib_mad_reg_req *mad_reg_req,
-				u8 rmpp_version,
-				ib_mad_send_handler send_handler,
-				ib_mad_recv_handler recv_handler,
-				void *context);
+struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
+					   u8 port,
+					   enum ib_qp_type qp_type,
+					   struct ib_mad_reg_req *mad_reg_req,
+					   u8 rmpp_version,
+					   ib_mad_send_handler send_handler,
+					   ib_mad_recv_handler recv_handler,
+					   void *context);
 
 /**
- * ib_mad_dereg - Deregisters a client from using MAD services.
+ * ib_unregister_mad_agent - Deregisters a client from using MAD services.
  * @mad_agent - Corresponding MAD registration request to deregister.
  *
  * After invoking this routine, MAD services are no longer usable by the
  * client on the associated QP.
  */
-int ib_mad_dereg(struct ib_mad_agent *mad_agent);
+int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent);
 
 /**
- * ib_mad_post_send - Posts MAD(s) to the send queue of the QP associated
+ * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated
  *   with the registered client.
  * @mad_agent - Specifies the associated registration to post the send to.
  * @send_wr - Specifies the information needed to send the MAD(s).
  * @bad_send_wr - Specifies the MAD on which an error was encountered.
  */
-int ib_mad_post_send(struct ib_mad_agent *mad_agent,
+int ib_post_send_mad(struct ib_mad_agent *mad_agent,
 		     struct ib_send_wr *send_wr,
 		     struct ib_send_wr **bad_send_wr);
 
 /**
- * ib_mad_qp_redir - Registers a QP for MAD services.
+ * ib_redirect_mad_qp - Registers a QP for MAD services.
  * @qp - Reference to a QP that requires MAD services.
  * @rmpp_version - If set, indicates that the client will send
  *   and receive MADs that contain the RMPP header for the given version.
@@ -251,14 +251,14 @@
  * on user-owned QPs.  After calling this routine, users may send
  * MADs on the specified QP by calling ib_mad_post_send.
  */
-struct ib_mad_agent *ib_mad_qp_redir(struct ib_qp *qp,
-				     u8 rmpp_version,
-				     ib_mad_send_handler send_handler,
-				     ib_mad_recv_handler recv_handler,
-				     void *context);
+struct ib_mad_agent *ib_redirect_mad_qp(struct ib_qp *qp,
+					u8 rmpp_version,
+					ib_mad_send_handler send_handler,
+					ib_mad_recv_handler recv_handler,
+					void *context);
 
 /**
- * ib_mad_process_wc - Processes a work completion associated with a
+ * ib_process_mad_wc - Processes a work completion associated with a
  *   MAD sent or received on a redirected QP.
  * @mad_agent - Specifies the registered MAD service using the redirected QP.
  * @wc - References a work completion associated with a sent or received
@@ -272,7 +272,7 @@
  * process an inbound or outbound RMPP transfer, or to match a response MAD
  * with its corresponding request.
  */
-int ib_mad_process_wc(struct ib_mad_agent *mad_agent,
+int ib_process_mad_wc(struct ib_mad_agent *mad_agent,
 		      struct ib_wc *wc);
 
 #endif /* IB_MAD_H */



More information about the general mailing list