WND_SCALE: duplicate define check & doc cleanup

This commit cleans up a duplicate #if check for LWIP_WND_SCALE in init.c
which was already under #if LWIP_WND_SCALE

This commit also improves documentation for TCP_WND in the window scaling
case to communicate TCP_WND is always the calculated (scaled) window value,
not the value reported in the TCP header

Our developers were confused by having to set both the window and scaling
factor and only after studying the usage of TCP_WND throughout the code, was
it determined to be the calculated (scaled) window
This commit is contained in:
Joel Cunningham 2016-11-11 15:59:03 -06:00
parent f965034366
commit 6dc3a2108a
2 changed files with 5 additions and 2 deletions

View File

@ -141,7 +141,7 @@ PACK_STRUCT_END
#if (LWIP_TCP && (TCP_WND > 0xffffffff))
#error "If you want to use TCP, TCP_WND must fit in an u32_t, so, you have to reduce it in your lwipopts.h"
#endif
#if (LWIP_TCP && LWIP_WND_SCALE && (TCP_RCV_SCALE > 14))
#if (LWIP_TCP && (TCP_RCV_SCALE > 14))
#error "The maximum valid window scale value is 14!"
#endif
#if (LWIP_TCP && (TCP_WND > (0xFFFFU << TCP_RCV_SCALE)))

View File

@ -1128,7 +1128,10 @@
/**
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
* (2 * TCP_MSS) for things to work well.
* ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size
* with scaling applied. Maximum window value in the TCP header
* will be TCP_WND >> TCP_RCV_SCALE
*/
#if !defined TCP_WND || defined __DOXYGEN__
#define TCP_WND (4 * TCP_MSS)