OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [services/] [tftp.c] - Diff between revs 246 and 405

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 246 Rev 405
Line 266... Line 266...
                if (TftpState == STATE_RRQ) {
                if (TftpState == STATE_RRQ) {
                        TftpState = STATE_DATA;
                        TftpState = STATE_DATA;
                        TftpServerPort = src;
                        TftpServerPort = src;
                        TftpLastBlock = 0;
                        TftpLastBlock = 0;
 
 
 
 
                        if (TftpBlock != 1) {   /* Assertion */
                        if (TftpBlock != 1) {   /* Assertion */
                                printf ("\nTFTP error: "
                                printf ("\nTFTP error: "
                                        "First block is not block 1 (%d)\n"
                                        "First block is not block 1 (%d)\n"
                                        "Starting again\n\n",
                                        "Starting again\n\n",
                                        TftpBlock);
                                        TftpBlock);
Line 277... Line 278...
                                break;
                                break;
                        }
                        }
                }
                }
 
 
                if (TftpBlock == TftpLastBlock) {
                if (TftpBlock == TftpLastBlock) {
 
#ifdef ET_DEBUG
 
                  printf("block %d - repeated\n",TftpLastBlock);
 
#endif
                  /*
                  /*
                   *    Same block again; resend ack (maybe got lost last time)
                   *    Same block again; resend ack (maybe got lost last time)
                   */
                   */
                  TftpSend ();
                  TftpSend ();
                  break;
                  break;
                }
                }
                else
                else
                  {
                  {
 
#ifdef ET_DEBUG
 
                    printf("block %d - OK\n",TftpLastBlock);
 
#endif
                    TftpLastBlock = TftpBlock;
                    TftpLastBlock = TftpBlock;
                    NetSetTimeout (TIMEOUT * TICKS_PER_SEC, TftpTimeout);
                    NetSetTimeout (TIMEOUT * TICKS_PER_SEC, TftpTimeout);
 
 
                    store_block (TftpBlock - 1, pkt + 2, len);
                    store_block (TftpBlock - 1, pkt + 2, len);
                  }
                  }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.