On Thu, Apr 2, 2009 at 3:47 PM, Detlev Zundel <d...@denx.de> wrote:

>> I have to enable the git operation via gmail on my workstation.
>
> What do you mean by this?  Usually you only need a mailer which is
> capable to attach things inline.  Even better - if you have a direct
> access to an mta or an smtp server, use git-send-email after
> git-format-patch.

Ok, I tried the msmtp to access my www.gmail.com account with no
success nether directly (is prohibited by corporate policy) nor via
corporate email relay (the gmail smtp server uses non standard port
which requires reflection in the email relay configuration and no one
is willing to do it for me :-).

> Apart from that you have to nudge Ben or Heiko as to the real content.
> I only wanted to help get the formalities straight ;)
>
> Cheers
>  Detlev


Dear Heiko,

 Could you please do an additional try to apply the patch produced
with git-format-patch. I hope it is OK now.

Thanks,
Michael

>From 774a3d83c4363a0bbeb0616786f522877882c88b Mon Sep 17 00:00:00 2001
From: Michael Zaidman <michael.zaid...@gmail.com>
Date: Thu, 2 Apr 2009 18:25:03 +0300
Subject: [U-Boot] [PATCH] NetLoop initialization bug

The patch fixes the bug of partial initialization of global network
parameters.

Upon u-boot's start up the first ping command causes a failure of the
consequent TFTP transfers. It happens in the recently added mechanism of
NetLoop initialization where initialization of global network parameters is
separated in the NetInitLoop routine which is called per env_id change.
Thus, ping request will initialize the network parameters necessary
for ping operation only, afterwards the env_changed_id will be set
to the env_id that will prevent all following initialization requests
from other protocols.
The problem is that the initialized by ping subset of network parameters
is not sufficient for other protocols and particularly for TFTP
which requires the NetServerIp also.

Signed-off-by: Michael Zaidman <michael.zaid...@gmail.com>
---
 net/net.c |   62 ++----------------------------------------------------------
 1 files changed, 3 insertions(+), 59 deletions(-)

diff --git a/net/net.c b/net/net.c
index a89f6a0..edb4477 100644
--- a/net/net.c
+++ b/net/net.c
@@ -285,68 +285,15 @@ NetInitLoop(proto_t protocol)
        int env_id = get_env_id ();

        /* update only when the environment has changed */
-       if (env_changed_id == env_id)
-               return 0;
-
-       switch (protocol) {
-#if defined(CONFIG_CMD_NFS)
-       case NFS:
-#endif
-#if defined(CONFIG_CMD_PING)
-       case PING:
-#endif
-#if defined(CONFIG_CMD_SNTP)
-       case SNTP:
-#endif
-       case NETCONS:
-       case TFTP:
+       if (env_changed_id != env_id) {
                NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
                NetOurGatewayIP = getenv_IPaddr ("gatewayip");
                NetOurSubnetMask= getenv_IPaddr ("netmask");
-               NetOurVLAN = getenv_VLAN("vlan");
-               NetOurNativeVLAN = getenv_VLAN("nvlan");
-
-               switch (protocol) {
-#if defined(CONFIG_CMD_NFS)
-               case NFS:
-#endif
-               case NETCONS:
-               case TFTP:
-                       NetServerIP = getenv_IPaddr ("serverip");
-                       break;
-#if defined(CONFIG_CMD_PING)
-               case PING:
-                       /* nothing */
-                       break;
-#endif
-#if defined(CONFIG_CMD_SNTP)
-               case SNTP:
-                       /* nothing */
-                       break;
-#endif
-               default:
-                       break;
-               }
-
-               break;
-       case BOOTP:
-       case RARP:
-               /*
-                * initialize our IP addr to 0 in order to accept ANY
-                * IP addr assigned to us by the BOOTP / RARP server
-                */
-               NetOurIP = 0;
                NetServerIP = getenv_IPaddr ("serverip");
-               NetOurVLAN = getenv_VLAN("vlan");       /* VLANs must be read */
                NetOurNativeVLAN = getenv_VLAN("nvlan");
-       case CDP:
-               NetOurVLAN = getenv_VLAN("vlan");       /* VLANs must be read */
-               NetOurNativeVLAN = getenv_VLAN("nvlan");
-               break;
-       default:
-               break;
+               NetOurVLAN = getenv_VLAN("vlan");
+               env_changed_id = env_id;
        }
-       env_changed_id = env_id;
        return 0;
 }

@@ -440,10 +387,7 @@ restart:

 #if defined(CONFIG_CMD_DHCP)
                case DHCP:
-                       /* Start with a clean slate... */
                        BootpTry = 0;
-                       NetOurIP = 0;
-                       NetServerIP = getenv_IPaddr ("serverip");
                        DhcpRequest();          /* Basically same as BOOTP */
                        break;
 #endif
-- 
1.5.6.3
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to