--- zzzz-none-000/linux-4.1.38/include/linux/tcp.h 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/include/linux/tcp.h 2020-11-25 10:06:48.000000000 +0000 @@ -52,7 +52,11 @@ /* 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 */ +#if !defined(CONFIG_BCM_MPTCP) || !defined(CONFIG_BCM_KF_MPTCP) #define TCP_FASTOPEN_COOKIE_SIZE 8 /* the size employed by this impl. */ +#else +#define TCP_FASTOPEN_COOKIE_SIZE 4 /* the size employed by this impl. */ +#endif /* TCP Fast Open Cookie as stored in memory */ struct tcp_fastopen_cookie { @@ -72,6 +76,58 @@ u32 end_seq; }; +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) +struct tcp_out_options { + u16 options; /* bit field of OPTION_* */ + u8 ws; /* window scale, 0 to disable */ + u8 num_sack_blocks;/* number of SACK blocks to include */ + u8 hash_size; /* bytes in hash_location */ + u16 mss; /* 0 to disable */ + __u8 *hash_location; /* temporary pointer, overloaded */ + __u32 tsval, tsecr; /* need to include OPTION_TS */ + struct tcp_fastopen_cookie *fastopen_cookie; /* Fast open cookie */ +#ifdef CONFIG_MPTCP + u16 mptcp_options; /* bit field of MPTCP related OPTION_* */ + u8 dss_csum:1, /* dss-checksum required? */ + add_addr_v4:1, + add_addr_v6:1, + mptcp_ver:4; + + union { + struct { + __u64 sender_key; /* sender's key for mptcp */ + __u64 receiver_key; /* receiver's key for mptcp */ + } mp_capable; + + struct { + __u64 sender_truncated_mac; + __u32 sender_nonce; + /* random number of the sender */ + __u32 token; /* token for mptcp */ + u8 low_prio:1; + } mp_join_syns; + }; + + struct { + __u64 trunc_mac; + struct in_addr addr; + u16 port; + u8 addr_id; + } add_addr4; + + struct { + __u64 trunc_mac; + struct in6_addr addr; + u16 port; + u8 addr_id; + } add_addr6; + + u16 remove_addrs; /* list of address id */ + u8 addr_id; /* address id (mp_join or add_address) */ +#endif /* CONFIG_MPTCP */ +}; + +#endif /*These are used to set the sack_ok field in struct tcp_options_received */ #define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */ #define TCP_FACK_ENABLED (1 << 1) /*1 = FACK is enabled locally*/ @@ -95,6 +151,11 @@ u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ }; +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) +struct mptcp_cb; +struct mptcp_tcp_sock; + +#endif static inline void tcp_clear_options(struct tcp_options_received *rx_opt) { rx_opt->tstamp_ok = rx_opt->sack_ok = 0; @@ -128,6 +189,10 @@ return (struct tcp_request_sock *)req; } +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) +struct tcp_md5sig_key; + +#endif struct tcp_sock { /* inet_connection_sock has to be the first member of tcp_sock */ struct inet_connection_sock inet_conn; @@ -168,7 +233,9 @@ u32 tsoffset; /* timestamp offset */ +#if !defined(CONFIG_BCM_KF_TCP_NO_TSQ) struct list_head tsq_node; /* anchor in tsq_tasklet.head list */ +#endif unsigned long tsq_flags; /* Data for direct copy to user */ @@ -328,6 +395,42 @@ * socket. Used to retransmit SYNACKs etc. */ struct request_sock *fastopen_rsk; +#if defined(CONFIG_BCM_KF_SPEEDYGET) && defined(CONFIG_BCM_SPEEDYGET) + u8 tcp_nocopy; +#endif +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) + + /* MPTCP/TCP-specific callbacks */ + const struct tcp_sock_ops *ops; + + struct mptcp_cb *mpcb; + struct sock *meta_sk; + /* We keep these flags even if CONFIG_MPTCP is not checked, because + * it allows checking MPTCP capability just by checking the mpc flag, + * rather than adding ifdefs everywhere. + */ + u16 mpc:1, /* Other end is multipath capable */ + inside_tk_table:1, /* Is the tcp_sock inside the token-table? */ + send_mp_fclose:1, + request_mptcp:1, /* Did we send out an MP_CAPABLE? + * (this speeds up mptcp_doit() in tcp_recvmsg) + */ + pf:1, /* Potentially Failed state: when this flag is set, we + * stop using the subflow + */ + mp_killed:1, /* Killed with a tcp_done in mptcp? */ + was_meta_sk:1, /* This was a meta sk (in case of reuse) */ + is_master_sk:1, + close_it:1, /* Must close socket in mptcp_data_ready? */ + closing:1, + mptcp_ver:4; + struct mptcp_tcp_sock *mptcp; +#ifdef CONFIG_MPTCP + struct hlist_nulls_node tk_table; + u32 mptcp_loc_token; + u64 mptcp_loc_key; +#endif /* CONFIG_MPTCP */ +#endif }; enum tsq_flags { @@ -339,6 +442,10 @@ TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call * tcp_v{4|6}_mtu_reduced() */ +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) + MPTCP_PATH_MANAGER, /* MPTCP deferred creation of new subflows */ + MPTCP_SUB_DEFERRED, /* A subflow got deferred - process them */ +#endif }; static inline struct tcp_sock *tcp_sk(const struct sock *sk) @@ -361,6 +468,9 @@ #ifdef CONFIG_TCP_MD5SIG struct tcp_md5sig_key *tw_md5_key; #endif +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) + struct mptcp_tw *mptcp_tw; +#endif }; static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) @@ -395,4 +505,7 @@ return 0; } +int tcp_skb_shift(struct sk_buff *to, struct sk_buff *from, int pcount, + int shiftlen); + #endif /* _LINUX_TCP_H */