Discussion:
[edk2] [Patch] MdeModulePkg: Update UefiBootManagerLib to support HTTP boot option creation
Ruiyu Ni
2015-07-07 05:38:01 UTC
Permalink
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <***@intel.com>
Cc: Siyuan Fu <***@intel.com>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 +++++++++++-
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 3691c11..2c38aa8 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -69,6 +69,8 @@ EfiBootManagerRegisterLegacyBootSupport (
@retval MessageNetworkBoot If given device path contains MESSAGING_DEVICE_PATH type device path node
and its last device path node's subtype is MSG_MAC_ADDR_DP, MSG_VLAN_DP,
MSG_IPv4_DP or MSG_IPv6_DP.
+ @retval MessageHttpBoot If given device path contains MESSAGING_DEVICE_PATH type device path node
+ and its last device path node's subtype is MSG_URI_DP.
@retval UnsupportedBoot If tiven device path doesn't match the above condition, it's not supported.

**/
@@ -113,7 +115,7 @@ BmDevicePathType (
// If the device path not only point to driver device, it is not a messaging device path,
//
if (!IsDevicePathEndType (NextNode)) {
- break;
+ continue;
}

switch (DevicePathSubType (Node)) {
@@ -139,6 +141,10 @@ BmDevicePathType (
case MSG_IPv6_DP:
return BmMessageNetworkBoot;
break;
+
+ case MSG_URI_DP:
+ return BmMessageHttpBoot;
+ break;
}
}
}
@@ -686,6 +692,10 @@ BmGetMiscDescription (
Description = L"Network";
break;

+ case BmMessageHttpBoot:
+ Description = L"Http";
+ break;
+
default:
Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **) &Fs);
if (!EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
index 9baba86..d415442 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
+++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
@@ -91,6 +91,7 @@ typedef enum {
BmMessageUsbBoot,
BmMessageScsiBoot,
BmMessageNetworkBoot,
+ BmMessageHttpBoot,
BmMiscBoot
} BM_BOOT_TYPE;
--
1.9.5.msysgit.1
Fu, Siyuan
2015-07-07 05:39:35 UTC
Permalink
Looks good to me.
Reviewed-by: Fu Siyuan <***@intel.com>

-----Original Message-----
From: Ni, Ruiyu
Sent: Tuesday, July 07, 2015 1:38 PM
To: edk2-***@lists.sourceforge.net
Cc: Ni, Ruiyu; Fu, Siyuan
Subject: [Patch] MdeModulePkg: Update UefiBootManagerLib to support HTTP boot option creation

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <***@intel.com>
Cc: Siyuan Fu <***@intel.com>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 +++++++++++-
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 3691c11..2c38aa8 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -69,6 +69,8 @@ EfiBootManagerRegisterLegacyBootSupport (
@retval MessageNetworkBoot If given device path contains MESSAGING_DEVICE_PATH type device path node
and its last device path node's subtype is MSG_MAC_ADDR_DP, MSG_VLAN_DP,
MSG_IPv4_DP or MSG_IPv6_DP.
+ @retval MessageHttpBoot If given device path contains MESSAGING_DEVICE_PATH type device path node
+ and its last device path node's subtype is MSG_URI_DP.
@retval UnsupportedBoot If tiven device path doesn't match the above condition, it's not supported.

**/
@@ -113,7 +115,7 @@ BmDevicePathType (
// If the device path not only point to driver device, it is not a messaging device path,
//
if (!IsDevicePathEndType (NextNode)) {
- break;
+ continue;
}

switch (DevicePathSubType (Node)) { @@ -139,6 +141,10 @@ BmDevicePathType (
case MSG_IPv6_DP:
return BmMessageNetworkBoot;
break;
+
+ case MSG_URI_DP:
+ return BmMessageHttpBoot;
+ break;
}
}
}
@@ -686,6 +692,10 @@ BmGetMiscDescription (
Description = L"Network";
break;

+ case BmMessageHttpBoot:
+ Description = L"Http";
+ break;
+
default:
Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **) &Fs);
if (!EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
index 9baba86..d415442 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
+++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
@@ -91,6 +91,7 @@ typedef enum {
BmMessageUsbBoot,
BmMessageScsiBoot,
BmMessageNetworkBoot,
+ BmMessageHttpBoot,
BmMiscBoot
} BM_BOOT_TYPE;

--
1.9.5.msysgit.1

Loading...