[CCID3] Introduce ccid3_hc_[rt]x_sk() for overal consistency
[sfrench/cifs-2.6.git] / net / dccp / ccids / ccid3.h
index f8965700bbe98e6d6caa226e2fcd606c4bc0a1a3..d16f00d784f39375a771550280281ba0d53d4c19 100644 (file)
 /* In usecs - half the scheduling granularity as per RFC3448 4.6 */
 #define TFRC_OPSYS_HALF_TIME_GRAN  (USEC_PER_SEC / (2 * HZ))
 
-#define TFRC_WIN_COUNT_PER_RTT     4
-#define TFRC_WIN_COUNT_LIMIT      16
-
 /* In seconds */
 #define TFRC_MAX_BACK_OFF_TIME    64
 
 #define TFRC_SMALLEST_P                   40
 
-#define TFRC_RECV_IVAL_F_LENGTH            8
-
-/* Number of later packets received before one is considered lost */
-#define TFRC_RECV_NUM_LATE_LOSS        3
-
 enum ccid3_options {
        TFRC_OPT_LOSS_EVENT_RATE = 192,
        TFRC_OPT_LOSS_INTERVALS  = 193,
@@ -119,34 +111,31 @@ struct ccid3_hc_tx_sock {
        struct ccid3_options_received   ccid3hctx_options_received;
 };
 
-struct ccid3_loss_interval_hist_entry {
-       struct list_head        ccid3lih_node;
-       u64                     ccid3lih_seqno:48,
-                               ccid3lih_win_count:4;
-       u32                     ccid3lih_interval;
-};
-
 struct ccid3_hc_rx_sock {
        u64                     ccid3hcrx_seqno_last_counter:48,
                                ccid3hcrx_state:8,
                                ccid3hcrx_last_counter:4;
-       unsigned long           ccid3hcrx_rtt;
+       u32                     ccid3hcrx_rtt;
        u32                     ccid3hcrx_p;
        u32                     ccid3hcrx_bytes_recv;
        struct timeval          ccid3hcrx_tstamp_last_feedback;
        struct timeval          ccid3hcrx_tstamp_last_ack;
        struct list_head        ccid3hcrx_hist;
-       struct list_head        ccid3hcrx_loss_interval_hist;
+       struct list_head        ccid3hcrx_li_hist;
        u16                     ccid3hcrx_s;
        u32                     ccid3hcrx_pinv;
        u32                     ccid3hcrx_elapsed_time;
        u32                     ccid3hcrx_x_recv;
 };
 
-#define ccid3_hc_tx_field(s,field) (s->dccps_hc_tx_ccid_private == NULL ? 0 : \
-    ((struct ccid3_hc_tx_sock *)s->dccps_hc_tx_ccid_private)->ccid3hctx_##field)
+static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk)
+{
+    return dccp_sk(sk)->dccps_hc_tx_ccid_private;
+}
 
-#define ccid3_hc_rx_field(s,field) (s->dccps_hc_rx_ccid_private == NULL ? 0 : \
-    ((struct ccid3_hc_rx_sock *)s->dccps_hc_rx_ccid_private)->ccid3hcrx_##field)
+static inline struct ccid3_hc_rx_sock *ccid3_hc_rx_sk(const struct sock *sk)
+{
+    return dccp_sk(sk)->dccps_hc_rx_ccid_private;
+}
 
 #endif /* _DCCP_CCID3_H_ */