From: amessier.tyco at gmail.com Date: Fri, 22 Jan 2016 14:18:27 -0500 Subject: [U-Boot] [PATCH] net: tftp: Add TFTP specific config for retry count Message-ID: <1453490307-15209-1-git-send-email-amessier.tyco@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Alexandre Messier There is currently one config option (CONFIG_NET_RETRY_COUNT) that is available to tune the retries of the network stack. Unfortunately, it is global to all protocols, and the value is interpreted differently in all of them. Add a new config option that sets directly the number of retries specifically for TFTP. Signed-off-by: Alexandre Messier --- README | 5 +++++ net/tftp.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/README b/README index ece4793..9d53c2e 100644 --- a/README +++ b/README @@ -2845,6 +2845,11 @@ CBFS (Coreboot Filesystem) support before giving up the operation. If not defined, a default value of 5 is used. + CONFIG_NET_RETRY_COUNT_TFTP + + Override CONFIG_NET_RETRY_COUNT for TFTP. If not defined, + falls back to CONFIG_NET_RETRY_COUNT. + CONFIG_ARP_TIMEOUT Timeout waiting for an ARP reply in milliseconds. diff --git a/net/tftp.c b/net/tftp.c index f2889fe..884cfaa 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -20,12 +20,16 @@ #define WELL_KNOWN_PORT 69 /* Millisecs to timeout for lost pkt */ #define TIMEOUT 5000UL +#ifndef CONFIG_NET_RETRY_COUNT_TFTP #ifndef CONFIG_NET_RETRY_COUNT /* # of timeouts before giving up */ # define TIMEOUT_COUNT 10 #else # define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT * 2) #endif +#else +# define TIMEOUT_COUNT CONFIG_NET_RETRY_COUNT_TFTP +#endif /* Number of "loading" hashes per line (for checking the image size) */ #define HASHES_PER_LINE 65 -- 2.7.0