summaryrefslogtreecommitdiffstats
path: root/src/net/infiniband
diff options
context:
space:
mode:
authorMichael Brown2011-06-24 15:14:41 +0200
committerMichael Brown2011-06-28 15:45:08 +0200
commite01ec74601b58f54a5e2ae7b9fd1196972034114 (patch)
tree54f2d2202274523e2365584502dee7db8deca43b /src/net/infiniband
parent[xfer] Send xfer_window_changed() after xfer_vredirect() (diff)
downloadipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.gz
ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.xz
ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.zip
[process] Pass containing object pointer to process step() methods
Give the step() method a pointer to the containing object, rather than a pointer to the process. This is consistent with the operation of interface methods, and allows a single function to serve as both an interface method and a process step() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/infiniband')
-rw-r--r--src/net/infiniband/ib_cmrc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/net/infiniband/ib_cmrc.c b/src/net/infiniband/ib_cmrc.c
index 4b15314e..972a60cf 100644
--- a/src/net/infiniband/ib_cmrc.c
+++ b/src/net/infiniband/ib_cmrc.c
@@ -92,7 +92,7 @@ struct ib_cmrc_connection {
/**
* Shut down CMRC connection gracefully
*
- * @v process Process
+ * @v cmrc Communication-Managed Reliable Connection
*
* The Infiniband data structures are not reference-counted or
* guarded. It is therefore unsafe to shut them down while we may be
@@ -107,9 +107,7 @@ struct ib_cmrc_connection {
* connection, ensuring that the structure is not freed before the
* shutdown process has run.
*/
-static void ib_cmrc_shutdown ( struct process *process ) {
- struct ib_cmrc_connection *cmrc =
- container_of ( process, struct ib_cmrc_connection, shutdown );
+static void ib_cmrc_shutdown ( struct ib_cmrc_connection *cmrc ) {
DBGC ( cmrc, "CMRC %p shutting down\n", cmrc );
@@ -363,6 +361,10 @@ static struct interface_operation ib_cmrc_xfer_operations[] = {
static struct interface_descriptor ib_cmrc_xfer_desc =
INTF_DESC ( struct ib_cmrc_connection, xfer, ib_cmrc_xfer_operations );
+/** CMRC shutdown process descriptor */
+static struct process_descriptor ib_cmrc_shutdown_desc =
+ PROC_DESC ( struct ib_cmrc_connection, shutdown, ib_cmrc_shutdown );
+
/**
* Open CMRC connection
*
@@ -388,7 +390,7 @@ int ib_cmrc_open ( struct interface *xfer, struct ib_device *ibdev,
cmrc->ibdev = ibdev;
memcpy ( &cmrc->dgid, dgid, sizeof ( cmrc->dgid ) );
memcpy ( &cmrc->service_id, service_id, sizeof ( cmrc->service_id ) );
- process_init_stopped ( &cmrc->shutdown, ib_cmrc_shutdown,
+ process_init_stopped ( &cmrc->shutdown, &ib_cmrc_shutdown_desc,
&cmrc->refcnt );
/* Open Infiniband device */