aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/ccids/ccid3.c35
-rw-r--r--net/dccp/ccids/ccid3.h42
2 files changed, 39 insertions, 38 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index ff41977f1edc..cfd11234d8f9 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -49,9 +49,9 @@ static inline u32 usecs_div(const u32 a, const u32 b)
49 return b > 20 ? tmp / (b / 10) : tmp; 49 return b > 20 ? tmp / (b / 10) : tmp;
50} 50}
51 51
52#ifdef CCID3_DEBUG 52static int ccid3_debug;
53extern int ccid3_debug;
54 53
54#ifdef CCID3_DEBUG
55#define ccid3_pr_debug(format, a...) \ 55#define ccid3_pr_debug(format, a...) \
56 do { if (ccid3_debug) \ 56 do { if (ccid3_debug) \
57 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \ 57 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \
@@ -60,37 +60,6 @@ extern int ccid3_debug;
60#define ccid3_pr_debug(format, a...) 60#define ccid3_pr_debug(format, a...)
61#endif 61#endif
62 62
63#define TFRC_MIN_PACKET_SIZE 16
64#define TFRC_STD_PACKET_SIZE 256
65#define TFRC_MAX_PACKET_SIZE 65535
66
67#define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC)
68/* two seconds as per CCID3 spec 11 */
69
70#define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ))
71/* above is in usecs - half the scheduling granularity as per RFC3448 4.6 */
72
73#define TFRC_WIN_COUNT_PER_RTT 4
74#define TFRC_WIN_COUNT_LIMIT 16
75
76#define TFRC_MAX_BACK_OFF_TIME 64
77/* above is in seconds */
78
79#define TFRC_SMALLEST_P 40
80
81#define TFRC_RECV_IVAL_F_LENGTH 8 /* length(w[]) */
82
83/* Number of later packets received before one is considered lost */
84#define TFRC_RECV_NUM_LATE_LOSS 3
85
86enum ccid3_options {
87 TFRC_OPT_LOSS_EVENT_RATE = 192,
88 TFRC_OPT_LOSS_INTERVALS = 193,
89 TFRC_OPT_RECEIVE_RATE = 194,
90};
91
92static int ccid3_debug;
93
94static struct dccp_tx_hist *ccid3_tx_hist; 63static struct dccp_tx_hist *ccid3_tx_hist;
95static struct dccp_rx_hist *ccid3_rx_hist; 64static struct dccp_rx_hist *ccid3_rx_hist;
96 65
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h
index 5ef72cda7cd7..f8965700bbe9 100644
--- a/net/dccp/ccids/ccid3.h
+++ b/net/dccp/ccids/ccid3.h
@@ -36,8 +36,39 @@
36#ifndef _DCCP_CCID3_H_ 36#ifndef _DCCP_CCID3_H_
37#define _DCCP_CCID3_H_ 37#define _DCCP_CCID3_H_
38 38
39#include <linux/types.h> 39#include <linux/config.h>
40#include <linux/list.h> 40#include <linux/list.h>
41#include <linux/time.h>
42#include <linux/types.h>
43
44#define TFRC_MIN_PACKET_SIZE 16
45#define TFRC_STD_PACKET_SIZE 256
46#define TFRC_MAX_PACKET_SIZE 65535
47
48/* Two seconds as per CCID3 spec */
49#define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC)
50
51/* In usecs - half the scheduling granularity as per RFC3448 4.6 */
52#define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ))
53
54#define TFRC_WIN_COUNT_PER_RTT 4
55#define TFRC_WIN_COUNT_LIMIT 16
56
57/* In seconds */
58#define TFRC_MAX_BACK_OFF_TIME 64
59
60#define TFRC_SMALLEST_P 40
61
62#define TFRC_RECV_IVAL_F_LENGTH 8
63
64/* Number of later packets received before one is considered lost */
65#define TFRC_RECV_NUM_LATE_LOSS 3
66
67enum ccid3_options {
68 TFRC_OPT_LOSS_EVENT_RATE = 192,
69 TFRC_OPT_LOSS_INTERVALS = 193,
70 TFRC_OPT_RECEIVE_RATE = 194,
71};
41 72
42struct ccid3_options_received { 73struct ccid3_options_received {
43 u64 ccid3or_seqno:48, 74 u64 ccid3or_seqno:48,
@@ -47,7 +78,7 @@ struct ccid3_options_received {
47 u32 ccid3or_receive_rate; 78 u32 ccid3or_receive_rate;
48}; 79};
49 80
50/** struct ccid3_hc_tx_sock - CCID3 sender half connection congestion control block 81/** struct ccid3_hc_tx_sock - CCID3 sender half connection sock
51 * 82 *
52 * @ccid3hctx_state - Sender state 83 * @ccid3hctx_state - Sender state
53 * @ccid3hctx_x - Current sending rate 84 * @ccid3hctx_x - Current sending rate
@@ -57,7 +88,8 @@ struct ccid3_options_received {
57 * @ccid3hctx_rtt - Estimate of current round trip time in usecs 88 * @ccid3hctx_rtt - Estimate of current round trip time in usecs
58 * @@ccid3hctx_p - Current loss event rate (0-1) scaled by 1000000 89 * @@ccid3hctx_p - Current loss event rate (0-1) scaled by 1000000
59 * @ccid3hctx_last_win_count - Last window counter sent 90 * @ccid3hctx_last_win_count - Last window counter sent
60 * @ccid3hctx_t_last_win_count - Timestamp of earliest packet with last_win_count value sent 91 * @ccid3hctx_t_last_win_count - Timestamp of earliest packet
92 * with last_win_count value sent
61 * @ccid3hctx_no_feedback_timer - Handle to no feedback timer 93 * @ccid3hctx_no_feedback_timer - Handle to no feedback timer
62 * @ccid3hctx_idle - FIXME 94 * @ccid3hctx_idle - FIXME
63 * @ccid3hctx_t_ld - Time last doubled during slow start 95 * @ccid3hctx_t_ld - Time last doubled during slow start
@@ -112,9 +144,9 @@ struct ccid3_hc_rx_sock {
112}; 144};
113 145
114#define ccid3_hc_tx_field(s,field) (s->dccps_hc_tx_ccid_private == NULL ? 0 : \ 146#define ccid3_hc_tx_field(s,field) (s->dccps_hc_tx_ccid_private == NULL ? 0 : \
115 ((struct ccid3_hc_tx_sock *)s->dccps_hc_tx_ccid_private)->ccid3hctx_##field) 147 ((struct ccid3_hc_tx_sock *)s->dccps_hc_tx_ccid_private)->ccid3hctx_##field)
116 148
117#define ccid3_hc_rx_field(s,field) (s->dccps_hc_rx_ccid_private == NULL ? 0 : \ 149#define ccid3_hc_rx_field(s,field) (s->dccps_hc_rx_ccid_private == NULL ? 0 : \
118 ((struct ccid3_hc_rx_sock *)s->dccps_hc_rx_ccid_private)->ccid3hcrx_##field) 150 ((struct ccid3_hc_rx_sock *)s->dccps_hc_rx_ccid_private)->ccid3hcrx_##field)
119 151
120#endif /* _DCCP_CCID3_H_ */ 152#endif /* _DCCP_CCID3_H_ */