aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-10-16 15:11:16 +0100
committerMichael Brown <mcb30@ipxe.org>2020-10-16 15:38:20 +0100
commit1e8648f6113691366729bbffc3412bcf3a27ece2 (patch)
tree38a470169c9325c890b7e01040c2cfdbc1ba2953
parent87e39a9c9345e177c46f74dc1e3d6d94136315be (diff)
downloadipxe-1e8648f6113691366729bbffc3412bcf3a27ece2.tar.gz
[usbblk] Allow USB block device to be described using an EFI device path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/drivers/usb/usbblk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/drivers/usb/usbblk.c b/src/drivers/usb/usbblk.c
index a68e3ced5..5a086d3f8 100644
--- a/src/drivers/usb/usbblk.c
+++ b/src/drivers/usb/usbblk.c
@@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/xfer.h>
#include <ipxe/uri.h>
#include <ipxe/open.h>
+#include <ipxe/efi/efi_path.h>
#include "usbblk.h"
/** @file
@@ -702,11 +703,25 @@ static void usbblk_scsi_close ( struct usbblk_device *usbblk, int rc ) {
usbblk->opened = 0;
}
+/**
+ * Describe as an EFI device path
+ *
+ * @v usbblk USB block device
+ * @ret path EFI device path, or NULL on error
+ */
+static EFI_DEVICE_PATH_PROTOCOL *
+usbblk_efi_describe ( struct usbblk_device *usbblk ) {
+
+ return efi_usb_path ( usbblk->func );
+}
+
/** SCSI command interface operations */
static struct interface_operation usbblk_scsi_operations[] = {
INTF_OP ( scsi_command, struct usbblk_device *, usbblk_scsi_command ),
INTF_OP ( xfer_window, struct usbblk_device *, usbblk_scsi_window ),
INTF_OP ( intf_close, struct usbblk_device *, usbblk_scsi_close ),
+ EFI_INTF_OP ( efi_describe, struct usbblk_device *,
+ usbblk_efi_describe ),
};
/** SCSI command interface descriptor */