Skip to contentSkip to conversation

DHCP/BOOTP with CONFIG_NET_MULTI

U-Boot-Users Figini Enzo 2 participants 4 messages Jul 29, 2004

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

Dear Enzo,

Quoted 3 lines · in message <[email protected]> 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?

Quoted 3 lines

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.

Quoted 1 line

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

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at 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."
#2 lore raw

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

Quoted 11 lines

-----Messaggio originale-----
Da: wd at denx.de [mailto:wd at denx.de]
Inviato: gioved? 29 luglio 2004 10.50
A: Figini Enzo
Cc: u-boot-users at lists.sourceforge.net
Oggetto: Re: [U-Boot-Users] DHCP/BOOTP with CONFIG_NET_MULTI

Dear Enzo,

Quoted 8 lines

in message

Quoted 2 lines · <[email protected]> you wrote:

I'm using u-boot 1.1.0 and I need to boot Linux using DHCP;

in my board

Quoted 1 line

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.

Quoted 22 lines
Quoted 2 lines

Until now I have been using TFTP with CONFIG_NET_MULTI

defined and all was

Quoted 1 line

good, but looking the dhcp code for this step I see that

dhcp doesn't

Quoted 1 line

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
    ...
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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.

#3 lore raw

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

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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.

Quoted 3 lines

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.

Quoted 9 lines

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

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
You young'uns. That was *long* before AltaVista,  DejaNews,  or  even
(gasp) the *Web*! In fact, we typed that thread on steam-powered card
punchers, and shipped it around via Pony Express.
            -- Randal Schwartz in <[email protected]>