From: Patrick Wildt <patrick@blueri.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] efi_loader: set the dhcp ack received flag
Date: Sun, 25 Mar 2018 22:23:09 +0200 [thread overview]
Message-ID: <20180325202309.GA87508@nyx.fritz.box> (raw)
In-Reply-To: <3ed60309-4681-d376-c9b8-88ce7238c2aa@gmx.de>
On Sun, Mar 25, 2018 at 10:04:55PM +0200, Heinrich Schuchardt wrote:
> Thank you for the explanation. I think the right way go ahead is to add
> all missing fields and to do away with unused[].
>
> Please, carefully observe the alignment. The spec defines BOOLEAN as
> 8bit value. ToS is the 19th byte followed by an EFI_IP_ADDRESS which is
> a 16-byte buffer aligned on a 4-byte boundary. So after ToS we need one
> byte to ensure alignment. We could define a struct efi_ip_address as
> u8 a[16] __attribute__((aligned(4))).
>
> Best regards
>
> Heinrich
I have noticed that, yes. I think explicitly padding the struct gives
better visibility of the issue, instead of relying on an implicit
alignment. Two other structures in u-boot EFI headers contain explicit
"pad" members. I'd feel safer to go that route. What do you think
about the following?
Best regards,
Patrick
diff --git a/include/efi_api.h b/include/efi_api.h
index 3ba650e57e..489ff476a4 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -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;
next prev parent reply other threads:[~2018-03-25 20:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7c21262c-62a9-ba5e-3f4f-023c7026d7f8@gmx.de>
2018-03-23 19:04 ` [U-Boot] [PATCH 2/2] efi_loader: set the dhcp ack received flag Heinrich Schuchardt
2018-03-25 17:44 ` Patrick Wildt
2018-03-25 20:04 ` Heinrich Schuchardt
2018-03-25 20:23 ` Patrick Wildt [this message]
2018-03-26 4:39 ` Heinrich Schuchardt
2018-03-26 7:28 ` Patrick Wildt
2018-03-26 11:34 ` Alexander Graf
2018-03-27 12:24 Patrick Wildt
2018-03-27 16:05 ` Heinrich Schuchardt
2018-12-02 21:21 ` Alexander Graf
2019-01-31 14:25 ` Patrick Wildt
2019-01-31 14:31 ` Alexander Graf
2019-01-31 14:54 ` Patrick Wildt
2019-01-31 18:29 ` Heinrich Schuchardt
2019-02-04 16:43 ` Patrick Wildt
2019-02-04 17:28 ` Heinrich Schuchardt
2019-04-10 9:20 ` Patrick Wildt
2019-04-10 9:24 ` Patrick Wildt
2019-08-02 19:26 ` Patrick Wildt
2019-08-04 11:52 ` Heinrich Schuchardt
2019-08-06 17:49 ` Heinrich Schuchardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180325202309.GA87508@nyx.fritz.box \
--to=patrick@blueri.se \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox