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

Subversion Repositories openrisc_me

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

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

Rev 175 Rev 246
Line 8... Line 8...
#include "support.h"
#include "support.h"
#include "net.h"
#include "net.h"
#include "tftp.h"
#include "tftp.h"
#include "bootp.h"
#include "bootp.h"
 
 
//#undef        ET_DEBUG
 
#define ET_DEBUG
 
 
 
#define WELL_KNOWN_PORT 69              /* Well known TFTP port #               */
#define WELL_KNOWN_PORT 69              /* Well known TFTP port #               */
#define TIMEOUT         2               /* Seconds to timeout for a lost pkt    */
#define TIMEOUT         2               /* Seconds to timeout for a lost pkt    */
#define TIMEOUT_COUNT   10              /* # of timeouts before giving up       */
#define TIMEOUT_COUNT   10              /* # of timeouts before giving up       */
                                        /* (for checking the image size)        */
                                        /* (for checking the image size)        */
Line 159... Line 157...
        volatile unsigned char *        pkt;
        volatile unsigned char *        pkt;
        volatile unsigned char *        xp;
        volatile unsigned char *        xp;
        int                     len = 0;
        int                     len = 0;
 
 
#ifdef ET_DEBUG
#ifdef ET_DEBUG
        //printf("TftpSend: %d\n", TftpState);
        printf("TftpSend: %d\n", TftpState);
#endif
#endif
 
 
 
 
        /*
        /*
         *      We will always be sending some sort of packet, so
         *      We will always be sending some sort of packet, so
Line 280... Line 278...
                        }
                        }
                }
                }
 
 
                if (TftpBlock == TftpLastBlock) {
                if (TftpBlock == TftpLastBlock) {
                        /*
                        /*
                         *      Same block again; ignore it.
                   *    Same block again; resend ack (maybe got lost last time)
                         */
                         */
 
                  TftpSend ();
                        break;
                        break;
                }
                }
 
                else
 
                  {
                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);
 
                  }
 
 
                /*
                /*
                 *      Acknoledge the block just received, which will prompt
                 *      Acknoledge the block just received, which will prompt
                 *      the server for the next one.
                 *      the server for the next one.
                 */
                 */

powered by: WebSVN 2.1.0

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