Skip to contentSkip to conversation

efi_loader: complete efi_pxe_mode struct definition

PATCH New Patrick Wildt 3 participants 3 messages Mar 27, 2018 – Apr 4, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 efi_loader: complete efi_pxe_mode struct definition

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.

---
 include/efi_api.h | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
include/efi_api.h +23 -2
index 3ba650e57e..06789acdd1 100644
@@ -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;
Signature · 1 line
2.14.3 (Apple Git-98)
#1 lore raw

PATCH 1/2 efi_loader: complete efi_pxe_mode struct definition

Quoted 31 lines · Patrick Wildt

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.

---
 include/efi_api.h | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
include/efi_api.h +3 -2
index 3ba650e57e..06789acdd1 100644
@@ -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;

include/efi_api.h struct efi_pxe_packet { · line 770

Quoted 10 lines
include/efi_api.h +10 -0
+	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;

%s/pxe_discovervalid/pxe_discover_valid/

Everywhere else you replaced CamelCase by underscores.

Rest looks fine. Thanks.

Regards

Heinrich

Quoted 14 lines
include/efi_api.h +10 -0
+	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;
#2 lore raw

PATCH 1/2 efi_loader: complete efi_pxe_mode struct definition

In reply to Patrick Wildt
Quoted 7 lines

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.

Thanks, applied to efi-next

Alex