aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tcp_ctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libtle_l4p/tcp_ctl.h')
-rw-r--r--lib/libtle_l4p/tcp_ctl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libtle_l4p/tcp_ctl.h b/lib/libtle_l4p/tcp_ctl.h
index dcb9c3e..95c2bbc 100644
--- a/lib/libtle_l4p/tcp_ctl.h
+++ b/lib/libtle_l4p/tcp_ctl.h
@@ -41,6 +41,13 @@ tcp_stream_up(struct tle_tcp_stream *s)
rwl_up(&s->tx.use);
}
+/* calculate RCV.WND value based on size of stream receive buffer */
+static inline uint32_t
+calc_rx_wnd(const struct tle_tcp_stream *s, uint32_t scale)
+{
+ return s->rx.q->prod.mask << scale;
+}
+
/* empty stream's receive queue */
static void
empty_rq(struct tle_tcp_stream *s)