From patchwork Tue Mar 27 12:23:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Wildt X-Patchwork-Id: 891537 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=blueri.se Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 409VY13VLJz9s0R for ; Tue, 27 Mar 2018 23:23:33 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EFBF0C21FB3; Tue, 27 Mar 2018 12:23:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DB4BBC21D83; Tue, 27 Mar 2018 12:23:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D1F2FC21E1A; Tue, 27 Mar 2018 12:23:22 +0000 (UTC) Received: from pony.blueri.se (pony.blueri.se [163.172.214.9]) by lists.denx.de (Postfix) with ESMTPS id 673C3C21C57 for ; Tue, 27 Mar 2018 12:23:22 +0000 (UTC) Received: from nyx.local (p50937c2a.dip0.t-ipconnect.de [80.147.124.42]) by pony.blueri.se (OpenSMTPD) with ESMTPSA id 102a49ae (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 27 Mar 2018 14:23:21 +0200 (CEST) Date: Tue, 27 Mar 2018 14:23:20 +0200 From: Patrick Wildt To: u-boot@lists.denx.de Message-ID: <20180327122319.GA94872@nyx.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Cc: Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH 1/2] efi_loader: complete efi_pxe_mode struct definition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The efi_pxe_mode struct which represents the PXE_BASE_CODE_PROTOCOL Replace the placeholder paddings in the efi_pxe_mode struct with the actual fields as defined in UEFI's PXE Base Code Protocol. Since our efi_ip_address is a simple char array set a specific alignment to the efi_ip_address fields, as expected by the UEFI spec. Signed-off-by: Patrick Wildt --- include/efi_api.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 3ba650e57e..06789acdd1 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -662,7 +662,7 @@ struct efi_mac_address { struct efi_ip_address { u8 ip_addr[16]; -}; +} __attribute__((aligned(4))); enum efi_simple_network_state { EFI_NETWORK_STOPPED, @@ -756,7 +756,28 @@ struct efi_pxe_packet { struct efi_pxe_mode { - u8 unused[52]; + u8 started; + u8 ipv6_available; + u8 ipv6_supported; + u8 using_ipv6; + u8 bis_supported; + u8 bis_detected; + u8 auto_arp; + u8 send_guid; + u8 dhcp_discover_valid; + u8 dhcp_ack_received; + u8 proxy_offer_received; + u8 pxe_discovervalid; + u8 pxe_reply_received; + u8 pxe_bis_reply_received; + u8 icmp_error_received; + u8 tftp_error_received; + u8 make_callbacks; + u8 ttl; + u8 tos; + u8 pad; + struct efi_ip_address station_ip; + struct efi_ip_address subnet_mask; struct efi_pxe_packet dhcp_discover; struct efi_pxe_packet dhcp_ack; struct efi_pxe_packet proxy_offer; From patchwork Tue Mar 27 12:24:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Wildt X-Patchwork-Id: 891538 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=blueri.se Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 409VYs6DG2z9s02 for ; Tue, 27 Mar 2018 23:24:17 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 527F6C21FD8; Tue, 27 Mar 2018 12:24:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0ED78C21D83; Tue, 27 Mar 2018 12:24:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 965A1C21D83; Tue, 27 Mar 2018 12:24:08 +0000 (UTC) Received: from pony.blueri.se (pony.blueri.se [163.172.214.9]) by lists.denx.de (Postfix) with ESMTPS id 44C09C21C57 for ; Tue, 27 Mar 2018 12:24:08 +0000 (UTC) Received: from nyx.local (p50937c2a.dip0.t-ipconnect.de [80.147.124.42]) by pony.blueri.se (OpenSMTPD) with ESMTPSA id f292e516 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 27 Mar 2018 14:24:07 +0200 (CEST) Date: Tue, 27 Mar 2018 14:24:05 +0200 From: Patrick Wildt To: u-boot@lists.denx.de Message-ID: <20180327122405.GB94872@nyx.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Cc: Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH 2/2] efi_loader: set the dhcp ack received flag X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The PXE object contains a flag that specifies whether or not a DHCP ACK has been received. This can be used by EFI Applications to find out whether or not it is worth to read the DHCP information from our object. Signed-off-by: Patrick Wildt --- lib/efi_loader/efi_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 8c5d5b492c..0b9c7b9345 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -332,8 +332,10 @@ int efi_net_register(void) netobj->net_mode.max_packet_size = PKTSIZE; netobj->pxe.mode = &netobj->pxe_mode; - if (dhcp_ack) + if (dhcp_ack) { netobj->pxe_mode.dhcp_ack = *dhcp_ack; + netobj->pxe_mode.dhcp_ack_received = 1; + } /* * Create WaitForPacket event.