瀏覽代碼

[int13] Provide a permanently closed window via the control interface

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>
tags/v1.20.1
Michael Brown 13 年之前
父節點
當前提交
69f5b2e8dc
共有 1 個檔案被更改,包括 15 行新增0 行删除
  1. 15
    0
      src/arch/i386/interface/pcbios/int13.c

+ 15
- 0
src/arch/i386/interface/pcbios/int13.c 查看文件

@@ -1333,6 +1333,20 @@ static void int13_unhook_vector ( void ) {
1333 1333
 				&int13_vector );
1334 1334
 }
1335 1335
 
1336
+/**
1337
+ * Check INT13 emulated drive flow control window
1338
+ *
1339
+ * @v int13		Emulated drive
1340
+ */
1341
+static size_t int13_block_window ( struct int13_drive *int13 __unused ) {
1342
+
1343
+	/* We are never ready to receive data via this interface.
1344
+	 * This prevents objects that support both block and stream
1345
+	 * interfaces from attempting to send us stream data.
1346
+	 */
1347
+	return 0;
1348
+}
1349
+
1336 1350
 /**
1337 1351
  * Handle INT 13 emulated drive underlying block device closing
1338 1352
  *
@@ -1357,6 +1371,7 @@ static void int13_block_close ( struct int13_drive *int13, int rc ) {
1357 1371
 
1358 1372
 /** INT 13 drive interface operations */
1359 1373
 static struct interface_operation int13_block_op[] = {
1374
+	INTF_OP ( xfer_window, struct int13_drive *, int13_block_window ),
1360 1375
 	INTF_OP ( intf_close, struct int13_drive *, int13_block_close ),
1361 1376
 };
1362 1377
 

Loading…
取消
儲存