if (tftp_tsize) {
ulong pos = tftp_cur_block * tftp_block_size +
tftp_block_wrap_offset;
+ if (pos > tftp_tsize)
+ pos = tftp_tsize;
while (tftp_tsize_num_hash < pos * 50 / tftp_tsize) {
putc('#');
#ifdef CONFIG_MCAST_TFTP
mcast_cleanup();
#endif
- NetStartAgain();
+ net_start_again();
}
/*
printf("First block is not block 1 (%ld)\n",
tftp_cur_block);
puts("Starting again\n\n");
- NetStartAgain();
+ net_start_again();
break;
}
}
tftp_prev_block = tftp_cur_block;
timeout_count_max = TIMEOUT_COUNT;
- NetSetTimeout(timeout_ms, tftp_timeout_handler);
+ net_set_timeout_handler(timeout_ms, tftp_timeout_handler);
store_block(tftp_cur_block - 1, pkt + 2, len);
/* try to double it and retry */
tftp_mcast_bitmap_size <<= 1;
mcast_cleanup();
- NetStartAgain();
+ net_start_again();
return;
}
tftp_prev_block = tftp_cur_block;
#ifdef CONFIG_MCAST_TFTP
mcast_cleanup();
#endif
- NetStartAgain();
+ net_start_again();
break;
}
break;
restart("Retry count exceeded");
} else {
puts("T ");
- NetSetTimeout(timeout_ms, tftp_timeout_handler);
+ net_set_timeout_handler(timeout_ms, tftp_timeout_handler);
if (tftp_state != STATE_RECV_WRQ)
tftp_send();
}
time_start = get_timer(0);
timeout_count_max = tftp_timeout_count_max;
- NetSetTimeout(timeout_ms, tftp_timeout_handler);
+ net_set_timeout_handler(timeout_ms, tftp_timeout_handler);
net_set_udp_handler(tftp_handler);
#ifdef CONFIG_CMD_TFTPPUT
net_set_icmp_handler(icmp_handler);
timeout_count_max = TIMEOUT_COUNT;
timeout_count = 0;
timeout_ms = TIMEOUT;
- NetSetTimeout(timeout_ms, tftp_timeout_handler);
+ net_set_timeout_handler(timeout_ms, tftp_timeout_handler);
/* Revert tftp_block_size to dflt */
tftp_block_size = TFTP_BLOCK_SIZE;
printf("Fail to set mcast, revert to TFTP\n");
tftp_mcast_disabled = 1;
mcast_cleanup();
- NetStartAgain();
+ net_start_again();
}
}
tftp_mcast_master_client = simple_strtoul((char *)mc, NULL, 10);