[U-Boot-Users] DHCP/BOOTP with CONFIG_NET_MULTI

Hi.
Simple question : I'm using u-boot 1.1.0 and I need to boot Linux using DHCP; in my board there is more than one eth line available. Until now I have been using TFTP with CONFIG_NET_MULTI defined and all was good, but looking the dhcp code for this step I see that dhcp doesn't support more than one eth line (get mac address only from the first). Is there any reason for this or is a bug ?
regards, Enzo

Dear Enzo,
in message 000e01c47541$604e1330$4a50848a@settimo.italtel.it you wrote:
I'm using u-boot 1.1.0 and I need to boot Linux using DHCP; in my board there is more than one eth line available.
OK. Ummm... which type of board is this?
Until now I have been using TFTP with CONFIG_NET_MULTI defined and all was good, but looking the dhcp code for this step I see that dhcp doesn't support more than one eth line (get mac address only from the first).
You write "looking the dhcp code" -- did you actually try it out?
The assignment of the current MAC address when switching to a new network interface happens in "net.c":
... 289 restart: 290 #ifdef CONFIG_NET_MULTI 291 memcpy (NetOurEther, eth_get_dev()->enetaddr, 6); 292 #else 293 memcpy (NetOurEther, bd->bi_enetaddr, 6); 294 #endif ...
The BOOTP/DHCP code just uses the value stored in the "NetOurEther" variable. To me this looks OK.
Is there any reason for this or is a bug ?
I'm not sure I understand what you mean. Are you perhaps confusing this with the random delay code (CONFIG_BOOTP_RANDOM_DELAY) where the computation of the initial random delay is based on the "ethaddr" value? This is definitely not a problem...
Best regards,
Wolfgang Denk

-----Messaggio originale----- Da: wd@denx.de [mailto:wd@denx.de] Inviato: giovedì 29 luglio 2004 10.50 A: Figini Enzo Cc: u-boot-users@lists.sourceforge.net Oggetto: Re: [U-Boot-Users] DHCP/BOOTP with CONFIG_NET_MULTI
Dear Enzo,
in message 000e01c47541$604e1330$4a50848a@settimo.italtel.it you wrote:
I'm using u-boot 1.1.0 and I need to boot Linux using DHCP;
in my board
there is more than one eth line available.
OK. Ummm... which type of board is this?
A proprietary board with MPC8280. I think to add it to u-boot tree when I'll finish to develop IPMI driver and all will be OK.
Until now I have been using TFTP with CONFIG_NET_MULTI
defined and all was
good, but looking the dhcp code for this step I see that
dhcp doesn't
support more than one eth line (get mac address only from
the first).
You write "looking the dhcp code" -- did you actually try it out?
The assignment of the current MAC address when switching to a new network interface happens in "net.c":
... 289 restart: 290 #ifdef CONFIG_NET_MULTI 291 memcpy (NetOurEther, eth_get_dev()->enetaddr, 6); 292 #else 293 memcpy (NetOurEther, bd->bi_enetaddr, 6); 294 #endif ...
The BOOTP/DHCP code just uses the value stored in the "NetOurEther" variable. To me this looks OK.
yes, I see it and it's OK.
Is there any reason for this or is a bug ?
I'm not sure I understand what you mean. Are you perhaps confusing this with the random delay code (CONFIG_BOOTP_RANDOM_DELAY) where the computation of the initial random delay is based on the "ethaddr" value? This is definitely not a problem...
Yes, You are right, I made some confusion with this define. Looking better the code seems all OK. Sorry for my mistake.
My intention is to launch dhcp and tftp in a function that control the result; in case of failure the boot process will be aborted sending a communication over IPMI using a proprietari SMS interface based on SCC. I looked the code for see if with CONFIG_NET_MULTI the dhcp process return an error code or loop until ^C is pressed.
From the code seems that after all the interface configured, netRestartWrap
go to 1, so a return of -1 is made bacause NetState assume the NETLOOP_FAIL value. This is exactly all I wanted.
Thank's for all Regards, Enzo
Best regards,
Wolfgang Denk
-- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de How many hardware guys does it take to change a light bulb? "Well the diagnostics say it's fine buddy, so it's a software problem."

In message 000f01c47550$8fb7fe10$4a50848a@settimo.italtel.it you wrote:
The BOOTP/DHCP code just uses the value stored in the "NetOurEther" variable. To me this looks OK.
yes, I see it and it's OK.
Fine.
Yes, You are right, I made some confusion with this define. Looking better the code seems all OK. Sorry for my mistake.
Don't worry; we all have our blind spots.
My intention is to launch dhcp and tftp in a function that control the result; in case of failure the boot process will be aborted sending a communication over IPMI using a proprietari SMS interface based on SCC. I looked the code for see if with CONFIG_NET_MULTI the dhcp process return an error code or loop until ^C is pressed. From the code seems that after all the interface configured, netRestartWrap go to 1, so a return of -1 is made bacause NetState assume the NETLOOP_FAIL value. This is exactly all I wanted.
Don't waste your time writing new code for such functionality. Just enable the hush shell as parser and implement it as a shell command / script, for example something like that
run dhcp_cmd || run tftp_cmd || run ipmi_cmd
You have the power of shell programming available for free - use it!
Best regards,
Wolfgang Denk
participants (2)
-
Figini Enzo
-
Wolfgang Denk