
Hi,
attached is a patch which changes the behaviour of NetLoop().
I am using a board, which has its own bootloader and which loads u-boot via bootp/tftp. u-boot needs to get its network settings from that bootp server too, but to load the linux kernel via bootp/tftp it must use a different filename than given by the bootp server.
the beginning of the u-boot commandline looks like this: setenv autoload no; bootp; tftpboot 100000 kernel
The current version of u-boot stops executing the commandline before tftpboot, because the bootp command returns an error, when NetLoop() returns zero.
Currently NetLoop returns the loaded file size or zero on failure. If you do not load a file, then file size stays zero and will be interpreted as a failure, too. This also prevents netboot_update_env() from being called in cmd_net.c.
This patch changes the behaviour so that NetLoop returns -1 on error. Zero and positive integers can then be handled as the file size correctly.
It also removes a warning in list.h. ;)
Best Regards, Andreas