mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-08 16:26:58 +02:00
net: cosmetic: Fixup var names related to boot file
The variables around the bootfile were inconsistent and used CamelCase. Update them to make the code more readable. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
049a95a775
commit
1411157d85
@ -201,11 +201,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
|
|||||||
if (end == (argv[1] + strlen(argv[1])))
|
if (end == (argv[1] + strlen(argv[1])))
|
||||||
load_addr = addr;
|
load_addr = addr;
|
||||||
else
|
else
|
||||||
copy_filename(BootFile, argv[1], sizeof(BootFile));
|
copy_filename(net_boot_file_name, argv[1],
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: load_addr = simple_strtoul(argv[1], NULL, 16);
|
case 3: load_addr = simple_strtoul(argv[1], NULL, 16);
|
||||||
copy_filename(BootFile, argv[2], sizeof(BootFile));
|
copy_filename(net_boot_file_name, argv[2],
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -216,7 +218,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
|
|||||||
printf("Invalid address/size\n");
|
printf("Invalid address/size\n");
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
copy_filename(BootFile, argv[3], sizeof(BootFile));
|
copy_filename(net_boot_file_name, argv[3],
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
@ -1568,7 +1568,7 @@ do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
|
|
||||||
destroy_pxe_menu(cfg);
|
destroy_pxe_menu(cfg);
|
||||||
|
|
||||||
copy_filename(BootFile, "", sizeof(BootFile));
|
copy_filename(net_boot_file_name, "", sizeof(net_boot_file_name));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
|
|||||||
saved_timeout_msecs = TftpRRQTimeoutMSecs;
|
saved_timeout_msecs = TftpRRQTimeoutMSecs;
|
||||||
saved_timeout_count = TftpRRQTimeoutCountMax;
|
saved_timeout_count = TftpRRQTimeoutCountMax;
|
||||||
saved_netretry = strdup(getenv("netretry"));
|
saved_netretry = strdup(getenv("netretry"));
|
||||||
saved_bootfile = strdup(BootFile);
|
saved_bootfile = strdup(net_boot_file_name);
|
||||||
|
|
||||||
/* set timeouts for auto-update */
|
/* set timeouts for auto-update */
|
||||||
TftpRRQTimeoutMSecs = msec_max;
|
TftpRRQTimeoutMSecs = msec_max;
|
||||||
@ -69,7 +69,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
|
|||||||
|
|
||||||
/* download the update file */
|
/* download the update file */
|
||||||
load_addr = addr;
|
load_addr = addr;
|
||||||
copy_filename(BootFile, filename, sizeof(BootFile));
|
copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name));
|
||||||
size = NetLoop(TFTPGET);
|
size = NetLoop(TFTPGET);
|
||||||
|
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
@ -86,7 +86,8 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
|
|||||||
free(saved_netretry);
|
free(saved_netretry);
|
||||||
|
|
||||||
if (saved_bootfile != NULL) {
|
if (saved_bootfile != NULL) {
|
||||||
copy_filename(BootFile, saved_bootfile, sizeof(BootFile));
|
copy_filename(net_boot_file_name, saved_bootfile,
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
free(saved_bootfile);
|
free(saved_bootfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,9 +476,7 @@ extern struct in_addr net_dns_server2;
|
|||||||
extern char NetOurNISDomain[32]; /* Our NIS domain */
|
extern char NetOurNISDomain[32]; /* Our NIS domain */
|
||||||
extern char NetOurHostName[32]; /* Our hostname */
|
extern char NetOurHostName[32]; /* Our hostname */
|
||||||
extern char NetOurRootPath[64]; /* Our root path */
|
extern char NetOurRootPath[64]; /* Our root path */
|
||||||
extern ushort NetBootFileSize; /* Our boot file size in blocks */
|
|
||||||
/** END OF BOOTP EXTENTIONS **/
|
/** END OF BOOTP EXTENTIONS **/
|
||||||
extern ulong NetBootFileXferSize; /* size of bootfile in bytes */
|
|
||||||
extern uchar NetOurEther[6]; /* Our ethernet address */
|
extern uchar NetOurEther[6]; /* Our ethernet address */
|
||||||
extern uchar NetServerEther[6]; /* Boot server enet address */
|
extern uchar NetServerEther[6]; /* Boot server enet address */
|
||||||
extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */
|
extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */
|
||||||
@ -507,8 +505,11 @@ enum proto_t {
|
|||||||
TFTPSRV, TFTPPUT, LINKLOCAL
|
TFTPSRV, TFTPPUT, LINKLOCAL
|
||||||
};
|
};
|
||||||
|
|
||||||
/* from net/net.c */
|
extern char net_boot_file_name[128];/* Boot File name */
|
||||||
extern char BootFile[128]; /* Boot File name */
|
/* The actual transferred size of the bootfile (in bytes) */
|
||||||
|
extern u32 net_boot_file_size;
|
||||||
|
/* Boot file size in blocks as reported by the DHCP server */
|
||||||
|
extern u32 net_boot_file_expected_size_in_blocks;
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_DNS)
|
#if defined(CONFIG_CMD_DNS)
|
||||||
extern char *NetDNSResolve; /* The host to resolve */
|
extern char *NetDNSResolve; /* The host to resolve */
|
||||||
|
27
net/bootp.c
27
net/bootp.c
@ -146,16 +146,17 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
|
|||||||
net_copy_ip(&net_server_ip, &bp->bp_siaddr);
|
net_copy_ip(&net_server_ip, &bp->bp_siaddr);
|
||||||
memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
|
memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
|
||||||
if (strlen(bp->bp_file) > 0)
|
if (strlen(bp->bp_file) > 0)
|
||||||
copy_filename(BootFile, bp->bp_file, sizeof(BootFile));
|
copy_filename(net_boot_file_name, bp->bp_file,
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
|
|
||||||
debug("Bootfile: %s\n", BootFile);
|
debug("net_boot_file_name: %s\n", net_boot_file_name);
|
||||||
|
|
||||||
/* Propagate to environment:
|
/* Propagate to environment:
|
||||||
* don't delete exising entry when BOOTP / DHCP reply does
|
* don't delete exising entry when BOOTP / DHCP reply does
|
||||||
* not contain a new value
|
* not contain a new value
|
||||||
*/
|
*/
|
||||||
if (*BootFile)
|
if (*net_boot_file_name)
|
||||||
setenv("bootfile", BootFile);
|
setenv("bootfile", net_boot_file_name);
|
||||||
#endif
|
#endif
|
||||||
net_copy_ip(&net_ip, &bp->bp_yiaddr);
|
net_copy_ip(&net_ip, &bp->bp_yiaddr);
|
||||||
}
|
}
|
||||||
@ -179,7 +180,7 @@ static void BootpVendorFieldProcess(u8 *ext)
|
|||||||
debug("[BOOTP] Processing extension %d... (%d bytes)\n", *ext,
|
debug("[BOOTP] Processing extension %d... (%d bytes)\n", *ext,
|
||||||
*(ext + 1));
|
*(ext + 1));
|
||||||
|
|
||||||
NetBootFileSize = 0;
|
net_boot_file_expected_size_in_blocks = 0;
|
||||||
|
|
||||||
switch (*ext) {
|
switch (*ext) {
|
||||||
/* Fixed length fields */
|
/* Fixed length fields */
|
||||||
@ -228,9 +229,11 @@ static void BootpVendorFieldProcess(u8 *ext)
|
|||||||
break;
|
break;
|
||||||
case 13: /* Boot file size */
|
case 13: /* Boot file size */
|
||||||
if (size == 2)
|
if (size == 2)
|
||||||
NetBootFileSize = ntohs(*(ushort *) (ext + 2));
|
net_boot_file_expected_size_in_blocks =
|
||||||
|
ntohs(*(ushort *)(ext + 2));
|
||||||
else if (size == 4)
|
else if (size == 4)
|
||||||
NetBootFileSize = ntohl(*(ulong *) (ext + 2));
|
net_boot_file_expected_size_in_blocks =
|
||||||
|
ntohl(*(ulong *)(ext + 2));
|
||||||
break;
|
break;
|
||||||
case 14: /* Merit dump file - Not yet supported */
|
case 14: /* Merit dump file - Not yet supported */
|
||||||
break;
|
break;
|
||||||
@ -303,8 +306,9 @@ static void BootpVendorProcess(u8 *ext, int size)
|
|||||||
if (net_gateway.s_addr)
|
if (net_gateway.s_addr)
|
||||||
debug("net_gateway : %pI4", &net_gateway);
|
debug("net_gateway : %pI4", &net_gateway);
|
||||||
|
|
||||||
if (NetBootFileSize)
|
if (net_boot_file_expected_size_in_blocks)
|
||||||
debug("NetBootFileSize : %d\n", NetBootFileSize);
|
debug("net_boot_file_expected_size_in_blocks : %d\n",
|
||||||
|
net_boot_file_expected_size_in_blocks);
|
||||||
|
|
||||||
if (NetOurHostName[0])
|
if (NetOurHostName[0])
|
||||||
debug("NetOurHostName : %s\n", NetOurHostName);
|
debug("NetOurHostName : %s\n", NetOurHostName);
|
||||||
@ -315,9 +319,6 @@ static void BootpVendorProcess(u8 *ext, int size)
|
|||||||
if (NetOurNISDomain[0])
|
if (NetOurNISDomain[0])
|
||||||
debug("NetOurNISDomain : %s\n", NetOurNISDomain);
|
debug("NetOurNISDomain : %s\n", NetOurNISDomain);
|
||||||
|
|
||||||
if (NetBootFileSize)
|
|
||||||
debug("NetBootFileSize: %d\n", NetBootFileSize);
|
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
||||||
if (net_ntp_server)
|
if (net_ntp_server)
|
||||||
debug("net_ntp_server : %pI4\n", &net_ntp_server);
|
debug("net_ntp_server : %pI4\n", &net_ntp_server);
|
||||||
@ -716,7 +717,7 @@ BootpRequest(void)
|
|||||||
net_write_ip(&bp->bp_siaddr, zero_ip);
|
net_write_ip(&bp->bp_siaddr, zero_ip);
|
||||||
net_write_ip(&bp->bp_giaddr, zero_ip);
|
net_write_ip(&bp->bp_giaddr, zero_ip);
|
||||||
memcpy(bp->bp_chaddr, NetOurEther, 6);
|
memcpy(bp->bp_chaddr, NetOurEther, 6);
|
||||||
copy_filename(bp->bp_file, BootFile, sizeof(bp->bp_file));
|
copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file));
|
||||||
|
|
||||||
/* Request additional information from the BOOTP/DHCP server */
|
/* Request additional information from the BOOTP/DHCP server */
|
||||||
#if defined(CONFIG_CMD_DHCP)
|
#if defined(CONFIG_CMD_DHCP)
|
||||||
|
@ -60,7 +60,6 @@ struct Bootp_t {
|
|||||||
|
|
||||||
/* bootp.c */
|
/* bootp.c */
|
||||||
extern ulong BootpID; /* ID of cur BOOTP request */
|
extern ulong BootpID; /* ID of cur BOOTP request */
|
||||||
extern char BootFile[128]; /* Boot file name */
|
|
||||||
extern int BootpTry;
|
extern int BootpTry;
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ static void eth_env_init(void)
|
|||||||
|
|
||||||
s = getenv("bootfile");
|
s = getenv("bootfile");
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
copy_filename(BootFile, s, sizeof(BootFile));
|
copy_filename(net_boot_file_name, s,
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int eth_mac_skip(int index)
|
static int eth_mac_skip(int index)
|
||||||
|
26
net/net.c
26
net/net.c
@ -127,8 +127,6 @@ char NetOurNISDomain[32] = {0,};
|
|||||||
char NetOurHostName[32] = {0,};
|
char NetOurHostName[32] = {0,};
|
||||||
/* Our bootpath */
|
/* Our bootpath */
|
||||||
char NetOurRootPath[64] = {0,};
|
char NetOurRootPath[64] = {0,};
|
||||||
/* Our bootfile size in blocks */
|
|
||||||
ushort NetBootFileSize;
|
|
||||||
|
|
||||||
#ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */
|
#ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */
|
||||||
struct in_addr net_mcast_addr;
|
struct in_addr net_mcast_addr;
|
||||||
@ -136,8 +134,6 @@ struct in_addr net_mcast_addr;
|
|||||||
|
|
||||||
/** END OF BOOTP EXTENTIONS **/
|
/** END OF BOOTP EXTENTIONS **/
|
||||||
|
|
||||||
/* The actual transferred size of the bootfile (in bytes) */
|
|
||||||
ulong NetBootFileXferSize;
|
|
||||||
/* Our ethernet address */
|
/* Our ethernet address */
|
||||||
uchar NetOurEther[6];
|
uchar NetOurEther[6];
|
||||||
/* Boot server enet address */
|
/* Boot server enet address */
|
||||||
@ -174,7 +170,11 @@ ushort NetOurVLAN = 0xFFFF;
|
|||||||
ushort NetOurNativeVLAN = 0xFFFF;
|
ushort NetOurNativeVLAN = 0xFFFF;
|
||||||
|
|
||||||
/* Boot File name */
|
/* Boot File name */
|
||||||
char BootFile[128];
|
char net_boot_file_name[128];
|
||||||
|
/* The actual transferred size of the bootfile (in bytes) */
|
||||||
|
u32 net_boot_file_size;
|
||||||
|
/* Boot file size in blocks as reported by the DHCP server */
|
||||||
|
u32 net_boot_file_expected_size_in_blocks;
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_SNTP)
|
#if defined(CONFIG_CMD_SNTP)
|
||||||
/* NTP server IP address */
|
/* NTP server IP address */
|
||||||
@ -222,7 +222,8 @@ static int on_bootfile(const char *name, const char *value, enum env_op op,
|
|||||||
switch (op) {
|
switch (op) {
|
||||||
case env_op_create:
|
case env_op_create:
|
||||||
case env_op_overwrite:
|
case env_op_overwrite:
|
||||||
copy_filename(BootFile, value, sizeof(BootFile));
|
copy_filename(net_boot_file_name, value,
|
||||||
|
sizeof(net_boot_file_name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -380,7 +381,7 @@ restart:
|
|||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
NetDevExists = 1;
|
NetDevExists = 1;
|
||||||
NetBootFileXferSize = 0;
|
net_boot_file_size = 0;
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
case TFTPGET:
|
case TFTPGET:
|
||||||
#ifdef CONFIG_CMD_TFTPPUT
|
#ifdef CONFIG_CMD_TFTPPUT
|
||||||
@ -551,11 +552,10 @@ restart:
|
|||||||
|
|
||||||
case NETLOOP_SUCCESS:
|
case NETLOOP_SUCCESS:
|
||||||
net_cleanup_loop();
|
net_cleanup_loop();
|
||||||
if (NetBootFileXferSize > 0) {
|
if (net_boot_file_size > 0) {
|
||||||
printf("Bytes transferred = %ld (%lx hex)\n",
|
printf("Bytes transferred = %d (%x hex)\n",
|
||||||
NetBootFileXferSize,
|
net_boot_file_size, net_boot_file_size);
|
||||||
NetBootFileXferSize);
|
setenv_hex("filesize", net_boot_file_size);
|
||||||
setenv_hex("filesize", NetBootFileXferSize);
|
|
||||||
setenv_hex("fileaddr", load_addr);
|
setenv_hex("fileaddr", load_addr);
|
||||||
}
|
}
|
||||||
if (protocol != NETCONS)
|
if (protocol != NETCONS)
|
||||||
@ -565,7 +565,7 @@ restart:
|
|||||||
|
|
||||||
eth_set_last_protocol(protocol);
|
eth_set_last_protocol(protocol);
|
||||||
|
|
||||||
ret = NetBootFileXferSize;
|
ret = net_boot_file_size;
|
||||||
debug_cond(DEBUG_INT_STATE, "--- NetLoop Success!\n");
|
debug_cond(DEBUG_INT_STATE, "--- NetLoop Success!\n");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
19
net/nfs.c
19
net/nfs.c
@ -100,8 +100,8 @@ store_block(uchar *src, unsigned offset, unsigned len)
|
|||||||
unmap_sysmem(ptr);
|
unmap_sysmem(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetBootFileXferSize < (offset+len))
|
if (net_boot_file_size < (offset + len))
|
||||||
NetBootFileXferSize = newsize;
|
net_boot_file_size = newsize;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,7 +724,7 @@ NfsStart(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BootFile[0] == '\0') {
|
if (net_boot_file_name[0] == '\0') {
|
||||||
sprintf(default_filename, "/nfsroot/%02X%02X%02X%02X.img",
|
sprintf(default_filename, "/nfsroot/%02X%02X%02X%02X.img",
|
||||||
net_ip.s_addr & 0xFF,
|
net_ip.s_addr & 0xFF,
|
||||||
(net_ip.s_addr >> 8) & 0xFF,
|
(net_ip.s_addr >> 8) & 0xFF,
|
||||||
@ -735,16 +735,16 @@ NfsStart(void)
|
|||||||
printf("*** Warning: no boot file name; using '%s'\n",
|
printf("*** Warning: no boot file name; using '%s'\n",
|
||||||
nfs_path);
|
nfs_path);
|
||||||
} else {
|
} else {
|
||||||
char *p = BootFile;
|
char *p = net_boot_file_name;
|
||||||
|
|
||||||
p = strchr(p, ':');
|
p = strchr(p, ':');
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
nfs_server_ip = string_to_ip(BootFile);
|
nfs_server_ip = string_to_ip(net_boot_file_name);
|
||||||
++p;
|
++p;
|
||||||
strcpy(nfs_path, p);
|
strcpy(nfs_path, p);
|
||||||
} else {
|
} else {
|
||||||
strcpy(nfs_path, BootFile);
|
strcpy(nfs_path, net_boot_file_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,9 +769,10 @@ NfsStart(void)
|
|||||||
}
|
}
|
||||||
printf("\nFilename '%s/%s'.", nfs_path, nfs_filename);
|
printf("\nFilename '%s/%s'.", nfs_path, nfs_filename);
|
||||||
|
|
||||||
if (NetBootFileSize) {
|
if (net_boot_file_expected_size_in_blocks) {
|
||||||
printf(" Size is 0x%x Bytes = ", NetBootFileSize<<9);
|
printf(" Size is 0x%x Bytes = ",
|
||||||
print_size(NetBootFileSize<<9, "");
|
net_boot_file_expected_size_in_blocks << 9);
|
||||||
|
print_size(net_boot_file_expected_size_in_blocks << 9, "");
|
||||||
}
|
}
|
||||||
printf("\nLoad address: 0x%lx\n"
|
printf("\nLoad address: 0x%lx\n"
|
||||||
"Loading: *\b", load_addr);
|
"Loading: *\b", load_addr);
|
||||||
|
29
net/tftp.c
29
net/tftp.c
@ -197,8 +197,8 @@ store_block(int block, uchar *src, unsigned len)
|
|||||||
ext2_set_bit(block, Bitmap);
|
ext2_set_bit(block, Bitmap);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (NetBootFileXferSize < newsize)
|
if (net_boot_file_size < newsize)
|
||||||
NetBootFileXferSize = newsize;
|
net_boot_file_size = newsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear our state ready for a new transfer */
|
/* Clear our state ready for a new transfer */
|
||||||
@ -227,7 +227,7 @@ static int load_block(unsigned block, uchar *dst, unsigned len)
|
|||||||
ulong offset = ((int)block - 1) * len + TftpBlockWrapOffset;
|
ulong offset = ((int)block - 1) * len + TftpBlockWrapOffset;
|
||||||
ulong tosend = len;
|
ulong tosend = len;
|
||||||
|
|
||||||
tosend = min(NetBootFileXferSize - offset, tosend);
|
tosend = min(net_boot_file_size - offset, tosend);
|
||||||
(void)memcpy(dst, (void *)(save_addr + offset), tosend);
|
(void)memcpy(dst, (void *)(save_addr + offset), tosend);
|
||||||
debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__,
|
debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__,
|
||||||
block, offset, len, tosend);
|
block, offset, len, tosend);
|
||||||
@ -311,7 +311,7 @@ static void tftp_complete(void)
|
|||||||
time_start = get_timer(time_start);
|
time_start = get_timer(time_start);
|
||||||
if (time_start > 0) {
|
if (time_start > 0) {
|
||||||
puts("\n\t "); /* Line up with "Loading: " */
|
puts("\n\t "); /* Line up with "Loading: " */
|
||||||
print_size(NetBootFileXferSize /
|
print_size(net_boot_file_size /
|
||||||
time_start * 1000, "/s");
|
time_start * 1000, "/s");
|
||||||
}
|
}
|
||||||
puts("\ndone\n");
|
puts("\ndone\n");
|
||||||
@ -361,8 +361,8 @@ TftpSend(void)
|
|||||||
debug("send option \"timeout %s\"\n", (char *)pkt);
|
debug("send option \"timeout %s\"\n", (char *)pkt);
|
||||||
pkt += strlen((char *)pkt) + 1;
|
pkt += strlen((char *)pkt) + 1;
|
||||||
#ifdef CONFIG_TFTP_TSIZE
|
#ifdef CONFIG_TFTP_TSIZE
|
||||||
pkt += sprintf((char *)pkt, "tsize%c%lu%c",
|
pkt += sprintf((char *)pkt, "tsize%c%u%c",
|
||||||
0, NetBootFileXferSize, 0);
|
0, net_boot_file_size, 0);
|
||||||
#endif
|
#endif
|
||||||
/* try for more effic. blk size */
|
/* try for more effic. blk size */
|
||||||
pkt += sprintf((char *)pkt, "blksize%c%d%c",
|
pkt += sprintf((char *)pkt, "blksize%c%d%c",
|
||||||
@ -720,7 +720,7 @@ void TftpStart(enum proto_t protocol)
|
|||||||
TftpBlkSizeOption, TftpTimeoutMSecs);
|
TftpBlkSizeOption, TftpTimeoutMSecs);
|
||||||
|
|
||||||
tftp_remote_ip = net_server_ip;
|
tftp_remote_ip = net_server_ip;
|
||||||
if (BootFile[0] == '\0') {
|
if (net_boot_file_name[0] == '\0') {
|
||||||
sprintf(default_filename, "%02X%02X%02X%02X.img",
|
sprintf(default_filename, "%02X%02X%02X%02X.img",
|
||||||
net_ip.s_addr & 0xFF,
|
net_ip.s_addr & 0xFF,
|
||||||
(net_ip.s_addr >> 8) & 0xFF,
|
(net_ip.s_addr >> 8) & 0xFF,
|
||||||
@ -733,13 +733,13 @@ void TftpStart(enum proto_t protocol)
|
|||||||
printf("*** Warning: no boot file name; using '%s'\n",
|
printf("*** Warning: no boot file name; using '%s'\n",
|
||||||
tftp_filename);
|
tftp_filename);
|
||||||
} else {
|
} else {
|
||||||
char *p = strchr(BootFile, ':');
|
char *p = strchr(net_boot_file_name, ':');
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
strncpy(tftp_filename, BootFile, MAX_LEN);
|
strncpy(tftp_filename, net_boot_file_name, MAX_LEN);
|
||||||
tftp_filename[MAX_LEN-1] = 0;
|
tftp_filename[MAX_LEN-1] = 0;
|
||||||
} else {
|
} else {
|
||||||
tftp_remote_ip = string_to_ip(BootFile);
|
tftp_remote_ip = string_to_ip(net_boot_file_name);
|
||||||
strncpy(tftp_filename, p + 1, MAX_LEN);
|
strncpy(tftp_filename, p + 1, MAX_LEN);
|
||||||
tftp_filename[MAX_LEN-1] = 0;
|
tftp_filename[MAX_LEN-1] = 0;
|
||||||
}
|
}
|
||||||
@ -768,9 +768,10 @@ void TftpStart(enum proto_t protocol)
|
|||||||
|
|
||||||
printf("Filename '%s'.", tftp_filename);
|
printf("Filename '%s'.", tftp_filename);
|
||||||
|
|
||||||
if (NetBootFileSize) {
|
if (net_boot_file_expected_size_in_blocks) {
|
||||||
printf(" Size is 0x%x Bytes = ", NetBootFileSize<<9);
|
printf(" Size is 0x%x Bytes = ",
|
||||||
print_size(NetBootFileSize<<9, "");
|
net_boot_file_expected_size_in_blocks << 9);
|
||||||
|
print_size(net_boot_file_expected_size_in_blocks << 9, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
putc('\n');
|
putc('\n');
|
||||||
@ -779,7 +780,7 @@ void TftpStart(enum proto_t protocol)
|
|||||||
if (TftpWriting) {
|
if (TftpWriting) {
|
||||||
printf("Save address: 0x%lx\n", save_addr);
|
printf("Save address: 0x%lx\n", save_addr);
|
||||||
printf("Save size: 0x%lx\n", save_size);
|
printf("Save size: 0x%lx\n", save_size);
|
||||||
NetBootFileXferSize = save_size;
|
net_boot_file_size = save_size;
|
||||||
puts("Saving: *\b");
|
puts("Saving: *\b");
|
||||||
TftpState = STATE_SEND_WRQ;
|
TftpState = STATE_SEND_WRQ;
|
||||||
new_transfer();
|
new_transfer();
|
||||||
|
Loading…
Reference in New Issue
Block a user