net/tcp and sixlowpan: Separate the the TCP receive window calculations to a separate header file. It must also be used by the special 6LoWPAN TCP logic.

This commit is contained in:
Gregory Nutt
2018-06-30 20:50:07 -06:00
parent d52b65b06d
commit b32d8b1714
5 changed files with 187 additions and 69 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* net/sixlowpan/sixlowpan_tcpsend.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2017-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -267,6 +267,12 @@ static int sixlowpan_tcp_header(FAR struct tcp_conn_s *conn,
}
else
{
/* Update the TCP received window based on I/O buffer availability */
tcp_update_recvwindws(dev);
/* Set the TCP Window */
ipv6tcp->tcp.wnd[0] = ((NET_DEV_RCVWNDO(dev)) >> 8);
ipv6tcp->tcp.wnd[1] = ((NET_DEV_RCVWNDO(dev)) & 0xff);
}