From 769786ed748fe4582f3ee2b51233afab16c8be18 Mon Sep 17 00:00:00 2001
From: Chad Kimes <chkimes@github.com>
Date: Mon, 21 Mar 2022 18:07:31 -0400
Subject: [PATCH 335/336] kern/efi/efi: Print VLAN info in EFI device path
Signed-off-by: Chad Kimes <chkimes@github.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/kern/efi/efi.c | 7 +++++++
include/grub/efi/api.h | 10 ++++++++++
2 files changed, 17 insertions(+)
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index 4ac2b2754..b9a69d44f 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -872,6 +872,13 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
sata->lun);
}
break;
+ case GRUB_EFI_VLAN_DEVICE_PATH_SUBTYPE:
+ {
+ grub_efi_vlan_device_path_t *vlan;
+ vlan = (grub_efi_vlan_device_path_t *) dp;
+ grub_printf ("/Vlan(%u)", vlan->vlan_id);
+ }
+ break;
case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE:
dump_vendor_path ("Messaging",
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 464842ba3..b03f7fae3 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -963,6 +963,7 @@ struct grub_efi_uri_device_path
typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t;
#define GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE 31
+
struct grub_efi_dns_device_path
{
grub_efi_device_path_t header;
@@ -971,6 +972,15 @@ struct grub_efi_dns_device_path
} GRUB_PACKED;
typedef struct grub_efi_dns_device_path grub_efi_dns_device_path_t;
+#define GRUB_EFI_VLAN_DEVICE_PATH_SUBTYPE 20
+
+struct grub_efi_vlan_device_path
+{
+ grub_efi_device_path_t header;
+ grub_efi_uint16_t vlan_id;
+} GRUB_PACKED;
+typedef struct grub_efi_vlan_device_path grub_efi_vlan_device_path_t;
+
#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
/* Media Device Path. */
--
2.41.0