SHA256
1
0
forked from pool/u-boot
u-boot/0008-efi-Use-device-device-path-type-Mes.patch
Dominique Leuenberger 4a8c51668e Accepting request 448523 from Base:System
- Added support for DE0-Nanos-SoC board

- Updated to v2016.11

- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2016.11
  to fix build of Raspberry Pi 1, 2 and 3

- Updated to v2016.11-rc3
- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2016.11
* Patches dropped:
  0004-efi_loader-Allow-boards-to-implemen.patch
  0005-ARM-bcm283x-Implement-EFI-RTS-reset.patch
  0006-efi_loader-gop-Expose-fb-when-32bpp.patch
  0007-bcm2835-video-Map-frame-buffer-as-3.patch
  0008-bcm2835-Reserve-the-spin-table-in-e.patch
  0009-x86-Move-table-csum-into-separate-h.patch
  0010-x86-Move-smbios-generation-into-arc.patch
  0011-efi_loader-Expose-efi_install_confi.patch
  0012-smbios-Allow-compilation-on-64bit-s.patch
  0013-smbios-Expose-in-efi_loader-as-tabl.patch
  0014-efi_loader-Fix-efi_install_configur.patch
  0015-smbios-Provide-serial-number.patch
  0016-efi_loader-Update-description-of-in.patch
  0017-efi_loader-Fix-memory-map-size-chec.patch
  0018-efi_loader-Fix-crash-on-32-bit-syst.patch
  0019-efi_loader-Move-efi_allocate_pool-i.patch
  0020-efi_loader-Track-size-of-pool-alloc.patch
  0021-efi_loader-Readd-freed-pages-to-mem.patch
  0022-efi_loader-Keep-memory-mapping-sort.patch
  0023-efi_loader-Do-not-leak-memory-when-.patch

OBS-URL: https://build.opensuse.org/request/show/448523
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/u-boot?expand=0&rev=83
2017-01-09 10:54:59 +00:00

92 lines
3.1 KiB
Diff

From cd3fca2b8567f236b38f94a091e77f9efc3a879b Mon Sep 17 00:00:00 2001
From: Oleksandr Tymoshenko <gonzo@bluezbox.com>
Date: Mon, 24 Oct 2016 10:47:01 -0700
Subject: [PATCH] efi: Use device device path type Messaging for network
interface node
When adding network interface node use Messaging device path with
subtype MAC Address and device's MAC address as a value instead
of Media Device path type with subtype File Path and path "Net"
Signed-off-by: Oleksandr Tymoshenko <gonzo@bluezbox.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
include/efi_api.h | 13 +++++++++++++
lib/efi_loader/efi_net.c | 17 +++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/include/efi_api.h b/include/efi_api.h
index bdb600e..5c3836a 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -268,6 +268,19 @@ struct efi_device_path {
u16 length;
};
+struct efi_mac_addr {
+ u8 addr[32];
+};
+
+#define DEVICE_PATH_TYPE_MESSAGING_DEVICE 0x03
+# define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b
+
+struct efi_device_path_mac_addr {
+ struct efi_device_path dp;
+ struct efi_mac_addr mac;
+ u8 if_type;
+};
+
#define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
# define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 3796496..604ac6e 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -27,7 +27,8 @@ struct efi_net_obj {
struct efi_simple_network net;
struct efi_simple_network_mode net_mode;
/* Device path to the network adapter */
- struct efi_device_path_file_path dp[2];
+ struct efi_device_path_mac_addr dp_mac;
+ struct efi_device_path_file_path dp_end;
/* PXE struct to transmit dhcp data */
struct efi_pxe pxe;
struct efi_pxe_mode pxe_mode;
@@ -205,7 +206,7 @@ static efi_status_t EFIAPI efi_net_open_dp(void *handle, efi_guid_t *protocol,
struct efi_simple_network *net = handle;
struct efi_net_obj *netobj = container_of(net, struct efi_net_obj, net);
- *protocol_interface = netobj->dp;
+ *protocol_interface = &netobj->dp_mac;
return EFI_SUCCESS;
}
@@ -236,11 +237,10 @@ void efi_net_set_dhcp_ack(void *pkt, int len)
int efi_net_register(void **handle)
{
struct efi_net_obj *netobj;
- struct efi_device_path_file_path dp_net = {
- .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
- .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
+ struct efi_device_path_mac_addr dp_net = {
+ .dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE,
+ .dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR,
.dp.length = sizeof(dp_net),
- .str = { 'N', 'e', 't' },
};
struct efi_device_path_file_path dp_end = {
.dp.type = DEVICE_PATH_TYPE_END,
@@ -279,8 +279,9 @@ int efi_net_register(void **handle)
netobj->net.receive = efi_net_receive;
netobj->net.mode = &netobj->net_mode;
netobj->net_mode.state = EFI_NETWORK_STARTED;
- netobj->dp[0] = dp_net;
- netobj->dp[1] = dp_end;
+ netobj->dp_mac = dp_net;
+ netobj->dp_end = dp_end;
+ memcpy(netobj->dp_mac.mac.addr, eth_get_ethaddr(), 6);
memcpy(netobj->net_mode.current_address.mac_addr, eth_get_ethaddr(), 6);
netobj->net_mode.max_packet_size = PKTSIZE;