summaryrefslogtreecommitdiffstats
path: root/src/net/fcels.c
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/fcels.c
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/fcels.c')
-rw-r--r--src/net/fcels.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/fcels.c b/src/net/fcels.c
index f8bcb865..656b4f67 100644
--- a/src/net/fcels.c
+++ b/src/net/fcels.c
@@ -244,11 +244,9 @@ static struct interface_descriptor fc_els_job_desc =
/**
* Fibre Channel ELS process
*
- * @v process Process
+ * @v els Fibre Channel ELS transaction
*/
-static void fc_els_step ( struct process *process ) {
- struct fc_els *els =
- container_of ( process, struct fc_els, process );
+static void fc_els_step ( struct fc_els *els ) {
int xchg_id;
int rc;
@@ -278,6 +276,10 @@ static void fc_els_step ( struct process *process ) {
}
}
+/** Fibre Channel ELS process descriptor */
+static struct process_descriptor fc_els_process_desc =
+ PROC_DESC ( struct fc_els, process, fc_els_step );
+
/**
* Create ELS transaction
*
@@ -298,7 +300,8 @@ static struct fc_els * fc_els_create ( struct fc_port *port,
ref_init ( &els->refcnt, fc_els_free );
intf_init ( &els->job, &fc_els_job_desc, &els->refcnt );
intf_init ( &els->xchg, &fc_els_xchg_desc, &els->refcnt );
- process_init_stopped ( &els->process, fc_els_step, &els->refcnt );
+ process_init_stopped ( &els->process, &fc_els_process_desc,
+ &els->refcnt );
els->port = fc_port_get ( port );
memcpy ( &els->port_id, port_id, sizeof ( els->port_id ) );
memcpy ( &els->peer_port_id, peer_port_id,