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/fcns.c | |
parent | ba3633782bd36831ca5471d792e626b7e8344e0c (diff) | |
download | ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.zip ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.gz ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.bz2 |
[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/fcns.c')
-rw-r--r-- | src/net/fcns.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/fcns.c b/src/net/fcns.c index 7769e25..afb57cf 100644 --- a/src/net/fcns.c +++ b/src/net/fcns.c @@ -153,11 +153,9 @@ static int fc_ns_query_deliver ( struct fc_ns_query *query, /** * Name server query process * - * @v process Process + * @v query Name server query */ -static void fc_ns_query_step ( struct process *process ) { - struct fc_ns_query *query = - container_of ( process, struct fc_ns_query, process ); +static void fc_ns_query_step ( struct fc_ns_query *query ) { struct xfer_metadata meta; struct fc_ns_gid_pn_request gid_pn; int xchg_id; @@ -208,6 +206,10 @@ static struct interface_operation fc_ns_query_xchg_op[] = { static struct interface_descriptor fc_ns_query_xchg_desc = INTF_DESC ( struct fc_ns_query, xchg, fc_ns_query_xchg_op ); +/** Name server process descriptor */ +static struct process_descriptor fc_ns_query_process_desc = + PROC_DESC ( struct fc_ns_query, process, fc_ns_query_step ); + /** * Issue Fibre Channel name server query * @@ -226,7 +228,8 @@ int fc_ns_query ( struct fc_peer *peer, struct fc_port *port, return -ENOMEM; ref_init ( &query->refcnt, fc_ns_query_free ); intf_init ( &query->xchg, &fc_ns_query_xchg_desc, &query->refcnt ); - process_init ( &query->process, fc_ns_query_step, &query->refcnt ); + process_init ( &query->process, &fc_ns_query_process_desc, + &query->refcnt ); query->peer = fc_peer_get ( peer ); query->port = fc_port_get ( port ); query->done = done; |