]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[int13] Provide a permanently closed window via the control interface
authorMichael Brown <mcb30@ipxe.org>
Fri, 24 Jun 2011 18:14:13 +0000 (19:14 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 28 Jun 2011 13:45:13 +0000 (14:45 +0100)
Allow objects to support both streaming and block device protocols, by
starting streaming data only when the data transfer window opens.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/interface/pcbios/int13.c

index b099958c6e1de40b6b7abcd78827332f5d1dbf9e..8ce77ada2242657878bf5c6177984fb70f11bfcc 100644 (file)
@@ -1333,6 +1333,20 @@ static void int13_unhook_vector ( void ) {
                                &int13_vector );
 }
 
+/**
+ * Check INT13 emulated drive flow control window
+ *
+ * @v int13            Emulated drive
+ */
+static size_t int13_block_window ( struct int13_drive *int13 __unused ) {
+
+       /* We are never ready to receive data via this interface.
+        * This prevents objects that support both block and stream
+        * interfaces from attempting to send us stream data.
+        */
+       return 0;
+}
+
 /**
  * Handle INT 13 emulated drive underlying block device closing
  *
@@ -1357,6 +1371,7 @@ static void int13_block_close ( struct int13_drive *int13, int rc ) {
 
 /** INT 13 drive interface operations */
 static struct interface_operation int13_block_op[] = {
+       INTF_OP ( xfer_window, struct int13_drive *, int13_block_window ),
        INTF_OP ( intf_close, struct int13_drive *, int13_block_close ),
 };