summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/xfer.h
diff options
context:
space:
mode:
authorMichael Brown2008-06-12 20:43:25 +0200
committerMichael Brown2010-06-22 15:34:58 +0200
commite71b83b22b3ce8ddb6b5ba91948c5a1b937ef0fb (patch)
tree5050cf65aa2ba31fab04f9c6225d60c6435ffdc8 /src/include/ipxe/xfer.h
parent[retry] Use start_timer_fixed() instead of direct timeout manipulation (diff)
downloadipxe-e71b83b22b3ce8ddb6b5ba91948c5a1b937ef0fb.tar.gz
ipxe-e71b83b22b3ce8ddb6b5ba91948c5a1b937ef0fb.tar.xz
ipxe-e71b83b22b3ce8ddb6b5ba91948c5a1b937ef0fb.zip
[interface] Expand object interface to allow for polymorphic interfaces
We have several types of object interface at present (data-xfer, job control, name resolution), and there is some duplication of functionality between them. For example, job_done(), job_kill() and xfer_close() are almost isomorphic to each other. This updated version of the object interface mechanism allows for each interface to export an arbitrary list of supported operations. Advantages include: Operations methods now receive a pointer to the object, rather than a pointer to the interface. This allows an object to, for example, implement a single close() method that can handle close() operations from any of its exposed interfaces. The close() operation is implemented as a generic operation (rather than having specific variants for data-xfer, job control, etc.). This will allow functions such as monojob_wait() to be used to wait for e.g. a name resolution to complete. The amount of boilerplate code required in objects is reduced, not least because it is no longer necessary to include per-interface methods that simply use container_of() to derive a pointer to the object and then tail-call to a common per-object method. The cost of adding new operations is reduced; adding a new data-xfer operation such as stat() no longer incurs the penalty of adding a .stat member to the operations table of all existing data-xfer interfaces. The data-xfer, job control and name resolution interfaces have not yet been updated to use the new interface mechanism, but the code will still compile and run. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/xfer.h')
-rw-r--r--src/include/ipxe/xfer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/ipxe/xfer.h b/src/include/ipxe/xfer.h
index ad41e932c..8a3f9bb1c 100644
--- a/src/include/ipxe/xfer.h
+++ b/src/include/ipxe/xfer.h
@@ -238,7 +238,7 @@ xfer_put ( struct xfer_interface *xfer ) {
*/
static inline __attribute__ (( always_inline )) void
xfer_plug ( struct xfer_interface *xfer, struct xfer_interface *dest ) {
- plug ( &xfer->intf, &dest->intf );
+ intf_plug ( &xfer->intf, &dest->intf );
}
/**
@@ -249,7 +249,7 @@ xfer_plug ( struct xfer_interface *xfer, struct xfer_interface *dest ) {
*/
static inline __attribute__ (( always_inline )) void
xfer_plug_plug ( struct xfer_interface *a, struct xfer_interface *b ) {
- plug_plug ( &a->intf, &b->intf );
+ intf_plug_plug ( &a->intf, &b->intf );
}
/**
@@ -259,7 +259,7 @@ xfer_plug_plug ( struct xfer_interface *a, struct xfer_interface *b ) {
*/
static inline __attribute__ (( always_inline )) void
xfer_unplug ( struct xfer_interface *xfer ) {
- plug ( &xfer->intf, &null_xfer.intf );
+ intf_plug ( &xfer->intf, &null_xfer.intf );
}
/**