diff --git a/arch b/arch index 5336c646386..3077bd096b7 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 5336c646386607424e3426fb488d73241abb5f08 +Subproject commit 3077bd096b77a5a49ff80cc460dc024fe69cb078 diff --git a/net/Kconfig b/net/Kconfig index f7e5f67cfa6..b13a38351cb 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -102,7 +102,7 @@ config NET_SLIP_MTU bytes of data: 40 + 128. I believe that is to allow for the 2x worst cast packet expansion. Ideally we would like to advertise the 256 MSS, but restrict transfers to 128 bytes (possibly by modifying - the tcp_mss() macro). + the MSS value in the TCP connection structure). config NET_SLIP_TCP_RECVWNDO diff --git a/net/devif/devif.h b/net/devif/devif.h index d4ecdd023f5..a7c26d34371 100644 --- a/net/devif/devif.h +++ b/net/devif/devif.h @@ -423,8 +423,8 @@ uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, * The amount of data that actually is sent out after a call to this * function is determined by the maximum amount of data TCP allows. uIP * will automatically crop the data so that only the appropriate - * amount of data is sent. The function tcp_mss() can be used to query - * uIP for the amount of data that actually will be sent. + * amount of data is sent. The mss field of the TCP connection structure + * can be used to determine the amount of data that actually will be sent. * * Note: This function does not guarantee that the sent data will * arrive at the destination. If the data is lost in the network, the diff --git a/net/socket/net_sendfile.c b/net/socket/net_sendfile.c index 2f6c3c9bb52..443a66357d3 100644 --- a/net/socket/net_sendfile.c +++ b/net/socket/net_sendfile.c @@ -354,9 +354,9 @@ static uint16_t sendfile_interrupt(FAR struct net_driver_s *dev, FAR void *pvcon uint32_t sndlen = pstate->snd_flen - pstate->snd_sent; - if (sndlen > tcp_mss(conn)) + if (sndlen > conn->mss) { - sndlen = tcp_mss(conn); + sndlen = conn->mss; } /* Check if we have "space" in the window */ diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index 7e958b60068..759b50deb8b 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -101,12 +101,6 @@ devif_conn_callback_free(g_netdevices, cb, NULL) #endif -/* Get the current maximum segment size that can be sent on the current - * TCP connection. - */ - -#define tcp_mss(conn) ((conn)->mss) - #ifdef CONFIG_NET_TCP_WRITE_BUFFERS /* TCP write buffer access macros */ diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index d8ea4a66b7a..3044b5f030e 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -697,9 +697,9 @@ static uint16_t psock_send_interrupt(FAR struct net_driver_s *dev, */ sndlen = WRB_PKTLEN(wrb) - WRB_SENT(wrb); - if (sndlen > tcp_mss(conn)) + if (sndlen > conn->mss) { - sndlen = tcp_mss(conn); + sndlen = conn->mss; } if (sndlen > conn->winsize) diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 95263324244..b8052a1ec7b 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -442,12 +442,12 @@ static uint16_t tcpsend_interrupt(FAR struct net_driver_s *dev, if (sndlen >= CONFIG_NET_TCP_SPLIT_SIZE) { /* sndlen is the number of bytes remaining to be sent. - * tcp_mss(conn) will return the number of bytes that can sent + * conn->mss will provide the number of bytes that can sent * in one packet. The difference, then, is the number of bytes * that would be sent in the next packet after this one. */ - int32_t next_sndlen = sndlen - tcp_mss(conn); + int32_t next_sndlen = sndlen - conn->mss; /* Is this the even packet in the packet pair transaction? */ @@ -474,13 +474,13 @@ static uint16_t tcpsend_interrupt(FAR struct net_driver_s *dev, { /* Will there be another (even) packet afer this one? * (next_sndlen > 0) Will the split condition occur on that - * next, even packet? ((next_sndlen - tcp_mss(conn)) < 0) If + * next, even packet? ((next_sndlen - conn->mss) < 0) If * so, then perform the split now to avoid the case where the * byte count is less than CONFIG_NET_TCP_SPLIT_SIZE on the * next pair. */ - if (next_sndlen > 0 && (next_sndlen - tcp_mss(conn)) < 0) + if (next_sndlen > 0 && (next_sndlen - conn->mss) < 0) { /* Here, we know that sndlen must be MSS < sndlen <= 2*MSS * and so (sndlen / 2) is <= MSS. @@ -497,9 +497,9 @@ static uint16_t tcpsend_interrupt(FAR struct net_driver_s *dev, #endif /* CONFIG_NET_TCP_SPLIT */ - if (sndlen > tcp_mss(conn)) + if (sndlen > conn->mss) { - sndlen = tcp_mss(conn); + sndlen = conn->mss; } /* Check if we have "space" in the window */