tcp: dont drop MTU reduction indications
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / tcp.h
index 4c5b63283377449ff94252f1ff64e2a8b16fddcf..eb125a4c30b334b63ca9d06983a125360839d90e 100644 (file)
@@ -69,16 +69,16 @@ union tcp_word_hdr {
 #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
 
 enum { 
-       TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
-       TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
-       TCP_FLAG_URG = __cpu_to_be32(0x00200000),
-       TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
-       TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
-       TCP_FLAG_RST = __cpu_to_be32(0x00040000),
-       TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
-       TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
-       TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
-       TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
+       TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
+       TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
+       TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
+       TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
+       TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
+       TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
+       TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
+       TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
+       TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
+       TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
 }; 
 
 /*
@@ -243,6 +243,16 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)
        return (tcp_hdr(skb)->doff - 5) * 4;
 }
 
+/* TCP Fast Open */
+#define TCP_FASTOPEN_COOKIE_MIN        4       /* Min Fast Open Cookie size in bytes */
+#define TCP_FASTOPEN_COOKIE_MAX        16      /* Max Fast Open Cookie size in bytes */
+
+/* TCP Fast Open Cookie as stored in memory */
+struct tcp_fastopen_cookie {
+       s8      len;
+       u8      val[TCP_FASTOPEN_COOKIE_MAX];
+};
+
 /* This defines a selective acknowledgement block. */
 struct tcp_sack_block_wire {
        __be32  start_seq;
@@ -339,6 +349,9 @@ struct tcp_sock {
        u32     rcv_tstamp;     /* timestamp of last received ACK (for keepalives) */
        u32     lsndtime;       /* timestamp of last sent data packet (for restart window) */
 
+       struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
+       unsigned long   tsq_flags;
+
        /* Data for direct copy to user */
        struct {
                struct sk_buff_head     prequeue;
@@ -373,7 +386,9 @@ struct tcp_sock {
                unused      : 1;
        u8      repair_queue;
        u8      do_early_retrans:1,/* Enable RFC5827 early-retransmit  */
-               early_retrans_delayed:1; /* Delayed ER timer installed */
+               early_retrans_delayed:1, /* Delayed ER timer installed */
+               syn_data:1,     /* SYN includes data */
+               syn_fastopen:1; /* SYN includes Fast Open option */
 
 /* RTT measurement */
        u32     srtt;           /* smoothed round trip time << 3        */
@@ -478,6 +493,9 @@ struct tcp_sock {
                u32               probe_seq_start;
                u32               probe_seq_end;
        } mtu_probe;
+       u32     mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG
+                          * while socket was owned by user.
+                          */
 
 #ifdef CONFIG_TCP_MD5SIG
 /* TCP AF-Specific parts; only used by MD5 Signature support so far */
@@ -487,6 +505,9 @@ struct tcp_sock {
        struct tcp_md5sig_info  __rcu *md5sig_info;
 #endif
 
+/* TCP fastopen related information */
+       struct tcp_fastopen_request *fastopen_req;
+
        /* When the cookie options are generated and exchanged, then this
         * object holds a reference to them (cookie_values->kref).  Also
         * contains related tcp_cookie_transactions fields.
@@ -494,6 +515,17 @@ struct tcp_sock {
        struct tcp_cookie_values  *cookie_values;
 };
 
+enum tsq_flags {
+       TSQ_THROTTLED,
+       TSQ_QUEUED,
+       TCP_TSQ_DEFERRED,          /* tcp_tasklet_func() found socket was owned */
+       TCP_WRITE_TIMER_DEFERRED,  /* tcp_write_timer() found socket was owned */
+       TCP_DELACK_TIMER_DEFERRED, /* tcp_delack_timer() found socket was owned */
+       TCP_MTU_REDUCED_DEFERRED,  /* tcp_v{4|6}_err() could not call
+                                   * tcp_v{4|6}_mtu_reduced()
+                                   */
+};
+
 static inline struct tcp_sock *tcp_sk(const struct sock *sk)
 {
        return (struct tcp_sock *)sk;
@@ -507,7 +539,7 @@ struct tcp_timewait_sock {
        u32                       tw_ts_recent;
        long                      tw_ts_recent_stamp;
 #ifdef CONFIG_TCP_MD5SIG
-       struct tcp_md5sig_key   *tw_md5_key;
+       struct tcp_md5sig_key     *tw_md5_key;
 #endif
        /* Few sockets in timewait have cookies; in that case, then this
         * object holds a reference to them (tw_cookie_values->kref).