diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-06-24 14:14:41 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2011-06-28 14:45:08 +0100 |
commit | e01ec74601b58f54a5e2ae7b9fd1196972034114 (patch) | |
tree | 54f2d2202274523e2365584502dee7db8deca43b /src/net/fcels.c | |
parent | ba3633782bd36831ca5471d792e626b7e8344e0c (diff) | |
download | ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.gz |
[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.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/fcels.c b/src/net/fcels.c index f8bcb865f..656b4f672 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, |