summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/xfer.c27
-rw-r--r--src/include/ipxe/xfer.h4
2 files changed, 31 insertions, 0 deletions
diff --git a/src/core/xfer.c b/src/core/xfer.c
index 222af52a8..a755d438a 100644
--- a/src/core/xfer.c
+++ b/src/core/xfer.c
@@ -105,6 +105,33 @@ size_t xfer_window ( struct interface *intf ) {
}
/**
+ * Report change of flow control window
+ *
+ * @v intf Data transfer interface
+ *
+ * Note that this method is used to indicate only unsolicited changes
+ * in the flow control window. In particular, this method must not be
+ * called as part of the response to xfer_deliver(), since that could
+ * easily lead to an infinite loop. Callers of xfer_deliver() should
+ * assume that the flow control window will have changed without
+ * generating an xfer_window_changed() message.
+ */
+void xfer_window_changed ( struct interface *intf ) {
+ struct interface *dest;
+ xfer_window_changed_TYPE ( void * ) *op =
+ intf_get_dest_op ( intf, xfer_window_changed, &dest );
+ void *object = intf_object ( dest );
+
+ if ( op ) {
+ op ( object );
+ } else {
+ /* Default is to do nothing */
+ }
+
+ intf_put ( dest );
+}
+
+/**
* Allocate I/O buffer
*
* @v intf Data transfer interface
diff --git a/src/include/ipxe/xfer.h b/src/include/ipxe/xfer.h
index 2aa35f8de..0c0303279 100644
--- a/src/include/ipxe/xfer.h
+++ b/src/include/ipxe/xfer.h
@@ -57,6 +57,10 @@ extern size_t xfer_window ( struct interface *intf );
#define xfer_window_TYPE( object_type ) \
typeof ( size_t ( object_type ) )
+extern void xfer_window_changed ( struct interface *intf );
+#define xfer_window_changed_TYPE( object_type ) \
+ typeof ( void ( object_type ) )
+
extern struct io_buffer * xfer_alloc_iob ( struct interface *intf,
size_t len );
#define xfer_alloc_iob_TYPE( object_type ) \