#if defined(CONFIG_CMD_NET)
-#define TIMEOUT 5UL /* Seconds before trying BOOTP again */
+#define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
#ifndef CONFIG_NET_RETRY_COUNT
# define TIMEOUT_COUNT 5 /* # of timeouts before giving up */
#else
puts ("\nRetry count exceeded; starting again\n");
NetStartAgain ();
} else {
- NetSetTimeout (TIMEOUT * CFG_HZ, BootpTimeout);
+ NetSetTimeout (TIMEOUT, BootpTimeout);
BootpRequest ();
}
}
bp->bp_htype = HWT_ETHER;
bp->bp_hlen = HWL_ETHER;
bp->bp_hops = 0;
- bp->bp_secs = htons(get_timer(0) / CFG_HZ);
+ bp->bp_secs = htons(get_timer(0) / 1000);
NetWriteIP(&bp->bp_ciaddr, 0);
NetWriteIP(&bp->bp_yiaddr, 0);
NetWriteIP(&bp->bp_siaddr, 0);
/*
* Bootp ID is the lower 4 bytes of our ethernet address
- * plus the current time in HZ.
+ * plus the current time in ms.
*/
BootpID = ((ulong)NetOurEther[2] << 24)
| ((ulong)NetOurEther[3] << 16)
pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + ext_len;
iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + ext_len;
NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
- NetSetTimeout(SELECT_TIMEOUT * CFG_HZ, BootpTimeout);
+ NetSetTimeout(SELECT_TIMEOUT, BootpTimeout);
#if defined(CONFIG_CMD_DHCP)
dhcp_state = SELECTING;
bp->bp_htype = HWT_ETHER;
bp->bp_hlen = HWL_ETHER;
bp->bp_hops = 0;
- bp->bp_secs = htons(get_timer(0) / CFG_HZ);
+ bp->bp_secs = htons(get_timer(0) / 1000);
/* Do not set the client IP, your IP, or server IP yet, since it hasn't been ACK'ed by
* the server yet */
if (NetReadLong((ulong*)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
DhcpOptionsProcess((u8 *)&bp->bp_vend[4], bp);
- NetSetTimeout(TIMEOUT * CFG_HZ, BootpTimeout);
+ NetSetTimeout(TIMEOUT, BootpTimeout);
DhcpSendRequestPkt(bp);
#ifdef CFG_BOOTFILE_PREFIX
}
#define DHCP_NAK 6
#define DHCP_RELEASE 7
-#define SELECT_TIMEOUT 3UL /* Seconds to wait for offers */
+#define SELECT_TIMEOUT 3000UL /* Milliseconds to wait for offers */
/**********************************************************************/
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_ARP_TIMEOUT
-# define ARP_TIMEOUT 50UL /* Deciseconds before trying ARP again */
-#elif (CONFIG_ARP_TIMEOUT < 100)
-# error "Due to possible overflow CONFIG_ARP_TIMEOUT must be greater than 100ms"
+# define ARP_TIMEOUT 5000UL /* Milliseconds before trying ARP again */
#else
-# if (CONFIG_ARP_TIMEOUT % 100)
-# warning "Supported ARP_TIMEOUT precision is 100ms"
-# endif
-# define ARP_TIMEOUT (CONFIG_ARP_TIMEOUT / 100)
+# define ARP_TIMEOUT CONFIG_ARP_TIMEOUT
#endif
t = get_timer(0);
/* check for arp timeout */
- if ((t - NetArpWaitTimerStart) > ARP_TIMEOUT * CFG_HZ / 10) {
+ if ((t - NetArpWaitTimerStart) > ARP_TIMEOUT) {
NetArpWaitTry++;
if (NetArpWaitTry >= ARP_TIMEOUT_COUNT) {
return;
}
#ifndef CONFIG_NET_MULTI
- NetSetTimeout (10UL * CFG_HZ, startAgainTimeout);
+ NetSetTimeout (10000UL, startAgainTimeout);
NetSetHandler (startAgainHandler);
#else /* !CONFIG_NET_MULTI*/
eth_halt ();
if (NetRestartWrap) {
NetRestartWrap = 0;
if (NetDevExists && !once) {
- NetSetTimeout (10UL * CFG_HZ, startAgainTimeout);
+ NetSetTimeout (10000UL, startAgainTimeout);
NetSetHandler (startAgainHandler);
} else {
NetState = NETLOOP_FAIL;
#if defined(CONFIG_NET_MULTI)
printf ("Using %s device\n", eth_get_name());
#endif /* CONFIG_NET_MULTI */
- NetSetTimeout (10UL * CFG_HZ, PingTimeout);
+ NetSetTimeout (10000UL, PingTimeout);
NetSetHandler (PingHandler);
PingSend();
#define CDP_SYSOBJECT_TLV 0x0015
#define CDP_MANAGEMENT_ADDRESS_TLV 0x0016
-#define CDP_TIMEOUT (CFG_HZ/4) /* one packet every 250ms */
+#define CDP_TIMEOUT 250UL /* one packet every 250ms */
static int CDPSeq;
static int CDPOK;
#define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
#define NFS_RETRY_COUNT 30
-#define NFS_TIMEOUT 2UL
+#define NFS_TIMEOUT 2000UL
static int fs_mounted = 0;
static unsigned long rpc_id = 0;
case STATE_READ_REQ:
rlen = nfs_read_reply (pkt, len);
- NetSetTimeout (NFS_TIMEOUT * CFG_HZ, NfsTimeout);
+ NetSetTimeout (NFS_TIMEOUT, NfsTimeout);
if (rlen > 0) {
nfs_offset += rlen;
NfsSend ();
printf ("\nLoad address: 0x%lx\n"
"Loading: *\b", load_addr);
- NetSetTimeout (NFS_TIMEOUT * CFG_HZ, NfsTimeout);
+ NetSetTimeout (NFS_TIMEOUT, NfsTimeout);
NetSetHandler (NfsHandler);
NfsTimeoutCount = 0;
#if defined(CONFIG_CMD_NET)
-#define TIMEOUT 5UL /* Seconds before trying BOOTP again */
+#define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
#ifndef CONFIG_NET_RETRY_COUNT
# define TIMEOUT_COUNT 5 /* # of timeouts before giving up */
#else
puts ("\nRetry count exceeded; starting again\n");
NetStartAgain ();
} else {
- NetSetTimeout (TIMEOUT * CFG_HZ, RarpTimeout);
+ NetSetTimeout (TIMEOUT, RarpTimeout);
RarpRequest ();
}
}
NetSendPacket(NetTxPacket, (pkt - NetTxPacket) + ARP_HDR_SIZE);
- NetSetTimeout(TIMEOUT * CFG_HZ, RarpTimeout);
+ NetSetTimeout(TIMEOUT, RarpTimeout);
NetSetHandler(RarpHandler);
}
#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_SNTP)
-#define SNTP_TIMEOUT 10
+#define SNTP_TIMEOUT 10000UL
static int SntpOurPort;
{
debug ("%s\n", __FUNCTION__);
- NetSetTimeout (SNTP_TIMEOUT * CFG_HZ, SntpTimeout);
+ NetSetTimeout (SNTP_TIMEOUT, SntpTimeout);
NetSetHandler(SntpHandler);
memset (NetServerEther, 0, 6);
#if defined(CONFIG_CMD_NET)
#define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
-#define TIMEOUT 5UL /* Seconds to timeout for a lost pkt */
+#define TIMEOUT 5000UL /* Millisecs to timeout for lost pkt */
#ifndef CONFIG_NET_RETRY_COUNT
# define TIMEOUT_COUNT 10 /* # of timeouts before giving up */
#else
pkt += 5 /*strlen("octet")*/ + 1;
strcpy ((char *)pkt, "timeout");
pkt += 7 /*strlen("timeout")*/ + 1;
- sprintf((char *)pkt, "%lu", TIMEOUT);
+ sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
#ifdef ET_DEBUG
printf("send option \"timeout %s\"\n", (char *)pkt);
#endif
}
TftpLastBlock = TftpBlock;
- NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
+ NetSetTimeout (TIMEOUT, TftpTimeout);
store_block (TftpBlock - 1, pkt + 2, len);
NetStartAgain ();
} else {
puts ("T ");
- NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
+ NetSetTimeout (TIMEOUT, TftpTimeout);
TftpSend ();
}
}
puts ("Loading: *\b");
- NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
+ NetSetTimeout (TIMEOUT, TftpTimeout);
NetSetHandler (TftpHandler);
TftpServerPort = WELL_KNOWN_PORT;