Skip to contentSkip to conversation

initialize net_mode.if_type

PATCH In review Andrew Thomas 3 participants 4 messages Jun 21, 2018 – Jul 26, 2018

lore
Share & tools
lore
#0 lore raw

cover initialize net_mode.if_type

A minor fix to efi networking.

When if_type is not set, it leads grub2's efi code to send a bogus arp request. This will then stall the progress of grub.

This was tested with grubaa64.efi from Redhat/Oracle linux 7u5.

The patch was tested against: 890e79f2b1c26c5ba1a86d179706348aec7feef7 (aka v2018.05)

Andrew Thomas (1):
initialize net_mode.if_type

 lib/efi_loader/efi_net.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 initialize net_mode.if_type

if_type is not correctly initialized

Failure to initialize if_type means that grub2/efinet sends a bogus arp request. It therefore gets no response. On Raspberry Pi 3B+ this leads to a pause at:

lan78xx_eth Waiting for PHY auto negotiation to complete....... done lan78xx_eth Waiting for PHY auto negotiation to complete....... done

---
 lib/efi_loader/efi_net.c | 1 +
 1 file changed, 1 insertion(+)
lib/efi_loader/efi_net.c +1 -0
index e113950..5a3d7be 100644
@@ -361,6 +361,7 @@ efi_status_t efi_net_register(void)
 	memcpy(netobj->net_mode.current_address.mac_addr, eth_get_ethaddr(), 6);
 	netobj->net_mode.hwaddr_size = ARP_HLEN;
 	netobj->net_mode.max_packet_size = PKTSIZE;
+	netobj->net_mode.if_type = ARP_ETHER;
 
 	netobj->pxe.mode = &netobj->pxe_mode;
 	if (dhcp_ack)
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/1 initialize net_mode.if_type

Quoted 10 lines · Andrew Thomas

if_type is not correctly initialized

Failure to initialize if_type means that grub2/efinet sends a bogus arp request. It therefore gets no response. On Raspberry Pi 3B+ this leads to a pause at:

lan78xx_eth Waiting for PHY auto negotiation to complete....... done lan78xx_eth Waiting for PHY auto negotiation to complete....... done

In the future, please Cc me (network maintainer).

Quoted 23 lines
---
 lib/efi_loader/efi_net.c | 1 +
 1 file changed, 1 insertion(+)
lib/efi_loader/efi_net.c +1 -1
index e113950..5a3d7be 100644
@@ -361,6 +361,7 @@ efi_status_t efi_net_register(void)
        memcpy(netobj->net_mode.current_address.mac_addr, eth_get_ethaddr(), 6);
        netobj->net_mode.hwaddr_size = ARP_HLEN;
        netobj->net_mode.max_packet_size = PKTSIZE;
+       netobj->net_mode.if_type = ARP_ETHER;
 
        netobj->pxe.mode = &netobj->pxe_mode;
        if (dhcp_ack)
--

1.8.3.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot