summaryrefslogtreecommitdiffstats
path: root/src/net/fcns.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/fcns.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/fcns.c')
-rw-r--r--src/net/fcns.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/fcns.c b/src/net/fcns.c
index 7769e255..afb57cfe 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;