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