|
|
f731ee |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
f731ee |
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
|
|
|
f731ee |
Date: Sat, 15 Feb 2014 15:10:22 -0500
|
|
|
f731ee |
Subject: [PATCH] reopen SNP protocol for exclusive use by grub
|
|
|
f731ee |
|
|
|
f731ee |
---
|
|
|
f731ee |
grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++
|
|
|
f731ee |
1 file changed, 16 insertions(+)
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
|
|
|
f731ee |
index 2b344d6ef78..a6e4c7992f7 100644
|
|
|
f731ee |
--- a/grub-core/net/drivers/efi/efinet.c
|
|
|
f731ee |
+++ b/grub-core/net/drivers/efi/efinet.c
|
|
|
f731ee |
@@ -223,6 +223,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
|
|
|
f731ee |
{
|
|
|
f731ee |
struct grub_net_card *card;
|
|
|
f731ee |
grub_efi_device_path_t *dp;
|
|
|
f731ee |
+ grub_efi_simple_network_t *net;
|
|
|
f731ee |
|
|
|
f731ee |
dp = grub_efi_get_device_path (hnd);
|
|
|
f731ee |
if (! dp)
|
|
|
f731ee |
@@ -250,6 +251,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
|
|
|
f731ee |
&pxe_mode->dhcp_ack,
|
|
|
f731ee |
sizeof (pxe_mode->dhcp_ack),
|
|
|
f731ee |
1, device, path);
|
|
|
f731ee |
+ net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
|
|
|
f731ee |
+ GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
|
|
|
f731ee |
+ if (net) {
|
|
|
f731ee |
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
|
|
|
f731ee |
+ && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
|
|
|
f731ee |
+ continue;
|
|
|
f731ee |
+
|
|
|
f731ee |
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
|
|
|
f731ee |
+ continue;
|
|
|
f731ee |
+
|
|
|
f731ee |
+ if (net->mode->state == GRUB_EFI_NETWORK_STARTED
|
|
|
f731ee |
+ && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
|
|
|
f731ee |
+ continue;
|
|
|
f731ee |
+ card->efi_net = net;
|
|
|
f731ee |
+ }
|
|
|
f731ee |
return;
|
|
|
f731ee |
}
|
|
|
f731ee |
}
|