]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_loader/efi_device_path.c
efi_loader: Fix network DP with DM_ETH
[u-boot] / lib / efi_loader / efi_device_path.c
index 3c735e60d3bc540875221bf8e64f2e3fcea2cf04..22627824f05dd0190e7c42290035289b08609c17 100644 (file)
@@ -749,7 +749,9 @@ struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
 #ifdef CONFIG_CMD_NET
 struct efi_device_path *efi_dp_from_eth(void)
 {
+#ifndef CONFIG_DM_ETH
        struct efi_device_path_mac_addr *ndp;
+#endif
        void *buf, *start;
        unsigned dpsize = 0;
 
@@ -759,8 +761,8 @@ struct efi_device_path *efi_dp_from_eth(void)
        dpsize += dp_size(eth_get_dev());
 #else
        dpsize += sizeof(ROOT);
-#endif
        dpsize += sizeof(*ndp);
+#endif
 
        start = buf = dp_alloc(dpsize + sizeof(END));
        if (!buf)
@@ -771,14 +773,15 @@ struct efi_device_path *efi_dp_from_eth(void)
 #else
        memcpy(buf, &ROOT, sizeof(ROOT));
        buf += sizeof(ROOT);
-#endif
 
        ndp = buf;
        ndp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
        ndp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR;
        ndp->dp.length = sizeof(*ndp);
+       ndp->if_type = 1; /* Ethernet */
        memcpy(ndp->mac.addr, eth_get_ethaddr(), ARP_HLEN);
        buf = &ndp[1];
+#endif
 
        *((struct efi_device_path *)buf) = END;