Show
Ignore:
Timestamp:
06/24/09 22:02:36 (5 months ago)
Author:
BrainSlayer
Message:

support for senao firmware format

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ar5315_microredboot/microredboot/ecos/packages/redboot/current/src/net/tftp_server.c

    r12368 r12370  
    156156        /* do_flash = 1, write to flash */ 
    157157        rc = fw_check_image_wili((char *)base_addr, len, 1); 
     158 
     159        memset((unsigned char *)base_addr, 0, len); 
     160        flashresult(rc); 
     161} 
     162 
     163void do_flash_update_senao(unsigned long base_addr, unsigned long len) 
     164{ 
     165        int rc; 
     166        pagesetup(); 
     167        /* do_flash = 1, write to flash */ 
     168        rc = fw_check_image_senao((char *)base_addr, len, 1); 
    158169 
    159170        memset((unsigned char *)base_addr, 0, len); 
     
    257268                        int isubnt = 0; 
    258269                        int iswili = 0; 
     270                        int issenao = 0; 
    259271                        isddwrt = fw_check_image_ddwrt((char *)BASE_ADDR, 
    260272                                                       ptr - BASE_ADDR, 0) == 0; 
     
    271283                                                        0) == 0; 
    272284 
    273                         if (isddwrt || isubnt || iswili)        /* third parameter 0 - do not write to flash */ 
     285                        if (!isubnt && !isddwrt && !iswili) 
     286                                issenao = 
     287                                    fw_check_image_senao((char *)BASE_ADDR, 
     288                                                        ptr - BASE_ADDR, 
     289                                                        0) == 0; 
     290 
     291                        if (isddwrt || isubnt || iswili || issenao)     /* third parameter 0 - do not write to flash */ 
    274292                                tftpd_send(ACK, block, src_route, src_port);    // crc ok 
    275293                        else { 
     
    296314                                    ("WILIGEAR firmware format detected\n"); 
    297315                                do_flash_update_wili(BASE_ADDR, 
     316                                                     ptr - BASE_ADDR); 
     317                        } 
     318                        if (issenao) { 
     319                                diag_printf 
     320                                    ("SENAO firmware format detected\n"); 
     321                                do_flash_update_senao(BASE_ADDR, 
    298322                                                     ptr - BASE_ADDR); 
    299323                        }