--- zzzz-none-000/linux-4.1.52/include/net/sock.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/net/sock.h 2022-03-02 11:37:13.000000000 +0000 @@ -431,6 +431,9 @@ #endif __u32 sk_mark; u32 sk_classid; +#ifdef CONFIG_AVM_SK_TC_INDEX + unsigned long sk_tc_index; +#endif struct cg_proto *sk_cgrp; void (*sk_state_change)(struct sock *sk); void (*sk_data_ready)(struct sock *sk); @@ -721,6 +724,9 @@ */ SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */ SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) + SOCK_MPTCP, /* MPTCP set on this socket */ +#endif }; #define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) @@ -760,7 +766,7 @@ #endif -static inline gfp_t sk_gfp_atomic(struct sock *sk, gfp_t gfp_mask) +static inline gfp_t sk_gfp_atomic(struct sock *sk, gfp_t gfp_mask __maybe_unused) { return GFP_ATOMIC | (sk->sk_allocation & __GFP_MEMALLOC); } @@ -915,6 +921,18 @@ int sk_wait_data(struct sock *sk, long *timeo); +#if defined(CONFIG_BCM_MPTCP) && defined(CONFIG_BCM_KF_MPTCP) +/* START - needed for MPTCP */ +struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, int family); +void sock_lock_init(struct sock *sk); + +extern struct lock_class_key af_callback_keys[AF_MAX]; +extern char *const af_family_clock_key_strings[AF_MAX+1]; + +#define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) +/* END - needed for MPTCP */ + +#endif struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; @@ -1123,8 +1141,9 @@ #define mem_cgroup_sockets_enabled static_key_false(&memcg_socket_limit_enabled) #else #define mem_cgroup_sockets_enabled 0 -static inline struct cg_proto *parent_cg_proto(struct proto *proto, - struct cg_proto *cg_proto) +static inline struct cg_proto *parent_cg_proto( + struct proto *proto __maybe_unused, + struct cg_proto *cg_proto __maybe_unused) { return NULL; } @@ -1793,13 +1812,13 @@ { if (skb->ip_summed == CHECKSUM_NONE) { __wsum csum = 0; - if (csum_and_copy_from_iter(to, copy, &csum, from) != copy) + if (csum_and_copy_from_iter(to, copy, &csum, from) != (unsigned int)copy) return -EFAULT; skb->csum = csum_block_add(skb->csum, csum, offset); } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { - if (copy_from_iter_nocache(to, copy, from) != copy) + if (copy_from_iter_nocache(to, copy, from) != (unsigned int)copy) return -EFAULT; - } else if (copy_from_iter(to, copy, from) != copy) + } else if (copy_from_iter(to, copy, from) != (unsigned int)copy) return -EFAULT; return 0; @@ -1959,6 +1978,11 @@ skb->sk = sk; skb->destructor = sock_wfree; skb_set_hash_from_sk(skb, sk); +#ifdef CONFIG_AVM_SK_TC_INDEX +#ifdef CONFIG_NET_SCHED + skb->tc_index = sk->sk_tc_index; +#endif +#endif /* * We used to take a refcount on sk, but following operation * is enough to guarantee sk_free() wont free this sock until @@ -2192,13 +2216,13 @@ } static inline -struct net *sock_net(const struct sock *sk) +struct net *sock_net(const struct sock *sk __maybe_unused) { return read_pnet(&sk->sk_net); } static inline -void sock_net_set(struct sock *sk, struct net *net) +void sock_net_set(struct sock *sk __maybe_unused, struct net *net) { write_pnet(&sk->sk_net, net); }