
Dear Drasko DRASKOVIC,
In message 5ec3d7930903170638n7769e61anb30f5ce39d704f84@mail.gmail.com you wrote:
I am sorry for being vague, I hope this example will make it a bit more clear:
static void TftpTimeout (void) { if (++TftpTimeoutCount > TIMEOUT_COUNT) { puts ("\nRetry count exceeded; timeout error\n"); if (image_valid == 0) { /* * We have no valid Linux image anymore! * We must start update again! */ NetStartAgain (); } * else /* last image is not corrupted, I want to boot it */ { /* LET ME OUT! I do not want to go back to net.c caller, bacause I do not know how to tell him it was TIMEOUT. All I can do is NetState = NETLOOP_FAIL. Not much of an info. */ printf("TIMEOUT error\n"); exit (-1); }* } else { puts ("T "); NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout); TftpSend (); } }
What you are doing here makes no sense.
Image handling has no place in the networking code.
If you need image download with error handling, then implement this on the command level as a command sequence in an environment variable, or as a shell script.
Best regards,
Wolfgang Denk