Changeset 12407
- Timestamp:
- 06/30/2009 12:16:23 AM (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ar5315_microredboot/microredboot/ecos/packages/redboot/current/src/net/tftp_client.c
r12388 r12407 223 223 if (ntohs(hdr->th_opcode) == DATA) { 224 224 if (ntohs(hdr->th_block) == 225 (cyg_uint16) ((tftp_stream. 226 last_good_block + 227 1) & 0xFFFF)) { 225 (cyg_uint16) ((tftp_stream.last_good_block + 1) & 0xFFFF)) { 228 226 // Consume this data 229 227 data_len -= 4; /* Sizeof TFTP header */ ar5315_microredboot/microredboot/ecos/packages/redboot/current/src/net/tftp_server.c
r12388 r12407 233 233 diag_printf("Checking uploaded file...\n"); 234 234 235 int detect = 0;235 int detect = -1; 236 236 int i; 237 237 for (i = 0; … … 239 239 sizeof(fw_formats) / 240 240 sizeof(struct firmware_formats); i++) { 241 int v = 242 fw_formats[i].fw_check_image((char *) 243 BASE_ADDR, 244 ptr - 245 BASE_ADDR, 246 0) == 0; 247 if (v) { 241 int v = fw_formats[i].fw_check_image((char *)BASE_ADDR,ptr - BASE_ADDR,0); 242 // diag_printf("%s returns %d\n",fw_formats[i].name,v); 243 if (!v) { 248 244 detect = i; 249 245 break; … … 251 247 } 252 248 253 if (detect ) /* third parameter 0 - do not write to flash */249 if (detect!=-1) /* third parameter 0 - do not write to flash */ 254 250 tftpd_send(ACK, block, src_route, src_port); // crc ok 255 251 else {
