aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-05 17:54:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-05 17:54:29 -0400
commitcc998ff8811530be521f6b316f37ab7676a07938 (patch)
treea054b3bf4b2ef406bf756a6cfc9be2f9115f17ae /include/net
parent57d730924d5cc2c3e280af16a9306587c3a511db (diff)
parent0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking changes from David Miller: "Noteworthy changes this time around: 1) Multicast rejoin support for team driver, from Jiri Pirko. 2) Centralize and simplify TCP RTT measurement handling in order to reduce the impact of bad RTO seeding from SYN/ACKs. Also, when both timestamps and local RTT measurements are available prefer the later because there are broken middleware devices which scramble the timestamp. From Yuchung Cheng. 3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel memory consumed to queue up unsend user data. From Eric Dumazet. 4) Add a "physical port ID" abstraction for network devices, from Jiri Pirko. 5) Add a "suppress" operation to influence fib_rules lookups, from Stefan Tomanek. 6) Add a networking development FAQ, from Paul Gortmaker. 7) Extend the information provided by tcp_probe and add ipv6 support, from Daniel Borkmann. 8) Use RCU locking more extensively in openvswitch data paths, from Pravin B Shelar. 9) Add SCTP support to openvswitch, from Joe Stringer. 10) Add EF10 chip support to SFC driver, from Ben Hutchings. 11) Add new SYNPROXY netfilter target, from Patrick McHardy. 12) Compute a rate approximation for sending in TCP sockets, and use this to more intelligently coalesce TSO frames. Furthermore, add a new packet scheduler which takes advantage of this estimate when available. From Eric Dumazet. 13) Allow AF_PACKET fanouts with random selection, from Daniel Borkmann. 14) Add ipv6 support to vxlan driver, from Cong Wang" Resolved conflicts as per discussion. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits) openvswitch: Fix alignment of struct sw_flow_key. netfilter: Fix build errors with xt_socket.c tcp: Add missing braces to do_tcp_setsockopt caif: Add missing braces to multiline if in cfctrl_linkup_request bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize vxlan: Fix kernel panic on device delete. net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls net: mvneta: properly disable HW PHY polling and ensure adjust_link() works icplus: Use netif_running to determine device state ethernet/arc/arc_emac: Fix huge delays in large file copies tuntap: orphan frags before trying to set tx timestamp tuntap: purge socket error queue on detach qlcnic: use standard NAPI weights ipv6:introduce function to find route for redirect bnx2x: VF RSS support - VF side bnx2x: VF RSS support - PF side vxlan: Notify drivers for listening UDP port changes net: usbnet: update addr_assign_type if appropriate driver/net: enic: update enic maintainers and driver driver/net: enic: Exposing symbols for Cisco's low latency driver ...
Diffstat (limited to 'include/net')
-rw-r--r--include/net/9p/transport.h3
-rw-r--r--include/net/act_api.h60
-rw-r--r--include/net/addrconf.h180
-rw-r--r--include/net/af_rxrpc.h35
-rw-r--r--include/net/af_unix.h17
-rw-r--r--include/net/af_vsock.h175
-rw-r--r--include/net/arp.h30
-rw-r--r--include/net/ax25.h215
-rw-r--r--include/net/bluetooth/bluetooth.h8
-rw-r--r--include/net/bluetooth/hci.h7
-rw-r--r--include/net/bluetooth/hci_core.h10
-rw-r--r--include/net/bluetooth/sco.h1
-rw-r--r--include/net/cfg80211.h239
-rw-r--r--include/net/checksum.h10
-rw-r--r--include/net/cls_cgroup.h2
-rw-r--r--include/net/dst.h12
-rw-r--r--include/net/fib_rules.h14
-rw-r--r--include/net/ieee80211_radiotap.h4
-rw-r--r--include/net/if_inet6.h9
-rw-r--r--include/net/ip.h12
-rw-r--r--include/net/ip6_route.h2
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h11
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/irda/irlan_common.h3
-rw-r--r--include/net/llc_if.h30
-rw-r--r--include/net/mac80211.h192
-rw-r--r--include/net/mld.h51
-rw-r--r--include/net/ndisc.h5
-rw-r--r--include/net/neighbour.h98
-rw-r--r--include/net/net_namespace.h37
-rw-r--r--include/net/netfilter/nf_conntrack.h9
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h6
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h7
-rw-r--r--include/net/netfilter/nf_conntrack_seqadj.h51
-rw-r--r--include/net/netfilter/nf_conntrack_synproxy.h77
-rw-r--r--include/net/netfilter/nf_nat.h10
-rw-r--r--include/net/netfilter/nf_nat_helper.h19
-rw-r--r--include/net/netfilter/nf_tproxy_core.h210
-rw-r--r--include/net/netfilter/nfnetlink_queue.h8
-rw-r--r--include/net/netns/ipv4.h1
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/netprio_cgroup.h2
-rw-r--r--include/net/nfc/nfc.h3
-rw-r--r--include/net/pkt_cls.h42
-rw-r--r--include/net/pkt_sched.h53
-rw-r--r--include/net/sch_generic.h54
-rw-r--r--include/net/sctp/auth.h8
-rw-r--r--include/net/sctp/checksum.h23
-rw-r--r--include/net/sctp/command.h18
-rw-r--r--include/net/sctp/constants.h8
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/sctp/sm.h8
-rw-r--r--include/net/sctp/structs.h29
-rw-r--r--include/net/sctp/tsnmap.h8
-rw-r--r--include/net/sctp/ulpevent.h8
-rw-r--r--include/net/sctp/ulpqueue.h8
-rw-r--r--include/net/sock.h29
-rw-r--r--include/net/tcp.h44
-rw-r--r--include/net/udp.h1
-rw-r--r--include/net/vsock_addr.h30
-rw-r--r--include/net/vxlan.h40
-rw-r--r--include/net/xfrm.h2
63 files changed, 1423 insertions, 881 deletions
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d9fa68f26c41..9a36d9297114 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -40,8 +40,6 @@
40 * @close: member function to discard a connection on this transport 40 * @close: member function to discard a connection on this transport
41 * @request: member function to issue a request to the transport 41 * @request: member function to issue a request to the transport
42 * @cancel: member function to cancel a request (if it hasn't been sent) 42 * @cancel: member function to cancel a request (if it hasn't been sent)
43 * @cancelled: member function to notify that a cancelled request will not
44 * not receive a reply
45 * 43 *
46 * This is the basic API for a transport module which is registered by the 44 * This is the basic API for a transport module which is registered by the
47 * transport module with the 9P core network module and used by the client 45 * transport module with the 9P core network module and used by the client
@@ -60,7 +58,6 @@ struct p9_trans_module {
60 void (*close) (struct p9_client *); 58 void (*close) (struct p9_client *);
61 int (*request) (struct p9_client *, struct p9_req_t *req); 59 int (*request) (struct p9_client *, struct p9_req_t *req);
62 int (*cancel) (struct p9_client *, struct p9_req_t *req); 60 int (*cancel) (struct p9_client *, struct p9_req_t *req);
63 int (*cancelled)(struct p9_client *, struct p9_req_t *req);
64 int (*zc_request)(struct p9_client *, struct p9_req_t *, 61 int (*zc_request)(struct p9_client *, struct p9_req_t *,
65 char *, char *, int , int, int, int); 62 char *, char *, int , int, int, int);
66}; 63};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index b8ffac7b6bab..9e90fdff470d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -82,36 +82,36 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 83};
84 84
85extern struct tcf_common *tcf_hash_lookup(u32 index, 85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo);
86 struct tcf_hashinfo *hinfo); 86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87extern void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 87int tcf_hash_release(struct tcf_common *p, int bind,
88extern int tcf_hash_release(struct tcf_common *p, int bind, 88 struct tcf_hashinfo *hinfo);
89 struct tcf_hashinfo *hinfo); 89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
90extern int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 90 int type, struct tc_action *a);
91 int type, struct tc_action *a); 91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92extern u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo); 92int tcf_hash_search(struct tc_action *a, u32 index);
93extern int tcf_hash_search(struct tc_action *a, u32 index); 93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94extern struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 94 int bind, struct tcf_hashinfo *hinfo);
95 int bind, struct tcf_hashinfo *hinfo); 95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96extern struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 96 struct tc_action *a, int size,
97 struct tc_action *a, int size, 97 int bind, u32 *idx_gen,
98 int bind, u32 *idx_gen, 98 struct tcf_hashinfo *hinfo);
99 struct tcf_hashinfo *hinfo); 99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
101 100
102extern int tcf_register_action(struct tc_action_ops *a); 101int tcf_register_action(struct tc_action_ops *a);
103extern int tcf_unregister_action(struct tc_action_ops *a); 102int tcf_unregister_action(struct tc_action_ops *a);
104extern void tcf_action_destroy(struct tc_action *a, int bind); 103void tcf_action_destroy(struct tc_action *a, int bind);
105extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); 104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a,
106extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 105 struct tcf_result *res);
107 struct nlattr *est, char *n, int ovr, 106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla,
108 int bind); 107 struct nlattr *est, char *n, int ovr,
109extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 108 int bind);
110 struct nlattr *est, char *n, int ovr, 109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
111 int bind); 110 struct nlattr *est, char *n, int ovr,
112extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 111 int bind);
113extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
114extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
115extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
115int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
116#endif /* CONFIG_NET_CLS_ACT */ 116#endif /* CONFIG_NET_CLS_ACT */
117#endif 117#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index c7b181cb47a6..fb314de2b61b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -53,51 +53,36 @@ struct prefix_info {
53#define IN6_ADDR_HSIZE_SHIFT 4 53#define IN6_ADDR_HSIZE_SHIFT 4
54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT)
55 55
56extern int addrconf_init(void); 56int addrconf_init(void);
57extern void addrconf_cleanup(void); 57void addrconf_cleanup(void);
58 58
59extern int addrconf_add_ifaddr(struct net *net, 59int addrconf_add_ifaddr(struct net *net, void __user *arg);
60 void __user *arg); 60int addrconf_del_ifaddr(struct net *net, void __user *arg);
61extern int addrconf_del_ifaddr(struct net *net, 61int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 void __user *arg);
63extern int addrconf_set_dstaddr(struct net *net,
64 void __user *arg);
65 62
66extern int ipv6_chk_addr(struct net *net, 63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
67 const struct in6_addr *addr, 64 const struct net_device *dev, int strict);
68 const struct net_device *dev,
69 int strict);
70 65
71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 66#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
72extern int ipv6_chk_home_addr(struct net *net, 67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
73 const struct in6_addr *addr);
74#endif 68#endif
75 69
76extern int ipv6_chk_prefix(const struct in6_addr *addr, 70int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
77 struct net_device *dev); 71
78 72struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
79extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 73 const struct in6_addr *addr,
80 const struct in6_addr *addr, 74 struct net_device *dev, int strict);
81 struct net_device *dev, 75
82 int strict); 76int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
83 77 const struct in6_addr *daddr, unsigned int srcprefs,
84extern int ipv6_dev_get_saddr(struct net *net, 78 struct in6_addr *saddr);
85 const struct net_device *dev, 79int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
86 const struct in6_addr *daddr, 80 unsigned char banned_flags);
87 unsigned int srcprefs, 81int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
88 struct in6_addr *saddr); 82 unsigned char banned_flags);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev, 83int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
90 struct in6_addr *addr, 84void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
91 unsigned char banned_flags); 85void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
92extern int ipv6_get_lladdr(struct net_device *dev,
93 struct in6_addr *addr,
94 unsigned char banned_flags);
95extern int ipv6_rcv_saddr_equal(const struct sock *sk,
96 const struct sock *sk2);
97extern void addrconf_join_solict(struct net_device *dev,
98 const struct in6_addr *addr);
99extern void addrconf_leave_solict(struct inet6_dev *idev,
100 const struct in6_addr *addr);
101 86
102static inline unsigned long addrconf_timeout_fixup(u32 timeout, 87static inline unsigned long addrconf_timeout_fixup(u32 timeout,
103 unsigned int unit) 88 unsigned int unit)
@@ -124,41 +109,58 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
124/* 109/*
125 * IPv6 Address Label subsystem (addrlabel.c) 110 * IPv6 Address Label subsystem (addrlabel.c)
126 */ 111 */
127extern int ipv6_addr_label_init(void); 112int ipv6_addr_label_init(void);
128extern void ipv6_addr_label_cleanup(void); 113void ipv6_addr_label_cleanup(void);
129extern void ipv6_addr_label_rtnl_register(void); 114void ipv6_addr_label_rtnl_register(void);
130extern u32 ipv6_addr_label(struct net *net, 115u32 ipv6_addr_label(struct net *net, const struct in6_addr *addr,
131 const struct in6_addr *addr, 116 int type, int ifindex);
132 int type, int ifindex);
133 117
134/* 118/*
135 * multicast prototypes (mcast.c) 119 * multicast prototypes (mcast.c)
136 */ 120 */
137extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 121int ipv6_sock_mc_join(struct sock *sk, int ifindex,
138 const struct in6_addr *addr); 122 const struct in6_addr *addr);
139extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 123int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
140 const struct in6_addr *addr); 124 const struct in6_addr *addr);
141extern void ipv6_sock_mc_close(struct sock *sk); 125void ipv6_sock_mc_close(struct sock *sk);
142extern bool inet6_mc_check(struct sock *sk, 126bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
143 const struct in6_addr *mc_addr, 127 const struct in6_addr *src_addr);
144 const struct in6_addr *src_addr); 128
145 129int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
146extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 130int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
147extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 131int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
148extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 132void ipv6_mc_up(struct inet6_dev *idev);
149extern void ipv6_mc_up(struct inet6_dev *idev); 133void ipv6_mc_down(struct inet6_dev *idev);
150extern void ipv6_mc_down(struct inet6_dev *idev); 134void ipv6_mc_unmap(struct inet6_dev *idev);
151extern void ipv6_mc_unmap(struct inet6_dev *idev); 135void ipv6_mc_remap(struct inet6_dev *idev);
152extern void ipv6_mc_remap(struct inet6_dev *idev); 136void ipv6_mc_init_dev(struct inet6_dev *idev);
153extern void ipv6_mc_init_dev(struct inet6_dev *idev); 137void ipv6_mc_destroy_dev(struct inet6_dev *idev);
154extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 138void addrconf_dad_failure(struct inet6_ifaddr *ifp);
155extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 139
156 140bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
157extern bool ipv6_chk_mcast_addr(struct net_device *dev, 141 const struct in6_addr *src_addr);
158 const struct in6_addr *group, 142
159 const struct in6_addr *src_addr); 143void ipv6_mc_dad_complete(struct inet6_dev *idev);
160 144
161extern void ipv6_mc_dad_complete(struct inet6_dev *idev); 145/* A stub used by vxlan module. This is ugly, ideally these
146 * symbols should be built into the core kernel.
147 */
148struct ipv6_stub {
149 int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex,
150 const struct in6_addr *addr);
151 int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex,
152 const struct in6_addr *addr);
153 int (*ipv6_dst_lookup)(struct sock *sk, struct dst_entry **dst,
154 struct flowi6 *fl6);
155 void (*udpv6_encap_enable)(void);
156 void (*ndisc_send_na)(struct net_device *dev, struct neighbour *neigh,
157 const struct in6_addr *daddr,
158 const struct in6_addr *solicited_addr,
159 bool router, bool solicited, bool override, bool inc_opt);
160 struct neigh_table *nd_tbl;
161};
162extern const struct ipv6_stub *ipv6_stub __read_mostly;
163
162/* 164/*
163 * identify MLD packets for MLD filter exceptions 165 * identify MLD packets for MLD filter exceptions
164 */ 166 */
@@ -184,29 +186,31 @@ static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
184 return false; 186 return false;
185} 187}
186 188
187extern void addrconf_prefix_rcv(struct net_device *dev, 189void addrconf_prefix_rcv(struct net_device *dev,
188 u8 *opt, int len, bool sllao); 190 u8 *opt, int len, bool sllao);
189 191
190/* 192/*
191 * anycast prototypes (anycast.c) 193 * anycast prototypes (anycast.c)
192 */ 194 */
193extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 195int ipv6_sock_ac_join(struct sock *sk, int ifindex,
194extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 196 const struct in6_addr *addr);
195extern void ipv6_sock_ac_close(struct sock *sk); 197int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
196 198 const struct in6_addr *addr);
197extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 199void ipv6_sock_ac_close(struct sock *sk);
198extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 200
199extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 201int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
202int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
203bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
200 const struct in6_addr *addr); 204 const struct in6_addr *addr);
201 205
202 206
203/* Device notifier */ 207/* Device notifier */
204extern int register_inet6addr_notifier(struct notifier_block *nb); 208int register_inet6addr_notifier(struct notifier_block *nb);
205extern int unregister_inet6addr_notifier(struct notifier_block *nb); 209int unregister_inet6addr_notifier(struct notifier_block *nb);
206extern int inet6addr_notifier_call_chain(unsigned long val, void *v); 210int inet6addr_notifier_call_chain(unsigned long val, void *v);
207 211
208extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 212void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
209 struct ipv6_devconf *devconf); 213 struct ipv6_devconf *devconf);
210 214
211/** 215/**
212 * __in6_dev_get - get inet6_dev pointer from netdevice 216 * __in6_dev_get - get inet6_dev pointer from netdevice
@@ -240,7 +244,7 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
240 return idev; 244 return idev;
241} 245}
242 246
243extern void in6_dev_finish_destroy(struct inet6_dev *idev); 247void in6_dev_finish_destroy(struct inet6_dev *idev);
244 248
245static inline void in6_dev_put(struct inet6_dev *idev) 249static inline void in6_dev_put(struct inet6_dev *idev)
246{ 250{
@@ -258,7 +262,7 @@ static inline void in6_dev_hold(struct inet6_dev *idev)
258 atomic_inc(&idev->refcnt); 262 atomic_inc(&idev->refcnt);
259} 263}
260 264
261extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 265void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
262 266
263static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 267static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
264{ 268{
@@ -340,8 +344,8 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
340} 344}
341 345
342#ifdef CONFIG_PROC_FS 346#ifdef CONFIG_PROC_FS
343extern int if6_proc_init(void); 347int if6_proc_init(void);
344extern void if6_proc_exit(void); 348void if6_proc_exit(void);
345#endif 349#endif
346 350
347#endif 351#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 03e6e9453623..e797d45a5ae6 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -31,24 +31,21 @@ enum {
31 31
32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long, 32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long,
33 struct sk_buff *); 33 struct sk_buff *);
34extern void rxrpc_kernel_intercept_rx_messages(struct socket *, 34void rxrpc_kernel_intercept_rx_messages(struct socket *, rxrpc_interceptor_t);
35 rxrpc_interceptor_t); 35struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
36extern struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *, 36 struct sockaddr_rxrpc *,
37 struct sockaddr_rxrpc *, 37 struct key *,
38 struct key *, 38 unsigned long,
39 unsigned long, 39 gfp_t);
40 gfp_t); 40int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
41extern int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, 41void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
42 size_t); 42void rxrpc_kernel_end_call(struct rxrpc_call *);
43extern void rxrpc_kernel_abort_call(struct rxrpc_call *, u32); 43bool rxrpc_kernel_is_data_last(struct sk_buff *);
44extern void rxrpc_kernel_end_call(struct rxrpc_call *); 44u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
45extern bool rxrpc_kernel_is_data_last(struct sk_buff *); 45int rxrpc_kernel_get_error_number(struct sk_buff *);
46extern u32 rxrpc_kernel_get_abort_code(struct sk_buff *); 46void rxrpc_kernel_data_delivered(struct sk_buff *);
47extern int rxrpc_kernel_get_error_number(struct sk_buff *); 47void rxrpc_kernel_free_skb(struct sk_buff *);
48extern void rxrpc_kernel_data_delivered(struct sk_buff *); 48struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
49extern void rxrpc_kernel_free_skb(struct sk_buff *); 49int rxrpc_kernel_reject_call(struct socket *);
50extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *,
51 unsigned long);
52extern int rxrpc_kernel_reject_call(struct socket *);
53 50
54#endif /* _NET_RXRPC_H */ 51#endif /* _NET_RXRPC_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index dbdfd2b0f3b3..a175ba4a7adb 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -6,12 +6,12 @@
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <net/sock.h> 7#include <net/sock.h>
8 8
9extern void unix_inflight(struct file *fp); 9void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11void unix_gc(void);
12extern void wait_for_unix_gc(void); 12void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp); 13struct sock *unix_get_socket(struct file *filp);
14extern struct sock *unix_peer_get(struct sock *); 14struct sock *unix_peer_get(struct sock *);
15 15
16#define UNIX_HASH_SIZE 256 16#define UNIX_HASH_SIZE 256
17#define UNIX_HASH_BITS 8 17#define UNIX_HASH_BITS 8
@@ -35,6 +35,7 @@ struct unix_skb_parms {
35#ifdef CONFIG_SECURITY_NETWORK 35#ifdef CONFIG_SECURITY_NETWORK
36 u32 secid; /* Security ID */ 36 u32 secid; /* Security ID */
37#endif 37#endif
38 u32 consumed;
38}; 39};
39 40
40#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) 41#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
@@ -71,8 +72,8 @@ long unix_inq_len(struct sock *sk);
71long unix_outq_len(struct sock *sk); 72long unix_outq_len(struct sock *sk);
72 73
73#ifdef CONFIG_SYSCTL 74#ifdef CONFIG_SYSCTL
74extern int unix_sysctl_register(struct net *net); 75int unix_sysctl_register(struct net *net);
75extern void unix_sysctl_unregister(struct net *net); 76void unix_sysctl_unregister(struct net *net);
76#else 77#else
77static inline int unix_sysctl_register(struct net *net) { return 0; } 78static inline int unix_sysctl_register(struct net *net) { return 0; }
78static inline void unix_sysctl_unregister(struct net *net) {} 79static inline void unix_sysctl_unregister(struct net *net) {}
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
new file mode 100644
index 000000000000..7d64d3609ec9
--- /dev/null
+++ b/include/net/af_vsock.h
@@ -0,0 +1,175 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __AF_VSOCK_H__
17#define __AF_VSOCK_H__
18
19#include <linux/kernel.h>
20#include <linux/workqueue.h>
21#include <linux/vm_sockets.h>
22
23#include "vsock_addr.h"
24
25#define LAST_RESERVED_PORT 1023
26
27#define vsock_sk(__sk) ((struct vsock_sock *)__sk)
28#define sk_vsock(__vsk) (&(__vsk)->sk)
29
30struct vsock_sock {
31 /* sk must be the first member. */
32 struct sock sk;
33 struct sockaddr_vm local_addr;
34 struct sockaddr_vm remote_addr;
35 /* Links for the global tables of bound and connected sockets. */
36 struct list_head bound_table;
37 struct list_head connected_table;
38 /* Accessed without the socket lock held. This means it can never be
39 * modified outsided of socket create or destruct.
40 */
41 bool trusted;
42 bool cached_peer_allow_dgram; /* Dgram communication allowed to
43 * cached peer?
44 */
45 u32 cached_peer; /* Context ID of last dgram destination check. */
46 const struct cred *owner;
47 /* Rest are SOCK_STREAM only. */
48 long connect_timeout;
49 /* Listening socket that this came from. */
50 struct sock *listener;
51 /* Used for pending list and accept queue during connection handshake.
52 * The listening socket is the head for both lists. Sockets created
53 * for connection requests are placed in the pending list until they
54 * are connected, at which point they are put in the accept queue list
55 * so they can be accepted in accept(). If accept() cannot accept the
56 * connection, it is marked as rejected so the cleanup function knows
57 * to clean up the socket.
58 */
59 struct list_head pending_links;
60 struct list_head accept_queue;
61 bool rejected;
62 struct delayed_work dwork;
63 u32 peer_shutdown;
64 bool sent_request;
65 bool ignore_connecting_rst;
66
67 /* Private to transport. */
68 void *trans;
69};
70
71s64 vsock_stream_has_data(struct vsock_sock *vsk);
72s64 vsock_stream_has_space(struct vsock_sock *vsk);
73void vsock_pending_work(struct work_struct *work);
74struct sock *__vsock_create(struct net *net,
75 struct socket *sock,
76 struct sock *parent,
77 gfp_t priority, unsigned short type);
78
79/**** TRANSPORT ****/
80
81struct vsock_transport_recv_notify_data {
82 u64 data1; /* Transport-defined. */
83 u64 data2; /* Transport-defined. */
84 bool notify_on_block;
85};
86
87struct vsock_transport_send_notify_data {
88 u64 data1; /* Transport-defined. */
89 u64 data2; /* Transport-defined. */
90};
91
92struct vsock_transport {
93 /* Initialize/tear-down socket. */
94 int (*init)(struct vsock_sock *, struct vsock_sock *);
95 void (*destruct)(struct vsock_sock *);
96 void (*release)(struct vsock_sock *);
97
98 /* Connections. */
99 int (*connect)(struct vsock_sock *);
100
101 /* DGRAM. */
102 int (*dgram_bind)(struct vsock_sock *, struct sockaddr_vm *);
103 int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
104 struct msghdr *msg, size_t len, int flags);
105 int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
106 struct iovec *, size_t len);
107 bool (*dgram_allow)(u32 cid, u32 port);
108
109 /* STREAM. */
110 /* TODO: stream_bind() */
111 ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
112 size_t len, int flags);
113 ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
114 size_t len);
115 s64 (*stream_has_data)(struct vsock_sock *);
116 s64 (*stream_has_space)(struct vsock_sock *);
117 u64 (*stream_rcvhiwat)(struct vsock_sock *);
118 bool (*stream_is_active)(struct vsock_sock *);
119 bool (*stream_allow)(u32 cid, u32 port);
120
121 /* Notification. */
122 int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
123 int (*notify_poll_out)(struct vsock_sock *, size_t, bool *);
124 int (*notify_recv_init)(struct vsock_sock *, size_t,
125 struct vsock_transport_recv_notify_data *);
126 int (*notify_recv_pre_block)(struct vsock_sock *, size_t,
127 struct vsock_transport_recv_notify_data *);
128 int (*notify_recv_pre_dequeue)(struct vsock_sock *, size_t,
129 struct vsock_transport_recv_notify_data *);
130 int (*notify_recv_post_dequeue)(struct vsock_sock *, size_t,
131 ssize_t, bool, struct vsock_transport_recv_notify_data *);
132 int (*notify_send_init)(struct vsock_sock *,
133 struct vsock_transport_send_notify_data *);
134 int (*notify_send_pre_block)(struct vsock_sock *,
135 struct vsock_transport_send_notify_data *);
136 int (*notify_send_pre_enqueue)(struct vsock_sock *,
137 struct vsock_transport_send_notify_data *);
138 int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
139 struct vsock_transport_send_notify_data *);
140
141 /* Shutdown. */
142 int (*shutdown)(struct vsock_sock *, int);
143
144 /* Buffer sizes. */
145 void (*set_buffer_size)(struct vsock_sock *, u64);
146 void (*set_min_buffer_size)(struct vsock_sock *, u64);
147 void (*set_max_buffer_size)(struct vsock_sock *, u64);
148 u64 (*get_buffer_size)(struct vsock_sock *);
149 u64 (*get_min_buffer_size)(struct vsock_sock *);
150 u64 (*get_max_buffer_size)(struct vsock_sock *);
151
152 /* Addressing. */
153 u32 (*get_local_cid)(void);
154};
155
156/**** CORE ****/
157
158int vsock_core_init(const struct vsock_transport *t);
159void vsock_core_exit(void);
160
161/**** UTILS ****/
162
163void vsock_release_pending(struct sock *pending);
164void vsock_add_pending(struct sock *listener, struct sock *pending);
165void vsock_remove_pending(struct sock *listener, struct sock *pending);
166void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
167void vsock_insert_connected(struct vsock_sock *vsk);
168void vsock_remove_bound(struct vsock_sock *vsk);
169void vsock_remove_connected(struct vsock_sock *vsk);
170struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
171struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
172 struct sockaddr_vm *dst);
173void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
174
175#endif /* __AF_VSOCK_H__ */
diff --git a/include/net/arp.h b/include/net/arp.h
index b630dae03411..7509d9da4e36 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -46,22 +46,22 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32
46 return n; 46 return n;
47} 47}
48 48
49extern void arp_init(void); 49void arp_init(void);
50extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 50int arp_find(unsigned char *haddr, struct sk_buff *skb);
51extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 51int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
52extern void arp_send(int type, int ptype, __be32 dest_ip, 52void arp_send(int type, int ptype, __be32 dest_ip,
53 struct net_device *dev, __be32 src_ip, 53 struct net_device *dev, __be32 src_ip,
54 const unsigned char *dest_hw, 54 const unsigned char *dest_hw,
55 const unsigned char *src_hw, const unsigned char *th); 55 const unsigned char *src_hw, const unsigned char *th);
56extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 56int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
57extern void arp_ifdown(struct net_device *dev); 57void arp_ifdown(struct net_device *dev);
58 58
59extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, 59struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
60 struct net_device *dev, __be32 src_ip, 60 struct net_device *dev, __be32 src_ip,
61 const unsigned char *dest_hw, 61 const unsigned char *dest_hw,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64extern void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip); 65int arp_invalidate(struct net_device *dev, __be32 ip);
66 66
67#endif /* _ARP_H */ 67#endif /* _ARP_H */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 89ed9ac5701f..bf0396e9a5d3 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -195,7 +195,7 @@ static inline void ax25_hold_route(ax25_route *ax25_rt)
195 atomic_inc(&ax25_rt->refcount); 195 atomic_inc(&ax25_rt->refcount);
196} 196}
197 197
198extern void __ax25_put_route(ax25_route *ax25_rt); 198void __ax25_put_route(ax25_route *ax25_rt);
199 199
200static inline void ax25_put_route(ax25_route *ax25_rt) 200static inline void ax25_put_route(ax25_route *ax25_rt)
201{ 201{
@@ -272,30 +272,31 @@ static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev
272/* af_ax25.c */ 272/* af_ax25.c */
273extern struct hlist_head ax25_list; 273extern struct hlist_head ax25_list;
274extern spinlock_t ax25_list_lock; 274extern spinlock_t ax25_list_lock;
275extern void ax25_cb_add(ax25_cb *); 275void ax25_cb_add(ax25_cb *);
276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); 276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int);
277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); 277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int);
278extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 278ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *,
279extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); 279 struct net_device *);
280extern void ax25_destroy_socket(ax25_cb *); 280void ax25_send_to_raw(ax25_address *, struct sk_buff *, int);
281extern ax25_cb * __must_check ax25_create_cb(void); 281void ax25_destroy_socket(ax25_cb *);
282extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); 282ax25_cb * __must_check ax25_create_cb(void);
283extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 283void ax25_fillin_cb(ax25_cb *, ax25_dev *);
284struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
284 285
285/* ax25_addr.c */ 286/* ax25_addr.c */
286extern const ax25_address ax25_bcast; 287extern const ax25_address ax25_bcast;
287extern const ax25_address ax25_defaddr; 288extern const ax25_address ax25_defaddr;
288extern const ax25_address null_ax25_address; 289extern const ax25_address null_ax25_address;
289extern char *ax2asc(char *buf, const ax25_address *); 290char *ax2asc(char *buf, const ax25_address *);
290extern void asc2ax(ax25_address *addr, const char *callsign); 291void asc2ax(ax25_address *addr, const char *callsign);
291extern int ax25cmp(const ax25_address *, const ax25_address *); 292int ax25cmp(const ax25_address *, const ax25_address *);
292extern int ax25digicmp(const ax25_digi *, const ax25_digi *); 293int ax25digicmp(const ax25_digi *, const ax25_digi *);
293extern const unsigned char *ax25_addr_parse(const unsigned char *, int, 294const unsigned char *ax25_addr_parse(const unsigned char *, int,
294 ax25_address *, ax25_address *, ax25_digi *, int *, int *); 295 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
295extern int ax25_addr_build(unsigned char *, const ax25_address *, 296int ax25_addr_build(unsigned char *, const ax25_address *,
296 const ax25_address *, const ax25_digi *, int, int); 297 const ax25_address *, const ax25_digi *, int, int);
297extern int ax25_addr_size(const ax25_digi *); 298int ax25_addr_size(const ax25_digi *);
298extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); 299void ax25_digi_invert(const ax25_digi *, ax25_digi *);
299 300
300/* ax25_dev.c */ 301/* ax25_dev.c */
301extern ax25_dev *ax25_dev_list; 302extern ax25_dev *ax25_dev_list;
@@ -306,33 +307,33 @@ static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
306 return dev->ax25_ptr; 307 return dev->ax25_ptr;
307} 308}
308 309
309extern ax25_dev *ax25_addr_ax25dev(ax25_address *); 310ax25_dev *ax25_addr_ax25dev(ax25_address *);
310extern void ax25_dev_device_up(struct net_device *); 311void ax25_dev_device_up(struct net_device *);
311extern void ax25_dev_device_down(struct net_device *); 312void ax25_dev_device_down(struct net_device *);
312extern int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *); 313int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *);
313extern struct net_device *ax25_fwd_dev(struct net_device *); 314struct net_device *ax25_fwd_dev(struct net_device *);
314extern void ax25_dev_free(void); 315void ax25_dev_free(void);
315 316
316/* ax25_ds_in.c */ 317/* ax25_ds_in.c */
317extern int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int); 318int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int);
318 319
319/* ax25_ds_subr.c */ 320/* ax25_ds_subr.c */
320extern void ax25_ds_nr_error_recovery(ax25_cb *); 321void ax25_ds_nr_error_recovery(ax25_cb *);
321extern void ax25_ds_enquiry_response(ax25_cb *); 322void ax25_ds_enquiry_response(ax25_cb *);
322extern void ax25_ds_establish_data_link(ax25_cb *); 323void ax25_ds_establish_data_link(ax25_cb *);
323extern void ax25_dev_dama_off(ax25_dev *); 324void ax25_dev_dama_off(ax25_dev *);
324extern void ax25_dama_on(ax25_cb *); 325void ax25_dama_on(ax25_cb *);
325extern void ax25_dama_off(ax25_cb *); 326void ax25_dama_off(ax25_cb *);
326 327
327/* ax25_ds_timer.c */ 328/* ax25_ds_timer.c */
328extern void ax25_ds_setup_timer(ax25_dev *); 329void ax25_ds_setup_timer(ax25_dev *);
329extern void ax25_ds_set_timer(ax25_dev *); 330void ax25_ds_set_timer(ax25_dev *);
330extern void ax25_ds_del_timer(ax25_dev *); 331void ax25_ds_del_timer(ax25_dev *);
331extern void ax25_ds_timer(ax25_cb *); 332void ax25_ds_timer(ax25_cb *);
332extern void ax25_ds_t1_timeout(ax25_cb *); 333void ax25_ds_t1_timeout(ax25_cb *);
333extern void ax25_ds_heartbeat_expiry(ax25_cb *); 334void ax25_ds_heartbeat_expiry(ax25_cb *);
334extern void ax25_ds_t3timer_expiry(ax25_cb *); 335void ax25_ds_t3timer_expiry(ax25_cb *);
335extern void ax25_ds_idletimer_expiry(ax25_cb *); 336void ax25_ds_idletimer_expiry(ax25_cb *);
336 337
337/* ax25_iface.c */ 338/* ax25_iface.c */
338 339
@@ -342,107 +343,109 @@ struct ax25_protocol {
342 int (*func)(struct sk_buff *, ax25_cb *); 343 int (*func)(struct sk_buff *, ax25_cb *);
343}; 344};
344 345
345extern void ax25_register_pid(struct ax25_protocol *ap); 346void ax25_register_pid(struct ax25_protocol *ap);
346extern void ax25_protocol_release(unsigned int); 347void ax25_protocol_release(unsigned int);
347 348
348struct ax25_linkfail { 349struct ax25_linkfail {
349 struct hlist_node lf_node; 350 struct hlist_node lf_node;
350 void (*func)(ax25_cb *, int); 351 void (*func)(ax25_cb *, int);
351}; 352};
352 353
353extern void ax25_linkfail_register(struct ax25_linkfail *lf); 354void ax25_linkfail_register(struct ax25_linkfail *lf);
354extern void ax25_linkfail_release(struct ax25_linkfail *lf); 355void ax25_linkfail_release(struct ax25_linkfail *lf);
355extern int __must_check ax25_listen_register(ax25_address *, 356int __must_check ax25_listen_register(ax25_address *, struct net_device *);
356 struct net_device *); 357void ax25_listen_release(ax25_address *, struct net_device *);
357extern void ax25_listen_release(ax25_address *, struct net_device *); 358int(*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *);
358extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); 359int ax25_listen_mine(ax25_address *, struct net_device *);
359extern int ax25_listen_mine(ax25_address *, struct net_device *); 360void ax25_link_failed(ax25_cb *, int);
360extern void ax25_link_failed(ax25_cb *, int); 361int ax25_protocol_is_registered(unsigned int);
361extern int ax25_protocol_is_registered(unsigned int);
362 362
363/* ax25_in.c */ 363/* ax25_in.c */
364extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *); 364int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
365extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); 365int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *,
366 struct net_device *);
366 367
367/* ax25_ip.c */ 368/* ax25_ip.c */
368extern int ax25_hard_header(struct sk_buff *, struct net_device *, 369int ax25_hard_header(struct sk_buff *, struct net_device *, unsigned short,
369 unsigned short, const void *, 370 const void *, const void *, unsigned int);
370 const void *, unsigned int); 371int ax25_rebuild_header(struct sk_buff *);
371extern int ax25_rebuild_header(struct sk_buff *);
372extern const struct header_ops ax25_header_ops; 372extern const struct header_ops ax25_header_ops;
373 373
374/* ax25_out.c */ 374/* ax25_out.c */
375extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 375ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *,
376extern void ax25_output(ax25_cb *, int, struct sk_buff *); 376 ax25_digi *, struct net_device *);
377extern void ax25_kick(ax25_cb *); 377void ax25_output(ax25_cb *, int, struct sk_buff *);
378extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); 378void ax25_kick(ax25_cb *);
379extern void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev); 379void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int);
380extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); 380void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev);
381int ax25_check_iframes_acked(ax25_cb *, unsigned short);
381 382
382/* ax25_route.c */ 383/* ax25_route.c */
383extern void ax25_rt_device_down(struct net_device *); 384void ax25_rt_device_down(struct net_device *);
384extern int ax25_rt_ioctl(unsigned int, void __user *); 385int ax25_rt_ioctl(unsigned int, void __user *);
385extern const struct file_operations ax25_route_fops; 386extern const struct file_operations ax25_route_fops;
386extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 387ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
387extern int ax25_rt_autobind(ax25_cb *, ax25_address *); 388int ax25_rt_autobind(ax25_cb *, ax25_address *);
388extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); 389struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *,
389extern void ax25_rt_free(void); 390 ax25_address *, ax25_digi *);
391void ax25_rt_free(void);
390 392
391/* ax25_std_in.c */ 393/* ax25_std_in.c */
392extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); 394int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);
393 395
394/* ax25_std_subr.c */ 396/* ax25_std_subr.c */
395extern void ax25_std_nr_error_recovery(ax25_cb *); 397void ax25_std_nr_error_recovery(ax25_cb *);
396extern void ax25_std_establish_data_link(ax25_cb *); 398void ax25_std_establish_data_link(ax25_cb *);
397extern void ax25_std_transmit_enquiry(ax25_cb *); 399void ax25_std_transmit_enquiry(ax25_cb *);
398extern void ax25_std_enquiry_response(ax25_cb *); 400void ax25_std_enquiry_response(ax25_cb *);
399extern void ax25_std_timeout_response(ax25_cb *); 401void ax25_std_timeout_response(ax25_cb *);
400 402
401/* ax25_std_timer.c */ 403/* ax25_std_timer.c */
402extern void ax25_std_heartbeat_expiry(ax25_cb *); 404void ax25_std_heartbeat_expiry(ax25_cb *);
403extern void ax25_std_t1timer_expiry(ax25_cb *); 405void ax25_std_t1timer_expiry(ax25_cb *);
404extern void ax25_std_t2timer_expiry(ax25_cb *); 406void ax25_std_t2timer_expiry(ax25_cb *);
405extern void ax25_std_t3timer_expiry(ax25_cb *); 407void ax25_std_t3timer_expiry(ax25_cb *);
406extern void ax25_std_idletimer_expiry(ax25_cb *); 408void ax25_std_idletimer_expiry(ax25_cb *);
407 409
408/* ax25_subr.c */ 410/* ax25_subr.c */
409extern void ax25_clear_queues(ax25_cb *); 411void ax25_clear_queues(ax25_cb *);
410extern void ax25_frames_acked(ax25_cb *, unsigned short); 412void ax25_frames_acked(ax25_cb *, unsigned short);
411extern void ax25_requeue_frames(ax25_cb *); 413void ax25_requeue_frames(ax25_cb *);
412extern int ax25_validate_nr(ax25_cb *, unsigned short); 414int ax25_validate_nr(ax25_cb *, unsigned short);
413extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *); 415int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *);
414extern void ax25_send_control(ax25_cb *, int, int, int); 416void ax25_send_control(ax25_cb *, int, int, int);
415extern void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *, ax25_digi *); 417void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *,
416extern void ax25_calculate_t1(ax25_cb *); 418 ax25_digi *);
417extern void ax25_calculate_rtt(ax25_cb *); 419void ax25_calculate_t1(ax25_cb *);
418extern void ax25_disconnect(ax25_cb *, int); 420void ax25_calculate_rtt(ax25_cb *);
421void ax25_disconnect(ax25_cb *, int);
419 422
420/* ax25_timer.c */ 423/* ax25_timer.c */
421extern void ax25_setup_timers(ax25_cb *); 424void ax25_setup_timers(ax25_cb *);
422extern void ax25_start_heartbeat(ax25_cb *); 425void ax25_start_heartbeat(ax25_cb *);
423extern void ax25_start_t1timer(ax25_cb *); 426void ax25_start_t1timer(ax25_cb *);
424extern void ax25_start_t2timer(ax25_cb *); 427void ax25_start_t2timer(ax25_cb *);
425extern void ax25_start_t3timer(ax25_cb *); 428void ax25_start_t3timer(ax25_cb *);
426extern void ax25_start_idletimer(ax25_cb *); 429void ax25_start_idletimer(ax25_cb *);
427extern void ax25_stop_heartbeat(ax25_cb *); 430void ax25_stop_heartbeat(ax25_cb *);
428extern void ax25_stop_t1timer(ax25_cb *); 431void ax25_stop_t1timer(ax25_cb *);
429extern void ax25_stop_t2timer(ax25_cb *); 432void ax25_stop_t2timer(ax25_cb *);
430extern void ax25_stop_t3timer(ax25_cb *); 433void ax25_stop_t3timer(ax25_cb *);
431extern void ax25_stop_idletimer(ax25_cb *); 434void ax25_stop_idletimer(ax25_cb *);
432extern int ax25_t1timer_running(ax25_cb *); 435int ax25_t1timer_running(ax25_cb *);
433extern unsigned long ax25_display_timer(struct timer_list *); 436unsigned long ax25_display_timer(struct timer_list *);
434 437
435/* ax25_uid.c */ 438/* ax25_uid.c */
436extern int ax25_uid_policy; 439extern int ax25_uid_policy;
437extern ax25_uid_assoc *ax25_findbyuid(kuid_t); 440ax25_uid_assoc *ax25_findbyuid(kuid_t);
438extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); 441int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
439extern const struct file_operations ax25_uid_fops; 442extern const struct file_operations ax25_uid_fops;
440extern void ax25_uid_free(void); 443void ax25_uid_free(void);
441 444
442/* sysctl_net_ax25.c */ 445/* sysctl_net_ax25.c */
443#ifdef CONFIG_SYSCTL 446#ifdef CONFIG_SYSCTL
444extern int ax25_register_dev_sysctl(ax25_dev *ax25_dev); 447int ax25_register_dev_sysctl(ax25_dev *ax25_dev);
445extern void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); 448void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev);
446#else 449#else
447static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } 450static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; }
448static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} 451static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {}
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 10eb9b389014..10d43d8c7037 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -107,6 +107,14 @@ struct bt_power {
107 */ 107 */
108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2 108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2
109 109
110#define BT_VOICE 11
111struct bt_voice {
112 __u16 setting;
113};
114
115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060
117
110__printf(1, 2) 118__printf(1, 2)
111int bt_info(const char *fmt, ...); 119int bt_info(const char *fmt, ...);
112__printf(1, 2) 120__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3c592cf473da..aaeaf0938ec0 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -238,6 +238,7 @@ enum {
238#define LMP_CVSD 0x01 238#define LMP_CVSD 0x01
239#define LMP_PSCHEME 0x02 239#define LMP_PSCHEME 0x02
240#define LMP_PCONTROL 0x04 240#define LMP_PCONTROL 0x04
241#define LMP_TRANSPARENT 0x08
241 242
242#define LMP_RSSI_INQ 0x40 243#define LMP_RSSI_INQ 0x40
243#define LMP_ESCO 0x80 244#define LMP_ESCO 0x80
@@ -296,6 +297,12 @@ enum {
296#define HCI_AT_GENERAL_BONDING 0x04 297#define HCI_AT_GENERAL_BONDING 0x04
297#define HCI_AT_GENERAL_BONDING_MITM 0x05 298#define HCI_AT_GENERAL_BONDING_MITM 0x05
298 299
300/* I/O capabilities */
301#define HCI_IO_DISPLAY_ONLY 0x00
302#define HCI_IO_DISPLAY_YESNO 0x01
303#define HCI_IO_KEYBOARD_ONLY 0x02
304#define HCI_IO_NO_INPUT_OUTPUT 0x03
305
299/* Link Key types */ 306/* Link Key types */
300#define HCI_LK_COMBINATION 0x00 307#define HCI_LK_COMBINATION 0x00
301#define HCI_LK_LOCAL_UNIT 0x01 308#define HCI_LK_LOCAL_UNIT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f77885ea78c2..3ede820d328f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -320,6 +320,7 @@ struct hci_conn {
320 __u32 passkey_notify; 320 __u32 passkey_notify;
321 __u8 passkey_entered; 321 __u8 passkey_entered;
322 __u16 disc_timeout; 322 __u16 disc_timeout;
323 __u16 setting;
323 unsigned long flags; 324 unsigned long flags;
324 325
325 __u8 remote_cap; 326 __u8 remote_cap;
@@ -569,7 +570,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
569} 570}
570 571
571void hci_disconnect(struct hci_conn *conn, __u8 reason); 572void hci_disconnect(struct hci_conn *conn, __u8 reason);
572void hci_setup_sync(struct hci_conn *conn, __u16 handle); 573bool hci_setup_sync(struct hci_conn *conn, __u16 handle);
573void hci_sco_setup(struct hci_conn *conn, __u8 status); 574void hci_sco_setup(struct hci_conn *conn, __u8 status);
574 575
575struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); 576struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
@@ -584,6 +585,8 @@ struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
584 585
585struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 586struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
586 __u8 dst_type, __u8 sec_level, __u8 auth_type); 587 __u8 dst_type, __u8 sec_level, __u8 auth_type);
588struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
589 __u16 setting);
587int hci_conn_check_link_mode(struct hci_conn *conn); 590int hci_conn_check_link_mode(struct hci_conn *conn);
588int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 591int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
589int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 592int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
@@ -797,6 +800,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
797#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO) 800#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO)
798#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR) 801#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR)
799#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES) 802#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES)
803#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
800 804
801/* ----- Extended LMP capabilities ----- */ 805/* ----- Extended LMP capabilities ----- */
802#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 806#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
@@ -1213,4 +1217,8 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
1213 1217
1214u8 bdaddr_to_le(u8 bdaddr_type); 1218u8 bdaddr_to_le(u8 bdaddr_type);
1215 1219
1220#define SCO_AIRMODE_MASK 0x0003
1221#define SCO_AIRMODE_CVSD 0x0000
1222#define SCO_AIRMODE_TRANSP 0x0003
1223
1216#endif /* __HCI_CORE_H */ 1224#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h
index 1e35c43657c8..e252a31ee6b6 100644
--- a/include/net/bluetooth/sco.h
+++ b/include/net/bluetooth/sco.h
@@ -73,6 +73,7 @@ struct sco_conn {
73struct sco_pinfo { 73struct sco_pinfo {
74 struct bt_sock bt; 74 struct bt_sock bt;
75 __u32 flags; 75 __u32 flags;
76 __u16 setting;
76 struct sco_conn *conn; 77 struct sco_conn *conn;
77}; 78};
78 79
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7b0730aeb892..cb710913d5c8 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -461,6 +461,33 @@ ieee80211_chandef_rate_flags(struct cfg80211_chan_def *chandef)
461} 461}
462 462
463/** 463/**
464 * ieee80211_chandef_max_power - maximum transmission power for the chandef
465 *
466 * In some regulations, the transmit power may depend on the configured channel
467 * bandwidth which may be defined as dBm/MHz. This function returns the actual
468 * max_power for non-standard (20 MHz) channels.
469 *
470 * @chandef: channel definition for the channel
471 *
472 * Returns: maximum allowed transmission power in dBm for the chandef
473 */
474static inline int
475ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
476{
477 switch (chandef->width) {
478 case NL80211_CHAN_WIDTH_5:
479 return min(chandef->chan->max_reg_power - 6,
480 chandef->chan->max_power);
481 case NL80211_CHAN_WIDTH_10:
482 return min(chandef->chan->max_reg_power - 3,
483 chandef->chan->max_power);
484 default:
485 break;
486 }
487 return chandef->chan->max_power;
488}
489
490/**
464 * enum survey_info_flags - survey information flags 491 * enum survey_info_flags - survey information flags
465 * 492 *
466 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 493 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -490,7 +517,7 @@ enum survey_info_flags {
490 * @channel: the channel this survey record reports, mandatory 517 * @channel: the channel this survey record reports, mandatory
491 * @filled: bitflag of flags from &enum survey_info_flags 518 * @filled: bitflag of flags from &enum survey_info_flags
492 * @noise: channel noise in dBm. This and all following fields are 519 * @noise: channel noise in dBm. This and all following fields are
493 * optional 520 * optional
494 * @channel_time: amount of time in ms the radio spent on the channel 521 * @channel_time: amount of time in ms the radio spent on the channel
495 * @channel_time_busy: amount of time the primary channel was sensed busy 522 * @channel_time_busy: amount of time the primary channel was sensed busy
496 * @channel_time_ext_busy: amount of time the extension channel was sensed busy 523 * @channel_time_ext_busy: amount of time the extension channel was sensed busy
@@ -546,9 +573,9 @@ struct cfg80211_crypto_settings {
546/** 573/**
547 * struct cfg80211_beacon_data - beacon data 574 * struct cfg80211_beacon_data - beacon data
548 * @head: head portion of beacon (before TIM IE) 575 * @head: head portion of beacon (before TIM IE)
549 * or %NULL if not changed 576 * or %NULL if not changed
550 * @tail: tail portion of beacon (after TIM IE) 577 * @tail: tail portion of beacon (after TIM IE)
551 * or %NULL if not changed 578 * or %NULL if not changed
552 * @head_len: length of @head 579 * @head_len: length of @head
553 * @tail_len: length of @tail 580 * @tail_len: length of @tail
554 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL 581 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
@@ -639,6 +666,30 @@ struct cfg80211_ap_settings {
639}; 666};
640 667
641/** 668/**
669 * struct cfg80211_csa_settings - channel switch settings
670 *
671 * Used for channel switch
672 *
673 * @chandef: defines the channel to use after the switch
674 * @beacon_csa: beacon data while performing the switch
675 * @counter_offset_beacon: offset for the counter within the beacon (tail)
676 * @counter_offset_presp: offset for the counter within the probe response
677 * @beacon_after: beacon data to be used on the new channel
678 * @radar_required: whether radar detection is required on the new channel
679 * @block_tx: whether transmissions should be blocked while changing
680 * @count: number of beacons until switch
681 */
682struct cfg80211_csa_settings {
683 struct cfg80211_chan_def chandef;
684 struct cfg80211_beacon_data beacon_csa;
685 u16 counter_offset_beacon, counter_offset_presp;
686 struct cfg80211_beacon_data beacon_after;
687 bool radar_required;
688 bool block_tx;
689 u8 count;
690};
691
692/**
642 * enum station_parameters_apply_mask - station parameter values to apply 693 * enum station_parameters_apply_mask - station parameter values to apply
643 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 694 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
644 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 695 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
@@ -764,7 +815,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
764 * @STATION_INFO_PLINK_STATE: @plink_state filled 815 * @STATION_INFO_PLINK_STATE: @plink_state filled
765 * @STATION_INFO_SIGNAL: @signal filled 816 * @STATION_INFO_SIGNAL: @signal filled
766 * @STATION_INFO_TX_BITRATE: @txrate fields are filled 817 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
767 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 818 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
768 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value 819 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
769 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value 820 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
770 * @STATION_INFO_TX_RETRIES: @tx_retries filled 821 * @STATION_INFO_TX_RETRIES: @tx_retries filled
@@ -1285,6 +1336,7 @@ struct cfg80211_ssid {
1285 * @n_ssids: number of SSIDs 1336 * @n_ssids: number of SSIDs
1286 * @channels: channels to scan on. 1337 * @channels: channels to scan on.
1287 * @n_channels: total number of channels to scan 1338 * @n_channels: total number of channels to scan
1339 * @scan_width: channel width for scanning
1288 * @ie: optional information element(s) to add into Probe Request or %NULL 1340 * @ie: optional information element(s) to add into Probe Request or %NULL
1289 * @ie_len: length of ie in octets 1341 * @ie_len: length of ie in octets
1290 * @flags: bit field of flags controlling operation 1342 * @flags: bit field of flags controlling operation
@@ -1300,6 +1352,7 @@ struct cfg80211_scan_request {
1300 struct cfg80211_ssid *ssids; 1352 struct cfg80211_ssid *ssids;
1301 int n_ssids; 1353 int n_ssids;
1302 u32 n_channels; 1354 u32 n_channels;
1355 enum nl80211_bss_scan_width scan_width;
1303 const u8 *ie; 1356 const u8 *ie;
1304 size_t ie_len; 1357 size_t ie_len;
1305 u32 flags; 1358 u32 flags;
@@ -1333,6 +1386,7 @@ struct cfg80211_match_set {
1333 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) 1386 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
1334 * @n_ssids: number of SSIDs 1387 * @n_ssids: number of SSIDs
1335 * @n_channels: total number of channels to scan 1388 * @n_channels: total number of channels to scan
1389 * @scan_width: channel width for scanning
1336 * @interval: interval between each scheduled scan cycle 1390 * @interval: interval between each scheduled scan cycle
1337 * @ie: optional information element(s) to add into Probe Request or %NULL 1391 * @ie: optional information element(s) to add into Probe Request or %NULL
1338 * @ie_len: length of ie in octets 1392 * @ie_len: length of ie in octets
@@ -1352,6 +1406,7 @@ struct cfg80211_sched_scan_request {
1352 struct cfg80211_ssid *ssids; 1406 struct cfg80211_ssid *ssids;
1353 int n_ssids; 1407 int n_ssids;
1354 u32 n_channels; 1408 u32 n_channels;
1409 enum nl80211_bss_scan_width scan_width;
1355 u32 interval; 1410 u32 interval;
1356 const u8 *ie; 1411 const u8 *ie;
1357 size_t ie_len; 1412 size_t ie_len;
@@ -1403,6 +1458,7 @@ struct cfg80211_bss_ies {
1403 * for use in scan results and similar. 1458 * for use in scan results and similar.
1404 * 1459 *
1405 * @channel: channel this BSS is on 1460 * @channel: channel this BSS is on
1461 * @scan_width: width of the control channel
1406 * @bssid: BSSID of the BSS 1462 * @bssid: BSSID of the BSS
1407 * @beacon_interval: the beacon interval as from the frame 1463 * @beacon_interval: the beacon interval as from the frame
1408 * @capability: the capability field in host byte order 1464 * @capability: the capability field in host byte order
@@ -1424,6 +1480,7 @@ struct cfg80211_bss_ies {
1424 */ 1480 */
1425struct cfg80211_bss { 1481struct cfg80211_bss {
1426 struct ieee80211_channel *channel; 1482 struct ieee80211_channel *channel;
1483 enum nl80211_bss_scan_width scan_width;
1427 1484
1428 const struct cfg80211_bss_ies __rcu *ies; 1485 const struct cfg80211_bss_ies __rcu *ies;
1429 const struct cfg80211_bss_ies __rcu *beacon_ies; 1486 const struct cfg80211_bss_ies __rcu *beacon_ies;
@@ -1509,7 +1566,7 @@ enum cfg80211_assoc_req_flags {
1509 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame 1566 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
1510 * @flags: See &enum cfg80211_assoc_req_flags 1567 * @flags: See &enum cfg80211_assoc_req_flags
1511 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1568 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1512 * will be used in ht_capa. Un-supported values will be ignored. 1569 * will be used in ht_capa. Un-supported values will be ignored.
1513 * @ht_capa_mask: The bits of ht_capa which are to be used. 1570 * @ht_capa_mask: The bits of ht_capa which are to be used.
1514 * @vht_capa: VHT capability override 1571 * @vht_capa: VHT capability override
1515 * @vht_capa_mask: VHT capability mask indicating which fields to use 1572 * @vht_capa_mask: VHT capability mask indicating which fields to use
@@ -1592,6 +1649,9 @@ struct cfg80211_disassoc_request {
1592 * user space. Otherwise, port is marked authorized by default. 1649 * user space. Otherwise, port is marked authorized by default.
1593 * @basic_rates: bitmap of basic rates to use when creating the IBSS 1650 * @basic_rates: bitmap of basic rates to use when creating the IBSS
1594 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 1651 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
1652 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1653 * will be used in ht_capa. Un-supported values will be ignored.
1654 * @ht_capa_mask: The bits of ht_capa which are to be used.
1595 */ 1655 */
1596struct cfg80211_ibss_params { 1656struct cfg80211_ibss_params {
1597 u8 *ssid; 1657 u8 *ssid;
@@ -1605,6 +1665,8 @@ struct cfg80211_ibss_params {
1605 bool privacy; 1665 bool privacy;
1606 bool control_port; 1666 bool control_port;
1607 int mcast_rate[IEEE80211_NUM_BANDS]; 1667 int mcast_rate[IEEE80211_NUM_BANDS];
1668 struct ieee80211_ht_cap ht_capa;
1669 struct ieee80211_ht_cap ht_capa_mask;
1608}; 1670};
1609 1671
1610/** 1672/**
@@ -1630,9 +1692,9 @@ struct cfg80211_ibss_params {
1630 * @key: WEP key for shared key authentication 1692 * @key: WEP key for shared key authentication
1631 * @flags: See &enum cfg80211_assoc_req_flags 1693 * @flags: See &enum cfg80211_assoc_req_flags
1632 * @bg_scan_period: Background scan period in seconds 1694 * @bg_scan_period: Background scan period in seconds
1633 * or -1 to indicate that default value is to be used. 1695 * or -1 to indicate that default value is to be used.
1634 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1696 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1635 * will be used in ht_capa. Un-supported values will be ignored. 1697 * will be used in ht_capa. Un-supported values will be ignored.
1636 * @ht_capa_mask: The bits of ht_capa which are to be used. 1698 * @ht_capa_mask: The bits of ht_capa which are to be used.
1637 * @vht_capa: VHT Capability overrides 1699 * @vht_capa: VHT Capability overrides
1638 * @vht_capa_mask: The bits of vht_capa which are to be used. 1700 * @vht_capa_mask: The bits of vht_capa which are to be used.
@@ -1698,7 +1760,7 @@ struct cfg80211_pmksa {
1698}; 1760};
1699 1761
1700/** 1762/**
1701 * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern 1763 * struct cfg80211_pkt_pattern - packet pattern
1702 * @mask: bitmask where to match pattern and where to ignore bytes, 1764 * @mask: bitmask where to match pattern and where to ignore bytes,
1703 * one bit per byte, in same format as nl80211 1765 * one bit per byte, in same format as nl80211
1704 * @pattern: bytes to match where bitmask is 1 1766 * @pattern: bytes to match where bitmask is 1
@@ -1708,7 +1770,7 @@ struct cfg80211_pmksa {
1708 * Internal note: @mask and @pattern are allocated in one chunk of 1770 * Internal note: @mask and @pattern are allocated in one chunk of
1709 * memory, free @mask only! 1771 * memory, free @mask only!
1710 */ 1772 */
1711struct cfg80211_wowlan_trig_pkt_pattern { 1773struct cfg80211_pkt_pattern {
1712 u8 *mask, *pattern; 1774 u8 *mask, *pattern;
1713 int pattern_len; 1775 int pattern_len;
1714 int pkt_offset; 1776 int pkt_offset;
@@ -1770,12 +1832,41 @@ struct cfg80211_wowlan {
1770 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1832 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1771 eap_identity_req, four_way_handshake, 1833 eap_identity_req, four_way_handshake,
1772 rfkill_release; 1834 rfkill_release;
1773 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1835 struct cfg80211_pkt_pattern *patterns;
1774 struct cfg80211_wowlan_tcp *tcp; 1836 struct cfg80211_wowlan_tcp *tcp;
1775 int n_patterns; 1837 int n_patterns;
1776}; 1838};
1777 1839
1778/** 1840/**
1841 * struct cfg80211_coalesce_rules - Coalesce rule parameters
1842 *
1843 * This structure defines coalesce rule for the device.
1844 * @delay: maximum coalescing delay in msecs.
1845 * @condition: condition for packet coalescence.
1846 * see &enum nl80211_coalesce_condition.
1847 * @patterns: array of packet patterns
1848 * @n_patterns: number of patterns
1849 */
1850struct cfg80211_coalesce_rules {
1851 int delay;
1852 enum nl80211_coalesce_condition condition;
1853 struct cfg80211_pkt_pattern *patterns;
1854 int n_patterns;
1855};
1856
1857/**
1858 * struct cfg80211_coalesce - Packet coalescing settings
1859 *
1860 * This structure defines coalescing settings.
1861 * @rules: array of coalesce rules
1862 * @n_rules: number of rules
1863 */
1864struct cfg80211_coalesce {
1865 struct cfg80211_coalesce_rules *rules;
1866 int n_rules;
1867};
1868
1869/**
1779 * struct cfg80211_wowlan_wakeup - wakeup report 1870 * struct cfg80211_wowlan_wakeup - wakeup report
1780 * @disconnect: woke up by getting disconnected 1871 * @disconnect: woke up by getting disconnected
1781 * @magic_pkt: woke up by receiving magic packet 1872 * @magic_pkt: woke up by receiving magic packet
@@ -1990,7 +2081,7 @@ struct cfg80211_update_ft_ies_params {
1990 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management 2081 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
1991 * frame on another channel 2082 * frame on another channel
1992 * 2083 *
1993 * @testmode_cmd: run a test mode command 2084 * @testmode_cmd: run a test mode command; @wdev may be %NULL
1994 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be 2085 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1995 * used by the function, but 0 and 1 must not be touched. Additionally, 2086 * used by the function, but 0 and 1 must not be touched. Additionally,
1996 * return error codes other than -ENOBUFS and -ENOENT will terminate the 2087 * return error codes other than -ENOBUFS and -ENOENT will terminate the
@@ -2071,6 +2162,9 @@ struct cfg80211_update_ft_ies_params {
2071 * driver can take the most appropriate actions. 2162 * driver can take the most appropriate actions.
2072 * @crit_proto_stop: Indicates critical protocol no longer needs increased link 2163 * @crit_proto_stop: Indicates critical protocol no longer needs increased link
2073 * reliability. This operation can not fail. 2164 * reliability. This operation can not fail.
2165 * @set_coalesce: Set coalesce parameters.
2166 *
2167 * @channel_switch: initiate channel-switch procedure (with CSA)
2074 */ 2168 */
2075struct cfg80211_ops { 2169struct cfg80211_ops {
2076 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2170 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2196,7 +2290,8 @@ struct cfg80211_ops {
2196 void (*rfkill_poll)(struct wiphy *wiphy); 2290 void (*rfkill_poll)(struct wiphy *wiphy);
2197 2291
2198#ifdef CONFIG_NL80211_TESTMODE 2292#ifdef CONFIG_NL80211_TESTMODE
2199 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 2293 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
2294 void *data, int len);
2200 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb, 2295 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
2201 struct netlink_callback *cb, 2296 struct netlink_callback *cb,
2202 void *data, int len); 2297 void *data, int len);
@@ -2306,6 +2401,12 @@ struct cfg80211_ops {
2306 u16 duration); 2401 u16 duration);
2307 void (*crit_proto_stop)(struct wiphy *wiphy, 2402 void (*crit_proto_stop)(struct wiphy *wiphy,
2308 struct wireless_dev *wdev); 2403 struct wireless_dev *wdev);
2404 int (*set_coalesce)(struct wiphy *wiphy,
2405 struct cfg80211_coalesce *coalesce);
2406
2407 int (*channel_switch)(struct wiphy *wiphy,
2408 struct net_device *dev,
2409 struct cfg80211_csa_settings *params);
2309}; 2410};
2310 2411
2311/* 2412/*
@@ -2371,6 +2472,8 @@ struct cfg80211_ops {
2371 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX. 2472 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
2372 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call. 2473 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
2373 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. 2474 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
2475 * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
2476 * beaconing mode (AP, IBSS, Mesh, ...).
2374 */ 2477 */
2375enum wiphy_flags { 2478enum wiphy_flags {
2376 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2479 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2395,6 +2498,7 @@ enum wiphy_flags {
2395 WIPHY_FLAG_OFFCHAN_TX = BIT(20), 2498 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
2396 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), 2499 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
2397 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), 2500 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
2501 WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
2398}; 2502};
2399 2503
2400/** 2504/**
@@ -2532,6 +2636,25 @@ struct wiphy_wowlan_support {
2532}; 2636};
2533 2637
2534/** 2638/**
2639 * struct wiphy_coalesce_support - coalesce support data
2640 * @n_rules: maximum number of coalesce rules
2641 * @max_delay: maximum supported coalescing delay in msecs
2642 * @n_patterns: number of supported patterns in a rule
2643 * (see nl80211.h for the pattern definition)
2644 * @pattern_max_len: maximum length of each pattern
2645 * @pattern_min_len: minimum length of each pattern
2646 * @max_pkt_offset: maximum Rx packet offset
2647 */
2648struct wiphy_coalesce_support {
2649 int n_rules;
2650 int max_delay;
2651 int n_patterns;
2652 int pattern_max_len;
2653 int pattern_min_len;
2654 int max_pkt_offset;
2655};
2656
2657/**
2535 * struct wiphy - wireless hardware description 2658 * struct wiphy - wireless hardware description
2536 * @reg_notifier: the driver's regulatory notification callback, 2659 * @reg_notifier: the driver's regulatory notification callback,
2537 * note that if your driver uses wiphy_apply_custom_regulatory() 2660 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2641,6 +2764,7 @@ struct wiphy_wowlan_support {
2641 * 802.11-2012 8.4.2.29 for the defined fields. 2764 * 802.11-2012 8.4.2.29 for the defined fields.
2642 * @extended_capabilities_mask: mask of the valid values 2765 * @extended_capabilities_mask: mask of the valid values
2643 * @extended_capabilities_len: length of the extended capabilities 2766 * @extended_capabilities_len: length of the extended capabilities
2767 * @coalesce: packet coalescing support information
2644 */ 2768 */
2645struct wiphy { 2769struct wiphy {
2646 /* assign these fields before you register the wiphy */ 2770 /* assign these fields before you register the wiphy */
@@ -2750,6 +2874,8 @@ struct wiphy {
2750 const struct iw_handler_def *wext; 2874 const struct iw_handler_def *wext;
2751#endif 2875#endif
2752 2876
2877 const struct wiphy_coalesce_support *coalesce;
2878
2753 char priv[0] __aligned(NETDEV_ALIGN); 2879 char priv[0] __aligned(NETDEV_ALIGN);
2754}; 2880};
2755 2881
@@ -2841,7 +2967,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2841 * 2967 *
2842 * Return: A non-negative wiphy index or a negative error code. 2968 * Return: A non-negative wiphy index or a negative error code.
2843 */ 2969 */
2844extern int wiphy_register(struct wiphy *wiphy); 2970int wiphy_register(struct wiphy *wiphy);
2845 2971
2846/** 2972/**
2847 * wiphy_unregister - deregister a wiphy from cfg80211 2973 * wiphy_unregister - deregister a wiphy from cfg80211
@@ -2852,14 +2978,14 @@ extern int wiphy_register(struct wiphy *wiphy);
2852 * pointer, but the call may sleep to wait for an outstanding 2978 * pointer, but the call may sleep to wait for an outstanding
2853 * request that is being handled. 2979 * request that is being handled.
2854 */ 2980 */
2855extern void wiphy_unregister(struct wiphy *wiphy); 2981void wiphy_unregister(struct wiphy *wiphy);
2856 2982
2857/** 2983/**
2858 * wiphy_free - free wiphy 2984 * wiphy_free - free wiphy
2859 * 2985 *
2860 * @wiphy: The wiphy to free 2986 * @wiphy: The wiphy to free
2861 */ 2987 */
2862extern void wiphy_free(struct wiphy *wiphy); 2988void wiphy_free(struct wiphy *wiphy);
2863 2989
2864/* internal structs */ 2990/* internal structs */
2865struct cfg80211_conn; 2991struct cfg80211_conn;
@@ -3014,14 +3140,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
3014 * @band: band, necessary due to channel number overlap 3140 * @band: band, necessary due to channel number overlap
3015 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. 3141 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
3016 */ 3142 */
3017extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); 3143int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
3018 3144
3019/** 3145/**
3020 * ieee80211_frequency_to_channel - convert frequency to channel number 3146 * ieee80211_frequency_to_channel - convert frequency to channel number
3021 * @freq: center frequency 3147 * @freq: center frequency
3022 * Return: The corresponding channel, or 0 if the conversion failed. 3148 * Return: The corresponding channel, or 0 if the conversion failed.
3023 */ 3149 */
3024extern int ieee80211_frequency_to_channel(int freq); 3150int ieee80211_frequency_to_channel(int freq);
3025 3151
3026/* 3152/*
3027 * Name indirection necessary because the ieee80211 code also has 3153 * Name indirection necessary because the ieee80211 code also has
@@ -3030,8 +3156,8 @@ extern int ieee80211_frequency_to_channel(int freq);
3030 * to include both header files you'll (rightfully!) get a symbol 3156 * to include both header files you'll (rightfully!) get a symbol
3031 * clash. 3157 * clash.
3032 */ 3158 */
3033extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, 3159struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
3034 int freq); 3160 int freq);
3035/** 3161/**
3036 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 3162 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
3037 * @wiphy: the struct wiphy to get the channel for 3163 * @wiphy: the struct wiphy to get the channel for
@@ -3063,11 +3189,13 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
3063/** 3189/**
3064 * ieee80211_mandatory_rates - get mandatory rates for a given band 3190 * ieee80211_mandatory_rates - get mandatory rates for a given band
3065 * @sband: the band to look for rates in 3191 * @sband: the band to look for rates in
3192 * @scan_width: width of the control channel
3066 * 3193 *
3067 * This function returns a bitmap of the mandatory rates for the given 3194 * This function returns a bitmap of the mandatory rates for the given
3068 * band, bits are set according to the rate position in the bitrates array. 3195 * band, bits are set according to the rate position in the bitrates array.
3069 */ 3196 */
3070u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband); 3197u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
3198 enum nl80211_bss_scan_width scan_width);
3071 3199
3072/* 3200/*
3073 * Radiotap parsing functions -- for controlled injection support 3201 * Radiotap parsing functions -- for controlled injection support
@@ -3141,13 +3269,14 @@ struct ieee80211_radiotap_iterator {
3141 int _reset_on_ext; 3269 int _reset_on_ext;
3142}; 3270};
3143 3271
3144extern int ieee80211_radiotap_iterator_init( 3272int
3145 struct ieee80211_radiotap_iterator *iterator, 3273ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_iterator *iterator,
3146 struct ieee80211_radiotap_header *radiotap_header, 3274 struct ieee80211_radiotap_header *radiotap_header,
3147 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns); 3275 int max_length,
3276 const struct ieee80211_radiotap_vendor_namespaces *vns);
3148 3277
3149extern int ieee80211_radiotap_iterator_next( 3278int
3150 struct ieee80211_radiotap_iterator *iterator); 3279ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
3151 3280
3152 3281
3153extern const unsigned char rfc1042_header[6]; 3282extern const unsigned char rfc1042_header[6];
@@ -3307,7 +3436,7 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
3307 * 3436 *
3308 * Return: 0 on success. -ENOMEM. 3437 * Return: 0 on success. -ENOMEM.
3309 */ 3438 */
3310extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3439int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3311 3440
3312/** 3441/**
3313 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 3442 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
@@ -3321,9 +3450,8 @@ extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3321 * default channel settings will be disregarded. If no rule is found for a 3450 * default channel settings will be disregarded. If no rule is found for a
3322 * channel on the regulatory domain the channel will be disabled. 3451 * channel on the regulatory domain the channel will be disabled.
3323 */ 3452 */
3324extern void wiphy_apply_custom_regulatory( 3453void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3325 struct wiphy *wiphy, 3454 const struct ieee80211_regdomain *regd);
3326 const struct ieee80211_regdomain *regd);
3327 3455
3328/** 3456/**
3329 * freq_reg_info - get regulatory information for the given frequency 3457 * freq_reg_info - get regulatory information for the given frequency
@@ -3379,10 +3507,11 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy);
3379void cfg80211_sched_scan_stopped(struct wiphy *wiphy); 3507void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3380 3508
3381/** 3509/**
3382 * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame 3510 * cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
3383 * 3511 *
3384 * @wiphy: the wiphy reporting the BSS 3512 * @wiphy: the wiphy reporting the BSS
3385 * @channel: The channel the frame was received on 3513 * @channel: The channel the frame was received on
3514 * @scan_width: width of the control channel
3386 * @mgmt: the management frame (probe response or beacon) 3515 * @mgmt: the management frame (probe response or beacon)
3387 * @len: length of the management frame 3516 * @len: length of the management frame
3388 * @signal: the signal strength, type depends on the wiphy's signal_type 3517 * @signal: the signal strength, type depends on the wiphy's signal_type
@@ -3395,16 +3524,29 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3395 * Or %NULL on error. 3524 * Or %NULL on error.
3396 */ 3525 */
3397struct cfg80211_bss * __must_check 3526struct cfg80211_bss * __must_check
3527cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
3528 struct ieee80211_channel *channel,
3529 enum nl80211_bss_scan_width scan_width,
3530 struct ieee80211_mgmt *mgmt, size_t len,
3531 s32 signal, gfp_t gfp);
3532
3533static inline struct cfg80211_bss * __must_check
3398cfg80211_inform_bss_frame(struct wiphy *wiphy, 3534cfg80211_inform_bss_frame(struct wiphy *wiphy,
3399 struct ieee80211_channel *channel, 3535 struct ieee80211_channel *channel,
3400 struct ieee80211_mgmt *mgmt, size_t len, 3536 struct ieee80211_mgmt *mgmt, size_t len,
3401 s32 signal, gfp_t gfp); 3537 s32 signal, gfp_t gfp)
3538{
3539 return cfg80211_inform_bss_width_frame(wiphy, channel,
3540 NL80211_BSS_CHAN_WIDTH_20,
3541 mgmt, len, signal, gfp);
3542}
3402 3543
3403/** 3544/**
3404 * cfg80211_inform_bss - inform cfg80211 of a new BSS 3545 * cfg80211_inform_bss - inform cfg80211 of a new BSS
3405 * 3546 *
3406 * @wiphy: the wiphy reporting the BSS 3547 * @wiphy: the wiphy reporting the BSS
3407 * @channel: The channel the frame was received on 3548 * @channel: The channel the frame was received on
3549 * @scan_width: width of the control channel
3408 * @bssid: the BSSID of the BSS 3550 * @bssid: the BSSID of the BSS
3409 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0) 3551 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
3410 * @capability: the capability field sent by the peer 3552 * @capability: the capability field sent by the peer
@@ -3421,11 +3563,26 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
3421 * Or %NULL on error. 3563 * Or %NULL on error.
3422 */ 3564 */
3423struct cfg80211_bss * __must_check 3565struct cfg80211_bss * __must_check
3566cfg80211_inform_bss_width(struct wiphy *wiphy,
3567 struct ieee80211_channel *channel,
3568 enum nl80211_bss_scan_width scan_width,
3569 const u8 *bssid, u64 tsf, u16 capability,
3570 u16 beacon_interval, const u8 *ie, size_t ielen,
3571 s32 signal, gfp_t gfp);
3572
3573static inline struct cfg80211_bss * __must_check
3424cfg80211_inform_bss(struct wiphy *wiphy, 3574cfg80211_inform_bss(struct wiphy *wiphy,
3425 struct ieee80211_channel *channel, 3575 struct ieee80211_channel *channel,
3426 const u8 *bssid, u64 tsf, u16 capability, 3576 const u8 *bssid, u64 tsf, u16 capability,
3427 u16 beacon_interval, const u8 *ie, size_t ielen, 3577 u16 beacon_interval, const u8 *ie, size_t ielen,
3428 s32 signal, gfp_t gfp); 3578 s32 signal, gfp_t gfp)
3579{
3580 return cfg80211_inform_bss_width(wiphy, channel,
3581 NL80211_BSS_CHAN_WIDTH_20,
3582 bssid, tsf, capability,
3583 beacon_interval, ie, ielen, signal,
3584 gfp);
3585}
3429 3586
3430struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, 3587struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
3431 struct ieee80211_channel *channel, 3588 struct ieee80211_channel *channel,
@@ -3471,6 +3628,19 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3471 */ 3628 */
3472void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); 3629void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3473 3630
3631static inline enum nl80211_bss_scan_width
3632cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
3633{
3634 switch (chandef->width) {
3635 case NL80211_CHAN_WIDTH_5:
3636 return NL80211_BSS_CHAN_WIDTH_5;
3637 case NL80211_CHAN_WIDTH_10:
3638 return NL80211_BSS_CHAN_WIDTH_10;
3639 default:
3640 return NL80211_BSS_CHAN_WIDTH_20;
3641 }
3642}
3643
3474/** 3644/**
3475 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame 3645 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
3476 * @dev: network device 3646 * @dev: network device
@@ -3886,6 +4056,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3886 * @sig_dbm: signal strength in mBm, or 0 if unknown 4056 * @sig_dbm: signal strength in mBm, or 0 if unknown
3887 * @buf: Management frame (header + body) 4057 * @buf: Management frame (header + body)
3888 * @len: length of the frame data 4058 * @len: length of the frame data
4059 * @flags: flags, as defined in enum nl80211_rxmgmt_flags
3889 * @gfp: context flags 4060 * @gfp: context flags
3890 * 4061 *
3891 * This function is called whenever an Action frame is received for a station 4062 * This function is called whenever an Action frame is received for a station
@@ -3897,7 +4068,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3897 * driver is responsible for rejecting the frame. 4068 * driver is responsible for rejecting the frame.
3898 */ 4069 */
3899bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, 4070bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3900 const u8 *buf, size_t len, gfp_t gfp); 4071 const u8 *buf, size_t len, u32 flags, gfp_t gfp);
3901 4072
3902/** 4073/**
3903 * cfg80211_mgmt_tx_status - notification of TX status for management frame 4074 * cfg80211_mgmt_tx_status - notification of TX status for management frame
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 600d1d705bb8..8f59ca50477c 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -107,11 +107,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
107} 107}
108 108
109struct sk_buff; 109struct sk_buff;
110extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, 110void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
111 __be32 from, __be32 to, int pseudohdr); 111 __be32 from, __be32 to, int pseudohdr);
112extern void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, 112void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
113 const __be32 *from, const __be32 *to, 113 const __be32 *from, const __be32 *to,
114 int pseudohdr); 114 int pseudohdr);
115 115
116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, 116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
117 __be16 from, __be16 to, 117 __be16 from, __be16 to,
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 52adaa75dac9..33d03b648646 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,7 +24,7 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27void sock_update_classid(struct sock *sk);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) 29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
diff --git a/include/net/dst.h b/include/net/dst.h
index 1f8fd109e225..3bc4865f8267 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -311,11 +311,13 @@ static inline void skb_dst_force(struct sk_buff *skb)
311 * __skb_tunnel_rx - prepare skb for rx reinsert 311 * __skb_tunnel_rx - prepare skb for rx reinsert
312 * @skb: buffer 312 * @skb: buffer
313 * @dev: tunnel device 313 * @dev: tunnel device
314 * @net: netns for packet i/o
314 * 315 *
315 * After decapsulation, packet is going to re-enter (netif_rx()) our stack, 316 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
316 * so make some cleanups. (no accounting done) 317 * so make some cleanups. (no accounting done)
317 */ 318 */
318static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 319static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
320 struct net *net)
319{ 321{
320 skb->dev = dev; 322 skb->dev = dev;
321 323
@@ -327,8 +329,7 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
327 if (!skb->l4_rxhash) 329 if (!skb->l4_rxhash)
328 skb->rxhash = 0; 330 skb->rxhash = 0;
329 skb_set_queue_mapping(skb, 0); 331 skb_set_queue_mapping(skb, 0);
330 skb_dst_drop(skb); 332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
331 nf_reset(skb);
332} 333}
333 334
334/** 335/**
@@ -340,12 +341,13 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
340 * so make some cleanups, and perform accounting. 341 * so make some cleanups, and perform accounting.
341 * Note: this accounting is not SMP safe. 342 * Note: this accounting is not SMP safe.
342 */ 343 */
343static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 344static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
345 struct net *net)
344{ 346{
345 /* TODO : stats should be SMP safe */ 347 /* TODO : stats should be SMP safe */
346 dev->stats.rx_packets++; 348 dev->stats.rx_packets++;
347 dev->stats.rx_bytes += skb->len; 349 dev->stats.rx_bytes += skb->len;
348 __skb_tunnel_rx(skb, dev); 350 __skb_tunnel_rx(skb, dev, net);
349} 351}
350 352
351/* Children define the path of the packet through the 353/* Children define the path of the packet through the
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e361f4882426..4b2b557fb0e8 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -10,21 +10,25 @@
10 10
11struct fib_rule { 11struct fib_rule {
12 struct list_head list; 12 struct list_head list;
13 atomic_t refcnt;
14 int iifindex; 13 int iifindex;
15 int oifindex; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref;
19 u32 flags; 17 u32 flags;
20 u32 table; 18 u32 table;
21 u8 action; 19 u8 action;
20 /* 3 bytes hole, try to use */
22 u32 target; 21 u32 target;
23 struct fib_rule __rcu *ctarget; 22 struct fib_rule __rcu *ctarget;
23 struct net *fr_net;
24
25 atomic_t refcnt;
26 u32 pref;
27 int suppress_ifgroup;
28 int suppress_prefixlen;
24 char iifname[IFNAMSIZ]; 29 char iifname[IFNAMSIZ];
25 char oifname[IFNAMSIZ]; 30 char oifname[IFNAMSIZ];
26 struct rcu_head rcu; 31 struct rcu_head rcu;
27 struct net * fr_net;
28}; 32};
29 33
30struct fib_lookup_arg { 34struct fib_lookup_arg {
@@ -46,6 +50,8 @@ struct fib_rules_ops {
46 int (*action)(struct fib_rule *, 50 int (*action)(struct fib_rule *,
47 struct flowi *, int, 51 struct flowi *, int,
48 struct fib_lookup_arg *); 52 struct fib_lookup_arg *);
53 bool (*suppress)(struct fib_rule *,
54 struct fib_lookup_arg *);
49 int (*match)(struct fib_rule *, 55 int (*match)(struct fib_rule *,
50 struct flowi *, int); 56 struct flowi *, int);
51 int (*configure)(struct fib_rule *, 57 int (*configure)(struct fib_rule *,
@@ -80,6 +86,8 @@ struct fib_rules_ops {
80 [FRA_FWMARK] = { .type = NLA_U32 }, \ 86 [FRA_FWMARK] = { .type = NLA_U32 }, \
81 [FRA_FWMASK] = { .type = NLA_U32 }, \ 87 [FRA_FWMASK] = { .type = NLA_U32 }, \
82 [FRA_TABLE] = { .type = NLA_U32 }, \ 88 [FRA_TABLE] = { .type = NLA_U32 }, \
89 [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
90 [FRA_SUPPRESS_IFGROUP] = { .type = NLA_U32 }, \
83 [FRA_GOTO] = { .type = NLA_U32 } 91 [FRA_GOTO] = { .type = NLA_U32 }
84 92
85static inline void fib_rule_get(struct fib_rule *rule) 93static inline void fib_rule_get(struct fib_rule *rule)
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c6d07cb074bc..8b5b71433297 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -230,6 +230,10 @@ enum ieee80211_radiotap_type {
230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ 230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ 231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ 232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
233#define IEEE80211_CHAN_GSM 0x1000 /* GSM (900 MHz) */
234#define IEEE80211_CHAN_STURBO 0x2000 /* Static Turbo */
235#define IEEE80211_CHAN_HALF 0x4000 /* Half channel (10 MHz wide) */
236#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter channel (5 MHz wide) */
233 237
234/* For IEEE80211_RADIOTAP_FLAGS */ 238/* For IEEE80211_RADIOTAP_FLAGS */
235#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received 239#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 736b5fb95474..02ef7727bb55 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -171,12 +171,17 @@ struct inet6_dev {
171 struct ifmcaddr6 *mc_list; 171 struct ifmcaddr6 *mc_list;
172 struct ifmcaddr6 *mc_tomb; 172 struct ifmcaddr6 *mc_tomb;
173 spinlock_t mc_lock; 173 spinlock_t mc_lock;
174 unsigned char mc_qrv; 174
175 unsigned char mc_qrv; /* Query Robustness Variable */
175 unsigned char mc_gq_running; 176 unsigned char mc_gq_running;
176 unsigned char mc_ifc_count; 177 unsigned char mc_ifc_count;
177 unsigned char mc_dad_count; 178 unsigned char mc_dad_count;
178 unsigned long mc_v1_seen; 179
180 unsigned long mc_v1_seen; /* Max time we stay in MLDv1 mode */
181 unsigned long mc_qi; /* Query Interval */
182 unsigned long mc_qri; /* Query Response Interval */
179 unsigned long mc_maxdelay; 183 unsigned long mc_maxdelay;
184
180 struct timer_list mc_gq_timer; /* general query timer */ 185 struct timer_list mc_gq_timer; /* general query timer */
181 struct timer_list mc_ifc_timer; /* interface change timer */ 186 struct timer_list mc_ifc_timer; /* interface change timer */
182 struct timer_list mc_dad_timer; /* dad complete mc timer */ 187 struct timer_list mc_dad_timer; /* dad complete mc timer */
diff --git a/include/net/ip.h b/include/net/ip.h
index a68f838a132c..48f55979d842 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -194,7 +194,17 @@ static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp
194} 194}
195#endif 195#endif
196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); 196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
197extern void snmp_mib_free(void __percpu *ptr[2]); 197
198static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
199{
200 int i;
201
202 BUG_ON(ptr == NULL);
203 for (i = 0; i < SNMP_ARRAY_SZ; i++) {
204 free_percpu(ptr[i]);
205 ptr[i] = NULL;
206 }
207}
198 208
199extern struct local_ports { 209extern struct local_ports {
200 seqlock_t lock; 210 seqlock_t lock;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f667248202b6..f525e7038cca 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -112,8 +112,6 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
112 const struct in6_addr *addr, 112 const struct in6_addr *addr,
113 bool anycast); 113 bool anycast);
114 114
115extern int ip6_dst_hoplimit(struct dst_entry *dst);
116
117/* 115/*
118 * support functions for ND 116 * support functions for ND
119 * 117 *
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 4da5de10d1d4..6d1549c4893c 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -36,6 +36,7 @@ struct __ip6_tnl_parm {
36struct ip6_tnl { 36struct ip6_tnl {
37 struct ip6_tnl __rcu *next; /* next tunnel in list */ 37 struct ip6_tnl __rcu *next; /* next tunnel in list */
38 struct net_device *dev; /* virtual device associated with tunnel */ 38 struct net_device *dev; /* virtual device associated with tunnel */
39 struct net *net; /* netns for packet i/o */
39 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */ 40 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */
40 struct flowi fl; /* flowi template for xmit */ 41 struct flowi fl; /* flowi template for xmit */
41 struct dst_entry *dst_cache; /* cached dst */ 42 struct dst_entry *dst_cache; /* cached dst */
@@ -74,7 +75,6 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
74 struct net_device_stats *stats = &dev->stats; 75 struct net_device_stats *stats = &dev->stats;
75 int pkt_len, err; 76 int pkt_len, err;
76 77
77 nf_reset(skb);
78 pkt_len = skb->len; 78 pkt_len = skb->len;
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index a354db5b7662..a0a4a100f5c9 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -86,12 +86,12 @@ struct tnl_ptk_info {
86#define PACKET_RCVD 0 86#define PACKET_RCVD 0
87#define PACKET_REJECT 1 87#define PACKET_REJECT 1
88 88
89#define IP_TNL_HASH_BITS 10 89#define IP_TNL_HASH_BITS 7
90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS) 90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS)
91 91
92struct ip_tunnel_net { 92struct ip_tunnel_net {
93 struct hlist_head *tunnels;
94 struct net_device *fb_tunnel_dev; 93 struct net_device *fb_tunnel_dev;
94 struct hlist_head tunnels[IP_TNL_HASH_SIZE];
95}; 95};
96 96
97#ifdef CONFIG_INET 97#ifdef CONFIG_INET
@@ -102,7 +102,7 @@ void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
103 struct rtnl_link_ops *ops, char *devname); 103 struct rtnl_link_ops *ops, char *devname);
104 104
105void ip_tunnel_delete_net(struct ip_tunnel_net *itn); 105void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops);
106 106
107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
108 const struct iphdr *tnl_params, const u8 protocol); 108 const struct iphdr *tnl_params, const u8 protocol);
@@ -146,10 +146,9 @@ static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
146} 146}
147 147
148int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); 148int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
149int iptunnel_xmit(struct net *net, struct rtable *rt, 149int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
150 struct sk_buff *skb,
151 __be32 src, __be32 dst, __u8 proto, 150 __be32 src, __be32 dst, __u8 proto,
152 __u8 tos, __u8 ttl, __be16 df); 151 __u8 tos, __u8 ttl, __be16 df, bool xnet);
153 152
154static inline void iptunnel_xmit_stats(int err, 153static inline void iptunnel_xmit_stats(int err,
155 struct net_device_stats *err_stats, 154 struct net_device_stats *err_stats,
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5fe564985171..bbf1c8fb8511 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -41,6 +41,7 @@
41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ 41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
42#define NEXTHDR_NONE 59 /* No next header */ 42#define NEXTHDR_NONE 59 /* No next header */
43#define NEXTHDR_DEST 60 /* Destination options header. */ 43#define NEXTHDR_DEST 60 /* Destination options header. */
44#define NEXTHDR_SCTP 132 /* SCTP message. */
44#define NEXTHDR_MOBILITY 135 /* Mobility header. */ 45#define NEXTHDR_MOBILITY 135 /* Mobility header. */
45 46
46#define NEXTHDR_MAX 255 47#define NEXTHDR_MAX 255
@@ -657,6 +658,8 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
657 658
658extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 659extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
659 660
661extern int ip6_dst_hoplimit(struct dst_entry *dst);
662
660/* 663/*
661 * Header manipulation 664 * Header manipulation
662 */ 665 */
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 0af8b8dfbc22..550c2d6ec7ff 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -32,6 +32,7 @@
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/if_ether.h>
35 36
36#include <net/irda/irttp.h> 37#include <net/irda/irttp.h>
37 38
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
161 int access_type; /* Access type */ 162 int access_type; /* Access type */
162 __u16 send_arb_val; 163 __u16 send_arb_val;
163 164
164 __u8 mac_address[6]; /* Generated MAC address for peer device */ 165 __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
165}; 166};
166 167
167/* 168/*
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index b595a004d31b..f0cb909b60eb 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -62,36 +62,6 @@
62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */ 62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */
63#define LLC_STATUS_RESET_DONE 8 /* */ 63#define LLC_STATUS_RESET_DONE 8 /* */
64 64
65/**
66 * llc_mac_null - determines if a address is a null mac address
67 * @mac: Mac address to test if null.
68 *
69 * Determines if a given address is a null mac address. Returns 0 if the
70 * address is not a null mac, 1 if the address is a null mac.
71 */
72static inline int llc_mac_null(const u8 *mac)
73{
74 return is_zero_ether_addr(mac);
75}
76
77static inline int llc_mac_multicast(const u8 *mac)
78{
79 return is_multicast_ether_addr(mac);
80}
81/**
82 * llc_mac_match - determines if two mac addresses are the same
83 * @mac1: First mac address to compare.
84 * @mac2: Second mac address to compare.
85 *
86 * Determines if two given mac address are the same. Returns 0 if there
87 * is not a complete match up to len, 1 if a complete match up to len is
88 * found.
89 */
90static inline int llc_mac_match(const u8 *mac1, const u8 *mac2)
91{
92 return !compare_ether_addr(mac1, mac2);
93}
94
95extern int llc_establish_connection(struct sock *sk, u8 *lmac, 65extern int llc_establish_connection(struct sock *sk, u8 *lmac,
96 u8 *dmac, u8 dsap); 66 u8 *dmac, u8 dsap);
97extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); 67extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 551ba6a6a073..cc6035f1a2f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -152,11 +152,14 @@ struct ieee80211_low_level_stats {
152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA
155 */ 157 */
156enum ieee80211_chanctx_change { 158enum ieee80211_chanctx_change {
157 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
158 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
159 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
160}; 163};
161 164
162/** 165/**
@@ -372,7 +375,7 @@ struct ieee80211_bss_conf {
372}; 375};
373 376
374/** 377/**
375 * enum mac80211_tx_control_flags - flags to describe transmission information/status 378 * enum mac80211_tx_info_flags - flags to describe transmission information/status
376 * 379 *
377 * These flags are used with the @flags member of &ieee80211_tx_info. 380 * These flags are used with the @flags member of &ieee80211_tx_info.
378 * 381 *
@@ -468,7 +471,7 @@ struct ieee80211_bss_conf {
468 * Note: If you have to add new flags to the enumeration, then don't 471 * Note: If you have to add new flags to the enumeration, then don't
469 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 472 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
470 */ 473 */
471enum mac80211_tx_control_flags { 474enum mac80211_tx_info_flags {
472 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 475 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
473 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1), 476 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
474 IEEE80211_TX_CTL_NO_ACK = BIT(2), 477 IEEE80211_TX_CTL_NO_ACK = BIT(2),
@@ -504,6 +507,18 @@ enum mac80211_tx_control_flags {
504 507
505#define IEEE80211_TX_CTL_STBC_SHIFT 23 508#define IEEE80211_TX_CTL_STBC_SHIFT 23
506 509
510/**
511 * enum mac80211_tx_control_flags - flags to describe transmit control
512 *
513 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
514 * protocol frame (e.g. EAP)
515 *
516 * These flags are used in tx_info->control.flags.
517 */
518enum mac80211_tx_control_flags {
519 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
520};
521
507/* 522/*
508 * This definition is used as a mask to clear all temporary flags, which are 523 * This definition is used as a mask to clear all temporary flags, which are
509 * set by the tx handlers for each transmission attempt by the mac80211 stack. 524 * set by the tx handlers for each transmission attempt by the mac80211 stack.
@@ -677,7 +692,8 @@ struct ieee80211_tx_info {
677 /* NB: vif can be NULL for injected frames */ 692 /* NB: vif can be NULL for injected frames */
678 struct ieee80211_vif *vif; 693 struct ieee80211_vif *vif;
679 struct ieee80211_key_conf *hw_key; 694 struct ieee80211_key_conf *hw_key;
680 /* 8 bytes free */ 695 u32 flags;
696 /* 4 bytes free */
681 } control; 697 } control;
682 struct { 698 struct {
683 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; 699 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
@@ -811,6 +827,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
811 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC 827 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
812 * is stored in the @ampdu_delimiter_crc field) 828 * is stored in the @ampdu_delimiter_crc field)
813 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 829 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
830 * @RX_FLAG_10MHZ: 10 MHz (half channel) was used
831 * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
814 */ 832 */
815enum mac80211_rx_flags { 833enum mac80211_rx_flags {
816 RX_FLAG_MMIC_ERROR = BIT(0), 834 RX_FLAG_MMIC_ERROR = BIT(0),
@@ -839,6 +857,8 @@ enum mac80211_rx_flags {
839 RX_FLAG_80P80MHZ = BIT(24), 857 RX_FLAG_80P80MHZ = BIT(24),
840 RX_FLAG_160MHZ = BIT(25), 858 RX_FLAG_160MHZ = BIT(25),
841 RX_FLAG_STBC_MASK = BIT(26) | BIT(27), 859 RX_FLAG_STBC_MASK = BIT(26) | BIT(27),
860 RX_FLAG_10MHZ = BIT(28),
861 RX_FLAG_5MHZ = BIT(29),
842}; 862};
843 863
844#define RX_FLAG_STBC_SHIFT 26 864#define RX_FLAG_STBC_SHIFT 26
@@ -1004,11 +1024,11 @@ enum ieee80211_smps_mode {
1004 * @radar_enabled: whether radar detection is enabled 1024 * @radar_enabled: whether radar detection is enabled
1005 * 1025 *
1006 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 1026 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
1007 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 1027 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
1008 * but actually means the number of transmissions not the number of retries 1028 * but actually means the number of transmissions not the number of retries
1009 * @short_frame_max_tx_count: Maximum number of transmissions for a "short" 1029 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
1010 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the 1030 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
1011 * number of transmissions not the number of retries 1031 * number of transmissions not the number of retries
1012 * 1032 *
1013 * @smps_mode: spatial multiplexing powersave mode; note that 1033 * @smps_mode: spatial multiplexing powersave mode; note that
1014 * %IEEE80211_SMPS_STATIC is used when the device is not 1034 * %IEEE80211_SMPS_STATIC is used when the device is not
@@ -1080,6 +1100,7 @@ enum ieee80211_vif_flags {
1080 * @addr: address of this interface 1100 * @addr: address of this interface
1081 * @p2p: indicates whether this AP or STA interface is a p2p 1101 * @p2p: indicates whether this AP or STA interface is a p2p
1082 * interface, i.e. a GO or p2p-sta respectively 1102 * interface, i.e. a GO or p2p-sta respectively
1103 * @csa_active: marks whether a channel switch is going on
1083 * @driver_flags: flags/capabilities the driver has for this interface, 1104 * @driver_flags: flags/capabilities the driver has for this interface,
1084 * these need to be set (or cleared) when the interface is added 1105 * these need to be set (or cleared) when the interface is added
1085 * or, if supported by the driver, the interface type is changed 1106 * or, if supported by the driver, the interface type is changed
@@ -1092,7 +1113,7 @@ enum ieee80211_vif_flags {
1092 * be off when it is %NULL there can still be races and packets could be 1113 * be off when it is %NULL there can still be races and packets could be
1093 * processed after it switches back to %NULL. 1114 * processed after it switches back to %NULL.
1094 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per 1115 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per
1095 * interface debug files. Note that it will be NULL for the virtual 1116 * interface debug files. Note that it will be NULL for the virtual
1096 * monitor interface (if that is requested.) 1117 * monitor interface (if that is requested.)
1097 * @drv_priv: data area for driver use, will always be aligned to 1118 * @drv_priv: data area for driver use, will always be aligned to
1098 * sizeof(void *). 1119 * sizeof(void *).
@@ -1102,6 +1123,7 @@ struct ieee80211_vif {
1102 struct ieee80211_bss_conf bss_conf; 1123 struct ieee80211_bss_conf bss_conf;
1103 u8 addr[ETH_ALEN]; 1124 u8 addr[ETH_ALEN];
1104 bool p2p; 1125 bool p2p;
1126 bool csa_active;
1105 1127
1106 u8 cab_queue; 1128 u8 cab_queue;
1107 u8 hw_queue[IEEE80211_NUM_ACS]; 1129 u8 hw_queue[IEEE80211_NUM_ACS];
@@ -1425,10 +1447,10 @@ struct ieee80211_tx_control {
1425 * the stack. 1447 * the stack.
1426 * 1448 *
1427 * @IEEE80211_HW_CONNECTION_MONITOR: 1449 * @IEEE80211_HW_CONNECTION_MONITOR:
1428 * The hardware performs its own connection monitoring, including 1450 * The hardware performs its own connection monitoring, including
1429 * periodic keep-alives to the AP and probing the AP on beacon loss. 1451 * periodic keep-alives to the AP and probing the AP on beacon loss.
1430 * When this flag is set, signaling beacon-loss will cause an immediate 1452 * When this flag is set, signaling beacon-loss will cause an immediate
1431 * change to disassociated state. 1453 * change to disassociated state.
1432 * 1454 *
1433 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC: 1455 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1434 * This device needs to get data from beacon before association (i.e. 1456 * This device needs to get data from beacon before association (i.e.
@@ -1527,10 +1549,10 @@ enum ieee80211_hw_flags {
1527 * @channel_change_time: time (in microseconds) it takes to change channels. 1549 * @channel_change_time: time (in microseconds) it takes to change channels.
1528 * 1550 *
1529 * @max_signal: Maximum value for signal (rssi) in RX information, used 1551 * @max_signal: Maximum value for signal (rssi) in RX information, used
1530 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1552 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
1531 * 1553 *
1532 * @max_listen_interval: max listen interval in units of beacon interval 1554 * @max_listen_interval: max listen interval in units of beacon interval
1533 * that HW supports 1555 * that HW supports
1534 * 1556 *
1535 * @queues: number of available hardware transmit queues for 1557 * @queues: number of available hardware transmit queues for
1536 * data packets. WMM/QoS requires at least four, these 1558 * data packets. WMM/QoS requires at least four, these
@@ -2444,7 +2466,7 @@ enum ieee80211_roc_type {
2444 * The callback can sleep. 2466 * The callback can sleep.
2445 * 2467 *
2446 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 2468 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
2447 * Currently, this is only used for IBSS mode debugging. Is not a 2469 * Currently, this is only used for IBSS mode debugging. Is not a
2448 * required function. 2470 * required function.
2449 * The callback can sleep. 2471 * The callback can sleep.
2450 * 2472 *
@@ -2495,8 +2517,8 @@ enum ieee80211_roc_type {
2495 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout 2517 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
2496 * accordingly. This callback is not required and may sleep. 2518 * accordingly. This callback is not required and may sleep.
2497 * 2519 *
2498 * @testmode_cmd: Implement a cfg80211 test mode command. 2520 * @testmode_cmd: Implement a cfg80211 test mode command. The passed @vif may
2499 * The callback can sleep. 2521 * be %NULL. The callback can sleep.
2500 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. 2522 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
2501 * 2523 *
2502 * @flush: Flush all pending frames from the hardware queue, making sure 2524 * @flush: Flush all pending frames from the hardware queue, making sure
@@ -2634,6 +2656,16 @@ enum ieee80211_roc_type {
2634 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2656 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2635 * Currently, this is only called for managed or P2P client interfaces. 2657 * Currently, this is only called for managed or P2P client interfaces.
2636 * This callback is optional; it must not sleep. 2658 * This callback is optional; it must not sleep.
2659 *
2660 * @channel_switch_beacon: Starts a channel switch to a new channel.
2661 * Beacons are modified to include CSA or ECSA IEs before calling this
2662 * function. The corresponding count fields in these IEs must be
2663 * decremented, and when they reach zero the driver must call
2664 * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get()
2665 * get the csa counter decremented by mac80211, but must check if it is
2666 * zero using ieee80211_csa_is_complete() after the beacon has been
2667 * transmitted and then call ieee80211_csa_finish().
2668 *
2637 */ 2669 */
2638struct ieee80211_ops { 2670struct ieee80211_ops {
2639 void (*tx)(struct ieee80211_hw *hw, 2671 void (*tx)(struct ieee80211_hw *hw,
@@ -2747,7 +2779,8 @@ struct ieee80211_ops {
2747 void (*rfkill_poll)(struct ieee80211_hw *hw); 2779 void (*rfkill_poll)(struct ieee80211_hw *hw);
2748 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2780 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
2749#ifdef CONFIG_NL80211_TESTMODE 2781#ifdef CONFIG_NL80211_TESTMODE
2750 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2782 int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2783 void *data, int len);
2751 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, 2784 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2752 struct netlink_callback *cb, 2785 struct netlink_callback *cb,
2753 void *data, int len); 2786 void *data, int len);
@@ -2821,6 +2854,9 @@ struct ieee80211_ops {
2821 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2822 struct inet6_dev *idev); 2855 struct inet6_dev *idev);
2823#endif 2856#endif
2857 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
2858 struct ieee80211_vif *vif,
2859 struct cfg80211_chan_def *chandef);
2824}; 2860};
2825 2861
2826/** 2862/**
@@ -2878,14 +2914,14 @@ enum ieee80211_tpt_led_trigger_flags {
2878}; 2914};
2879 2915
2880#ifdef CONFIG_MAC80211_LEDS 2916#ifdef CONFIG_MAC80211_LEDS
2881extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); 2917char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
2882extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); 2918char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
2883extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); 2919char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
2884extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); 2920char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
2885extern char *__ieee80211_create_tpt_led_trigger( 2921char *__ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
2886 struct ieee80211_hw *hw, unsigned int flags, 2922 unsigned int flags,
2887 const struct ieee80211_tpt_blink *blink_table, 2923 const struct ieee80211_tpt_blink *blink_table,
2888 unsigned int blink_table_len); 2924 unsigned int blink_table_len);
2889#endif 2925#endif
2890/** 2926/**
2891 * ieee80211_get_tx_led_name - get name of TX LED 2927 * ieee80211_get_tx_led_name - get name of TX LED
@@ -3316,6 +3352,25 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3316} 3352}
3317 3353
3318/** 3354/**
3355 * ieee80211_csa_finish - notify mac80211 about channel switch
3356 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3357 *
3358 * After a channel switch announcement was scheduled and the counter in this
3359 * announcement hit zero, this function must be called by the driver to
3360 * notify mac80211 that the channel can be changed.
3361 */
3362void ieee80211_csa_finish(struct ieee80211_vif *vif);
3363
3364/**
3365 * ieee80211_csa_is_complete - find out if counters reached zero
3366 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3367 *
3368 * This function returns whether the channel switch counters reached zero.
3369 */
3370bool ieee80211_csa_is_complete(struct ieee80211_vif *vif);
3371
3372
3373/**
3319 * ieee80211_proberesp_get - retrieve a Probe Response template 3374 * ieee80211_proberesp_get - retrieve a Probe Response template
3320 * @hw: pointer obtained from ieee80211_alloc_hw(). 3375 * @hw: pointer obtained from ieee80211_alloc_hw().
3321 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3376 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -3634,6 +3689,89 @@ void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
3634 int tid, struct ieee80211_key_seq *seq); 3689 int tid, struct ieee80211_key_seq *seq);
3635 3690
3636/** 3691/**
3692 * ieee80211_set_key_tx_seq - set key TX sequence counter
3693 *
3694 * @keyconf: the parameter passed with the set key
3695 * @seq: new sequence data
3696 *
3697 * This function allows a driver to set the current TX IV/PNs for the
3698 * given key. This is useful when resuming from WoWLAN sleep and the
3699 * device may have transmitted frames using the PTK, e.g. replies to
3700 * ARP requests.
3701 *
3702 * Note that this function may only be called when no TX processing
3703 * can be done concurrently.
3704 */
3705void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
3706 struct ieee80211_key_seq *seq);
3707
3708/**
3709 * ieee80211_set_key_rx_seq - set key RX sequence counter
3710 *
3711 * @keyconf: the parameter passed with the set key
3712 * @tid: The TID, or -1 for the management frame value (CCMP only);
3713 * the value on TID 0 is also used for non-QoS frames. For
3714 * CMAC, only TID 0 is valid.
3715 * @seq: new sequence data
3716 *
3717 * This function allows a driver to set the current RX IV/PNs for the
3718 * given key. This is useful when resuming from WoWLAN sleep and GTK
3719 * rekey may have been done while suspended. It should not be called
3720 * if IV checking is done by the device and not by mac80211.
3721 *
3722 * Note that this function may only be called when no RX processing
3723 * can be done concurrently.
3724 */
3725void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
3726 int tid, struct ieee80211_key_seq *seq);
3727
3728/**
3729 * ieee80211_remove_key - remove the given key
3730 * @keyconf: the parameter passed with the set key
3731 *
3732 * Remove the given key. If the key was uploaded to the hardware at the
3733 * time this function is called, it is not deleted in the hardware but
3734 * instead assumed to have been removed already.
3735 *
3736 * Note that due to locking considerations this function can (currently)
3737 * only be called during key iteration (ieee80211_iter_keys().)
3738 */
3739void ieee80211_remove_key(struct ieee80211_key_conf *keyconf);
3740
3741/**
3742 * ieee80211_gtk_rekey_add - add a GTK key from rekeying during WoWLAN
3743 * @vif: the virtual interface to add the key on
3744 * @keyconf: new key data
3745 *
3746 * When GTK rekeying was done while the system was suspended, (a) new
3747 * key(s) will be available. These will be needed by mac80211 for proper
3748 * RX processing, so this function allows setting them.
3749 *
3750 * The function returns the newly allocated key structure, which will
3751 * have similar contents to the passed key configuration but point to
3752 * mac80211-owned memory. In case of errors, the function returns an
3753 * ERR_PTR(), use IS_ERR() etc.
3754 *
3755 * Note that this function assumes the key isn't added to hardware
3756 * acceleration, so no TX will be done with the key. Since it's a GTK
3757 * on managed (station) networks, this is true anyway. If the driver
3758 * calls this function from the resume callback and subsequently uses
3759 * the return code 1 to reconfigure the device, this key will be part
3760 * of the reconfiguration.
3761 *
3762 * Note that the driver should also call ieee80211_set_key_rx_seq()
3763 * for the new key for each TID to set up sequence counters properly.
3764 *
3765 * IMPORTANT: If this replaces a key that is present in the hardware,
3766 * then it will attempt to remove it during this call. In many cases
3767 * this isn't what you want, so call ieee80211_remove_key() first for
3768 * the key that's being replaced.
3769 */
3770struct ieee80211_key_conf *
3771ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
3772 struct ieee80211_key_conf *keyconf);
3773
3774/**
3637 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying 3775 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
3638 * @vif: virtual interface the rekeying was done on 3776 * @vif: virtual interface the rekeying was done on
3639 * @bssid: The BSSID of the AP, for checking association 3777 * @bssid: The BSSID of the AP, for checking association
@@ -4205,8 +4343,10 @@ struct rate_control_ops {
4205 4343
4206 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 4344 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
4207 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, 4345 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
4346 struct cfg80211_chan_def *chandef,
4208 struct ieee80211_sta *sta, void *priv_sta); 4347 struct ieee80211_sta *sta, void *priv_sta);
4209 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, 4348 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
4349 struct cfg80211_chan_def *chandef,
4210 struct ieee80211_sta *sta, void *priv_sta, 4350 struct ieee80211_sta *sta, void *priv_sta,
4211 u32 changed); 4351 u32 changed);
4212 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 4352 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
diff --git a/include/net/mld.h b/include/net/mld.h
index 467143cd4e2f..faa1d161bf24 100644
--- a/include/net/mld.h
+++ b/include/net/mld.h
@@ -63,13 +63,48 @@ struct mld2_query {
63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay 63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay
64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1] 64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1]
65 65
66/* Max Response Code */ 66/* RFC3810, 5.1.3. Maximum Response Code:
67#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 67 *
68#define MLDV2_EXP(thresh, nbmant, nbexp, value) \ 68 * If Maximum Response Code >= 32768, Maximum Response Code represents a
69 ((value) < (thresh) ? (value) : \ 69 * floating-point value as follows:
70 ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \ 70 *
71 (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 71 * 0 1 2 3 4 5 6 7 8 9 A B C D E F
72 72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) 73 * |1| exp | mant |
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 */
76#define MLDV2_MRC_EXP(value) (((value) >> 12) & 0x0007)
77#define MLDV2_MRC_MAN(value) ((value) & 0x0fff)
78
79/* RFC3810, 5.1.9. QQIC (Querier's Query Interval Code):
80 *
81 * If QQIC >= 128, QQIC represents a floating-point value as follows:
82 *
83 * 0 1 2 3 4 5 6 7
84 * +-+-+-+-+-+-+-+-+
85 * |1| exp | mant |
86 * +-+-+-+-+-+-+-+-+
87 */
88#define MLDV2_QQIC_EXP(value) (((value) >> 4) & 0x07)
89#define MLDV2_QQIC_MAN(value) ((value) & 0x0f)
90
91static inline unsigned long mldv2_mrc(const struct mld2_query *mlh2)
92{
93 /* RFC3810, 5.1.3. Maximum Response Code */
94 unsigned long ret, mc_mrc = ntohs(mlh2->mld2q_mrc);
95
96 if (mc_mrc < 32768) {
97 ret = mc_mrc;
98 } else {
99 unsigned long mc_man, mc_exp;
100
101 mc_exp = MLDV2_MRC_EXP(mc_mrc);
102 mc_man = MLDV2_MRC_MAN(mc_mrc);
103
104 ret = (mc_man | 0x1000) << (mc_exp + 3);
105 }
106
107 return ret;
108}
74 109
75#endif 110#endif
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6fea32340ae8..3c4211f0bed6 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -204,6 +204,11 @@ extern void ndisc_send_ns(struct net_device *dev,
204extern void ndisc_send_rs(struct net_device *dev, 204extern void ndisc_send_rs(struct net_device *dev,
205 const struct in6_addr *saddr, 205 const struct in6_addr *saddr,
206 const struct in6_addr *daddr); 206 const struct in6_addr *daddr);
207extern void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
208 const struct in6_addr *daddr,
209 const struct in6_addr *solicited_addr,
210 bool router, bool solicited, bool override,
211 bool inc_opt);
207 212
208extern void ndisc_send_redirect(struct sk_buff *skb, 213extern void ndisc_send_redirect(struct sk_buff *skb,
209 const struct in6_addr *target); 214 const struct in6_addr *target);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 7e748ad8b50c..536501a3e58d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -195,68 +195,67 @@ static inline void *neighbour_priv(const struct neighbour *n)
195#define NEIGH_UPDATE_F_ISROUTER 0x40000000 195#define NEIGH_UPDATE_F_ISROUTER 0x40000000
196#define NEIGH_UPDATE_F_ADMIN 0x80000000 196#define NEIGH_UPDATE_F_ADMIN 0x80000000
197 197
198extern void neigh_table_init(struct neigh_table *tbl); 198void neigh_table_init(struct neigh_table *tbl);
199extern int neigh_table_clear(struct neigh_table *tbl); 199int neigh_table_clear(struct neigh_table *tbl);
200extern struct neighbour * neigh_lookup(struct neigh_table *tbl, 200struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
201 const void *pkey, 201 struct net_device *dev);
202 struct net_device *dev); 202struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
203extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, 203 const void *pkey);
204 struct net *net, 204struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
205 const void *pkey); 205 struct net_device *dev, bool want_ref);
206extern struct neighbour * __neigh_create(struct neigh_table *tbl,
207 const void *pkey,
208 struct net_device *dev,
209 bool want_ref);
210static inline struct neighbour *neigh_create(struct neigh_table *tbl, 206static inline struct neighbour *neigh_create(struct neigh_table *tbl,
211 const void *pkey, 207 const void *pkey,
212 struct net_device *dev) 208 struct net_device *dev)
213{ 209{
214 return __neigh_create(tbl, pkey, dev, true); 210 return __neigh_create(tbl, pkey, dev, true);
215} 211}
216extern void neigh_destroy(struct neighbour *neigh); 212void neigh_destroy(struct neighbour *neigh);
217extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
218extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, 214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
219 u32 flags); 215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
220extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
221extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
222extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 218int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
223extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); 219int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
224extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); 220int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
225extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); 221struct neighbour *neigh_event_ns(struct neigh_table *tbl,
226extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
227 u8 *lladdr, void *saddr, 222 u8 *lladdr, void *saddr,
228 struct net_device *dev); 223 struct net_device *dev);
229 224
230extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); 225struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
231extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); 226 struct neigh_table *tbl);
227void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
232 228
233static inline 229static inline
234struct net *neigh_parms_net(const struct neigh_parms *parms) 230struct net *neigh_parms_net(const struct neigh_parms *parms)
235{ 231{
236 return read_pnet(&parms->net); 232 return read_pnet(&parms->net);
237} 233}
238 234
239extern unsigned long neigh_rand_reach_time(unsigned long base); 235unsigned long neigh_rand_reach_time(unsigned long base);
240 236
241extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, 237void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
242 struct sk_buff *skb); 238 struct sk_buff *skb);
243extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); 239struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net,
244extern struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, 240 const void *key, struct net_device *dev,
245 struct net *net, 241 int creat);
246 const void *key, 242struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, struct net *net,
247 struct net_device *dev); 243 const void *key, struct net_device *dev);
248extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); 244int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key,
245 struct net_device *dev);
249 246
250static inline 247static inline struct net *pneigh_net(const struct pneigh_entry *pneigh)
251struct net *pneigh_net(const struct pneigh_entry *pneigh)
252{ 248{
253 return read_pnet(&pneigh->net); 249 return read_pnet(&pneigh->net);
254} 250}
255 251
256extern void neigh_app_ns(struct neighbour *n); 252void neigh_app_ns(struct neighbour *n);
257extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); 253void neigh_for_each(struct neigh_table *tbl,
258extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); 254 void (*cb)(struct neighbour *, void *), void *cookie);
259extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); 255void __neigh_for_each_release(struct neigh_table *tbl,
256 int (*cb)(struct neighbour *));
257void pneigh_for_each(struct neigh_table *tbl,
258 void (*cb)(struct pneigh_entry *));
260 259
261struct neigh_seq_state { 260struct neigh_seq_state {
262 struct seq_net_private p; 261 struct seq_net_private p;
@@ -270,15 +269,14 @@ struct neigh_seq_state {
270#define NEIGH_SEQ_IS_PNEIGH 0x00000002 269#define NEIGH_SEQ_IS_PNEIGH 0x00000002
271#define NEIGH_SEQ_SKIP_NOARP 0x00000004 270#define NEIGH_SEQ_SKIP_NOARP 0x00000004
272}; 271};
273extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); 272void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); 273 unsigned int);
275extern void neigh_seq_stop(struct seq_file *, void *); 274void *neigh_seq_next(struct seq_file *, void *, loff_t *);
276 275void neigh_seq_stop(struct seq_file *, void *);
277extern int neigh_sysctl_register(struct net_device *dev, 276
278 struct neigh_parms *p, 277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
279 char *p_name, 278 char *p_name, proc_handler *proc_handler);
280 proc_handler *proc_handler); 279void neigh_sysctl_unregister(struct neigh_parms *p);
281extern void neigh_sysctl_unregister(struct neigh_parms *p);
282 280
283static inline void __neigh_parms_put(struct neigh_parms *parms) 281static inline void __neigh_parms_put(struct neigh_parms *parms)
284{ 282{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 84e37b1ca9e1..1313456a0994 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -119,7 +119,6 @@ struct net {
119 struct netns_ipvs *ipvs; 119 struct netns_ipvs *ipvs;
120#endif 120#endif
121 struct sock *diag_nlsk; 121 struct sock *diag_nlsk;
122 atomic_t rt_genid;
123 atomic_t fnhe_genid; 122 atomic_t fnhe_genid;
124}; 123};
125 124
@@ -333,14 +332,42 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
333} 332}
334#endif 333#endif
335 334
336static inline int rt_genid(struct net *net) 335static inline int rt_genid_ipv4(struct net *net)
337{ 336{
338 return atomic_read(&net->rt_genid); 337 return atomic_read(&net->ipv4.rt_genid);
339} 338}
340 339
341static inline void rt_genid_bump(struct net *net) 340static inline void rt_genid_bump_ipv4(struct net *net)
342{ 341{
343 atomic_inc(&net->rt_genid); 342 atomic_inc(&net->ipv4.rt_genid);
343}
344
345#if IS_ENABLED(CONFIG_IPV6)
346static inline int rt_genid_ipv6(struct net *net)
347{
348 return atomic_read(&net->ipv6.rt_genid);
349}
350
351static inline void rt_genid_bump_ipv6(struct net *net)
352{
353 atomic_inc(&net->ipv6.rt_genid);
354}
355#else
356static inline int rt_genid_ipv6(struct net *net)
357{
358 return 0;
359}
360
361static inline void rt_genid_bump_ipv6(struct net *net)
362{
363}
364#endif
365
366/* For callers who don't really care about whether it's IPv4 or IPv6 */
367static inline void rt_genid_bump_all(struct net *net)
368{
369 rt_genid_bump_ipv4(net);
370 rt_genid_bump_ipv6(net);
344} 371}
345 372
346static inline int fnhe_genid(struct net *net) 373static inline int fnhe_genid(struct net *net)
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 644d9c223d24..0c1288a50e8b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -181,8 +181,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
181 const struct nf_conntrack_tuple *tuple); 181 const struct nf_conntrack_tuple *tuple);
182 182
183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184extern void nf_ct_delete_from_lists(struct nf_conn *ct); 184bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 185
187extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); 186extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
188 187
@@ -235,7 +234,7 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
235} 234}
236 235
237/* These are for NAT. Icky. */ 236/* These are for NAT. Icky. */
238extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, 237extern s32 (*nf_ct_nat_offset)(const struct nf_conn *ct,
239 enum ip_conntrack_dir dir, 238 enum ip_conntrack_dir dir,
240 u32 seq); 239 u32 seq);
241 240
@@ -249,7 +248,9 @@ extern void nf_ct_untracked_status_or(unsigned long bits);
249 248
250/* Iterate over all conntracks: if iter returns true, it's deleted. */ 249/* Iterate over all conntracks: if iter returns true, it's deleted. */
251extern void 250extern void
252nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); 251nf_ct_iterate_cleanup(struct net *net,
252 int (*iter)(struct nf_conn *i, void *data),
253 void *data, u32 portid, int report);
253extern void nf_conntrack_free(struct nf_conn *ct); 254extern void nf_conntrack_free(struct nf_conn *ct);
254extern struct nf_conn * 255extern struct nf_conn *
255nf_conntrack_alloc(struct net *net, u16 zone, 256nf_conntrack_alloc(struct net *net, u16 zone,
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 977bc8a46444..ff95434e50ca 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -10,6 +10,7 @@ enum nf_ct_ext_id {
10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE) 10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE)
11 NF_CT_EXT_NAT, 11 NF_CT_EXT_NAT,
12#endif 12#endif
13 NF_CT_EXT_SEQADJ,
13 NF_CT_EXT_ACCT, 14 NF_CT_EXT_ACCT,
14#ifdef CONFIG_NF_CONNTRACK_EVENTS 15#ifdef CONFIG_NF_CONNTRACK_EVENTS
15 NF_CT_EXT_ECACHE, 16 NF_CT_EXT_ECACHE,
@@ -26,17 +27,22 @@ enum nf_ct_ext_id {
26#ifdef CONFIG_NF_CONNTRACK_LABELS 27#ifdef CONFIG_NF_CONNTRACK_LABELS
27 NF_CT_EXT_LABELS, 28 NF_CT_EXT_LABELS,
28#endif 29#endif
30#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
31 NF_CT_EXT_SYNPROXY,
32#endif
29 NF_CT_EXT_NUM, 33 NF_CT_EXT_NUM,
30}; 34};
31 35
32#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help 36#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
33#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat 37#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
38#define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj
34#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter 39#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter
35#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 40#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
36#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone 41#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
37#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 42#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
38#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout 43#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
39#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels 44#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
45#define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy
40 46
41/* Extensions: optional stuff which isn't permanently in struct. */ 47/* Extensions: optional stuff which isn't permanently in struct. */
42struct nf_ct_ext { 48struct nf_ct_ext {
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 914d8d900798..b411d7b17dec 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -148,17 +148,10 @@ extern int nf_ct_port_nlattr_tuple_size(void);
148extern const struct nla_policy nf_ct_port_nla_policy[]; 148extern const struct nla_policy nf_ct_port_nla_policy[];
149 149
150#ifdef CONFIG_SYSCTL 150#ifdef CONFIG_SYSCTL
151#ifdef DEBUG_INVALID_PACKETS
152#define LOG_INVALID(net, proto) \ 151#define LOG_INVALID(net, proto) \
153 ((net)->ct.sysctl_log_invalid == (proto) || \ 152 ((net)->ct.sysctl_log_invalid == (proto) || \
154 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) 153 (net)->ct.sysctl_log_invalid == IPPROTO_RAW)
155#else 154#else
156#define LOG_INVALID(net, proto) \
157 (((net)->ct.sysctl_log_invalid == (proto) || \
158 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) \
159 && net_ratelimit())
160#endif
161#else
162static inline int LOG_INVALID(struct net *net, int proto) { return 0; } 155static inline int LOG_INVALID(struct net *net, int proto) { return 0; }
163#endif /* CONFIG_SYSCTL */ 156#endif /* CONFIG_SYSCTL */
164 157
diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h
new file mode 100644
index 000000000000..f6177a5fe0ca
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_seqadj.h
@@ -0,0 +1,51 @@
1#ifndef _NF_CONNTRACK_SEQADJ_H
2#define _NF_CONNTRACK_SEQADJ_H
3
4#include <net/netfilter/nf_conntrack_extend.h>
5
6/**
7 * struct nf_ct_seqadj - sequence number adjustment information
8 *
9 * @correction_pos: position of the last TCP sequence number modification
10 * @offset_before: sequence number offset before last modification
11 * @offset_after: sequence number offset after last modification
12 */
13struct nf_ct_seqadj {
14 u32 correction_pos;
15 s32 offset_before;
16 s32 offset_after;
17};
18
19struct nf_conn_seqadj {
20 struct nf_ct_seqadj seq[IP_CT_DIR_MAX];
21};
22
23static inline struct nf_conn_seqadj *nfct_seqadj(const struct nf_conn *ct)
24{
25 return nf_ct_ext_find(ct, NF_CT_EXT_SEQADJ);
26}
27
28static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
29{
30 return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
31}
32
33extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
34 s32 off);
35extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
36 __be32 seq, s32 off);
37extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb,
38 struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo,
40 s32 off);
41
42extern int nf_ct_seq_adjust(struct sk_buff *skb,
43 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
44 unsigned int protoff);
45extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir,
46 u32 seq);
47
48extern int nf_conntrack_seqadj_init(void);
49extern void nf_conntrack_seqadj_fini(void);
50
51#endif /* _NF_CONNTRACK_SEQADJ_H */
diff --git a/include/net/netfilter/nf_conntrack_synproxy.h b/include/net/netfilter/nf_conntrack_synproxy.h
new file mode 100644
index 000000000000..806f54a290d6
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_synproxy.h
@@ -0,0 +1,77 @@
1#ifndef _NF_CONNTRACK_SYNPROXY_H
2#define _NF_CONNTRACK_SYNPROXY_H
3
4#include <net/netns/generic.h>
5
6struct nf_conn_synproxy {
7 u32 isn;
8 u32 its;
9 u32 tsoff;
10};
11
12static inline struct nf_conn_synproxy *nfct_synproxy(const struct nf_conn *ct)
13{
14#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
15 return nf_ct_ext_find(ct, NF_CT_EXT_SYNPROXY);
16#else
17 return NULL;
18#endif
19}
20
21static inline struct nf_conn_synproxy *nfct_synproxy_ext_add(struct nf_conn *ct)
22{
23#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
24 return nf_ct_ext_add(ct, NF_CT_EXT_SYNPROXY, GFP_ATOMIC);
25#else
26 return NULL;
27#endif
28}
29
30struct synproxy_stats {
31 unsigned int syn_received;
32 unsigned int cookie_invalid;
33 unsigned int cookie_valid;
34 unsigned int cookie_retrans;
35 unsigned int conn_reopened;
36};
37
38struct synproxy_net {
39 struct nf_conn *tmpl;
40 struct synproxy_stats __percpu *stats;
41};
42
43extern int synproxy_net_id;
44static inline struct synproxy_net *synproxy_pernet(struct net *net)
45{
46 return net_generic(net, synproxy_net_id);
47}
48
49struct synproxy_options {
50 u8 options;
51 u8 wscale;
52 u16 mss;
53 u32 tsval;
54 u32 tsecr;
55};
56
57struct tcphdr;
58struct xt_synproxy_info;
59extern void synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
60 const struct tcphdr *th,
61 struct synproxy_options *opts);
62extern unsigned int synproxy_options_size(const struct synproxy_options *opts);
63extern void synproxy_build_options(struct tcphdr *th,
64 const struct synproxy_options *opts);
65
66extern void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info,
67 struct synproxy_options *opts);
68extern void synproxy_check_timestamp_cookie(struct synproxy_options *opts);
69
70extern unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
71 unsigned int protoff,
72 struct tcphdr *th,
73 struct nf_conn *ct,
74 enum ip_conntrack_info ctinfo,
75 const struct nf_conn_synproxy *synproxy);
76
77#endif /* _NF_CONNTRACK_SYNPROXY_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index ad14a799fd2e..59a192420053 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -13,15 +13,6 @@ enum nf_nat_manip_type {
13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ 13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
14 (hooknum) != NF_INET_LOCAL_IN) 14 (hooknum) != NF_INET_LOCAL_IN)
15 15
16/* NAT sequence number modifications */
17struct nf_nat_seq {
18 /* position of the last TCP sequence number modification (if any) */
19 u_int32_t correction_pos;
20
21 /* sequence number offset before and after last modification */
22 int16_t offset_before, offset_after;
23};
24
25#include <linux/list.h> 16#include <linux/list.h>
26#include <linux/netfilter/nf_conntrack_pptp.h> 17#include <linux/netfilter/nf_conntrack_pptp.h>
27#include <net/netfilter/nf_conntrack_extend.h> 18#include <net/netfilter/nf_conntrack_extend.h>
@@ -39,7 +30,6 @@ struct nf_conn;
39/* The structure embedded in the conntrack structure. */ 30/* The structure embedded in the conntrack structure. */
40struct nf_conn_nat { 31struct nf_conn_nat {
41 struct hlist_node bysource; 32 struct hlist_node bysource;
42 struct nf_nat_seq seq[IP_CT_DIR_MAX];
43 struct nf_conn *ct; 33 struct nf_conn *ct;
44 union nf_conntrack_nat_help help; 34 union nf_conntrack_nat_help help;
45#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ 35#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index b4d6bfc2af03..404324d1d0c4 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -39,28 +39,9 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
39 const char *rep_buffer, 39 const char *rep_buffer,
40 unsigned int rep_len); 40 unsigned int rep_len);
41 41
42extern void nf_nat_set_seq_adjust(struct nf_conn *ct,
43 enum ip_conntrack_info ctinfo,
44 __be32 seq, s16 off);
45extern int nf_nat_seq_adjust(struct sk_buff *skb,
46 struct nf_conn *ct,
47 enum ip_conntrack_info ctinfo,
48 unsigned int protoff);
49extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb,
50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo,
52 unsigned int protoff);
53
54/* Setup NAT on this expected conntrack so it follows master, but goes 42/* Setup NAT on this expected conntrack so it follows master, but goes
55 * to port ct->master->saved_proto. */ 43 * to port ct->master->saved_proto. */
56extern void nf_nat_follow_master(struct nf_conn *ct, 44extern void nf_nat_follow_master(struct nf_conn *ct,
57 struct nf_conntrack_expect *this); 45 struct nf_conntrack_expect *this);
58 46
59extern s16 nf_nat_get_offset(const struct nf_conn *ct,
60 enum ip_conntrack_dir dir,
61 u32 seq);
62
63extern void nf_nat_tcp_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
64 u32 dir, int off);
65
66#endif 47#endif
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
deleted file mode 100644
index 36d9379d4c4b..000000000000
--- a/include/net/netfilter/nf_tproxy_core.h
+++ /dev/null
@@ -1,210 +0,0 @@
1#ifndef _NF_TPROXY_CORE_H
2#define _NF_TPROXY_CORE_H
3
4#include <linux/types.h>
5#include <linux/in.h>
6#include <linux/skbuff.h>
7#include <net/sock.h>
8#include <net/inet_hashtables.h>
9#include <net/inet6_hashtables.h>
10#include <net/tcp.h>
11
12#define NFT_LOOKUP_ANY 0
13#define NFT_LOOKUP_LISTENER 1
14#define NFT_LOOKUP_ESTABLISHED 2
15
16/* look up and get a reference to a matching socket */
17
18
19/* This function is used by the 'TPROXY' target and the 'socket'
20 * match. The following lookups are supported:
21 *
22 * Explicit TProxy target rule
23 * ===========================
24 *
25 * This is used when the user wants to intercept a connection matching
26 * an explicit iptables rule. In this case the sockets are assumed
27 * matching in preference order:
28 *
29 * - match: if there's a fully established connection matching the
30 * _packet_ tuple, it is returned, assuming the redirection
31 * already took place and we process a packet belonging to an
32 * established connection
33 *
34 * - match: if there's a listening socket matching the redirection
35 * (e.g. on-port & on-ip of the connection), it is returned,
36 * regardless if it was bound to 0.0.0.0 or an explicit
37 * address. The reasoning is that if there's an explicit rule, it
38 * does not really matter if the listener is bound to an interface
39 * or to 0. The user already stated that he wants redirection
40 * (since he added the rule).
41 *
42 * "socket" match based redirection (no specific rule)
43 * ===================================================
44 *
45 * There are connections with dynamic endpoints (e.g. FTP data
46 * connection) that the user is unable to add explicit rules
47 * for. These are taken care of by a generic "socket" rule. It is
48 * assumed that the proxy application is trusted to open such
49 * connections without explicit iptables rule (except of course the
50 * generic 'socket' rule). In this case the following sockets are
51 * matched in preference order:
52 *
53 * - match: if there's a fully established connection matching the
54 * _packet_ tuple
55 *
56 * - match: if there's a non-zero bound listener (possibly with a
57 * non-local address) We don't accept zero-bound listeners, since
58 * then local services could intercept traffic going through the
59 * box.
60 *
61 * Please note that there's an overlap between what a TPROXY target
62 * and a socket match will match. Normally if you have both rules the
63 * "socket" match will be the first one, effectively all packets
64 * belonging to established connections going through that one.
65 */
66static inline struct sock *
67nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
68 const __be32 saddr, const __be32 daddr,
69 const __be16 sport, const __be16 dport,
70 const struct net_device *in, int lookup_type)
71{
72 struct sock *sk;
73
74 /* look up socket */
75 switch (protocol) {
76 case IPPROTO_TCP:
77 switch (lookup_type) {
78 case NFT_LOOKUP_ANY:
79 sk = __inet_lookup(net, &tcp_hashinfo,
80 saddr, sport, daddr, dport,
81 in->ifindex);
82 break;
83 case NFT_LOOKUP_LISTENER:
84 sk = inet_lookup_listener(net, &tcp_hashinfo,
85 saddr, sport,
86 daddr, dport,
87 in->ifindex);
88
89 /* NOTE: we return listeners even if bound to
90 * 0.0.0.0, those are filtered out in
91 * xt_socket, since xt_TPROXY needs 0 bound
92 * listeners too */
93
94 break;
95 case NFT_LOOKUP_ESTABLISHED:
96 sk = inet_lookup_established(net, &tcp_hashinfo,
97 saddr, sport, daddr, dport,
98 in->ifindex);
99 break;
100 default:
101 WARN_ON(1);
102 sk = NULL;
103 break;
104 }
105 break;
106 case IPPROTO_UDP:
107 sk = udp4_lib_lookup(net, saddr, sport, daddr, dport,
108 in->ifindex);
109 if (sk && lookup_type != NFT_LOOKUP_ANY) {
110 int connected = (sk->sk_state == TCP_ESTABLISHED);
111 int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0);
112
113 /* NOTE: we return listeners even if bound to
114 * 0.0.0.0, those are filtered out in
115 * xt_socket, since xt_TPROXY needs 0 bound
116 * listeners too */
117 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
118 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
119 sock_put(sk);
120 sk = NULL;
121 }
122 }
123 break;
124 default:
125 WARN_ON(1);
126 sk = NULL;
127 }
128
129 pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n",
130 protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), lookup_type, sk);
131
132 return sk;
133}
134
135#if IS_ENABLED(CONFIG_IPV6)
136static inline struct sock *
137nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
138 const struct in6_addr *saddr, const struct in6_addr *daddr,
139 const __be16 sport, const __be16 dport,
140 const struct net_device *in, int lookup_type)
141{
142 struct sock *sk;
143
144 /* look up socket */
145 switch (protocol) {
146 case IPPROTO_TCP:
147 switch (lookup_type) {
148 case NFT_LOOKUP_ANY:
149 sk = inet6_lookup(net, &tcp_hashinfo,
150 saddr, sport, daddr, dport,
151 in->ifindex);
152 break;
153 case NFT_LOOKUP_LISTENER:
154 sk = inet6_lookup_listener(net, &tcp_hashinfo,
155 saddr, sport,
156 daddr, ntohs(dport),
157 in->ifindex);
158
159 /* NOTE: we return listeners even if bound to
160 * 0.0.0.0, those are filtered out in
161 * xt_socket, since xt_TPROXY needs 0 bound
162 * listeners too */
163
164 break;
165 case NFT_LOOKUP_ESTABLISHED:
166 sk = __inet6_lookup_established(net, &tcp_hashinfo,
167 saddr, sport, daddr, ntohs(dport),
168 in->ifindex);
169 break;
170 default:
171 WARN_ON(1);
172 sk = NULL;
173 break;
174 }
175 break;
176 case IPPROTO_UDP:
177 sk = udp6_lib_lookup(net, saddr, sport, daddr, dport,
178 in->ifindex);
179 if (sk && lookup_type != NFT_LOOKUP_ANY) {
180 int connected = (sk->sk_state == TCP_ESTABLISHED);
181 int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr);
182
183 /* NOTE: we return listeners even if bound to
184 * 0.0.0.0, those are filtered out in
185 * xt_socket, since xt_TPROXY needs 0 bound
186 * listeners too */
187 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
188 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
189 sock_put(sk);
190 sk = NULL;
191 }
192 }
193 break;
194 default:
195 WARN_ON(1);
196 sk = NULL;
197 }
198
199 pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
200 protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk);
201
202 return sk;
203}
204#endif
205
206/* assign a socket to the skb -- consumes sk */
207void
208nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
209
210#endif
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h
index 86267a529514..aff88ba91391 100644
--- a/include/net/netfilter/nfnetlink_queue.h
+++ b/include/net/netfilter/nfnetlink_queue.h
@@ -15,6 +15,8 @@ int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct,
15 enum ip_conntrack_info ctinfo); 15 enum ip_conntrack_info ctinfo);
16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, 16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
17 enum ip_conntrack_info ctinfo, int diff); 17 enum ip_conntrack_info ctinfo, int diff);
18int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
19 u32 portid, u32 report);
18#else 20#else
19inline struct nf_conn * 21inline struct nf_conn *
20nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo) 22nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo)
@@ -39,5 +41,11 @@ inline void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo, int diff) 41 enum ip_conntrack_info ctinfo, int diff)
40{ 42{
41} 43}
44
45inline int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
46 u32 portid, u32 report)
47{
48 return 0;
49}
42#endif /* NF_CONNTRACK */ 50#endif /* NF_CONNTRACK */
43#endif 51#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ba9de89e8ec..bf2ec2202c56 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -77,5 +77,6 @@ struct netns_ipv4 {
77 struct fib_rules_ops *mr_rules_ops; 77 struct fib_rules_ops *mr_rules_ops;
78#endif 78#endif
79#endif 79#endif
80 atomic_t rt_genid;
80}; 81};
81#endif 82#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 005e2c2e39a9..0fb2401197c5 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -72,6 +72,7 @@ struct netns_ipv6 {
72#endif 72#endif
73#endif 73#endif
74 atomic_t dev_addr_genid; 74 atomic_t dev_addr_genid;
75 atomic_t rt_genid;
75}; 76};
76 77
77#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 78#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index a24f8bb3ca47..099d02782e22 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -25,7 +25,7 @@ struct netprio_map {
25 u32 priomap[]; 25 u32 priomap[];
26}; 26};
27 27
28extern void sock_update_netprioidx(struct sock *sk); 28void sock_update_netprioidx(struct sock *sk);
29 29
30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
31 31
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5f286b726bb6..f68ee68e4e3e 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -224,6 +224,9 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev,
224 u8 *gt, u8 gt_len); 224 u8 *gt, u8 gt_len);
225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); 225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len);
226 226
227int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
228 u32 result);
229
227int nfc_targets_found(struct nfc_dev *dev, 230int nfc_targets_found(struct nfc_dev *dev,
228 struct nfc_target *targets, int ntargets); 231 struct nfc_target *targets, int ntargets);
229int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); 232int nfc_target_lost(struct nfc_dev *dev, u32 target_idx);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 13174509cdfd..2ebef77a2f9a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -14,8 +14,8 @@ struct tcf_walker {
14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); 14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *);
15}; 15};
16 16
17extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); 17int register_tcf_proto_ops(struct tcf_proto_ops *ops);
18extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); 18int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
19 19
20static inline unsigned long 20static inline unsigned long
21__cls_set_class(unsigned long *clp, unsigned long cl) 21__cls_set_class(unsigned long *clp, unsigned long cl)
@@ -126,17 +126,17 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
126 return 0; 126 return 0;
127} 127}
128 128
129extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 129int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 130 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 131 struct tcf_exts *exts,
132 const struct tcf_ext_map *map); 132 const struct tcf_ext_map *map);
133extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 135 struct tcf_exts *src);
136extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts,
137 const struct tcf_ext_map *map); 137 const struct tcf_ext_map *map);
138extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, 138int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
139 const struct tcf_ext_map *map); 139 const struct tcf_ext_map *map);
140 140
141/** 141/**
142 * struct tcf_pkt_info - packet information 142 * struct tcf_pkt_info - packet information
@@ -239,14 +239,14 @@ struct tcf_ematch_ops {
239 struct list_head link; 239 struct list_head link;
240}; 240};
241 241
242extern int tcf_em_register(struct tcf_ematch_ops *); 242int tcf_em_register(struct tcf_ematch_ops *);
243extern void tcf_em_unregister(struct tcf_ematch_ops *); 243void tcf_em_unregister(struct tcf_ematch_ops *);
244extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, 244int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
245 struct tcf_ematch_tree *); 245 struct tcf_ematch_tree *);
246extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); 246void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
247extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); 247int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int);
248extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, 248int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *,
249 struct tcf_pkt_info *); 249 struct tcf_pkt_info *);
250 250
251/** 251/**
252 * tcf_em_tree_change - replace ematch tree of a running classifier 252 * tcf_em_tree_change - replace ematch tree of a running classifier
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 388bf8b6d060..59ec3cd15d68 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -64,8 +64,8 @@ struct qdisc_watchdog {
64 struct Qdisc *qdisc; 64 struct Qdisc *qdisc;
65}; 65};
66 66
67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 67void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
68extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires); 68void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
69 69
70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, 70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
71 psched_time_t expires) 71 psched_time_t expires)
@@ -73,31 +73,34 @@ static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires)); 73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
74} 74}
75 75
76extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); 76void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
77 77
78extern struct Qdisc_ops pfifo_qdisc_ops; 78extern struct Qdisc_ops pfifo_qdisc_ops;
79extern struct Qdisc_ops bfifo_qdisc_ops; 79extern struct Qdisc_ops bfifo_qdisc_ops;
80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops; 80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
81 81
82extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); 82int fifo_set_limit(struct Qdisc *q, unsigned int limit);
83extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, 83struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
84 unsigned int limit); 84 unsigned int limit);
85 85
86extern int register_qdisc(struct Qdisc_ops *qops); 86int register_qdisc(struct Qdisc_ops *qops);
87extern int unregister_qdisc(struct Qdisc_ops *qops); 87int unregister_qdisc(struct Qdisc_ops *qops);
88extern void qdisc_list_del(struct Qdisc *q); 88void qdisc_get_default(char *id, size_t len);
89extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 89int qdisc_set_default(const char *id);
90extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 90
91extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 91void qdisc_list_del(struct Qdisc *q);
92 struct nlattr *tab); 92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
94extern void qdisc_put_stab(struct qdisc_size_table *tab); 94struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
95extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 95 struct nlattr *tab);
96extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, 96void qdisc_put_rtab(struct qdisc_rate_table *tab);
97 struct net_device *dev, struct netdev_queue *txq, 97void qdisc_put_stab(struct qdisc_size_table *tab);
98 spinlock_t *root_lock); 98void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
99 99int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
100extern void __qdisc_run(struct Qdisc *q); 100 struct net_device *dev, struct netdev_queue *txq,
101 spinlock_t *root_lock);
102
103void __qdisc_run(struct Qdisc *q);
101 104
102static inline void qdisc_run(struct Qdisc *q) 105static inline void qdisc_run(struct Qdisc *q)
103{ 106{
@@ -105,10 +108,10 @@ static inline void qdisc_run(struct Qdisc *q)
105 __qdisc_run(q); 108 __qdisc_run(q);
106} 109}
107 110
108extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, 111int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
109 struct tcf_result *res);
110extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
111 struct tcf_result *res); 112 struct tcf_result *res);
113int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
114 struct tcf_result *res);
112 115
113/* Calculate maximal size of packet seen by hard_start_xmit 116/* Calculate maximal size of packet seen by hard_start_xmit
114 routine of this device. 117 routine of this device.
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index e5ae0c50fa9c..f4eb365f7dcd 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -316,6 +316,7 @@ extern struct Qdisc noop_qdisc;
316extern struct Qdisc_ops noop_qdisc_ops; 316extern struct Qdisc_ops noop_qdisc_ops;
317extern struct Qdisc_ops pfifo_fast_ops; 317extern struct Qdisc_ops pfifo_fast_ops;
318extern struct Qdisc_ops mq_qdisc_ops; 318extern struct Qdisc_ops mq_qdisc_ops;
319extern const struct Qdisc_ops *default_qdisc_ops;
319 320
320struct Qdisc_class_common { 321struct Qdisc_class_common {
321 u32 classid; 322 u32 classid;
@@ -350,30 +351,32 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
350 return NULL; 351 return NULL;
351} 352}
352 353
353extern int qdisc_class_hash_init(struct Qdisc_class_hash *); 354int qdisc_class_hash_init(struct Qdisc_class_hash *);
354extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *); 355void qdisc_class_hash_insert(struct Qdisc_class_hash *,
355extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *); 356 struct Qdisc_class_common *);
356extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *); 357void qdisc_class_hash_remove(struct Qdisc_class_hash *,
357extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *); 358 struct Qdisc_class_common *);
358 359void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
359extern void dev_init_scheduler(struct net_device *dev); 360void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
360extern void dev_shutdown(struct net_device *dev); 361
361extern void dev_activate(struct net_device *dev); 362void dev_init_scheduler(struct net_device *dev);
362extern void dev_deactivate(struct net_device *dev); 363void dev_shutdown(struct net_device *dev);
363extern void dev_deactivate_many(struct list_head *head); 364void dev_activate(struct net_device *dev);
364extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, 365void dev_deactivate(struct net_device *dev);
365 struct Qdisc *qdisc); 366void dev_deactivate_many(struct list_head *head);
366extern void qdisc_reset(struct Qdisc *qdisc); 367struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
367extern void qdisc_destroy(struct Qdisc *qdisc); 368 struct Qdisc *qdisc);
368extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 369void qdisc_reset(struct Qdisc *qdisc);
369extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 370void qdisc_destroy(struct Qdisc *qdisc);
370 struct Qdisc_ops *ops); 371void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
371extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, 372struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
372 struct Qdisc_ops *ops, u32 parentid); 373 const struct Qdisc_ops *ops);
373extern void __qdisc_calculate_pkt_len(struct sk_buff *skb, 374struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
374 const struct qdisc_size_table *stab); 375 const struct Qdisc_ops *ops, u32 parentid);
375extern void tcf_destroy(struct tcf_proto *tp); 376void __qdisc_calculate_pkt_len(struct sk_buff *skb,
376extern void tcf_destroy_chain(struct tcf_proto **fl); 377 const struct qdisc_size_table *stab);
378void tcf_destroy(struct tcf_proto *tp);
379void tcf_destroy_chain(struct tcf_proto **fl);
377 380
378/* Reset all TX qdiscs greater then index of a device. */ 381/* Reset all TX qdiscs greater then index of a device. */
379static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) 382static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
@@ -698,7 +701,8 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
698 return ((u64)len * r->mult) >> r->shift; 701 return ((u64)len * r->mult) >> r->shift;
699} 702}
700 703
701extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); 704void psched_ratecfg_precompute(struct psched_ratecfg *r,
705 const struct tc_ratespec *conf);
702 706
703static inline void psched_ratecfg_getrate(struct tc_ratespec *res, 707static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
704 const struct psched_ratecfg *r) 708 const struct psched_ratecfg *r)
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 49bc9577c61e..aa80bef3c9d5 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -22,16 +22,10 @@
22 * 22 *
23 * Please send any bug reports or fixes you make to the 23 * Please send any bug reports or fixes you make to the
24 * email address(es): 24 * email address(es):
25 * lksctp developers <lksctp-developers@lists.sourceforge.net> 25 * lksctp developers <linux-sctp@vger.kernel.org>
26 *
27 * Or submit a bug report through the following website:
28 * http://www.sf.net/projects/lksctp
29 * 26 *
30 * Written or modified by: 27 * Written or modified by:
31 * Vlad Yasevich <vladislav.yasevich@hp.com> 28 * Vlad Yasevich <vladislav.yasevich@hp.com>
32 *
33 * Any bugs reported given to us we will try to fix... any fixes shared will
34 * be incorporated into the next SCTP release.
35 */ 29 */
36 30
37#ifndef __sctp_auth_h__ 31#ifndef __sctp_auth_h__
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 0cb08e6fb6df..259924d63ba6 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Dinakaran Joseph 31 * Dinakaran Joseph
@@ -37,9 +34,6 @@
37 * 34 *
38 * Rewritten to use libcrc32c by: 35 * Rewritten to use libcrc32c by:
39 * Vlad Yasevich <vladislav.yasevich@hp.com> 36 * Vlad Yasevich <vladislav.yasevich@hp.com>
40 *
41 * Any bugs reported given to us we will try to fix... any fixes shared will
42 * be incorporated into the next SCTP release.
43 */ 37 */
44 38
45#ifndef __sctp_checksum_h__ 39#ifndef __sctp_checksum_h__
@@ -85,4 +79,19 @@ static inline __le32 sctp_end_cksum(__u32 crc32)
85 return cpu_to_le32(~crc32); 79 return cpu_to_le32(~crc32);
86} 80}
87 81
82/* Calculate the CRC32C checksum of an SCTP packet. */
83static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
84 unsigned int offset)
85{
86 const struct sk_buff *iter;
87
88 __u32 crc32 = sctp_start_cksum(skb->data + offset,
89 skb_headlen(skb) - offset);
90 skb_walk_frags(skb, iter)
91 crc32 = sctp_update_cksum((__u8 *) iter->data,
92 skb_headlen(iter), crc32);
93
94 return sctp_end_cksum(crc32);
95}
96
88#endif /* __sctp_checksum_h__ */ 97#endif /* __sctp_checksum_h__ */
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 35247271e557..832f2191489c 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -23,19 +23,17 @@
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 * 25 *
26 * Please send any bug reports or fixes you make to one of the 26 * Please send any bug reports or fixes you make to the
27 * following email addresses: 27 * email address(es):
28 * lksctp developers <linux-sctp@vger.kernel.org>
28 * 29 *
29 * La Monte H.P. Yarroll <piggy@acm.org> 30 * Written or modified by:
30 * Karl Knutson <karl@athena.chicago.il.us> 31 * La Monte H.P. Yarroll <piggy@acm.org>
31 * Ardelle Fan <ardelle.fan@intel.com> 32 * Karl Knutson <karl@athena.chicago.il.us>
32 * Sridhar Samudrala <sri@us.ibm.com> 33 * Ardelle Fan <ardelle.fan@intel.com>
33 * 34 * Sridhar Samudrala <sri@us.ibm.com>
34 * Any bugs reported given to us we will try to fix... any fixes shared will
35 * be incorporated into the next SCTP release.
36 */ 35 */
37 36
38
39#ifndef __net_sctp_command_h__ 37#ifndef __net_sctp_command_h__
40#define __net_sctp_command_h__ 38#define __net_sctp_command_h__
41 39
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index ca50e0751e47..2f0a565a0fd5 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * La Monte H.P. Yarroll <piggy@acm.org> 31 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -39,9 +36,6 @@
39 * Xingang Guo <xingang.guo@intel.com> 36 * Xingang Guo <xingang.guo@intel.com>
40 * Sridhar Samudrala <samudrala@us.ibm.com> 37 * Sridhar Samudrala <samudrala@us.ibm.com>
41 * Daisy Chang <daisyc@us.ibm.com> 38 * Daisy Chang <daisyc@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_constants_h__ 41#ifndef __sctp_constants_h__
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d8e37ecea691..3794c5ad20fe 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email address(es): 29 * email address(es):
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -41,9 +38,6 @@
41 * Ardelle Fan <ardelle.fan@intel.com> 38 * Ardelle Fan <ardelle.fan@intel.com>
42 * Ryan Layer <rmlayer@us.ibm.com> 39 * Ryan Layer <rmlayer@us.ibm.com>
43 * Kevin Gao <kevin.gao@intel.com> 40 * Kevin Gao <kevin.gao@intel.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __net_sctp_h__ 43#ifndef __net_sctp_h__
@@ -613,7 +607,7 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
613 */ 607 */
614static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 608static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
615{ 609{
616 if (t->dst && !dst_check(t->dst, 0)) { 610 if (t->dst && !dst_check(t->dst, t->dst_cookie)) {
617 dst_release(t->dst); 611 dst_release(t->dst);
618 t->dst = NULL; 612 t->dst = NULL;
619 } 613 }
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 2a82d1384706..4ef75af340b6 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email addresses: 29 * email addresses:
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -42,9 +39,6 @@
42 * Daisy Chang <daisyc@us.ibm.com> 39 * Daisy Chang <daisyc@us.ibm.com>
43 * Ardelle Fan <ardelle.fan@intel.com> 40 * Ardelle Fan <ardelle.fan@intel.com>
44 * Kevin Gao <kevin.gao@intel.com> 41 * Kevin Gao <kevin.gao@intel.com>
45 *
46 * Any bugs reported given to us we will try to fix... any fixes shared will
47 * be incorporated into the next SCTP release.
48 */ 42 */
49 43
50#include <linux/types.h> 44#include <linux/types.h>
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e745c92a1532..2174d8da0770 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email addresses: 27 * email addresses:
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Randall Stewart <randall@sctp.chicago.il.us> 31 * Randall Stewart <randall@sctp.chicago.il.us>
@@ -46,9 +43,6 @@
46 * Ryan Layer <rmlayer@us.ibm.com> 43 * Ryan Layer <rmlayer@us.ibm.com>
47 * Anup Pemmaiah <pemmaiah@cc.usu.edu> 44 * Anup Pemmaiah <pemmaiah@cc.usu.edu>
48 * Kevin Gao <kevin.gao@intel.com> 45 * Kevin Gao <kevin.gao@intel.com>
49 *
50 * Any bugs reported given to us we will try to fix... any fixes shared will
51 * be incorporated into the next SCTP release.
52 */ 46 */
53 47
54#ifndef __sctp_structs_h__ 48#ifndef __sctp_structs_h__
@@ -119,29 +113,27 @@ struct sctp_hashbucket {
119 113
120/* The SCTP globals structure. */ 114/* The SCTP globals structure. */
121extern struct sctp_globals { 115extern struct sctp_globals {
122 /* The following variables are implementation specific. */
123
124 /* Default initialization values to be applied to new associations. */
125 __u16 max_instreams;
126 __u16 max_outstreams;
127
128 /* This is a list of groups of functions for each address 116 /* This is a list of groups of functions for each address
129 * family that we support. 117 * family that we support.
130 */ 118 */
131 struct list_head address_families; 119 struct list_head address_families;
132 120
133 /* This is the hash of all endpoints. */ 121 /* This is the hash of all endpoints. */
134 int ep_hashsize;
135 struct sctp_hashbucket *ep_hashtable; 122 struct sctp_hashbucket *ep_hashtable;
136
137 /* This is the hash of all associations. */ 123 /* This is the hash of all associations. */
138 int assoc_hashsize;
139 struct sctp_hashbucket *assoc_hashtable; 124 struct sctp_hashbucket *assoc_hashtable;
140
141 /* This is the sctp port control hash. */ 125 /* This is the sctp port control hash. */
142 int port_hashsize;
143 struct sctp_bind_hashbucket *port_hashtable; 126 struct sctp_bind_hashbucket *port_hashtable;
144 127
128 /* Sizes of above hashtables. */
129 int ep_hashsize;
130 int assoc_hashsize;
131 int port_hashsize;
132
133 /* Default initialization values to be applied to new associations. */
134 __u16 max_instreams;
135 __u16 max_outstreams;
136
145 /* Flag to indicate whether computing and verifying checksum 137 /* Flag to indicate whether computing and verifying checksum
146 * is disabled. */ 138 * is disabled. */
147 bool checksum_disable; 139 bool checksum_disable;
@@ -782,6 +774,7 @@ struct sctp_transport {
782 774
783 /* Has this transport moved the ctsn since we last sacked */ 775 /* Has this transport moved the ctsn since we last sacked */
784 __u32 sack_generation; 776 __u32 sack_generation;
777 u32 dst_cookie;
785 778
786 struct flowi fl; 779 struct flowi fl;
787 780
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 2c5d2b4d5d1e..54bbbe547303 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -28,19 +28,13 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 *
33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp
35 * 32 *
36 * Written or modified by: 33 * Written or modified by:
37 * Jon Grimm <jgrimm@us.ibm.com> 34 * Jon Grimm <jgrimm@us.ibm.com>
38 * La Monte H.P. Yarroll <piggy@acm.org> 35 * La Monte H.P. Yarroll <piggy@acm.org>
39 * Karl Knutson <karl@athena.chicago.il.us> 36 * Karl Knutson <karl@athena.chicago.il.us>
40 * Sridhar Samudrala <sri@us.ibm.com> 37 * Sridhar Samudrala <sri@us.ibm.com>
41 *
42 * Any bugs reported given to us we will try to fix... any fixes shared will
43 * be incorporated into the next SCTP release.
44 */ 38 */
45#include <net/sctp/constants.h> 39#include <net/sctp/constants.h>
46 40
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index ca4693b4e09e..27b9f5c90153 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -31,19 +31,13 @@
31 * 31 *
32 * Please send any bug reports or fixes you make to the 32 * Please send any bug reports or fixes you make to the
33 * email address(es): 33 * email address(es):
34 * lksctp developers <lksctp-developers@lists.sourceforge.net> 34 * lksctp developers <linux-sctp@vger.kernel.org>
35 *
36 * Or submit a bug report through the following website:
37 * http://www.sf.net/projects/lksctp
38 * 35 *
39 * Written or modified by: 36 * Written or modified by:
40 * Jon Grimm <jgrimm@us.ibm.com> 37 * Jon Grimm <jgrimm@us.ibm.com>
41 * La Monte H.P. Yarroll <piggy@acm.org> 38 * La Monte H.P. Yarroll <piggy@acm.org>
42 * Karl Knutson <karl@athena.chicago.il.us> 39 * Karl Knutson <karl@athena.chicago.il.us>
43 * Sridhar Samudrala <sri@us.ibm.com> 40 * Sridhar Samudrala <sri@us.ibm.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __sctp_ulpevent_h__ 43#ifndef __sctp_ulpevent_h__
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 00e50ba3f24b..b0cf5d54d717 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -30,18 +30,12 @@
30 * 30 *
31 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
32 * email addresses: 32 * email addresses:
33 * lksctp developers <lksctp-developers@lists.sourceforge.net> 33 * lksctp developers <linux-sctp@vger.kernel.org>
34 *
35 * Or submit a bug report through the following website:
36 * http://www.sf.net/projects/lksctp
37 * 34 *
38 * Written or modified by: 35 * Written or modified by:
39 * Jon Grimm <jgrimm@us.ibm.com> 36 * Jon Grimm <jgrimm@us.ibm.com>
40 * La Monte H.P. Yarroll <piggy@acm.org> 37 * La Monte H.P. Yarroll <piggy@acm.org>
41 * Sridhar Samudrala <sri@us.ibm.com> 38 * Sridhar Samudrala <sri@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_ulpqueue_h__ 41#ifndef __sctp_ulpqueue_h__
diff --git a/include/net/sock.h b/include/net/sock.h
index 31d5cfbb51ec..6ba2e7b0e2b1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -232,6 +232,7 @@ struct cg_proto;
232 * @sk_napi_id: id of the last napi context to receive data for sk 232 * @sk_napi_id: id of the last napi context to receive data for sk
233 * @sk_ll_usec: usecs to busypoll when there is no data 233 * @sk_ll_usec: usecs to busypoll when there is no data
234 * @sk_allocation: allocation mode 234 * @sk_allocation: allocation mode
235 * @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler)
235 * @sk_sndbuf: size of send buffer in bytes 236 * @sk_sndbuf: size of send buffer in bytes
236 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 237 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
237 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 238 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
@@ -361,6 +362,7 @@ struct sock {
361 kmemcheck_bitfield_end(flags); 362 kmemcheck_bitfield_end(flags);
362 int sk_wmem_queued; 363 int sk_wmem_queued;
363 gfp_t sk_allocation; 364 gfp_t sk_allocation;
365 u32 sk_pacing_rate; /* bytes per second */
364 netdev_features_t sk_route_caps; 366 netdev_features_t sk_route_caps;
365 netdev_features_t sk_route_nocaps; 367 netdev_features_t sk_route_nocaps;
366 int sk_gso_type; 368 int sk_gso_type;
@@ -746,11 +748,6 @@ static inline int sk_stream_wspace(const struct sock *sk)
746 748
747extern void sk_stream_write_space(struct sock *sk); 749extern void sk_stream_write_space(struct sock *sk);
748 750
749static inline bool sk_stream_memory_free(const struct sock *sk)
750{
751 return sk->sk_wmem_queued < sk->sk_sndbuf;
752}
753
754/* OOB backlog add */ 751/* OOB backlog add */
755static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) 752static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
756{ 753{
@@ -950,6 +947,7 @@ struct proto {
950 unsigned int inuse_idx; 947 unsigned int inuse_idx;
951#endif 948#endif
952 949
950 bool (*stream_memory_free)(const struct sock *sk);
953 /* Memory pressure */ 951 /* Memory pressure */
954 void (*enter_memory_pressure)(struct sock *sk); 952 void (*enter_memory_pressure)(struct sock *sk);
955 atomic_long_t *memory_allocated; /* Current allocated memory. */ 953 atomic_long_t *memory_allocated; /* Current allocated memory. */
@@ -1088,6 +1086,21 @@ static inline struct cg_proto *parent_cg_proto(struct proto *proto,
1088} 1086}
1089#endif 1087#endif
1090 1088
1089static inline bool sk_stream_memory_free(const struct sock *sk)
1090{
1091 if (sk->sk_wmem_queued >= sk->sk_sndbuf)
1092 return false;
1093
1094 return sk->sk_prot->stream_memory_free ?
1095 sk->sk_prot->stream_memory_free(sk) : true;
1096}
1097
1098static inline bool sk_stream_is_writeable(const struct sock *sk)
1099{
1100 return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) &&
1101 sk_stream_memory_free(sk);
1102}
1103
1091 1104
1092static inline bool sk_has_memory_pressure(const struct sock *sk) 1105static inline bool sk_has_memory_pressure(const struct sock *sk)
1093{ 1106{
@@ -1509,6 +1522,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk,
1509 unsigned long size, int force, 1522 unsigned long size, int force,
1510 gfp_t priority); 1523 gfp_t priority);
1511extern void sock_wfree(struct sk_buff *skb); 1524extern void sock_wfree(struct sk_buff *skb);
1525extern void skb_orphan_partial(struct sk_buff *skb);
1512extern void sock_rfree(struct sk_buff *skb); 1526extern void sock_rfree(struct sk_buff *skb);
1513extern void sock_edemux(struct sk_buff *skb); 1527extern void sock_edemux(struct sk_buff *skb);
1514 1528
@@ -1527,7 +1541,8 @@ extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
1527 unsigned long header_len, 1541 unsigned long header_len,
1528 unsigned long data_len, 1542 unsigned long data_len,
1529 int noblock, 1543 int noblock,
1530 int *errcode); 1544 int *errcode,
1545 int max_page_order);
1531extern void *sock_kmalloc(struct sock *sk, int size, 1546extern void *sock_kmalloc(struct sock *sk, int size,
1532 gfp_t priority); 1547 gfp_t priority);
1533extern void sock_kfree_s(struct sock *sk, void *mem, int size); 1548extern void sock_kfree_s(struct sock *sk, void *mem, int size);
@@ -2249,6 +2264,8 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
2249extern void sock_enable_timestamp(struct sock *sk, int flag); 2264extern void sock_enable_timestamp(struct sock *sk, int flag);
2250extern int sock_get_timestamp(struct sock *, struct timeval __user *); 2265extern int sock_get_timestamp(struct sock *, struct timeval __user *);
2251extern int sock_get_timestampns(struct sock *, struct timespec __user *); 2266extern int sock_get_timestampns(struct sock *, struct timespec __user *);
2267extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
2268 int level, int type);
2252 2269
2253/* 2270/*
2254 * Enable debug/info messages 2271 * Enable debug/info messages
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d1980054ec75..b1aa324c5e65 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -192,10 +192,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
192#define TCPOLEN_TIMESTAMP 10 192#define TCPOLEN_TIMESTAMP 10
193#define TCPOLEN_MD5SIG 18 193#define TCPOLEN_MD5SIG 18
194#define TCPOLEN_EXP_FASTOPEN_BASE 4 194#define TCPOLEN_EXP_FASTOPEN_BASE 4
195#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
196#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
197#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
198#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
199 195
200/* But this is what stacks really send out. */ 196/* But this is what stacks really send out. */
201#define TCPOLEN_TSTAMP_ALIGNED 12 197#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -284,6 +280,8 @@ extern int sysctl_tcp_thin_dupack;
284extern int sysctl_tcp_early_retrans; 280extern int sysctl_tcp_early_retrans;
285extern int sysctl_tcp_limit_output_bytes; 281extern int sysctl_tcp_limit_output_bytes;
286extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs;
287 285
288extern atomic_long_t tcp_memory_allocated; 286extern atomic_long_t tcp_memory_allocated;
289extern struct percpu_counter tcp_sockets_allocated; 287extern struct percpu_counter tcp_sockets_allocated;
@@ -373,8 +371,8 @@ extern void tcp_delack_timer_handler(struct sock *sk);
373extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 371extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
374extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 372extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
375 const struct tcphdr *th, unsigned int len); 373 const struct tcphdr *th, unsigned int len);
376extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 374extern void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
377 const struct tcphdr *th, unsigned int len); 375 const struct tcphdr *th, unsigned int len);
378extern void tcp_rcv_space_adjust(struct sock *sk); 376extern void tcp_rcv_space_adjust(struct sock *sk);
379extern void tcp_cleanup_rbuf(struct sock *sk, int copied); 377extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
380extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); 378extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
@@ -479,9 +477,13 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
479 477
480/* From syncookies.c */ 478/* From syncookies.c */
481extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 479extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
480extern int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
481 u32 cookie);
482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
483 struct ip_options *opt); 483 struct ip_options *opt);
484#ifdef CONFIG_SYN_COOKIES 484#ifdef CONFIG_SYN_COOKIES
485extern u32 __cookie_v4_init_sequence(const struct iphdr *iph,
486 const struct tcphdr *th, u16 *mssp);
485extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 487extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
486 __u16 *mss); 488 __u16 *mss);
487#else 489#else
@@ -498,8 +500,12 @@ extern bool cookie_check_timestamp(struct tcp_options_received *opt,
498 struct net *net, bool *ecn_ok); 500 struct net *net, bool *ecn_ok);
499 501
500/* From net/ipv6/syncookies.c */ 502/* From net/ipv6/syncookies.c */
503extern int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th,
504 u32 cookie);
501extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 505extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
502#ifdef CONFIG_SYN_COOKIES 506#ifdef CONFIG_SYN_COOKIES
507extern u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph,
508 const struct tcphdr *th, u16 *mssp);
503extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, 509extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
504 __u16 *mss); 510 __u16 *mss);
505#else 511#else
@@ -591,7 +597,6 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
591extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 597extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
592extern int tcp_mss_to_mtu(struct sock *sk, int mss); 598extern int tcp_mss_to_mtu(struct sock *sk, int mss);
593extern void tcp_mtup_init(struct sock *sk); 599extern void tcp_mtup_init(struct sock *sk);
594extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
595extern void tcp_init_buffer_space(struct sock *sk); 600extern void tcp_init_buffer_space(struct sock *sk);
596 601
597static inline void tcp_bound_rto(const struct sock *sk) 602static inline void tcp_bound_rto(const struct sock *sk)
@@ -1094,15 +1099,6 @@ static inline void tcp_openreq_init(struct request_sock *req,
1094 ireq->loc_port = tcp_hdr(skb)->dest; 1099 ireq->loc_port = tcp_hdr(skb)->dest;
1095} 1100}
1096 1101
1097/* Compute time elapsed between SYNACK and the ACK completing 3WHS */
1098static inline void tcp_synack_rtt_meas(struct sock *sk,
1099 struct request_sock *req)
1100{
1101 if (tcp_rsk(req)->snt_synack)
1102 tcp_valid_rtt_meas(sk,
1103 tcp_time_stamp - tcp_rsk(req)->snt_synack);
1104}
1105
1106extern void tcp_enter_memory_pressure(struct sock *sk); 1102extern void tcp_enter_memory_pressure(struct sock *sk);
1107 1103
1108static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1104static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1313,7 +1309,8 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1313 1309
1314extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1310extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1315int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1311int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1316void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc); 1312extern void tcp_fastopen_cookie_gen(__be32 src, __be32 dst,
1313 struct tcp_fastopen_cookie *foc);
1317 1314
1318#define TCP_FASTOPEN_KEY_LENGTH 16 1315#define TCP_FASTOPEN_KEY_LENGTH 16
1319 1316
@@ -1549,6 +1546,19 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1549extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, 1546extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1550 __be32 daddr); 1547 __be32 daddr);
1551 1548
1549static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
1550{
1551 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat;
1552}
1553
1554static inline bool tcp_stream_memory_free(const struct sock *sk)
1555{
1556 const struct tcp_sock *tp = tcp_sk(sk);
1557 u32 notsent_bytes = tp->write_seq - tp->snd_nxt;
1558
1559 return notsent_bytes < tcp_notsent_lowat(tp);
1560}
1561
1552#ifdef CONFIG_PROC_FS 1562#ifdef CONFIG_PROC_FS
1553extern int tcp4_proc_init(void); 1563extern int tcp4_proc_init(void);
1554extern void tcp4_proc_exit(void); 1564extern void tcp4_proc_exit(void);
diff --git a/include/net/udp.h b/include/net/udp.h
index 74c10ec5e74f..ef2e0b7843a0 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -183,6 +183,7 @@ extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk); 184extern int udp_push_pending_frames(struct sock *sk);
185extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
186extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
186extern int udp_rcv(struct sk_buff *skb); 187extern int udp_rcv(struct sk_buff *skb);
187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 188extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
188extern int udp_disconnect(struct sock *sk, int flags); 189extern int udp_disconnect(struct sock *sk, int flags);
diff --git a/include/net/vsock_addr.h b/include/net/vsock_addr.h
new file mode 100644
index 000000000000..9ccd5316eac0
--- /dev/null
+++ b/include/net/vsock_addr.h
@@ -0,0 +1,30 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _VSOCK_ADDR_H_
17#define _VSOCK_ADDR_H_
18
19#include <linux/vm_sockets.h>
20
21void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port);
22int vsock_addr_validate(const struct sockaddr_vm *addr);
23bool vsock_addr_bound(const struct sockaddr_vm *addr);
24void vsock_addr_unbind(struct sockaddr_vm *addr);
25bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
26 const struct sockaddr_vm *other);
27int vsock_addr_cast(const struct sockaddr *addr, size_t len,
28 struct sockaddr_vm **out_addr);
29
30#endif
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
new file mode 100644
index 000000000000..2d64d3cd4999
--- /dev/null
+++ b/include/net/vxlan.h
@@ -0,0 +1,40 @@
1#ifndef __NET_VXLAN_H
2#define __NET_VXLAN_H 1
3
4#include <linux/skbuff.h>
5#include <linux/netdevice.h>
6#include <linux/udp.h>
7
8#define VNI_HASH_BITS 10
9#define VNI_HASH_SIZE (1<<VNI_HASH_BITS)
10
11struct vxlan_sock;
12typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key);
13
14/* per UDP socket information */
15struct vxlan_sock {
16 struct hlist_node hlist;
17 vxlan_rcv_t *rcv;
18 void *data;
19 struct work_struct del_work;
20 struct socket *sock;
21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt;
24};
25
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
27 vxlan_rcv_t *rcv, void *data,
28 bool no_share, bool ipv6);
29
30void vxlan_sock_release(struct vxlan_sock *vs);
31
32int vxlan_xmit_skb(struct vxlan_sock *vs,
33 struct rtable *rt, struct sk_buff *skb,
34 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
35 __be16 src_port, __be16 dst_port, __be32 vni);
36
37__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
38
39void vxlan_get_rx_port(struct net_device *netdev);
40#endif
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e823786e7c66..e253bf0cc7ef 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1554,7 +1554,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32
1554int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1554int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1555u32 xfrm_get_acqseq(void); 1555u32 xfrm_get_acqseq(void);
1556extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1556extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1557struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark, 1557struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1558 u8 mode, u32 reqid, u8 proto, 1558 u8 mode, u32 reqid, u8 proto,
1559 const xfrm_address_t *daddr, 1559 const xfrm_address_t *daddr,
1560 const xfrm_address_t *saddr, int create, 1560 const xfrm_address_t *saddr, int create,