summaryrefslogtreecommitdiff
path: root/net/tcp.c
diff options
context:
space:
mode:
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>2024-12-28 13:46:36 +0300
committerTom Rini <trini@konsulko.com>2024-12-28 11:59:42 -0600
commit0eff9208261e7526108243fa7441bb07a9203eb1 (patch)
tree0c66a47437e481867ce82000b109eafbd9ee2463 /net/tcp.c
parent3a44b8ba942ba1eabdcae8c45ba699952004aeed (diff)
net/tcp: define a fallback value for rcv_wnd size
Some driver implements it's own network packet pool, so PKTBUFSRX is zero. This results in zero-size TCP receive window, so data transfer doesn't work. Avoid it by setting a reasonable fallback value. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/tcp.c')
-rw-r--r--net/tcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/tcp.c b/net/tcp.c
index 2600f74b265..2635727f47d 100644
--- a/net/tcp.c
+++ b/net/tcp.c
@@ -36,7 +36,11 @@
#define TCP_SEND_RETRY 3
#define TCP_SEND_TIMEOUT 2000UL
#define TCP_RX_INACTIVE_TIMEOUT 30000UL
-#define TCP_RCV_WND_SIZE (PKTBUFSRX * TCP_MSS)
+#if PKTBUFSRX != 0
+ #define TCP_RCV_WND_SIZE (PKTBUFSRX * TCP_MSS)
+#else
+ #define TCP_RCV_WND_SIZE (4 * TCP_MSS)
+#endif
#define TCP_PACKET_OK 0
#define TCP_PACKET_DROP 1