From b4d5f4b2884625d13c7ef5b9fd085ec93bbf545c Mon Sep 17 00:00:00 2001 From: Gerrit Renker Date: Sun, 3 Jul 2011 09:04:18 -0600 Subject: dccp ccid-2: move rfc 3390 function into header file This moves CCID-2's initial window function into the header file, since several parts throughout the CCID-2 code need to call it (CCID-2 still uses RFC 3390). Signed-off-by: Gerrit Renker Acked-by: Leandro Melo de Sales --- net/dccp/ccids/ccid2.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'net/dccp/ccids/ccid2.h') diff --git a/net/dccp/ccids/ccid2.h b/net/dccp/ccids/ccid2.h index e9985dafc2c7..f17460a8fe7f 100644 --- a/net/dccp/ccids/ccid2.h +++ b/net/dccp/ccids/ccid2.h @@ -88,6 +88,15 @@ static inline bool ccid2_cwnd_network_limited(struct ccid2_hc_tx_sock *hc) return hc->tx_pipe >= hc->tx_cwnd; } +/* + * Convert RFC 3390 larger initial window into an equivalent number of packets. + * This is based on the numbers specified in RFC 5681, 3.1. + */ +static inline u32 rfc3390_bytes_to_packets(const u32 smss) +{ + return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3); +} + struct ccid2_hc_rx_sock { int rx_data; }; -- cgit v1.2.3